source: LMDZ6/trunk/libf/dyn3dmem/conf_gcm.F90 @ 4087

Last change on this file since 4087 was 4055, checked in by lguez, 2 years ago

Check that the value of iflag_top_bound is valid

This check is useful because if iflag_top_bound is not between 0 and
2 then the program runs with an undefined value of lambda in procedure
top_bound_loc.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 33.8 KB
Line 
1
2! $Id$
3
4SUBROUTINE conf_gcm( tapedef, etatinit )
5
6  USE control_mod
7#ifdef CPP_IOIPSL
8  use IOIPSL
9#else
10  ! if not using IOIPSL, we still need to use (a local version of) getin
11  use ioipsl_getincom
12#endif
13  use misc_mod
14  use mod_filtre_fft, ONLY : use_filtre_fft
15  use mod_filtre_fft_loc, ONLY : use_filtre_fft_loc=>use_filtre_fft
16  use mod_hallo, ONLY : use_mpi_alloc
17  USE infotrac, ONLY : type_trac
18  use assert_m, only: assert
19  USE comconst_mod, ONLY: dissip_deltaz, dissip_factz, dissip_zref, &
20                          iflag_top_bound, mode_top_bound, tau_top_bound, &
21                          ngroup
22  USE logic_mod, ONLY: fxyhypb, iflag_phys, ok_etat0, ok_gradsfile, &
23                       ok_guide, ok_limit, ok_strato, purmats, read_start, &
24                       ysinus, read_orop
25  USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, &
26                       alphax,alphay,taux,tauy
27  USE temps_mod, ONLY: calend, year_len
28
29  IMPLICIT NONE
30  !-----------------------------------------------------------------------
31  !     Auteurs :   L. Fairhead , P. Le Van  .
32
33  !     Arguments :
34
35  !     tapedef   :
36  !     etatinit  :     = TRUE   , on ne  compare pas les valeurs des para-
37  !     -metres  du zoom  avec  celles lues sur le fichier start .
38
39  LOGICAL,INTENT(IN) :: etatinit
40  INTEGER,INTENT(IN) :: tapedef
41
42  !   Declarations :
43  !   --------------
44  include "dimensions.h"
45  include "paramet.h"
46  include "comdissnew.h"
47  include "iniprint.h"
48
49  !   local:
50  !   ------
51
52  CHARACTER ch1*72,ch2*72,ch3*72,ch4*12
53  REAL clonn,clatt,grossismxx,grossismyy
54  REAL dzoomxx,dzoomyy, tauxx,tauyy
55  LOGICAL  fxyhypbb, ysinuss
56  INTEGER i
57  character(len=*),parameter :: modname="conf_gcm"
58  character (len=80) :: abort_message
59#ifdef CPP_OMP
60  integer,external :: OMP_GET_NUM_THREADS
61#endif
62
63  !  -------------------------------------------------------------------
64
65  !       .........     Version  du 29/04/97       ..........
66
67  !   Nouveaux parametres nitergdiv,nitergrot,niterh,tetagdiv,tetagrot,
68  !      tetatemp   ajoutes  pour la dissipation   .
69
70  !   Autre parametre ajoute en fin de liste de tapedef : ** fxyhypb **
71
72  !  Si fxyhypb = .TRUE. , choix de la fonction a derivee tangente hyperb.
73  !    Sinon , choix de fxynew  , a derivee sinusoidale  ..
74
75  !   ......  etatinit = . TRUE. si defrun  est appele dans ETAT0_LMD  ou
76  !         LIMIT_LMD  pour l'initialisation de start.dat (dic) et
77  !                de limit.dat ( dic)                        ...........
78  !           Sinon  etatinit = . FALSE .
79
80  !   Donc etatinit = .F.  si on veut comparer les valeurs de  grossismx ,
81  !    grossismy,clon,clat, fxyhypb  lues sur  le fichier  start  avec
82  !   celles passees  par run.def ,  au debut du gcm, apres l'appel a
83  !    lectba . 
84  !   Ces parmetres definissant entre autres la grille et doivent etre
85  !   pareils et coherents , sinon il y aura  divergence du gcm .
86
87  !-----------------------------------------------------------------------
88  !   initialisations:
89  !   ----------------
90
91  !Config  Key  = lunout
92  !Config  Desc = unite de fichier pour les impressions
93  !Config  Def  = 6
94  !Config  Help = unite de fichier pour les impressions
95  !Config         (defaut sortie standard = 6)
96  lunout=6
97  CALL getin('lunout', lunout)
98  IF (lunout /= 5 .and. lunout /= 6) THEN
99     OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write',  &
100          STATUS='unknown',FORM='formatted')
101  ENDIF
102
103  adjust=.false.
104  call getin('adjust',adjust)
105
106#ifdef CPP_OMP
107  ! adjust=y not implemented in case of OpenMP threads...
108  !$OMP PARALLEL
109  if ((OMP_GET_NUM_THREADS()>1).and.adjust) then
110     write(lunout,*)'conf_gcm: Error, adjust should be set to n' &
111          ,' when running with OpenMP threads'
112     abort_message = 'Wrong value for adjust'
113     call abort_gcm(modname,abort_message,1)
114  endif
115  !$OMP END PARALLEL         
116#endif
117
118  itaumax=0
119  call getin('itaumax',itaumax);
120  if (itaumax<=0) itaumax=HUGE(itaumax)
121
122  !Config  Key  = prt_level
123  !Config  Desc = niveau d'impressions de débogage
124  !Config  Def  = 0
125  !Config  Help = Niveau d'impression pour le débogage
126  !Config         (0 = minimum d'impression)
127  prt_level = 0
128  CALL getin('prt_level',prt_level)
129
130  !-----------------------------------------------------------------------
131  !  Parametres de controle du run:
132  !-----------------------------------------------------------------------
133  !Config  Key  = planet_type
134  !Config  Desc = planet type ("earth", "mars", "venus", ...)
135  !Config  Def  = earth
136  !Config  Help = this flag sets the type of atymosphere that is considered
137  planet_type="earth"
138  CALL getin('planet_type',planet_type)
139
140  !Config  Key  = calend
141  !Config  Desc = type de calendrier utilise
142  !Config  Def  = earth_360d
143  !Config  Help = valeur possible: earth_360d, earth_365d, earth_366d
144  !Config         
145  calend = 'earth_360d'
146! initialize year_len for aquaplanets and 1D
147  CALL getin('calend', calend)
148     if (calend == 'earth_360d') then
149        year_len=360
150      else if (calend == 'earth_365d') then
151        year_len=365
152      else if (calend == 'earth_366d') then
153        year_len=366
154      else
155        year_len=1
156      endif
157 
158
159  !Config  Key  = dayref
160  !Config  Desc = Jour de l'etat initial
161  !Config  Def  = 1
162  !Config  Help = Jour de l'etat initial ( = 350  si 20 Decembre ,
163  !Config         par expl. ,comme ici ) ... A completer
164  dayref=1
165  CALL getin('dayref', dayref)
166
167  !Config  Key  = anneeref
168  !Config  Desc = Annee de l'etat initial
169  !Config  Def  = 1998
170  !Config  Help = Annee de l'etat  initial
171  !Config         (   avec  4  chiffres   ) ... A completer
172  anneeref = 1998
173  CALL getin('anneeref',anneeref)
174
175  !Config  Key  = raz_date
176  !Config  Desc = Remise a zero de la date initiale
177  !Config  Def  = 0 (pas de remise a zero)
178  !Config  Help = Remise a zero de la date initiale
179  !Config         0 pas de remise a zero, on garde la date du fichier restart
180  !Config         1 prise en compte de la date de gcm.def avec remise a zero
181  !Config         des compteurs de pas de temps
182  raz_date = 0
183  CALL getin('raz_date', raz_date)
184
185  !Config  Key  = resetvarc
186  !Config  Desc = Reinit des variables de controle
187  !Config  Def  = n
188  !Config  Help = Reinit des variables de controle
189  resetvarc = .false.
190  CALL getin('resetvarc',resetvarc)
191
192  !Config  Key  = nday
193  !Config  Desc = Nombre de jours d'integration
194  !Config  Def  = 10
195  !Config  Help = Nombre de jours d'integration
196  !Config         ... On pourait aussi permettre des mois ou des annees !
197  nday = 10
198  CALL getin('nday',nday)
199
200  !Config  Key  = starttime
201  !Config  Desc = Heure de depart de la simulation
202  !Config  Def  = 0
203  !Config  Help = Heure de depart de la simulation
204  !Config         en jour
205  starttime = 0
206  CALL getin('starttime',starttime)
207
208  !Config  Key  = day_step
209  !Config  Desc = nombre de pas par jour
210  !Config  Def  = 240
211  !Config  Help = nombre de pas par jour (multiple de iperiod) (
212  !Config          ici pour  dt = 1 min )
213  day_step = 240
214  CALL getin('day_step',day_step)
215
216  !Config  Key  = nsplit_phys
217  nsplit_phys = 1
218  CALL getin('nsplit_phys',nsplit_phys)
219
220  !Config  Key  = iperiod
221  !Config  Desc = periode pour le pas Matsuno
222  !Config  Def  = 5
223  !Config  Help = periode pour le pas Matsuno (en pas de temps)
224  iperiod = 5
225  CALL getin('iperiod',iperiod)
226
227  !Config  Key  = iapp_tracvl
228  !Config  Desc = frequence du groupement des flux
229  !Config  Def  = iperiod
230  !Config  Help = frequence du groupement des flux (en pas de temps)
231  iapp_tracvl = iperiod
232  CALL getin('iapp_tracvl',iapp_tracvl)
233
234  !Config  Key  = iconser
235  !Config  Desc = periode de sortie des variables de controle
236  !Config  Def  = 240 
237  !Config  Help = periode de sortie des variables de controle
238  !Config         (En pas de temps)
239  iconser = 240 
240  CALL getin('iconser', iconser)
241
242  !Config  Key  = iecri
243  !Config  Desc = periode d'ecriture du fichier histoire
244  !Config  Def  = 1
245  !Config  Help = periode d'ecriture du fichier histoire (en jour)
246  iecri = 1
247  CALL getin('iecri',iecri)
248
249  !Config  Key  = periodav
250  !Config  Desc = periode de stockage fichier histmoy
251  !Config  Def  = 1
252  !Config  Help = periode de stockage fichier histmoy (en jour)
253  periodav = 1.
254  CALL getin('periodav',periodav)
255
256  !Config  Key  = output_grads_dyn
257  !Config  Desc = output dynamics diagnostics in 'dyn.dat' file
258  !Config  Def  = n
259  !Config  Help = output dynamics diagnostics in Grads-readable 'dyn.dat' file
260  output_grads_dyn=.false.
261  CALL getin('output_grads_dyn',output_grads_dyn)
262
263  !Config  Key  = dissip_period
264  !Config  Desc = periode de la dissipation
265  !Config  Def  = 0
266  !Config  Help = periode de la dissipation
267  !Config  dissip_period=0 => la valeur sera calcule dans inidissip       
268  !Config  dissip_period>0 => on prend cette valeur
269  dissip_period = 0
270  CALL getin('dissip_period',dissip_period)
271
272  !cc  ....   P. Le Van , modif le 29/04/97 .pour la dissipation  ...
273  !cc
274
275  !Config  Key  = lstardis
276  !Config  Desc = choix de l'operateur de dissipation
277  !Config  Def  = y
278  !Config  Help = choix de l'operateur de dissipation
279  !Config         'y' si on veut star et 'n' si on veut non-start !
280  !Config         Moi y en a pas comprendre !
281  lstardis = .TRUE.
282  CALL getin('lstardis',lstardis)
283
284  !Config  Key  = nitergdiv
285  !Config  Desc = Nombre d'iteration de gradiv
286  !Config  Def  = 1
287  !Config  Help = nombre d'iterations de l'operateur de dissipation
288  !Config         gradiv
289  nitergdiv = 1
290  CALL getin('nitergdiv',nitergdiv)
291
292  !Config  Key  = nitergrot
293  !Config  Desc = nombre d'iterations de nxgradrot
294  !Config  Def  = 2
295  !Config  Help = nombre d'iterations de l'operateur de dissipation 
296  !Config         nxgradrot
297  nitergrot = 2
298  CALL getin('nitergrot',nitergrot)
299
300  !Config  Key  = niterh
301  !Config  Desc = nombre d'iterations de divgrad
302  !Config  Def  = 2
303  !Config  Help = nombre d'iterations de l'operateur de dissipation
304  !Config         divgrad
305  niterh = 2
306  CALL getin('niterh',niterh)
307
308  !Config  Key  = tetagdiv
309  !Config  Desc = temps de dissipation pour div
310  !Config  Def  = 7200
311  !Config  Help = temps de dissipation des plus petites longeur
312  !Config         d'ondes pour u,v (gradiv)
313  tetagdiv = 7200.
314  CALL getin('tetagdiv',tetagdiv)
315
316  !Config  Key  = tetagrot
317  !Config  Desc = temps de dissipation pour grad
318  !Config  Def  = 7200
319  !Config  Help = temps de dissipation des plus petites longeur
320  !Config         d'ondes pour u,v (nxgradrot)
321  tetagrot = 7200.
322  CALL getin('tetagrot',tetagrot)
323
324  !Config  Key  = tetatemp
325  !Config  Desc = temps de dissipation pour h
326  !Config  Def  = 7200
327  !Config  Help =  temps de dissipation des plus petites longeur
328  !Config         d'ondes pour h (divgrad)   
329  tetatemp  = 7200.
330  CALL getin('tetatemp',tetatemp )
331
332  ! Parametres controlant la variation sur la verticale des constantes de
333  ! dissipation.
334  ! Pour le moment actifs uniquement dans la version a 39 niveaux
335  ! avec ok_strato=y
336
337  dissip_factz=4.
338  dissip_deltaz=10.
339  dissip_zref=30.
340  CALL getin('dissip_factz',dissip_factz )
341  CALL getin('dissip_deltaz',dissip_deltaz )
342  CALL getin('dissip_zref',dissip_zref )
343
344  ! ngroup
345  ngroup=3
346  CALL getin('ngroup',ngroup)
347  if (mod(iim, 2**ngroup) /= 0) &
348       call abort_gcm("conf_gcm", 'iim must be multiple of 2**ngroup', 1)
349  if (2**ngroup > jjm + 1) &
350       call abort_gcm("conf_gcm", '2**ngroup must be <= jjm + 1', 1)
351
352  ! mode_top_bound : fields towards which sponge relaxation will be done:
353  ! top_bound sponge: only active if ok_strato=.true. and iflag_top_bound!=0
354  !                   iflag_top_bound=0 for no sponge
355  !                   iflag_top_bound=1 for sponge over 4 topmost layers
356  !                   iflag_top_bound=2 for sponge from top to ~1% of top layer pressure
357  iflag_top_bound=1
358  CALL getin('iflag_top_bound',iflag_top_bound)
359  if (iflag_top_bound < 0 .or. iflag_top_bound > 2) &
360       call abort_gcm("conf_gcm", 'iflag_top_bound must be 0, 1 or 2', 1)
361
362  ! mode_top_bound : fields towards which sponge relaxation will be done:
363  !                  mode_top_bound=0: no relaxation
364  !                  mode_top_bound=1: u and v relax towards 0
365  !                  mode_top_bound=2: u and v relax towards their zonal mean
366  !                  mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean
367  mode_top_bound=3
368  CALL getin('mode_top_bound',mode_top_bound)
369
370  ! top_bound sponge : inverse of charactericstic relaxation time scale for sponge
371  tau_top_bound=1.e-5
372  CALL getin('tau_top_bound',tau_top_bound)
373
374  !Config  Key  = coefdis
375  !Config  Desc = coefficient pour gamdissip
376  !Config  Def  = 0
377  !Config  Help = coefficient pour gamdissip 
378  coefdis = 0.
379  CALL getin('coefdis',coefdis)
380
381  !Config  Key  = purmats
382  !Config  Desc = Schema d'integration
383  !Config  Def  = n
384  !Config  Help = Choix du schema d'integration temporel.
385  !Config         y = pure Matsuno sinon c'est du Matsuno-leapfrog
386  purmats = .FALSE.
387  CALL getin('purmats',purmats)
388
389  !Config  Key  = ok_guide
390  !Config  Desc = Guidage
391  !Config  Def  = n
392  !Config  Help = Guidage
393  ok_guide = .FALSE.
394  CALL getin('ok_guide',ok_guide)
395
396  if (ok_guide .and. adjust) call abort_gcm("conf_gcm", &
397       "adjust does not work with ok_guide", 1)
398
399  !Config  Key  =  read_start
400  !Config  Desc = Initialize model using a 'start.nc' file
401  !Config  Def  = y
402  !Config  Help = y: intialize dynamical fields using a 'start.nc' file
403  !               n: fields are initialized by 'iniacademic' routine
404  read_start= .true.
405  CALL getin('read_start',read_start)
406
407  !Config  Key  = iflag_phys
408  !Config  Desc = Avec ls physique
409  !Config  Def  = 1
410  !Config  Help = Permet de faire tourner le modele sans
411  !Config         physique.
412  iflag_phys = 1
413  CALL getin('iflag_phys',iflag_phys)
414
415  !Config  Key  =  iphysiq
416  !Config  Desc = Periode de la physique
417  !Config  Def  = 5
418  !Config  Help = Periode de la physique en pas de temps de la dynamique.
419  iphysiq = 5
420  CALL getin('iphysiq', iphysiq)
421
422  !Config  Key  = ip_ebil_dyn
423  !Config  Desc = PRINT level for energy conserv. diag.
424  !Config  Def  = 0
425  !Config  Help = PRINT level for energy conservation diag. ;
426  !               les options suivantes existent :
427  !Config         0 pas de print
428  !Config         1 pas de print
429  !Config         2 print,
430  ip_ebil_dyn = 0
431  CALL getin('ip_ebil_dyn',ip_ebil_dyn)
432
433  !cc  ....   P. Le Van , ajout  le 7/03/95 .pour le zoom ...
434  !     .........   (  modif  le 17/04/96 )   .........
435
436  test_etatinit: IF (.not. etatinit) then
437     !Config  Key  = clon
438     !Config  Desc = centre du zoom, longitude
439     !Config  Def  = 0
440     !Config  Help = longitude en degres du centre
441     !Config         du zoom
442     clonn = 0.
443     CALL getin('clon',clonn)
444
445     !Config  Key  = clat
446     !Config  Desc = centre du zoom, latitude
447     !Config  Def  = 0
448     !Config  Help = latitude en degres du centre du zoom
449     !Config         
450     clatt = 0.
451     CALL getin('clat',clatt)
452
453     IF( ABS(clat - clatt).GE. 0.001 )  THEN
454        write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', &
455             ' est differente de celle lue sur le fichier  start '
456        STOP
457     ENDIF
458
459     !Config  Key  = grossismx
460     !Config  Desc = zoom en longitude
461     !Config  Def  = 1.0
462     !Config  Help = facteur de grossissement du zoom,
463     !Config         selon la longitude
464     grossismxx = 1.0
465     CALL getin('grossismx',grossismxx)
466
467     IF( ABS(grossismx - grossismxx).GE. 0.001 )  THEN
468        write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', &
469             'run.def est differente de celle lue sur le fichier  start '
470        STOP
471     ENDIF
472
473     !Config  Key  = grossismy
474     !Config  Desc = zoom en latitude
475     !Config  Def  = 1.0
476     !Config  Help = facteur de grossissement du zoom,
477     !Config         selon la latitude
478     grossismyy = 1.0
479     CALL getin('grossismy',grossismyy)
480
481     IF( ABS(grossismy - grossismyy).GE. 0.001 )  THEN
482        write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', &
483             'run.def est differente de celle lue sur le fichier  start '
484        STOP
485     ENDIF
486
487     IF( grossismx.LT.1. )  THEN
488        write(lunout,*) &
489             'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
490        STOP
491     ELSE
492        alphax = 1. - 1./ grossismx
493     ENDIF
494
495     IF( grossismy.LT.1. )  THEN
496        write(lunout,*) &
497             'conf_gcm: ***  ATTENTION !! grossismy < 1 .   *** '
498        STOP
499     ELSE
500        alphay = 1. - 1./ grossismy
501     ENDIF
502
503     write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay
504
505     !    alphax et alphay sont les anciennes formulat. des grossissements
506
507     !Config  Key  = fxyhypb
508     !Config  Desc = Fonction  hyperbolique
509     !Config  Def  = y
510     !Config  Help = Fonction  f(y)  hyperbolique  si = .true. 
511     !Config         sinon  sinusoidale
512     fxyhypbb = .TRUE.
513     CALL getin('fxyhypb',fxyhypbb)
514
515     IF( .NOT.fxyhypb )  THEN
516        IF( fxyhypbb )     THEN
517           write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
518           write(lunout,*)' *** fxyhypb lu sur le fichier start est ', &
519                'F alors  qu il est  T  sur  run.def  ***'
520           STOP
521        ENDIF
522     ELSE
523        IF( .NOT.fxyhypbb )   THEN
524           write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
525           write(lunout,*)' ***  fxyhypb lu sur le fichier start est ', &
526                'T alors  qu il est  F  sur  run.def  ****  '
527           STOP
528        ENDIF
529     ENDIF
530
531     !Config  Key  = dzoomx
532     !Config  Desc = extension en longitude
533     !Config  Def  = 0
534     !Config  Help = extension en longitude  de la zone du zoom 
535     !Config         ( fraction de la zone totale)
536     dzoomxx = 0.0
537     CALL getin('dzoomx',dzoomxx)
538
539     IF( fxyhypb )  THEN
540        IF( ABS(dzoomx - dzoomxx).GE. 0.001 )  THEN
541           write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', &
542                'run.def est differente de celle lue sur le fichier  start '
543           STOP
544        ENDIF
545     ENDIF
546
547     !Config  Key  = dzoomy
548     !Config  Desc = extension en latitude
549     !Config  Def  = 0
550     !Config  Help = extension en latitude de la zone  du zoom 
551     !Config         ( fraction de la zone totale)
552     dzoomyy = 0.0
553     CALL getin('dzoomy',dzoomyy)
554
555     IF( fxyhypb )  THEN
556        IF( ABS(dzoomy - dzoomyy).GE. 0.001 )  THEN
557           write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', &
558                'run.def est differente de celle lue sur le fichier  start '
559           STOP
560        ENDIF
561     ENDIF
562
563     !Config  Key  = taux
564     !Config  Desc = raideur du zoom en  X
565     !Config  Def  = 3
566     !Config  Help = raideur du zoom en  X
567     tauxx = 3.0
568     CALL getin('taux',tauxx)
569
570     IF( fxyhypb )  THEN
571        IF( ABS(taux - tauxx).GE. 0.001 )  THEN
572           write(lunout,*)'conf_gcm: La valeur de taux passee par ', &
573                'run.def est differente de celle lue sur le fichier  start '
574           STOP
575        ENDIF
576     ENDIF
577
578     !Config  Key  = tauyy
579     !Config  Desc = raideur du zoom en  Y
580     !Config  Def  = 3
581     !Config  Help = raideur du zoom en  Y
582     tauyy = 3.0
583     CALL getin('tauy',tauyy)
584
585     IF( fxyhypb )  THEN
586        IF( ABS(tauy - tauyy).GE. 0.001 )  THEN
587           write(lunout,*)'conf_gcm: La valeur de tauy passee par ', &
588                'run.def est differente de celle lue sur le fichier  start '
589           STOP
590        ENDIF
591     ENDIF
592
593     !c
594     IF( .NOT.fxyhypb  )  THEN
595
596        !Config  Key  = ysinus
597        !Config  IF   = !fxyhypb
598        !Config  Desc = Fonction en Sinus
599        !Config  Def  = y
600        !Config  Help = Fonction  f(y) avec y = Sin(latit.) si = .true.
601        !Config         sinon y = latit.
602        ysinuss = .TRUE.
603        CALL getin('ysinus',ysinuss)
604
605        IF( .NOT.ysinus )  THEN
606           IF( ysinuss )     THEN
607              write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
608              write(lunout,*)' *** ysinus lu sur le fichier start est F', &
609                   ' alors  qu il est  T  sur  run.def  ***'
610              STOP
611           ENDIF
612        ELSE
613           IF( .NOT.ysinuss )   THEN
614              write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
615              write(lunout,*)' *** ysinus lu sur le fichier start est T', &
616                   ' alors  qu il est  F  sur  run.def  ****  '
617              STOP
618           ENDIF
619        ENDIF
620     ENDIF ! of IF( .NOT.fxyhypb  )
621
622     !Config  Key  = offline
623     !Config  Desc = Nouvelle eau liquide
624     !Config  Def  = n
625     !Config  Help = Permet de mettre en route la
626     !Config         nouvelle parametrisation de l'eau liquide !
627     offline = .FALSE.
628     CALL getin('offline',offline)
629     IF (offline .AND. adjust) THEN
630        WRITE(lunout,*)  &
631             'WARNING : option offline does not work with adjust=y :'
632        WRITE(lunout,*) 'the files defstoke.nc, fluxstoke.nc ',  &
633             'and fluxstokev.nc will not be created'
634        WRITE(lunout,*)  &
635             'only the file phystoke.nc will still be created '
636     END IF
637
638     !Config  Key  = type_trac
639     !Config  Desc = Choix de couplage avec model de chimie INCA ou REPROBUS
640     !Config  Def  = lmdz
641     !Config  Help =
642     !Config         'lmdz' = pas de couplage, pur LMDZ
643     !Config         'inca' = model de chime INCA
644     !Config         'repr' = model de chime REPROBUS
645     type_trac = 'lmdz'
646     CALL getin('type_trac',type_trac)
647
648     !Config  Key  = config_inca
649     !Config  Desc = Choix de configuration de INCA
650     !Config  Def  = none
651     !Config  Help = Choix de configuration de INCA :
652     !Config         'none' = sans INCA
653     !Config         'chem' = INCA avec calcul de chemie
654     !Config         'aero' = INCA avec calcul des aerosols
655     config_inca = 'none'
656     CALL getin('config_inca',config_inca)
657
658     !Config  Key  = ok_dynzon
659     !Config  Desc = calcul et sortie des transports
660     !Config  Def  = n
661     !Config  Help = Permet de mettre en route le calcul des transports
662     !Config         
663     ok_dynzon = .FALSE.
664     CALL getin('ok_dynzon',ok_dynzon)
665
666     !Config  Key  = ok_dyn_ins
667     !Config  Desc = sorties instantanees dans la dynamique
668     !Config  Def  = n
669     !Config  Help =
670     !Config         
671     ok_dyn_ins = .FALSE.
672     CALL getin('ok_dyn_ins',ok_dyn_ins)
673
674     !Config  Key  = ok_dyn_ave
675     !Config  Desc = sorties moyennes dans la dynamique
676     !Config  Def  = n
677     !Config  Help =
678     !Config         
679     ok_dyn_ave = .FALSE.
680     CALL getin('ok_dyn_ave',ok_dyn_ave)
681
682     write(lunout,*)' #########################################'
683     write(lunout,*)' Configuration des parametres du gcm: '
684     write(lunout,*)' planet_type = ', planet_type
685     write(lunout,*)' calend = ', calend
686     write(lunout,*)' dayref = ', dayref
687     write(lunout,*)' anneeref = ', anneeref
688     write(lunout,*)' nday = ', nday
689     write(lunout,*)' day_step = ', day_step
690     write(lunout,*)' iperiod = ', iperiod
691     write(lunout,*)' nsplit_phys = ', nsplit_phys
692     write(lunout,*)' iconser = ', iconser
693     write(lunout,*)' iecri = ', iecri
694     write(lunout,*)' periodav = ', periodav
695     write(lunout,*)' output_grads_dyn = ', output_grads_dyn
696     write(lunout,*)' dissip_period = ', dissip_period
697     write(lunout,*)' lstardis = ', lstardis
698     write(lunout,*)' nitergdiv = ', nitergdiv
699     write(lunout,*)' nitergrot = ', nitergrot
700     write(lunout,*)' niterh = ', niterh
701     write(lunout,*)' tetagdiv = ', tetagdiv
702     write(lunout,*)' tetagrot = ', tetagrot
703     write(lunout,*)' tetatemp = ', tetatemp
704     write(lunout,*)' coefdis = ', coefdis
705     write(lunout,*)' purmats = ', purmats
706     write(lunout,*)' read_start = ', read_start
707     write(lunout,*)' iflag_phys = ', iflag_phys
708     write(lunout,*)' iphysiq = ', iphysiq
709     write(lunout,*)' clonn = ', clonn
710     write(lunout,*)' clatt = ', clatt
711     write(lunout,*)' grossismx = ', grossismx
712     write(lunout,*)' grossismy = ', grossismy
713     write(lunout,*)' fxyhypbb = ', fxyhypbb
714     write(lunout,*)' dzoomxx = ', dzoomxx
715     write(lunout,*)' dzoomy = ', dzoomyy
716     write(lunout,*)' tauxx = ', tauxx
717     write(lunout,*)' tauyy = ', tauyy
718     write(lunout,*)' offline = ', offline
719     write(lunout,*)' type_trac = ', type_trac
720     write(lunout,*)' config_inca = ', config_inca
721     write(lunout,*)' ok_dynzon = ', ok_dynzon
722     write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
723     write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
724  else
725     !Config  Key  = clon
726     !Config  Desc = centre du zoom, longitude
727     !Config  Def  = 0
728     !Config  Help = longitude en degres du centre
729     !Config         du zoom
730     clon = 0.
731     CALL getin('clon',clon)
732
733     !Config  Key  = clat
734     !Config  Desc = centre du zoom, latitude
735     !Config  Def  = 0
736     !Config  Help = latitude en degres du centre du zoom
737     !Config         
738     clat = 0.
739     CALL getin('clat',clat)
740
741     !Config  Key  = grossismx
742     !Config  Desc = zoom en longitude
743     !Config  Def  = 1.0
744     !Config  Help = facteur de grossissement du zoom,
745     !Config         selon la longitude
746     grossismx = 1.0
747     CALL getin('grossismx',grossismx)
748
749     !Config  Key  = grossismy
750     !Config  Desc = zoom en latitude
751     !Config  Def  = 1.0
752     !Config  Help = facteur de grossissement du zoom,
753     !Config         selon la latitude
754     grossismy = 1.0
755     CALL getin('grossismy',grossismy)
756
757     IF( grossismx.LT.1. )  THEN
758        write(lunout,*) &
759             'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
760        STOP
761     ELSE
762        alphax = 1. - 1./ grossismx
763     ENDIF
764
765     IF( grossismy.LT.1. )  THEN
766        write(lunout,*) 'conf_gcm: ***ATTENTION !! grossismy < 1 . *** '
767        STOP
768     ELSE
769        alphay = 1. - 1./ grossismy
770     ENDIF
771
772     write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay
773
774     !    alphax et alphay sont les anciennes formulat. des grossissements
775
776     !Config  Key  = fxyhypb
777     !Config  Desc = Fonction  hyperbolique
778     !Config  Def  = y
779     !Config  Help = Fonction  f(y)  hyperbolique  si = .true. 
780     !Config         sinon  sinusoidale
781     fxyhypb = .TRUE.
782     CALL getin('fxyhypb',fxyhypb)
783
784     !Config  Key  = dzoomx
785     !Config  Desc = extension en longitude
786     !Config  Def  = 0
787     !Config  Help = extension en longitude  de la zone du zoom 
788     !Config         ( fraction de la zone totale)
789     dzoomx = 0.2
790     CALL getin('dzoomx',dzoomx)
791     call assert(dzoomx < 1, "conf_gcm: dzoomx must be < 1")
792
793     !Config  Key  = dzoomy
794     !Config  Desc = extension en latitude
795     !Config  Def  = 0
796     !Config  Help = extension en latitude de la zone  du zoom 
797     !Config         ( fraction de la zone totale)
798     dzoomy = 0.2
799     CALL getin('dzoomy',dzoomy)
800     call assert(dzoomy < 1, "conf_gcm: dzoomy must be < 1")
801
802     !Config  Key  = taux
803     !Config  Desc = raideur du zoom en  X
804     !Config  Def  = 3
805     !Config  Help = raideur du zoom en  X
806     taux = 3.0
807     CALL getin('taux',taux)
808
809     !Config  Key  = tauy
810     !Config  Desc = raideur du zoom en  Y
811     !Config  Def  = 3
812     !Config  Help = raideur du zoom en  Y
813     tauy = 3.0
814     CALL getin('tauy',tauy)
815
816     !Config  Key  = ysinus
817     !Config  IF   = !fxyhypb
818     !Config  Desc = Fonction en Sinus
819     !Config  Def  = y
820     !Config  Help = Fonction  f(y) avec y = Sin(latit.) si = .true.
821     !Config         sinon y = latit.
822     ysinus = .TRUE.
823     CALL getin('ysinus',ysinus)
824
825     !Config  Key  = offline
826     !Config  Desc = Nouvelle eau liquide
827     !Config  Def  = n
828     !Config  Help = Permet de mettre en route la
829     !Config         nouvelle parametrisation de l'eau liquide !
830     offline = .FALSE.
831     CALL getin('offline',offline)
832     IF (offline .AND. adjust) THEN
833        WRITE(lunout,*)  &
834             'WARNING : option offline does not work with adjust=y :'
835        WRITE(lunout,*) 'the files defstoke.nc, fluxstoke.nc ',  &
836             'and fluxstokev.nc will not be created'
837        WRITE(lunout,*)  &
838             'only the file phystoke.nc will still be created '
839     END IF
840
841     !Config  Key  = type_trac
842     !Config  Desc = Choix de couplage avec model de chimie INCA ou REPROBUS
843     !Config  Def  = lmdz
844     !Config  Help =
845     !Config         'lmdz' = pas de couplage, pur LMDZ
846     !Config         'inca' = model de chime INCA
847     !Config         'repr' = model de chime REPROBUS
848     type_trac = 'lmdz'
849     CALL getin('type_trac',type_trac)
850
851     !Config  Key  = config_inca
852     !Config  Desc = Choix de configuration de INCA
853     !Config  Def  = none
854     !Config  Help = Choix de configuration de INCA :
855     !Config         'none' = sans INCA
856     !Config         'chem' = INCA avec calcul de chemie
857     !Config         'aero' = INCA avec calcul des aerosols
858     config_inca = 'none'
859     CALL getin('config_inca',config_inca)
860
861     !Config  Key  = ok_dynzon
862     !Config  Desc = sortie des transports zonaux dans la dynamique
863     !Config  Def  = n
864     !Config  Help = Permet de mettre en route le calcul des transports
865     !Config         
866     ok_dynzon = .FALSE.
867     CALL getin('ok_dynzon',ok_dynzon)
868
869     !Config  Key  = ok_dyn_ins
870     !Config  Desc = sorties instantanees dans la dynamique
871     !Config  Def  = n
872     !Config  Help =
873     !Config         
874     ok_dyn_ins = .FALSE.
875     CALL getin('ok_dyn_ins',ok_dyn_ins)
876
877     !Config  Key  = ok_dyn_ave
878     !Config  Desc = sorties moyennes dans la dynamique
879     !Config  Def  = n
880     !Config  Help =
881     !Config         
882     ok_dyn_ave = .FALSE.
883     CALL getin('ok_dyn_ave',ok_dyn_ave)
884
885     !Config  Key  = use_filtre_fft
886     !Config  Desc = flag to activate FFTs for the filter
887     !Config  Def  = false
888     !Config  Help = enables to use FFts to do the longitudinal polar
889     !Config         filtering around the poles.
890     use_filtre_fft=.FALSE.
891     CALL getin('use_filtre_fft',use_filtre_fft)
892     IF (use_filtre_fft .AND. grossismx /= 1.0) THEN
893        write(lunout,*)'WARNING !!! '
894        write(lunout,*)"A zoom in longitude is not compatible", &
895             " with the FFT filter ", &
896             "---> FFT filter deactivated"
897        use_filtre_fft=.FALSE.
898     ENDIF
899     use_filtre_fft_loc=use_filtre_fft
900
901     !Config  Key  = use_mpi_alloc
902     !Config  Desc = Utilise un buffer MPI en m�moire globale
903     !Config  Def  = false
904     !Config  Help = permet d'activer l'utilisation d'un buffer MPI
905     !Config         en m�moire globale a l'aide de la fonction MPI_ALLOC.
906     !Config         Cela peut am�liorer la bande passante des transferts MPI
907     !Config         d'un facteur 2 
908     use_mpi_alloc=.FALSE.
909     CALL getin('use_mpi_alloc',use_mpi_alloc)
910
911     !Config key = ok_strato
912     !Config  Desc = activation de la version strato
913     !Config  Def  = .FALSE.
914     !Config  Help = active la version stratosphérique de LMDZ de F. Lott
915
916     ok_strato=.FALSE.
917     CALL getin('ok_strato',ok_strato)
918
919     vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39)
920     CALL getin('vert_prof_dissip', vert_prof_dissip)
921     call assert(vert_prof_dissip == 0 .or. vert_prof_dissip ==  1, &
922          "bad value for vert_prof_dissip")
923
924     !Config  Key  = ok_gradsfile
925     !Config  Desc = activation des sorties grads du guidage
926     !Config  Def  = n
927     !Config  Help = active les sorties grads du guidage
928
929     ok_gradsfile = .FALSE.
930     CALL getin('ok_gradsfile',ok_gradsfile)
931
932     !Config  Key  = ok_limit
933     !Config  Desc = creation des fichiers limit dans create_etat0_limit
934     !Config  Def  = y
935     !Config  Help = production du fichier limit.nc requise
936
937     ok_limit = .TRUE.
938     CALL getin('ok_limit',ok_limit)
939
940     !Config  Key  = ok_etat0
941     !Config  Desc = creation des fichiers etat0 dans create_etat0_limit
942     !Config  Def  = y
943     !Config  Help = production des fichiers start.nc, startphy.nc requise
944
945     ok_etat0 = .TRUE.
946     CALL getin('ok_etat0',ok_etat0)
947
948     !Config  Key  = read_orop
949     !Config  Desc = lecture du fichier de params orographiques sous maille
950     !Config  Def  = f
951     !Config  Help = lecture fichier plutot que grid_noro
952
953     read_orop = .FALSE.
954     CALL getin('read_orop',read_orop)
955
956     write(lunout,*)' #########################################'
957     write(lunout,*)' Configuration des parametres de cel0' &
958          //'_limit: '
959     write(lunout,*)' planet_type = ', planet_type
960     write(lunout,*)' calend = ', calend
961     write(lunout,*)' dayref = ', dayref
962     write(lunout,*)' anneeref = ', anneeref
963     write(lunout,*)' nday = ', nday
964     write(lunout,*)' day_step = ', day_step
965     write(lunout,*)' iperiod = ', iperiod
966     write(lunout,*)' iconser = ', iconser
967     write(lunout,*)' iecri = ', iecri
968     write(lunout,*)' periodav = ', periodav
969     write(lunout,*)' output_grads_dyn = ', output_grads_dyn
970     write(lunout,*)' dissip_period = ', dissip_period
971     write(lunout,*)' lstardis = ', lstardis
972     write(lunout,*)' nitergdiv = ', nitergdiv
973     write(lunout,*)' nitergrot = ', nitergrot
974     write(lunout,*)' niterh = ', niterh
975     write(lunout,*)' tetagdiv = ', tetagdiv
976     write(lunout,*)' tetagrot = ', tetagrot
977     write(lunout,*)' tetatemp = ', tetatemp
978     write(lunout,*)' coefdis = ', coefdis
979     write(lunout,*)' purmats = ', purmats
980     write(lunout,*)' read_start = ', read_start
981     write(lunout,*)' iflag_phys = ', iflag_phys
982     write(lunout,*)' iphysiq = ', iphysiq
983     write(lunout,*)' clon = ', clon
984     write(lunout,*)' clat = ', clat
985     write(lunout,*)' grossismx = ', grossismx
986     write(lunout,*)' grossismy = ', grossismy
987     write(lunout,*)' fxyhypb = ', fxyhypb
988     write(lunout,*)' dzoomx = ', dzoomx
989     write(lunout,*)' dzoomy = ', dzoomy
990     write(lunout,*)' taux = ', taux
991     write(lunout,*)' tauy = ', tauy
992     write(lunout,*)' offline = ', offline
993     write(lunout,*)' type_trac = ', type_trac
994     write(lunout,*)' config_inca = ', config_inca
995     write(lunout,*)' ok_dynzon = ', ok_dynzon
996     write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
997     write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
998     write(lunout,*)' use_filtre_fft = ', use_filtre_fft
999     write(lunout,*)' use_mpi_alloc = ', use_mpi_alloc
1000     write(lunout,*)' ok_strato = ', ok_strato
1001     write(lunout,*)' ok_gradsfile = ', ok_gradsfile
1002     write(lunout,*)' ok_limit = ', ok_limit
1003     write(lunout,*)' ok_etat0 = ', ok_etat0
1004     write(lunout,*)' read_orop = ', read_orop
1005  end IF test_etatinit
1006
1007END SUBROUTINE conf_gcm
Note: See TracBrowser for help on using the repository browser.