1 | C AGRIF (Adaptive Grid Refinement In Fortran) |
---|
2 | C |
---|
3 | C Copyright (C) 2003 Laurent Debreu (Laurent.Debreu@imag.fr) |
---|
4 | C Christophe Vouland (Christophe.Vouland@imag.fr) |
---|
5 | C |
---|
6 | C This program is free software; you can redistribute it and/or modify |
---|
7 | C it under the terms of the GNU General Public License as published by |
---|
8 | C the Free Software Foundation; either version 2 of the License, or |
---|
9 | C (at your option) any later version. |
---|
10 | C |
---|
11 | C This program is distributed in the hope that it will be useful, |
---|
12 | C but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | C GNU General Public License for more details. |
---|
15 | C |
---|
16 | C You should have received a copy of the GNU General Public License |
---|
17 | C along with this program; if not, write to the Free Software |
---|
18 | C Foundation, Inc., 59 Temple Place- Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | C |
---|
20 | C |
---|
21 | C |
---|
22 | CCC Module Agrif_Init |
---|
23 | C |
---|
24 | Module Agrif_Init |
---|
25 | C |
---|
26 | CCC Description: |
---|
27 | CCC Several operations on the variables of the current grid (creation, |
---|
28 | CCC instanciation, ...) used during the creation of the grid hierarchy and |
---|
29 | CCC during the time integration. |
---|
30 | C |
---|
31 | C Modules used: |
---|
32 | C |
---|
33 | Use Agrif_Types |
---|
34 | Use Agrif_link |
---|
35 | C |
---|
36 | IMPLICIT NONE |
---|
37 | C |
---|
38 | Contains |
---|
39 | C Defininition of the procedures contained in this module |
---|
40 | C |
---|
41 | C ************************************************************************** |
---|
42 | CCC Subroutine Agrif_Allocation |
---|
43 | C ************************************************************************** |
---|
44 | C |
---|
45 | Subroutine Agrif_Allocation(Agrif_Gr) |
---|
46 | C |
---|
47 | CCC Description: |
---|
48 | CCC Subroutine to allocate the arrays containing the values of the variables |
---|
49 | CCC of the current grd. |
---|
50 | C |
---|
51 | CC Method: |
---|
52 | CC Use of the allocate function. |
---|
53 | C |
---|
54 | C Declarations: |
---|
55 | C |
---|
56 | C Pointer argument: |
---|
57 | TYPE(AGRIF_grid), Pointer :: Agrif_Gr ! Pointer on the current grid |
---|
58 | C |
---|
59 | C Allocation of the arrays of the variables |
---|
60 | C We cut this in several files to avoid long compilation timings |
---|
61 | C |
---|
62 | Call Agrif_Allocationcalls(Agrif_Gr) |
---|
63 | C |
---|
64 | if ( Agrif_USE_ONLY_FIXED_GRIDS .EQ. 0 ) then |
---|
65 | C |
---|
66 | if ( Agrif_Probdim .EQ. 1 ) |
---|
67 | & Allocate(Agrif_Gr%tabpoint1D(Agrif_Gr%nb(1)+1)) |
---|
68 | if ( Agrif_Probdim .EQ. 2 ) |
---|
69 | & Allocate(Agrif_Gr%tabpoint2D(Agrif_Gr%nb(1)+1, |
---|
70 | & Agrif_Gr%nb(2)+1)) |
---|
71 | if ( Agrif_Probdim .EQ. 3 ) |
---|
72 | & Allocate(Agrif_Gr%tabpoint3D(Agrif_Gr%nb(1)+1, |
---|
73 | & Agrif_Gr%nb(2)+1,Agrif_Gr%nb(3)+1)) |
---|
74 | C |
---|
75 | endif |
---|
76 | C |
---|
77 | End Subroutine Agrif_Allocation |
---|
78 | C |
---|
79 | C ************************************************************************** |
---|
80 | CCC Subroutine Agrif_Instance |
---|
81 | C ************************************************************************** |
---|
82 | C |
---|
83 | Subroutine Agrif_Instance(Agrif_Gr) |
---|
84 | C |
---|
85 | CCC Description: |
---|
86 | CCC Subroutine to do an instance of the common variables to the variables of |
---|
87 | CCC the current grid. |
---|
88 | C |
---|
89 | CC Method: |
---|
90 | CC Pointing the common variables on these of the current grid. |
---|
91 | C |
---|
92 | C Declarations: |
---|
93 | C |
---|
94 | |
---|
95 | C |
---|
96 | C |
---|
97 | |
---|
98 | C |
---|
99 | C Pointer argument: |
---|
100 | Type(Agrif_Grid), Pointer :: Agrif_Gr ! Pointer on the current grid |
---|
101 | C |
---|
102 | C |
---|
103 | Agrif_Curgrid => Agrif_Gr |
---|
104 | Agrif_tabvars => Agrif_Curgrid % tabvars |
---|
105 | C |
---|
106 | Call Agrif_Get_numberofcells(Agrif_Gr) |
---|
107 | C |
---|
108 | C |
---|
109 | C Calculation of isf,jsf,nzsf and of the index of the output file |
---|
110 | Call Agrif_InitWorkSpace() |
---|
111 | C |
---|
112 | C |
---|
113 | End Subroutine Agrif_Instance |
---|
114 | C |
---|
115 | C |
---|
116 | C ************************************************************************** |
---|
117 | CCC Subroutine Agrif_initialisations |
---|
118 | C ************************************************************************** |
---|
119 | Subroutine Agrif_initialisations(Agrif_Gr) |
---|
120 | C |
---|
121 | CCC Description: |
---|
122 | C |
---|
123 | CC Method: |
---|
124 | C |
---|
125 | C Declarations: |
---|
126 | C |
---|
127 | INTEGER :: i |
---|
128 | C |
---|
129 | C Pointer argument: |
---|
130 | Type(Agrif_Grid), Pointer :: Agrif_Gr |
---|
131 | |
---|
132 | C |
---|
133 | do i = 1 , Agrif_NbVariables |
---|
134 | C |
---|
135 | Agrif_Gr % tabvars(i) % var % nbdim = 0 |
---|
136 | C |
---|
137 | if (associated(Agrif_Gr%tabvars(i)%var%array1)) then |
---|
138 | Agrif_Gr % tabvars(i) % var % nbdim = 1 |
---|
139 | Agrif_Gr % tabvars(i) % var % lb(1:1) = |
---|
140 | & lbound(Agrif_Gr%tabvars(i)%var%array1) |
---|
141 | Agrif_Gr % tabvars(i) % var % ub(1:1) = |
---|
142 | & ubound(Agrif_Gr%tabvars(i)%var%array1) |
---|
143 | endif |
---|
144 | if (associated(Agrif_Gr%tabvars(i)%var%array2)) then |
---|
145 | Agrif_Gr % tabvars(i) % var % nbdim = 2 |
---|
146 | Agrif_Gr % tabvars(i) % var % lb(1:2) = |
---|
147 | & lbound(Agrif_Gr%tabvars(i)%var%array2) |
---|
148 | Agrif_Gr % tabvars(i) % var % ub(1:2) = |
---|
149 | & ubound(Agrif_Gr%tabvars(i)%var%array2) |
---|
150 | endif |
---|
151 | if (associated(Agrif_Gr%tabvars(i)%var%array3)) then |
---|
152 | Agrif_Gr % tabvars(i) % var % nbdim = 3 |
---|
153 | Agrif_Gr % tabvars(i) % var % lb(1:3) = |
---|
154 | & lbound(Agrif_Gr%tabvars(i)%var%array3) |
---|
155 | Agrif_Gr % tabvars(i) % var % ub(1:3) = |
---|
156 | & ubound(Agrif_Gr%tabvars(i)%var%array3) |
---|
157 | endif |
---|
158 | if (associated(Agrif_Gr%tabvars(i)%var%array4)) then |
---|
159 | Agrif_Gr % tabvars(i) % var % nbdim = 4 |
---|
160 | Agrif_Gr % tabvars(i) % var % lb(1:4) = |
---|
161 | & lbound(Agrif_Gr%tabvars(i)%var%array4) |
---|
162 | Agrif_Gr % tabvars(i) % var % ub(1:4) = |
---|
163 | & ubound(Agrif_Gr%tabvars(i)%var%array4) |
---|
164 | endif |
---|
165 | if (associated(Agrif_Gr%tabvars(i)%var%array5)) then |
---|
166 | Agrif_Gr % tabvars(i) % var % nbdim = 5 |
---|
167 | Agrif_Gr % tabvars(i) % var % lb(1:5) = |
---|
168 | & lbound(Agrif_Gr%tabvars(i)%var%array5) |
---|
169 | Agrif_Gr % tabvars(i) % var % ub(1:5) = |
---|
170 | & ubound(Agrif_Gr%tabvars(i)%var%array5) |
---|
171 | endif |
---|
172 | if (associated(Agrif_Gr%tabvars(i)%var%array6)) then |
---|
173 | Agrif_Gr % tabvars(i) % var % nbdim = 6 |
---|
174 | Agrif_Gr % tabvars(i) % var % lb(1:6) = |
---|
175 | & lbound(Agrif_Gr%tabvars(i)%var%array6) |
---|
176 | Agrif_Gr % tabvars(i) % var % ub(1:6) = |
---|
177 | & ubound(Agrif_Gr%tabvars(i)%var%array6) |
---|
178 | endif |
---|
179 | C |
---|
180 | if (associated(Agrif_Gr%tabvars(i)%var%darray1)) then |
---|
181 | Agrif_Gr % tabvars(i) % var % nbdim = 1 |
---|
182 | endif |
---|
183 | if (associated(Agrif_Gr%tabvars(i)%var%darray2)) then |
---|
184 | Agrif_Gr % tabvars(i) % var % nbdim = 2 |
---|
185 | endif |
---|
186 | if (associated(Agrif_Gr%tabvars(i)%var%darray3)) then |
---|
187 | Agrif_Gr % tabvars(i) % var % nbdim = 3 |
---|
188 | endif |
---|
189 | if (associated(Agrif_Gr%tabvars(i)%var%darray4)) then |
---|
190 | Agrif_Gr % tabvars(i) % var % nbdim = 4 |
---|
191 | endif |
---|
192 | if (associated(Agrif_Gr%tabvars(i)%var%darray5)) then |
---|
193 | Agrif_Gr % tabvars(i) % var % nbdim = 5 |
---|
194 | endif |
---|
195 | if (associated(Agrif_Gr%tabvars(i)%var%darray6)) then |
---|
196 | Agrif_Gr % tabvars(i) % var % nbdim = 6 |
---|
197 | endif |
---|
198 | C |
---|
199 | if (associated(Agrif_Gr%tabvars(i)%var%larray1)) then |
---|
200 | Agrif_Gr % tabvars(i) % var % nbdim = 1 |
---|
201 | endif |
---|
202 | if (associated(Agrif_Gr%tabvars(i)%var%larray2)) then |
---|
203 | Agrif_Gr % tabvars(i) % var % nbdim = 2 |
---|
204 | endif |
---|
205 | if (associated(Agrif_Gr%tabvars(i)%var%larray3)) then |
---|
206 | Agrif_Gr % tabvars(i) % var % nbdim = 3 |
---|
207 | endif |
---|
208 | if (associated(Agrif_Gr%tabvars(i)%var%larray4)) then |
---|
209 | Agrif_Gr % tabvars(i) % var % nbdim = 4 |
---|
210 | endif |
---|
211 | if (associated(Agrif_Gr%tabvars(i)%var%larray5)) then |
---|
212 | Agrif_Gr % tabvars(i) % var % nbdim = 5 |
---|
213 | endif |
---|
214 | if (associated(Agrif_Gr%tabvars(i)%var%larray6)) then |
---|
215 | Agrif_Gr % tabvars(i) % var % nbdim = 6 |
---|
216 | endif |
---|
217 | C |
---|
218 | if (associated(Agrif_Gr%tabvars(i)%var%iarray1)) then |
---|
219 | Agrif_Gr % tabvars(i) % var % nbdim = 1 |
---|
220 | endif |
---|
221 | if (associated(Agrif_Gr%tabvars(i)%var%iarray2)) then |
---|
222 | Agrif_Gr % tabvars(i) % var % nbdim = 2 |
---|
223 | endif |
---|
224 | if (associated(Agrif_Gr%tabvars(i)%var%iarray3)) then |
---|
225 | Agrif_Gr % tabvars(i) % var % nbdim = 3 |
---|
226 | endif |
---|
227 | if (associated(Agrif_Gr%tabvars(i)%var%iarray4)) then |
---|
228 | Agrif_Gr % tabvars(i) % var % nbdim = 4 |
---|
229 | endif |
---|
230 | if (associated(Agrif_Gr%tabvars(i)%var%iarray5)) then |
---|
231 | Agrif_Gr % tabvars(i) % var % nbdim = 5 |
---|
232 | endif |
---|
233 | if (associated(Agrif_Gr%tabvars(i)%var%iarray6)) then |
---|
234 | Agrif_Gr % tabvars(i) % var % nbdim = 6 |
---|
235 | endif |
---|
236 | C |
---|
237 | if (associated(Agrif_Gr%tabvars(i)%var%carray1)) then |
---|
238 | Agrif_Gr % tabvars(i) % var % nbdim = 1 |
---|
239 | endif |
---|
240 | if (associated(Agrif_Gr%tabvars(i)%var%carray2)) then |
---|
241 | Agrif_Gr % tabvars(i) % var % nbdim = 2 |
---|
242 | endif |
---|
243 | C |
---|
244 | enddo |
---|
245 | C |
---|
246 | Return |
---|
247 | C |
---|
248 | C |
---|
249 | End Subroutine Agrif_initialisations |
---|
250 | C |
---|
251 | C |
---|
252 | End Module AGRIF_Init |
---|