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: latitude,longitude |
---|
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 | chimpas = tab_cntrl(3) |
---|
58 | lsinit = tab_cntrl(17) |
---|
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 | ! et verifier que lsinit est proche de 0. |
---|
65 | IF (raz_date.eq.1) THEN |
---|
66 | itau_phy=0 |
---|
67 | if ((lsinit.gt.3.).and.(lsinit.lt.357.)) then |
---|
68 | PRINT*, 'phyetat0: raz_date=1 and ls different from 0.' |
---|
69 | PRINT*, 'When raz_date=1, we reset the initial date' |
---|
70 | PRINT*, 'to spring equinox, Ls=0., so the start files' |
---|
71 | PRINT*, 'should be within a couple of degrees from Ls=0.' |
---|
72 | PRINT*, 'or the circulation will be too far from equilibrium' |
---|
73 | CALL abort |
---|
74 | endif |
---|
75 | ENDIF |
---|
76 | |
---|
77 | ! read latitudes |
---|
78 | call get_field("latitude",latitude,found) |
---|
79 | IF (.not.found) THEN |
---|
80 | PRINT*, 'phyetat0: Le champ <latitude> est absent' |
---|
81 | CALL abort |
---|
82 | ENDIF |
---|
83 | |
---|
84 | ! read longitudes |
---|
85 | call get_field("longitude",longitude,found) |
---|
86 | IF (.not.found) THEN |
---|
87 | PRINT*, 'phyetat0: Le champ <longitude> est absent' |
---|
88 | CALL abort |
---|
89 | ENDIF |
---|
90 | |
---|
91 | ! read in other variables here ... |
---|
92 | |
---|
93 | ! Lecture des temperatures du sol: |
---|
94 | |
---|
95 | CALL get_field("TS",ftsol(:),found) |
---|
96 | IF (.not.found) THEN |
---|
97 | PRINT*, 'phyetat0: Le champ <TS> est absent' |
---|
98 | PRINT*, "phyetat0: Lecture echouee pour <TS>" |
---|
99 | CALL abort |
---|
100 | ELSE |
---|
101 | PRINT*, 'phyetat0: Le champ <TS> est present' |
---|
102 | xmin = 1.0E+20 |
---|
103 | xmax = -1.0E+20 |
---|
104 | DO i = 1, klon |
---|
105 | xmin = MIN(ftsol(i),xmin) |
---|
106 | xmax = MAX(ftsol(i),xmax) |
---|
107 | ENDDO |
---|
108 | PRINT*,'Temperature du sol <TS>', xmin, xmax |
---|
109 | ENDIF |
---|
110 | |
---|
111 | |
---|
112 | ! Lecture des temperatures du sol profond: |
---|
113 | |
---|
114 | DO isoil=1, nsoilmx |
---|
115 | IF (isoil.GT.99) THEN |
---|
116 | PRINT*, "Trop de couches" |
---|
117 | CALL abort |
---|
118 | ENDIF |
---|
119 | WRITE(str2,'(i2.2)') isoil |
---|
120 | CALL get_field('Tsoil'//str2,ftsoil(:,isoil),found) |
---|
121 | IF (.not.found) THEN |
---|
122 | PRINT*, "phyetat0: Le champ <Tsoil"//str2//"> est absent" |
---|
123 | PRINT*, " Il prend donc la valeur de surface" |
---|
124 | DO i=1, klon |
---|
125 | ftsoil(i,isoil)=ftsol(i) |
---|
126 | ENDDO |
---|
127 | ENDIF |
---|
128 | ENDDO |
---|
129 | |
---|
130 | ! Lecture de albedo au sol: |
---|
131 | |
---|
132 | CALL get_field("ALBE", falbe,found) |
---|
133 | IF (.not.found) THEN |
---|
134 | PRINT*, 'phyetat0: Le champ <ALBE> est absent' |
---|
135 | PRINT*, "phyetat0: Lecture echouee pour <ALBE>" |
---|
136 | CALL abort |
---|
137 | ELSE |
---|
138 | xmin = 1.0E+20 |
---|
139 | xmax = -1.0E+20 |
---|
140 | DO i = 1, klon |
---|
141 | xmin = MIN(falbe(i),xmin) |
---|
142 | xmax = MAX(falbe(i),xmax) |
---|
143 | ENDDO |
---|
144 | PRINT*,'Albedo du sol <ALBE>', xmin, xmax |
---|
145 | ENDIF |
---|
146 | |
---|
147 | ! Lecture rayonnement solaire au sol: |
---|
148 | |
---|
149 | CALL get_field("solsw",solsw,found) |
---|
150 | IF (.not.found) THEN |
---|
151 | PRINT*, 'phyetat0: Le champ <solsw> est absent' |
---|
152 | PRINT*, 'mis a zero' |
---|
153 | solsw = 0. |
---|
154 | ENDIF |
---|
155 | xmin = 1.0E+20 |
---|
156 | xmax = -1.0E+20 |
---|
157 | DO i = 1, klon |
---|
158 | xmin = MIN(solsw(i),xmin) |
---|
159 | xmax = MAX(solsw(i),xmax) |
---|
160 | ENDDO |
---|
161 | PRINT*,'Rayonnement solaire au sol solsw:', xmin, xmax |
---|
162 | |
---|
163 | ! Lecture rayonnement IF au sol: |
---|
164 | |
---|
165 | CALL get_field("sollw",sollw,found) |
---|
166 | IF (.not.found) THEN |
---|
167 | PRINT*, 'phyetat0: Le champ <sollw> est absent' |
---|
168 | PRINT*, 'mis a zero' |
---|
169 | sollw = 0. |
---|
170 | ENDIF |
---|
171 | xmin = 1.0E+20 |
---|
172 | xmax = -1.0E+20 |
---|
173 | DO i = 1, klon |
---|
174 | xmin = MIN(sollw(i),xmin) |
---|
175 | xmax = MAX(sollw(i),xmax) |
---|
176 | ENDDO |
---|
177 | PRINT*,'Rayonnement IF au sol sollw:', xmin, xmax |
---|
178 | |
---|
179 | ! Lecture derive des flux: |
---|
180 | |
---|
181 | CALL get_field("fder",fder,found) |
---|
182 | IF (.not.found) THEN |
---|
183 | PRINT*, 'phyetat0: Le champ <fder> est absent' |
---|
184 | PRINT*, 'mis a zero' |
---|
185 | fder = 0. |
---|
186 | ENDIF |
---|
187 | xmin = 1.0E+20 |
---|
188 | xmax = -1.0E+20 |
---|
189 | DO i = 1, klon |
---|
190 | xmin = MIN(fder(i),xmin) |
---|
191 | xmax = MAX(fder(i),xmax) |
---|
192 | ENDDO |
---|
193 | PRINT*,'Derive des flux fder:', xmin, xmax |
---|
194 | |
---|
195 | ! Lecture du rayonnement net au sol: |
---|
196 | |
---|
197 | CALL get_field("RADS",radsol,found) |
---|
198 | IF (.not.found) THEN |
---|
199 | PRINT*, 'phyetat0: Le champ <RADS> est absent' |
---|
200 | CALL abort |
---|
201 | ENDIF |
---|
202 | xmin = 1.0E+20 |
---|
203 | xmax = -1.0E+20 |
---|
204 | DO i = 1, klon |
---|
205 | xmin = MIN(radsol(i),xmin) |
---|
206 | xmax = MAX(radsol(i),xmax) |
---|
207 | ENDDO |
---|
208 | PRINT*,'Rayonnement net au sol radsol:', xmin, xmax |
---|
209 | |
---|
210 | ! Lecture de l'orographie sous-maille si ok_orodr: |
---|
211 | |
---|
212 | if(ok_orodr) then |
---|
213 | |
---|
214 | CALL get_field("ZMEA",zmea,found) |
---|
215 | IF (.not.found) THEN |
---|
216 | PRINT*, 'phyetat0: Le champ <ZMEA> est absent' |
---|
217 | CALL abort |
---|
218 | ENDIF |
---|
219 | xmin = 1.0E+20 |
---|
220 | xmax = -1.0E+20 |
---|
221 | DO i = 1, klon |
---|
222 | xmin = MIN(zmea(i),xmin) |
---|
223 | xmax = MAX(zmea(i),xmax) |
---|
224 | ENDDO |
---|
225 | PRINT*,'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax |
---|
226 | |
---|
227 | CALL get_field("ZSTD",zstd,found) |
---|
228 | IF (.not.found) THEN |
---|
229 | PRINT*, 'phyetat0: Le champ <ZSTD> est absent' |
---|
230 | CALL abort |
---|
231 | ENDIF |
---|
232 | xmin = 1.0E+20 |
---|
233 | xmax = -1.0E+20 |
---|
234 | DO i = 1, klon |
---|
235 | xmin = MIN(zstd(i),xmin) |
---|
236 | xmax = MAX(zstd(i),xmax) |
---|
237 | ENDDO |
---|
238 | PRINT*,'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax |
---|
239 | |
---|
240 | CALL get_field("ZSIG",zsig,found) |
---|
241 | IF (.not.found) THEN |
---|
242 | PRINT*, 'phyetat0: Le champ <ZSIG> est absent' |
---|
243 | CALL abort |
---|
244 | ENDIF |
---|
245 | xmin = 1.0E+20 |
---|
246 | xmax = -1.0E+20 |
---|
247 | DO i = 1, klon |
---|
248 | xmin = MIN(zsig(i),xmin) |
---|
249 | xmax = MAX(zsig(i),xmax) |
---|
250 | ENDDO |
---|
251 | PRINT*,'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax |
---|
252 | |
---|
253 | CALL get_field("ZGAM",zgam,found) |
---|
254 | IF (.not.found) THEN |
---|
255 | PRINT*, 'phyetat0: Le champ <ZGAM> est absent' |
---|
256 | CALL abort |
---|
257 | ENDIF |
---|
258 | xmin = 1.0E+20 |
---|
259 | xmax = -1.0E+20 |
---|
260 | DO i = 1, klon |
---|
261 | xmin = MIN(zgam(i),xmin) |
---|
262 | xmax = MAX(zgam(i),xmax) |
---|
263 | ENDDO |
---|
264 | PRINT*,'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax |
---|
265 | |
---|
266 | CALL get_field("ZTHE",zthe,found) |
---|
267 | IF (.not.found) THEN |
---|
268 | PRINT*, 'phyetat0: Le champ <ZTHE> est absent' |
---|
269 | CALL abort |
---|
270 | ENDIF |
---|
271 | xmin = 1.0E+20 |
---|
272 | xmax = -1.0E+20 |
---|
273 | DO i = 1, klon |
---|
274 | xmin = MIN(zthe(i),xmin) |
---|
275 | xmax = MAX(zthe(i),xmax) |
---|
276 | ENDDO |
---|
277 | PRINT*,'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax |
---|
278 | |
---|
279 | CALL get_field("ZPIC",zpic,found) |
---|
280 | IF (.not.found) THEN |
---|
281 | PRINT*, 'phyetat0: Le champ <ZPIC> est absent' |
---|
282 | CALL abort |
---|
283 | ENDIF |
---|
284 | xmin = 1.0E+20 |
---|
285 | xmax = -1.0E+20 |
---|
286 | DO i = 1, klon |
---|
287 | xmin = MIN(zpic(i),xmin) |
---|
288 | xmax = MAX(zpic(i),xmax) |
---|
289 | ENDDO |
---|
290 | PRINT*,'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax |
---|
291 | |
---|
292 | CALL get_field("ZVAL",zval,found) |
---|
293 | IF (.not.found) THEN |
---|
294 | PRINT*, 'phyetat0: Le champ <ZVAL> est absent' |
---|
295 | CALL abort |
---|
296 | ENDIF |
---|
297 | xmin = 1.0E+20 |
---|
298 | xmax = -1.0E+20 |
---|
299 | DO i = 1, klon |
---|
300 | xmin = MIN(zval(i),xmin) |
---|
301 | xmax = MAX(zval(i),xmax) |
---|
302 | ENDDO |
---|
303 | PRINT*,'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax |
---|
304 | |
---|
305 | else |
---|
306 | zmea = 0. |
---|
307 | zstd = 0. |
---|
308 | zsig = 0. |
---|
309 | zgam = 0. |
---|
310 | zthe = 0. |
---|
311 | zpic = 0. |
---|
312 | zval = 0. |
---|
313 | |
---|
314 | endif ! fin test sur ok_orodr |
---|
315 | |
---|
316 | ! Par defaut on cree 2 bandes de methane au pole Nord et au pole Sud |
---|
317 | ! (entre 75 et 85 degres de latitude) de 2 metres. |
---|
318 | ! Les poles sont sec ! |
---|
319 | resch4(1) = 0. ! pole nord = 1 point |
---|
320 | DO i=2,klon |
---|
321 | if ((latitude(i).ge.75..and.latitude(i).le.85.).or. & |
---|
322 | (latitude(i).ge.-85.and.latitude(i).le.-75.)) then |
---|
323 | resch4(i) = 2. |
---|
324 | else |
---|
325 | resch4(i) = 0. |
---|
326 | endif |
---|
327 | ENDDO |
---|
328 | resch4(klon) = 0. ! pole sud = 1 point |
---|
329 | |
---|
330 | CALL get_field("RESCH4",resch4,found) |
---|
331 | IF (.not.found) THEN |
---|
332 | PRINT*, "phyetat0: Le champ <RESCH4> est absent" |
---|
333 | PRINT*, "Pas de reservoir de methane mais je continue..." |
---|
334 | PRINT*, "Pour info, je met 2 metres de methane sur 2 bandes" |
---|
335 | PRINT*, "comprises entre 75 et 85 degres de latitude dans " |
---|
336 | PRINT*, "chaque hemisphere." |
---|
337 | ENDIF |
---|
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(latitude,longitude) |
---|
355 | |
---|
356 | end subroutine phyetat0 |
---|