1 | ! |
---|
2 | ! $Id $ |
---|
3 | ! |
---|
4 | subroutine phyetat0(fichnom) |
---|
5 | ! Load initial state for the physics |
---|
6 | ! and do some resulting initializations |
---|
7 | |
---|
8 | USE dimphy |
---|
9 | USE mod_grid_phy_lmdz |
---|
10 | USE mod_phys_lmdz_para |
---|
11 | USE iophy |
---|
12 | USE phys_state_var_mod |
---|
13 | USE iostart |
---|
14 | USE infotrac |
---|
15 | USE comgeomphy, only: rlatd,rlond |
---|
16 | USE control_mod, only: raz_date |
---|
17 | |
---|
18 | implicit none |
---|
19 | !====================================================================== |
---|
20 | ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 |
---|
21 | ! Objet: Lecture de l'etat initial pour la physique |
---|
22 | !====================================================================== |
---|
23 | #include "dimensions.h" |
---|
24 | #include "netcdf.inc" |
---|
25 | #include "dimsoil.h" |
---|
26 | #include "clesphys.h" |
---|
27 | #include "tabcontrol.h" |
---|
28 | #include "temps.h" |
---|
29 | !====================================================================== |
---|
30 | |
---|
31 | character(len=*),intent(in) :: fichnom ! input file name |
---|
32 | REAL :: xmin, xmax |
---|
33 | LOGICAL :: found |
---|
34 | REAL :: tab_cntrl(length) |
---|
35 | integer :: i,isoil |
---|
36 | CHARACTER(len=2) :: str2 |
---|
37 | |
---|
38 | ! les variables globales lues dans le fichier restart |
---|
39 | |
---|
40 | ! open physics initial state file: |
---|
41 | call open_startphy(fichnom) |
---|
42 | |
---|
43 | ! |
---|
44 | ! Lecture des parametres de controle: |
---|
45 | ! |
---|
46 | CALL get_var("controle",tab_cntrl,found) |
---|
47 | IF (.not.found) THEN |
---|
48 | PRINT*, 'phyetat0: Le champ <controle> est absent' |
---|
49 | CALL abort |
---|
50 | ENDIF |
---|
51 | |
---|
52 | DO i = 1, length |
---|
53 | tabcntr0( i ) = tab_cntrl( i ) |
---|
54 | ENDDO |
---|
55 | |
---|
56 | |
---|
57 | dtime = tab_cntrl(1) |
---|
58 | radpas = tab_cntrl(2) |
---|
59 | |
---|
60 | itau_phy = tab_cntrl(15) |
---|
61 | |
---|
62 | ! Attention si raz_date est active : |
---|
63 | ! il faut remettre a zero itau_phy apres phyetat0 ! |
---|
64 | IF (raz_date.eq.1) THEN |
---|
65 | itau_phy=0 |
---|
66 | ENDIF |
---|
67 | |
---|
68 | ! read latitudes |
---|
69 | call get_field("latitude",rlatd,found) |
---|
70 | IF (.not.found) THEN |
---|
71 | PRINT*, 'phyetat0: Le champ <latitude> est absent' |
---|
72 | CALL abort |
---|
73 | ENDIF |
---|
74 | |
---|
75 | ! read longitudes |
---|
76 | call get_field("longitude",rlond,found) |
---|
77 | IF (.not.found) THEN |
---|
78 | PRINT*, 'phyetat0: Le champ <longitude> est absent' |
---|
79 | CALL abort |
---|
80 | ENDIF |
---|
81 | |
---|
82 | ! read in other variables here ... |
---|
83 | |
---|
84 | ! Lecture des temperatures du sol: |
---|
85 | |
---|
86 | CALL get_field("TS",ftsol(:),found) |
---|
87 | IF (.not.found) THEN |
---|
88 | PRINT*, 'phyetat0: Le champ <TS> est absent' |
---|
89 | PRINT*, "phyetat0: Lecture echouee pour <TS>" |
---|
90 | CALL abort |
---|
91 | ELSE |
---|
92 | PRINT*, 'phyetat0: Le champ <TS> est present' |
---|
93 | xmin = 1.0E+20 |
---|
94 | xmax = -1.0E+20 |
---|
95 | DO i = 1, klon |
---|
96 | xmin = MIN(ftsol(i),xmin) |
---|
97 | xmax = MAX(ftsol(i),xmax) |
---|
98 | ENDDO |
---|
99 | PRINT*,'Temperature du sol <TS>', xmin, xmax |
---|
100 | ENDIF |
---|
101 | |
---|
102 | |
---|
103 | ! Lecture des temperatures du sol profond: |
---|
104 | |
---|
105 | DO isoil=1, nsoilmx |
---|
106 | IF (isoil.GT.99) THEN |
---|
107 | PRINT*, "Trop de couches" |
---|
108 | CALL abort |
---|
109 | ENDIF |
---|
110 | WRITE(str2,'(i2.2)') isoil |
---|
111 | CALL get_field('Tsoil'//str2,ftsoil(:,isoil),found) |
---|
112 | IF (.not.found) THEN |
---|
113 | PRINT*, "phyetat0: Le champ <Tsoil"//str2//"> est absent" |
---|
114 | PRINT*, " Il prend donc la valeur de surface" |
---|
115 | DO i=1, klon |
---|
116 | ftsoil(i,isoil)=ftsol(i) |
---|
117 | ENDDO |
---|
118 | ENDIF |
---|
119 | ENDDO |
---|
120 | |
---|
121 | ! Lecture de albedo au sol: |
---|
122 | |
---|
123 | CALL get_field("ALBE", falbe,found) |
---|
124 | IF (.not.found) THEN |
---|
125 | PRINT*, 'phyetat0: Le champ <ALBE> est absent' |
---|
126 | PRINT*, "phyetat0: Lecture echouee pour <ALBE>" |
---|
127 | CALL abort |
---|
128 | ELSE |
---|
129 | xmin = 1.0E+20 |
---|
130 | xmax = -1.0E+20 |
---|
131 | DO i = 1, klon |
---|
132 | xmin = MIN(falbe(i),xmin) |
---|
133 | xmax = MAX(falbe(i),xmax) |
---|
134 | ENDDO |
---|
135 | PRINT*,'Albedo du sol <ALBE>', xmin, xmax |
---|
136 | ENDIF |
---|
137 | |
---|
138 | ! Lecture rayonnement solaire au sol: |
---|
139 | |
---|
140 | CALL get_field("solsw",solsw,found) |
---|
141 | IF (.not.found) THEN |
---|
142 | PRINT*, 'phyetat0: Le champ <solsw> est absent' |
---|
143 | PRINT*, 'mis a zero' |
---|
144 | solsw = 0. |
---|
145 | ENDIF |
---|
146 | xmin = 1.0E+20 |
---|
147 | xmax = -1.0E+20 |
---|
148 | DO i = 1, klon |
---|
149 | xmin = MIN(solsw(i),xmin) |
---|
150 | xmax = MAX(solsw(i),xmax) |
---|
151 | ENDDO |
---|
152 | PRINT*,'Rayonnement solaire au sol solsw:', xmin, xmax |
---|
153 | |
---|
154 | ! Lecture rayonnement IR au sol: |
---|
155 | |
---|
156 | CALL get_field("sollw",sollw,found) |
---|
157 | IF (.not.found) THEN |
---|
158 | PRINT*, 'phyetat0: Le champ <sollw> est absent' |
---|
159 | PRINT*, 'mis a zero' |
---|
160 | sollw = 0. |
---|
161 | ENDIF |
---|
162 | xmin = 1.0E+20 |
---|
163 | xmax = -1.0E+20 |
---|
164 | DO i = 1, klon |
---|
165 | xmin = MIN(sollw(i),xmin) |
---|
166 | xmax = MAX(sollw(i),xmax) |
---|
167 | ENDDO |
---|
168 | PRINT*,'Rayonnement IR au sol sollw:', xmin, xmax |
---|
169 | |
---|
170 | ! Lecture derive des flux: |
---|
171 | |
---|
172 | CALL get_field("fder",fder,found) |
---|
173 | IF (.not.found) THEN |
---|
174 | PRINT*, 'phyetat0: Le champ <fder> est absent' |
---|
175 | PRINT*, 'mis a zero' |
---|
176 | fder = 0. |
---|
177 | ENDIF |
---|
178 | xmin = 1.0E+20 |
---|
179 | xmax = -1.0E+20 |
---|
180 | DO i = 1, klon |
---|
181 | xmin = MIN(fder(i),xmin) |
---|
182 | xmax = MAX(fder(i),xmax) |
---|
183 | ENDDO |
---|
184 | PRINT*,'Derive des flux fder:', xmin, xmax |
---|
185 | |
---|
186 | ! Lecture derive flux IR: |
---|
187 | |
---|
188 | CALL get_field("dlw",dlw,found) |
---|
189 | IF (.not.found) THEN |
---|
190 | PRINT*, 'phyetat0: Le champ <dlw> est absent' |
---|
191 | PRINT*, 'mis a zero' |
---|
192 | dlw = 0. |
---|
193 | ENDIF |
---|
194 | xmin = 1.0E+20 |
---|
195 | xmax = -1.0E+20 |
---|
196 | DO i = 1, klon |
---|
197 | xmin = MIN(dlw(i),xmin) |
---|
198 | xmax = MAX(dlw(i),xmax) |
---|
199 | ENDDO |
---|
200 | PRINT*,'Derive flux IR dlw:', xmin, xmax |
---|
201 | |
---|
202 | ! Lecture rayonnement IR vers le bas au sol: |
---|
203 | |
---|
204 | CALL get_field("sollwdown",sollwdown,found) |
---|
205 | IF (.not.found) THEN |
---|
206 | PRINT*, 'phyetat0: Le champ <sollwdown> est absent' |
---|
207 | PRINT*, 'mis a zero' |
---|
208 | sollwdown = 0. |
---|
209 | ENDIF |
---|
210 | xmin = 1.0E+20 |
---|
211 | xmax = -1.0E+20 |
---|
212 | DO i = 1, klon |
---|
213 | xmin = MIN(sollwdown(i),xmin) |
---|
214 | xmax = MAX(sollwdown(i),xmax) |
---|
215 | ENDDO |
---|
216 | PRINT*,'Flux IR vers le bas au sol sollwdown:', xmin, xmax |
---|
217 | |
---|
218 | ! Lecture du rayonnement net au sol: |
---|
219 | |
---|
220 | CALL get_field("RADS",radsol,found) |
---|
221 | IF (.not.found) THEN |
---|
222 | PRINT*, 'phyetat0: Le champ <RADS> est absent' |
---|
223 | CALL abort |
---|
224 | ENDIF |
---|
225 | xmin = 1.0E+20 |
---|
226 | xmax = -1.0E+20 |
---|
227 | DO i = 1, klon |
---|
228 | xmin = MIN(radsol(i),xmin) |
---|
229 | xmax = MAX(radsol(i),xmax) |
---|
230 | ENDDO |
---|
231 | PRINT*,'Rayonnement net au sol radsol:', xmin, xmax |
---|
232 | |
---|
233 | ! Lecture de l'orographie sous-maille si ok_orodr: |
---|
234 | |
---|
235 | if(ok_orodr) then |
---|
236 | |
---|
237 | CALL get_field("ZMEA",zmea,found) |
---|
238 | IF (.not.found) THEN |
---|
239 | PRINT*, 'phyetat0: Le champ <ZMEA> est absent' |
---|
240 | CALL abort |
---|
241 | ENDIF |
---|
242 | xmin = 1.0E+20 |
---|
243 | xmax = -1.0E+20 |
---|
244 | DO i = 1, klon |
---|
245 | xmin = MIN(zmea(i),xmin) |
---|
246 | xmax = MAX(zmea(i),xmax) |
---|
247 | ENDDO |
---|
248 | PRINT*,'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax |
---|
249 | |
---|
250 | CALL get_field("ZSTD",zstd,found) |
---|
251 | IF (.not.found) THEN |
---|
252 | PRINT*, 'phyetat0: Le champ <ZSTD> est absent' |
---|
253 | CALL abort |
---|
254 | ENDIF |
---|
255 | xmin = 1.0E+20 |
---|
256 | xmax = -1.0E+20 |
---|
257 | DO i = 1, klon |
---|
258 | xmin = MIN(zstd(i),xmin) |
---|
259 | xmax = MAX(zstd(i),xmax) |
---|
260 | ENDDO |
---|
261 | PRINT*,'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax |
---|
262 | |
---|
263 | CALL get_field("ZSIG",zsig,found) |
---|
264 | IF (.not.found) THEN |
---|
265 | PRINT*, 'phyetat0: Le champ <ZSIG> est absent' |
---|
266 | CALL abort |
---|
267 | ENDIF |
---|
268 | xmin = 1.0E+20 |
---|
269 | xmax = -1.0E+20 |
---|
270 | DO i = 1, klon |
---|
271 | xmin = MIN(zsig(i),xmin) |
---|
272 | xmax = MAX(zsig(i),xmax) |
---|
273 | ENDDO |
---|
274 | PRINT*,'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax |
---|
275 | |
---|
276 | CALL get_field("ZGAM",zgam,found) |
---|
277 | IF (.not.found) THEN |
---|
278 | PRINT*, 'phyetat0: Le champ <ZGAM> est absent' |
---|
279 | CALL abort |
---|
280 | ENDIF |
---|
281 | xmin = 1.0E+20 |
---|
282 | xmax = -1.0E+20 |
---|
283 | DO i = 1, klon |
---|
284 | xmin = MIN(zgam(i),xmin) |
---|
285 | xmax = MAX(zgam(i),xmax) |
---|
286 | ENDDO |
---|
287 | PRINT*,'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax |
---|
288 | |
---|
289 | CALL get_field("ZTHE",zthe,found) |
---|
290 | IF (.not.found) THEN |
---|
291 | PRINT*, 'phyetat0: Le champ <ZTHE> est absent' |
---|
292 | CALL abort |
---|
293 | ENDIF |
---|
294 | xmin = 1.0E+20 |
---|
295 | xmax = -1.0E+20 |
---|
296 | DO i = 1, klon |
---|
297 | xmin = MIN(zthe(i),xmin) |
---|
298 | xmax = MAX(zthe(i),xmax) |
---|
299 | ENDDO |
---|
300 | PRINT*,'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax |
---|
301 | |
---|
302 | CALL get_field("ZPIC",zpic,found) |
---|
303 | IF (.not.found) THEN |
---|
304 | PRINT*, 'phyetat0: Le champ <ZPIC> est absent' |
---|
305 | CALL abort |
---|
306 | ENDIF |
---|
307 | xmin = 1.0E+20 |
---|
308 | xmax = -1.0E+20 |
---|
309 | DO i = 1, klon |
---|
310 | xmin = MIN(zpic(i),xmin) |
---|
311 | xmax = MAX(zpic(i),xmax) |
---|
312 | ENDDO |
---|
313 | PRINT*,'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax |
---|
314 | |
---|
315 | CALL get_field("ZVAL",zval,found) |
---|
316 | IF (.not.found) THEN |
---|
317 | PRINT*, 'phyetat0: Le champ <ZVAL> est absent' |
---|
318 | CALL abort |
---|
319 | ENDIF |
---|
320 | xmin = 1.0E+20 |
---|
321 | xmax = -1.0E+20 |
---|
322 | DO i = 1, klon |
---|
323 | xmin = MIN(zval(i),xmin) |
---|
324 | xmax = MAX(zval(i),xmax) |
---|
325 | ENDDO |
---|
326 | PRINT*,'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax |
---|
327 | |
---|
328 | else |
---|
329 | zmea = 0. |
---|
330 | zstd = 0. |
---|
331 | zsig = 0. |
---|
332 | zgam = 0. |
---|
333 | zthe = 0. |
---|
334 | zpic = 0. |
---|
335 | zval = 0. |
---|
336 | |
---|
337 | endif ! fin test sur ok_orodr |
---|
338 | |
---|
339 | ! Lecture de TANCIEN: |
---|
340 | |
---|
341 | ancien_ok = .TRUE. |
---|
342 | |
---|
343 | CALL get_field("TANCIEN",t_ancien,found) |
---|
344 | IF (.not.found) THEN |
---|
345 | PRINT*, "phyetat0: Le champ <TANCIEN> est absent" |
---|
346 | PRINT*, "Depart legerement fausse. Mais je continue" |
---|
347 | ancien_ok = .FALSE. |
---|
348 | ENDIF |
---|
349 | |
---|
350 | ! close file |
---|
351 | call close_startphy |
---|
352 | |
---|
353 | ! do some more initializations |
---|
354 | call init_iophy_new(rlatd,rlond) |
---|
355 | |
---|
356 | end subroutine phyetat0 |
---|