source: LMDZ6/branches/Ocean_skin/libf/dyn3dmem/conf_gcm.F90 @ 3809

Last change on this file since 3809 was 3809, checked in by lguez, 3 years ago

Additional constraint on ngroup

Move existing constraint on ngroup from groupeun_loc to conf_gcm
(abort as soon as possible if input is bad) and add constraint on
ngroup and jjm. As in revision [3802] on trunk.

  • 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.7 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
360  ! mode_top_bound : fields towards which sponge relaxation will be done:
361  !                  mode_top_bound=0: no relaxation
362  !                  mode_top_bound=1: u and v relax towards 0
363  !                  mode_top_bound=2: u and v relax towards their zonal mean
364  !                  mode_top_bound=3: u,v and pot. temp. relax towards their zonal mean
365  mode_top_bound=3
366  CALL getin('mode_top_bound',mode_top_bound)
367
368  ! top_bound sponge : inverse of charactericstic relaxation time scale for sponge
369  tau_top_bound=1.e-5
370  CALL getin('tau_top_bound',tau_top_bound)
371
372  !Config  Key  = coefdis
373  !Config  Desc = coefficient pour gamdissip
374  !Config  Def  = 0
375  !Config  Help = coefficient pour gamdissip 
376  coefdis = 0.
377  CALL getin('coefdis',coefdis)
378
379  !Config  Key  = purmats
380  !Config  Desc = Schema d'integration
381  !Config  Def  = n
382  !Config  Help = Choix du schema d'integration temporel.
383  !Config         y = pure Matsuno sinon c'est du Matsuno-leapfrog
384  purmats = .FALSE.
385  CALL getin('purmats',purmats)
386
387  !Config  Key  = ok_guide
388  !Config  Desc = Guidage
389  !Config  Def  = n
390  !Config  Help = Guidage
391  ok_guide = .FALSE.
392  CALL getin('ok_guide',ok_guide)
393
394  if (ok_guide .and. adjust) call abort_gcm("conf_gcm", &
395       "adjust does not work with ok_guide", 1)
396
397  !Config  Key  =  read_start
398  !Config  Desc = Initialize model using a 'start.nc' file
399  !Config  Def  = y
400  !Config  Help = y: intialize dynamical fields using a 'start.nc' file
401  !               n: fields are initialized by 'iniacademic' routine
402  read_start= .true.
403  CALL getin('read_start',read_start)
404
405  !Config  Key  = iflag_phys
406  !Config  Desc = Avec ls physique
407  !Config  Def  = 1
408  !Config  Help = Permet de faire tourner le modele sans
409  !Config         physique.
410  iflag_phys = 1
411  CALL getin('iflag_phys',iflag_phys)
412
413  !Config  Key  =  iphysiq
414  !Config  Desc = Periode de la physique
415  !Config  Def  = 5
416  !Config  Help = Periode de la physique en pas de temps de la dynamique.
417  iphysiq = 5
418  CALL getin('iphysiq', iphysiq)
419
420  !Config  Key  = ip_ebil_dyn
421  !Config  Desc = PRINT level for energy conserv. diag.
422  !Config  Def  = 0
423  !Config  Help = PRINT level for energy conservation diag. ;
424  !               les options suivantes existent :
425  !Config         0 pas de print
426  !Config         1 pas de print
427  !Config         2 print,
428  ip_ebil_dyn = 0
429  CALL getin('ip_ebil_dyn',ip_ebil_dyn)
430
431  !cc  ....   P. Le Van , ajout  le 7/03/95 .pour le zoom ...
432  !     .........   (  modif  le 17/04/96 )   .........
433
434  test_etatinit: IF (.not. etatinit) then
435     !Config  Key  = clon
436     !Config  Desc = centre du zoom, longitude
437     !Config  Def  = 0
438     !Config  Help = longitude en degres du centre
439     !Config         du zoom
440     clonn = 0.
441     CALL getin('clon',clonn)
442
443     !Config  Key  = clat
444     !Config  Desc = centre du zoom, latitude
445     !Config  Def  = 0
446     !Config  Help = latitude en degres du centre du zoom
447     !Config         
448     clatt = 0.
449     CALL getin('clat',clatt)
450
451     IF( ABS(clat - clatt).GE. 0.001 )  THEN
452        write(lunout,*)'conf_gcm: La valeur de clat passee par run.def', &
453             ' est differente de celle lue sur le fichier  start '
454        STOP
455     ENDIF
456
457     !Config  Key  = grossismx
458     !Config  Desc = zoom en longitude
459     !Config  Def  = 1.0
460     !Config  Help = facteur de grossissement du zoom,
461     !Config         selon la longitude
462     grossismxx = 1.0
463     CALL getin('grossismx',grossismxx)
464
465     IF( ABS(grossismx - grossismxx).GE. 0.001 )  THEN
466        write(lunout,*)'conf_gcm: La valeur de grossismx passee par ', &
467             'run.def est differente de celle lue sur le fichier  start '
468        STOP
469     ENDIF
470
471     !Config  Key  = grossismy
472     !Config  Desc = zoom en latitude
473     !Config  Def  = 1.0
474     !Config  Help = facteur de grossissement du zoom,
475     !Config         selon la latitude
476     grossismyy = 1.0
477     CALL getin('grossismy',grossismyy)
478
479     IF( ABS(grossismy - grossismyy).GE. 0.001 )  THEN
480        write(lunout,*)'conf_gcm: La valeur de grossismy passee par ', &
481             'run.def est differente de celle lue sur le fichier  start '
482        STOP
483     ENDIF
484
485     IF( grossismx.LT.1. )  THEN
486        write(lunout,*) &
487             'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
488        STOP
489     ELSE
490        alphax = 1. - 1./ grossismx
491     ENDIF
492
493     IF( grossismy.LT.1. )  THEN
494        write(lunout,*) &
495             'conf_gcm: ***  ATTENTION !! grossismy < 1 .   *** '
496        STOP
497     ELSE
498        alphay = 1. - 1./ grossismy
499     ENDIF
500
501     write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay
502
503     !    alphax et alphay sont les anciennes formulat. des grossissements
504
505     !Config  Key  = fxyhypb
506     !Config  Desc = Fonction  hyperbolique
507     !Config  Def  = y
508     !Config  Help = Fonction  f(y)  hyperbolique  si = .true. 
509     !Config         sinon  sinusoidale
510     fxyhypbb = .TRUE.
511     CALL getin('fxyhypb',fxyhypbb)
512
513     IF( .NOT.fxyhypb )  THEN
514        IF( fxyhypbb )     THEN
515           write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
516           write(lunout,*)' *** fxyhypb lu sur le fichier start est ', &
517                'F alors  qu il est  T  sur  run.def  ***'
518           STOP
519        ENDIF
520     ELSE
521        IF( .NOT.fxyhypbb )   THEN
522           write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
523           write(lunout,*)' ***  fxyhypb lu sur le fichier start est ', &
524                'T alors  qu il est  F  sur  run.def  ****  '
525           STOP
526        ENDIF
527     ENDIF
528
529     !Config  Key  = dzoomx
530     !Config  Desc = extension en longitude
531     !Config  Def  = 0
532     !Config  Help = extension en longitude  de la zone du zoom 
533     !Config         ( fraction de la zone totale)
534     dzoomxx = 0.0
535     CALL getin('dzoomx',dzoomxx)
536
537     IF( fxyhypb )  THEN
538        IF( ABS(dzoomx - dzoomxx).GE. 0.001 )  THEN
539           write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ', &
540                'run.def est differente de celle lue sur le fichier  start '
541           STOP
542        ENDIF
543     ENDIF
544
545     !Config  Key  = dzoomy
546     !Config  Desc = extension en latitude
547     !Config  Def  = 0
548     !Config  Help = extension en latitude de la zone  du zoom 
549     !Config         ( fraction de la zone totale)
550     dzoomyy = 0.0
551     CALL getin('dzoomy',dzoomyy)
552
553     IF( fxyhypb )  THEN
554        IF( ABS(dzoomy - dzoomyy).GE. 0.001 )  THEN
555           write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ', &
556                'run.def est differente de celle lue sur le fichier  start '
557           STOP
558        ENDIF
559     ENDIF
560
561     !Config  Key  = taux
562     !Config  Desc = raideur du zoom en  X
563     !Config  Def  = 3
564     !Config  Help = raideur du zoom en  X
565     tauxx = 3.0
566     CALL getin('taux',tauxx)
567
568     IF( fxyhypb )  THEN
569        IF( ABS(taux - tauxx).GE. 0.001 )  THEN
570           write(lunout,*)'conf_gcm: La valeur de taux passee par ', &
571                'run.def est differente de celle lue sur le fichier  start '
572           STOP
573        ENDIF
574     ENDIF
575
576     !Config  Key  = tauyy
577     !Config  Desc = raideur du zoom en  Y
578     !Config  Def  = 3
579     !Config  Help = raideur du zoom en  Y
580     tauyy = 3.0
581     CALL getin('tauy',tauyy)
582
583     IF( fxyhypb )  THEN
584        IF( ABS(tauy - tauyy).GE. 0.001 )  THEN
585           write(lunout,*)'conf_gcm: La valeur de tauy passee par ', &
586                'run.def est differente de celle lue sur le fichier  start '
587           STOP
588        ENDIF
589     ENDIF
590
591     !c
592     IF( .NOT.fxyhypb  )  THEN
593
594        !Config  Key  = ysinus
595        !Config  IF   = !fxyhypb
596        !Config  Desc = Fonction en Sinus
597        !Config  Def  = y
598        !Config  Help = Fonction  f(y) avec y = Sin(latit.) si = .true.
599        !Config         sinon y = latit.
600        ysinuss = .TRUE.
601        CALL getin('ysinus',ysinuss)
602
603        IF( .NOT.ysinus )  THEN
604           IF( ysinuss )     THEN
605              write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
606              write(lunout,*)' *** ysinus lu sur le fichier start est F', &
607                   ' alors  qu il est  T  sur  run.def  ***'
608              STOP
609           ENDIF
610        ELSE
611           IF( .NOT.ysinuss )   THEN
612              write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
613              write(lunout,*)' *** ysinus lu sur le fichier start est T', &
614                   ' alors  qu il est  F  sur  run.def  ****  '
615              STOP
616           ENDIF
617        ENDIF
618     ENDIF ! of IF( .NOT.fxyhypb  )
619
620     !Config  Key  = offline
621     !Config  Desc = Nouvelle eau liquide
622     !Config  Def  = n
623     !Config  Help = Permet de mettre en route la
624     !Config         nouvelle parametrisation de l'eau liquide !
625     offline = .FALSE.
626     CALL getin('offline',offline)
627     IF (offline .AND. adjust) THEN
628        WRITE(lunout,*)  &
629             'WARNING : option offline does not work with adjust=y :'
630        WRITE(lunout,*) 'the files defstoke.nc, fluxstoke.nc ',  &
631             'and fluxstokev.nc will not be created'
632        WRITE(lunout,*)  &
633             'only the file phystoke.nc will still be created '
634     END IF
635
636     !Config  Key  = type_trac
637     !Config  Desc = Choix de couplage avec model de chimie INCA ou REPROBUS
638     !Config  Def  = lmdz
639     !Config  Help =
640     !Config         'lmdz' = pas de couplage, pur LMDZ
641     !Config         'inca' = model de chime INCA
642     !Config         'repr' = model de chime REPROBUS
643     type_trac = 'lmdz'
644     CALL getin('type_trac',type_trac)
645
646     !Config  Key  = config_inca
647     !Config  Desc = Choix de configuration de INCA
648     !Config  Def  = none
649     !Config  Help = Choix de configuration de INCA :
650     !Config         'none' = sans INCA
651     !Config         'chem' = INCA avec calcul de chemie
652     !Config         'aero' = INCA avec calcul des aerosols
653     config_inca = 'none'
654     CALL getin('config_inca',config_inca)
655
656     !Config  Key  = ok_dynzon
657     !Config  Desc = calcul et sortie des transports
658     !Config  Def  = n
659     !Config  Help = Permet de mettre en route le calcul des transports
660     !Config         
661     ok_dynzon = .FALSE.
662     CALL getin('ok_dynzon',ok_dynzon)
663
664     !Config  Key  = ok_dyn_ins
665     !Config  Desc = sorties instantanees dans la dynamique
666     !Config  Def  = n
667     !Config  Help =
668     !Config         
669     ok_dyn_ins = .FALSE.
670     CALL getin('ok_dyn_ins',ok_dyn_ins)
671
672     !Config  Key  = ok_dyn_ave
673     !Config  Desc = sorties moyennes dans la dynamique
674     !Config  Def  = n
675     !Config  Help =
676     !Config         
677     ok_dyn_ave = .FALSE.
678     CALL getin('ok_dyn_ave',ok_dyn_ave)
679
680     write(lunout,*)' #########################################'
681     write(lunout,*)' Configuration des parametres du gcm: '
682     write(lunout,*)' planet_type = ', planet_type
683     write(lunout,*)' calend = ', calend
684     write(lunout,*)' dayref = ', dayref
685     write(lunout,*)' anneeref = ', anneeref
686     write(lunout,*)' nday = ', nday
687     write(lunout,*)' day_step = ', day_step
688     write(lunout,*)' iperiod = ', iperiod
689     write(lunout,*)' nsplit_phys = ', nsplit_phys
690     write(lunout,*)' iconser = ', iconser
691     write(lunout,*)' iecri = ', iecri
692     write(lunout,*)' periodav = ', periodav
693     write(lunout,*)' output_grads_dyn = ', output_grads_dyn
694     write(lunout,*)' dissip_period = ', dissip_period
695     write(lunout,*)' lstardis = ', lstardis
696     write(lunout,*)' nitergdiv = ', nitergdiv
697     write(lunout,*)' nitergrot = ', nitergrot
698     write(lunout,*)' niterh = ', niterh
699     write(lunout,*)' tetagdiv = ', tetagdiv
700     write(lunout,*)' tetagrot = ', tetagrot
701     write(lunout,*)' tetatemp = ', tetatemp
702     write(lunout,*)' coefdis = ', coefdis
703     write(lunout,*)' purmats = ', purmats
704     write(lunout,*)' read_start = ', read_start
705     write(lunout,*)' iflag_phys = ', iflag_phys
706     write(lunout,*)' iphysiq = ', iphysiq
707     write(lunout,*)' clonn = ', clonn
708     write(lunout,*)' clatt = ', clatt
709     write(lunout,*)' grossismx = ', grossismx
710     write(lunout,*)' grossismy = ', grossismy
711     write(lunout,*)' fxyhypbb = ', fxyhypbb
712     write(lunout,*)' dzoomxx = ', dzoomxx
713     write(lunout,*)' dzoomy = ', dzoomyy
714     write(lunout,*)' tauxx = ', tauxx
715     write(lunout,*)' tauyy = ', tauyy
716     write(lunout,*)' offline = ', offline
717     write(lunout,*)' type_trac = ', type_trac
718     write(lunout,*)' config_inca = ', config_inca
719     write(lunout,*)' ok_dynzon = ', ok_dynzon
720     write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
721     write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
722  else
723     !Config  Key  = clon
724     !Config  Desc = centre du zoom, longitude
725     !Config  Def  = 0
726     !Config  Help = longitude en degres du centre
727     !Config         du zoom
728     clon = 0.
729     CALL getin('clon',clon)
730
731     !Config  Key  = clat
732     !Config  Desc = centre du zoom, latitude
733     !Config  Def  = 0
734     !Config  Help = latitude en degres du centre du zoom
735     !Config         
736     clat = 0.
737     CALL getin('clat',clat)
738
739     !Config  Key  = grossismx
740     !Config  Desc = zoom en longitude
741     !Config  Def  = 1.0
742     !Config  Help = facteur de grossissement du zoom,
743     !Config         selon la longitude
744     grossismx = 1.0
745     CALL getin('grossismx',grossismx)
746
747     !Config  Key  = grossismy
748     !Config  Desc = zoom en latitude
749     !Config  Def  = 1.0
750     !Config  Help = facteur de grossissement du zoom,
751     !Config         selon la latitude
752     grossismy = 1.0
753     CALL getin('grossismy',grossismy)
754
755     IF( grossismx.LT.1. )  THEN
756        write(lunout,*) &
757             'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
758        STOP
759     ELSE
760        alphax = 1. - 1./ grossismx
761     ENDIF
762
763     IF( grossismy.LT.1. )  THEN
764        write(lunout,*) 'conf_gcm: ***ATTENTION !! grossismy < 1 . *** '
765        STOP
766     ELSE
767        alphay = 1. - 1./ grossismy
768     ENDIF
769
770     write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay
771
772     !    alphax et alphay sont les anciennes formulat. des grossissements
773
774     !Config  Key  = fxyhypb
775     !Config  Desc = Fonction  hyperbolique
776     !Config  Def  = y
777     !Config  Help = Fonction  f(y)  hyperbolique  si = .true. 
778     !Config         sinon  sinusoidale
779     fxyhypb = .TRUE.
780     CALL getin('fxyhypb',fxyhypb)
781
782     !Config  Key  = dzoomx
783     !Config  Desc = extension en longitude
784     !Config  Def  = 0
785     !Config  Help = extension en longitude  de la zone du zoom 
786     !Config         ( fraction de la zone totale)
787     dzoomx = 0.2
788     CALL getin('dzoomx',dzoomx)
789     call assert(dzoomx < 1, "conf_gcm: dzoomx must be < 1")
790
791     !Config  Key  = dzoomy
792     !Config  Desc = extension en latitude
793     !Config  Def  = 0
794     !Config  Help = extension en latitude de la zone  du zoom 
795     !Config         ( fraction de la zone totale)
796     dzoomy = 0.2
797     CALL getin('dzoomy',dzoomy)
798     call assert(dzoomy < 1, "conf_gcm: dzoomy must be < 1")
799
800     !Config  Key  = taux
801     !Config  Desc = raideur du zoom en  X
802     !Config  Def  = 3
803     !Config  Help = raideur du zoom en  X
804     taux = 3.0
805     CALL getin('taux',taux)
806
807     !Config  Key  = tauy
808     !Config  Desc = raideur du zoom en  Y
809     !Config  Def  = 3
810     !Config  Help = raideur du zoom en  Y
811     tauy = 3.0
812     CALL getin('tauy',tauy)
813
814     !Config  Key  = ysinus
815     !Config  IF   = !fxyhypb
816     !Config  Desc = Fonction en Sinus
817     !Config  Def  = y
818     !Config  Help = Fonction  f(y) avec y = Sin(latit.) si = .true.
819     !Config         sinon y = latit.
820     ysinus = .TRUE.
821     CALL getin('ysinus',ysinus)
822
823     !Config  Key  = offline
824     !Config  Desc = Nouvelle eau liquide
825     !Config  Def  = n
826     !Config  Help = Permet de mettre en route la
827     !Config         nouvelle parametrisation de l'eau liquide !
828     offline = .FALSE.
829     CALL getin('offline',offline)
830     IF (offline .AND. adjust) THEN
831        WRITE(lunout,*)  &
832             'WARNING : option offline does not work with adjust=y :'
833        WRITE(lunout,*) 'the files defstoke.nc, fluxstoke.nc ',  &
834             'and fluxstokev.nc will not be created'
835        WRITE(lunout,*)  &
836             'only the file phystoke.nc will still be created '
837     END IF
838
839     !Config  Key  = type_trac
840     !Config  Desc = Choix de couplage avec model de chimie INCA ou REPROBUS
841     !Config  Def  = lmdz
842     !Config  Help =
843     !Config         'lmdz' = pas de couplage, pur LMDZ
844     !Config         'inca' = model de chime INCA
845     !Config         'repr' = model de chime REPROBUS
846     type_trac = 'lmdz'
847     CALL getin('type_trac',type_trac)
848
849     !Config  Key  = config_inca
850     !Config  Desc = Choix de configuration de INCA
851     !Config  Def  = none
852     !Config  Help = Choix de configuration de INCA :
853     !Config         'none' = sans INCA
854     !Config         'chem' = INCA avec calcul de chemie
855     !Config         'aero' = INCA avec calcul des aerosols
856     config_inca = 'none'
857     CALL getin('config_inca',config_inca)
858
859     !Config  Key  = ok_dynzon
860     !Config  Desc = sortie des transports zonaux dans la dynamique
861     !Config  Def  = n
862     !Config  Help = Permet de mettre en route le calcul des transports
863     !Config         
864     ok_dynzon = .FALSE.
865     CALL getin('ok_dynzon',ok_dynzon)
866
867     !Config  Key  = ok_dyn_ins
868     !Config  Desc = sorties instantanees dans la dynamique
869     !Config  Def  = n
870     !Config  Help =
871     !Config         
872     ok_dyn_ins = .FALSE.
873     CALL getin('ok_dyn_ins',ok_dyn_ins)
874
875     !Config  Key  = ok_dyn_ave
876     !Config  Desc = sorties moyennes dans la dynamique
877     !Config  Def  = n
878     !Config  Help =
879     !Config         
880     ok_dyn_ave = .FALSE.
881     CALL getin('ok_dyn_ave',ok_dyn_ave)
882
883     !Config  Key  = use_filtre_fft
884     !Config  Desc = flag to activate FFTs for the filter
885     !Config  Def  = false
886     !Config  Help = enables to use FFts to do the longitudinal polar
887     !Config         filtering around the poles.
888     use_filtre_fft=.FALSE.
889     CALL getin('use_filtre_fft',use_filtre_fft)
890     IF (use_filtre_fft .AND. grossismx /= 1.0) THEN
891        write(lunout,*)'WARNING !!! '
892        write(lunout,*)"A zoom in longitude is not compatible", &
893             " with the FFT filter ", &
894             "---> FFT filter deactivated"
895        use_filtre_fft=.FALSE.
896     ENDIF
897     use_filtre_fft_loc=use_filtre_fft
898
899     !Config  Key  = use_mpi_alloc
900     !Config  Desc = Utilise un buffer MPI en m�moire globale
901     !Config  Def  = false
902     !Config  Help = permet d'activer l'utilisation d'un buffer MPI
903     !Config         en m�moire globale a l'aide de la fonction MPI_ALLOC.
904     !Config         Cela peut am�liorer la bande passante des transferts MPI
905     !Config         d'un facteur 2 
906     use_mpi_alloc=.FALSE.
907     CALL getin('use_mpi_alloc',use_mpi_alloc)
908
909     !Config key = ok_strato
910     !Config  Desc = activation de la version strato
911     !Config  Def  = .FALSE.
912     !Config  Help = active la version stratosphérique de LMDZ de F. Lott
913
914     ok_strato=.FALSE.
915     CALL getin('ok_strato',ok_strato)
916
917     vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39)
918     CALL getin('vert_prof_dissip', vert_prof_dissip)
919     call assert(vert_prof_dissip == 0 .or. vert_prof_dissip ==  1, &
920          "bad value for vert_prof_dissip")
921
922     !Config  Key  = ok_gradsfile
923     !Config  Desc = activation des sorties grads du guidage
924     !Config  Def  = n
925     !Config  Help = active les sorties grads du guidage
926
927     ok_gradsfile = .FALSE.
928     CALL getin('ok_gradsfile',ok_gradsfile)
929
930     !Config  Key  = ok_limit
931     !Config  Desc = creation des fichiers limit dans create_etat0_limit
932     !Config  Def  = y
933     !Config  Help = production du fichier limit.nc requise
934
935     ok_limit = .TRUE.
936     CALL getin('ok_limit',ok_limit)
937
938     !Config  Key  = ok_etat0
939     !Config  Desc = creation des fichiers etat0 dans create_etat0_limit
940     !Config  Def  = y
941     !Config  Help = production des fichiers start.nc, startphy.nc requise
942
943     ok_etat0 = .TRUE.
944     CALL getin('ok_etat0',ok_etat0)
945
946     !Config  Key  = read_orop
947     !Config  Desc = lecture du fichier de params orographiques sous maille
948     !Config  Def  = f
949     !Config  Help = lecture fichier plutot que grid_noro
950
951     read_orop = .FALSE.
952     CALL getin('read_orop',read_orop)
953
954     write(lunout,*)' #########################################'
955     write(lunout,*)' Configuration des parametres de cel0' &
956          //'_limit: '
957     write(lunout,*)' planet_type = ', planet_type
958     write(lunout,*)' calend = ', calend
959     write(lunout,*)' dayref = ', dayref
960     write(lunout,*)' anneeref = ', anneeref
961     write(lunout,*)' nday = ', nday
962     write(lunout,*)' day_step = ', day_step
963     write(lunout,*)' iperiod = ', iperiod
964     write(lunout,*)' iconser = ', iconser
965     write(lunout,*)' iecri = ', iecri
966     write(lunout,*)' periodav = ', periodav
967     write(lunout,*)' output_grads_dyn = ', output_grads_dyn
968     write(lunout,*)' dissip_period = ', dissip_period
969     write(lunout,*)' lstardis = ', lstardis
970     write(lunout,*)' nitergdiv = ', nitergdiv
971     write(lunout,*)' nitergrot = ', nitergrot
972     write(lunout,*)' niterh = ', niterh
973     write(lunout,*)' tetagdiv = ', tetagdiv
974     write(lunout,*)' tetagrot = ', tetagrot
975     write(lunout,*)' tetatemp = ', tetatemp
976     write(lunout,*)' coefdis = ', coefdis
977     write(lunout,*)' purmats = ', purmats
978     write(lunout,*)' read_start = ', read_start
979     write(lunout,*)' iflag_phys = ', iflag_phys
980     write(lunout,*)' iphysiq = ', iphysiq
981     write(lunout,*)' clon = ', clon
982     write(lunout,*)' clat = ', clat
983     write(lunout,*)' grossismx = ', grossismx
984     write(lunout,*)' grossismy = ', grossismy
985     write(lunout,*)' fxyhypb = ', fxyhypb
986     write(lunout,*)' dzoomx = ', dzoomx
987     write(lunout,*)' dzoomy = ', dzoomy
988     write(lunout,*)' taux = ', taux
989     write(lunout,*)' tauy = ', tauy
990     write(lunout,*)' offline = ', offline
991     write(lunout,*)' type_trac = ', type_trac
992     write(lunout,*)' config_inca = ', config_inca
993     write(lunout,*)' ok_dynzon = ', ok_dynzon
994     write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
995     write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
996     write(lunout,*)' use_filtre_fft = ', use_filtre_fft
997     write(lunout,*)' use_mpi_alloc = ', use_mpi_alloc
998     write(lunout,*)' ok_strato = ', ok_strato
999     write(lunout,*)' ok_gradsfile = ', ok_gradsfile
1000     write(lunout,*)' ok_limit = ', ok_limit
1001     write(lunout,*)' ok_etat0 = ', ok_etat0
1002     write(lunout,*)' read_orop = ', read_orop
1003  end IF test_etatinit
1004
1005END SUBROUTINE conf_gcm
Note: See TracBrowser for help on using the repository browser.