source: trunk/LMDZ.MARS/libf/phymars/inifis.F @ 415

Last change on this file since 415 was 414, checked in by aslmd, 14 years ago

LMDZ.MARS : NEW NLTE MODEL FROM GRANADA AMIGOS

23/11/11 == FGG + MALV

New parameterization of the NLTE 15 micron cooling. The old parameterization is kept as an option, including or not variable atomic oxygen concentration. A new flag is introduced in callphys.def, nltemodel, to select which parameterization wants to be used (new one, old one with variable [O], or old one with fixed [O], see below). Includes many new subroutines and commons in phymars. Some existing routines are also modified:

-physiq.F. Call to the new subroutine NLTE_leedat in first call. Call to nltecool modified to allow for variable atomic oxygen. Depending on the value of nltemodel, the new subroutine NLTEdlvr09_TCOOL is called instead of nltecool.

-inifis.F. Reading of nltemodel is added.

-callkeys.h Declaration of nltemodel is added.

The following lines should be added to callphys.def (ideally after setting callnlte):

# NLTE 15um scheme to use.
# 0-> Old scheme, static oxygen
# 1-> Old scheme, dynamic oxygen
# 2-> New scheme
nltemodel = 2

A new directory, NLTEDAT, has to be included in datagcm.

Improvements into NLTE NIR heating parameterization to take into account variability with O/CO2 ratio and SZA. A new subroutine, NIR_leedat.F, and a new common, NIRdata.h, are included. A new flag, nircorr, is added in callphys.def, to include or not these corrections. The following files are modified:

-nirco2abs.F: nq and pq are added in the arguments. The corrections factors are interpolated to the GCM grid and included in the clculation. A new subroutine, interpnir, is added at the end of the file.

-physiq.F: Call to NIR_leedat added at first call. Modified call to nirco2abs

-inifis: Reading new flag nircorr.

-callkeys.h: Declaration of nircorr.

The following lines have to be added to callphys.def (ideally after callnirco2):

# NIR NLTE correction for variable SZA and O/CO2?
# matters only if callnirco2=T
# 0-> no correction
# 1-> include correction
nircorr=1

A new data file, NIRcorrection_feb2011.dat, has to be included in datagcm.

Small changes to the molecular diffusion scheme to fix the number of species considered, to avoid problems when compiling with more than 15 tracers (for example, when CH4 is included). Modified subroutines: aeronomars/moldiff.F and aeronomars/moldiffcoeff.F

