Ignore:
Timestamp:
Mar 30, 2009, 4:46:54 PM (16 years ago)
Author:
Ehouarn Millour
Message:

Premiere vaque de modifications pour l'unification des dynamiques (planetes-Terre) et un peu de netoyage ...

  • modified 'makegcm' and 'makegcm_fcm' to remove 'CPP_PHYS' key and add 'CPP_EARTH' preprocessing key instead
  • updated 'diagedyn.F' (in dyn3d and dyn3dpar) to use 'CPP_EARTH' key
  • added 'ioipsl_getincom.F90' and 'ioipsl_stringop.F90' to 'dyn3d' and 'dyn3dpar' for future possibility of running without IOIPSL library
  • modified conf_gcm.F ( in d'yn3d' and 'dyn3dpar') to read in flag 'planet_type' (default=='earth') (flag added in 'control.h')
  • modified 'gcm.F' (in 'dyn3d' and 'dyn3dpar') so that flags so that 'read_start' and 'iflag_phys' (known from conf_gcm.F) are used
  • added flag 'output_grads_dyn' (read by conf_gcm.F, stored in 'control.h') to write grads outputs from 'leapfrog.F' and 'leapfrog_p.F'
  • removed 'comdiss.h' from 'dyn3d' and 'dyn3dpar' (it is not used)
  • removed variable 'lstardis' from 'comdissip.h' (it is also in

'comdissnew.h'), in dyn3d as well as in dyn3dpar

  • adapted 'dyn3d/iniacademic.F' to not use 'inicons0.F' but 'iniconst.F'
  • updated 'dyn3d/etat0_netcdf.F' to not use 'inicons0' but 'iniconst' (added prerequisite pa=50000 instruction) and added #ifdef CPP_EARTH keys
  • removed 'inicons0.F' and 'disvert0.F' (not used any more)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/gcm.F

    r1114 r1140  
    88#ifdef CPP_IOIPSL
    99      USE IOIPSL
     10#else
     11! if not using IOIPSL, we still need to use (a local version of) getin
     12      USE ioipsl_getincom
    1013#endif
    1114
     
    1720! A nettoyer. On ne veut qu'une ou deux routines d'interface
    1821! dynamique -> physique pour l'initialisation
    19 #ifdef CPP_PHYS
     22! Ehouarn: for now these only apply to Earth:
     23#ifdef CPP_EARTH
    2024      USE dimphy
    2125      USE comgeomphy
     
    158162
    159163
    160 c--------------------------------------------------------------------------
    161 c   Iflag_phys controle l'appel a la physique :
    162 c   -------------------------------------------
    163 c      0 : pas de physique
    164 c      1 : Normale (appel a phylmd, phymars ...)
    165 c      2 : rappel Newtonien pour la temperature + friction au sol
    166       iflag_phys=1
    167 
    168 c--------------------------------------------------------------------------
    169 c   Lecture de l'etat initial :
    170 c   ---------------------------
    171 c     T : on lit start.nc
    172 c     F : le modele s'autoinitialise avec un cas academique (iniacademic)
    173       read_start=.true.
    174 #ifdef CPP_IOIPSL
    175 #else
    176       read_start=.false.
    177 #endif
    178 #ifdef CPP_PHYS
    179 #else
    180       read_start=.false.
    181 #endif
    182164
    183165c-----------------------------------------------------------------------
     
    196178c  ---------------------------------------
    197179c
    198 #ifdef CPP_IOIPSL
     180! Ehouarn: dump possibility of using defrun
     181!#ifdef CPP_IOIPSL
    199182      CALL conf_gcm( 99, .TRUE. , clesphy0 )
    200 #else
    201       CALL defrun( 99, .TRUE. , clesphy0 )
    202 #endif
     183!#else
     184!      CALL defrun( 99, .TRUE. , clesphy0 )
     185!#endif
    203186
    204187!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    206189! A nettoyer. On ne veut qu'une ou deux routines d'interface
    207190! dynamique -> physique pour l'initialisation
    208 #ifdef CPP_PHYS
     191! Ehouarn : temporarily (?) keep this only for Earth
     192      if (planet_type.eq."earth") then
     193#ifdef CPP_EARTH
    209194      CALL Init_Phys_lmdz(iim,jjp1,llm,1,(jjm-1)*iim+2)
    210195      call InitComgeomphy
    211196#endif
     197      endif
    212198!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    213199
     
    242228c  lecture du fichier start.nc
    243229      if (read_start) then
    244 #ifdef CPP_IOIPSL
     230      ! we still need to run iniacademic to initialize some
     231      ! constants & fields, if we run the 'newtonian' case:
     232        if (iflag_phys.eq.2) then
     233          CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0)
     234        endif
     235!#ifdef CPP_IOIPSL
     236        if (planet_type.eq."earth") then
     237#ifdef CPP_EARTH
     238! Load an Earth-format start file
    245239         CALL dynetat0("start.nc",vcov,ucov,
    246240     .              teta,q,masse,ps,phis, time_0)
     241#endif
     242        endif ! of if (planet_type.eq."earth")
    247243c       write(73,*) 'ucov',ucov
    248244c       write(74,*) 'vcov',vcov
     
    251247c       write(77,*) 'q',q
    252248
    253 #endif
    254       endif
     249      endif ! of if (read_start)
    255250
    256251      IF (config_inca /= 'none') THEN
     
    264259c le cas echeant, creation d un etat initial
    265260      IF (prt_level > 9) WRITE(lunout,*)
    266      .                 'AVANT iniacademic AVANT AVANT AVANT AVANT'
     261     .              'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT'
    267262      if (.not.read_start) then
    268263         CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0)
     
    298293      if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then
    299294        write(lunout,*)
    300      .  ' Attention les dates initiales lues dans le fichier'
     295     .  'GCM: Attention les dates initiales lues dans le fichier'
    301296        write(lunout,*)
    302297     .  ' restart ne correspondent pas a celles lues dans '
     
    304299        if (raz_date .ne. 1) then
    305300          write(lunout,*)
    306      .    ' On garde les dates du fichier restart'
     301     .    'GCM: On garde les dates du fichier restart'
    307302        else
    308303          annee_ref = anneeref
     
    313308          time_0 = 0.
    314309          write(lunout,*)
    315      .   ' On reinitialise a la date lue dans gcm.def'
     310     .   'GCM: On reinitialise a la date lue dans gcm.def'
    316311        endif
    317312      ELSE
     
    350345c   Initialisation de la physique :
    351346c   -------------------------------
    352 #ifdef CPP_PHYS
    353       IF (call_iniphys.and.iflag_phys.eq.1) THEN
     347
     348      IF (call_iniphys.and.(iflag_phys.eq.1)) THEN
    354349         latfi(1)=rlatu(1)
    355350         lonfi(1)=0.
     
    370365         CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi)
    371366         WRITE(lunout,*)
    372      .           'WARNING!!! vitesse verticale nulle dans la physique'
     367     .       'GCM: WARNING!!! vitesse verticale nulle dans la physique'
     368! Earth:
     369         if (planet_type.eq."earth") then
     370#ifdef CPP_EARTH
    373371         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys ,
    374372     ,                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp     )
     373#endif
     374         endif ! of if (planet_type.eq."earth")
    375375         call_iniphys=.false.
    376       ENDIF
    377 #endif
     376      ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1))
     377!#endif
    378378
    379379c  numero de stockage pour les fichiers de redemarrage:
     
    386386      day_end = day_ini + nday
    387387      WRITE(lunout,300)day_ini,day_end
     388 300  FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//)
     389
     390      if (planet_type.eq."earth") then
     391#ifdef CPP_EARTH
     392      CALL dynredem0("restart.nc", day_end, phis)
     393#endif
     394      endif
     395
     396      ecripar = .TRUE.
    388397
    389398#ifdef CPP_IOIPSL
    390       CALL dynredem0("restart.nc", day_end, phis)
    391 
    392       ecripar = .TRUE.
    393 
    394399      if ( 1.eq.1) then
    395400      time_step = zdtvr
     
    409414
    410415#endif
     416! #endif of #ifdef CPP_IOIPSL
    411417
    412418c  Choix des frequences de stokage pour le offline
     
    432438     .              time_0)
    433439
    434 
    435 
    436  300  FORMAT('1'/,15x,'run du pas',i7,2x,'au pas',i7,2x,
    437      . 'c''est a dire du jour',i7,3x,'au jour',i7//)
    438440      END
    439441
Note: See TracChangeset for help on using the changeset viewer.