source: trunk/LMDZ.MARS/libf/phymars/conf_phys.F @ 1246

Last change on this file since 1246 was 1246, checked in by aslmd, 11 years ago

LMDZ.MARS. Made number of scatterers a free dimension not in need to be prescribe at compiling time. Instead it must be set in callphys.def. See README for further information about this commit.

File size: 26.8 KB
Line 
1      SUBROUTINE conf_phys(ngrid,nlayer,nq)
2 
3!=======================================================================
4!
5!   purpose:
6!   -------
7!
8!   Initialisation for the physical parametrisations of the LMD
9!   martian atmospheric general circulation modele.
10!
11!   author: Frederic Hourdin 15 / 10 /93
12!   -------
13!   modified: Sebastien Lebonnois 11/06/2003 (new callphys.def)
14!             Ehouarn Millour (oct. 2008) tracers are now identified
15!              by their names and may not be contiguously
16!              stored in the q(:,:,:,:) array
17!             E.M. (june 2009) use getin routine to load parameters
18!             adapted to the mesoscale use - Aymeric Spiga - 01/2007-07/2011
19!             separated inifis into conf_phys and phys_state_var_init (A. Spiga)
20!
21!
22!   arguments:
23!   ----------
24!
25!   input:
26!   ------
27!
28!    nq                    Number of tracers
29!
30!=======================================================================
31!
32!-----------------------------------------------------------------------
33!   declarations:
34!   -------------
35! to use  'getin'
36      USE ioipsl_getincom, only : getin
37      use tracer_mod, only : nuice_sed, ccn_factor
38      use surfdat_h, only: albedo_h2o_ice, inert_h2o_ice,
39     &                     frost_albedo_threshold
40      use control_mod, only: ecritphy
41      use planete_h
42      USE comcstfi_h, only: daysec,dtphys
43      use dimradmars_mod, only: naerkind, name_iaer,
44     &                      ini_scatterers,tauvis
45
46      IMPLICIT NONE
47#include "dimensions.h"
48#include "dimphys.h"
49!#include "comsaison.h"
50!#include "comdiurn.h"
51!#include "comgeomfi.h"
52#include "callkeys.h"
53!#include "surfdat.h"
54!#include "dimradmars.h"
55#include "datafile.h"
56!#include "slope.h"
57#include "microphys.h"
58!#include "tracer.h"
59
60      INTEGER,INTENT(IN) :: ngrid,nlayer,nq
61      INTEGER ig,ierr,j
62 
63      CHARACTER ch1*12
64      CHARACTER ch80*80
65
66      ! read in 'ecritphy' (frequency of calls to physics, in dynamical steps)
67      ! (also done in dyn3d/defrun_new but not in LMDZ.COMMON)
68      call getin("ecritphy",ecritphy)
69     
70! --------------------------------------------------------------
71!  Reading the "callphys.def" file controlling some key options
72! --------------------------------------------------------------
73     
74      ! check that 'callphys.def' file is around
75      OPEN(99,file='callphys.def',status='old',form='formatted'
76     &     ,iostat=ierr)
77      CLOSE(99)
78     
79      IF(ierr.EQ.0) THEN
80         PRINT*
81         PRINT*
82         PRINT*,'--------------------------------------------'
83         PRINT*,' conf_phys: Parameters for the physics (callphys.def)'
84         PRINT*,'--------------------------------------------'
85
86         write(*,*) "Directory where external input files are:"
87         datafile="/u/forget/WWW/datagcm/datafile"
88         call getin("datadir",datafile) ! default path
89         write(*,*) " datafile = ",trim(datafile)
90
91         write(*,*) "Run with or without tracer transport ?"
92         tracer=.false. ! default value
93         call getin("tracer",tracer)
94         write(*,*) " tracer = ",tracer
95
96         write(*,*) "Diurnal cycle ?"
97         write(*,*) "(if diurnal=False, diurnal averaged solar heating)"
98         diurnal=.true. ! default value
99         call getin("diurnal",diurnal)
100         write(*,*) " diurnal = ",diurnal
101
102         write(*,*) "Seasonal cycle ?"
103         write(*,*) "(if season=False, Ls stays constant, to value ",
104     &   "set in 'start'"
105         season=.true. ! default value
106         call getin("season",season)
107         write(*,*) " season = ",season
108
109         write(*,*) "Write some extra output to the screen ?"
110         lwrite=.false. ! default value
111         call getin("lwrite",lwrite)
112         write(*,*) " lwrite = ",lwrite
113
114         write(*,*) "Save statistics in file stats.nc ?"
115#ifdef MESOSCALE
116         callstats=.false. ! default value
117#else
118         callstats=.true. ! default value
119#endif
120         call getin("callstats",callstats)
121         write(*,*) " callstats = ",callstats
122
123         write(*,*) "Save EOF profiles in file 'profiles' for ",
124     &              "Climate Database?"
125         calleofdump=.false. ! default value
126         call getin("calleofdump",calleofdump)
127         write(*,*) " calleofdump = ",calleofdump
128
129         write(*,*) "Dust scenario: 1=constant dust (read from startfi",
130     &   " or set as tauvis); 2=Viking scenario; =3 MGS scenario,",
131     &   "=6 cold (low dust) scenario; =7 warm (high dust) scenario ",
132     &   "=24,25 ... 30 :Mars Year 24, ... or 30 from TES assimilation"
133         iaervar=3 ! default value
134         call getin("iaervar",iaervar)
135         write(*,*) " iaervar = ",iaervar
136
137         write(*,*) "Reference (visible) dust opacity at 610 Pa ",
138     &   "(matters only if iaervar=1)"
139         ! NB: default value of tauvis is set/read in startfi.nc file
140         call getin("tauvis",tauvis)
141         write(*,*) " tauvis = ",tauvis
142
143         write(*,*) "Dust vertical distribution:"
144         write(*,*) "(=1 top set by topdustref parameter;",
145     & " =2 Viking scenario; =3 MGS scenario)"
146         iddist=3 ! default value
147         call getin("iddist",iddist)
148         write(*,*) " iddist = ",iddist
149
150         write(*,*) "Dust top altitude (km). (Matters only if iddist=1)"
151         topdustref= 90.0 ! default value
152         call getin("topdustref",topdustref)
153         write(*,*) " topdustref = ",topdustref
154
155         write(*,*) "Prescribed surface thermal flux (H/(rho*cp),K m/s)"
156         tke_heat_flux=0. ! default value
157         call getin("tke_heat_flux",tke_heat_flux)
158         write(*,*) " tke_heat_flux = ",tke_heat_flux
159         write(*,*) " 0 means the usual schemes are computing"
160
161         write(*,*) "call radiative transfer ?"
162         callrad=.true. ! default value
163         call getin("callrad",callrad)
164         write(*,*) " callrad = ",callrad
165
166         write(*,*) "call slope insolation scheme ?",
167     &              "(matters only if callrad=T)"
168#ifdef MESOSCALE
169         callslope=.true. ! default value
170#else
171         callslope=.false. ! default value (not supported yet)
172#endif
173         call getin("callslope",callslope)
174         write(*,*) " callslope = ",callslope
175
176         write(*,*) "call NLTE radiative schemes ?",
177     &              "(matters only if callrad=T)"
178         callnlte=.false. ! default value
179         call getin("callnlte",callnlte)
180         write(*,*) " callnlte = ",callnlte
181         
182         nltemodel=0    !default value
183         write(*,*) "NLTE model?"
184         write(*,*) "0 -> old model, static O"
185         write(*,*) "1 -> old model, dynamic O"
186         write(*,*) "2 -> new model"
187         write(*,*) "(matters only if callnlte=T)"
188         call getin("nltemodel",nltemodel)
189         write(*,*) " nltemodel = ",nltemodel
190
191         write(*,*) "call CO2 NIR absorption ?",
192     &              "(matters only if callrad=T)"
193         callnirco2=.false. ! default value
194         call getin("callnirco2",callnirco2)
195         write(*,*) " callnirco2 = ",callnirco2
196
197         write(*,*) "New NIR NLTE correction ?",
198     $              "0-> old model (no correction)",
199     $              "1-> new correction",
200     $              "(matters only if callnirco2=T)"
201#ifdef MESOSCALE
202         nircorr=0      !default value. this is OK below 60 km.
203#else
204         nircorr=0      !default value
205#endif
206         call getin("nircorr",nircorr)
207         write(*,*) " nircorr = ",nircorr
208
209         write(*,*) "call turbulent vertical diffusion ?"
210         calldifv=.true. ! default value
211         call getin("calldifv",calldifv)
212         write(*,*) " calldifv = ",calldifv
213
214         write(*,*) "call thermals ?"
215         calltherm=.false. ! default value
216         call getin("calltherm",calltherm)
217         write(*,*) " calltherm = ",calltherm
218
219         write(*,*) "call convective adjustment ?"
220         calladj=.true. ! default value
221         call getin("calladj",calladj)
222         write(*,*) " calladj = ",calladj
223
224         if (calltherm .and. calladj) then
225          print*,'!!! PLEASE NOTE !!!'
226          print*,'convective adjustment is on'
227          print*,'but since thermal plume model is on'
228          print*,'convadj is only activated above the PBL'
229         endif
230       
231         write(*,*) "used latest version of yamada scheme?"
232         callyamada4=.true. ! default value
233         call getin("callyamada4",callyamada4)
234         write(*,*) " callyamada4 = ",callyamada4
235
236         if (calltherm .and. .not.callyamada4) then
237          print*,'!!!! WARNING WARNING WARNING !!!!'
238          print*,'if calltherm=T we strongly advise that '
239          print*,'you set the flag callyamada4 to T '
240          print*,'!!!! WARNING WARNING WARNING !!!!'
241         endif
242 
243         write(*,*) "call Richardson-based surface layer ?"
244         callrichsl=.false. ! default value
245         call getin("callrichsl",callrichsl)
246         write(*,*) " callrichsl = ",callrichsl
247
248         if (calltherm .and. .not.callrichsl) then
249          print*,'WARNING WARNING WARNING'
250          print*,'if calltherm=T we strongly advise that '
251          print*,'you use the new surface layer scheme '
252          print*,'by setting callrichsl=T '
253         endif
254
255         if (calladj .and. callrichsl .and. (.not. calltherm)) then
256          print*,'You should not be calling the convective adjustment
257     & scheme with the Richardson surface-layer and without the thermals
258     &. This approach is not
259     & physically consistent and can lead to unrealistic friction
260     & values.'
261          print*,'If you want to use the Ri. surface-layer, either
262     & activate thermals OR de-activate the convective adjustment.'
263          stop
264         endif
265
266         write(*,*) "call CO2 condensation ?"
267         callcond=.true. ! default value
268         call getin("callcond",callcond)
269         write(*,*) " callcond = ",callcond
270
271         write(*,*)"call thermal conduction in the soil ?"
272         callsoil=.true. ! default value
273         call getin("callsoil",callsoil)
274         write(*,*) " callsoil = ",callsoil
275         
276
277         write(*,*)"call Lott's gravity wave/subgrid topography ",
278     &             "scheme ?"
279         calllott=.true. ! default value
280         call getin("calllott",calllott)
281         write(*,*)" calllott = ",calllott
282
283
284         write(*,*)"rad.transfer is computed every iradia",
285     &             " physical timestep"
286         iradia=1 ! default value
287         call getin("iradia",iradia)
288         write(*,*)" iradia = ",iradia
289         
290
291         write(*,*)"Output of the exchange coefficient mattrix ?",
292     &             "(for diagnostics only)"
293         callg2d=.false. ! default value
294         call getin("callg2d",callg2d)
295         write(*,*)" callg2d = ",callg2d
296
297         write(*,*)"Rayleigh scattering : (should be .false. for now)"
298         rayleigh=.false.
299         call getin("rayleigh",rayleigh)
300         write(*,*)" rayleigh = ",rayleigh
301
302
303! TRACERS:
304
305! dustbin
306         write(*,*)"Transported dust ? (if >0, use 'dustbin' dust bins)"
307         dustbin=0 ! default value
308         call getin("dustbin",dustbin)
309         write(*,*)" dustbin = ",dustbin
310! active
311         write(*,*)"Radiatively active dust ? (matters if dustbin>0)"
312         active=.false. ! default value
313         call getin("active",active)
314         write(*,*)" active = ",active
315
316! Test of incompatibility:
317! if active is used, then dustbin should be > 0
318
319         if (active.and.(dustbin.lt.1)) then
320           print*,'if active is used, then dustbin should > 0'
321           stop
322         endif
323! doubleq
324         write(*,*)"use mass and number mixing ratios to predict",
325     &             " dust size ?"
326         doubleq=.false. ! default value
327         call getin("doubleq",doubleq)
328         write(*,*)" doubleq = ",doubleq
329! submicron
330         submicron=.false. ! default value
331         call getin("submicron",submicron)
332         write(*,*)" submicron = ",submicron
333
334! Test of incompatibility:
335! if doubleq is used, then dustbin should be 2
336
337         if (doubleq.and.(dustbin.ne.2)) then
338           print*,'if doubleq is used, then dustbin should be 2'
339           stop
340         endif
341         if (doubleq.and.submicron.and.(nq.LT.3)) then
342           print*,'If doubleq is used with a submicron tracer,'
343           print*,' then the number of tracers has to be'
344           print*,' larger than 3.'
345           stop
346         endif
347
348! lifting
349         write(*,*)"dust lifted by GCM surface winds ?"
350         lifting=.false. ! default value
351         call getin("lifting",lifting)
352         write(*,*)" lifting = ",lifting
353
354! Test of incompatibility:
355! if lifting is used, then dustbin should be > 0
356
357         if (lifting.and.(dustbin.lt.1)) then
358           print*,'if lifting is used, then dustbin should > 0'
359           stop
360         endif
361
362! free evolving dust
363! freedust=true just says that there is no lifting and no dust opacity scaling.
364         write(*,*)"dust lifted by GCM surface winds ?"
365         freedust=.false. ! default value
366         call getin("freedust",freedust)
367         write(*,*)" freedust = ",freedust
368         if (freedust.and..not.doubleq) then
369           print*,'freedust should be used with doubleq !'
370           stop
371         endif
372         if (freedust.and.lifting) then
373           print*,'if freedust is used, then lifting should not be used'
374           print*,'lifting forced to false !!'
375           lifting=.false.
376         endif
377
378! callddevil
379         write(*,*)" dust lifted by dust devils ?"
380         callddevil=.false. !default value
381         call getin("callddevil",callddevil)
382         write(*,*)" callddevil = ",callddevil
383
384! Test of incompatibility:
385! if dustdevil is used, then dustbin should be > 0
386
387         if (callddevil.and.(dustbin.lt.1)) then
388           print*,'if dustdevil is used, then dustbin should > 0'
389           stop
390         endif
391! sedimentation
392         write(*,*) "Gravitationnal sedimentation ?"
393         sedimentation=.true. ! default value
394         call getin("sedimentation",sedimentation)
395         write(*,*) " sedimentation = ",sedimentation
396! activice
397         write(*,*) "Radiatively active transported atmospheric ",
398     &              "water ice ?"
399         activice=.false. ! default value
400         call getin("activice",activice)
401         write(*,*) " activice = ",activice
402! water
403         write(*,*) "Compute water cycle ?"
404         water=.false. ! default value
405         call getin("water",water)
406         write(*,*) " water = ",water
407
408! thermal inertia feedback
409         write(*,*) "Activate the thermal inertia feedback ?"
410         tifeedback=.false. ! default value
411         call getin("tifeedback",tifeedback)
412         write(*,*) " tifeedback = ",tifeedback
413
414! Test of incompatibility:
415
416         if (tifeedback.and..not.water) then
417           print*,'if tifeedback is used,'
418           print*,'water should be used too'
419           stop
420         endif
421
422         if (tifeedback.and..not.callsoil) then
423           print*,'if tifeedback is used,'
424           print*,'callsoil should be used too'
425           stop
426         endif
427
428         if (activice.and..not.water) then
429           print*,'if activice is used, water should be used too'
430           stop
431         endif
432
433         if (water.and..not.tracer) then
434           print*,'if water is used, tracer should be used too'
435           stop
436         endif
437         
438! water ice clouds effective variance distribution for sedimentaion       
439        write(*,*) "effective variance for water ice clouds ?"
440        nuice_sed=0.45
441        call getin("nuice_sed",nuice_sed)
442        write(*,*) "water_param nueff Sedimentation:", nuice_sed
443         
444! ccn factor if no scavenging         
445        write(*,*) "water param CCN reduc. factor ?", ccn_factor
446        ccn_factor = 4.5
447        call getin("ccn_factor",ccn_factor)
448        write(*,*)" ccn_factor = ",ccn_factor
449        write(*,*)"Careful: only used when microphys=F, otherwise"
450        write(*,*)"the contact parameter is used instead;"
451
452! microphys
453         write(*,*)"Microphysical scheme for water-ice clouds?"
454         microphys=.false. ! default value
455         call getin("microphys",microphys)
456         write(*,*)" microphys = ",microphys
457
458! microphysical parameter contact       
459         write(*,*) "water contact parameter ?"
460         mteta  = 0.95
461         call getin("mteta",mteta)
462         write(*,*) "mteta = ", mteta
463
464! scavenging
465         write(*,*)"Dust scavenging by H2O/CO2 snowfall ?"
466         scavenging=.false. ! default value
467         call getin("scavenging",scavenging)
468         write(*,*)" scavenging = ",scavenging
469         
470
471! Test of incompatibility:
472! if scavenging is used, then dustbin should be > 0
473
474         if ((microphys.and..not.doubleq).or.
475     &       (microphys.and..not.water)) then
476             print*,'if microphys is used, then doubleq,'
477             print*,'and water must be used!'
478             stop
479         endif
480         if (microphys.and..not.scavenging) then
481             print*,''
482             print*,'----------------WARNING-----------------'
483             print*,'microphys is used without scavenging !!!'
484             print*,'----------------WARNING-----------------'
485             print*,''
486         endif
487
488         if ((scavenging.and..not.microphys).or.
489     &       (scavenging.and.(dustbin.lt.1))) then
490             print*,'if scavenging is used, then microphys'
491             print*,'must be used!'
492             stop
493         endif
494
495! Test of incompatibility:
496
497         write(*,*) "Permanent water caps at poles ?",
498     &               " .true. is RECOMMENDED"
499         write(*,*) "(with .true., North cap is a source of water ",
500     &   "and South pole is a cold trap)"
501         caps=.true. ! default value
502         call getin("caps",caps)
503         write(*,*) " caps = ",caps
504
505! albedo_h2o_ice
506         write(*,*) "water ice albedo ?"
507         albedo_h2o_ice=0.45
508         call getin("albedo_h2o_ice",albedo_h2o_ice)
509         write(*,*) " albedo_h2o_ice = ",albedo_h2o_ice
510! inert_h2o_ice
511         write(*,*) "water ice thermal inertia ?"
512         inert_h2o_ice=2400 ! (J.m^-2.K^-1.s^-1/2)
513         call getin("inert_h2o_ice",inert_h2o_ice)
514         write(*,*) " inert_h2o_ice = ",inert_h2o_ice
515! frost_albedo_threshold
516         write(*,*) "frost thickness threshold for albedo ?"
517         frost_albedo_threshold=0.005 ! 5.4 mic (i.e 0.005 kg.m-2)
518         call getin("frost_albedo_threshold",
519     &    frost_albedo_threshold)
520         write(*,*) " frost_albedo_threshold = ",
521     &            frost_albedo_threshold
522
523! call Titus crocus line -- DEFAULT IS NONE
524         write(*,*) "Titus crocus line ?"
525         tituscap=.false.  ! default value
526         call getin("tituscap",tituscap)
527         write(*,*) "tituscap",tituscap
528                     
529
530         write(*,*) "photochemistry: include chemical species"
531         photochem=.false. ! default value
532         call getin("photochem",photochem)
533         write(*,*) " photochem = ",photochem
534
535
536! SCATTERERS
537         write(*,*) "how many scatterers?"
538         naerkind=1 ! default value
539         call getin("naerkind",naerkind)
540         write(*,*)" naerkind = ",naerkind
541
542! Test of incompatibility
543c        Logical tests for radiatively active water-ice clouds:
544         IF ( (activice.AND.(.NOT.water)).OR.
545     &        (activice.AND.(naerkind.LT.2)) ) THEN
546           WRITE(*,*) 'If activice is TRUE, water has to be set'
547           WRITE(*,*) 'to TRUE, and "naerkind" must be at least'
548           WRITE(*,*) 'equal to 2.'
549           CALL ABORT
550         ELSE IF ( (.NOT.activice).AND.(naerkind.GT.1) ) THEN
551           WRITE(*,*) 'naerkind is greater than unity, but'
552           WRITE(*,*) 'activice has not been set to .true.'
553           WRITE(*,*) 'in callphys.def; this is not logical!'
554           CALL ABORT
555         ENDIF
556
557!------------------------------------------
558!------------------------------------------
559! once naerkind is known allocate arrays
560! -- we do it here and not in phys_var_init
561! -- because we need to know naerkind first
562         CALL ini_scatterers(ngrid,nlayer)
563!------------------------------------------
564!------------------------------------------
565
566
567c        Please name the different scatterers here ----------------
568         name_iaer(1) = "dust_conrath"   !! default choice is good old Conrath profile
569         IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme
570         if (nq.gt.1) then
571          ! trick to avoid problems compiling with 1 tracer
572          ! and picky compilers who know name_iaer(2) is out of bounds
573          j=2
574         IF (water.AND.activice) name_iaer(j) = "h2o_ice"      !! radiatively-active clouds
575         IF (submicron.AND.active) name_iaer(j) = "dust_submicron" !! JBM experimental stuff
576         endif ! of if (nq.gt.1)
577c        ----------------------------------------------------------
578
579! THERMOSPHERE
580
581         write(*,*) "call thermosphere ?"
582         callthermos=.false. ! default value
583         call getin("callthermos",callthermos)
584         write(*,*) " callthermos = ",callthermos
585         
586
587         write(*,*) " water included without cycle ",
588     &              "(only if water=.false.)"
589         thermoswater=.false. ! default value
590         call getin("thermoswater",thermoswater)
591         write(*,*) " thermoswater = ",thermoswater
592
593         write(*,*) "call thermal conduction ?",
594     &    " (only if callthermos=.true.)"
595         callconduct=.false. ! default value
596         call getin("callconduct",callconduct)
597         write(*,*) " callconduct = ",callconduct
598
599         write(*,*) "call EUV heating ?",
600     &   " (only if callthermos=.true.)"
601         calleuv=.false.  ! default value
602         call getin("calleuv",calleuv)
603         write(*,*) " calleuv = ",calleuv
604
605         write(*,*) "call molecular viscosity ?",
606     &   " (only if callthermos=.true.)"
607         callmolvis=.false. ! default value
608         call getin("callmolvis",callmolvis)
609         write(*,*) " callmolvis = ",callmolvis
610
611         write(*,*) "call molecular diffusion ?",
612     &   " (only if callthermos=.true.)"
613         callmoldiff=.false. ! default value
614         call getin("callmoldiff",callmoldiff)
615         write(*,*) " callmoldiff = ",callmoldiff
616         
617
618         write(*,*) "call thermospheric photochemistry ?",
619     &   " (only if callthermos=.true.)"
620         thermochem=.false. ! default value
621         call getin("thermochem",thermochem)
622         write(*,*) " thermochem = ",thermochem
623
624         write(*,*) "Method to include solar variability"
625         write(*,*) "0-> old method (using solarcondate); ",
626     &                  "1-> variability wit E10.7"
627         solvarmod=1
628         call getin("solvarmod",solvarmod)
629         write(*,*) " solvarmod = ",solvarmod
630
631         write(*,*) "date for solar flux calculation:",
632     &   " (1985 < date < 2002)",
633     $   " (Only used if solvarmod=0)"
634         write(*,*) "(Solar min=1996.4 ave=1993.4 max=1990.6)"
635         solarcondate=1993.4 ! default value
636         call getin("solarcondate",solarcondate)
637         write(*,*) " solarcondate = ",solarcondate
638         
639         write(*,*) "Solar variability as observed for MY: "
640         write(*,*) "Only if solvarmod=1"
641         solvaryear=24
642         call getin("solvaryear",solvaryear)
643         write(*,*) " solvaryear = ",solvaryear
644
645         write(*,*) "UV heating efficiency:",
646     &   "measured values between 0.19 and 0.23 (Fox et al. 1996)",
647     &   "lower values may be used to compensate low 15 um cooling"
648         euveff=0.21 !default value
649         call getin("euveff",euveff)
650         write(*,*) " euveff = ", euveff
651
652         if (.not.callthermos) then
653           if (thermoswater) then
654             print*,'if thermoswater is set, callthermos must be true'
655             stop
656           endif         
657           if (callconduct) then
658             print*,'if callconduct is set, callthermos must be true'
659             stop
660           endif       
661           if (calleuv) then
662             print*,'if calleuv is set, callthermos must be true'
663             stop
664           endif         
665           if (callmolvis) then
666             print*,'if callmolvis is set, callthermos must be true'
667             stop
668           endif       
669           if (callmoldiff) then
670             print*,'if callmoldiff is set, callthermos must be true'
671             stop
672           endif         
673           if (thermochem) then
674             print*,'if thermochem is set, callthermos must be true'
675             stop
676           endif         
677        endif
678
679! Test of incompatibility:
680! if photochem is used, then water should be used too
681
682         if (photochem.and..not.water) then
683           print*,'if photochem is used, water should be used too'
684           stop
685         endif
686
687! if callthermos is used, then thermoswater should be used too
688! (if water not used already)
689
690         if (callthermos .and. .not.water) then
691           if (callthermos .and. .not.thermoswater) then
692             print*,'if callthermos is used, water or thermoswater
693     &               should be used too'
694             stop
695           endif
696         endif
697
698         PRINT*,'--------------------------------------------'
699         PRINT*
700         PRINT*
701      ELSE
702         write(*,*)
703         write(*,*) 'Cannot read file callphys.def. Is it here ?'
704         stop
705      ENDIF
706
7078000  FORMAT(t5,a12,l8)
7088001  FORMAT(t5,a12,i8)
709
710      PRINT*
711      PRINT*,'conf_phys: daysec',daysec
712      PRINT*
713      PRINT*,'conf_phys: The radiative transfer is computed:'
714      PRINT*,'           each ',iradia,' physical time-step'
715      PRINT*,'        or each ',iradia*dtphys,' seconds'
716      PRINT*
717! --------------------------------------------------------------
718!  Managing the Longwave radiative transfer
719! --------------------------------------------------------------
720
721!     In most cases, the run just use the following values :
722!     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
723      callemis=.true.     
724!     ilwd=10*int(daysec/dtphys) ! bug before 22/10/01       
725      ilwd=1
726      ilwn=1 !2
727      ilwb=1 !2
728      linear=.true.       
729      ncouche=3
730      alphan=0.4
731      semi=0
732
733!     BUT people working hard on the LW may want to read them in 'radia.def'
734!     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
735
736      OPEN(99,file='radia.def',status='old',form='formatted'
737     .     ,iostat=ierr)
738      IF(ierr.EQ.0) THEN
739         write(*,*) 'conf_phys: Reading radia.def !!!'
740         READ(99,fmt='(a)') ch1
741         READ(99,*) callemis
742         WRITE(*,8000) ch1,callemis
743
744         READ(99,fmt='(a)') ch1
745         READ(99,*) iradia
746         WRITE(*,8001) ch1,iradia
747
748         READ(99,fmt='(a)') ch1
749         READ(99,*) ilwd
750         WRITE(*,8001) ch1,ilwd
751
752         READ(99,fmt='(a)') ch1
753         READ(99,*) ilwn
754         WRITE(*,8001) ch1,ilwn
755
756         READ(99,fmt='(a)') ch1
757         READ(99,*) linear
758         WRITE(*,8000) ch1,linear
759
760         READ(99,fmt='(a)') ch1
761         READ(99,*) ncouche
762         WRITE(*,8001) ch1,ncouche
763
764         READ(99,fmt='(a)') ch1
765         READ(99,*) alphan
766         WRITE(*,*) ch1,alphan
767
768         READ(99,fmt='(a)') ch1
769         READ(99,*) ilwb
770         WRITE(*,8001) ch1,ilwb
771
772
773         READ(99,fmt='(a)') ch1
774         READ(99,'(l1)') callg2d
775         WRITE(*,8000) ch1,callg2d
776
777         READ(99,fmt='(a)') ch1
778         READ(99,*) semi
779         WRITE(*,*) ch1,semi
780      end if
781      CLOSE(99)
782
783      END
Note: See TracBrowser for help on using the repository browser.