File size: 24.9 KB
Line 
1      SUBROUTINE inifis(
2     $           ngrid,nlayer
3     $           ,day_ini,pdaysec,ptimestep
4     $           ,plat,plon,parea
5     $           ,prad,pg,pr,pcpp
6#ifdef MESOSCALE
7#include "meso_inc/meso_inc_inifisinvar.F"
8#endif
9     $           )
10!
11!=======================================================================
12!
13!   purpose:
14!   -------
15!
16!   Initialisation for the physical parametrisations of the LMD
17!   martian atmospheric general circulation modele.
18!
19!   author: Frederic Hourdin 15 / 10 /93
20!   -------
21!   modified: Sebastien Lebonnois 11/06/2003 (new callphys.def)
22!             Ehouarn Millour (oct. 2008) tracers are now identified
23!              by their names and may not be contiguously
24!              stored in the q(:,:,:,:) array
25!             E.M. (june 2009) use getin routine to load parameters
26!             adapted to the mesoscale use - Aymeric Spiga - 01/2007-07/2011
27!
28!
29!   arguments:
30!   ----------
31!
32!   input:
33!   ------
34!
35!    ngrid                 Size of the horizontal grid.
36!                          All internal loops are performed on that grid.
37!    nlayer                Number of vertical layers.
38!    pdayref               Day of reference for the simulation
39!    pday                  Number of days counted from the North. Spring
40!                          equinoxe.
41!
42!=======================================================================
43!
44!-----------------------------------------------------------------------
45!   declarations:
46!   -------------
47! to use  'getin'
48      USE ioipsl_getincom
49      IMPLICIT NONE
50#include "dimensions.h"
51#include "dimphys.h"
52#include "planete.h"
53#include "comcstfi.h"
54#include "comsaison.h"
55#include "comdiurn.h"
56#include "comgeomfi.h"
57#include "callkeys.h"
58#include "surfdat.h"
59#include "dimradmars.h"
60#include "yomaer.h"
61#include "datafile.h"
62#include "slope.h"
63#include "microphys.h"
64#ifdef MESOSCALE
65#include "comsoil.h"     !!MESOSCALE -- needed to fill volcapa
66#include "meso_inc/meso_inc_inifisvar.F"
67#endif
68      REAL prad,pg,pr,pcpp,pdaysec
69
70      REAL ptimestep
71      INTEGER day_ini
72
73      INTEGER ngrid,nlayer
74      REAL plat(ngrid),plon(ngrid),parea(ngridmx)
75      INTEGER ig,ierr
76 
77!      EXTERNAL iniorbit,orbite
78      EXTERNAL SSUM
79      REAL SSUM
80 
81      CHARACTER ch1*12
82      CHARACTER ch80*80
83
84!      logical chem, h2o
85
86!      chem = .false.
87!      h2o = .false.
88
89      rad=prad
90      cpp=pcpp
91      g=pg
92      r=pr
93      rcp=r/cpp
94      daysec=pdaysec
95      dtphys=ptimestep
96#ifdef MESOSCALE
97#include "meso_inc/meso_inc_inifisini.F"
98#endif
99
100! --------------------------------------------------------
101!     The usual Tests
102!     --------------
103      IF (nlayer.NE.nlayermx) THEN
104         PRINT*,'STOP in inifis'
105         PRINT*,'Probleme de dimensions :'
106         PRINT*,'nlayer     = ',nlayer
107         PRINT*,'nlayermx   = ',nlayermx
108         STOP
109      ENDIF
110
111      IF (ngrid.NE.ngridmx) THEN
112         PRINT*,'STOP in inifis'
113         PRINT*,'Probleme de dimensions :'
114         PRINT*,'ngrid     = ',ngrid
115         PRINT*,'ngridmx   = ',ngridmx
116         STOP
117      ENDIF
118
119! --------------------------------------------------------------
120!  Reading the "callphys.def" file controlling some key options
121! --------------------------------------------------------------
122     
123      ! check that 'callphys.def' file is around
124      OPEN(99,file='callphys.def',status='old',form='formatted'
125     &     ,iostat=ierr)
126      CLOSE(99)
127     
128      IF(ierr.EQ.0) THEN
129         PRINT*
130         PRINT*
131         PRINT*,'--------------------------------------------'
132         PRINT*,' inifis: Parameters for the physics (callphys.def)'
133         PRINT*,'--------------------------------------------'
134
135         write(*,*) "Directory where external input files are:"
136         datafile="/data/fgglmd/datagcm/datafile"
137         call getin("datadir",datafile) ! default path
138         write(*,*) " datafile = ",trim(datafile)
139
140         write(*,*) "Run with or without tracer transport ?"
141         tracer=.false. ! default value
142         call getin("tracer",tracer)
143         write(*,*) " tracer = ",tracer
144
145         write(*,*) "Diurnal cycle ?"
146         write(*,*) "(if diurnal=False, diurnal averaged solar heating)"
147         diurnal=.true. ! default value
148         call getin("diurnal",diurnal)
149         write(*,*) " diurnal = ",diurnal
150
151         write(*,*) "Seasonal cycle ?"
152         write(*,*) "(if season=False, Ls stays constant, to value ",
153     &   "set in 'start'"
154         season=.true. ! default value
155         call getin("season",season)
156         write(*,*) " season = ",season
157
158         write(*,*) "Write some extra output to the screen ?"
159         lwrite=.false. ! default value
160         call getin("lwrite",lwrite)
161         write(*,*) " lwrite = ",lwrite
162
163         write(*,*) "Save statistics in file stats.nc ?"
164#ifdef MESOSCALE
165         callstats=.false. ! default value
166#else
167         callstats=.true. ! default value
168#endif
169         call getin("callstats",callstats)
170         write(*,*) " callstats = ",callstats
171
172         write(*,*) "Save EOF profiles in file 'profiles' for ",
173     &              "Climate Database?"
174         calleofdump=.false. ! default value
175         call getin("calleofdump",calleofdump)
176         write(*,*) " calleofdump = ",calleofdump
177
178         write(*,*) "Dust scenario: 1=constant dust (read from startfi",
179     &   " or set as tauvis); 2=Viking scenario; =3 MGS scenario,",
180     &   "=4 Mars Year 24 from TES assimilation, ",
181     &   "=24,25 or 26 :Mars Year 24,25 or 26 from TES assimilation"
182         iaervar=3 ! default value
183         call getin("iaervar",iaervar)
184         write(*,*) " iaervar = ",iaervar
185
186         write(*,*) "Reference (visible) dust opacity at 700 Pa ",
187     &   "(matters only if iaervar=1)"
188         ! NB: default value of tauvis is set/read in startfi.nc file
189         call getin("tauvis",tauvis)
190         write(*,*) " tauvis = ",tauvis
191
192         write(*,*) "Dust vertical distribution:"
193         write(*,*) "(=1 top set by topdustref parameter;",
194     & " =2 Viking scenario; =3 MGS scenario)"
195         iddist=3 ! default value
196         call getin("iddist",iddist)
197         write(*,*) " iddist = ",iddist
198
199         write(*,*) "Dust top altitude (km). (Matters only if iddist=1)"
200         topdustref= 90.0 ! default value
201         call getin("topdustref",topdustref)
202         write(*,*) " topdustref = ",topdustref
203
204         write(*,*) "call radiative transfer ?"
205         callrad=.true. ! default value
206         call getin("callrad",callrad)
207         write(*,*) " callrad = ",callrad
208
209         write(*,*) "call slope insolation scheme ?",
210     &              "(matters only if callrad=T)"
211#ifdef MESOSCALE
212         callslope=.true. ! default value
213#else
214         callslope=.false. ! default value (not supported yet)
215#endif
216         call getin("callslope",callslope)
217         write(*,*) " callslope = ",callslope
218
219         write(*,*) "call NLTE radiative schemes ?",
220     &              "(matters only if callrad=T)"
221         callnlte=.false. ! default value
222         call getin("callnlte",callnlte)
223         write(*,*) " callnlte = ",callnlte
224         
225         nltemodel=0    !default value
226         write(*,*) "NLTE model?"
227         write(*,*) "0 -> old model, static O"
228         write(*,*) "1 -> old model, dynamic O"
229         write(*,*) "2 -> new model"
230         write(*,*) "(matters only if callnlte=T)"
231         call getin("nltemodel",nltemodel)
232         write(*,*) " nltemodel = ",nltemodel
233
234         write(*,*) "call CO2 NIR absorption ?",
235     &              "(matters only if callrad=T)"
236         callnirco2=.false. ! default value
237         call getin("callnirco2",callnirco2)
238         write(*,*) " callnirco2 = ",callnirco2
239
240         write(*,*) "New NIR NLTE correction ?",
241     $              "0-> old model (no correction)",
242     $              "1-> new correction",
243     $              "(matters only if callnirco2=T)"
244         call getin("nircorr",nircorr)
245         write(*,*) " nircorr = ",nircorr
246
247         write(*,*) "call turbulent vertical diffusion ?"
248         calldifv=.true. ! default value
249         call getin("calldifv",calldifv)
250         write(*,*) " calldifv = ",calldifv
251
252         write(*,*) "call thermals ?"
253         calltherm=.false. ! default value
254         call getin("calltherm",calltherm)
255         write(*,*) " calltherm = ",calltherm
256
257         write(*,*) "output thermal diagnostics ?"
258         outptherm=.false. ! default value
259         call getin("outptherm",outptherm)
260         write(*,*) " outptherm = ",outptherm
261
262         write(*,*) "call convective adjustment ?"
263         calladj=.true. ! default value
264         call getin("calladj",calladj)
265         write(*,*) " calladj = ",calladj
266         
267         if (calltherm .and. (.not. calladj)) then
268          print*,'Convadj has to be activated when using thermals'
269          stop
270         endif
271
272         write(*,*) "call Richardson-based surface layer ?"
273         callrichsl=.false. ! default value
274         call getin("callrichsl",callrichsl)
275         write(*,*) " callrichsl = ",callrichsl
276
277         if (calltherm .and. .not.callrichsl) then
278          print*,'WARNING WARNING WARNING'
279          print*,'if calltherm=T we strongly advise that '
280          print*,'you use the new surface layer scheme '
281          print*,'by setting callrichsl=T '
282         endif
283
284         write(*,*) "call CO2 condensation ?"
285         callcond=.true. ! default value
286         call getin("callcond",callcond)
287         write(*,*) " callcond = ",callcond
288
289         write(*,*)"call thermal conduction in the soil ?"
290         callsoil=.true. ! default value
291         call getin("callsoil",callsoil)
292         write(*,*) " callsoil = ",callsoil
293         
294
295         write(*,*)"call Lott's gravity wave/subgrid topography ",
296     &             "scheme ?"
297         calllott=.true. ! default value
298         call getin("calllott",calllott)
299         write(*,*)" calllott = ",calllott
300
301
302         write(*,*)"rad.transfer is computed every iradia",
303     &             " physical timestep"
304         iradia=1 ! default value
305         call getin("iradia",iradia)
306         write(*,*)" iradia = ",iradia
307         
308
309         write(*,*)"Output of the exchange coefficient mattrix ?",
310     &             "(for diagnostics only)"
311         callg2d=.false. ! default value
312         call getin("callg2d",callg2d)
313         write(*,*)" callg2d = ",callg2d
314
315         write(*,*)"Rayleigh scattering : (should be .false. for now)"
316         rayleigh=.false.
317         call getin("rayleigh",rayleigh)
318         write(*,*)" rayleigh = ",rayleigh
319
320
321! TRACERS:
322
323! dustbin
324         write(*,*)"Transported dust ? (if >0, use 'dustbin' dust bins)"
325         dustbin=0 ! default value
326         call getin("dustbin",dustbin)
327         write(*,*)" dustbin = ",dustbin
328! active
329         write(*,*)"Radiatively active dust ? (matters if dustbin>0)"
330         active=.false. ! default value
331         call getin("active",active)
332         write(*,*)" active = ",active
333
334! Test of incompatibility:
335! if active is used, then dustbin should be > 0
336
337         if (active.and.(dustbin.lt.1)) then
338           print*,'if active is used, then dustbin should > 0'
339           stop
340         endif
341! doubleq
342         write(*,*)"use mass and number mixing ratios to predict",
343     &             " dust size ?"
344         doubleq=.false. ! default value
345         call getin("doubleq",doubleq)
346         write(*,*)" doubleq = ",doubleq
347! submicron
348         submicron=.false. ! default value
349         call getin("submicron",submicron)
350         write(*,*)" submicron = ",submicron
351
352! Test of incompatibility:
353! if doubleq is used, then dustbin should be 2
354
355         if (doubleq.and.(dustbin.ne.2)) then
356           print*,'if doubleq is used, then dustbin should be 2'
357           stop
358         endif
359         if (doubleq.and.submicron.and.(nqmx.LT.3)) then
360           print*,'If doubleq is used with a submicron tracer,'
361           print*,' then the number of tracers has to be'
362           print*,' larger than 3.'
363           stop
364         endif
365! lifting
366         write(*,*)"dust lifted by GCM surface winds ?"
367         lifting=.false. ! default value
368         call getin("lifting",lifting)
369         write(*,*)" lifting = ",lifting
370
371! Test of incompatibility:
372! if lifting is used, then dustbin should be > 0
373
374         if (lifting.and.(dustbin.lt.1)) then
375           print*,'if lifting is used, then dustbin should > 0'
376           stop
377         endif
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! Test of incompatibility:
409
410         if (activice.and..not.water) then
411           print*,'if activice is used, water should be used too'
412           stop
413         endif
414
415         if (water.and..not.tracer) then
416           print*,'if water is used, tracer should be used too'
417           stop
418         endif
419! microphys
420         write(*,*)"Microphysical scheme for water-ice clouds?"
421         microphys=.false. ! default value
422         call getin("microphys",microphys)
423         write(*,*)" microphys = ",microphys
424
425! microphysical parameter contact       
426         write(*,*) "water contact parameter ?"
427         mteta  = 0.95
428         call getin("mteta",mteta)
429         write(*,*) "mteta = ", mteta
430
431! scavenging
432         write(*,*)"Dust scavenging by H2O/CO2 snowfall ?"
433         scavenging=.false. ! default value
434         call getin("scavenging",scavenging)
435         write(*,*)" scavenging = ",scavenging
436         
437
438! Test of incompatibility:
439! if scavenging is used, then dustbin should be > 0
440
441         if (scavenging.and.(dustbin.lt.1)) then
442           print*,'if scavenging is used, then dustbin should > 0'
443           stop
444         endif
445         if ((microphys.and..not.doubleq).or.
446     &       (microphys.and..not.active).or.
447     &       (microphys.and..not.scavenging).or.
448     &       (microphys.and..not.water)) then
449           print*,'if microphys is used, then doubleq,'
450           print*,'active, water and scavenging must all be used!'
451           stop
452         endif
453         if ((scavenging.and..not.doubleq).or.
454     &       (scavenging.and..not.active).or.
455     &       (scavenging.and..not.water).or.
456     &       (scavenging.and..not.microphys)) then
457           print*,'if scavenging is used, then doubleq,'
458           print*,'active, water and microphys must all be used!'
459           stop
460         endif
461
462! Test of incompatibility:
463
464         write(*,*) "Permanent water caps at poles ?",
465     &               " .true. is RECOMMENDED"
466         write(*,*) "(with .true., North cap is a source of water ",
467     &   "and South pole is a cold trap)"
468         caps=.true. ! default value
469         call getin("caps",caps)
470         write(*,*) " caps = ",caps
471
472! albedo_h2o_ice
473         write(*,*) "water ice albedo ?"
474         albedo_h2o_ice=0.45
475         call getin("albedo_h2o_ice",albedo_h2o_ice)
476         write(*,*) " albedo_h2o_ice = ",albedo_h2o_ice
477! inert_h2o_ice
478         write(*,*) "water ice thermal inertia ?"
479         inert_h2o_ice=2400 ! (J.m^-2.K^-1.s^-1/2)
480         call getin("inert_h2o_ice",inert_h2o_ice)
481         write(*,*) " inert_h2o_ice = ",inert_h2o_ice
482! frost_albedo_threshold
483         write(*,*) "frost thickness threshold for albedo ?"
484         frost_albedo_threshold=0.005 ! 5.4 mic (i.e 0.005 kg.m-2)
485         call getin("frost_albedo_threshold",
486     &    frost_albedo_threshold)
487         write(*,*) " frost_albedo_threshold = ",
488     &            frost_albedo_threshold
489
490!!!!!!!!!!!!!!!! TEMP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
491!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     
492         write(*,*) "temp tag for water caps ?"
493         temptag=.false.
494         call getin("temptag",temptag)
495         write(*,*) " temptag = ",temptag
496!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
497!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!             
498
499         write(*,*) "photochemistry: include chemical species"
500         photochem=.false. ! default value
501         call getin("photochem",photochem)
502         write(*,*) " photochem = ",photochem
503
504
505! THERMOSPHERE
506
507         write(*,*) "call thermosphere ?"
508         callthermos=.false. ! default value
509         call getin("callthermos",callthermos)
510         write(*,*) " callthermos = ",callthermos
511         
512
513         write(*,*) " water included without cycle ",
514     &              "(only if water=.false.)"
515         thermoswater=.false. ! default value
516         call getin("thermoswater",thermoswater)
517         write(*,*) " thermoswater = ",thermoswater
518
519         write(*,*) "call thermal conduction ?",
520     &    " (only if callthermos=.true.)"
521         callconduct=.false. ! default value
522         call getin("callconduct",callconduct)
523         write(*,*) " callconduct = ",callconduct
524
525         write(*,*) "call EUV heating ?",
526     &   " (only if callthermos=.true.)"
527         calleuv=.false.  ! default value
528         call getin("calleuv",calleuv)
529         write(*,*) " calleuv = ",calleuv
530
531         write(*,*) "call molecular viscosity ?",
532     &   " (only if callthermos=.true.)"
533         callmolvis=.false. ! default value
534         call getin("callmolvis",callmolvis)
535         write(*,*) " callmolvis = ",callmolvis
536
537         write(*,*) "call molecular diffusion ?",
538     &   " (only if callthermos=.true.)"
539         callmoldiff=.false. ! default value
540         call getin("callmoldiff",callmoldiff)
541         write(*,*) " callmoldiff = ",callmoldiff
542         
543
544         write(*,*) "call thermospheric photochemistry ?",
545     &   " (only if callthermos=.true.)"
546         thermochem=.false. ! default value
547         call getin("thermochem",thermochem)
548         write(*,*) " thermochem = ",thermochem
549
550         write(*,*) "date for solar flux calculation:",
551     &   " (1985 < date < 2002)"
552         write(*,*) "(Solar min=1996.4 ave=1993.4 max=1990.6)"
553         solarcondate=1993.4 ! default value
554         call getin("solarcondate",solarcondate)
555         write(*,*) " solarcondate = ",solarcondate
556         
557
558         if (.not.callthermos) then
559           if (thermoswater) then
560             print*,'if thermoswater is set, callthermos must be true'
561             stop
562           endif         
563           if (callconduct) then
564             print*,'if callconduct is set, callthermos must be true'
565             stop
566           endif       
567           if (calleuv) then
568             print*,'if calleuv is set, callthermos must be true'
569             stop
570           endif         
571           if (callmolvis) then
572             print*,'if callmolvis is set, callthermos must be true'
573             stop
574           endif       
575           if (callmoldiff) then
576             print*,'if callmoldiff is set, callthermos must be true'
577             stop
578           endif         
579           if (thermochem) then
580             print*,'if thermochem is set, callthermos must be true'
581             stop
582           endif         
583        endif
584
585! Test of incompatibility:
586! if photochem is used, then water should be used too
587
588         if (photochem.and..not.water) then
589           print*,'if photochem is used, water should be used too'
590           stop
591         endif
592
593! if callthermos is used, then thermoswater should be used too
594! (if water not used already)
595
596         if (callthermos .and. .not.water) then
597           if (callthermos .and. .not.thermoswater) then
598             print*,'if callthermos is used, water or thermoswater
599     &               should be used too'
600             stop
601           endif
602         endif
603
604         PRINT*,'--------------------------------------------'
605         PRINT*
606         PRINT*
607      ELSE
608         write(*,*)
609         write(*,*) 'Cannot read file callphys.def. Is it here ?'
610         stop
611      ENDIF
612
6138000  FORMAT(t5,a12,l8)
6148001  FORMAT(t5,a12,i8)
615
616      PRINT*
617      PRINT*,'inifis: daysec',daysec
618      PRINT*
619      PRINT*,'inifis: The radiative transfer is computed:'
620      PRINT*,'           each ',iradia,' physical time-step'
621      PRINT*,'        or each ',iradia*dtphys,' seconds'
622      PRINT*
623! --------------------------------------------------------------
624!  Managing the Longwave radiative transfer
625! --------------------------------------------------------------
626
627!     In most cases, the run just use the following values :
628!     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
629      callemis=.true.     
630!     ilwd=10*int(daysec/dtphys) ! bug before 22/10/01       
631      ilwd=1
632      ilwn=1 !2
633      ilwb=1 !2
634      linear=.true.       
635      ncouche=3
636      alphan=0.4
637      semi=0
638
639!     BUT people working hard on the LW may want to read them in 'radia.def'
640!     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
641
642      OPEN(99,file='radia.def',status='old',form='formatted'
643     .     ,iostat=ierr)
644      IF(ierr.EQ.0) THEN
645         write(*,*) 'inifis: Reading radia.def !!!'
646         READ(99,fmt='(a)') ch1
647         READ(99,*) callemis
648         WRITE(*,8000) ch1,callemis
649
650         READ(99,fmt='(a)') ch1
651         READ(99,*) iradia
652         WRITE(*,8001) ch1,iradia
653
654         READ(99,fmt='(a)') ch1
655         READ(99,*) ilwd
656         WRITE(*,8001) ch1,ilwd
657
658         READ(99,fmt='(a)') ch1
659         READ(99,*) ilwn
660         WRITE(*,8001) ch1,ilwn
661
662         READ(99,fmt='(a)') ch1
663         READ(99,*) linear
664         WRITE(*,8000) ch1,linear
665
666         READ(99,fmt='(a)') ch1
667         READ(99,*) ncouche
668         WRITE(*,8001) ch1,ncouche
669
670         READ(99,fmt='(a)') ch1
671         READ(99,*) alphan
672         WRITE(*,*) ch1,alphan
673
674         READ(99,fmt='(a)') ch1
675         READ(99,*) ilwb
676         WRITE(*,8001) ch1,ilwb
677
678
679         READ(99,fmt='(a)') ch1
680         READ(99,'(l1)') callg2d
681         WRITE(*,8000) ch1,callg2d
682
683         READ(99,fmt='(a)') ch1
684         READ(99,*) semi
685         WRITE(*,*) ch1,semi
686      end if
687      CLOSE(99)
688
689!-----------------------------------------------------------------------
690!     Some more initialization:
691!     ------------------------
692
693      ! in 'comgeomfi.h'
694      CALL SCOPY(ngrid,plon,1,long,1)
695      CALL SCOPY(ngrid,plat,1,lati,1)
696      CALL SCOPY(ngrid,parea,1,area,1)
697      totarea=SSUM(ngridmx,area,1)
698
699      ! in 'comdiurn.h'
700      DO ig=1,ngrid
701         sinlat(ig)=sin(plat(ig))
702         coslat(ig)=cos(plat(ig))
703         sinlon(ig)=sin(plon(ig))
704         coslon(ig)=cos(plon(ig))
705      ENDDO
706
707      pi=2.*asin(1.) ! NB: pi is a common in comcstfi.h
708
709!     managing the tracers, and tests:
710!     -------------------------------
711!     Ehouarn: removed; as these tests are now done in initracer.F
712!      if(tracer) then
713!
714!!          when photochem is used, nqchem_min is the rank
715!!          of the first chemical species
716!
717!! Ehouarn: nqchem_min is now meaningless and no longer used
718!!       nqchem_min = 1
719!       if (photochem .or. callthermos) then
720!         chem = .true.
721!       end if
722!
723!       if (water .or. thermoswater) h2o = .true.
724!
725!!          TESTS
726!
727!       print*,'inifis: TRACERS:'
728!       write(*,*) "    chem=",chem,"    h2o=",h2o
729!!       write(*,*) "   doubleq=",doubleq
730!!       write(*,*) "   dustbin=",dustbin
731!
732!       if ((doubleq).and.(h2o).and.
733!     $     (chem)) then
734!         print*,' 2 dust tracers (doubleq)'
735!         print*,' 1 water vapour tracer'
736!         print*,' 1 water ice tracer'
737!         print*,nqmx-4,' chemistry tracers'
738!       endif
739!
740!       if ((doubleq).and.(h2o).and.
741!     $     .not.(chem)) then
742!         print*,' 2 dust tracers (doubleq)'
743!         print*,' 1 water vapour tracer'
744!         print*,' 1 water ice tracer'
745!         if (nqmx.LT.4) then
746!           print*,'nqmx should be at least equal to'
747!           print*,'4 with these options.'
748!           stop
749!         endif
750!       endif
751!
752!       if (.not.(doubleq).and.(h2o).and.
753!     $     (chem)) then
754!         if (dustbin.gt.0) then
755!           print*,dustbin,' dust bins'
756!         endif
757!         print*,nqmx-2-dustbin,' chemistry tracers'
758!         print*,' 1 water vapour tracer'
759!         print*,' 1 water ice tracer'
760!       endif
761!
762!       if (.not.(doubleq).and.(h2o).and.
763!     $     .not.(chem)) then
764!         if (dustbin.gt.0) then
765!           print*,dustbin,' dust bins'
766!         endif
767!         print*,' 1 water vapour tracer'
768!         print*,' 1 water ice tracer'
769!         if (nqmx.gt.(dustbin+2)) then
770!           print*,'nqmx should be ',(dustbin+2),
771!     $            ' with these options...'
772!                  print*,'(or check callphys.def)'
773!         endif
774!         if (nqmx.lt.(dustbin+2)) then
775!           write(*,*) "inifis: nqmx.lt.(dustbin+2)"
776!           stop
777!         endif
778!       endif
779!
780!      endif ! of if (tracer)
781!
782!      RETURN
783      END
Note: See TracBrowser for help on using the repository browser.