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