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 IF 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 IF 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 du rayonnement net au sol: |
---|
187 | |
---|
188 | CALL get_field("RADS",radsol,found) |
---|
189 | IF (.not.found) THEN |
---|
190 | PRINT*, 'phyetat0: Le champ <RADS> est absent' |
---|
191 | CALL abort |
---|
192 | ENDIF |
---|
193 | xmin = 1.0E+20 |
---|
194 | xmax = -1.0E+20 |
---|
195 | DO i = 1, klon |
---|
196 | xmin = MIN(radsol(i),xmin) |
---|
197 | xmax = MAX(radsol(i),xmax) |
---|
198 | ENDDO |
---|
199 | PRINT*,'Rayonnement net au sol radsol:', xmin, xmax |
---|
200 | |
---|
201 | ! Lecture de l'orographie sous-maille si ok_orodr: |
---|
202 | |
---|
203 | if(ok_orodr) then |
---|
204 | |
---|
205 | CALL get_field("ZMEA",zmea,found) |
---|
206 | IF (.not.found) THEN |
---|
207 | PRINT*, 'phyetat0: Le champ <ZMEA> est absent' |
---|
208 | CALL abort |
---|
209 | ENDIF |
---|
210 | xmin = 1.0E+20 |
---|
211 | xmax = -1.0E+20 |
---|
212 | DO i = 1, klon |
---|
213 | xmin = MIN(zmea(i),xmin) |
---|
214 | xmax = MAX(zmea(i),xmax) |
---|
215 | ENDDO |
---|
216 | PRINT*,'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax |
---|
217 | |
---|
218 | CALL get_field("ZSTD",zstd,found) |
---|
219 | IF (.not.found) THEN |
---|
220 | PRINT*, 'phyetat0: Le champ <ZSTD> 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(zstd(i),xmin) |
---|
227 | xmax = MAX(zstd(i),xmax) |
---|
228 | ENDDO |
---|
229 | PRINT*,'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax |
---|
230 | |
---|
231 | CALL get_field("ZSIG",zsig,found) |
---|
232 | IF (.not.found) THEN |
---|
233 | PRINT*, 'phyetat0: Le champ <ZSIG> est absent' |
---|
234 | CALL abort |
---|
235 | ENDIF |
---|
236 | xmin = 1.0E+20 |
---|
237 | xmax = -1.0E+20 |
---|
238 | DO i = 1, klon |
---|
239 | xmin = MIN(zsig(i),xmin) |
---|
240 | xmax = MAX(zsig(i),xmax) |
---|
241 | ENDDO |
---|
242 | PRINT*,'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax |
---|
243 | |
---|
244 | CALL get_field("ZGAM",zgam,found) |
---|
245 | IF (.not.found) THEN |
---|
246 | PRINT*, 'phyetat0: Le champ <ZGAM> est absent' |
---|
247 | CALL abort |
---|
248 | ENDIF |
---|
249 | xmin = 1.0E+20 |
---|
250 | xmax = -1.0E+20 |
---|
251 | DO i = 1, klon |
---|
252 | xmin = MIN(zgam(i),xmin) |
---|
253 | xmax = MAX(zgam(i),xmax) |
---|
254 | ENDDO |
---|
255 | PRINT*,'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax |
---|
256 | |
---|
257 | CALL get_field("ZTHE",zthe,found) |
---|
258 | IF (.not.found) THEN |
---|
259 | PRINT*, 'phyetat0: Le champ <ZTHE> est absent' |
---|
260 | CALL abort |
---|
261 | ENDIF |
---|
262 | xmin = 1.0E+20 |
---|
263 | xmax = -1.0E+20 |
---|
264 | DO i = 1, klon |
---|
265 | xmin = MIN(zthe(i),xmin) |
---|
266 | xmax = MAX(zthe(i),xmax) |
---|
267 | ENDDO |
---|
268 | PRINT*,'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax |
---|
269 | |
---|
270 | CALL get_field("ZPIC",zpic,found) |
---|
271 | IF (.not.found) THEN |
---|
272 | PRINT*, 'phyetat0: Le champ <ZPIC> est absent' |
---|
273 | CALL abort |
---|
274 | ENDIF |
---|
275 | xmin = 1.0E+20 |
---|
276 | xmax = -1.0E+20 |
---|
277 | DO i = 1, klon |
---|
278 | xmin = MIN(zpic(i),xmin) |
---|
279 | xmax = MAX(zpic(i),xmax) |
---|
280 | ENDDO |
---|
281 | PRINT*,'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax |
---|
282 | |
---|
283 | CALL get_field("ZVAL",zval,found) |
---|
284 | IF (.not.found) THEN |
---|
285 | PRINT*, 'phyetat0: Le champ <ZVAL> est absent' |
---|
286 | CALL abort |
---|
287 | ENDIF |
---|
288 | xmin = 1.0E+20 |
---|
289 | xmax = -1.0E+20 |
---|
290 | DO i = 1, klon |
---|
291 | xmin = MIN(zval(i),xmin) |
---|
292 | xmax = MAX(zval(i),xmax) |
---|
293 | ENDDO |
---|
294 | PRINT*,'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax |
---|
295 | |
---|
296 | else |
---|
297 | zmea = 0. |
---|
298 | zstd = 0. |
---|
299 | zsig = 0. |
---|
300 | zgam = 0. |
---|
301 | zthe = 0. |
---|
302 | zpic = 0. |
---|
303 | zval = 0. |
---|
304 | |
---|
305 | endif ! fin test sur ok_orodr |
---|
306 | |
---|
307 | ! Lecture de TANCIEN: |
---|
308 | |
---|
309 | ancien_ok = .TRUE. |
---|
310 | |
---|
311 | CALL get_field("TANCIEN",t_ancien,found) |
---|
312 | IF (.not.found) THEN |
---|
313 | PRINT*, "phyetat0: Le champ <TANCIEN> est absent" |
---|
314 | PRINT*, "Depart legerement fausse. Mais je continue" |
---|
315 | ancien_ok = .FALSE. |
---|
316 | ENDIF |
---|
317 | |
---|
318 | ! close file |
---|
319 | call close_startphy |
---|
320 | |
---|
321 | ! do some more initializations |
---|
322 | call init_iophy_new(rlatd,rlond) |
---|
323 | |
---|
324 | end subroutine phyetat0 |
---|