1 | MODULE inifis_mod |
---|
2 | IMPLICIT NONE |
---|
3 | |
---|
4 | CONTAINS |
---|
5 | |
---|
6 | SUBROUTINE inifis(ngrid,nlayer,nq, & |
---|
7 | day_ini,pdaysec,nday,ptimestep, & |
---|
8 | plat,plon,parea, & |
---|
9 | prad,pg,pr,pcpp) |
---|
10 | |
---|
11 | use init_print_control_mod, only: init_print_control |
---|
12 | use radinc_h, only: ini_radinc_h |
---|
13 | use comdiurn_h, only: sinlat, coslat, sinlon, coslon |
---|
14 | use comgeomfi_h, only: totarea, totarea_planet |
---|
15 | use comsoil_h, only: ini_comsoil_h, nsoilmx, lay1_soil, alpha_soil |
---|
16 | use time_phylmdz_mod, only: ecritphy,day_step,iphysiq, & |
---|
17 | init_time, daysec, dtphys |
---|
18 | use comcstfi_mod, only: rad, cpp, g, r, rcp, & |
---|
19 | mugaz, pi, avocado, kbol |
---|
20 | use planete_mod, only: nres |
---|
21 | use planetwide_mod, only: planetwide_sumval |
---|
22 | use callkeys_mod |
---|
23 | use mod_phys_lmdz_para, only : is_parallel |
---|
24 | |
---|
25 | !======================================================================= |
---|
26 | ! |
---|
27 | ! purpose: |
---|
28 | ! ------- |
---|
29 | ! |
---|
30 | ! Initialisation for the physical parametrisations of the LMD |
---|
31 | ! Generic Model. |
---|
32 | ! |
---|
33 | ! author: Frederic Hourdin 15 / 10 /93 |
---|
34 | ! ------- |
---|
35 | ! modified: -Sebastien Lebonnois 11/06/2003 (new callphys.def) |
---|
36 | ! -Ehouarn Millour (oct. 2008) tracers are now identified |
---|
37 | ! by their names and may not be contiguously |
---|
38 | ! stored in the q(:,:,:,:) array |
---|
39 | ! -Ehouarn Millour (june 2009) use getin routine |
---|
40 | ! to load parameters |
---|
41 | ! -Bruno de Batz de Trenquelléon (2023) minor changes and |
---|
42 | ! new initialisations |
---|
43 | ! |
---|
44 | ! |
---|
45 | ! arguments: |
---|
46 | ! ---------- |
---|
47 | ! |
---|
48 | ! input: |
---|
49 | ! ------ |
---|
50 | ! |
---|
51 | ! ngrid Size of the horizontal grid. |
---|
52 | ! All internal loops are performed on that grid. |
---|
53 | ! nlayer Number of vertical layers. |
---|
54 | ! pdayref Day of reference for the simulation |
---|
55 | ! pday Number of days counted from the North. Spring |
---|
56 | ! equinoxe. |
---|
57 | ! |
---|
58 | !======================================================================= |
---|
59 | ! |
---|
60 | !----------------------------------------------------------------------- |
---|
61 | ! declarations: |
---|
62 | ! ------------- |
---|
63 | use datafile_mod |
---|
64 | use ioipsl_getin_p_mod, only: getin_p |
---|
65 | IMPLICIT NONE |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | REAL,INTENT(IN) :: prad,pg,pr,pcpp,pdaysec,ptimestep |
---|
70 | INTEGER,INTENT(IN) :: nday |
---|
71 | INTEGER,INTENT(IN) :: ngrid,nlayer,nq |
---|
72 | REAL,INTENT(IN) :: plat(ngrid),plon(ngrid),parea(ngrid) |
---|
73 | integer,intent(in) :: day_ini |
---|
74 | INTEGER ig,ierr |
---|
75 | |
---|
76 | EXTERNAL iniorbit,orbite |
---|
77 | EXTERNAL SSUM |
---|
78 | REAL SSUM |
---|
79 | |
---|
80 | ! Initialize flags lunout, prt_level, debug (in print_control_mod) |
---|
81 | CALL init_print_control |
---|
82 | |
---|
83 | ! initialize constants in comcstfi_mod |
---|
84 | rad=prad |
---|
85 | cpp=pcpp |
---|
86 | g=pg |
---|
87 | r=pr |
---|
88 | rcp=r/cpp |
---|
89 | mugaz=8.314*1000./pr ! dummy init |
---|
90 | pi=2.*asin(1.) |
---|
91 | avocado = 6.02214179e23 ! added by RW |
---|
92 | kbol = 1.38064852e-23 ! added by JVO for Titan chem |
---|
93 | |
---|
94 | ! Initialize some "temporal and calendar" related variables |
---|
95 | #ifndef MESOSCALE |
---|
96 | CALL init_time(day_ini,pdaysec,nday,ptimestep) |
---|
97 | #endif |
---|
98 | |
---|
99 | ! read in some parameters from "run.def" for physics, |
---|
100 | ! or shared between dynamics and physics. |
---|
101 | call getin_p("ecritphy",ecritphy) ! frequency of outputs in physics, |
---|
102 | ! in dynamical steps |
---|
103 | call getin_p("day_step",day_step) ! number of dynamical steps per day |
---|
104 | call getin_p("iphysiq",iphysiq) ! call physics every iphysiq dyn step |
---|
105 | |
---|
106 | ! do we read a startphy.nc file? (default: .true.) |
---|
107 | call getin_p("startphy_file",startphy_file) |
---|
108 | |
---|
109 | ! -------------------------------------------------------------- |
---|
110 | ! Reading the "callphys.def" file controlling some key options |
---|
111 | ! -------------------------------------------------------------- |
---|
112 | |
---|
113 | ! check that 'callphys.def' file is around |
---|
114 | OPEN(99,file='callphys.def',status='old',form='formatted',iostat=ierr) |
---|
115 | CLOSE(99) |
---|
116 | IF(ierr.EQ.0) iscallphys=.true. !iscallphys initialised as false in callkeys_mod module |
---|
117 | |
---|
118 | !!! IF(ierr.EQ.0) THEN |
---|
119 | IF(iscallphys) THEN |
---|
120 | PRINT* |
---|
121 | PRINT* |
---|
122 | PRINT*,'--------------------------------------------' |
---|
123 | PRINT*,' inifis: Parametres pour la physique (callphys.def)' |
---|
124 | PRINT*,'--------------------------------------------' |
---|
125 | |
---|
126 | write(*,*) "Directory where external input files are:" |
---|
127 | ! default 'datadir' is set in "datadir_mod" |
---|
128 | call getin_p("datadir",datadir) ! default path |
---|
129 | write(*,*) " datadir = ",trim(datadir) |
---|
130 | |
---|
131 | write(*,*) "Run with or without tracer transport ?" |
---|
132 | tracer=.false. ! default value |
---|
133 | call getin_p("tracer",tracer) |
---|
134 | write(*,*) " tracer = ",tracer |
---|
135 | |
---|
136 | write(*,*) "Run with or without atm mass update ", & |
---|
137 | " due to tracer evaporation/condensation?" |
---|
138 | mass_redistrib=.false. ! default value |
---|
139 | call getin_p("mass_redistrib",mass_redistrib) |
---|
140 | write(*,*) " mass_redistrib = ",mass_redistrib |
---|
141 | |
---|
142 | write(*,*) "Diurnal cycle ?" |
---|
143 | write(*,*) "(if diurnal=false, diurnal averaged solar heating)" |
---|
144 | diurnal=.true. ! default value |
---|
145 | call getin_p("diurnal",diurnal) |
---|
146 | write(*,*) " diurnal = ",diurnal |
---|
147 | |
---|
148 | write(*,*) "Seasonal cycle ?" |
---|
149 | write(*,*) "(if season=false, Ls stays constant, to value ", & |
---|
150 | "set in 'start'" |
---|
151 | season=.true. ! default value |
---|
152 | call getin_p("season",season) |
---|
153 | write(*,*) " season = ",season |
---|
154 | |
---|
155 | write(*,*) "No seasonal cycle: initial day to lock the run during restart" |
---|
156 | noseason_day=0.0 ! default value |
---|
157 | call getin_p("noseason_day",noseason_day) |
---|
158 | write(*,*) "noseason_day=", noseason_day |
---|
159 | |
---|
160 | write(*,*) "Tidally resonant rotation ?" |
---|
161 | tlocked=.false. ! default value |
---|
162 | call getin_p("tlocked",tlocked) |
---|
163 | write(*,*) "tlocked = ",tlocked |
---|
164 | |
---|
165 | write(*,*) "Saturn ring shadowing ?" |
---|
166 | rings_shadow = .false. |
---|
167 | call getin_p("rings_shadow", rings_shadow) |
---|
168 | write(*,*) "rings_shadow = ", rings_shadow |
---|
169 | |
---|
170 | write(*,*) "Compute latitude-dependent gravity field?" |
---|
171 | oblate = .false. |
---|
172 | call getin_p("oblate", oblate) |
---|
173 | write(*,*) "oblate = ", oblate |
---|
174 | |
---|
175 | write(*,*) "Flattening of the planet (a-b)/a " |
---|
176 | flatten = 0.0 |
---|
177 | call getin_p("flatten", flatten) |
---|
178 | write(*,*) "flatten = ", flatten |
---|
179 | |
---|
180 | write(*,*) "Needed if oblate=.true.: J2" |
---|
181 | J2 = 0.0 |
---|
182 | call getin_p("J2", J2) |
---|
183 | write(*,*) "J2 = ", J2 |
---|
184 | |
---|
185 | write(*,*) "Needed if oblate=.true.: Planet mass (*1e24 kg)" |
---|
186 | MassPlanet = 0.0 |
---|
187 | call getin_p("MassPlanet", MassPlanet) |
---|
188 | write(*,*) "MassPlanet = ", MassPlanet |
---|
189 | |
---|
190 | write(*,*) "Needed if oblate=.true.: Planet mean radius (m)" |
---|
191 | Rmean = 0.0 |
---|
192 | call getin_p("Rmean", Rmean) |
---|
193 | write(*,*) "Rmean = ", Rmean |
---|
194 | |
---|
195 | write(*,*) "Compute effective altitude-dependent gravity field?" |
---|
196 | eff_gz = .false. |
---|
197 | call getin_p("eff_gz", eff_gz) |
---|
198 | write(*,*) "eff_gz = ", eff_gz |
---|
199 | |
---|
200 | write(*,*) "Nudging of zonal wind to keep the super-rotation" |
---|
201 | nudging_u = .true. |
---|
202 | call getin_p("nudging_u", nudging_u) |
---|
203 | write(*,*) "nudging_u = ", nudging_u |
---|
204 | |
---|
205 | write(*,*) "Nudging relaxation time (here ~ 1 titanian year in secondes)" |
---|
206 | nudging_dt = 9.3e8 |
---|
207 | call getin_p("nudging_dt", nudging_dt) |
---|
208 | write(*,*) "nudging_dt = ", nudging_dt |
---|
209 | |
---|
210 | write(*,*) "New optics for clouds" |
---|
211 | opt4clouds = .true. |
---|
212 | call getin_p("opt4clouds", opt4clouds) |
---|
213 | write(*,*) "opt4clouds = ", opt4clouds |
---|
214 | |
---|
215 | write(*,*) "Cloudy fraction in the Clear / Dark column method" |
---|
216 | Fcloudy = 1.0 |
---|
217 | call getin_p("Fcloudy", Fcloudy) |
---|
218 | write(*,*) "Fcloudy = ", Fcloudy |
---|
219 | |
---|
220 | write(*,*) "Adjustment of droplet properties in the VIS" |
---|
221 | FCVIS = 1.0 |
---|
222 | call getin_p("FCVIS", FCVIS) |
---|
223 | write(*,*) "FCVIS = ", FCVIS |
---|
224 | |
---|
225 | write(*,*) "Adjustment of droplet properties in the IR" |
---|
226 | FCIR = 1.0 |
---|
227 | call getin_p("FCIR", FCIR) |
---|
228 | write(*,*) "FCIR = ", FCIR |
---|
229 | |
---|
230 | write(*,*) "Adjustment of aerosol properties in the VIS" |
---|
231 | FHVIS = 1.0 |
---|
232 | call getin_p("FHVIS", FHVIS) |
---|
233 | write(*,*) "FHVIS = ", FHVIS |
---|
234 | |
---|
235 | write(*,*) "Adjustment of aerosol properties in the IR" |
---|
236 | FHIR = 1.0 |
---|
237 | call getin_p("FHIR", FHIR) |
---|
238 | write(*,*) "FHIR = ", FHIR |
---|
239 | |
---|
240 | write(*,*) "Infinite tank of CH4 ?" |
---|
241 | resCH4_inf = .false. |
---|
242 | call getin_p("resCH4_inf", resCH4_inf) |
---|
243 | write(*,*) "resCH4_inf = ", resCH4_inf |
---|
244 | |
---|
245 | ! sanity check warning |
---|
246 | if (eff_gz) then |
---|
247 | print*,"WARNING : You run chemistry with effective altitude-dependent gravity field !!" |
---|
248 | print*,"You will have no coherence in your heating rates between physics and dynamics !!" |
---|
249 | print*,"I let you continue but you should rather set eff_gz =.false. ..." |
---|
250 | endif |
---|
251 | |
---|
252 | |
---|
253 | ! Test of incompatibility: |
---|
254 | ! if tlocked, then diurnal should be false |
---|
255 | if (tlocked.and.diurnal) then |
---|
256 | print*,'If diurnal=true, we should turn off tlocked.' |
---|
257 | stop |
---|
258 | endif |
---|
259 | |
---|
260 | write(*,*) "Tidal resonance ratio ?" |
---|
261 | nres=0 ! default value |
---|
262 | call getin_p("nres",nres) |
---|
263 | write(*,*) "nres = ",nres |
---|
264 | |
---|
265 | write(*,*) "Write some extra output to the screen ?" |
---|
266 | lwrite=.false. ! default value |
---|
267 | call getin_p("lwrite",lwrite) |
---|
268 | write(*,*) " lwrite = ",lwrite |
---|
269 | |
---|
270 | write(*,*) "Save statistics in file stats.nc ?" |
---|
271 | callstats=.true. ! default value |
---|
272 | call getin_p("callstats",callstats) |
---|
273 | write(*,*) " callstats = ",callstats |
---|
274 | |
---|
275 | write(*,*) "Test energy conservation of model physics ?" |
---|
276 | enertest=.false. ! default value |
---|
277 | call getin_p("enertest",enertest) |
---|
278 | write(*,*) " enertest = ",enertest |
---|
279 | |
---|
280 | write(*,*) "Check to see if cpp values used match gases.def ?" |
---|
281 | check_cpp_match=.true. ! default value |
---|
282 | call getin_p("check_cpp_match",check_cpp_match) |
---|
283 | write(*,*) " check_cpp_match = ",check_cpp_match |
---|
284 | |
---|
285 | write(*,*) "call radiative transfer ?" |
---|
286 | callrad=.true. ! default value |
---|
287 | call getin_p("callrad",callrad) |
---|
288 | write(*,*) " callrad = ",callrad |
---|
289 | |
---|
290 | write(*,*) "call correlated-k radiative transfer ?" |
---|
291 | corrk=.true. ! default value |
---|
292 | call getin_p("corrk",corrk) |
---|
293 | write(*,*) " corrk = ",corrk |
---|
294 | |
---|
295 | if (corrk) then |
---|
296 | ! default path is set in datadir |
---|
297 | write(*,*) "callcorrk: Correlated-k data base folder:",trim(datadir) |
---|
298 | call getin_p("corrkdir",corrkdir) |
---|
299 | write(*,*) " corrkdir = ",corrkdir |
---|
300 | |
---|
301 | write(*,*) "use correlated-k recombination instead of pre-mixed values ?" |
---|
302 | corrk_recombin=.false.! default value |
---|
303 | call getin_p("corrk_recombin",corrk_recombin) |
---|
304 | write(*,*) " corrk_recombin = ",corrk_recombin |
---|
305 | endif |
---|
306 | |
---|
307 | if (corrk .and. ngrid.eq.1) then |
---|
308 | write(*,*) "simulate global averaged conditions ?" |
---|
309 | global1d = .false. ! default value |
---|
310 | call getin_p("global1d",global1d) |
---|
311 | write(*,*) " global1d = ",global1d |
---|
312 | |
---|
313 | ! Test of incompatibility : if global1d is true, there should not be any diurnal cycle. |
---|
314 | if (global1d.and.diurnal) then |
---|
315 | write(*,*) "if global1d is true, diurnal must be set to false" |
---|
316 | stop |
---|
317 | endif |
---|
318 | |
---|
319 | if (global1d) then |
---|
320 | write(*,*) "Solar Zenith angle (deg.) ?" |
---|
321 | write(*,*) "(assumed for averaged solar flux S/4)" |
---|
322 | szangle=60.0 ! default value |
---|
323 | call getin_p("szangle",szangle) |
---|
324 | write(*,*) " szangle = ",szangle |
---|
325 | endif |
---|
326 | endif |
---|
327 | |
---|
328 | write(*,*) "prohibit calculations outside corrk T grid?" |
---|
329 | strictboundcorrk=.true. ! default value |
---|
330 | call getin_p("strictboundcorrk",strictboundcorrk) |
---|
331 | write(*,*) "strictboundcorrk = ",strictboundcorrk |
---|
332 | |
---|
333 | write(*,*) "Minimum atmospheric temperature for Planck function integration ?" |
---|
334 | tplanckmin=30.0 ! default value |
---|
335 | call getin_p("tplanckmin",tplanckmin) |
---|
336 | write(*,*) " tplanckmin = ",tplanckmin |
---|
337 | |
---|
338 | write(*,*) "Maximum atmospheric temperature for Planck function integration ?" |
---|
339 | tplanckmax=1500.0 ! default value |
---|
340 | call getin_p("tplanckmax",tplanckmax) |
---|
341 | write(*,*) " tplanckmax = ",tplanckmax |
---|
342 | |
---|
343 | write(*,*) "Temperature step for Planck function integration ?" |
---|
344 | dtplanck=0.1 ! default value |
---|
345 | call getin_p("dtplanck",dtplanck) |
---|
346 | write(*,*) " dtplanck = ",dtplanck |
---|
347 | |
---|
348 | write(*,*) "call gaseous absorption in the visible bands?", & |
---|
349 | "(matters only if callrad=T)" |
---|
350 | callgasvis=.false. ! default value |
---|
351 | call getin_p("callgasvis",callgasvis) |
---|
352 | write(*,*) " callgasvis = ",callgasvis |
---|
353 | |
---|
354 | write(*,*) "call continuum opacities in radiative transfer ?", & |
---|
355 | "(matters only if callrad=T)" |
---|
356 | continuum=.true. ! default value |
---|
357 | call getin_p("continuum",continuum) |
---|
358 | write(*,*) " continuum = ",continuum |
---|
359 | |
---|
360 | write(*,*) "version for H2H2 CIA file ?" |
---|
361 | versH2H2cia=2011 ! default value (should be 2018 but retrocompatibility first) |
---|
362 | call getin_p("versH2H2cia",versH2H2cia) |
---|
363 | write(*,*) " versH2H2cia = ",versH2H2cia |
---|
364 | ! Sanity check |
---|
365 | if (versH2H2cia.ne.2011 .and. versH2H2cia.ne.2018) then |
---|
366 | print*,'Error: Choose a correct value (2011 or 2018) for versH2H2cia !' |
---|
367 | call abort |
---|
368 | endif |
---|
369 | |
---|
370 | write(*,*) "call turbulent vertical diffusion ?" |
---|
371 | calldifv=.true. ! default value |
---|
372 | call getin_p("calldifv",calldifv) |
---|
373 | write(*,*) " calldifv = ",calldifv |
---|
374 | |
---|
375 | write(*,*) "use turbdiff instead of vdifc ?" |
---|
376 | UseTurbDiff=.true. ! default value |
---|
377 | call getin_p("UseTurbDiff",UseTurbDiff) |
---|
378 | write(*,*) " UseTurbDiff = ",UseTurbDiff |
---|
379 | |
---|
380 | write(*,*) "call convective adjustment ?" |
---|
381 | calladj=.true. ! default value |
---|
382 | call getin_p("calladj",calladj) |
---|
383 | write(*,*) " calladj = ",calladj |
---|
384 | |
---|
385 | write(*,*) "Radiative timescale for Newtonian cooling ?" |
---|
386 | tau_relax=30. ! default value |
---|
387 | call getin_p("tau_relax",tau_relax) |
---|
388 | write(*,*) " tau_relax = ",tau_relax |
---|
389 | tau_relax=tau_relax*24*3600 ! convert Earth days --> seconds |
---|
390 | |
---|
391 | write(*,*)"call thermal conduction in the soil ?" |
---|
392 | callsoil=.true. ! default value |
---|
393 | call getin_p("callsoil",callsoil) |
---|
394 | write(*,*) " callsoil = ",callsoil |
---|
395 | |
---|
396 | write(*,*)"Rad transfer is computed every iradia", & |
---|
397 | " physical timestep" |
---|
398 | iradia=1 ! default value |
---|
399 | call getin_p("iradia",iradia) |
---|
400 | write(*,*)" iradia = ",iradia |
---|
401 | |
---|
402 | write(*,*)"Rayleigh scattering ?" |
---|
403 | rayleigh=.false. |
---|
404 | call getin_p("rayleigh",rayleigh) |
---|
405 | write(*,*)" rayleigh = ",rayleigh |
---|
406 | |
---|
407 | write(*,*) "Use blackbody for stellar spectrum ?" |
---|
408 | stelbbody=.false. ! default value |
---|
409 | call getin_p("stelbbody",stelbbody) |
---|
410 | write(*,*) " stelbbody = ",stelbbody |
---|
411 | |
---|
412 | write(*,*) "Stellar blackbody temperature ?" |
---|
413 | stelTbb=5800.0 ! default value |
---|
414 | call getin_p("stelTbb",stelTbb) |
---|
415 | write(*,*) " stelTbb = ",stelTbb |
---|
416 | |
---|
417 | write(*,*)"Output mean OLR in 1D?" |
---|
418 | meanOLR=.false. |
---|
419 | call getin_p("meanOLR",meanOLR) |
---|
420 | write(*,*)" meanOLR = ",meanOLR |
---|
421 | |
---|
422 | write(*,*)"Output spectral OLR in 3D?" |
---|
423 | specOLR=.false. |
---|
424 | call getin_p("specOLR",specOLR) |
---|
425 | write(*,*)" specOLR = ",specOLR |
---|
426 | |
---|
427 | write(*,*)"Output diagnostic optical thickness attenuation exp(-tau)?" |
---|
428 | diagdtau=.false. |
---|
429 | call getin_p("diagdtau",diagdtau) |
---|
430 | write(*,*)" diagdtau = ",diagdtau |
---|
431 | |
---|
432 | write(*,*)"Uniform absorption in radiative transfer?" |
---|
433 | graybody=.false. |
---|
434 | call getin_p("graybody",graybody) |
---|
435 | write(*,*)" graybody = ",graybody |
---|
436 | |
---|
437 | ! Chemistry |
---|
438 | |
---|
439 | write(*,*) "Run with or without chemistry?" |
---|
440 | callchim=.false. ! default value |
---|
441 | call getin_p("callchim",callchim) |
---|
442 | write(*,*) " callchim = ",callchim |
---|
443 | |
---|
444 | ! sanity check |
---|
445 | if (callchim.and.(.not.tracer)) then |
---|
446 | print*,"You are running chemistry without tracer" |
---|
447 | print*,"Please start again with tracer =.true." |
---|
448 | stop |
---|
449 | endif |
---|
450 | |
---|
451 | write(*,*)"Chemistry is computed every ichim", & |
---|
452 | " physical timestep" |
---|
453 | ichim=1 ! default value |
---|
454 | call getin_p("ichim",ichim) |
---|
455 | write(*,*)" ichim = ",ichim |
---|
456 | |
---|
457 | ! Microphysics |
---|
458 | |
---|
459 | write(*,*) "Use haze seasonal model from Karkoschka 2016 ?" |
---|
460 | seashaze=.true. ! default value |
---|
461 | call getin_p("seashaze",seashaze) |
---|
462 | write(*,*)" seashaze = ",seashaze |
---|
463 | |
---|
464 | write(*,*) "Run with or without microphysics?" |
---|
465 | callmufi=.false. ! default value |
---|
466 | call getin_p("callmufi",callmufi) |
---|
467 | write(*,*)" callmufi = ",callmufi |
---|
468 | |
---|
469 | ! sanity check |
---|
470 | if (callmufi.and.(.not.tracer)) then |
---|
471 | print*,"You are running microphysics without tracer" |
---|
472 | print*,"Please start again with tracer =.true." |
---|
473 | stop |
---|
474 | endif |
---|
475 | |
---|
476 | write(*,*) "Compute clouds?" |
---|
477 | callclouds=.false. ! default value |
---|
478 | call getin_p("callclouds",callclouds) |
---|
479 | write(*,*)" callclouds = ",callclouds |
---|
480 | |
---|
481 | ! sanity check |
---|
482 | if (callclouds.and.(.not.callmufi)) then |
---|
483 | print*,"You are trying to make clouds without microphysics !" |
---|
484 | print*,"Please start again with callmufi =.true." |
---|
485 | stop |
---|
486 | endif |
---|
487 | |
---|
488 | write(*,*) "Disable the coupling of microphysics within rad. transf. ?" |
---|
489 | write(*,*) "If disabled we will assume a planetwide vert. profile of extinction ..." |
---|
490 | uncoupl_optic_haze=.true. ! default value - true as long as the microphysics is bugged |
---|
491 | call getin_p("uncoupl_optic_haze",uncoupl_optic_haze) |
---|
492 | write(*,*)" uncoupl_optic_haze = ",uncoupl_optic_haze |
---|
493 | |
---|
494 | write(*,*) "Pressure level of aer. production (Pa) ?" |
---|
495 | p_prod=1.0 ! default value |
---|
496 | call getin_p("p_prod",p_prod) |
---|
497 | write(*,*)" p_prod = ",p_prod |
---|
498 | |
---|
499 | write(*,*) "Aerosol production rate (kg.m-2.s-1) ?" |
---|
500 | tx_prod=3.5e-13 ! default value |
---|
501 | call getin_p("tx_prod",tx_prod) |
---|
502 | write(*,*)" tx_prod = ",tx_prod |
---|
503 | |
---|
504 | write(*,*) "Equivalent radius production (m) ?" |
---|
505 | rc_prod=2.0e-8 ! default value |
---|
506 | call getin_p("rc_prod",rc_prod) |
---|
507 | write(*,*)" rhc_prod = ",rc_prod |
---|
508 | |
---|
509 | write(*,*) "Radius of air (nitrogen) molecule (m) ?" |
---|
510 | air_rad=1.75e-10 ! default value |
---|
511 | call getin_p("air_rad",air_rad) |
---|
512 | write(*,*)" air_rad = ",air_rad |
---|
513 | |
---|
514 | write(*,*) "Path to microphys. config file ?" |
---|
515 | config_mufi='datagcm/microphysics/config.cfg' ! default value |
---|
516 | call getin_p("config_mufi",config_mufi) |
---|
517 | write(*,*)" config_mufi = ",config_mufi |
---|
518 | |
---|
519 | ! Soil model |
---|
520 | write(*,*)"Number of sub-surface layers for soil scheme?" |
---|
521 | ! default value of nsoilmx set in comsoil_h |
---|
522 | call getin_p("nsoilmx",nsoilmx) |
---|
523 | write(*,*)" nsoilmx=",nsoilmx |
---|
524 | |
---|
525 | write(*,*)"Thickness of topmost soil layer (m)?" |
---|
526 | ! default value of lay1_soil set in comsoil_h |
---|
527 | call getin_p("lay1_soil",lay1_soil) |
---|
528 | write(*,*)" lay1_soil = ",lay1_soil |
---|
529 | |
---|
530 | write(*,*)"Coefficient for soil layer thickness distribution?" |
---|
531 | ! default value of alpha_soil set in comsoil_h |
---|
532 | call getin_p("alpha_soil",alpha_soil) |
---|
533 | write(*,*)" alpha_soil = ",alpha_soil |
---|
534 | |
---|
535 | write(*,*)"Remove lower boundary?" |
---|
536 | nosurf=.false. |
---|
537 | call getin_p("nosurf",nosurf) |
---|
538 | write(*,*)" nosurf = ",nosurf |
---|
539 | |
---|
540 | ! Tests of incompatibility: |
---|
541 | if (nosurf.and.callsoil) then |
---|
542 | print*,'nosurf not compatible with soil scheme!' |
---|
543 | print*,'... got to make a choice!' |
---|
544 | call abort |
---|
545 | endif |
---|
546 | |
---|
547 | write(*,*)"Add an internal heat flux?", & |
---|
548 | "... matters only if callsoil=F" |
---|
549 | intheat=0. |
---|
550 | call getin_p("intheat",intheat) |
---|
551 | write(*,*)" intheat = ",intheat |
---|
552 | |
---|
553 | write(*,*)"Use Newtonian cooling for radiative transfer?" |
---|
554 | newtonian=.false. |
---|
555 | call getin_p("newtonian",newtonian) |
---|
556 | write(*,*)" newtonian = ",newtonian |
---|
557 | |
---|
558 | ! Tests of incompatibility: |
---|
559 | if (newtonian.and.corrk) then |
---|
560 | print*,'newtonian not compatible with correlated-k!' |
---|
561 | call abort |
---|
562 | endif |
---|
563 | if (newtonian.and.calladj) then |
---|
564 | print*,'newtonian not compatible with adjustment!' |
---|
565 | call abort |
---|
566 | endif |
---|
567 | if (newtonian.and.calldifv) then |
---|
568 | print*,'newtonian not compatible with a boundary layer!' |
---|
569 | call abort |
---|
570 | endif |
---|
571 | |
---|
572 | write(*,*)"Test physics timescale in 1D?" |
---|
573 | testradtimes=.false. |
---|
574 | call getin_p("testradtimes",testradtimes) |
---|
575 | write(*,*)" testradtimes = ",testradtimes |
---|
576 | |
---|
577 | ! Test of incompatibility: |
---|
578 | ! if testradtimes used, we must be in 1D |
---|
579 | if (testradtimes.and.(ngrid.gt.1)) then |
---|
580 | print*,'testradtimes can only be used in 1D!' |
---|
581 | call abort |
---|
582 | endif |
---|
583 | |
---|
584 | write(*,*)"Which star?" |
---|
585 | startype=1 ! default value = Sol |
---|
586 | call getin_p("startype",startype) |
---|
587 | write(*,*)" startype = ",startype |
---|
588 | |
---|
589 | write(*,*)"Value of stellar flux at 1 AU?" |
---|
590 | Fat1AU=1356.0 ! default value = Sol today |
---|
591 | call getin_p("Fat1AU",Fat1AU) |
---|
592 | write(*,*)" Fat1AU = ",Fat1AU |
---|
593 | |
---|
594 | write(*,*) "Does user want to force cpp and mugaz?" |
---|
595 | force_cpp=.false. ! default value |
---|
596 | call getin_p("force_cpp",force_cpp) |
---|
597 | write(*,*) " force_cpp = ",force_cpp |
---|
598 | |
---|
599 | if (force_cpp) then |
---|
600 | mugaz = -99999. |
---|
601 | PRINT *,'MEAN MOLECULAR MASS in g mol-1 ?' |
---|
602 | call getin_p("mugaz",mugaz) |
---|
603 | IF (mugaz.eq.-99999.) THEN |
---|
604 | PRINT *, "mugaz must be set if force_cpp = T" |
---|
605 | STOP |
---|
606 | ELSE |
---|
607 | write(*,*) "mugaz=",mugaz |
---|
608 | ENDIF |
---|
609 | cpp = -99999. |
---|
610 | PRINT *,'SPECIFIC HEAT CAPACITY in J K-1 kg-1 ?' |
---|
611 | call getin_p("cpp",cpp) |
---|
612 | IF (cpp.eq.-99999.) THEN |
---|
613 | PRINT *, "cpp must be set if force_cpp = T" |
---|
614 | STOP |
---|
615 | ELSE |
---|
616 | write(*,*) "cpp=",cpp |
---|
617 | ENDIF |
---|
618 | endif ! of if (force_cpp) |
---|
619 | |
---|
620 | call su_gases(nlayer,tracer) |
---|
621 | call calc_cpp_mugaz |
---|
622 | |
---|
623 | PRINT*,'--------------------------------------------' |
---|
624 | PRINT* |
---|
625 | PRINT* |
---|
626 | ELSE |
---|
627 | write(*,*) |
---|
628 | write(*,*) 'Cannot read file callphys.def. Is it here ?' |
---|
629 | stop |
---|
630 | ENDIF ! of IF(iscallphys) |
---|
631 | |
---|
632 | PRINT* |
---|
633 | PRINT*,'inifis: daysec',daysec |
---|
634 | PRINT* |
---|
635 | PRINT*,'inifis: The radiative transfer is computed:' |
---|
636 | PRINT*,' each ',iradia,' physical time-step' |
---|
637 | PRINT*,' or each ',iradia*dtphys,' seconds' |
---|
638 | PRINT* |
---|
639 | PRINT*,'inifis: Chemistry is computed:' |
---|
640 | PRINT*,' each ',ichim,' physical time-step' |
---|
641 | PRINT*,' or each ',ichim*dtphys,' seconds' |
---|
642 | PRINT* |
---|
643 | |
---|
644 | !----------------------------------------------------------------------- |
---|
645 | ! Some more initialization: |
---|
646 | ! ------------------------ |
---|
647 | |
---|
648 | ! Initializations for comgeomfi_h |
---|
649 | #ifndef MESOSCALE |
---|
650 | totarea=SSUM(ngrid,parea,1) |
---|
651 | call planetwide_sumval(parea,totarea_planet) |
---|
652 | |
---|
653 | !! those are defined in comdiurn_h.F90 |
---|
654 | IF (.not.ALLOCATED(sinlat)) ALLOCATE(sinlat(ngrid)) |
---|
655 | IF (.not.ALLOCATED(coslat)) ALLOCATE(coslat(ngrid)) |
---|
656 | IF (.not.ALLOCATED(sinlon)) ALLOCATE(sinlon(ngrid)) |
---|
657 | IF (.not.ALLOCATED(coslon)) ALLOCATE(coslon(ngrid)) |
---|
658 | |
---|
659 | DO ig=1,ngrid |
---|
660 | sinlat(ig)=sin(plat(ig)) |
---|
661 | coslat(ig)=cos(plat(ig)) |
---|
662 | sinlon(ig)=sin(plon(ig)) |
---|
663 | coslon(ig)=cos(plon(ig)) |
---|
664 | ENDDO |
---|
665 | #endif |
---|
666 | ! initialize variables in radinc_h |
---|
667 | call ini_radinc_h(nlayer,tplanckmin,tplanckmax,dtplanck) |
---|
668 | |
---|
669 | ! allocate "comsoil_h" arrays |
---|
670 | call ini_comsoil_h(ngrid) |
---|
671 | |
---|
672 | END SUBROUTINE inifis |
---|
673 | |
---|
674 | END MODULE inifis_mod |
---|