1 | SUBROUTINE inifis(ngrid,nlayer, |
---|
2 | $ wday_ini,wdaysec, |
---|
3 | $ wappel_phys, |
---|
4 | $ plat,plon,parea, |
---|
5 | $ prad,pg,pr,pcpp, |
---|
6 | $ nq, wdt, |
---|
7 | $ womeg,wmugaz, |
---|
8 | $ wyear_day,wperiheli,waphelie,wperi_day,wobliquit, |
---|
9 | $ wz0,wemin_turb,wlmixmin, |
---|
10 | $ wemissiv,wemissiceN,wemissiceS,walbediceN,walbediceS, |
---|
11 | $ wiceradiusN,wiceradiusS,wdtemisiceN,wdtemisiceS, |
---|
12 | $ walbedodat,winertiedat,wphisfi, |
---|
13 | $ wzmea,wzstd,wzsig,wzgam,wzthe, |
---|
14 | $ wtheta,wpsi) |
---|
15 | |
---|
16 | |
---|
17 | IMPLICIT NONE |
---|
18 | c======================================================================= |
---|
19 | c |
---|
20 | c CAREFUL: THIS IS A VERSION TO BE USED WITH WRF !!! |
---|
21 | c |
---|
22 | c ... CHECK THE ****WRF lines |
---|
23 | c |
---|
24 | c======================================================================= |
---|
25 | c |
---|
26 | c subject: |
---|
27 | c -------- |
---|
28 | c |
---|
29 | c Initialisation for the physical parametrisations of the LMD |
---|
30 | c martian atmospheric general circulation modele. |
---|
31 | c |
---|
32 | c author: Frederic Hourdin 15 / 10 /93 |
---|
33 | c ------- |
---|
34 | c modified: Sebastien Lebonnois 11/06/2003 (new callphys.def) |
---|
35 | c adapted to the WRF use - Aymeric Spiga - Jan 2007 |
---|
36 | c |
---|
37 | c arguments: |
---|
38 | c ---------- |
---|
39 | c |
---|
40 | c input: |
---|
41 | c ------ |
---|
42 | c |
---|
43 | c ngrid Size of the horizontal grid. |
---|
44 | c All internal loops are performed on that grid. |
---|
45 | c nlayer Number of vertical layers. |
---|
46 | c pdayref Day of reference for the simulation |
---|
47 | c firstcall True at the first call |
---|
48 | c lastcall True at the last call |
---|
49 | c pday Number of days counted from the North. Spring |
---|
50 | c equinoxe. |
---|
51 | c |
---|
52 | c======================================================================= |
---|
53 | c |
---|
54 | c----------------------------------------------------------------------- |
---|
55 | c declarations: |
---|
56 | c ------------- |
---|
57 | |
---|
58 | #include "dimensions.h" |
---|
59 | #include "dimphys.h" |
---|
60 | #include "planete.h" |
---|
61 | #include "comcstfi.h" |
---|
62 | #include "comsaison.h" |
---|
63 | #include "comdiurn.h" |
---|
64 | #include "comgeomfi.h" |
---|
65 | #include "callkeys.h" |
---|
66 | #include "surfdat.h" |
---|
67 | #include "slope.h" |
---|
68 | |
---|
69 | |
---|
70 | INTEGER ngrid,nlayer,nq |
---|
71 | |
---|
72 | REAL prad,pg,pr,pcpp,pdaysec |
---|
73 | REAL womeg,wmugaz,wdaysec |
---|
74 | REAL wyear_day,wperiheli,waphelie,wperi_day,wobliquit |
---|
75 | REAL wz0,wemin_turb,wlmixmin |
---|
76 | REAL wemissiv,wemissiceN,wemissiceS,walbediceN,walbediceS |
---|
77 | |
---|
78 | REAL wiceradiusN,wiceradiusS,wdtemisiceN,wdtemisiceS |
---|
79 | REAL walbedodat(ngrid),winertiedat(ngrid),wphisfi(ngrid) |
---|
80 | REAL wzmea(ngrid),wzstd(ngrid),wzsig(ngrid) |
---|
81 | REAL wzgam(ngrid),wzthe(ngrid) |
---|
82 | REAL wtheta(ngrid),wpsi(ngrid) |
---|
83 | |
---|
84 | REAL plat(ngrid),plon(ngrid),parea(ngridmx) |
---|
85 | integer wday_ini |
---|
86 | REAL wdt |
---|
87 | INTEGER ig,ierr |
---|
88 | |
---|
89 | INTEGER wecri_phys |
---|
90 | REAL wappel_phys |
---|
91 | |
---|
92 | EXTERNAL iniorbit,orbite |
---|
93 | EXTERNAL SSUM |
---|
94 | REAL SSUM |
---|
95 | |
---|
96 | CHARACTER ch1*12 |
---|
97 | CHARACTER ch80*80 |
---|
98 | |
---|
99 | logical chem, h2o |
---|
100 | |
---|
101 | c ****WRF |
---|
102 | c |
---|
103 | c------------------------------------------------------ |
---|
104 | c Fill some parameters in the 'include' files |
---|
105 | c >> Do part of the job previously done by phyetat0.F |
---|
106 | c >> Complete list of parameters is found in tabfi.F |
---|
107 | c------------------------------------------------------ |
---|
108 | c |
---|
109 | c Values are defined in the module_model_constants.F WRF routine |
---|
110 | c |
---|
111 | ! in 'comcstfi.h' |
---|
112 | rad=prad |
---|
113 | cpp=pcpp |
---|
114 | g=pg |
---|
115 | r=pr |
---|
116 | rcp=r/cpp |
---|
117 | daysec=wdaysec |
---|
118 | omeg=womeg |
---|
119 | mugaz=wmugaz |
---|
120 | print*,"check: rad,cpp,g,r,rcp,daysec,omeg,mugaz" |
---|
121 | print*,rad,cpp,g,r,rcp,daysec,omeg,mugaz |
---|
122 | |
---|
123 | ! in 'planet.h' |
---|
124 | year_day=wyear_day |
---|
125 | periheli=wperiheli |
---|
126 | aphelie=waphelie |
---|
127 | peri_day=wperi_day |
---|
128 | obliquit=wobliquit |
---|
129 | z0=wz0 |
---|
130 | emin_turb=wemin_turb |
---|
131 | lmixmin=wlmixmin |
---|
132 | print*,"check: year_day,periheli,aphelie,peri_day,obliquit" |
---|
133 | print*,year_day,periheli,aphelie,peri_day,obliquit |
---|
134 | print*,"check: z0,emin_turb,lmixmin" |
---|
135 | print*,z0,emin_turb,lmixmin |
---|
136 | |
---|
137 | ! in 'surfdat.h' |
---|
138 | emissiv=wemissiv |
---|
139 | emisice(1)=wemissiceN |
---|
140 | emisice(2)=wemissiceS |
---|
141 | albedice(1)=walbediceN |
---|
142 | albedice(2)=walbediceS |
---|
143 | iceradius(1)=wiceradiusN |
---|
144 | iceradius(2)=wiceradiusS |
---|
145 | dtemisice(1)=wdtemisiceN |
---|
146 | dtemisice(2)=wdtemisiceS |
---|
147 | print*,"check: emissiv,emisice,albedice,iceradius,dtemisice" |
---|
148 | print*,emissiv,emisice,albedice,iceradius,dtemisice |
---|
149 | |
---|
150 | c |
---|
151 | c Values are defined in the WPS processing |
---|
152 | c |
---|
153 | albedodat(:)=walbedodat(:) |
---|
154 | inertiedat(:)=winertiedat(:) |
---|
155 | phisfi(:)=wphisfi(:) |
---|
156 | print*,"check: albedodat(1),inertiedat(1),phisfi(1)" |
---|
157 | print*,albedodat(1),inertiedat(1),phisfi(1) |
---|
158 | print*,"check: albedodat(end),inertiedat(end),phisfi(end)" |
---|
159 | print*,albedodat(ngrid),inertiedat(ngrid),phisfi(ngrid) |
---|
160 | |
---|
161 | ! NB: usually, gravity wave scheme is useless in mesoscale modeling |
---|
162 | ! NB: we however keep the option for coarse grid case ... |
---|
163 | zmea(:)=wzmea(:) |
---|
164 | zstd(:)=wzstd(:) |
---|
165 | zsig(:)=wzsig(:) |
---|
166 | zgam(:)=wzgam(:) |
---|
167 | zthe(:)=wzthe(:) |
---|
168 | print*,"check: gw param" |
---|
169 | print*,zmea(1),zmea(ngrid) |
---|
170 | print*,zstd(1),zstd(ngrid) |
---|
171 | print*,zsig(1),zsig(ngrid) |
---|
172 | print*,zgam(1),zgam(ngrid) |
---|
173 | print*,zthe(1),zthe(ngrid) |
---|
174 | |
---|
175 | ! |
---|
176 | ! in slope.h |
---|
177 | ! |
---|
178 | theta_sl(:)=wtheta(:) |
---|
179 | psi_sl(:)=wpsi(:) |
---|
180 | print*,"check: theta_sl(1),psi_sl(1)" |
---|
181 | print*,theta_sl(1),psi_sl(1) |
---|
182 | print*,"check: theta_sl(end),psi_sl(end)" |
---|
183 | print*,theta_sl(ngrid),psi_sl(ngrid) |
---|
184 | |
---|
185 | |
---|
186 | c ****WRF |
---|
187 | |
---|
188 | |
---|
189 | |
---|
190 | c -------------------------------------------------------- |
---|
191 | c The usual Tests |
---|
192 | c -------------- |
---|
193 | |
---|
194 | c ****WRF |
---|
195 | c useless here, because it was already done in the WRF driver |
---|
196 | |
---|
197 | IF (nlayer.NE.nlayermx) THEN |
---|
198 | PRINT*,'STOP in inifis' |
---|
199 | PRINT*,'Probleme de dimensions :' |
---|
200 | PRINT*,'nlayer = ',nlayer |
---|
201 | PRINT*,'nlayermx = ',nlayermx |
---|
202 | STOP |
---|
203 | ENDIF |
---|
204 | |
---|
205 | IF (ngrid.NE.ngridmx) THEN |
---|
206 | PRINT*,'STOP in inifis' |
---|
207 | PRINT*,'Probleme de dimensions :' |
---|
208 | PRINT*,'ngrid = ',ngrid |
---|
209 | PRINT*,'ngridmx = ',ngridmx |
---|
210 | STOP |
---|
211 | ENDIF |
---|
212 | |
---|
213 | |
---|
214 | c -------------------------------------------------------------- |
---|
215 | c Reading the "callphys.def" file controlling some key options |
---|
216 | c -------------------------------------------------------------- |
---|
217 | |
---|
218 | callrad=.true. |
---|
219 | calldifv=.true. |
---|
220 | calladj=.true. |
---|
221 | callcond=.true. |
---|
222 | callsoil=.true. |
---|
223 | season=.true. |
---|
224 | diurnal=.false. |
---|
225 | lwrite=.false. |
---|
226 | calllott=.true. |
---|
227 | iaervar=2 |
---|
228 | iddist=3 |
---|
229 | topdustref=55. |
---|
230 | OPEN(99,file='callphys.def',status='old',form='formatted' |
---|
231 | . ,iostat=ierr) |
---|
232 | IF(ierr.EQ.0) THEN |
---|
233 | !PRINT* |
---|
234 | !PRINT* |
---|
235 | PRINT*,'--------------------------------------------' |
---|
236 | PRINT*,' Parametres pour la physique (callphys.def)' |
---|
237 | PRINT*,'--------------------------------------------' |
---|
238 | |
---|
239 | READ(99,*) |
---|
240 | READ(99,*) |
---|
241 | |
---|
242 | READ(99,fmt='(a)') ch1 |
---|
243 | READ(99,*) tracer |
---|
244 | WRITE(*,8000) ch1,tracer |
---|
245 | |
---|
246 | READ(99,fmt='(a)') ch1 |
---|
247 | READ(99,'(l1)') diurnal |
---|
248 | WRITE(*,8000) ch1,diurnal |
---|
249 | |
---|
250 | READ(99,fmt='(a)') ch1 |
---|
251 | READ(99,'(l1)') season |
---|
252 | WRITE(*,8000) ch1,season |
---|
253 | |
---|
254 | READ(99,fmt='(a)') ch1 |
---|
255 | READ(99,'(l1)') lwrite |
---|
256 | WRITE(*,8000) ch1,lwrite |
---|
257 | |
---|
258 | READ(99,fmt='(a)') ch1 |
---|
259 | READ(99,'(l1)') callstats |
---|
260 | WRITE(*,8000) ch1,callstats |
---|
261 | |
---|
262 | READ(99,fmt='(a)') ch1 |
---|
263 | READ(99,'(l1)') calleofdump |
---|
264 | WRITE(*,8000) ch1,calleofdump |
---|
265 | |
---|
266 | READ(99,*) |
---|
267 | READ(99,*) |
---|
268 | |
---|
269 | READ(99,fmt='(a)') ch1 |
---|
270 | READ(99,*,iostat=ierr) iaervar |
---|
271 | if(ierr.ne.0) stop'no iaervar in callphys.def (old?)' |
---|
272 | c****WRF: ligne trop longue .... |
---|
273 | WRITE(*,8001) ch1,iaervar |
---|
274 | |
---|
275 | READ(99,fmt='(a)') ch1 |
---|
276 | READ(99,*) iddist |
---|
277 | WRITE(*,8001) ch1,iddist |
---|
278 | |
---|
279 | READ(99,fmt='(a)') ch1 |
---|
280 | READ(99,*) topdustref |
---|
281 | WRITE(*,8002) ch1,topdustref |
---|
282 | |
---|
283 | READ(99,*) |
---|
284 | READ(99,*) |
---|
285 | |
---|
286 | READ(99,fmt='(a)') ch1 |
---|
287 | READ(99,'(l1)') callrad |
---|
288 | WRITE(*,8000) ch1,callrad |
---|
289 | |
---|
290 | READ(99,fmt='(a)') ch1 |
---|
291 | READ(99,'(l1)') callnlte |
---|
292 | WRITE(*,8000) ch1,callnlte |
---|
293 | |
---|
294 | READ(99,fmt='(a)') ch1 |
---|
295 | READ(99,'(l1)') callnirco2 |
---|
296 | WRITE(*,8000) ch1,callnirco2 |
---|
297 | |
---|
298 | READ(99,fmt='(a)') ch1 |
---|
299 | READ(99,'(l1)') calldifv |
---|
300 | WRITE(*,8000) ch1,calldifv |
---|
301 | |
---|
302 | READ(99,fmt='(a)') ch1 |
---|
303 | READ(99,'(l1)') calladj |
---|
304 | WRITE(*,8000) ch1,calladj |
---|
305 | |
---|
306 | READ(99,fmt='(a)') ch1 |
---|
307 | READ(99,'(l1)') callcond |
---|
308 | WRITE(*,8000) ch1,callcond |
---|
309 | |
---|
310 | READ(99,fmt='(a)') ch1 |
---|
311 | READ(99,'(l1)') callsoil |
---|
312 | WRITE(*,8000) ch1,callsoil |
---|
313 | |
---|
314 | READ(99,fmt='(a)') ch1 |
---|
315 | READ(99,'(l1)') calllott |
---|
316 | WRITE(*,8000) ch1,calllott |
---|
317 | |
---|
318 | READ(99,*) |
---|
319 | READ(99,*) |
---|
320 | |
---|
321 | READ(99,fmt='(a)') ch1 |
---|
322 | READ(99,*) iradia |
---|
323 | WRITE(*,8001) ch1,iradia |
---|
324 | |
---|
325 | READ(99,fmt='(a)') ch1 |
---|
326 | READ(99,'(l1)') callg2d |
---|
327 | WRITE(*,8000) ch1,callg2d |
---|
328 | |
---|
329 | READ(99,fmt='(a)') ch1 |
---|
330 | READ(99,*) rayleigh |
---|
331 | WRITE(*,8000) ch1,rayleigh |
---|
332 | |
---|
333 | READ(99,*) |
---|
334 | READ(99,*) |
---|
335 | |
---|
336 | c TRACERS: |
---|
337 | |
---|
338 | READ(99,fmt='(a)') ch1 |
---|
339 | READ(99,*) dustbin |
---|
340 | WRITE(*,8001) ch1,dustbin |
---|
341 | |
---|
342 | READ(99,fmt='(a)') ch1 |
---|
343 | READ(99,*) active |
---|
344 | WRITE(*,8000) ch1,active |
---|
345 | |
---|
346 | c Test of incompatibility: |
---|
347 | c if active is used, then dustbin should be > 0 |
---|
348 | |
---|
349 | if (active.and.(dustbin.lt.1)) then |
---|
350 | print*,'if active is used, then dustbin should > 0' |
---|
351 | stop |
---|
352 | endif |
---|
353 | |
---|
354 | READ(99,fmt='(a)') ch1 |
---|
355 | READ(99,*) doubleq |
---|
356 | WRITE(*,8000) ch1,doubleq |
---|
357 | |
---|
358 | c Test of incompatibility: |
---|
359 | c if doubleq is used, then dustbin should be 1 |
---|
360 | |
---|
361 | if (doubleq.and.(dustbin.ne.1)) then |
---|
362 | print*,'if doubleq is used, then dustbin should be 1' |
---|
363 | stop |
---|
364 | endif |
---|
365 | |
---|
366 | READ(99,fmt='(a)') ch1 |
---|
367 | READ(99,*) lifting |
---|
368 | WRITE(*,8000) ch1,lifting |
---|
369 | |
---|
370 | c Test of incompatibility: |
---|
371 | c if lifting is used, then dustbin should be > 0 |
---|
372 | |
---|
373 | if (lifting.and.(dustbin.lt.1)) then |
---|
374 | print*,'if lifting is used, then dustbin should > 0' |
---|
375 | stop |
---|
376 | endif |
---|
377 | |
---|
378 | READ(99,fmt='(a)') ch1 |
---|
379 | READ(99,*) callddevil |
---|
380 | WRITE(*,8000) ch1,callddevil |
---|
381 | |
---|
382 | c Test of incompatibility: |
---|
383 | c if dustdevil is used, then dustbin should be > 0 |
---|
384 | |
---|
385 | if (callddevil.and.(dustbin.lt.1)) then |
---|
386 | print*,'if dustdevil is used, then dustbin should > 0' |
---|
387 | stop |
---|
388 | endif |
---|
389 | |
---|
390 | READ(99,fmt='(a)') ch1 |
---|
391 | READ(99,*) scavenging |
---|
392 | WRITE(*,8000) ch1,scavenging |
---|
393 | |
---|
394 | c Test of incompatibility: |
---|
395 | c if scavenging is used, then dustbin should be > 0 |
---|
396 | |
---|
397 | if (scavenging.and.(dustbin.lt.1)) then |
---|
398 | print*,'if scavenging is used, then dustbin should > 0' |
---|
399 | stop |
---|
400 | endif |
---|
401 | |
---|
402 | READ(99,fmt='(a)') ch1 |
---|
403 | READ(99,*) sedimentation |
---|
404 | WRITE(*,8000) ch1,sedimentation |
---|
405 | |
---|
406 | READ(99,fmt='(a)') ch1 |
---|
407 | READ(99,*) iceparty |
---|
408 | WRITE(*,8000) ch1,iceparty |
---|
409 | |
---|
410 | READ(99,fmt='(a)') ch1 |
---|
411 | READ(99,*) activice |
---|
412 | WRITE(*,8000) ch1,activice |
---|
413 | |
---|
414 | c Test of incompatibility: |
---|
415 | c if activice is used, then iceparty should be used too |
---|
416 | |
---|
417 | if (activice.and..not.iceparty) then |
---|
418 | print*,'if activice is used, iceparty should be used too' |
---|
419 | stop |
---|
420 | endif |
---|
421 | |
---|
422 | READ(99,fmt='(a)') ch1 |
---|
423 | READ(99,*) water |
---|
424 | WRITE(*,8000) ch1,water |
---|
425 | |
---|
426 | c Test of incompatibility: |
---|
427 | c if iceparty is used, then water should be used too |
---|
428 | |
---|
429 | if (.not.water) then |
---|
430 | iceparty = .false. |
---|
431 | endif |
---|
432 | |
---|
433 | READ(99,fmt='(a)') ch1 |
---|
434 | READ(99,*) caps |
---|
435 | WRITE(*,8000) ch1,caps |
---|
436 | |
---|
437 | READ(99,fmt='(a)') ch1 |
---|
438 | READ(99,*) photochem |
---|
439 | WRITE(*,8000) ch1,photochem |
---|
440 | |
---|
441 | READ(99,*) |
---|
442 | READ(99,*) |
---|
443 | |
---|
444 | c THERMOSPHERE |
---|
445 | |
---|
446 | READ(99,fmt='(a)') ch1 |
---|
447 | READ(99,'(l1)') callthermos |
---|
448 | WRITE(*,8000) ch1,callthermos |
---|
449 | |
---|
450 | READ(99,fmt='(a)') ch1 |
---|
451 | READ(99,'(l1)') thermoswater |
---|
452 | WRITE(*,8000) ch1,thermoswater |
---|
453 | |
---|
454 | READ(99,fmt='(a)') ch1 |
---|
455 | READ(99,'(l1)') callconduct |
---|
456 | WRITE(*,8000) ch1,callconduct |
---|
457 | |
---|
458 | READ(99,fmt='(a)') ch1 |
---|
459 | READ(99,'(l1)') calleuv |
---|
460 | WRITE(*,8000) ch1,calleuv |
---|
461 | |
---|
462 | READ(99,fmt='(a)') ch1 |
---|
463 | READ(99,'(l1)') callmolvis |
---|
464 | WRITE(*,8000) ch1,callmolvis |
---|
465 | |
---|
466 | READ(99,fmt='(a)') ch1 |
---|
467 | READ(99,'(l1)') callmoldiff |
---|
468 | WRITE(*,8000) ch1,callmoldiff |
---|
469 | |
---|
470 | READ(99,fmt='(a)') ch1 |
---|
471 | READ(99,'(l1)') thermochem |
---|
472 | WRITE(*,8000) ch1,thermochem |
---|
473 | |
---|
474 | READ(99,fmt='(a)') ch1 |
---|
475 | READ(99,*) solarcondate |
---|
476 | WRITE(*,*) ch1,solarcondate |
---|
477 | |
---|
478 | if (.not.callthermos) then |
---|
479 | thermoswater=.false. |
---|
480 | callconduct=.false. |
---|
481 | calleuv=.false. |
---|
482 | callmolvis=.false. |
---|
483 | callmoldiff=.false. |
---|
484 | thermochem=.false. |
---|
485 | end if |
---|
486 | |
---|
487 | c Test of incompatibility: |
---|
488 | c if photochem is used, then water should be used too |
---|
489 | |
---|
490 | if (photochem.and..not.water) then |
---|
491 | print*,'if photochem is used, water should be used too' |
---|
492 | stop |
---|
493 | endif |
---|
494 | |
---|
495 | c if callthermos is used, then thermoswater should be used too |
---|
496 | c (if water not used already) |
---|
497 | |
---|
498 | if (callthermos .and. .not.water) then |
---|
499 | if (callthermos .and. .not.thermoswater) then |
---|
500 | print*,'if callthermos is used, water or thermoswater |
---|
501 | & should be used too' |
---|
502 | stop |
---|
503 | endif |
---|
504 | endif |
---|
505 | |
---|
506 | PRINT*,'--------------------------------------------' |
---|
507 | PRINT* |
---|
508 | PRINT* |
---|
509 | ELSE |
---|
510 | write(*,*) |
---|
511 | write(*,*) 'Cannot read file callphys.def. Is it here ?' |
---|
512 | stop |
---|
513 | ENDIF |
---|
514 | CLOSE(99) |
---|
515 | |
---|
516 | !!----------------------------------------- |
---|
517 | !! titus cap |
---|
518 | OPEN(99,file='titus.def',status='old',form='formatted' |
---|
519 | . ,iostat=ierr) |
---|
520 | IF(ierr.EQ.0) THEN |
---|
521 | READ(99,*,iostat=ierr) tituscap |
---|
522 | ELSE |
---|
523 | write(*,*) 'no titus.def files. assuming no Titus cap.' |
---|
524 | tituscap = .false. |
---|
525 | ENDIF |
---|
526 | write(*,*) 'Titus cap is: ',tituscap |
---|
527 | CLOSE(99) |
---|
528 | !!----------------------------------------- |
---|
529 | |
---|
530 | |
---|
531 | 8000 FORMAT(t5,a12,l8) |
---|
532 | 8001 FORMAT(t5,a12,i8) |
---|
533 | 8002 FORMAT(t5,a12,f8.1) |
---|
534 | |
---|
535 | |
---|
536 | c ****WRF |
---|
537 | c***************************************************** |
---|
538 | c Since it comes from WRF settings, we have to |
---|
539 | c fill dtphys in the include file |
---|
540 | c It must be set now, because it is used afterwards |
---|
541 | c |
---|
542 | c Opportunity is taken to fill ecri_phys as well |
---|
543 | c***************************************************** |
---|
544 | dtphys=wdt*wappel_phys |
---|
545 | print*,'Physical timestep (s) ',dtphys |
---|
546 | ecri_phys=10 !8.e18 !! a dummy low frequency |
---|
547 | print*,'Physical frequency for writing ',ecri_phys |
---|
548 | c |
---|
549 | c ****WRF |
---|
550 | |
---|
551 | |
---|
552 | PRINT* |
---|
553 | PRINT*,'daysec',daysec |
---|
554 | PRINT* |
---|
555 | PRINT*,'The radiative transfer is computed:' |
---|
556 | PRINT*,' each ',iradia,' physical time-step' |
---|
557 | PRINT*,' or each ',iradia*dtphys,' seconds' |
---|
558 | PRINT* |
---|
559 | |
---|
560 | |
---|
561 | |
---|
562 | c -------------------------------------------------------------- |
---|
563 | c Managing the Longwave radiative transfer |
---|
564 | c -------------------------------------------------------------- |
---|
565 | |
---|
566 | c In most cases, the run just use the following values : |
---|
567 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
568 | callemis=.true. |
---|
569 | c ilwd=10*int(daysec/dtphys) ! bug before 22/10/01 |
---|
570 | ilwd=10*int(daysec/dtphys) |
---|
571 | ilwn=2 |
---|
572 | linear=.true. |
---|
573 | ncouche=3 |
---|
574 | alphan=0.4 |
---|
575 | ilwb=2 |
---|
576 | semi=0 |
---|
577 | |
---|
578 | c BUT people working hard on the LW may want to read them in 'radia.def' |
---|
579 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
580 | |
---|
581 | OPEN(99,file='radia.def',status='old',form='formatted' |
---|
582 | . ,iostat=ierr) |
---|
583 | IF(ierr.EQ.0) THEN |
---|
584 | write(*,*) 'Reading radia.def !!!' |
---|
585 | READ(99,fmt='(a)') ch1 |
---|
586 | READ(99,*) callemis |
---|
587 | WRITE(*,8000) ch1,callemis |
---|
588 | |
---|
589 | READ(99,fmt='(a)') ch1 |
---|
590 | READ(99,*) iradia |
---|
591 | WRITE(*,8001) ch1,iradia |
---|
592 | |
---|
593 | READ(99,fmt='(a)') ch1 |
---|
594 | READ(99,*) ilwd |
---|
595 | WRITE(*,8001) ch1,ilwd |
---|
596 | |
---|
597 | READ(99,fmt='(a)') ch1 |
---|
598 | READ(99,*) ilwn |
---|
599 | WRITE(*,8001) ch1,ilwn |
---|
600 | |
---|
601 | READ(99,fmt='(a)') ch1 |
---|
602 | READ(99,*) linear |
---|
603 | WRITE(*,8000) ch1,linear |
---|
604 | |
---|
605 | READ(99,fmt='(a)') ch1 |
---|
606 | READ(99,*) ncouche |
---|
607 | WRITE(*,8001) ch1,ncouche |
---|
608 | |
---|
609 | READ(99,fmt='(a)') ch1 |
---|
610 | READ(99,*) alphan |
---|
611 | WRITE(*,*) ch1,alphan |
---|
612 | |
---|
613 | READ(99,fmt='(a)') ch1 |
---|
614 | READ(99,*) ilwb |
---|
615 | WRITE(*,8001) ch1,ilwb |
---|
616 | |
---|
617 | |
---|
618 | READ(99,fmt='(a)') ch1 |
---|
619 | READ(99,'(l1)') callg2d |
---|
620 | WRITE(*,8000) ch1,callg2d |
---|
621 | |
---|
622 | READ(99,fmt='(a)') ch1 |
---|
623 | READ(99,*) semi |
---|
624 | WRITE(*,*) ch1,semi |
---|
625 | end if |
---|
626 | |
---|
627 | c----------------------------------------------------------------------- |
---|
628 | c Some more initialization: |
---|
629 | c ------------------------ |
---|
630 | |
---|
631 | ! in 'comgeomfi.h' |
---|
632 | CALL SCOPY(ngrid,plon,1,long,1) |
---|
633 | CALL SCOPY(ngrid,plat,1,lati,1) |
---|
634 | CALL SCOPY(ngrid,parea,1,area,1) |
---|
635 | totarea=SSUM(ngridmx,area,1) |
---|
636 | |
---|
637 | ! in 'comdiurn.h' |
---|
638 | DO ig=1,ngrid |
---|
639 | sinlat(ig)=sin(plat(ig)) |
---|
640 | coslat(ig)=cos(plat(ig)) |
---|
641 | sinlon(ig)=sin(plon(ig)) |
---|
642 | coslon(ig)=cos(plon(ig)) |
---|
643 | ENDDO |
---|
644 | |
---|
645 | pi=2.*asin(1.) |
---|
646 | |
---|
647 | c managing the tracers, and tests: |
---|
648 | c ------------------------------- |
---|
649 | |
---|
650 | if(tracer) then |
---|
651 | |
---|
652 | c when photochem is used, nqchem_min is the rank |
---|
653 | c of the first chemical species |
---|
654 | |
---|
655 | nqchem_min = 1 |
---|
656 | if (photochem .or. callthermos) then |
---|
657 | chem = .true. |
---|
658 | if (doubleq) then |
---|
659 | nqchem_min = 3 |
---|
660 | else |
---|
661 | nqchem_min = dustbin+1 |
---|
662 | end if |
---|
663 | end if |
---|
664 | |
---|
665 | if (water .or. thermoswater) h2o = .true. |
---|
666 | |
---|
667 | c TESTS |
---|
668 | |
---|
669 | print*,'TRACERS:' |
---|
670 | |
---|
671 | if ((doubleq).and.(h2o).and. |
---|
672 | $ (chem).and.(iceparty)) then |
---|
673 | print*,' 1: dust ; 2: dust (doubleq)' |
---|
674 | print*,' 3 to ',nqmx-2,': chemistry' |
---|
675 | print*,nqmx-1,': water ice ; ',nqmx,': water vapor' |
---|
676 | endif |
---|
677 | |
---|
678 | if ((doubleq).and.(h2o).and. |
---|
679 | $ (chem).and..not.(iceparty)) then |
---|
680 | print*,' 1: dust ; 2: dust (doubleq)' |
---|
681 | print*,' 3 to ',nqmx-1,': chemistry' |
---|
682 | print*,nqmx,': water vapor' |
---|
683 | endif |
---|
684 | |
---|
685 | if ((doubleq).and.(h2o).and. |
---|
686 | $ .not.(chem).and.(iceparty)) then |
---|
687 | print*,' 1: dust ; 2: dust (doubleq)' |
---|
688 | print*,nqmx-1,': water ice ; ',nqmx,': water vapor' |
---|
689 | if (nqmx.ne.4) then |
---|
690 | print*,'nqmx should be 4 with these options.' |
---|
691 | print*,'(or check callphys.def)' |
---|
692 | stop |
---|
693 | endif |
---|
694 | endif |
---|
695 | |
---|
696 | if ((doubleq).and.(h2o).and. |
---|
697 | $ .not.(chem).and..not.(iceparty)) then |
---|
698 | print*,' 1: dust ; 2: dust (doubleq)' |
---|
699 | print*,nqmx,': water vapor' |
---|
700 | if (nqmx.ne.3) then |
---|
701 | print*,'nqmx should be 3 with these options...' |
---|
702 | print*,'(or check callphys.def)' |
---|
703 | stop |
---|
704 | endif |
---|
705 | endif |
---|
706 | |
---|
707 | if ((doubleq).and..not.(h2o)) then |
---|
708 | print*,' 1: dust ; 2: dust (doubleq)' |
---|
709 | if (nqmx.ne.2) then |
---|
710 | print*,'nqmx should be 2 with these options...' |
---|
711 | print*,'(or check callphys.def)' |
---|
712 | stop |
---|
713 | endif |
---|
714 | endif |
---|
715 | |
---|
716 | if (.not.(doubleq).and.(h2o).and. |
---|
717 | $ (chem).and.(iceparty)) then |
---|
718 | if (dustbin.gt.0) then |
---|
719 | print*,' 1 to ',dustbin,': dust bins' |
---|
720 | endif |
---|
721 | print*,nqchem_min,' to ',nqmx-2,': chemistry' |
---|
722 | print*,nqmx-1,': water ice ; ',nqmx,': water vapor' |
---|
723 | endif |
---|
724 | if (.not.(doubleq).and.(h2o).and. |
---|
725 | $ (chem).and..not.(iceparty)) then |
---|
726 | if (dustbin.gt.0) then |
---|
727 | print*,' 1 to ',dustbin,': dust bins' |
---|
728 | endif |
---|
729 | print*,nqchem_min,' to ',nqmx-1,': chemistry' |
---|
730 | print*,nqmx,': water vapor' |
---|
731 | endif |
---|
732 | if (.not.(doubleq).and.(h2o).and. |
---|
733 | $ .not.(chem).and.(iceparty)) then |
---|
734 | if (dustbin.gt.0) then |
---|
735 | print*,' 1 to ',dustbin,': dust bins' |
---|
736 | endif |
---|
737 | print*,nqmx-1,': water ice ; ',nqmx,': water vapor' |
---|
738 | if (nqmx.ne.(dustbin+2)) then |
---|
739 | print*,'nqmx should be ',(dustbin+2), |
---|
740 | $ ' with these options...' |
---|
741 | print*,'(or check callphys.def)' |
---|
742 | stop |
---|
743 | endif |
---|
744 | endif |
---|
745 | if (.not.(doubleq).and.(h2o).and. |
---|
746 | $ .not.(chem).and..not.(iceparty)) then |
---|
747 | if (dustbin.gt.0) then |
---|
748 | print*,' 1 to ',dustbin,': dust bins' |
---|
749 | endif |
---|
750 | print*,nqmx,': water vapor' |
---|
751 | if (nqmx.ne.(dustbin+1)) then |
---|
752 | print*,'nqmx should be ',(dustbin+1), |
---|
753 | $ ' with these options...' |
---|
754 | print*,'(or check callphys.def)' |
---|
755 | stop |
---|
756 | endif |
---|
757 | endif |
---|
758 | if (.not.(doubleq).and..not.(h2o)) then |
---|
759 | if (dustbin.gt.0) then |
---|
760 | print*,' 1 to ',dustbin,': dust bins' |
---|
761 | if (nqmx.ne.dustbin) then |
---|
762 | print*,'nqmx should be ',dustbin, |
---|
763 | $ ' with these options...' |
---|
764 | print*,'(or check callphys.def)' |
---|
765 | stop |
---|
766 | endif |
---|
767 | else |
---|
768 | print*,'dustbin=',dustbin, |
---|
769 | $ ': tracer should be F with these options...' |
---|
770 | $ ,'UNLESS you just want to move tracers around ' |
---|
771 | endif |
---|
772 | endif |
---|
773 | |
---|
774 | endif |
---|
775 | |
---|
776 | RETURN |
---|
777 | END |
---|