Changeset 1650


Ignore:
Timestamp:
Jan 25, 2017, 4:02:54 PM (8 years ago)
Author:
emillour
Message:

Dynamical core: Further adaptations to stick with LMDZ5 (up to rev r2750)

  • libf
  • makelmdz[_fcm] : added Earth-specific "dust" and "strataer" cases and

-arch_path option

  • bld.cfg : added dust and strataer cases
  • dyn3d[par]
  • conf_gcm.F90 : added read_orop parameter (Earth-related) for

loading subgrid orography parameters.

  • guide[_p]_mod.F90: added output of nudging coefficients for winds

and temperature

  • temps_mod.F90 : cosmetics/comments
  • logic_mod.F90 : cosmetics/comments
  • dyn3d_common
  • comconst_mod.F90 : cosmetics/comments + added year_day module variable
  • conf_planete.F90 : added year_day from comconst_mod as done in LMDZ5
  • comvert_mod.F90 : cosmetics/comments
  • infotrac.F90 : added "startAer" case to follow up with LMDZ5
  • misc
  • wxios.F90 : follow up on changes in LMDZ5

EM

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/DOC/chantiers/commit_importants.log

    r1621 r1650  
    19341934  logic_mod (which is in the dynamics).
    19351935
     1936**********************
     1937**** commit_v1650 ****
     1938**********************
     1939Ehouarn: Further adaptations to stick with LMDZ5 (up to rev r2750)
     1940
     1941* libf
     1942- makelmdz[_fcm] : added Earth-specific "dust" and "strataer" cases and
     1943                   -arch_path option
     1944- bld.cfg : added dust and strataer cases
     1945
     1946* dyn3d[par]
     1947- conf_gcm.F90 : added read_orop parameter (Earth-related) for
     1948                 loading subgrid orography parameters.
     1949- guide[_p]_mod.F90: added output of nudging coefficients for winds
     1950                     and temperature
     1951- temps_mod.F90 : cosmetics/comments
     1952- logic_mod.F90 : cosmetics/comments
     1953
     1954* dyn3d_common
     1955- comconst_mod.F90 : cosmetics/comments + added year_day module variable
     1956- conf_planete.F90 : added year_day from comconst_mod as done in LMDZ5
     1957- comvert_mod.F90 : cosmetics/comments
     1958- infotrac.F90 : added "startAer" case to follow up with LMDZ5
     1959
     1960* misc
     1961- wxios.F90 : follow up on changes in LMDZ5
  • trunk/LMDZ.COMMON/bld.cfg

    r1540 r1650  
    3030src::sisvat  %SISVAT
    3131src::rrtm    %RRTM
     32src::dust    %DUST
     33src::strataer %STRATAER
    3234src::grid    %SRC_PATH/grid
    3335src::filtrez %FILTRE
  • trunk/LMDZ.COMMON/libf/dyn3d/conf_gcm.F90

    r1593 r1650  
    2525  USE logic_mod, ONLY: tidal,purmats,ok_guide,read_start,iflag_phys,            &
    2626                iflag_trac,ok_strato,ok_gradsfile,ok_limit,ok_etat0,            &
    27                 moyzon_mu,moyzon_ch,ok_strato,fxyhypb,ysinus
     27                moyzon_mu,moyzon_ch,ok_strato,fxyhypb,ysinus,read_orop
    2828  USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy,             &
    2929                alphax,alphay,taux,tauy
     
    5353!   ------
    5454
    55   CHARACTER ch1*72,ch2*72,ch3*72,ch4*12
    5655  REAL clonn,clatt,grossismxx,grossismyy
    5756  REAL dzoomxx,dzoomyy, tauxx,tauyy
    5857  LOGICAL  fxyhypbb, ysinuss
    59   INTEGER i
    6058  LOGICAL use_filtre_fft
    6159!
     
    549547  IF (use_filtre_fft) THEN
    550548    write(lunout,*)'STOP !!!'
    551     write(lunout,*)'use_filtre_fft n est pas implemente dans dyn3d'
     549    write(lunout,*)'use_filtre_fft not implemented in dyn3d'
    552550    STOP 1
    553551  ENDIF
     
    597595  ok_etat0 = .TRUE.
    598596  CALL getin('ok_etat0',ok_etat0)
     597
     598!Config  Key  = read_orop
     599!Config  Desc = lecture du fichier de params orographiques sous maille
     600!Config  Def  = f
     601!Config  Help = lecture fichier plutot que grid_noro
     602
     603  read_orop = .FALSE.
     604  CALL getin('read_orop',read_orop)
    599605
    600606!----------------------------------------
     
    954960 write(lunout,*)' ok_limit = ', ok_limit
    955961 write(lunout,*)' ok_etat0 = ', ok_etat0
     962 write(lunout,*)' read_orop = ', read_orop
    956963 if (planet_type=="titan") then
    957964   write(lunout,*)' moyzon_mu = ', moyzon_mu
  • trunk/LMDZ.COMMON/libf/dyn3d/guide_mod.F90

    r1508 r1650  
    1313  use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close
    1414  use pres2lev_mod
    15   USE serre_mod, ONLY: grossismx
    1615
    1716  IMPLICIT NONE
     
    3938
    4039  REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE     :: alpha_u,alpha_v
    41   REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE     :: alpha_T,alpha_Q
     40  REAL, ALLOCATABLE, DIMENSION(:, :), PRIVATE, SAVE     :: alpha_T,alpha_Q
    4241  REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE     :: alpha_P,alpha_pcor
    4342 
     
    6463  SUBROUTINE guide_init
    6564
    66     USE control_mod
     65    USE control_mod, ONLY: day_step
     66    USE serre_mod, ONLY: grossismx
    6767
    6868    IMPLICIT NONE
     
    108108    CALL getpar('gamma4',.false.,gamma4,'Zone sans rappel elargie')
    109109    CALL getpar('guide_BL',.true.,guide_BL,'guidage dans C.Lim')
    110    
     110
    111111! Sauvegarde du for�age
    112112    CALL getpar('guide_sav',.false.,guide_sav,'sauvegarde guidage')
     
    147147
    148148    call fin_getparam
    149 
     149   
    150150! ---------------------------------------------
    151151! Determination du nombre de niveaux verticaux
     
    222222    ALLOCATE(alpha_v(ip1jm), stat = error)
    223223    IF (error /= 0) CALL abort_gcm(modname,abort_message,1)
    224     ALLOCATE(alpha_T(ip1jmp1), stat = error)
     224    ALLOCATE(alpha_T(iip1, jjp1), stat = error)
    225225    IF (error /= 0) CALL abort_gcm(modname,abort_message,1)
    226     ALLOCATE(alpha_Q(ip1jmp1), stat = error)
     226    ALLOCATE(alpha_Q(iip1, jjp1), stat = error)
    227227    IF (error /= 0) CALL abort_gcm(modname,abort_message,1)
    228228    ALLOCATE(alpha_P(ip1jmp1), stat = error)
     
    312312  SUBROUTINE guide_main(itau,ucov,vcov,teta,q,masse,ps)
    313313
    314     USE control_mod
    315     USE comvert_mod, ONLY: ap,bp,preff,presnivs
    316     USE comconst_mod, ONLY: daysec,dtvr
     314    USE control_mod, ONLY: day_step, iperiod
     315    USE comconst_mod, ONLY: dtvr, daysec
     316    USE comvert_mod, ONLY: ap, bp, preff, presnivs
    317317 
    318318    IMPLICIT NONE
     
    541541
    542542    USE comconst_mod, ONLY: pi
    543 
     543   
    544544    IMPLICIT NONE
    545545
     
    606606  use exner_hyb_m, only: exner_hyb
    607607  use exner_milieu_m, only: exner_milieu
    608   USE comvert_mod, ONLY: ap,bp,preff,pressure_exner
    609   USE comconst_mod, ONLY: cpp,kappa
    610 
     608  use comconst_mod, only: kappa, cpp
     609  use comvert_mod, only: preff, pressure_exner, bp, ap
    611610  IMPLICIT NONE
    612611
     
    777776            do j=1,jjp1
    778777                IF (guide_teta) THEN
    779                     do i=1,iim
    780                         ij=(j-1)*iip1+i
    781                         tgui1(ij,l)=zu1(i,j,l)
    782                         tgui2(ij,l)=zu2(i,j,l)
    783                     enddo
     778                    do i=1,iim
     779                        ij=(j-1)*iip1+i
     780                        tgui1(ij,l)=zu1(i,j,l)
     781                        tgui2(ij,l)=zu2(i,j,l)
     782                    enddo
    784783                ELSE
    785                     do i=1,iim
    786                         ij=(j-1)*iip1+i
    787                         tgui1(ij,l)=zu1(i,j,l)*cpp/pk(i,j,l)
    788                         tgui2(ij,l)=zu2(i,j,l)*cpp/pk(i,j,l)
    789                     enddo
     784                    do i=1,iim
     785                        ij=(j-1)*iip1+i
     786                        tgui1(ij,l)=zu1(i,j,l)*cpp/pk(i,j,l)
     787                        tgui2(ij,l)=zu2(i,j,l)*cpp/pk(i,j,l)
     788                    enddo
    790789                ENDIF
    791790                tgui1(j*iip1,l)=tgui1((j-1)*iip1+1,l)   
     
    855854! Calcul des constantes de rappel alpha (=1/tau)
    856855
    857     USE comconst_mod, ONLY: pi
    858     USE serre_mod, ONLY: clon,clat,grossismy
    859 
     856    use comconst_mod, only: pi
     857    use serre_mod, only: clon, clat, grossismx, grossismy
     858   
    860859    implicit none
    861860
     
    15171516  SUBROUTINE guide_out(varname,hsize,vsize,field)
    15181517
     1518    USE comconst_mod, ONLY: pi
    15191519    USE comvert_mod, ONLY: presnivs
    1520     USE comconst_mod, ONLY: pi
    1521 
     1520    use netcdf95, only: nf95_def_var, nf95_put_var
     1521    use netcdf, only: nf90_float
     1522   
    15221523    IMPLICIT NONE
    15231524
     
    15371538    INTEGER       :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev
    15381539    INTEGER       :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev
    1539     INTEGER       :: vid_au,vid_av
     1540    INTEGER       :: vid_au,vid_av, varid_alpha_t, varid_alpha_q
    15401541    INTEGER, DIMENSION (3) :: dim3
    15411542    INTEGER, DIMENSION (4) :: dim4,count,start
     
    15681569        ierr=NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv)
    15691570        ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av)
     1571        call nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), &
     1572             varid_alpha_t)
     1573        call nf95_def_var(nid, "alpha_q", nf90_float, (/id_lonv, id_latu/), &
     1574             varid_alpha_q)
    15701575       
    15711576        ierr=NF_ENDDEF(nid)
     
    15931598        ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v)
    15941599#endif
     1600        call nf95_put_var(nid, varid_alpha_t, alpha_t)
     1601        call nf95_put_var(nid, varid_alpha_q, alpha_q)
    15951602! --------------------------------------------------------------------
    15961603! Cr�ation des variables sauvegard�es
  • trunk/LMDZ.COMMON/libf/dyn3d/logic_mod.F90

    r1593 r1650  
    33IMPLICIT NONE 
    44
    5       LOGICAL purmats,forward,leapf,apphys,statcl,conser,               &
    6      & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus                      &
    7      &  ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile               &
    8      &  ,ok_limit,ok_etat0
    9       logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
    10                      ! (only used if disvert_type==2)
    11       logical moyzon_mu,moyzon_ch ! used for zonal averages in Titan
     5  LOGICAL purmats ! true if time stepping is purely Matsuno scheme
     6                  ! false implies Matsuno-Leapfrog time stepping scheme
     7  LOGICAL forward ! true if during forward phase of Matsuno step
     8  LOGICAL leapf ! true if during a leapfrog time stepping step
     9  LOGICAL apphys ! true if during a time step when physics will be called
     10  LOGICAL statcl
     11  LOGICAL conser
     12  LOGICAL apdiss ! true if during a time step when dissipation will be called
     13  LOGICAL apdelq
     14  LOGICAL saison
     15  LOGICAL ecripar
     16  LOGICAL fxyhypb ! true if using hyperbolic function discretization
     17                  ! for latitudinal grid
     18  LOGICAL ysinus ! true if using sine function discretiation
     19                 ! for latitudinal grid
     20  LOGICAL read_start ! true if reading a start.nc file to initialize fields
     21  LOGICAL ok_guide ! true if nudging
     22  LOGICAL ok_strato
     23  LOGICAL tidal  ! true if adding tidal forces (for Titan)
     24  LOGICAL ok_gradsfile
     25  LOGICAL ok_limit  ! true for boundary conditions file creation (limit.nc)
     26  LOGICAL ok_etat0  ! true for initial states creation (start.nc, startphy.nc)
     27  LOGICAL read_orop ! true for sub-cell scales orographic params read in file
     28  LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
     29                 ! (only used if disvert_type==2)
     30  LOGICAL moyzon_mu,moyzon_ch ! used for zonal averages in Titan
    1231
    13       integer iflag_phys,iflag_trac
     32  INTEGER iflag_phys ! type of physics to call: 0 none, 1: phy*** package,
     33                     ! 2: Held & Suarez, 101-200: aquaplanets & terraplanets
     34  INTEGER iflag_trac
    1435
    1536END MODULE logic_mod
  • trunk/LMDZ.COMMON/libf/dyn3d/temps_mod.F90

    r1422 r1650  
    33IMPLICIT NONE 
    44
    5 ! jD_ref = jour julien de la date de reference (lancement de l'experience)
    6 ! hD_ref = "heure" julienne de la date de reference
    7 
    85      INTEGER   itaufin ! total number of dynamical steps for the run
    9       INTEGER   itau_dyn, itau_phy
     6      INTEGER   itau_dyn
     7      INTEGER   itau_phy
    108      INTEGER   day_ini ! initial day # of simulation sequence
    119      INTEGER   day_end ! final day # ; i.e. day # when this simulation ends
     
    1311      INTEGER   day_ref
    1412      REAL      dt ! (dynamics) time step (changes if doing Matsuno or LF step)
    15       REAL      jD_ref, jH_ref, start_time
    16       CHARACTER (len=10) :: calend
     13      REAL      jD_ref ! reference julian day date (beginning of experiment)
     14      REAL      jH_ref ! reference julian "hour" of reference julian date
     15      REAL      start_time
     16      CHARACTER (len=10) :: calend ! calendar type
    1717
    1818      ! Additionnal Mars stuff:
  • trunk/LMDZ.COMMON/libf/dyn3d_common/comconst_mod.F90

    r1572 r1650  
    1212      REAL r ! Reduced Gas constant r=R/mu
    1313             ! with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol)
    14       REAL cpp   ! Cp
    15       REAL kappa ! kappa=R/Cp
     14      REAL cpp   ! Specific heat Cp (J.kg-1.K-1)
     15      REAL kappa ! kappa=r/Cp
    1616      REAL cotot
    1717      REAL unsim ! = 1./iim
     
    2323      REAL dissip_fac_mid,dissip_fac_up,dissip_deltaz,dissip_hdelta
    2424      REAL dissip_pupstart
    25       INTEGER iflag_top_bound,mode_top_bound
     25! top_bound sponge:
     26      INTEGER iflag_top_bound ! sponge type
    2627      INTEGER ngroup ! parameter to group points (along longitude) near poles
    27       REAL tau_top_bound
     28      INTEGER mode_top_bound  ! sponge mode
     29      REAL tau_top_bound ! inverse of sponge characteristic time scale (Hz)
    2830      REAL daylen ! length of solar day, in 'standard' day length
     31      REAL year_day ! Number of standard days in a year
    2932      REAL molmass ! (g/mol) molar mass of the atmosphere
    3033
  • trunk/LMDZ.COMMON/libf/dyn3d_common/comvert_mod.F90

    r1422 r1650  
    33IMPLICIT NONE 
    44
    5 include "dimensions.h"
    6 include "paramet.h"
     5PRIVATE
     6INCLUDE "dimensions.h"
    77
    8 REAL ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm),pa,preff,     &
    9         nivsigs(llm),nivsig(llm+1),scaleheight
    10 ! Mars Ce qui suit vient de gcm
    11 REAL sig(llm+1),ds(llm),aps(llm),bps(llm),pseudoalt(llm)
     8PUBLIC :: ap,bp,presnivs,dpres,sig,ds,pa,preff,nivsigs,nivsig, &
     9          aps,bps,scaleheight,pseudoalt,disvert_type, pressure_exner
     10
     11REAL ap(llm+1) ! hybrid pressure contribution at interlayers
     12REAL bp (llm+1) ! hybrid sigma contribution at interlayer
     13REAL presnivs(llm) ! (reference) pressure at mid-layers
     14REAL dpres(llm)
     15REAL sig(llm+1)
     16REAL ds(llm)
     17REAL pa ! reference pressure (Pa) at which hybrid coordinates
     18        ! become purely pressure (more or less)
     19REAL preff  ! reference surface pressure (Pa)
     20REAL nivsigs(llm)
     21REAL nivsig(llm+1)
     22REAL aps(llm) ! hybrid pressure contribution at mid-layers
     23REAL bps(llm) ! hybrid sigma contribution at mid-layers
     24REAL scaleheight ! atmospheric (reference) scale height (km)
     25REAL pseudoalt(llm) ! pseudo-altitude of model levels (km), based on presnivs(),
     26                     ! preff and scaleheight
     27
    1228INTEGER disvert_type ! type of vertical discretization:
    13                            ! 1: Earth (default for planet_type==earth),
    14                            !     automatic generation
    15                            ! 2: Planets (default for planet_type!=earth),
    16                            !     using 'z2sig.def' (or 'esasig.def) file
     29                     ! 1: Earth (default for planet_type==earth),
     30                     !     automatic generation
     31                     ! 2: Planets (default for planet_type!=earth),
     32                     !     using 'z2sig.def' (or 'esasig.def) file
     33
    1734LOGICAL pressure_exner
    1835!     compute pressure inside layers using Exner function, else use mean
  • trunk/LMDZ.COMMON/libf/dyn3d_common/conf_planete.F90

    r1422 r1650  
    1010USE ioipsl_getincom
    1111#endif
    12 USE comvert_mod, ONLY: preff,pa
    13 USE comconst_mod, ONLY: daysec,daylen,kappa,cpp,omeg,rad,g,ihf,pi,molmass
     12USE comconst_mod, ONLY: pi, g, molmass, kappa, cpp, omeg, rad, &
     13                        year_day, daylen, daysec, ihf
     14USE comvert_mod, ONLY: preff, pa
    1415IMPLICIT NONE
    1516!
     
    1718!   Declarations :
    1819!   --------------
    19 #include "dimensions.h"
     20
    2021!
    2122!   local:
    2223!   ------
    23 
    24 real :: year_day_dyn
    2524
    2625! ---------------------------------------------
     
    5958CALL getin('daylen',daylen)
    6059! Number of days (standard) per year:
    61 year_day_dyn = 365.25
    62 CALL getin('year_day',year_day_dyn)
     60year_day = 365.25
     61CALL getin('year_day',year_day)
    6362! Omega
    6463! omeg=2.*pi/86400.
    65 omeg=2.*pi/daysec*(1./daylen+1./year_day_dyn)
     64omeg=2.*pi/daysec*(1./daylen+1./year_day)
    6665CALL getin('omeg',omeg)
    6766
    68 ! Intrinsic heat flux [default is none]
    69 ! Aymeric -- for giant planets
    70 ! [matters only if planet_type="giant"]
     67! Intrinsic heat flux (default: none) (only used if planet_type="giant")
    7168ihf = 0.
    72 CALL getin('ihf',ihf)
    73 
    74 
     69call getin('ihf',ihf)
    7570
    7671END SUBROUTINE conf_planete
  • trunk/LMDZ.COMMON/libf/dyn3d_common/infotrac.F90

    r1575 r1650  
    4545    INTEGER :: niso_possibles   
    4646    PARAMETER ( niso_possibles=5) ! 5 possible water isotopes
    47     real, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal
     47    REAL, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal
    4848    LOGICAL, DIMENSION(niso_possibles),SAVE ::  use_iso
    4949    INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE ::  iqiso ! donne indice iq en fn de (ixt,phase)
     
    5555    INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE ::  index_trac ! numéro ixt en fn izone, indnum entre 1 et niso
    5656    INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso
     57
     58#ifdef CPP_StratAer
     59!--CK/OB for stratospheric aerosols
     60  INTEGER, SAVE :: nbtr_bin
     61  INTEGER, SAVE :: nbtr_sulgas
     62  INTEGER, SAVE :: id_OCS_strat
     63  INTEGER, SAVE :: id_SO2_strat
     64  INTEGER, SAVE :: id_H2SO4_strat
     65  INTEGER, SAVE :: id_BIN01_strat
     66  INTEGER, SAVE :: id_TEST_strat
     67#endif
    5768
    5869CONTAINS
     
    143154       CALL abort_gcm('infotrac_init','You must compile with cpp key REPROBUS',1)
    144155#endif
     156    ELSE IF (type_trac == 'coag') THEN
     157       WRITE(lunout,*) 'Tracers are treated for COAGULATION tests : type_trac=', type_trac
     158#ifndef CPP_StratAer
     159       WRITE(lunout,*) 'To run this option you must add cpp key StratAer and compile with StratAer code'
     160       CALL abort_gcm('infotrac_init','You must compile with cpp key StratAer',1)
     161#endif
    145162     ELSE IF (type_trac == 'lmdz') THEN
    146163       WRITE(lunout,*) 'Tracers are treated in LMDZ only : type_trac=', type_trac
     
    166183!-----------------------------------------------------------------------
    167184    IF (planet_type=='earth') THEN
    168      IF (type_trac == 'lmdz' .OR. type_trac == 'repr') THEN
     185     IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN
    169186       OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr)
    170187       IF(ierr.EQ.0) THEN
     
    272289!---------------------------------------------------------------------
    273290    IF (planet_type=='earth') THEN
    274      IF (type_trac == 'lmdz' .OR. type_trac == 'repr') THEN
     291     IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN
    275292       IF(ierr.EQ.0) THEN
    276293          ! Continue to read tracer.def
     
    352369       END DO
    353370
     371!       IF ( planet_type=='earth') THEN
    354372         !CR: nombre de traceurs de l eau
    355          if (tnom_0(3) == 'H2Oi') then
     373         IF (tnom_0(3) == 'H2Oi') then
    356374            nqo=3
    357          else
     375         ELSE
    358376            nqo=2
    359          endif
     377         ENDIF
    360378         ! For Earth, water vapour & liquid tracers are not in the physics
    361379         nbtr=nqtrue-nqo
    362      ENDIF  ! (type_trac == 'lmdz' .OR. type_trac == 'repr')
     380!       ELSE
     381!         ! Other planets (for now); we have the same number of tracers
     382!         ! in the dynamics than in the physics
     383!         nbtr=nqtrue
     384!       ENDIF
     385
     386#ifdef CPP_StratAer
     387       IF (type_trac == 'coag') THEN
     388         nbtr_bin=0
     389         nbtr_sulgas=0
     390         DO iq=1,nqtrue
     391           IF (tnom_0(iq)(1:3)=='BIN') THEN !check if tracer name contains 'BIN'
     392             nbtr_bin=nbtr_bin+1
     393           ENDIF
     394           IF (tnom_0(iq)(1:3)=='GAS') THEN !check if tracer name contains 'GAS'
     395             nbtr_sulgas=nbtr_sulgas+1
     396           ENDIF
     397         ENDDO
     398         print*,'nbtr_bin=',nbtr_bin
     399         print*,'nbtr_sulgas=',nbtr_sulgas
     400         DO iq=1,nqtrue
     401           IF (tnom_0(iq)=='GASOCS') THEN
     402             id_OCS_strat=iq-nqo
     403           ENDIF
     404           IF (tnom_0(iq)=='GASSO2') THEN
     405             id_SO2_strat=iq-nqo
     406           ENDIF
     407           IF (tnom_0(iq)=='GASH2SO4') THEN
     408             id_H2SO4_strat=iq-nqo
     409           ENDIF
     410           IF (tnom_0(iq)=='BIN01') THEN
     411             id_BIN01_strat=iq-nqo
     412           ENDIF
     413           IF (tnom_0(iq)=='GASTEST') THEN
     414             id_TEST_strat=iq-nqo
     415           ENDIF
     416         ENDDO
     417         print*,'id_OCS_strat  =',id_OCS_strat
     418         print*,'id_SO2_strat  =',id_SO2_strat
     419         print*,'id_H2SO4_strat=',id_H2SO4_strat
     420         print*,'id_BIN01_strat=',id_BIN01_strat
     421       ENDIF
     422#endif
     423
     424     ENDIF  ! (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac = 'coag')
    363425!jyg<
    364426!
  • trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F90

    r1572 r1650  
    2424  USE logic_mod, ONLY: tidal,purmats,ok_guide,read_start,iflag_phys,iflag_trac, &
    2525                ok_strato,ok_gradsfile,ok_limit,ok_etat0,moyzon_mu,moyzon_ch,   &
    26                 fxyhypb,ysinus
     26                fxyhypb,ysinus,read_orop
    2727  USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy,             &
    2828                alphax,alphay,taux,tauy
     
    5353!   ------
    5454
    55   CHARACTER ch1*72,ch2*72,ch3*72,ch4*12
    5655  REAL clonn,clatt,grossismxx,grossismyy
    5756  REAL dzoomxx,dzoomyy, tauxx,tauyy
    5857  LOGICAL  fxyhypbb, ysinuss
    59   INTEGER i
    6058  character(len=*),parameter :: modname="conf_gcm"
    6159  character (len=80) :: abort_message
     
    638636  ok_etat0 = .TRUE.
    639637  CALL getin('ok_etat0',ok_etat0)
     638
     639!Config  Key  = read_orop
     640!Config  Desc = lecture du fichier de params orographiques sous maille
     641!Config  Def  = f
     642!Config  Help = lecture fichier plutot que grid_noro
     643
     644  read_orop = .FALSE.
     645  CALL getin('read_orop',read_orop)
    640646
    641647!----------------------------------------
     
    9951001      write(lunout,*)' ok_limit = ', ok_limit
    9961002      write(lunout,*)' ok_etat0 = ', ok_etat0
     1003      write(lunout,*)' read_orop = ', read_orop
    9971004      if (planet_type=="titan") then
    9981005       write(lunout,*)' moyzon_mu = ', moyzon_mu
  • trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90

    r1422 r1650  
    3838
    3939  REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE     :: alpha_u,alpha_v
    40   REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE     :: alpha_T,alpha_Q
     40  REAL, ALLOCATABLE, DIMENSION(:, :), PRIVATE, SAVE     :: alpha_T,alpha_Q
    4141  REAL, ALLOCATABLE, DIMENSION(:), PRIVATE, SAVE     :: alpha_P,alpha_pcor
    4242 
     
    6868  SUBROUTINE guide_init
    6969
    70     USE control_mod
     70    USE control_mod, ONLY: day_step
    7171    USE serre_mod, ONLY: grossismx
    7272
     
    237237    ALLOCATE(alpha_v(ip1jm), stat = error)
    238238    IF (error /= 0) CALL abort_gcm(modname,abort_message,1)
    239     ALLOCATE(alpha_T(ip1jmp1), stat = error)
     239    ALLOCATE(alpha_T(iip1, jjp1), stat = error)
    240240    IF (error /= 0) CALL abort_gcm(modname,abort_message,1)
    241     ALLOCATE(alpha_Q(ip1jmp1), stat = error)
     241    ALLOCATE(alpha_Q(iip1, jjp1), stat = error)
    242242    IF (error /= 0) CALL abort_gcm(modname,abort_message,1)
    243243    ALLOCATE(alpha_P(ip1jmp1), stat = error)
     
    339339    USE parallel_lmdz
    340340    USE control_mod
    341     USE comvert_mod, ONLY: ap,bp,preff,presnivs,pressure_exner
    342     USE comconst_mod, ONLY: daysec,dtvr,kappa,cpp
     341    USE comconst_mod, ONLY: daysec, dtvr, cpp, kappa
     342    USE comvert_mod, ONLY: ap, bp, preff, presnivs, pressure_exner
    343343   
    344344    IMPLICIT NONE
     
    618618
    619619    USE comconst_mod, ONLY: pi
    620 
     620   
    621621    IMPLICIT NONE
    622622
     
    706706  USE mod_hallo
    707707  USE Bands
    708   USE comvert_mod, ONLY: ap,bp,preff,pressure_exner
    709   USE comconst_mod, ONLY: kappa,cpp
     708  USE comconst_mod, ONLY: cpp, kappa
     709  USE comvert_mod, ONLY: preff, pressure_exner, bp, ap
    710710  IMPLICIT NONE
    711711
     
    10981098! Calcul des constantes de rappel alpha (=1/tau)
    10991099
    1100     USE comconst_mod, ONLY: pi
    1101     USE serre_mod, ONLY: clon,clat,grossismx,grossismy
    1102 
     1100    use comconst_mod, only: pi
     1101    use serre_mod, only: clat, clon, grossismx, grossismy
     1102   
    11031103    implicit none
    11041104
     
    18131813  SUBROUTINE guide_out(varname,hsize,vsize,field,factt)
    18141814    USE parallel_lmdz
     1815    USE comconst_mod, ONLY: pi
    18151816    USE comvert_mod, ONLY: presnivs
    1816     USE comconst_mod, ONLY: pi
     1817    use netcdf95, only: nf95_def_var, nf95_put_var
     1818    use netcdf, only: nf90_float
     1819
    18171820    IMPLICIT NONE
    18181821
     
    18331836    INTEGER       :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev
    18341837    INTEGER       :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev
    1835     INTEGER       :: vid_au,vid_av
     1838    INTEGER       :: vid_au,vid_av, varid_alpha_t, varid_alpha_q
    18361839    INTEGER       :: l
    18371840    INTEGER, DIMENSION (3) :: dim3
     
    18711874        ierr=NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au)
    18721875        ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av)
     1876        call nf95_def_var(nid, "alpha_T", nf90_float, (/id_lonv, id_latu/), &
     1877             varid_alpha_t)
     1878        call nf95_def_var(nid, "alpha_q", nf90_float, (/id_lonv, id_latu/), &
     1879             varid_alpha_q)
    18731880       
    18741881        ierr=NF_ENDDEF(nid)
     
    18981905        ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v)
    18991906#endif
     1907        call nf95_put_var(nid, varid_alpha_t, alpha_t)
     1908        call nf95_put_var(nid, varid_alpha_q, alpha_q)
    19001909! --------------------------------------------------------------------
    19011910! Cr�ation des variables sauvegard�es
  • trunk/LMDZ.COMMON/libf/dyn3dpar/logic_mod.F90

    r1593 r1650  
     1!
     2! $Id: $
     3!
    14MODULE logic_mod
    25
    36IMPLICIT NONE 
    47
    5       LOGICAL purmats,forward,leapf,apphys,statcl,conser,               &
    6      & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus                      &
    7      &  ,read_start,ok_guide,ok_strato,tidal,ok_gradsfile               &
    8      &  ,ok_limit,ok_etat0
    9       logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
    10                      ! (only used if disvert_type==2)
    11       logical moyzon_mu,moyzon_ch ! used for zonal averages in Titan
     8  LOGICAL purmats ! true if time stepping is purely Matsuno scheme
     9                  ! false implies Matsuno-Leapfrog time stepping scheme
     10  LOGICAL forward ! true if during forward phase of Matsuno step
     11  LOGICAL leapf ! true if during a leapfrog time stepping step
     12  LOGICAL apphys ! true if during a time step when physics will be called
     13  LOGICAL statcl
     14  LOGICAL conser
     15  LOGICAL apdiss ! true if during a time step when dissipation will be called
     16  LOGICAL apdelq
     17  LOGICAL saison
     18  LOGICAL ecripar
     19  LOGICAL fxyhypb ! true if using hyperbolic function discretization
     20                  ! for latitudinal grid
     21  LOGICAL ysinus ! true if using sine function discretiation
     22                 ! for latitudinal grid
     23  LOGICAL read_start ! true if reading a start.nc file to initialize fields
     24  LOGICAL ok_guide ! true if nudging
     25  LOGICAL ok_strato
     26  LOGICAL tidal  ! true if adding tidal forces (for Titan)
     27  LOGICAL ok_gradsfile
     28  LOGICAL ok_limit  ! true for boundary conditions file creation (limit.nc)
     29  LOGICAL ok_etat0  ! true for initial states creation (start.nc, startphy.nc)
     30  LOGICAL read_orop ! true for sub-cell scales orographic params read in file
     31  LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
     32                 ! (only used if disvert_type==2)
     33  LOGICAL moyzon_mu,moyzon_ch ! used for zonal averages in Titan
    1234
    13       integer iflag_phys,iflag_trac
     35  INTEGER iflag_phys ! type of physics to call: 0 none, 1: phy*** package,
     36                     ! 2: Held & Suarez, 101-200: aquaplanets & terraplanets
     37  INTEGER iflag_trac
    1438
    1539!$OMP THREADPRIVATE(purmats,forward,leapf,apphys,statcl,conser,       &
    16   !$OMP     apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,              &
    17   !$OMP     read_start,ok_guide,ok_strato,tidal,ok_gradsfile,         &
    18   !$OMP     ok_limit,ok_etat0)
     40!$OMP     apdiss,apdelq,saison,ecripar,fxyhypb,ysinus,              &
     41!$OMP     read_start,ok_guide,ok_strato,tidal,ok_gradsfile,         &
     42!$OMP     ok_limit,ok_etat0,hybrid,moyzon_mu,moyzon_ch)
    1943!$OMP THREADPRIVATE(iflag_phys,iflag_trac)
    2044
    21 !BE CAREFUL: when adding a threadprivate variable in this module
    22 !       do not forget to add it to copyin clause of gcm.F (before CALL leapfrog_p)
     45!WARNING: when adding a threadprivate variable in this module
     46!        do not forget to add it to the copyin clause when opening an OpenMP
     47!        parallel section. e.g. in gcm before call leapfrog_loc
    2348
    2449END MODULE logic_mod
  • trunk/LMDZ.COMMON/libf/dyn3dpar/temps_mod.F90

    r1422 r1650  
    33IMPLICIT NONE 
    44
    5 ! jD_ref = jour julien de la date de reference (lancement de l'experience)
    6 ! hD_ref = "heure" julienne de la date de reference
     5  INTEGER   itaufin ! total number of dynamical steps for the run
     6  INTEGER   itau_dyn
     7  INTEGER   itau_phy
     8  INTEGER   day_ini ! initial day # of simulation sequence
     9  INTEGER   day_end ! final day # ; i.e. day # when this simulation ends
     10  INTEGER   annee_ref
     11  INTEGER   day_ref
     12  REAL      dt ! (dynamics) time step (changes if doing Matsuno or LF step)
     13  REAL      jD_ref ! reference julian day date (beginning of experiment)
     14  REAL      jH_ref ! reference julian "hour" of reference julian date
     15  REAL      start_time
     16  CHARACTER (len=10) :: calend ! calendar type
    717
    8       INTEGER   itaufin ! total number of dynamical steps for the run
    9       INTEGER   itau_dyn, itau_phy
    10       INTEGER   day_ini ! initial day # of simulation sequence
    11       INTEGER   day_end ! final day # ; i.e. day # when this simulation ends
    12       INTEGER   annee_ref
    13       INTEGER   day_ref
    14       REAL      dt ! (dynamics) time step (changes if doing Matsuno or LF step)
    15       REAL      jD_ref, jH_ref, start_time
    16       CHARACTER (len=10) :: calend
     18  ! Additionnal Mars stuff:
     19  REAL hour_ini ! initial fraction of day of simulation sequence (0=<hour_ini<1)
    1720
    18       ! Additionnal Mars stuff:
    19       real hour_ini ! initial fraction of day of simulation sequence (0=<hour_ini<1)
     21!$OMP THREADPRIVATE(dt,jD_ref,jH_ref,start_time,hour_ini,                        &
     22!$OMP                day_ini,day_end,annee_ref,day_ref,itau_dyn,itau_phy,itaufin,&
     23!$OMP                calend)       
    2024
    21 !$OMP THREADPRIVATE(dt,jD_ref,jH_ref,start_time,hour_ini,                       &
    22   !$OMP         day_ini,day_end,annee_ref,day_ref,itau_dyn,itau_phy,itaufin,    &
    23   !$OMP         calend)
    24 
    25 !BE CAREFUL: when adding a threadprivate variable in this module
    26 !       do not forget to add it to copyin clause of gcm.F (before CALL leapfrog_p)
     25!WARNING: when adding a threadprivate variable in this module
     26!        do not forget to add it to the copyin clause when opening an OpenMP
     27!        parallel section. e.g. in gcm before call leapfrog_loc and/or
     28!        possibly in iniphysiq
    2729
    2830END MODULE temps_mod
  • trunk/LMDZ.COMMON/libf/misc/wxios.F90

    r1575 r1650  
    2525!$OMP THREADPRIVATE(missing_val)
    2626
     27#ifdef XIOS1
     28#error "XIOS v1 no longer supported, use XIOS v2."
     29#endif
     30
    2731    CONTAINS
    2832   
     
    3337    SUBROUTINE reformadate(odate, ndate)
    3438        CHARACTER(len=*), INTENT(IN) :: odate
    35 #ifdef XIOS1
    36         CHARACTER(len=100), INTENT(OUT) :: ndate
    37 #else
    3839        TYPE(xios_duration) :: ndate
    39 #endif
    4040       
    4141        INTEGER :: i = 0
     
    5252        i = INDEX(odate, "day")
    5353        IF (i > 0) THEN
    54 #ifdef XIOS1
    55             ndate = odate(1:i-1)//"d"
    56 #else
    5754            read(odate(1:i-1),*) ndate%day
    58 #endif
    5955        END IF
    6056
    6157        i = INDEX(odate, "hr")
    6258        IF (i > 0) THEN
    63 #ifdef XIOS1
    64             ndate = odate(1:i-1)//"h"
    65 #else
    6659            read(odate(1:i-1),*) ndate%hour
    67 #endif
    6860        END IF
    6961
    7062        i = INDEX(odate, "mth")
    7163        IF (i > 0) THEN
    72 #ifdef XIOS1
    73             ndate = odate(1:i-1)//"mo"
    74 #else
    7564            read(odate(1:i-1),*) ndate%month
    76 #endif
    7765        END IF
    7866       
     
    197185     
    198186     !Variables pour xios:
    199 #ifdef XIOS1
    200      TYPE(xios_time) :: mdtime
    201 #else
    202187     TYPE(xios_duration) :: mdtime
    203 #endif
    204188     !REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0
    205189     
    206 #ifdef XIOS1
    207         mdtime = xios_time(0, 0, 0, 0, 0, pasdetemps)
    208 #else
    209190        mdtime%second=pasdetemps
    210 #endif
    211191
    212192        !Réglage du calendrier:
    213 #ifdef XIOS1
    214         SELECT CASE (calendrier)
    215             CASE('earth_360d')
    216                 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "D360")
    217                 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 360 jours/an'
    218             CASE('earth_365d')
    219                 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "NoLeap")
    220                 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 365 jours/an'
    221             CASE('gregorian')
    222                 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "Gregorian")
    223                 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier gregorien'
    224             CASE DEFAULT
    225                 abort_message = 'wxios_set_cal: Mauvais choix de calendrier'
    226                 CALL abort_gcm('Gcm:Xios',abort_message,1)
    227         END SELECT
    228 #else
    229193        SELECT CASE (calendrier)
    230194            CASE('earth_360d')
     
    241205                CALL abort_gcm('Gcm:Xios',abort_message,1)
    242206        END SELECT
    243 #endif
    244207       
    245208        !Formatage de la date d'origine:
     
    247210       
    248211        IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Time origin: ", date
    249 #ifdef XIOS1
    250         CALL xios_set_context_attr_hdl(g_ctx, time_origin = date)
    251 #else
    252212        CALL xios_set_time_origin(xios_date(annee,mois,jour,int(heure),0,0))
    253 #endif
    254213
    255214        !Formatage de la date de debut:
     
    259218        IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Start date: ", date
    260219       
    261 #ifdef XIOS1
    262         CALL xios_set_context_attr_hdl(g_ctx, start_date = date)
    263 #else
    264220        CALL xios_set_start_date(xios_date(ini_an,ini_mois,ini_jour,int(ini_heure),0,0))
    265 #endif
    266221       
    267222        !Et enfin,le pas de temps:
     
    272227    SUBROUTINE wxios_set_timestep(ts)
    273228        REAL, INTENT(IN) :: ts
    274 #ifdef XIOS1
    275         TYPE(xios_time) :: mdtime     
    276 
    277         mdtime = xios_time(0, 0, 0, 0, 0, ts)
    278 #else
    279229        TYPE(xios_duration) :: mdtime     
    280230
    281231        mdtime%timestep = ts
    282 #endif
    283232
    284233        CALL xios_set_timestep(mdtime)
     
    334283       
    335284        !On parametrise le domaine:
    336 #ifdef XIOS1
    337         CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin, ni=ni)
    338         CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin, nj=nj, data_dim=2)
    339         CALL xios_set_domain_attr_hdl(dom, lonvalue=io_lon(ibegin:iend), latvalue=io_lat(jbegin:jend))
    340 #else
    341285        CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin-1, ni=ni, type="rectilinear")
    342286        CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin-1, nj=nj, data_dim=2)
    343287        CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(ibegin:iend), latvalue_1d=io_lat(jbegin:jend))
    344 #endif
    345288        IF (.NOT.is_sequential) THEN
    346289            mask(:,:)=.TRUE.
     
    353296              WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,nj)=",mask(:,nj)
    354297            ENDIF
    355 #ifdef XIOS1
    356             CALL xios_set_domain_attr_hdl(dom, mask=mask)
    357 #else
    358298            CALL xios_set_domain_attr_hdl(dom, mask_2d=mask)
    359 #endif
    360299        END IF
    361300
     
    401340       
    402341        ! Ehouarn: New way to declare axis, without axis_group:
    403 #ifdef XIOS1
    404         CALL xios_set_axis_attr(trim(axis_id),size=axis_size,value=axis_value)
    405 #else
    406342        CALL xios_set_axis_attr(trim(axis_id),n_glo=axis_size,value=axis_value)
    407 #endif       
     343
    408344        !Vérification:
    409345        IF (xios_is_valid_axis(TRIM(ADJUSTL(axis_id)))) THEN
     
    429365        TYPE(xios_file) :: x_file
    430366        TYPE(xios_filegroup) :: x_fg
    431 #ifdef XIOS1
    432         CHARACTER(len=100) :: nffreq
    433 #else
    434367        TYPE(xios_duration) :: nffreq
    435 #endif
    436368       
    437369        !On regarde si le fichier n'est pas défini par XML:
     
    445377       
    446378            !On configure:
    447 #ifdef XIOS1
    448             CALL xios_set_file_attr_hdl(x_file, name="X"//fname,&
    449                 output_freq=TRIM(ADJUSTL(nffreq)), output_level=flvl, enabled=.TRUE.)
    450 #else
    451379            CALL xios_set_file_attr_hdl(x_file, name="X"//fname,&
    452380                output_freq=nffreq, output_level=flvl, enabled=.TRUE.)
    453 #endif
    454381       
    455382            IF (xios_is_valid_file("X"//fname)) THEN
    456383                IF (prt_level >= 10) THEN
    457384                  WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname
    458 #ifdef XIOS1
    459                   WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl
    460 #else
    461385                  WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl
    462 #endif
    463386                ENDIF
    464387            ELSE
    465388                WRITE(lunout,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname)
    466 #ifdef XIOS1
    467                 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl
    468 #else
    469389                WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl
    470 #endif
    471390            END IF
    472391        ELSE
     
    538457        TYPE(xios_field) :: field
    539458        TYPE(xios_fieldgroup) :: fieldgroup
    540 #ifndef XIOS1
    541459        TYPE(xios_duration) :: freq_op
    542 #endif
     460
    543461        LOGICAL :: bool=.FALSE.
    544462        INTEGER :: lvl =0
     
    599517           
    600518            !L'operation, sa frequence:
    601 #ifdef XIOS1
    602             CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op="1ts", prec=4)
    603 #else
    604519            freq_op%timestep=1
    605520            CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op=freq_op, prec=4)
    606 #endif
    607521
    608522           
  • trunk/LMDZ.COMMON/makelmdz

    r1540 r1650  
    2727sisvat=false
    2828rrtm=false
     29dust=false
     30strataer=false
    2931bands=""
    3032scatterers=""
    3133full=''
    3234
     35arch_defined="FALSE"
     36arch_path="arch"
     37arch_default_path="arch"
     38
    3339# guess a default 'arch'
    3440arch="local" # start with assuming we're on a local machine with local arch file
     41arch_defined="TRUE" # and thus also set arch_defined to true
    3542## try to recognise machine and infer arch from it
    3643machine=`hostname`
     
    120127[-sisvat true/false]  : (Earth) compile with/without sisvat package (default: false)
    121128[-rrtm true/false]    : (Earth) compile with/without rrtm package (default: false)
     129[-dust true/false]    : (Earth) compile with/without the dust package from Boucher et al. (default: false)
     130[-strataer true/false]    : (Earth) compile with/without the strat aer package from Boucher et al. (default: false)
    122131[-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp
    123132[-g GRI]                   : grid configuration in dyn3d/GRI_xy.h  (default: reg, inclues a zoom)
     
    131140[-full]                    : full (re-)compilation (from scratch)
    132141[-ext_src path]            : path to an additional set of routines to compile with the model
     142[-arch_path path]          : path to architecture files (default: $arch_default_path)
    133143 -arch arch                : target architecture
    134144 exec                      : executable to build
     
    189199          rrtm="$2" ; shift ; shift ;;
    190200     
     201      "-dust")
     202          dust="$2" ; shift ; shift ;;
     203     
     204      "-strataer")
     205          strataer="$2" ; shift ; shift ;;
     206     
    191207      "-mem")
    192208          paramem="mem" ; shift ;;
     
    205221
    206222      "-arch")
    207           arch=$2 ; shift ; shift ;;
     223          arch=$2 ; arch_defined="TRUE" ; shift ; shift ;;
     224
     225      "-arch_path")
     226          arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
    208227
    209228      *)
     
    219238rm -rf .void_dir
    220239mkdir .void_dir
    221 rm -f arch.path
    222 if [[ -r arch/arch-${arch}.path ]]
    223 then
    224   ln -s arch/arch-${arch}.path ./arch.path
     240
     241if [[ "$arch_defined" == "TRUE" ]]
     242then
     243  rm -f arch.path
     244  rm -f arch.fcm
     245  rm -f arch.env
     246
     247  if test -f $arch_path/arch-${arch}.path
     248  then
     249    ln -s $arch_path/arch-${arch}.path arch.path
     250  elif test -f $arch_default_path/arch-${arch}.path
     251  then
     252    ln -s $arch_default_path/arch-${arch}.path arch.path
     253  fi
     254       
     255  if test -f $arch_path/arch-${arch}.fcm
     256  then
     257    ln -s $arch_path/arch-${arch}.fcm arch.fcm
     258  elif test -f $arch_default_path/arch-${arch}.fcm
     259  then
     260    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
     261  fi
     262
     263  if test -f $arch_path/arch-${arch}.env
     264  then
     265    ln -s $arch_path/arch-${arch}.env arch.env
     266  elif test -f $arch_default_path/arch-${arch}.env
     267  then
     268    ln -s $arch_default_path/arch-${arch}.env arch.env
     269  else
     270    ln -s .void_file arch.env
     271  fi
     272  # source architecture PATH and ENV files
     273  source arch.env
    225274  source arch.path
    226275else
    227   echo "Error: missing arch/arch-${arch}.path file !"
    228   exit
    229 fi
    230 rm -f arch.fcm
    231 if [[ -r arch/arch-${arch}.fcm ]]
    232 then
    233   ln -s arch/arch-${arch}.fcm arch.fcm
    234 else
    235   echo "Error: missing arch/arch-${arch}.fcm file !"
    236   exit
    237 fi
     276  echo "You must define a target architecture"
     277  exit 1
     278fi
     279
    238280########################################################################
    239281# Definition des clefs CPP, des chemins des includes et modules
     
    486528   CPP_KEY="$CPP_KEY CPP_RRTM"
    487529   src_dirs="$src_dirs phy${physique}/rrtm"
     530fi
     531
     532if [[ "$dust" == "true" ]]
     533then
     534   CPP_KEY="$CPP_KEY CPP_Dust"
     535   src_dirs="$src_dirs phy${physique}/Dust"
     536fi
     537
     538if [[ "$strataer" == "true" ]]
     539then
     540   CPP_KEY="$CPP_KEY CPP_StratAer"
     541   src_dirs="$src_dirs phy${physique}/StratAer"
    488542fi
    489543
  • trunk/LMDZ.COMMON/makelmdz_fcm

    r1540 r1650  
    2424sisvat=false
    2525rrtm=false
     26dust=false
     27strataer=false
    2628chimie=false
    2729chemistry=false
     
    3840libphy=false
    3941
     42arch_defined="FALSE"
     43arch_path="arch"
     44arch_default_path="arch"
     45
    4046LMDGCM=`/bin/pwd`
    4147LIBOGCM=$LMDGCM/libo
     
    4854PHY_COMMON_PATH=$LMDGCM/.void_dir
    4955RRTM_PATH=$LMDGCM/.void_dir
     56DUST_PATH=$LMDGCM/.void_dir
     57STRATAER_PATH=$LMDGCM/.void_dir
    5058SISVAT_PATH=$LMDGCM/.void_dir
    5159COSP_PATH=$LMDGCM/.void_dir
     
    8593[-p PHYS]                  : set of physical parametrizations (in libf/phyPHYS), (default: lmd)
    8694[-prod / -dev / -debug]    : compilation mode production (default) / developement / debug .
    87 [-c false/MPI1/OMCT]       : coupling with ocean model : MPI1/OMCT/false (default: false)
    88 [-v false/orchidee2.0/orchidee1.9/true] : version of the vegetation model to include (default: false)
     95[-c false/MPI1/OMCT]       : (Earth) coupling with ocean model : MPI1/OMCT/false (default: false)
     96[-v false/orchidee2.0/orchidee1.9/true] : (Earth) version of the vegetation model to include (default: false)
    8997          false       : no vegetation model
    9098          orchidee2.0 : compile using ORCHIDEE 2.0 (or more recent version)
     
    95103[-sisvat true/false]  : (Earth) compile with/without sisvat package (default: false)
    96104[-rrtm true/false]    : (Earth) compile with/without rrtm package (default: false)
     105[-dust true/false]    : (Earth) compile with/without the dust package by Boucher and co (default: false)
     106[-strataer true/false]    : (Earth) compile with/without the strat aer package by Boucher and co (default: false)
    97107[-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp
    98108[-g GRI]                   : grid configuration in dyn3d/GRI_xy.h  (default: reg, inclues a zoom)
     
    108118[-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
    109119[-ext_src path]            : path to an additional set of routines to compile with the model
     120[-arch_path path]          : path to architecture files (default: $arch_default_path)
    110121 -arch arch                : target architecture
    111122 exec                      : executable to build
     
    152163          rrtm="$2" ; shift ; shift ;;
    153164
     165      "-dust")
     166          dust="$2" ; shift ; shift ;;
     167
     168      "-strataer")
     169          strataer="$2" ; shift ; shift ;;
     170
    154171      "-chimie")
    155172          chimie="$2" ; shift ; shift ;;
     
    197214
    198215      "-arch")
    199           arch=$2 ; shift ; shift ;;
     216          arch=$2 ; arch_defined="TRUE" ; shift ; shift ;;
     217
     218      "-arch_path")
     219          arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
    200220
    201221      *)
     
    227247rm -rf .void_dir
    228248mkdir .void_dir
    229 rm -f arch.path
    230 ln -s arch/arch-${arch}.path ./arch.path
    231 source arch.path
     249
     250if [[ "$arch_defined" == "TRUE" ]]
     251then
     252  rm -f arch.path
     253  rm -f arch.fcm
     254  rm -f arch.env
     255
     256  if test -f $arch_path/arch-${arch}.path
     257  then
     258    ln -s $arch_path/arch-${arch}.path arch.path
     259  elif test -f $arch_default_path/arch-${arch}.path
     260  then
     261    ln -s $arch_default_path/arch-${arch}.path arch.path
     262  fi
     263       
     264  if test -f $arch_path/arch-${arch}.fcm
     265  then
     266    ln -s $arch_path/arch-${arch}.fcm arch.fcm
     267  elif test -f $arch_default_path/arch-${arch}.fcm
     268  then
     269    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
     270  fi
     271
     272  if test -f $arch_path/arch-${arch}.env
     273  then
     274    ln -s $arch_path/arch-${arch}.env arch.env
     275  elif test -f $arch_default_path/arch-${arch}.env
     276  then
     277    ln -s $arch_default_path/arch-${arch}.env arch.env
     278  else
     279    ln -s .void_file arch.env
     280  fi
     281  # source architecture PATH and ENV files
     282  source arch.env
     283  source arch.path
     284else
     285  echo "You must define a target architecture"
     286  exit 1
     287fi
    232288
    233289########################################################################
     
    372428fi
    373429
     430if [[ "$dust" == "true" ]]
     431then
     432   CPP_KEY="$CPP_KEY CPP_Dust"
     433   DUST_PATH="$LIBFGCM/%PHYS/Dust"
     434fi
     435
     436if [[ "$strataer" == "true" ]]
     437then
     438   CPP_KEY="$CPP_KEY CPP_StratAer"
     439   STRATAER_PATH="$LIBFGCM/%PHYS/StratAer"
     440fi
     441
    374442if [[ $io == ioipsl ]]
    375443then
     
    642710echo "%DYN_PHYS_SUB  $DYN_PHYS_SUB_PATH" >> $config_fcm
    643711echo "%RRTM          $RRTM_PATH"     >> $config_fcm
     712echo "%DUST          $DUST_PATH"     >> $config_fcm
     713echo "%STRATAER      $STRATAER_PATH" >> $config_fcm
    644714echo "%SISVAT        $SISVAT_PATH"   >> $config_fcm
    645715echo "%COSP          $COSP_PATH"     >> $config_fcm
Note: See TracChangeset for help on using the changeset viewer.