Changeset 1140


Ignore:
Timestamp:
Mar 30, 2009, 4:46:54 PM (15 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)
Location:
LMDZ4/branches/LMDZ4-dev
Files:
4 added
6 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/comdissip.h

    r524 r1140  
    22! $Header$
    33!
    4 c-----------------------------------------------------------------------
    5 c INCLUDE dissip.h
     4!-----------------------------------------------------------------------
     5! INCLUDE comdissip.h
    66
    7       COMMON/comdissip/
    8      $    lstardis,niterdis,coefdis,tetavel,tetatemp,gamdissip
     7      COMMON/comdissip/                                                 &
     8     &    niterdis,coefdis,tetavel,tetatemp,gamdissip
    99
    1010
    11       LOGICAL lstardis
    1211      INTEGER niterdis
    1312
    1413      REAL tetavel,tetatemp,coefdis,gamdissip
    1514
    16 c-----------------------------------------------------------------------
     15!-----------------------------------------------------------------------
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/conf_gcm.F

    r1046 r1140  
    66      SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 )
    77c
     8#ifdef CPP_IOIPSL
    89      use IOIPSL
     10#else
     11! if not using IOIPSL, we still need to use (a local version of) getin
     12      use ioipsl_getincom
     13#endif
    914      IMPLICIT NONE
    1015c-----------------------------------------------------------------------
     
    99104c  Parametres de controle du run:
    100105c-----------------------------------------------------------------------
     106!Config  Key  = planet_type
     107!Config  Desc = planet type ("earth", "mars", "venus", ...)
     108!Config  Def  = earth
     109!Config  Help = this flag sets the type of atymosphere that is considered
     110      planet_type="earth"
     111      CALL getin('planet_type',planet_type)
    101112
    102113!Config  Key  = dayref
     
    179190       CALL getin('periodav',periodav)
    180191
     192!Config  Key  = output_grads_dyn
     193!Config  Desc = output dynamics diagnostics in 'dyn.dat' file
     194!Config  Def  = n
     195!Config  Help = output dynamics diagnostics in Grads-readable 'dyn.dat' file
     196       output_grads_dyn=.false.
     197       CALL getin('output_grads_dyn',output_grads_dyn)
     198
    181199!Config  Key  = idissip
    182200!Config  Desc = periode de la dissipation
     
    274292c    ...............................................................
    275293
     294!Config  Key  =  read_start
     295!Config  Desc = Initialize model using a 'start.nc' file
     296!Config  Def  = y
     297!Config  Help = y: intialize dynamical fields using a 'start.nc' file
     298!               n: fields are initialized by 'iniacademic' routine
     299       read_start= .true.
     300       CALL getin('read_start',read_start)
     301
    276302!Config  Key  = iflag_phys
    277303!Config  Desc = Avec ls physique
     
    330356c
    331357      IF( ABS(clat - clatt).GE. 0.001 )  THEN
    332         PRINT *,' La valeur de clat passee par run.def est differente de
    333      * celle lue sur le fichier  start '
     358        write(lunout,*)'conf_gcm: La valeur de clat passee par run.def',
     359     &    ' est differente de celle lue sur le fichier  start '
    334360        STOP
    335361      ENDIF
     
    345371
    346372      IF( ABS(grossismx - grossismxx).GE. 0.001 )  THEN
    347         PRINT *,' La valeur de grossismx passee par run.def est differente 
    348      * de celle lue sur le fichier  start '
     373        write(lunout,*)'conf_gcm: La valeur de grossismx passee par ',
     374     &  'run.def est differente de celle lue sur le fichier  start '
    349375        STOP
    350376      ENDIF
     
    359385
    360386      IF( ABS(grossismy - grossismyy).GE. 0.001 )  THEN
    361         PRINT *,' La valeur de grossismy passee par run.def est differen
    362      * te de celle lue sur le fichier  start '
     387        write(lunout,*)'conf_gcm: La valeur de grossismy passee par ',
     388     & 'run.def est differente de celle lue sur le fichier  start '
    363389        STOP
    364390      ENDIF
    365391     
    366392      IF( grossismx.LT.1. )  THEN
    367         PRINT *,' ***  ATTENTION !! grossismx < 1 .   *** '
     393        write(lunout,*)
     394     &       'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
    368395         STOP
    369396      ELSE
     
    373400
    374401      IF( grossismy.LT.1. )  THEN
    375         PRINT *,' ***  ATTENTION !! grossismy < 1 .   *** '
     402        write(lunout,*)
     403     &       'conf_gcm: ***  ATTENTION !! grossismy < 1 .   *** '
    376404         STOP
    377405      ELSE
     
    379407      ENDIF
    380408
    381       PRINT *,' alphax alphay defrun ',alphax,alphay
     409      write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay
    382410c
    383411c    alphax et alphay sont les anciennes formulat. des grossissements
     
    394422
    395423      IF( .NOT.fxyhypb )  THEN
    396            IF( fxyhypbb )     THEN
    397               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    398               PRINT *,' *** fxyhypb lu sur le fichier start est F ',
    399      *       'alors  qu il est  T  sur  run.def  ***'
     424         IF( fxyhypbb )     THEN
     425            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     426            write(lunout,*)' *** fxyhypb lu sur le fichier start est ',
     427     *       'F alors  qu il est  T  sur  run.def  ***'
    400428              STOP
    401            ENDIF
     429         ENDIF
    402430      ELSE
    403            IF( .NOT.fxyhypbb )   THEN
    404               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    405               PRINT *,' ***  fxyhypb lu sur le fichier start est T ',
    406      *        'alors  qu il est  F  sur  run.def  ****  '
     431         IF( .NOT.fxyhypbb )   THEN
     432            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     433            write(lunout,*)' ***  fxyhypb lu sur le fichier start est ',
     434     *        'T alors  qu il est  F  sur  run.def  ****  '
    407435              STOP
    408            ENDIF
     436         ENDIF
    409437      ENDIF
    410438c
     
    419447      IF( fxyhypb )  THEN
    420448       IF( ABS(dzoomx - dzoomxx).GE. 0.001 )  THEN
    421         PRINT *,' La valeur de dzoomx passee par run.def est differente
    422      *  de celle lue sur le fichier  start '
     449        write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ',
     450     *  'run.def est differente de celle lue sur le fichier  start '
    423451        STOP
    424452       ENDIF
     
    435463      IF( fxyhypb )  THEN
    436464       IF( ABS(dzoomy - dzoomyy).GE. 0.001 )  THEN
    437         PRINT *,' La valeur de dzoomy passee par run.def est differente
    438      * de celle lue sur le fichier  start '
     465        write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ',
     466     * 'run.def est differente de celle lue sur le fichier  start '
    439467        STOP
    440468       ENDIF
     
    450478      IF( fxyhypb )  THEN
    451479       IF( ABS(taux - tauxx).GE. 0.001 )  THEN
    452         PRINT *,' La valeur de taux passee par run.def est differente
    453      * de celle lue sur le fichier  start '
     480        write(lunout,*)'conf_gcm: La valeur de taux passee par ',
     481     * 'run.def est differente de celle lue sur le fichier  start '
    454482        STOP
    455483       ENDIF
     
    465493      IF( fxyhypb )  THEN
    466494       IF( ABS(tauy - tauyy).GE. 0.001 )  THEN
    467         PRINT *,' La valeur de tauy passee par run.def est differente
    468      * de celle lue sur le fichier  start '
     495        write(lunout,*)'conf_gcm: La valeur de tauy passee par ',
     496     * 'run.def est differente de celle lue sur le fichier  start '
    469497        STOP
    470498       ENDIF
     
    484512
    485513        IF( .NOT.ysinus )  THEN
    486            IF( ysinuss )     THEN
    487               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    488               PRINT *,' *** ysinus lu sur le fichier start est F ',
    489      *       'alors  qu il est  T  sur  run.def  ***'
     514          IF( ysinuss )     THEN
     515            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     516            write(lunout,*)' *** ysinus lu sur le fichier start est F',
     517     *       ' alors  qu il est  T  sur  run.def  ***'
     518            STOP
     519          ENDIF
     520        ELSE
     521          IF( .NOT.ysinuss )   THEN
     522            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     523            write(lunout,*)' *** ysinus lu sur le fichier start est T',
     524     *        ' alors  qu il est  F  sur  run.def  ****  '
    490525              STOP
    491            ENDIF
    492         ELSE
    493            IF( .NOT.ysinuss )   THEN
    494               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    495               PRINT *,' ***  ysinus lu sur le fichier start est T ',
    496      *        'alors  qu il est  F  sur  run.def  ****  '
    497               STOP
    498            ENDIF
     526          ENDIF
    499527        ENDIF
    500       ENDIF
     528      ENDIF ! of IF( .NOT.fxyhypb  )
    501529c
    502530!Config  Key  = offline
     
    521549      write(lunout,*)' #########################################'
    522550      write(lunout,*)' Configuration des parametres du gcm: '
     551      write(lunout,*)' planet_type = ', planet_type
    523552      write(lunout,*)' dayref = ', dayref
    524553      write(lunout,*)' anneeref = ', anneeref
     
    529558      write(lunout,*)' iecri = ', iecri
    530559      write(lunout,*)' periodav = ', periodav
     560      write(lunout,*)' output_grads_dyn = ', output_grads_dyn
    531561      write(lunout,*)' idissip = ', idissip
    532562      write(lunout,*)' lstardis = ', lstardis
     
    539569      write(lunout,*)' coefdis = ', coefdis
    540570      write(lunout,*)' purmats = ', purmats
     571      write(lunout,*)' read_start = ', read_start
    541572      write(lunout,*)' iflag_phys = ', iflag_phys
    542573      write(lunout,*)' iphysiq = ', iphysiq
     
    590621
    591622      IF( grossismx.LT.1. )  THEN
    592         PRINT *,' ***  ATTENTION !! grossismx < 1 .   *** '
     623        write(lunout,*)
     624     &   'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
    593625         STOP
    594626      ELSE
     
    598630
    599631      IF( grossismy.LT.1. )  THEN
    600         PRINT *,' ***  ATTENTION !! grossismy < 1 .   *** '
     632        write(lunout,*)
     633     &  'conf_gcm: ***  ATTENTION !! grossismy < 1 .   *** '
    601634         STOP
    602635      ELSE
     
    604637      ENDIF
    605638
    606       PRINT *,' alphax alphay defrun ',alphax,alphay
     639      write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay
    607640c
    608641c    alphax et alphay sont les anciennes formulat. des grossissements
     
    693726      write(lunout,*)' #########################################'
    694727      write(lunout,*)' Configuration des parametres du gcm: '
     728      write(lunout,*)' planet_type = ', planet_type
    695729      write(lunout,*)' dayref = ', dayref
    696730      write(lunout,*)' anneeref = ', anneeref
     
    701735      write(lunout,*)' iecri = ', iecri
    702736      write(lunout,*)' periodav = ', periodav
     737      write(lunout,*)' output_grads_dyn = ', output_grads_dyn
    703738      write(lunout,*)' idissip = ', idissip
    704739      write(lunout,*)' lstardis = ', lstardis
     
    711746      write(lunout,*)' coefdis = ', coefdis
    712747      write(lunout,*)' purmats = ', purmats
     748      write(lunout,*)' read_start = ', read_start
    713749      write(lunout,*)' iflag_phys = ', iflag_phys
    714750      write(lunout,*)' iphysiq = ', iphysiq
    715       write(lunout,*)' clonn = ', clonn
    716       write(lunout,*)' clatt = ', clatt
     751      write(lunout,*)' clon = ', clon
     752      write(lunout,*)' clat = ', clat
    717753      write(lunout,*)' grossismx = ', grossismx
    718754      write(lunout,*)' grossismy = ', grossismy
    719       write(lunout,*)' fxyhypbb = ', fxyhypbb
     755      write(lunout,*)' fxyhypb = ', fxyhypb
    720756      write(lunout,*)' dzoomx = ', dzoomx
    721757      write(lunout,*)' dzoomy = ', dzoomy
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/control.h

    r962 r1140  
    1414     &              iperiod,iapp_tracvl,iconser,iecri,idissip,iphysiq , &
    1515     &              periodav,iecrimoy,dayref,anneeref,                  &
    16      &              raz_date,offline,ip_ebil_dyn,config_inca
     16     &              raz_date,offline,ip_ebil_dyn,config_inca,           &
     17     &              planet_type,output_grads_dyn
    1718
    1819      INTEGER   nday,day_step,iperiod,iapp_tracvl,iconser,iecri,        &
     
    2223      logical offline
    2324      CHARACTER (len=4) :: config_inca
     25      CHARACTER(len=10) :: planet_type ! planet type ('earth','mars',...)
     26      LOGICAL :: output_grads_dyn ! output dynamics diagnostics in
     27                                  ! binary grads file 'dyn.dat' (y/n)
    2428!-----------------------------------------------------------------------
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/diagedyn.F

    r524 r1140  
    5858#include "paramet.h"
    5959#include "comgeom.h"
    60 
    61 #ifdef CPP_PHYS
     60#include "iniprint.h"
     61
     62#ifdef CPP_EARTH
    6263#include "../phylmd/YOMCST.h"
    6364#include "../phylmd/YOETHF.h"
     
    139140
    140141
    141 #ifdef CPP_PHYS
     142#ifdef CPP_EARTH
    142143c======================================================================
    143144C     Compute Kinetic enrgy
     
    314315C
    315316#else
    316       print*,'Pour l instant diagedyn a besoin de la physique'
     317      write(lunout,*),'diagedyn: Needs Earth physics to function'
    317318#endif
     319! #endif of #ifdef CPP_EARTH
    318320      RETURN
    319321      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/etat0_netcdf.F

    r1114 r1140  
    55c
    66      SUBROUTINE etat0_netcdf (interbar, masque)
    7    
     7#ifdef CPP_EARTH       
    88      USE startvar
    99      USE ioipsl
     
    1414      USE phys_state_var_mod
    1515      USE filtreg_mod
     16#endif
     17!#endif of #ifdef CPP_EARTH
    1618      !
    1719      IMPLICIT NONE
     
    2527!     .KLON=KFDIA-KIDIA+1,KLEV=llm
    2628      !
     29#ifdef CPP_EARTH   
    2730#include "comgeom2.h"
    2831#include "comvert.h"
     
    3134#include "dimsoil.h"
    3235#include "temps.h"
    33       !
     36#endif
     37!#endif of #ifdef CPP_EARTH
     38      ! arguments:
    3439      LOGICAL interbar
     40      REAL :: masque(iip1,jjp1)
     41
     42#ifdef CPP_EARTH
     43      ! local variables:
    3544      REAL :: latfi(klon), lonfi(klon)
    36       REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), masque(iip1,jjp1)
     45      REAL :: orog(iip1,jjp1), rugo(iip1,jjp1)
    3746      REAL :: psol(iip1, jjp1), phis(iip1, jjp1)
    3847      REAL :: p3d(iip1, jjp1, llm+1)
     
    143152      !
    144153      preff     = 101325.
     154      pa        =  50000.
    145155      unskap = 1./kappa
    146156      !
     
    168178
    169179
    170       CALL inicons0()
     180      CALL iniconst()
    171181      CALL inigeom()
    172182
     
    759769      DEALLOCATE(q3d)
    760770
     771#endif
     772!#endif of #ifdef CPP_EARTH
    761773      RETURN
    762774      !
  • 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
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/iniacademic.F

    r1114 r1140  
    4545#include "temps.h"
    4646#include "control.h"
     47#include "iniprint.h"
    4748
    4849c   Arguments:
     
    5758      REAL ps(ip1jmp1)                       ! pression  au sol
    5859      REAL masse(ip1jmp1,llm)                ! masse d'air
     60      REAL phis(ip1jmp1)                     ! geopotentiel au sol
     61
     62c   Local:
     63c   ------
     64
    5965      REAL p (ip1jmp1,llmp1  )               ! pression aux interfac.des couches
    6066      REAL pks(ip1jmp1)                      ! exner au  sol
    6167      REAL pk(ip1jmp1,llm)                   ! exner au milieu des couches
    6268      REAL pkf(ip1jmp1,llm)                  ! exner filt.au milieu des couches
    63       REAL phis(ip1jmp1)                     ! geopotentiel au sol
    6469      REAL phi(ip1jmp1,llm)                  ! geopotentiel
    65 
    66 
    67 
    68 
    69 
    70 c   Local:
    71 c   ------
    72 
    7370      REAL ddsin,tetarappelj,tetarappell,zsig
    7471      real tetajl(jjp1,llm)
     
    8178
    8279c-----------------------------------------------------------------------
     80! 1. Initializations for Earth-like case
     81! --------------------------------------
     82      if (planet_type=="earth") then
     83c
     84        time_0=0.
    8385
    84 c
    85       time_0=0.
     86        im         = iim
     87        jm         = jjm
     88        day_ini    = 0
     89        omeg       = 4.*asin(1.)/86400.
     90        rad    = 6371229.
     91        g      = 9.8
     92        daysec = 86400.
     93        dtvr    = daysec/FLOAT(day_step)
     94        zdtvr=dtvr
     95        kappa  = 0.2857143
     96        cpp    = 1004.70885
     97        preff     = 101325.
     98        pa        =  50000.
     99        etot0      = 0.
     100        ptot0      = 0.
     101        ztot0      = 0.
     102        stot0      = 0.
     103        ang0       = 0.
    86104
    87       im         = iim
    88       jm         = jjm
    89       day_ini    = 0
    90       omeg       = 4.*asin(1.)/86400.
    91       rad    = 6371229.
    92       g      = 9.8
    93       daysec = 86400.
    94       dtvr    = daysec/FLOAT(day_step)
    95       zdtvr=dtvr
    96       kappa  = 0.2857143
    97       cpp    = 1004.70885
    98       preff     = 101325.
    99       pa        =  50 000.
    100       etot0      = 0.
    101       ptot0      = 0.
    102       ztot0      = 0.
    103       stot0      = 0.
    104       ang0       = 0.
    105       pa         = 0.
     105        CALL iniconst
     106        CALL inigeom
     107        CALL inifilr
    106108
    107       CALL inicons0
    108       CALL inigeom
    109       CALL inifilr
    110 
    111       ps=0.
    112       phis=0.
     109        ps=0.
     110        phis=0.
    113111c---------------------------------------------------------------------
    114112
    115       taurappel=10.*daysec
     113        taurappel=10.*daysec
    116114
    117115c---------------------------------------------------------------------
     
    119117c   --------------------------------------
    120118
    121       DO l=1,llm
    122        zsig=ap(l)/preff+bp(l)
    123        if (zsig.gt.0.3) then
    124          lsup=l
    125          tetarappell=1./8.*(-log(zsig)-.5)
    126          DO j=1,jjp1
    127             ddsin=sin(rlatu(j))-sin(pi/20.)
    128             tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell)
    129          ENDDO
    130         else
     119        DO l=1,llm
     120         zsig=ap(l)/preff+bp(l)
     121         if (zsig.gt.0.3) then
     122           lsup=l
     123           tetarappell=1./8.*(-log(zsig)-.5)
     124           DO j=1,jjp1
     125             ddsin=sin(rlatu(j))-sin(pi/20.)
     126             tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell)
     127           ENDDO
     128          else
    131129c   Choix isotherme au-dessus de 300 mbar
    132          do j=1,jjp1
    133             tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa
    134          enddo
    135         endif
    136       ENDDO
     130           do j=1,jjp1
     131             tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa
     132           enddo
     133          endif ! of if (zsig.gt.0.3)
     134        ENDDO ! of DO l=1,llm
    137135
    138       do l=1,llm
    139          do j=1,jjp1
    140             do i=1,iip1
    141                ij=(j-1)*iip1+i
    142                tetarappel(ij,l)=tetajl(j,l)
    143             enddo
    144          enddo
    145       enddo
     136        do l=1,llm
     137           do j=1,jjp1
     138              do i=1,iip1
     139                 ij=(j-1)*iip1+i
     140                 tetarappel(ij,l)=tetajl(j,l)
     141              enddo
     142           enddo
     143        enddo
    146144
    147 c     call dump2d(jjp1,llm,tetajl,'TEQ   ')
     145c       call dump2d(jjp1,llm,tetajl,'TEQ   ')
    148146
    149       ps=1.e5
    150       phis=0.
    151       CALL pression ( ip1jmp1, ap, bp, ps, p       )
    152       CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf )
    153       CALL massdair(p,masse)
     147        ps=1.e5
     148        phis=0.
     149        CALL pression ( ip1jmp1, ap, bp, ps, p       )
     150        CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf )
     151        CALL massdair(p,masse)
    154152
    155153c  intialisation du vent et de la temperature
    156       teta(:,:)=tetarappel(:,:)
    157       CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)
    158       call ugeostr(phi,ucov)
    159       vcov=0.
    160       q(:,:,1   )=1.e-10
    161       q(:,:,2   )=1.e-15
    162       q(:,:,3:nqtot)=0.
     154        teta(:,:)=tetarappel(:,:)
     155        CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)
     156        call ugeostr(phi,ucov)
     157        vcov=0.
     158        q(:,:,1   )=1.e-10
     159        q(:,:,2   )=1.e-15
     160        q(:,:,3:nqtot)=0.
    163161
    164162
    165 c   perturbation al\351atoire sur la temp\351rature
    166       idum  = -1
    167       zz = ran1(idum)
    168       idum  = 0
    169       do l=1,llm
    170          do ij=iip2,ip1jm
    171             teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum))
    172          enddo
    173       enddo
     163c   perturbation aleatoire sur la temperature
     164        idum  = -1
     165        zz = ran1(idum)
     166        idum  = 0
     167        do l=1,llm
     168           do ij=iip2,ip1jm
     169              teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum))
     170           enddo
     171        enddo
    174172
    175       do l=1,llm
    176          do ij=1,ip1jmp1,iip1
    177             teta(ij+iim,l)=teta(ij,l)
    178          enddo
    179       enddo
     173        do l=1,llm
     174           do ij=1,ip1jmp1,iip1
     175              teta(ij+iim,l)=teta(ij,l)
     176           enddo
     177        enddo
    180178
    181179
     
    187185
    188186c   initialisation d'un traceur sur une colonne
    189       j=jjp1*3/4
    190       i=iip1/2
    191       ij=(j-1)*iip1+i
    192       q(ij,:,3)=1.
    193 
     187        j=jjp1*3/4
     188        i=iip1/2
     189        ij=(j-1)*iip1+i
     190        q(ij,:,3)=1.
     191     
     192      else
     193        write(lunout,*)"iniacademic: planet types other than earth",
     194     &                 " not implemented (yet)."
     195        stop
     196      endif ! of if (planet_type=="earth")
    194197      return
    195198      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/leapfrog.F

    r1114 r1140  
    77
    88cIM : pour sortir les param. du modele dans un fis. netcdf 110106
    9       USE IOIPSL
     9#ifdef CPP_IOIPSL
     10      use IOIPSL
     11#endif
    1012      USE infotrac
    1113
     
    161163
    162164      character*80 dynhist_file, dynhistave_file
    163       character*20 modname
     165      character(len=20) :: modname
    164166      character*80 abort_message
    165167
     
    217219        call guide(itau,ucov,vcov,teta,q,masse,ps)
    218220      else
    219         IF(prt_level>9)WRITE(*,*)'attention on ne guide pas les ',
    220      .    '6 dernieres heures'
     221        IF(prt_level>9)WRITE(lunout,*)'leapfrog: attention on ne ',
     222     .    'guide pas les 6 dernieres heures'
    221223      endif
    222224#endif
     
    227229c     ENDIF
    228230c
     231
     232! Save fields obtained at previous time step as '...m1'
    229233      CALL SCOPY( ijmllm ,vcov , 1, vcovm1 , 1 )
    230234      CALL SCOPY( ijp1llm,ucov , 1, ucovm1 , 1 )
     
    242246      CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 )
    243247
    244       call minmax(ijp1llm,q(:,:,3),zqmin,zqmax)
     248! Ehouarn: what is this for? zqmin & zqmax are not used anyway ...
     249!      call minmax(ijp1llm,q(:,:,3),zqmin,zqmax)
    245250
    246251   2  CONTINUE
     
    302307
    303308
    304          ENDIF
    305 c
    306       ENDIF
     309         ENDIF ! of IF (offline)
     310c
     311      ENDIF ! of IF( forward. OR . leapf )
    307312
    308313
     
    350355c   -----------------------------------------------------
    351356
    352 #ifdef CPP_PHYS
    353357c+jld
    354358
    355359c  Diagnostique de conservation de l'énergie : initialisation
    356       IF (ip_ebil_dyn.ge.1 ) THEN
     360         IF (ip_ebil_dyn.ge.1 ) THEN
    357361          ztit='bil dyn'
    358           CALL diagedyn(ztit,2,1,1,dtphys
    359      e  , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
    360       ENDIF
     362! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)!
     363           IF (planet_type.eq."earth") THEN
     364            CALL diagedyn(ztit,2,1,1,dtphys
     365     &    , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
     366           ENDIF
     367         ENDIF ! of IF (ip_ebil_dyn.ge.1 )
    361368c-jld
     369#ifdef CPP_IOIPSL
    362370cIM : pour sortir les param. du modele dans un fis. netcdf 110106
    363       IF (first) THEN
    364        first=.false.
     371         IF (first) THEN
     372          first=.false.
    365373#include "ini_paramLMDZ_dyn.h"
    366       ENDIF
     374         ENDIF
    367375c
    368376#include "write_paramLMDZ_dyn.h"
    369377c
    370 
    371         CALL calfis( lafin ,rdayvrai,time  ,
     378#endif
     379! #endif of #ifdef CPP_IOIPSL
     380         CALL calfis( lafin ,rdayvrai,time  ,
    372381     $               ucov,vcov,teta,q,masse,ps,p,pk,phis,phi ,
    373382     $               du,dv,dteta,dq,
     
    375384     $               clesphy0, dufi,dvfi,dtetafi,dqfi,dpfi  )
    376385
    377        IF (ok_strato) THEN
    378          CALL top_bound( vcov,ucov,teta, dufi,dvfi,dtetafi)
    379        ENDIF
     386         IF (ok_strato) THEN
     387           CALL top_bound( vcov,ucov,teta, dufi,dvfi,dtetafi)
     388         ENDIF
    380389       
    381390c      ajout des tendances physiques:
     
    386395c
    387396c  Diagnostique de conservation de l'énergie : difference
    388       IF (ip_ebil_dyn.ge.1 ) THEN
     397         IF (ip_ebil_dyn.ge.1 ) THEN
    389398          ztit='bil phys'
    390           CALL diagedyn(ztit,2,1,1,dtphys
    391      e  , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
    392       ENDIF
    393 #endif
     399          IF (planet_type.eq."earth") THEN
     400           CALL diagedyn(ztit,2,1,1,dtphys
     401     &     , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
     402          ENDIF
     403         ENDIF ! of IF (ip_ebil_dyn.ge.1 )
     404
    394405       ENDIF ! of IF( apphys )
    395406
    396       IF(iflag_phys.EQ.2) THEN ! "Newtonian physics" case
     407      IF(iflag_phys.EQ.2) THEN ! "Newtonian" case
    397408c   Calcul academique de la physique = Rappel Newtonien + friction
    398409c   --------------------------------------------------------------
     
    472483
    473484
    474       END IF
     485      END IF ! of IF(apdiss)
    475486
    476487c ajout debug
     
    545556c           IF( MOD(itau,iecri*day_step).EQ.0) THEN
    546557
    547                nbetat = nbetatdem
    548        CALL geopot  ( ip1jmp1, teta  , pk , pks,  phis  , phi        )
    549         unat=0.
    550         do l=1,llm
    551            unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)
    552            vnat(:,l)=vcov(:,l)/cv(:)
    553         enddo
    554 #ifdef CPP_IOIPSL
    555 c        CALL writehist(histid,histvid,itau,vcov,
    556 c     s                       ucov,teta,phi,q,masse,ps,phis)
    557 #else
     558              nbetat = nbetatdem
     559              CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)
     560              unat=0.
     561              do l=1,llm
     562                unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)
     563                vnat(:,l)=vcov(:,l)/cv(:)
     564              enddo
     565#ifdef CPP_IOIPSL
     566c             CALL writehist(histid,histvid,itau,vcov,
     567c     &                      ucov,teta,phi,q,masse,ps,phis)
     568#endif
     569! For some Grads outputs of fields
     570             if (output_grads_dyn) then
    558571#include "write_grads_dyn.h"
    559 #endif
    560 
    561 
    562             ENDIF
     572             endif
     573
     574            ENDIF ! of IF(MOD(itau,iecri).EQ.0)
    563575
    564576            IF(itau.EQ.itaufin) THEN
    565577
    566578
    567 #ifdef CPP_IOIPSL
    568        CALL dynredem1("restart.nc",0.0,
    569      ,                     vcov,ucov,teta,q,masse,ps)
    570 #endif
     579              if (planet_type.eq."earth") then
     580#ifdef CPP_EARTH
     581! Write an Earth-format restart file
     582                CALL dynredem1("restart.nc",0.0,
     583     &                         vcov,ucov,teta,q,masse,ps)
     584#endif
     585              endif ! of if (planet_type.eq."earth")
    571586
    572587              CLOSE(99)
    573             ENDIF
     588            ENDIF ! of IF (itau.EQ.itaufin)
    574589
    575590c-----------------------------------------------------------------------
     
    593608                        leapf =  .TRUE.
    594609                        dt  =  2.*dtvr
    595                         GO TO 2
    596                    END IF
     610                        GO TO 2 
     611                   END IF ! of IF (forward)
    597612            ELSE
    598613
     
    602617                 dt  = 2.*dtvr
    603618                 GO TO 2
    604             END IF
    605 
    606       ELSE
     619            END IF ! of IF (MOD(itau,iperiod).EQ.0)
     620                   !    ELSEIF (MOD(itau-1,iperiod).EQ.0)
     621
     622      ELSE ! of IF (.not.purmats)
    607623
    608624c       ........................................................
     
    627643               GO TO 2
    628644
    629             ELSE
    630 
    631             IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN
     645            ELSE ! of IF(forward)
     646
     647              IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN
    632648               IF(itau.EQ.itaufin) THEN
    633649                  iav=1
     
    636652               ENDIF
    637653#ifdef CPP_IOIPSL
    638               CALL writedynav(histaveid, itau,vcov ,
     654               CALL writedynav(histaveid, itau,vcov ,
    639655     ,                          ucov,teta,pk,phi,q,masse,ps,phis)
    640656               call bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav,
     
    642658#endif
    643659
    644             ENDIF
    645 
    646                IF(MOD(itau,iecri         ).EQ.0) THEN
     660              ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin)
     661
     662              IF(MOD(itau,iecri         ).EQ.0) THEN
    647663c              IF(MOD(itau,iecri*day_step).EQ.0) THEN
    648                   nbetat = nbetatdem
    649        CALL geopot  ( ip1jmp1, teta  , pk , pks,  phis  , phi       )
    650         unat=0.
    651         do l=1,llm
    652            unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)
    653            vnat(:,l)=vcov(:,l)/cv(:)
    654         enddo
    655 #ifdef CPP_IOIPSL
    656 c       CALL writehist( histid, histvid, itau,vcov ,
    657 c    ,                           ucov,teta,phi,q,masse,ps,phis)
    658 #else
     664                nbetat = nbetatdem
     665                CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)
     666                unat=0.
     667                do l=1,llm
     668                  unat(iip2:ip1jm,l)=ucov(iip2:ip1jm,l)/cu(iip2:ip1jm)
     669                  vnat(:,l)=vcov(:,l)/cv(:)
     670                enddo
     671#ifdef CPP_IOIPSL
     672c               CALL writehist( histid, histvid, itau,vcov ,
     673c    &                           ucov,teta,phi,q,masse,ps,phis)
     674#endif
     675! For some Grads outputs
     676                if (output_grads_dyn) then
    659677#include "write_grads_dyn.h"
    660 #endif
    661 
    662 
    663                ENDIF
    664 
    665 #ifdef CPP_IOIPSL
    666                  IF(itau.EQ.itaufin)
    667      . CALL dynredem1("restart.nc",0.0,
    668      .                     vcov,ucov,teta,q,masse,ps)
    669 #endif
    670 
    671                  forward = .TRUE.
    672                  GO TO  1
    673 
    674             ENDIF
    675 
    676       END IF
     678                endif
     679
     680              ENDIF ! of IF(MOD(itau,iecri         ).EQ.0)
     681
     682              IF(itau.EQ.itaufin) THEN
     683                if (planet_type.eq."earth") then
     684#ifdef CPP_EARTH
     685                  CALL dynredem1("restart.nc",0.0,
     686     &                           vcov,ucov,teta,q,masse,ps)
     687#endif
     688                endif ! of if (planet_type.eq."earth")
     689              ENDIF ! of IF(itau.EQ.itaufin)
     690
     691              forward = .TRUE.
     692              GO TO  1
     693
     694            ENDIF ! of IF (forward)
     695
     696      END IF ! of IF(.not.purmats)
    677697
    678698      STOP
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/comdissip.h

    r774 r1140  
    22! $Header$
    33!
    4 c-----------------------------------------------------------------------
    5 c INCLUDE dissip.h
     4!-----------------------------------------------------------------------
     5! INCLUDE comdissip.h
    66
    7       COMMON/comdissip/
    8      $    lstardis,niterdis,coefdis,tetavel,tetatemp,gamdissip
     7      COMMON/comdissip/                                                 &
     8     &    niterdis,coefdis,tetavel,tetatemp,gamdissip
    99
    1010
    11       LOGICAL lstardis
    1211      INTEGER niterdis
    1312
    1413      REAL tetavel,tetatemp,coefdis,gamdissip
    1514
    16 c-----------------------------------------------------------------------
     15!-----------------------------------------------------------------------
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/conf_gcm.F

    r1111 r1140  
    66      SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 )
    77c
     8#ifdef CPP_IOIPSL
    89      use IOIPSL
     10#else
     11! if not using IOIPSL, we still need to use (a local version of) getin
     12      use ioipsl_getincom
     13#endif
    914      use misc_mod
    1015      use mod_filtre_fft, ONLY : use_filtre_fft
     
    99104
    100105!Config  Key  = prt_level
    101 !Config  Desc = niveau d'impressions de dbogage
    102 !Config  Def  = 0
    103 !Config  Help = Niveau d'impression pour le dbogage
     106!Config  Desc = niveau d'impressions de débogage
     107!Config  Def  = 0
     108!Config  Help = Niveau d'impression pour le débogage
    104109!Config         (0 = minimum d'impression)
    105110      prt_level = 0
     
    109114c  Parametres de controle du run:
    110115c-----------------------------------------------------------------------
     116!Config  Key  = planet_type
     117!Config  Desc = planet type ("earth", "mars", "venus", ...)
     118!Config  Def  = earth
     119!Config  Help = this flag sets the type of atymosphere that is considered
     120      planet_type="earth"
     121      CALL getin('planet_type',planet_type)
    111122
    112123!Config  Key  = dayref
     
    189200       CALL getin('periodav',periodav)
    190201
     202!Config  Key  = output_grads_dyn
     203!Config  Desc = output dynamics diagnostics in 'dyn.dat' file
     204!Config  Def  = n
     205!Config  Help = output dynamics diagnostics in Grads-readable 'dyn.dat' file
     206       output_grads_dyn=.false.
     207       CALL getin('output_grads_dyn',output_grads_dyn)
     208
    191209!Config  Key  = idissip
    192210!Config  Desc = periode de la dissipation
     
    284302c    ...............................................................
    285303
     304!Config  Key  =  read_start
     305!Config  Desc = Initialize model using a 'start.nc' file
     306!Config  Def  = y
     307!Config  Help = y: intialize dynamical fields using a 'start.nc' file
     308!               n: fields are initialized by 'iniacademic' routine
     309       read_start= .true.
     310       CALL getin('read_start',read_start)
     311
    286312!Config  Key  = iflag_phys
    287313!Config  Desc = Avec ls physique
     
    341367c
    342368      IF( ABS(clat - clatt).GE. 0.001 )  THEN
    343         PRINT *,' La valeur de clat passee par run.def est differente de
    344      * celle lue sur le fichier  start '
     369        write(lunout,*)'conf_gcm: La valeur de clat passee par run.def',
     370     &    ' est differente de celle lue sur le fichier  start '
    345371        STOP
    346372      ENDIF
     
    356382
    357383      IF( ABS(grossismx - grossismxx).GE. 0.001 )  THEN
    358         PRINT *,' La valeur de grossismx passee par run.def est differente 
    359      * de celle lue sur le fichier  start '
     384        write(lunout,*)'conf_gcm: La valeur de grossismx passee par ',
     385     &  'run.def est differente de celle lue sur le fichier  start '
    360386        STOP
    361387      ENDIF
     
    370396
    371397      IF( ABS(grossismy - grossismyy).GE. 0.001 )  THEN
    372         PRINT *,' La valeur de grossismy passee par run.def est differen
    373      * te de celle lue sur le fichier  start '
     398        write(lunout,*)'conf_gcm: La valeur de grossismy passee par ',
     399     & 'run.def est differente de celle lue sur le fichier  start '
    374400        STOP
    375401      ENDIF
    376402     
    377403      IF( grossismx.LT.1. )  THEN
    378         PRINT *,' ***  ATTENTION !! grossismx < 1 .   *** '
     404        write(lunout,*)
     405     &       'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
    379406         STOP
    380407      ELSE
     
    384411
    385412      IF( grossismy.LT.1. )  THEN
    386         PRINT *,' ***  ATTENTION !! grossismy < 1 .   *** '
     413        write(lunout,*)
     414     &       'conf_gcm: ***  ATTENTION !! grossismy < 1 .   *** '
    387415         STOP
    388416      ELSE
     
    390418      ENDIF
    391419
    392       PRINT *,' alphax alphay defrun ',alphax,alphay
     420      write(lunout,*)'conf_gcm: alphax alphay',alphax,alphay
    393421c
    394422c    alphax et alphay sont les anciennes formulat. des grossissements
     
    405433
    406434      IF( .NOT.fxyhypb )  THEN
    407            IF( fxyhypbb )     THEN
    408               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    409               PRINT *,' *** fxyhypb lu sur le fichier start est F ',
    410      *       'alors  qu il est  T  sur  run.def  ***'
     435         IF( fxyhypbb )     THEN
     436            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     437            write(lunout,*)' *** fxyhypb lu sur le fichier start est ',
     438     *       'F alors  qu il est  T  sur  run.def  ***'
    411439              STOP
    412            ENDIF
     440         ENDIF
    413441      ELSE
    414            IF( .NOT.fxyhypbb )   THEN
    415               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    416               PRINT *,' ***  fxyhypb lu sur le fichier start est T ',
    417      *        'alors  qu il est  F  sur  run.def  ****  '
     442         IF( .NOT.fxyhypbb )   THEN
     443            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     444            write(lunout,*)' ***  fxyhypb lu sur le fichier start est ',
     445     *        'T alors  qu il est  F  sur  run.def  ****  '
    418446              STOP
    419            ENDIF
     447         ENDIF
    420448      ENDIF
    421449c
     
    430458      IF( fxyhypb )  THEN
    431459       IF( ABS(dzoomx - dzoomxx).GE. 0.001 )  THEN
    432         PRINT *,' La valeur de dzoomx passee par run.def est differente
    433      *  de celle lue sur le fichier  start '
     460        write(lunout,*)'conf_gcm: La valeur de dzoomx passee par ',
     461     *  'run.def est differente de celle lue sur le fichier  start '
    434462        STOP
    435463       ENDIF
     
    446474      IF( fxyhypb )  THEN
    447475       IF( ABS(dzoomy - dzoomyy).GE. 0.001 )  THEN
    448         PRINT *,' La valeur de dzoomy passee par run.def est differente
    449      * de celle lue sur le fichier  start '
     476        write(lunout,*)'conf_gcm: La valeur de dzoomy passee par ',
     477     * 'run.def est differente de celle lue sur le fichier  start '
    450478        STOP
    451479       ENDIF
     
    461489      IF( fxyhypb )  THEN
    462490       IF( ABS(taux - tauxx).GE. 0.001 )  THEN
    463         PRINT *,' La valeur de taux passee par run.def est differente
    464      * de celle lue sur le fichier  start '
     491        write(lunout,*)'conf_gcm: La valeur de taux passee par ',
     492     * 'run.def est differente de celle lue sur le fichier  start '
    465493        STOP
    466494       ENDIF
     
    476504      IF( fxyhypb )  THEN
    477505       IF( ABS(tauy - tauyy).GE. 0.001 )  THEN
    478         PRINT *,' La valeur de tauy passee par run.def est differente
    479      * de celle lue sur le fichier  start '
     506        write(lunout,*)'conf_gcm: La valeur de tauy passee par ',
     507     * 'run.def est differente de celle lue sur le fichier  start '
    480508        STOP
    481509       ENDIF
     
    495523
    496524        IF( .NOT.ysinus )  THEN
    497            IF( ysinuss )     THEN
    498               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    499               PRINT *,' *** ysinus lu sur le fichier start est F ',
    500      *       'alors  qu il est  T  sur  run.def  ***'
     525          IF( ysinuss )     THEN
     526            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     527            write(lunout,*)' *** ysinus lu sur le fichier start est F',
     528     *       ' alors  qu il est  T  sur  run.def  ***'
     529            STOP
     530          ENDIF
     531        ELSE
     532          IF( .NOT.ysinuss )   THEN
     533            write(lunout,*)' ********  PBS DANS  CONF_GCM  ******** '
     534            write(lunout,*)' *** ysinus lu sur le fichier start est T',
     535     *        ' alors  qu il est  F  sur  run.def  ****  '
    501536              STOP
    502            ENDIF
    503         ELSE
    504            IF( .NOT.ysinuss )   THEN
    505               PRINT *,' ********  PBS DANS  DEFRUN  ******** '
    506               PRINT *,' ***  ysinus lu sur le fichier start est T ',
    507      *        'alors  qu il est  F  sur  run.def  ****  '
    508               STOP
    509            ENDIF
     537          ENDIF
    510538        ENDIF
    511       ENDIF
     539      ENDIF ! of IF( .NOT.fxyhypb  )
    512540c
    513541!Config  Key  = offline
     
    532560      write(lunout,*)' #########################################'
    533561      write(lunout,*)' Configuration des parametres du gcm: '
     562      write(lunout,*)' planet_type = ', planet_type
    534563      write(lunout,*)' dayref = ', dayref
    535564      write(lunout,*)' anneeref = ', anneeref
     
    540569      write(lunout,*)' iecri = ', iecri
    541570      write(lunout,*)' periodav = ', periodav
     571      write(lunout,*)' output_grads_dyn = ', output_grads_dyn
    542572      write(lunout,*)' idissip = ', idissip
    543573      write(lunout,*)' lstardis = ', lstardis
     
    550580      write(lunout,*)' coefdis = ', coefdis
    551581      write(lunout,*)' purmats = ', purmats
     582      write(lunout,*)' read_start = ', read_start
    552583      write(lunout,*)' iflag_phys = ', iflag_phys
    553584      write(lunout,*)' clonn = ', clonn
     
    600631
    601632      IF( grossismx.LT.1. )  THEN
    602         PRINT *,' ***  ATTENTION !! grossismx < 1 .   *** '
     633        write(lunout,*)
     634     &   'conf_gcm: ***  ATTENTION !! grossismx < 1 .   *** '
    603635         STOP
    604636      ELSE
     
    608640
    609641      IF( grossismy.LT.1. )  THEN
    610         PRINT *,' ***  ATTENTION !! grossismy < 1 .   *** '
     642        write(lunout,*)
     643     &  'conf_gcm: ***  ATTENTION !! grossismy < 1 .   *** '
    611644         STOP
    612645      ELSE
     
    614647      ENDIF
    615648
    616       PRINT *,' alphax alphay defrun ',alphax,alphay
     649      write(lunout,*)'conf_gcm: alphax alphay ',alphax,alphay
    617650c
    618651c    alphax et alphay sont les anciennes formulat. des grossissements
     
    697730        write(lunout,*)"Le zoom en longitude est incompatible",
    698731     &                 " avec l'utilisation du filtre FFT ",
    699      &                 "---> filtre FFT désactivé "
     732     &                 "---> filtre FFT désactivé "
    700733       use_filtre_fft=.FALSE.
    701734      ENDIF
     
    704737     
    705738!Config  Key  = use_mpi_alloc
    706 !Config  Desc = Utilise un buffer MPI en mmoire globale
     739!Config  Desc = Utilise un buffer MPI en m�moire globale
    707740!Config  Def  = false
    708741!Config  Help = permet d'activer l'utilisation d'un buffer MPI
    709 !Config         en mmoire globale a l'aide de la fonction MPI_ALLOC.
    710 !Config         Cela peut amliorer la bande passante des transferts MPI
     742!Config         en m�moire globale a l'aide de la fonction MPI_ALLOC.
     743!Config         Cela peut am�liorer la bande passante des transferts MPI
    711744!Config         d'un facteur 2 
    712745      use_mpi_alloc=.FALSE.
     
    716749!Config  Desc = taille des blocs openmp
    717750!Config  Def  = 1
    718 !Config  Help = defini la taille des packets d'itration openmp
    719 !Config         distribu�e � chaque t�che lors de l'entr�e dans une
    720 !Config         boucle parall�lis�e
     751!Config  Help = defini la taille des packets d'it�ration openmp
     752!Config         distribu�e � chaque t�che lors de l'entr�e dans une
     753!Config         boucle parall�lis�e
    721754 
    722755      omp_chunk=1
     
    726759!Config  Desc = activation de la version strato
    727760!Config  Def  = .FALSE.
    728 !Config  Help = active la version stratosphrique de LMDZ de F. Lott
     761!Config  Help = active la version stratosph�rique de LMDZ de F. Lott
    729762
    730763      ok_strato=.FALSE.
     
    741774      write(lunout,*)' #########################################'
    742775      write(lunout,*)' Configuration des parametres du gcm: '
     776      write(lunout,*)' planet_type = ', planet_type
    743777      write(lunout,*)' dayref = ', dayref
    744778      write(lunout,*)' anneeref = ', anneeref
     
    749783      write(lunout,*)' iecri = ', iecri
    750784      write(lunout,*)' periodav = ', periodav
     785      write(lunout,*)' output_grads_dyn = ', output_grads_dyn
    751786      write(lunout,*)' idissip = ', idissip
    752787      write(lunout,*)' lstardis = ', lstardis
     
    759794      write(lunout,*)' coefdis = ', coefdis
    760795      write(lunout,*)' purmats = ', purmats
     796      write(lunout,*)' read_start = ', read_start
    761797      write(lunout,*)' iflag_phys = ', iflag_phys
    762798      write(lunout,*)' clon = ', clon
     
    764800      write(lunout,*)' grossismx = ', grossismx
    765801      write(lunout,*)' grossismy = ', grossismy
    766       write(lunout,*)' fxyhypbb = ', fxyhypbb
     802      write(lunout,*)' fxyhypb = ', fxyhypb
    767803      write(lunout,*)' dzoomx = ', dzoomx
    768804      write(lunout,*)' dzoomy = ', dzoomy
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/control.h

    r985 r1140  
    1414     &              iperiod,iapp_tracvl,iconser,iecri,idissip,iphysiq , &
    1515     &              periodav,iecrimoy,dayref,anneeref,                  &
    16      &              raz_date,offline,ip_ebil_dyn,config_inca
     16     &              raz_date,offline,ip_ebil_dyn,config_inca,           &
     17     &              planet_type,output_grads_dyn
    1718
    1819      INTEGER   nday,day_step,iperiod,iapp_tracvl,iconser,iecri,        &
     
    2122      REAL periodav
    2223      logical offline
    23       CHARACTER*4 config_inca
     24      CHARACTER (len=4) :: config_inca
     25      CHARACTER(len=10) :: planet_type ! planet type ('earth','mars',...)
     26      LOGICAL :: output_grads_dyn ! output dynamics diagnostics in
     27                                  ! binary grads file 'dyn.dat' (y/n)
    2428!-----------------------------------------------------------------------
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/diagedyn.F

    r774 r1140  
    5858#include "paramet.h"
    5959#include "comgeom.h"
    60 
    61 #ifdef CPP_PHYS
     60#include "iniprint.h"
     61
     62#ifdef CPP_EARTH
    6263#include "../phylmd/YOMCST.h"
    6364#include "../phylmd/YOETHF.h"
     
    139140
    140141
    141 #ifdef CPP_PHYS
     142#ifdef CPP_EARTH
    142143c======================================================================
    143144C     Compute Kinetic enrgy
     
    314315C
    315316#else
    316       print*,'Pour l instant diagedyn a besoin de la physique'
     317      write(lunout,*),'diagedyn: Needs Earth physics to function'
    317318#endif
     319! #endif of #ifdef CPP_EARTH
    318320      RETURN
    319321      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/etat0_netcdf.F

    r1117 r1140  
    55c
    66      SUBROUTINE etat0_netcdf (interbar, masque)
    7    
     7#ifdef CPP_EARTH       
    88      USE startvar
    99      USE ioipsl
     
    1414      USE filtreg_mod
    1515      USE infotrac
     16#endif
     17!#endif of #ifdef CPP_EARTH
    1618      !
    1719      IMPLICIT NONE
     
    2527!     .KLON=KFDIA-KIDIA+1,KLEV=llm
    2628      !
     29#ifdef CPP_EARTH   
    2730#include "comgeom2.h"
    2831#include "comvert.h"
     
    3134#include "dimsoil.h"
    3235#include "temps.h"
    33       !
     36#endif
     37!#endif of #ifdef CPP_EARTH
     38      ! arguments:
    3439      LOGICAL interbar
     40      REAL :: masque(iip1,jjp1)
     41
     42#ifdef CPP_EARTH
     43      ! local variables:
    3544      REAL :: latfi(klon), lonfi(klon)
    36       REAL :: orog(iip1,jjp1), rugo(iip1,jjp1), masque(iip1,jjp1),
     45      REAL :: orog(iip1,jjp1), rugo(iip1,jjp1),
    3746     . psol(iip1, jjp1), phis(iip1, jjp1)
    3847      REAL :: p3d(iip1, jjp1, llm+1)
     
    144153      !
    145154      preff     = 101325.
     155      pa        =  50000.
    146156      unskap = 1./kappa
    147157      !
     
    167177      print*,'dtvr',dtvr
    168178
    169       CALL inicons0()
     179      CALL iniconst()
    170180      CALL inigeom()
    171181      !
     
    754764      print*,'entree histclo'
    755765      CALL histclo
     766
     767#endif
     768!#endif of #ifdef CPP_EARTH
    756769      RETURN
    757770      !
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/gcm.F

    r1129 r1140  
    99      USE IOIPSL
    1010#endif
     11
    1112      USE mod_const_mpi, ONLY: init_const_mpi
    1213      USE parallel
    1314      USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb
     15      USE infotrac
     16      USE mod_interface_dyn_phys
     17      USE mod_hallo
     18      USE Bands
     19
     20      USE filtreg_mod
     21
     22! Ehouarn: for now these only apply to Earth:
     23#ifdef CPP_EARTH
    1424      USE mod_grid_phy_lmdz
    1525      USE mod_phys_lmdz_omp_data, ONLY: klon_omp
    1626      USE dimphy
    17       USE infotrac
    18       USE mod_interface_dyn_phys
    1927      USE comgeomphy
    20       USE mod_hallo
    21       USE Bands
    22 
    23       USE filtreg_mod
    24 
     28#endif
    2529      IMPLICIT NONE
    2630
     
    160164      dynhistave_file = 'dyn_hist_ave'
    161165
    162 c--------------------------------------------------------------------------
    163 c   Iflag_phys controle l'appel a la physique :
    164 c   -------------------------------------------
    165 c      0 : pas de physique
    166 c      1 : Normale (appel a phylmd, phymars ...)
    167 c      2 : rappel Newtonien pour la temperature + friction au sol
    168       iflag_phys=1
    169 
    170 c--------------------------------------------------------------------------
    171 c   Lecture de l'etat initial :
    172 c   ---------------------------
    173 c     T : on lit start.nc
    174 c     F : le modele s'autoinitialise avec un cas academique (iniacademic)
    175 #ifdef CPP_IOIPSL
    176       read_start=.true.
    177 #else
    178       read_start=.false.
    179 #endif
    180166
    181167c-----------------------------------------------------------------------
     
    194180c  ---------------------------------------
    195181c
    196 #ifdef CPP_IOIPSL
     182! Ehouarn: dump possibility of using defrun
     183!#ifdef CPP_IOIPSL
    197184      CALL conf_gcm( 99, .TRUE. , clesphy0 )
    198 #else
    199       CALL defrun( 99, .TRUE. , clesphy0 )
    200 #endif
     185!#else
     186!      CALL defrun( 99, .TRUE. , clesphy0 )
     187!#endif
    201188c
    202189c
     
    208195      call init_parallel
    209196      call Read_Distrib
    210       CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
     197! Ehouarn : temporarily (?) keep this only for Earth
     198      if (planet_type.eq."earth") then
     199#ifdef CPP_EARTH
     200        CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys)
     201#endif
     202      endif ! of if (planet_type.eq."earth")
    211203      CALL set_bands
    212204      CALL Init_interface_dyn_phys
     
    220212c$OMP END PARALLEL
    221213
     214! Ehouarn : temporarily (?) keep this only for Earth
     215      if (planet_type.eq."earth") then
     216#ifdef CPP_EARTH
    222217c$OMP PARALLEL
    223218      call InitComgeomphy
    224219c$OMP END PARALLEL
     220#endif
     221      endif ! of if (planet_type.eq."earth")
    225222
    226223      IF (config_inca /= 'none') THEN
     
    252249c  lecture du fichier start.nc
    253250      if (read_start) then
    254 #ifdef CPP_IOIPSL
     251      ! we still need to run iniacademic to initialize some
     252      ! constants & fields, if we run the 'newtonian' case:
     253        if (iflag_phys.eq.2) then
     254          CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0)
     255        endif
     256!#ifdef CPP_IOIPSL
     257        if (planet_type.eq."earth") then
     258#ifdef CPP_EARTH
     259! Load an Earth-format start file
    255260         CALL dynetat0("start.nc",vcov,ucov,
    256261     .              teta,q,masse,ps,phis, time_0)
     262#endif
     263        endif ! of if (planet_type.eq."earth")
    257264c       write(73,*) 'ucov',ucov
    258265c       write(74,*) 'vcov',vcov
     
    261268c       write(77,*) 'q',q
    262269
    263 #endif
    264       endif
     270      endif ! of if (read_start)
    265271
    266272c le cas echeant, creation d un etat initial
    267273      IF (prt_level > 9) WRITE(lunout,*)
    268      .                 'AVANT iniacademic AVANT AVANT AVANT AVANT'
     274     .              'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT'
    269275      if (.not.read_start) then
    270276         CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0)
     
    351357c   Initialisation de la physique :
    352358c   -------------------------------
    353 #ifdef CPP_PHYS
    354359      IF (call_iniphys.and.iflag_phys.eq.1) THEN
    355360         latfi(1)=rlatu(1)
     
    372377
    373378         WRITE(lunout,*)
    374      .           'WARNING!!! vitesse verticale nulle dans la physique'
    375 
     379     .       'GCM: WARNING!!! vitesse verticale nulle dans la physique'
     380! Earth:
     381         if (planet_type.eq."earth") then
     382#ifdef CPP_EARTH
    376383         CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys ,
    377384     ,                latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp     )
    378 
     385#endif
     386         endif ! of if (planet_type.eq."earth")
    379387         call_iniphys=.false.
    380 
    381       ENDIF
    382 #endif
     388      ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1))
    383389
    384390
     
    402408      day_end = day_ini + nday
    403409      WRITE(lunout,300)day_ini,day_end
     410 300  FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//)
     411
     412!#ifdef CPP_IOIPSL
     413      if (planet_type.eq."earth") then
     414#ifdef CPP_EARTH
     415      CALL dynredem0_p("restart.nc", day_end, phis)
     416#endif
     417      endif
     418
     419      ecripar = .TRUE.
    404420
    405421#ifdef CPP_IOIPSL
    406       CALL dynredem0_p("restart.nc", day_end, phis)
    407 
    408       ecripar = .TRUE.
    409 
    410422      if ( 1.eq.1) then
    411423      time_step = zdtvr
     
    425437
    426438#endif
     439! #endif of #ifdef CPP_IOIPSL
    427440
    428441c  Choix des frequences de stokage pour le offline
     
    450463
    451464
    452  300  FORMAT('1'/,15x,'run du pas',i7,2x,'au pas',i7,2x,
    453      . 'c''est a dire du jour',i7,3x,'au jour',i7//)
    454465      END
    455466
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/iniacademic.F

    r1114 r1140  
    4545#include "temps.h"
    4646#include "control.h"
     47#include "iniprint.h"
    4748
    4849c   Arguments:
     
    5758      REAL ps(ip1jmp1)                       ! pression  au sol
    5859      REAL masse(ip1jmp1,llm)                ! masse d'air
     60      REAL phis(ip1jmp1)                     ! geopotentiel au sol
     61
     62c   Local:
     63c   ------
     64
    5965      REAL p (ip1jmp1,llmp1  )               ! pression aux interfac.des couches
    6066      REAL pks(ip1jmp1)                      ! exner au  sol
    6167      REAL pk(ip1jmp1,llm)                   ! exner au milieu des couches
    6268      REAL pkf(ip1jmp1,llm)                  ! exner filt.au milieu des couches
    63       REAL phis(ip1jmp1)                     ! geopotentiel au sol
    6469      REAL phi(ip1jmp1,llm)                  ! geopotentiel
    65 
    66 
    67 
    68 
    69 
    70 c   Local:
    71 c   ------
    72 
    7370      REAL ddsin,tetarappelj,tetarappell,zsig
    7471      real tetajl(jjp1,llm)
     
    8178
    8279c-----------------------------------------------------------------------
     80! 1. Initializations for Earth-like case
     81! --------------------------------------
     82      if (planet_type=="earth") then
     83c
     84        time_0=0.
    8385
    84 c
    85       time_0=0.
     86        im         = iim
     87        jm         = jjm
     88        day_ini    = 0
     89        omeg       = 4.*asin(1.)/86400.
     90        rad    = 6371229.
     91        g      = 9.8
     92        daysec = 86400.
     93        dtvr    = daysec/FLOAT(day_step)
     94        zdtvr=dtvr
     95        kappa  = 0.2857143
     96        cpp    = 1004.70885
     97        preff     = 101325.
     98        pa        =  50000.
     99        etot0      = 0.
     100        ptot0      = 0.
     101        ztot0      = 0.
     102        stot0      = 0.
     103        ang0       = 0.
    86104
    87       im         = iim
    88       jm         = jjm
    89       day_ini    = 0
    90       omeg       = 4.*asin(1.)/86400.
    91       rad    = 6371229.
    92       g      = 9.8
    93       daysec = 86400.
    94       dtvr    = daysec/FLOAT(day_step)
    95       zdtvr=dtvr
    96       kappa  = 0.2857143
    97       cpp    = 1004.70885
    98       preff     = 101325.
    99       pa        =  50 000.
    100       etot0      = 0.
    101       ptot0      = 0.
    102       ztot0      = 0.
    103       stot0      = 0.
    104       ang0       = 0.
    105       pa         = 0.
     105        CALL iniconst
     106        CALL inigeom
     107        CALL inifilr
    106108
    107       CALL inicons0
    108       CALL inigeom
    109       CALL inifilr
    110 
    111       ps=0.
    112       phis=0.
     109        ps=0.
     110        phis=0.
    113111c---------------------------------------------------------------------
    114112
    115       taurappel=10.*daysec
     113        taurappel=10.*daysec
    116114
    117115c---------------------------------------------------------------------
     
    119117c   --------------------------------------
    120118
    121       DO l=1,llm
    122        zsig=ap(l)/preff+bp(l)
    123        if (zsig.gt.0.3) then
    124          lsup=l
    125          tetarappell=1./8.*(-log(zsig)-.5)
    126          DO j=1,jjp1
    127             ddsin=sin(rlatu(j))-sin(pi/20.)
    128             tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell)
    129          ENDDO
    130         else
     119        DO l=1,llm
     120         zsig=ap(l)/preff+bp(l)
     121         if (zsig.gt.0.3) then
     122           lsup=l
     123           tetarappell=1./8.*(-log(zsig)-.5)
     124           DO j=1,jjp1
     125             ddsin=sin(rlatu(j))-sin(pi/20.)
     126             tetajl(j,l)=300.*(1+1./18.*(1.-3.*ddsin*ddsin)+tetarappell)
     127           ENDDO
     128          else
    131129c   Choix isotherme au-dessus de 300 mbar
    132          do j=1,jjp1
    133             tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa
    134          enddo
    135         endif
    136       ENDDO
     130           do j=1,jjp1
     131             tetajl(j,l)=tetajl(j,lsup)*(0.3/zsig)**kappa
     132           enddo
     133          endif ! of if (zsig.gt.0.3)
     134        ENDDO ! of DO l=1,llm
    137135
    138       do l=1,llm
    139          do j=1,jjp1
    140             do i=1,iip1
    141                ij=(j-1)*iip1+i
    142                tetarappel(ij,l)=tetajl(j,l)
    143             enddo
    144          enddo
    145       enddo
     136        do l=1,llm
     137           do j=1,jjp1
     138              do i=1,iip1
     139                 ij=(j-1)*iip1+i
     140                 tetarappel(ij,l)=tetajl(j,l)
     141              enddo
     142           enddo
     143        enddo
    146144
    147 c     call dump2d(jjp1,llm,tetajl,'TEQ   ')
     145c       call dump2d(jjp1,llm,tetajl,'TEQ   ')
    148146
    149       ps=1.e5
    150       phis=0.
    151       CALL pression ( ip1jmp1, ap, bp, ps, p       )
    152       CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf )
    153       CALL massdair(p,masse)
     147        ps=1.e5
     148        phis=0.
     149        CALL pression ( ip1jmp1, ap, bp, ps, p       )
     150        CALL exner_hyb( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf )
     151        CALL massdair(p,masse)
    154152
    155153c  intialisation du vent et de la temperature
    156       teta(:,:)=tetarappel(:,:)
    157       CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)
    158       call ugeostr(phi,ucov)
    159       vcov=0.
    160       q(:,:,1   )=1.e-10
    161       q(:,:,2   )=1.e-15
    162       q(:,:,3:nqtot)=0.
     154        teta(:,:)=tetarappel(:,:)
     155        CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)
     156        call ugeostr(phi,ucov)
     157        vcov=0.
     158        q(:,:,1   )=1.e-10
     159        q(:,:,2   )=1.e-15
     160        q(:,:,3:nqtot)=0.
    163161
    164162
    165 c   perturbation al\351atoire sur la temp\351rature
    166       idum  = -1
    167       zz = ran1(idum)
    168       idum  = 0
    169       do l=1,llm
    170          do ij=iip2,ip1jm
    171             teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum))
    172          enddo
    173       enddo
     163c   perturbation aleatoire sur la temperature
     164        idum  = -1
     165        zz = ran1(idum)
     166        idum  = 0
     167        do l=1,llm
     168           do ij=iip2,ip1jm
     169              teta(ij,l)=teta(ij,l)*(1.+0.005*ran1(idum))
     170           enddo
     171        enddo
    174172
    175       do l=1,llm
    176          do ij=1,ip1jmp1,iip1
    177             teta(ij+iim,l)=teta(ij,l)
    178          enddo
    179       enddo
     173        do l=1,llm
     174           do ij=1,ip1jmp1,iip1
     175              teta(ij+iim,l)=teta(ij,l)
     176           enddo
     177        enddo
    180178
    181179
     
    187185
    188186c   initialisation d'un traceur sur une colonne
    189       j=jjp1*3/4
    190       i=iip1/2
    191       ij=(j-1)*iip1+i
    192       q(ij,:,3)=1.
    193 
     187        j=jjp1*3/4
     188        i=iip1/2
     189        ij=(j-1)*iip1+i
     190        q(ij,:,3)=1.
     191     
     192      else
     193        write(lunout,*)"iniacademic: planet types other than earth",
     194     &                 " not implemented (yet)."
     195        stop
     196      endif ! of if (planet_type=="earth")
    194197      return
    195198      END
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/leapfrog_p.F

    r1134 r1140  
    44c
    55c
    6 #define IO_DEBUG
    7 
    8 #undef CPP_IOIPSL
    9 #define CPP_IOIPSL
    106
    117      SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0,
     
    285281c$OMP BARRIER
    286282       else
    287          
     283! Save fields obtained at previous time step as '...m1'
    288284         ijb=ij_begin
    289285         ije=ij_end
     
    312308     .                    llm, -2,2, .TRUE., 1 )
    313309
    314        endif
     310       endif ! of if (FirstCaldyn)
    315311       
    316312      forward = .TRUE.
     
    356352         IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE.
    357353         IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward
    358      s          .and. iflag_phys.NE.0                 ) apphys = .TRUE.
     354     s          .and. iflag_phys.EQ.1                 ) apphys = .TRUE.
    359355      ELSE
    360356         IF( MOD(itau   ,iconser) .EQ. 0              ) conser = .TRUE.
    361357         IF( MOD(itau+1,idissip)  .EQ. 0              ) apdiss = .TRUE.
    362          IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys.NE.0) apphys=.TRUE.
     358         IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys.EQ.1) apphys=.TRUE.
    363359      END IF
    364360
     
    537533
    538534c$OMP MASTER
    539       IF (prt_level>9)WRITE(lunout,*)"Iteration No",True_itau
     535      IF (prt_level>9) THEN
     536        WRITE(lunout,*)"leapfrog_p: Iteration No",True_itau
     537      ENDIF
    540538
    541539
     
    594592
    595593
    596          ENDIF
    597 c
    598       ENDIF
     594         ENDIF ! of IF (offline)
     595c
     596      ENDIF ! of IF( forward. OR . leapf )
    599597cc$OMP END PARALLEL
    600598
     
    673671c$OMP MASTER
    674672         call suspend_timer(timer_caldyn)
    675          WRITE(lunout,*)'Entree dans la physique : Iteration No ',      &
    676      &                   true_itau
     673
     674         write(lunout,*)
     675     &   'leapfrog_p: Entree dans la physique : Iteration No ',true_itau
    677676c$OMP END MASTER
    678677
     
    693692c   -----------------------------------------------------
    694693
    695 #ifdef CPP_PHYS
    696694c+jld
    697695
     
    699697      IF (ip_ebil_dyn.ge.1 ) THEN
    700698          ztit='bil dyn'
    701           CALL diagedyn(ztit,2,1,1,dtphys
    702      e  , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
     699! Ehouarn: be careful, diagedyn is Earth-specific (includes ../phylmd/..)!
     700           IF (planet_type.eq."earth") THEN
     701            CALL diagedyn(ztit,2,1,1,dtphys
     702     &    , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
     703           ENDIF
    703704      ENDIF
    704705c-jld
     
    787788          dpfi_tmp(1:iip1)     = dpfi(ijb:ijb+iim) 
    788789c$OMP END MASTER
    789         endif
     790        endif ! of if ( .not. pole_nord)
    790791
    791792c$OMP BARRIER
     
    843844c$OMP END MASTER
    844845         
    845         endif
     846        endif ! of if (.not. pole_nord)
    846847c$OMP BARRIER
    847848cc$OMP MASTER       
     
    932933cc$OMP END MASTER
    933934
    934 #else
    935 
     935
     936c-jld
     937c$OMP MASTER
     938         call resume_timer(timer_caldyn)
     939         if (FirstPhysic) then
     940           ok_start_timer=.TRUE.
     941           FirstPhysic=.false.
     942         endif
     943c$OMP END MASTER
     944       ENDIF ! of IF( apphys )
     945
     946      IF(iflag_phys.EQ.2) THEN ! "Newtonian" case
    936947c   Calcul academique de la physique = Rappel Newtonien + fritcion
    937948c   --------------------------------------------------------------
     
    949960
    950961       call friction_p(ucov,vcov,iphysiq*dtvr)
    951 
    952 #endif
    953 
    954 c-jld
    955 c$OMP MASTER
    956          call resume_timer(timer_caldyn)
    957          if (FirstPhysic) then
    958            ok_start_timer=.TRUE.
    959            FirstPhysic=.false.
    960          endif
    961 c$OMP END MASTER
    962        ENDIF
     962      ENDIF ! of IF(iflag_phys.EQ.2)
     963
    963964
    964965        CALL pression_p ( ip1jmp1, ap, bp, ps, p                  )
     
    13121313c      IF( MOD(itau,iecri         ).EQ.0) THEN
    13131314
    1314            IF( MOD(itau,iecri*day_step).EQ.0) THEN
    1315 c$OMP BARRIER
    1316 c$OMP MASTER
    1317                nbetat = nbetatdem
    1318         CALL geopot_p  ( ip1jmp1, teta  , pk , pks,  phis  , phi )
     1315            IF( MOD(itau,iecri*day_step).EQ.0) THEN
     1316c$OMP BARRIER
     1317c$OMP MASTER
     1318              nbetat = nbetatdem
     1319              CALL geopot_p(ip1jmp1,teta,pk,pks,phis,phi)
    13191320       
    13201321cym        unat=0.
    13211322       
    1322         ijb=ij_begin
    1323         ije=ij_end
    1324        
    1325         if (pole_nord) then
    1326           ijb=ij_begin+iip1
    1327           unat(1:iip1,:)=0.
    1328         endif
    1329        
    1330         if (pole_sud) then
    1331           ije=ij_end-iip1
    1332           unat(ij_end-iip1+1:ij_end,:)=0.
    1333         endif
     1323              ijb=ij_begin
     1324              ije=ij_end
     1325       
     1326              if (pole_nord) then
     1327                ijb=ij_begin+iip1
     1328                unat(1:iip1,:)=0.
     1329              endif
     1330       
     1331              if (pole_sud) then
     1332                ije=ij_end-iip1
     1333                unat(ij_end-iip1+1:ij_end,:)=0.
     1334              endif
    13341335           
    1335         do l=1,llm
    1336            unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)
    1337         enddo
    1338 
    1339         ijb=ij_begin
    1340         ije=ij_end
    1341         if (pole_sud) ije=ij_end-iip1
    1342        
    1343         do l=1,llm
    1344            vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)
    1345         enddo
     1336              do l=1,llm
     1337                unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)
     1338              enddo
     1339
     1340              ijb=ij_begin
     1341              ije=ij_end
     1342              if (pole_sud) ije=ij_end-iip1
     1343       
     1344              do l=1,llm
     1345                vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)
     1346              enddo
    13461347       
    13471348#ifdef CPP_IOIPSL
    13481349 
    1349         CALL writehist_p(histid,histvid, itau,vcov,
    1350      s                       ucov,teta,phi,q,masse,ps,phis)
     1350              CALL writehist_p(histid,histvid, itau,vcov,
     1351                            ucov,teta,phi,q,masse,ps,phis)
    13511352
    13521353#endif
    1353 c$OMP END MASTER
    1354            ENDIF
     1354! For some Grads outputs of fields
     1355              if (output_grads_dyn) then
     1356! Ehouarn: hope this works the way I think it does:
     1357                  call Gather_Field(unat,ip1jmp1,llm,0)
     1358                  call Gather_Field(vnat,ip1jm,llm,0)
     1359                  call Gather_Field(teta,ip1jmp1,llm,0)
     1360                  call Gather_Field(ps,ip1jmp1,1,0)
     1361                  do iq=1,nqtot
     1362                    call Gather_Field(q(1,1,iq),ip1jmp1,llm,0)
     1363                  enddo
     1364                  if (mpi_rank==0) then
     1365#include "write_grads_dyn.h"
     1366                  endif
     1367              endif ! of if (output_grads_dyn)
     1368c$OMP END MASTER
     1369            ENDIF ! of IF(MOD(itau,iecri).EQ.0)
    13551370
    13561371            IF(itau.EQ.itaufin) THEN
     
    13591374c$OMP MASTER
    13601375
    1361 c#ifdef CPP_IOIPSL
    1362 
    1363        CALL dynredem1_p("restart.nc",0.0,
    1364      ,                     vcov,ucov,teta,q,masse,ps)
    1365 c#endif
     1376              if (planet_type.eq."earth") then
     1377#ifdef CPP_EARTH
     1378! Write an Earth-format restart file
     1379                CALL dynredem1_p("restart.nc",0.0,
     1380     &                           vcov,ucov,teta,q,masse,ps)
     1381
     1382#endif
     1383              endif ! of if (planet_type.eq."earth")
    13661384
    13671385              CLOSE(99)
    13681386c$OMP END MASTER
    1369             ENDIF
     1387            ENDIF ! of IF (itau.EQ.itaufin)
    13701388
    13711389c-----------------------------------------------------------------------
     
    13981416                 dt  = 2.*dtvr
    13991417                 GO TO 2
    1400             END IF
    1401 
    1402       ELSE
     1418            END IF ! of IF (MOD(itau,iperiod).EQ.0)
     1419                   !    ELSEIF (MOD(itau-1,iperiod).EQ.0)
     1420
     1421
     1422      ELSE ! of IF (.not.purmats)
    14031423
    14041424c       ........................................................
     
    14271447               GO TO 2
    14281448
    1429             ELSE
    1430 
    1431             IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN
     1449            ELSE ! of IF(forward)
     1450
     1451              IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN
    14321452               IF(itau.EQ.itaufin) THEN
    14331453                  iav=1
     
    14381458c$OMP BARRIER
    14391459
    1440               call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest)
    1441               call SendRequest(TestRequest)
    1442 c$OMP BARRIER
    1443               call WaitRequest(TestRequest)
    1444 
    1445 c$OMP BARRIER
    1446 c$OMP MASTER
    1447               CALL writedynav_p(histaveid, itau,vcov ,
     1460               call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest)
     1461               call SendRequest(TestRequest)
     1462c$OMP BARRIER
     1463               call WaitRequest(TestRequest)
     1464
     1465c$OMP BARRIER
     1466c$OMP MASTER
     1467               CALL writedynav_p(histaveid, itau,vcov ,
    14481468     ,                          ucov,teta,pk,phi,q,masse,ps,phis)
    14491469               call bilan_dyn_p (2,dtvr*iperiod,dtvr*day_step*periodav,
     
    14511471c$OMP END MASTER
    14521472#endif
    1453             ENDIF
     1473              ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin)
     1474
    14541475
    14551476c               IF(MOD(itau,iecri         ).EQ.0) THEN
     
    14571478c$OMP BARRIER
    14581479c$OMP MASTER
    1459                   nbetat = nbetatdem
    1460        CALL geopot_p( ip1jmp1, teta  , pk , pks,  phis  , phi   )
     1480                nbetat = nbetatdem
     1481                CALL geopot_p(ip1jmp1,teta,pk,pks,phis,phi)
    14611482
    14621483cym        unat=0.
    1463         ijb=ij_begin
    1464         ije=ij_end
    1465        
    1466         if (pole_nord) then
    1467           ijb=ij_begin+iip1
    1468           unat(1:iip1,:)=0.
    1469         endif
    1470        
    1471         if (pole_sud) then
    1472           ije=ij_end-iip1
    1473           unat(ij_end-iip1+1:ij_end,:)=0.
    1474         endif
     1484                ijb=ij_begin
     1485                ije=ij_end
     1486       
     1487                if (pole_nord) then
     1488                  ijb=ij_begin+iip1
     1489                  unat(1:iip1,:)=0.
     1490                endif
     1491       
     1492                if (pole_sud) then
     1493                  ije=ij_end-iip1
     1494                  unat(ij_end-iip1+1:ij_end,:)=0.
     1495                endif
    14751496           
    1476         do l=1,llm
    1477            unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)
    1478         enddo
    1479 
    1480         ijb=ij_begin
    1481         ije=ij_end
    1482         if (pole_sud) ije=ij_end-iip1
    1483        
    1484         do l=1,llm
    1485            vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)
    1486         enddo
     1497                do l=1,llm
     1498                  unat(ijb:ije,l)=ucov(ijb:ije,l)/cu(ijb:ije)
     1499                enddo
     1500
     1501                ijb=ij_begin
     1502                ije=ij_end
     1503                if (pole_sud) ije=ij_end-iip1
     1504       
     1505                do l=1,llm
     1506                  vnat(ijb:ije,l)=vcov(ijb:ije,l)/cv(ijb:ije)
     1507                enddo
    14871508
    14881509#ifdef CPP_IOIPSL
    14891510
    1490        CALL writehist_p( histid, histvid, itau,vcov ,
    1491      ,                           ucov,teta,phi,q,masse,ps,phis)
    1492 c#else
    1493 c      call Gather_Field(unat,ip1jmp1,llm,0)
    1494 c      call Gather_Field(vnat,ip1jm,llm,0)
    1495 c      call Gather_Field(teta,ip1jmp1,llm,0)
    1496 c      call Gather_Field(ps,ip1jmp1,1,0)
    1497 c      do iq=1,nqtot
    1498 c        call Gather_Field(q(1,1,iq),ip1jmp1,llm,0)
    1499 c      enddo
     1511                CALL writehist_p(histid, histvid, itau,vcov ,
     1512     &                           ucov,teta,phi,q,masse,ps,phis)
     1513#endif
     1514! For some Grads output (but does it work?)
     1515                if (output_grads_dyn) then
     1516                  call Gather_Field(unat,ip1jmp1,llm,0)
     1517                  call Gather_Field(vnat,ip1jm,llm,0)
     1518                  call Gather_Field(teta,ip1jmp1,llm,0)
     1519                  call Gather_Field(ps,ip1jmp1,1,0)
     1520                  do iq=1,nqtot
     1521                    call Gather_Field(q(1,1,iq),ip1jmp1,llm,0)
     1522                  enddo
    15001523c     
    1501 c      if (mpi_rank==0) then
    1502 c#include "write_grads_dyn.h"
    1503 c      endif
    1504 #endif
    1505 
    1506 c$OMP END MASTER
    1507                ENDIF
    1508 
    1509                  IF(itau.EQ.itaufin) THEN
     1524                  if (mpi_rank==0) then
     1525#include "write_grads_dyn.h"
     1526                  endif
     1527                endif ! of if (output_grads_dyn)
     1528
     1529c$OMP END MASTER
     1530              ENDIF ! of IF(MOD(itau,iecri*day_step).EQ.0)
     1531
     1532              IF(itau.EQ.itaufin) THEN
     1533                if (planet_type.eq."earth") then
     1534#ifdef CPP_EARTH
    15101535c$OMP MASTER
    15111536                   CALL dynredem1_p("restart.nc",0.0,
    15121537     .                               vcov,ucov,teta,q,masse,ps)
    15131538c$OMP END MASTER
    1514                  ENDIF
    1515                  forward = .TRUE.
    1516                  GO TO  1
    1517 
    1518             ENDIF
    1519 
    1520       END IF
    1521 c$OMP MASTER
    1522         call finalize_parallel
    1523 c$OMP END MASTER
    1524         RETURN
     1539#endif
     1540                endif ! of if (planet_type.eq."earth")
     1541              ENDIF ! of IF(itau.EQ.itaufin)
     1542
     1543              forward = .TRUE.
     1544              GO TO  1
     1545
     1546            ENDIF ! of IF (forward)
     1547
     1548      END IF ! of IF(.not.purmats)
     1549c$OMP MASTER
     1550      call finalize_parallel
     1551c$OMP END MASTER
     1552      RETURN
    15251553      END
  • LMDZ4/branches/LMDZ4-dev/makegcm

    r1114 r1140  
    206206   set optim90="-Wp'-P' -DCRAY -p$IOIPSLDIR "'-p$(LIBO) -eiv '
    207207   set optim="$optim90"
    208    set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -lioipsl  -L$NCDFLIB -lnetcdf "
     208   if ( $io == "ioipsl" ) then
     209     set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -lioipsl  -L$NCDFLIB -lnetcdf "
     210   else
     211     set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -L$NCDFLIB -lnetcdf "
     212   endif
    209213   set mod_loc_dir=" "
    210214   set mod_suffix=" "
     
    216220   set optim90=" -fast -fixed "
    217221   set optimtru90=" -fast -free "
    218    set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -lioipsl -L$NCDFLIB -lnetcdf "
     222   if ( $io == "ioipsl" ) then
     223     set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -lioipsl -L$NCDFLIB -lnetcdf "
     224   else
     225     set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -L$NCDFLIB -lnetcdf "
     226   endif
    219227   set mod_loc_dir=$localdir
    220228   set mod_suffix=mod
     
    270278   set optim="$optim90"
    271279   set optimbis=" "
    272    set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR -lioipsl  $NCDFLIB -lnetcdf_i8r8_v "
     280   if ( $io == "ioipsl" ) then
     281     set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR -lioipsl  $NCDFLIB -lnetcdf_i8r8_v "
     282   else
     283     set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR $NCDFLIB -lnetcdf_i8r8_v "
     284   endif
    273285   set mod_loc_dir="."
    274286   set mod_suffix="mod"
     
    533545   set phys="L_PHY= LIBPHY="
    534546else
    535    set cppflags="$cppflags -DCPP_PHYS"
     547   #Default planet type is Earth
     548   set cppflags="$cppflags -DCPP_EARTH"
    536549endif
    537550
     
    685698######################################################################
    686699
    687 if ( -f $libf/phy$physique/raddim.h ) then
    688  if ( -f $libf/phy$physique/raddim.$dimh.h ) then
    689   \rm -f $libf/phy$physique/raddim.h
    690   cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h
    691   echo $libf/phy$physique/raddim.$dimh.h
    692   cat $libf/phy$physique/raddim.$dimh.h
    693   cat $libf/phy$physique/raddim.h
    694  else
    695   echo On peut diminuer la taille de l executable en creant
    696   echo le fichier $libf/phy$physique/raddim.$dimh.h
    697   \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h
    698  endif
    699 endif
     700#if ( -f $libf/phy$physique/raddim.h ) then
     701# if ( -f $libf/phy$physique/raddim.$dimh.h ) then
     702#  \rm -f $libf/phy$physique/raddim.h
     703#  cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h
     704#  echo $libf/phy$physique/raddim.$dimh.h
     705#  cat $libf/phy$physique/raddim.$dimh.h
     706#  cat $libf/phy$physique/raddim.h
     707# else
     708#  echo On peut diminuer la taille de l executable en creant
     709#  echo le fichier $libf/phy$physique/raddim.$dimh.h
     710#  \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h
     711# endif
     712#endif
    700713
    701714######################################################################
     
    793806   set f90=$FC_LINUX
    794807   if ( $FC_LINUX == 'pgf90' ) then
    795    set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf "
     808     if ( $io == "ioipsl" ) then
     809       set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf "
     810     else
     811       set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lnetcdf "
     812     endif
    796813   else if ($FC_LINUX == 'g95') then
    797      set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf "
     814     if ( $io == "ioipsl" ) then
     815       set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf "
     816     else
     817       set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lnetcdf "
     818     endif
    798819   else
    799820     set opt_link=" "
     
    804825   set f77=f90
    805826   set f90=f90
    806    set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf "
     827   if ( $io == "ioipsl" ) then
     828     set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf "
     829   else
     830     set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -L$NCDFLIB -lnetcdf "
     831   endif
    807832#################
    808833else if $NEC then
  • LMDZ4/branches/LMDZ4-dev/makelmdz_fcm

    r1137 r1140  
    33# $Header$
    44#
    5 # FH : on ne cr�e plus le fichier arch.mk qui est suppos� exister par
     5# FH : on ne crée plus le fichier arch.mk qui est supposé exister par
    66# FH : ailleurs.
    7 # FH : ult�rieurement, ce fichier sera pr�-existant pour une s�rie
    8 # FH : de configurations en versions optimises et debug qui seront
    9 # FH : lis (ln -s) avec arch.mk en fonction de l'architecture.
    10 # FH : Pour le moment, cette version est en test et on peut crer les
    11 # FH : arch.mk en lan�ant une premi�re fois makegcm7.
     7# FH : ulterieurement, ce fichier sera pré-existant pour une série
     8# FH : de configurations en versions optimisées et debug qui seront
     9# FH : liés (ln -s) avec arch.mk en fonction de l'architecture.
     10# FH : Pour le moment, cette version est en test et on peut créer les
     11# FH : arch.mk en lançant une première fois makegcm.
    1212#
    1313set verbose echo
     
    5858Usage :
    5959makegcm [options] -m arch exec
    60 [-h]                       : manuel abrégé
     60[-h]                       : manuel abrégé
    6161[-d [[IMx]JMx]LM]          : IM, JM, LM sont les dims en x, y, z (def: $dim)
    6262[-p PHYS]                  : compilation avec la physique libf/phyPHYS, (def: lmd)
    6363[-prod / -dev / -debug]    : compilation en mode production (default) / developpement / debug .
    64 [-c false/MPI1/MPI2]       : couplé océan : MPI1/MPI2/false (def: false)
    65 [-v false/true]            : avec ou sans végétation (def: false)
     64[-c false/MPI1/MPI2]       : couplé océan : MPI1/MPI2/false (def: false)
     65[-v false/true]            : avec ou sans végétation (def: false)
    6666[-chimie INCA/false]       : avec ou sans model de chimie INCA (def: false)
    6767[-parallel none/mpi/omp/mpi_omp] : parallelisation (default: none) : mpi, openmp ou mixte mpi_openmp
     
    7575[-fcm_path path]           : chemin pour fcm (def: le chemin est suppose deja exister dans le PATH)
    7676 -arch nom_arch            : nom de l'architecture cible
    77  exec                      : exécutable généré
     77 exec                      : exécutable généré
    7878fin
    7979        exit
     
    157157
    158158###############################################################
    159 # lecture des chemins propres a l'architecture de la machine #
     159# lecture des chemins propres à l'architecture de la machine #
    160160###############################################################
    161161
     
    180180   
    181181else
    182    set CPP_KEY="$CPP_KEY CPP_PHYS"
     182   #Default planet type is Earth
     183   set CPP_KEY="$CPP_KEY CPP_EARTH"
    183184endif
    184185
Note: See TracChangeset for help on using the changeset viewer.