Changeset 1036


Ignore:
Timestamp:
Sep 11, 2013, 2:34:44 PM (11 years ago)
Author:
emillour
Message:

Mars GCM: (a first step towards using parallel dynamics)

  • IMPORTANT CHANGE: Implemented dynamic tracers. It is no longer necessary to compile the model with the '-t #' option, number of tracers is simply read from tracer.def file (as before). Adapted makegcm_* scripts (and co.) accordingly. Technical aspects of the switch to dynamic tracers are:
    • advtrac.h (in dyn3d) removed and replaced by module infotrac.F
    • tracer.h (in phymars) removed and replaced by module tracer_mod.F90 (which contains nqmx, the number of tracers, etc. and can be used anywhere in the physics).
  • Included some side cleanups: removed unused files (in dyn3d) anldoppler2.F, anl_mcdstats.F and anl_stats-diag.F, and all the unecessary dimensions.* files in grid/dimension.
  • Checked that changes are clean and that GCM yields identical results (in debug mode) to previous svn version.

EM

Location:
trunk/LMDZ.MARS
Files:
2 added
73 deleted
58 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r1035 r1036  
    18931893- Checked: exact same results than before modifications
    18941894
    1895 == 09/11/2013 == EM
     1895== 11/09/2013 == EM
    18961896- Bug fix in vdifc.F: in some cases, some elements of pdqsdif() were not given
    18971897  any value. In all cases, it is safer to start with clean initialization of
     
    18991899- Bug fix in concentration.F: error in cpi() and aki() indexes led to
    19001900  wrong computation of atmospheric conductivity and specific heat.
     1901
     1902== 11/09/2013 == EM
     1903- IMPORTANT CHANGE: Implemented dynamic tracers. It is no longer necessary to
     1904  compile the model with the '-t #' option, number of tracers is simply read
     1905  from tracer.def file (as before).
     1906  Adapted makegcm_* scripts (and co.) accordingly.
     1907  Technical aspects of the switch to dynamic tracers are:
     1908  - advtrac.h (in dyn3d) removed and replaced by module infotrac.F
     1909  - tracer.h (in phymars) removed and replaced by module tracer_mod.F90 (which
     1910    contains nqmx, the number of tracers, etc. and can be used anywhere in the
     1911    physics).
     1912- Included some side cleanups: removed unused files (in dyn3d) anldoppler2.F,
     1913  anl_mcdstats.F and anl_stats-diag.F, and all the unecessary dimensions.*
     1914  files in grid/dimension.
     1915- Checked that changes are clean and that GCM yields identical results (in
     1916  debug mode) to previous svn version.
  • trunk/LMDZ.MARS/libf/aeronomars/calchim.F90

    r658 r1036  
    1       subroutine calchim(ptimestep,pplay,pplev,pt,pdt,dist_sol,mu0,         &
     1      subroutine calchim(nq,                                                &
     2                         ptimestep,pplay,pplev,pt,pdt,dist_sol,mu0,         &
    23                         zzlev,zzlay,zday,pq,pdq,dqchim,dqschim,dqcloud,    &
    34                         dqscloud,tauref,co2ice,                            &
    45                         pu,pdu,pv,pdv,surfdust,surfice)
    56
     7      use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d, igcm_o2, &
     8                            igcm_o3, igcm_h, igcm_h2, igcm_oh, igcm_ho2,  &
     9                            igcm_h2o2, igcm_ch4, igcm_n2, igcm_h2o_vap,   &
     10                            igcm_no, igcm_n, igcm_no2, igcm_n2d,          &
     11                            igcm_o2plus, igcm_co2plus, igcm_oplus,        &
     12                            igcm_coplus, igcm_cplus, igcm_nplus,          &
     13                            igcm_noplus, igcm_n2plus, igcm_hplus,         &
     14                            igcm_hco2plus, igcm_elec, mmol
    615      implicit none
    716
     
    5665#include "dimphys.h"
    5766#include "chimiedata.h"
    58 #include "tracer.h"
     67!#include "tracer.h"
    5968#include "comcstfi.h"
    6069#include "callkeys.h"
     
    6372!     input:
    6473
     74      integer,intent(in) :: nq ! number of tracers
    6575      real :: ptimestep
    6676      real :: pplay(ngridmx,nlayermx)    ! pressure at the middle of the layers
     
    7686      real :: dist_sol                   ! distance of the sun (AU)
    7787      real :: mu0(ngridmx)               ! cos of solar zenith angle (=1 when sun at zenith)
    78       real :: pq(ngridmx,nlayermx,nqmx)  ! tracers mass mixing ratio
    79       real :: pdq(ngridmx,nlayermx,nqmx) ! previous tendencies
     88      real :: pq(ngridmx,nlayermx,nq)  ! tracers mass mixing ratio
     89      real :: pdq(ngridmx,nlayermx,nq) ! previous tendencies
    8090      real :: zday                       ! date (time since Ls=0, in martian days)
    8191      real :: tauref(ngridmx)            ! optical depth at 7 hPa
     
    8696!     output:
    8797
    88       real :: dqchim(ngridmx,nlayermx,nqmx) ! tendencies on pq due to chemistry
    89       real :: dqschim(ngridmx,nqmx)         ! tendencies on qsurf
    90       real :: dqcloud(ngridmx,nlayermx,nqmx)! tendencies on pq due to condensation
    91       real :: dqscloud(ngridmx,nqmx)        ! tendencies on qsurf
     98      real :: dqchim(ngridmx,nlayermx,nq) ! tendencies on pq due to chemistry
     99      real :: dqschim(ngridmx,nq)         ! tendencies on qsurf
     100      real :: dqcloud(ngridmx,nlayermx,nq)! tendencies on pq due to condensation
     101      real :: dqscloud(ngridmx,nq)        ! tendencies on qsurf
    92102
    93103!     local variables:
    94104
    95105      integer,save :: nbq                   ! number of tracers used in the chemistry
    96       integer,save :: niq(nqmx)             ! array storing the indexes of the tracers
     106      integer,allocatable,save :: niq(:)    ! array storing the indexes of the tracers
    97107      integer :: iloc(1)            ! index of major species
    98108      integer :: ig,l,i,iq,iqmax
     
    133143
    134144      real    :: latvl1, lonvl1
    135       real    :: zq(ngridmx,nlayermx,nqmx) ! pq+pdq*ptimestep before chemistry
     145      real    :: zq(ngridmx,nlayermx,nq) ! pq+pdq*ptimestep before chemistry
    136146                                           ! new mole fraction after
    137147      real    :: zt(ngridmx,nlayermx)      ! temperature
     
    149159      real :: ztemp(nlayermx)        !  Temperature (K)
    150160      real :: zlocal(nlayermx)       !  Altitude (km)
    151       real :: zycol(nlayermx,nqmx)   !  Composition (mole fractions)
     161      real :: zycol(nlayermx,nq)   !  Composition (mole fractions)
    152162      real :: szacol                 !  Solar zenith angle
    153163      real :: surfice1d(nlayermx)    !  Ice surface area (cm2/cm3)
     
    172182         end if
    173183         ! find index of chemical tracers to use
     184         allocate(niq(nq))
    174185         ! Listed here are all tracers that can go into photochemistry
    175186         nbq = 0 ! to count number of tracers
  • trunk/LMDZ.MARS/libf/aeronomars/chemthermos.F90

    r705 r1036  
    22           zpress,zlocal,zenit,ptimestep,zday)
    33
     4      use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d,  &
     5                            igcm_o2, igcm_h, igcm_h2, igcm_oh, igcm_ho2,&
     6                            igcm_h2o2, igcm_h2o_vap, igcm_o3, igcm_n2,  &
     7                            igcm_n, igcm_no, igcm_no2, igcm_n2d,        &
     8                            igcm_co2plus, igcm_o2plus, igcm_coplus,     &
     9                            igcm_cplus, igcm_nplus, igcm_noplus,        &
     10                            igcm_n2plus, igcm_hplus, igcm_hco2plus,     &
     11                            igcm_elec, igcm_oplus
    412      IMPLICIT NONE
    513!=======================================================================
     
    2836#include "param.h"
    2937#include "param_v4.h"
    30 #include"tracer.h"
     38!#include"tracer.h"
    3139!-----------------------------------------------------------------------
    3240!    Input/Output
  • trunk/LMDZ.MARS/libf/aeronomars/concentrations.F

    r1035 r1036  
    1       SUBROUTINE concentrations(pplay,pt,pdt,pq,pdq,ptimestep)
     1      SUBROUTINE concentrations(nq,pplay,pt,pdt,pq,pdq,ptimestep)
    22                                             
     3      use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d,
     4     &                      igcm_o2, igcm_o3, igcm_h, igcm_h2,
     5     &                      igcm_oh, igcm_ho2, igcm_n2, igcm_ar,
     6     &                      igcm_h2o_vap, igcm_n, igcm_no, igcm_no2,
     7     &                      igcm_n2d, igcm_co2plus, igcm_oplus,
     8     &                      igcm_o2plus, igcm_coplus, igcm_cplus,
     9     &                      igcm_nplus, igcm_noplus, igcm_n2plus,
     10     &                      igcm_hplus, igcm_hco2plus, mmol
    311      implicit none
    412
     
    2230#include "comdiurn.h"
    2331#include "chimiedata.h"
    24 #include "tracer.h"
     32!#include "tracer.h"
    2533#include "conc.h"
    2634
    2735!     input/output
    2836
    29       real pplay(ngridmx,nlayermx)
    30       real pt(ngridmx,nlayermx)
    31       real pdt(ngridmx,nlayermx)
    32       real pq(ngridmx,nlayermx,nqmx)
    33       real pdq(ngridmx,nlayermx,nqmx)
    34       real ptimestep
     37      integer,intent(in) :: nq ! number of tracers
     38      real,intent(in) :: pplay(ngridmx,nlayermx)
     39      real,intent(in) :: pt(ngridmx,nlayermx)
     40      real,intent(in) :: pdt(ngridmx,nlayermx)
     41      real,intent(in) :: pq(ngridmx,nlayermx,nq)
     42      real,intent(in) :: pdq(ngridmx,nlayermx,nq)
     43      real,intent(in) :: ptimestep
    3544
    3645!     local variables
    3746
    3847      integer       :: i, l, ig, iq
    39       integer, save :: nbq, niq(nqmx)
    40       real          :: ni(nqmx), ntot
    41       real          :: zq(ngridmx, nlayermx, nqmx)
     48      integer, save :: nbq
     49      integer,allocatable,save :: niq(:)
     50      real          :: ni(nq), ntot
     51      real          :: zq(ngridmx, nlayermx, nq)
    4252      real          :: zt(ngridmx, nlayermx)
    43       real, save    :: aki(nqmx)
    44       real, save    :: cpi(nqmx)
     53      real,allocatable,save    :: aki(:)
     54      real,allocatable,save    :: cpi(:)
    4555
    4656      logical, save :: firstcall = .true.
     
    4858      if (firstcall) then
    4959
     60         ! allocate local saved arrays:
     61         allocate(aki(nq))
     62         allocate(cpi(nq))
     63         allocate(niq(nq))
    5064!        find index of chemical tracers to use
    5165!        initialize thermal conductivity and specific heat coefficients
     
    217231         endif
    218232         
    219            
     233         ! tell the world about it:
     234         write(*,*) "concentrations: firstcall, nbq=",nbq
     235         write(*,*) "  niq(1:nbq)=",niq(1:nbq)
     236         write(*,*) "  aki(1:nbq)=",aki(1:nbq)
     237         write(*,*) "  cpi(1:nbq)=",cpi(1:nbq)
    220238
    221239         firstcall = .false.
  • trunk/LMDZ.MARS/libf/aeronomars/deposition.F

    r421 r1036  
    77cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
    88c
     9      use tracer_mod, only: nqmx
    910      implicit none
    1011c
  • trunk/LMDZ.MARS/libf/aeronomars/euvheat.F90

    r705 r1036  
    22           mu0,ptimestep,ptime,zday,pq,pdq,pdteuv)
    33
     4      use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d,  &
     5                            igcm_o2, igcm_h, igcm_h2, igcm_oh, igcm_ho2,&
     6                            igcm_h2o2, igcm_h2o_vap, igcm_o3, igcm_n2,  &
     7                            igcm_n, igcm_no, igcm_no2, igcm_n2d, mmol
    48      IMPLICIT NONE
    59!=======================================================================
     
    3438#include "param_v4.h"
    3539#include "chimiedata.h"
    36 #include "tracer.h"
     40!#include "tracer.h"
    3741#include "conc.h"
    3842!-----------------------------------------------------------------------
  • trunk/LMDZ.MARS/libf/aeronomars/inichim_newstart.F90

    r655 r1036  
    1       subroutine inichim_newstart(pq, qsurf, ps, flagh2o, flagthermo)
    2 
     1      subroutine inichim_newstart(nq, pq, qsurf, ps, flagh2o, flagthermo)
     2
     3      use tracer_mod
    34      implicit none
    45
     
    2324!  ----------
    2425!
    25 !  pq(iip1,jjp1,llm,nqmx)  Advected fields, ie chemical species here
    26 !  qsurf(ngridmx,nqmx)     Amount of tracer on the surface (kg/m2)
     26!  pq(iip1,jjp1,llm,nq)  Advected fields, ie chemical species here
     27!  qsurf(ngridmx,nq)     Amount of tracer on the surface (kg/m2)
    2728!  ps(iip1,jjp1)           Surface pressure (Pa)
    2829!  flagh2o                 flag for initialisation of h2o (1: yes / 0: no)
     
    3435#include "dimphys.h"
    3536#include "paramet.h"
    36 #include "tracer.h"
     37!#include "tracer.h"
    3738#include "comvert.h"
    3839#include "callkeys.h"
     
    4142! inputs :
    4243
     44      integer,intent(in) :: nq                    ! number of tracers
    4345      real,intent(in) :: ps(iip1,jjp1)            ! surface pressure in the gcm (Pa)   
    4446      integer,intent(in) :: flagh2o               ! flag for h2o initialisation
     
    4749! outputs :
    4850
    49       real,intent(out) :: pq(iip1,jjp1,llm,nqmx)  ! advected fields, ie chemical species
    50       real,intent(out) :: qsurf(ngridmx,nqmx)     ! surface values (kg/m2) of tracers
     51      real,intent(out) :: pq(iip1,jjp1,llm,nq)  ! advected fields, ie chemical species
     52      real,intent(out) :: qsurf(ngridmx,nq)     ! surface values (kg/m2) of tracers
    5153
    5254! local :
     
    7375
    7476! 1.1 initialize tracer indexes to zero:
    75 
     77      nqmx=nq ! initialize value of nqmx
     78     
    7679      do iq = 1,nqmx
    7780        igcm_dustbin(iq) = 0
  • trunk/LMDZ.MARS/libf/aeronomars/jthermcalc.F

    r658 r1036  
    10261026c**********************************************************************
    10271027
     1028      use tracer_mod, only: igcm_o, igcm_co2, igcm_o2, igcm_h2,
     1029     &                      igcm_h2o_vap, igcm_h2o2, igcm_co, igcm_h,
     1030     &                      igcm_o3, igcm_n2, igcm_n, igcm_no, igcm_no2,
     1031     &                      mmol
    10281032      implicit none
    10291033
     
    10321036      include "dimensions.h"
    10331037      include "dimphys.h"
    1034       include "tracer.h"
     1038!      include "tracer.h"
    10351039      include 'param.h'
    10361040      include 'param_v4.h'
  • trunk/LMDZ.MARS/libf/aeronomars/moldiff.F

    r690 r1036  
    22     &                   zzlay,pdteuv,pdtconduc,pdqdiff)
    33
    4 
     4      use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d,
     5     &                      igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh,
     6     &                      igcm_ho2, igcm_h2o2, igcm_n2, igcm_ar,
     7     &                      igcm_h2o_vap, mmol
    58      implicit none
    69
     
    1114#include "comdiurn.h"
    1215#include "chimiedata.h"
    13 #include "tracer.h"
     16!#include "tracer.h"
    1417#include "conc.h"
    1518
  • trunk/LMDZ.MARS/libf/aeronomars/moldiff_red.F90

    r1020 r1036  
    11subroutine moldiff_red(pplay,pplev,pt,pdt,pq,pdq,ptimestep,zzlay,pdteuv,pdtconduc,pdqdiff)
     2
     3use tracer_mod, only: nqmx, noms, mmol
    24
    35implicit none
     
    911#include "comdiurn.h"
    1012#include "chimiedata.h"
    11 #include "tracer.h"
     13!#include "tracer.h"
    1214#include "conc.h"
    1315#include "diffusion.h"
     
    904906
    905907        SUBROUTINE QMNEW(Q1,DQ,Q2,dtime,nl,nq,gc,ig)
     908        use tracer_mod, only: nqmx
    906909        IMPLICIT NONE
    907 #include "dimensions.h"
     910!#include "dimensions.h"
    908911
    909912        INTEGER,INTENT(IN) :: nl,nq
     
    939942
    940943        SUBROUTINE MMOY(massemoy,mmol,qq,gc,nl,nq)
    941         IMPLICIT NONE
    942 #include "dimensions.h"
     944        use tracer_mod, only: nqmx
     945        IMPLICIT NONE
     946!#include "dimensions.h"
    943947
    944948        INTEGER :: nl,nq,l
     
    10231027     & qq,mmol,gc,Praf,Traf,Qraf,Mraf,Zraf,                             &
    10241028     & Nraf,Nrafk,Rraf,Rrafk,il,nl,nq,nlx,ig)
     1029        use tracer_mod, only: nqmx
    10251030        IMPLICIT NONE
    1026 #include "dimensions.h"
     1031!#include "dimensions.h"
    10271032       
    10281033        INTEGER :: nl,nq,il,l,i,iq,nlx,iz,ig
     
    13641369        SUBROUTINE GCMGRID_P(Z,P,Q,T,Nk,Rk,qq,qnew,tt,tnew,             &
    13651370     &    pp,M,gc,nl,nq,nlx,ig)
    1366         IMPLICIT NONE
    1367 #include "dimensions.h"
     1371        use tracer_mod, only: nqmx
     1372        IMPLICIT NONE
     1373!#include "dimensions.h"
    13681374        INTEGER :: nl,nq,nlx,il,nn,iP,ig,compteur
    13691375        INTEGER,DIMENSION(1) :: indP
     
    14651471        SUBROUTINE GCMGRID_P2(Z,P,Q,T,Nk,Rk,qq,qnew,tt,tnew             &
    14661472     &   ,pp,M,gc,nl,nq,nlx,facM,ig)
     1473        use tracer_mod, only: nqmx
    14671474        IMPLICIT NONE
    1468 #include "dimensions.h"
     1475!#include "dimensions.h"
    14691476        INTEGER :: nl,nq,nlx,il,nn,iP,ig,compteur
    14701477        INTEGER,DIMENSION(1) :: indP
  • trunk/LMDZ.MARS/libf/aeronomars/moldiffcoeff.F

    r414 r1036  
    11      subroutine moldiffcoeff(dij)
     2
     3      use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_o1d,
     4     &                      igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh,
     5     &                      igcm_ho2, igcm_h2o2, igcm_n2, igcm_ar,
     6     &                      igcm_h2o_vap, mmol
    27
    38       IMPLICIT NONE
     
    1621#include "comdiurn.h"
    1722#include "chimiedata.h"
    18 #include "tracer.h"
     23!#include "tracer.h"
    1924#include "conc.h"
    2025
  • trunk/LMDZ.MARS/libf/aeronomars/moldiffcoeff_red.F

    r710 r1036  
    11      subroutine moldiffcoeff_red(dij,indic,gcmind,ncompdiff2)
    22
     3       use tracer_mod, only: nqmx, noms, mmol
    34       IMPLICIT NONE
    45c=======================================================================
     
    1617#include "comdiurn.h"
    1718#include "chimiedata.h"
    18 #include "tracer.h"
     19!#include "tracer.h"
    1920#include "conc.h"
    2021#include "diffusion.h"
  • trunk/LMDZ.MARS/libf/aeronomars/perosat.F

    r658 r1036  
    22     $                   pplev, pplay, zt,
    33     &                   zy, pdqcloud, pdqscloud)
     4      use tracer_mod, only: nqmx, igcm_h2o2, mmol
    45      IMPLICIT NONE
    56
     
    1415c
    1516c     WARNING : H2O2 mixing ratio is assumed to be q(igcm_h2o2)   
    16 c               index igcm_h2o2 is known from tracer.h
     17c               index igcm_h2o2 is known from tracer_mod
    1718c=======================================================================
    1819
     
    2526#include "comcstfi.h"
    2627#include "chimiedata.h"
    27 #include "tracer.h"
     28!#include "tracer.h"
    2829#include "conc.h"
    2930c
  • trunk/LMDZ.MARS/libf/aeronomars/photochemistry.F

    r690 r1036  
    1414     $                  surfice1d, jo3, tau)
    1515c
     16      use tracer_mod, only: nqmx
    1617      implicit none
    1718c
     
    2021#include "chimiedata.h"
    2122#include "callkeys.h"
    22 #include "tracer.h"
     23!#include "tracer.h"
    2324c
    2425cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     
    11521153c*****************************************************************
    11531154c
     1155      use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d,
     1156     &                      igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh,
     1157     &                      igcm_ho2, igcm_h2o2, igcm_n2, igcm_h2o_vap,
     1158     &                      igcm_ch4
    11541159      implicit none
    11551160c
     
    11571162#include "dimphys.h"
    11581163#include "callkeys.h"
    1159 #include "tracer.h"
     1164!#include "tracer.h"
    11601165c
    11611166cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     
    12501255c*****************************************************************
    12511256c
     1257      use tracer_mod, only: nqmx, igcm_co2, igcm_co, igcm_o, igcm_o1d,
     1258     &                      igcm_o2, igcm_o3, igcm_h, igcm_h2, igcm_oh,
     1259     &                      igcm_ho2, igcm_h2o2, igcm_n2, igcm_h2o_vap,
     1260     &                      igcm_ch4
    12521261      implicit none
    12531262c
     
    12551264#include "dimphys.h"
    12561265#include "callkeys.h"
    1257 #include "tracer.h"
     1266!#include "tracer.h"
    12581267c
    12591268cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  • trunk/LMDZ.MARS/libf/aeronomars/surfacearea.F

    r635 r1036  
    55     $                       surfdust, surfice)
    66
     7      use tracer_mod, only: nuice_sed, igcm_dust_number,
     8     &                      igcm_ccn_number, varian, ccn_factor
    79      implicit none
    810
     
    1921#include "comcstfi.h"
    2022#include "callkeys.h"
    21 #include "tracer.h"
     23!#include "tracer.h"
    2224#include "dimradmars.h"
    2325#include "chimiedata.h"
  • trunk/LMDZ.MARS/libf/aeronomars/thermosphere.F

    r658 r1036  
    44     $     zdteuv,zdtconduc,zdumolvis,zdvmolvis,zdqmoldiff)
    55
     6      use tracer_mod, only: nqmx ! number of advecter tracers
    67      implicit none
    78
  • trunk/LMDZ.MARS/libf/dyn3d/calfis.F

    r697 r1036  
    8282      REAL pteta(iip1,jjp1,llm)
    8383      REAL pmasse(iip1,jjp1,llm)
    84       REAL pq(iip1,jjp1,llm,nqmx)
     84      REAL pq(iip1,jjp1,llm,nq)
    8585      REAL pphis(iip1,jjp1)
    8686      REAL pphi(iip1,jjp1,llm)
     
    8989      REAL pducov(iip1,jjp1,llm)
    9090      REAL pdteta(iip1,jjp1,llm)
    91       REAL pdq(iip1,jjp1,llm,nqmx)
     91      REAL pdq(iip1,jjp1,llm,nq)
    9292c
    9393      REAL pw(iip1,jjp1,llm)
     
    100100      REAL pdufi(iip1,jjp1,llm)
    101101      REAL pdhfi(iip1,jjp1,llm)
    102       REAL pdqfi(iip1,jjp1,llm,nqmx)
     102      REAL pdqfi(iip1,jjp1,llm,nq)
    103103      REAL pdpsfi(iip1,jjp1)
    104104      logical tracer
     
    113113c
    114114      REAL zufi(ngridmx,llm), zvfi(ngridmx,llm)
    115       REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nqmx)
     115      REAL ztfi(ngridmx,llm),zqfi(ngridmx,llm,nq)
    116116c
    117117      REAL zvervel(ngridmx,llm)
    118118c
    119119      REAL zdufi(ngridmx,llm),zdvfi(ngridmx,llm)
    120       REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nqmx)
     120      REAL zdtfi(ngridmx,llm),zdqfi(ngridmx,llm,nq)
    121121      REAL zdpsrf(ngridmx)
    122122c
     
    185185         airefi(ngridmx)=airefi(ngridmx)*iim
    186186
    187          CALL inifis(ngridmx,llm,day_ini,daysec,dtphys,
     187         CALL inifis(ngridmx,llm,nq,day_ini,daysec,dtphys,
    188188     .                latfi,lonfi,airefi,rad,g,r,cpp)
    189189      ENDIF
     
    275275c   43.bis Taceurs (en kg/kg)
    276276c   --------------------------
    277       DO iq=1,nqmx
     277      DO iq=1,nq
    278278         DO l=1,llm
    279279            zqfi(1,l,iq) = pq(1,1,l,iq)
     
    466466c   ---------------------
    467467
    468       DO iq=1,nqmx
     468      DO iq=1,nq
    469469         DO l=1,llm
    470470            DO i=1,iip1
  • trunk/LMDZ.MARS/libf/dyn3d/dynetat0.F

    r999 r1036  
    33     
    44      use netcdf
     5      use infotrac, only: tnom
    56     
    67      IMPLICIT NONE
     
    3738#include "serre.h"
    3839#include "logic.h"
    39 #include "advtrac.h"
     40!#include "advtrac.h"
    4041#include "control.h"
    4142
     
    380381!           WRITE(str3(2:3),'(i2.2)') iq
    381382!           ierr =  NF_INQ_VARID (nid, str3, nvarid)
    382 ! NB: tracers are now read in using their name ('tnom' from advtrac.h)
     383! NB: tracers are now read in using their name ('tnom' from infotrac)
    383384!           write(*,*) "  loading tracer:",trim(tnom(iq))
    384385           ierr=nf90_inq_varid(nid,tnom(iq),nvarid)
     
    404405c        case when new tracer are added in addition to old ones
    405406             write(*,*)'tracers 1 to ', nqold,'were already present'
    406              write(*,*)'tracers ', nqold+1,' to ', nqmx,'are new'
     407             write(*,*)'tracers ', nqold+1,' to ', nq,'are new'
    407408!             yes=' '
    408409!            do while ((yes.ne.'y').and.(yes.ne.'n'))
    409410!             write(*,*) 'Would you like to reindex tracer # 1 ->',nqold
    410 !             write(*,*) 'to #',nqmx-nqold+1,'->', nqmx,'   (y or n) ?'
     411!             write(*,*) 'to #',nq-nqold+1,'->', nq,'   (y or n) ?'
    411412!             read(*,fmt='(a)') yes
    412413!            end do
     
    416417!                do j=1,jjp1
    417418!                  do i=1,iip1
    418 !                    do iq=nqmx,nqmx-nqold+1,-1
    419 !                       q(i,j,l,iq)=q(i,j,l,iq-nqmx+nqold)   
     419!                    do iq=nq,nq-nqold+1,-1
     420!                       q(i,j,l,iq)=q(i,j,l,iq-nq+nqold)   
    420421!                    end do
    421 !                    do iq=nqmx-nqold,1,-1
     422!                    do iq=nq-nqold,1,-1
    422423!                       q(i,j,l,iq)= 0.
    423424!                    end do
  • trunk/LMDZ.MARS/libf/dyn3d/dynredem.F

    r999 r1036  
    11      SUBROUTINE dynredem0(fichnom,idayref,anneeref,phis,nq)
     2      use infotrac, only: tnom
    23      IMPLICIT NONE
    34c=======================================================================
     
    1718#include "description.h"
    1819#include "serre.h"
    19 #include "advtrac.h"
     20!#include "advtrac.h"
    2021c   Arguments:
    2122c   ----------
     
    963964      SUBROUTINE dynredem1(fichnom,time,
    964965     .                     vcov,ucov,teta,q,nq,masse,ps)
     966      use infotrac, only: nqtot, tnom
    965967      IMPLICIT NONE
    966968c=================================================================
     
    973975#include "comvert.h"
    974976#include "comgeom.h"
    975 #include"advtrac.h"
     977!#include"advtrac.h"
    976978
    977979      INTEGER nq, l
     
    979981      REAL teta(ip1jmp1,llm)                   
    980982      REAL ps(ip1jmp1),masse(ip1jmp1,llm)                   
    981       REAL q(iip1,jjp1,llm,nqmx)
     983      REAL q(iip1,jjp1,llm,nqtot)
    982984      REAL q3d(iip1,jjp1,llm) !temporary variable
    983985      CHARACTER*(*) fichnom
  • trunk/LMDZ.MARS/libf/dyn3d/gcm.F

    r999 r1036  
    11      PROGRAM gcm
    22
     3      use infotrac, only: iniadvtrac, nqtot, iadv
    34      IMPLICIT NONE
    45
     
    4849#include "tracstoke.h"
    4950#include "sponge.h"
    50 #include"advtrac.h"
     51!#include"advtrac.h"
    5152
    5253      INTEGER*4  iday ! jour julien
     
    5758      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants
    5859      real, dimension(ip1jmp1,llm) :: teta   ! temperature potentielle
    59       REAL q(ip1jmp1,llm,nqmx)               ! champs advectes
     60      REAL,allocatable :: q(:,:,:)           ! champs advectes
    6061      REAL ps(ip1jmp1)                       ! pression  au sol
    6162      REAL pext(ip1jmp1)                     ! pression  extensive
     
    8081c   tendances dynamiques
    8182      REAL dv(ip1jm,llm),du(ip1jmp1,llm)
    82       REAL dteta(ip1jmp1,llm),dq(ip1jmp1,llm,nqmx),dp(ip1jmp1)
     83      REAL dteta(ip1jmp1,llm),dp(ip1jmp1)
     84      REAL,ALLOCATABLE :: dq(:,:,:)
    8385
    8486c   tendances de la dissipation
     
    8890c   tendances physiques
    8991      REAL dvfi(ip1jm,llm),dufi(ip1jmp1,llm)
    90       REAL dhfi(ip1jmp1,llm),dqfi(ip1jmp1,llm,nqmx),dpfi(ip1jmp1)
     92      REAL dhfi(ip1jmp1,llm),dpfi(ip1jmp1)
     93      REAL,ALLOCATABLE :: dqfi(:,:,:)
    9194
    9295c   variables pour le fichier histoire
     
    9598      REAL tppn(iim),tpps(iim),tpn,tps
    9699c
    97 !      INTEGER iadv(nqmx) ! indice schema de transport pour le traceur iq
    98100
    99101      INTEGER itau,itaufinp1,iav
     
    124126      LOGICAL tracer
    125127          data tracer/.true./
    126       INTEGER nq
     128!      INTEGER nq
    127129
    128130C Calendrier
     
    142144
    143145c-----------------------------------------------------------------------
    144 c  Initialize tracers using iniadvtrac (Ehouarn, oct 2008)
    145146      CALL defrun_new( 99, .TRUE. )
    146147
    147       CALL iniadvtrac(nq,numvanle)
    148      
    149       CALL dynetat0("start.nc",nqmx,vcov,ucov,
     148! Initialize tracers
     149      call iniadvtrac(nqtot,numvanle)
     150! Allocation de la tableau q : champs advectes   
     151      allocate(q(ip1jmp1,llm,nqtot))
     152      allocate(dq(ip1jmp1,llm,nqtot))
     153      allocate(dqfi(ip1jmp1,llm,nqtot))
     154
     155      CALL dynetat0("start.nc",nqtot,vcov,ucov,
    150156     .              teta,q,masse,ps,phis,time_0)
    151157
     
    245251     . 'c''est a dire du jour',i7,3x,'au jour',i7//)
    246252
    247       CALL dynredem0("restart.nc",day_ini,anne_ini,phis,nqmx)
     253      CALL dynredem0("restart.nc",day_ini,anne_ini,phis,nqtot)
    248254
    249255      ecripar = .TRUE.
     
    253259
    254260c   Quelques initialisations pour les traceurs
    255       call initial0(ijp1llm*nqmx,dq)
     261      dq(:,:,:)=0
    256262c     istdyn=day_step/4     ! stockage toutes les 6h=1jour/4
    257263c     istphy=istdyn/iphysiq
     
    348354       IF( forward. OR . leapf )  THEN
    349355
    350         DO iq = 1, nqmx
     356        DO iq = 1, nqtot
    351357c
    352358         IF ( iadv(iq).EQ.1.OR.iadv(iq).EQ.2 )  THEN
    353359            CALL traceur( iq,iadv,q,teta,pk,w, pbaru, pbarv, dq )
    354360
    355          ELSE IF( iq.EQ. nqmx )   THEN
     361         ELSE IF( iq.EQ. nqtot )   THEN
    356362c
    357363            iapp_tracvl = 5
     
    361367c
    362368
    363             CALL vanleer(numvanle,iapp_tracvl,nqmx,q,pbaru,pbarv,
     369            CALL vanleer(numvanle,iapp_tracvl,nqtot,q,pbaru,pbarv,
    364370     *                      p, masse, dq,  iadv(1), teta, pk     )
    365371
     
    422428           ENDIF
    423429c
    424         CALL calfis( nqmx, lafin ,rdayvrai,rday_ecri,time  ,
     430        CALL calfis( nqtot, lafin ,rdayvrai,rday_ecri,time  ,
    425431     $                 ucov,vcov,teta,q,masse,ps,p,pk,phis,phi ,
    426432     $     du,dv,dteta,dq,w, dufi,dvfi,dhfi,dqfi,dpfi,tracer)
     
    429435c      ajout des tendances physiques:
    430436c      ------------------------------
    431           CALL addfi( nqmx, dtphys, leapf, forward   ,
     437          CALL addfi( nqtot, dtphys, leapf, forward   ,
    432438     $                  ucov, vcov, teta , q   ,ps , masse,
    433439     $                 dufi, dvfi, dhfi , dqfi ,dpfi  )
     
    540546c                 iav=0
    541547c              ENDIF
    542 c              CALL writedynav(histaveid, nqmx, itau,vcov ,
     548c              CALL writedynav(histaveid, nqtot, itau,vcov ,
    543549c    ,                          ucov,teta,pk,phi,q,masse,ps,phis)
    544550c           ENDIF
     
    556562     .  ' date=',REAL(itau)/REAL(day_step)
    557563       CALL dynredem1("restart.nc",REAL(itau)/REAL(day_step),
    558      .                vcov,ucov,teta,q,nqmx,masse,ps)
     564     .                vcov,ucov,teta,q,nqtot,masse,ps)
    559565     
    560566      CLOSE(99)
     
    625631                  iav=0
    626632               ENDIF
    627 c              CALL writedynav(histaveid, nqmx, itau,vcov ,
     633c              CALL writedynav(histaveid, nqtot, itau,vcov ,
    628634c    ,                          ucov,teta,pk,phi,q,masse,ps,phis)
    629635
     
    636642              CALL dynredem1("restart.nc",
    637643     .                REAL(itau)/REAL(day_step),
    638      .                vcov,ucov,teta,q,nqmx,masse,ps)
     644     .                vcov,ucov,teta,q,nqtot,masse,ps)
    639645     
    640646              forward = .TRUE.
  • trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F

    r999 r1036  
    1       SUBROUTINE lect_start_archive(date,tsurf,tsoil,emis,q2,
     1      SUBROUTINE lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2,
    22     &     t,ucov,vcov,ps,co2ice,h,phisold_newgrid,
    33     &     q,qsurf,surfith,nid)
     
    1616c
    1717c=======================================================================
    18 
     18      use infotrac, only: tnom
    1919      implicit none
    2020
     
    3838#include "netcdf.inc"
    3939!#include "tracer.h"
    40 #include"advtrac.h"
     40!#include"advtrac.h"
    4141c=======================================================================
    4242c   Declarations
     
    4949c et autres:
    5050c----------
    51       INTEGER lnblnk
    52       EXTERNAL lnblnk
     51      integer,intent(in) :: nqtot ! number of advected tracers
    5352
    5453c Variables pour les lectures des fichiers "ini"
     
    8584      REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants
    8685      REAL h(iip1,jjp1,llm),ps(iip1,jjp1)
    87       REAL q(iip1,jjp1,llm,nqmx),qtot(iip1,jjp1,llm)
     86      REAL q(iip1,jjp1,llm,nqtot),qtot(iip1,jjp1,llm)
    8887
    8988c autre variables dynamique nouvelle grille
     
    103102      REAL co2ice(ngridmx) ! CO2 ice layer
    104103      REAL emis(ngridmx)
    105       REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqmx)
     104      REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqtot)
    106105c     REAL phisfi(ngridmx)
    107106
     
    130129      real inertiedatS(iip1,jjp1,nsoilmx)
    131130      real co2iceS(iip1,jjp1),emisS(iip1,jjp1)
    132       REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nqmx)
     131      REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nqtot)
    133132
    134133      real ptotal, co2icetotal
     
    193192! check if tracers follow old naming convention (q01, q02, q03, ...)
    194193      counter=0
    195       do iq=1,nqmx
     194      do iq=1,nqtot
    196195        txt= " "
    197196        write(txt,'(a1,i2.2)')'q',iq
     
    205204        endif
    206205      enddo
    207       if (counter.eq.nqmx) then
     206      if (counter.eq.nqtot) then
    208207        write(*,*) "lect_start_archive: tracers seem to follow old ",
    209208     &             "naming convention (q01, q02,...)"
     
    318317      allocate(psold(imold+1,jmold+1))
    319318      allocate(phisold(imold+1,jmold+1))
    320       allocate(qold(imold+1,jmold+1,lmold,nqmx))
     319      allocate(qold(imold+1,jmold+1,lmold,nqtot))
    321320      allocate(co2iceold(imold+1,jmold+1))
    322321      allocate(tsurfold(imold+1,jmold+1))
     
    331330      allocate(surfithold(imold+1,jmold+1))
    332331      allocate(mlayerold(nsoilold))
    333       allocate(qsurfold(imold+1,jmold+1,nqmx))
     332      allocate(qsurfold(imold+1,jmold+1,nqtot))
    334333
    335334      allocate(var (imold+1,jmold+1,llm))
     
    748747c -------------------------------------------
    749748! Surface tracers:     
    750       qsurfold(1:imold+1,1:jmold+1,1:nqmx)=0
    751 
    752       DO iq=1,nqmx
     749      qsurfold(1:imold+1,1:jmold+1,1:nqtot)=0
     750
     751      DO iq=1,nqtot
    753752        IF (oldtracernames) THEN
    754753          txt=" "
     
    787786        ENDIF
    788787
    789       ENDDO ! of DO iq=1,nqmx
     788      ENDDO ! of DO iq=1,nqtot
    790789
    791790!-----------------------------------------------------------------------
     
    936935c -------------------------------------------
    937936! Tracers:
    938       qold(1:imold+1,1:jmold+1,1:lmold,1:nqmx)=0
    939 
    940       DO iq=1,nqmx
     937      qold(1:imold+1,1:jmold+1,1:lmold,1:nqtot)=0
     938
     939      DO iq=1,nqtot
    941940        IF (oldtracernames) THEN
    942941          txt=" "
     
    966965        ENDIF
    967966
    968       ENDDO ! of DO iq=1,nqmx
     967      ENDDO ! of DO iq=1,nqtot
    969968
    970969
     
    12731272
    12741273c traceurs surface
    1275       do iq = 1, nqmx
     1274      do iq = 1, nqtot
    12761275            call interp_horiz(qsurfold(1,1,iq) ,qsurfs(1,1,iq),
    12771276     &                  imold,jmold,iim,jjm,1,
     
    12791278      enddo
    12801279
    1281       call gr_dyn_fi (nqmx,iim+1,jjm+1,ngridmx,qsurfs,qsurf)
     1280      call gr_dyn_fi (nqtot,iim+1,jjm+1,ngridmx,qsurfs,qsurf)
    12821281
    12831282c traceurs 3D
    1284       do  iq = 1, nqmx
     1283      do  iq = 1, nqtot
    12851284            call interp_vert(qold(1,1,1,iq),var,lmold,llm,
    12861285     &        apsold,bpsold,aps,bps,psold,(imold+1)*(jmold+1))
     
    13221321
    13231322c     Periodicite :
    1324       do  iq = 1, nqmx
     1323      do  iq = 1, nqtot
    13251324         do l=1, llm
    13261325            do j = 1, jjp1
  • trunk/LMDZ.MARS/libf/dyn3d/newstart.F

    r999 r1036  
    1616
    1717! to use  'getin'
    18       USE ioipsl_getincom
    19 
     18      use ioipsl_getincom, only: getin
     19      use infotrac, only: iniadvtrac, nqtot, tnom
     20      use tracer_mod, only: noms, igcm_h2o_vap, igcm_h2o_ice
    2021      implicit none
    2122
     
    4142#include "serre.h"
    4243#include "netcdf.inc"
    43 #include"advtrac.h"
    44 #include"tracer.h"
     44!#include"advtrac.h"
     45!#include"tracer.h"
    4546#include "datafile.h"
    4647c=======================================================================
     
    7273      REAL vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants
    7374      REAL phis(iip1,jjp1)
    74       REAL q(iip1,jjp1,llm,nqmx)               ! champs advectes
     75      REAL,ALLOCATABLE :: q(:,:,:,:)               ! champs advectes
    7576
    7677c autre variables dynamique nouvelle grille
     
    9899      REAL co2ice(ngridmx)      ! CO2 ice layer
    99100      REAL emis(ngridmx)        ! surface emissivity
    100       REAL qsurf(ngridmx,nqmx)
     101      REAL,ALLOCATABLE :: qsurf(:,:)
    101102      REAL q2(ngridmx,nlayermx+1)
    102103!      REAL rnaturfi(ngridmx)
     
    179180      pa= 20           ! for Mars, instead of 500 (Earth)
    180181
     182! Load tracer number and names:
     183      call iniadvtrac(nqtot,numvanle)
     184! allocate arrays
     185      allocate(q(iip1,jjp1,llm,nqtot))
     186      allocate(qsurf(ngridmx,nqtot))
     187     
    181188c=======================================================================
    182189c   Choice of the start file(s) to use
     
    323330c  INITIALISATIONS DIVERSES
    324331c=======================================================================
    325 ! Load tracer names:
    326       call iniadvtrac(nq,numvanle)
    327332
    328333      day_step=180 !?! Note: day_step is a common in "control.h"
     
    357362!    (for instance initracer needs to know about some flags, and/or
    358363!      'datafile' path may be changed by user)
    359       call inifis(ngridmx,llm,day_ini,daysec,dtphys,
     364      call inifis(ngridmx,llm,nqtot,day_ini,daysec,dtphys,
    360365     &                latfi,lonfi,airefi,rad,g,r,cpp)
    361366
     
    399404
    400405        write(*,*) 'Reading file START_ARCHIVE'
    401         CALL lect_start_archive(date,tsurf,tsoil,emis,q2,
     406        CALL lect_start_archive(nqtot,date,tsurf,tsoil,emis,q2,
    402407     .   t,ucov,vcov,ps,co2ice,teta,phisold_newgrid,q,qsurf,
    403408     &   surfith,nid)
     
    415420        write(*,*) 'Reading file START'
    416421        fichnom = 'start.nc'
    417         CALL dynetat0(fichnom,nqmx,vcov,ucov,teta,q,masse,
     422        CALL dynetat0(fichnom,nqtot,vcov,ucov,teta,q,masse,
    418423     .       ps,phis,time)
    419424
    420425        write(*,*) 'Reading file STARTFI'
    421426        fichnom = 'startfi.nc'
    422         CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqmx,
     427        CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqtot,
    423428     .        day_ini,time,
    424429     .        tsurf,tsoil,emis,q2,qsurf,co2ice)
     
    448453! rename them
    449454      count=0
    450       do iq=1,nqmx
     455      do iq=1,nqtot
    451456        txt=" "
    452457        write(txt,'(a1,i2.2)') 'q',iq
     
    454459          count=count+1
    455460        endif
    456       enddo ! of do iq=1,nqmx
     461      enddo ! of do iq=1,nqtot
    457462     
    458463      ! initialize tracer names noms(:) and indexes (igcm_co2, igcm_h2o_vap, ...)
    459       call initracer(qsurf,co2ice)
     464      call initracer(ngridmx,nqtot,qsurf,co2ice)
    460465     
    461       if (count.eq.nqmx) then
     466      if (count.eq.nqtot) then
    462467        write(*,*) 'Newstart: updating tracer names'
    463468        ! copy noms(:) to tnom(:) to have matching tracer names in physics
    464469        ! and dynamics
    465         tnom(1:nqmx)=noms(1:nqmx)
     470        tnom(1:nqtot)=noms(1:nqtot)
    466471      endif
    467472
     
    693698         if (yes.eq.'y') then
    694699           write(*,*) 'OK : conservation of tracer total mass'
    695            DO iq =1, nqmx
     700           DO iq =1, nqtot
    696701             DO l=1,llm
    697702               DO j=1,jjp1
     
    712717         do while (yes.eq.'y')
    713718          write(*,*) 'Which tracer name do you want to change ?'
    714           do iq=1,nqmx
     719          do iq=1,nqtot
    715720            write(*,'(i3,a3,a20)')iq,' : ',trim(tnom(iq))
    716721          enddo
    717722          write(*,'(a35,i3)')
    718      &            '(enter tracer number; between 1 and ',nqmx
     723     &            '(enter tracer number; between 1 and ',nqtot
    719724          write(*,*)' or any other value to quit this option)'
    720725          read(*,*) iq
    721           if ((iq.ge.1).and.(iq.le.nqmx)) then
     726          if ((iq.ge.1).and.(iq.le.nqtot)) then
    722727            write(*,*)'Change tracer name ',trim(tnom(iq)),' to ?'
    723728            read(*,*) txt
     
    728733! inapropiate value of iq; quit this option
    729734            yes='n'
    730           endif ! of if ((iq.ge.1).and.(iq.le.nqmx))
     735          endif ! of if ((iq.ge.1).and.(iq.le.nqtot))
    731736         enddo ! of do while (yes.ne.'y')
    732737
     
    736741c          mise a 0 des q (traceurs)
    737742          write(*,*) 'Tracers set to 0 (1.E-30 in fact)'
    738            DO iq =1, nqmx
     743           DO iq =1, nqtot
    739744             DO l=1,llm
    740745               DO j=1,jjp1
     
    747752
    748753c          set surface tracers to zero
    749            DO iq =1, nqmx
     754           DO iq =1, nqtot
    750755             DO ig=1,ngridmx
    751756                 qsurf(ig,iq)=0.
     
    757762        else if (trim(modif) .eq. 'q=x') then
    758763             write(*,*) 'Which tracer do you want to modify ?'
    759              do iq=1,nqmx
     764             do iq=1,nqtot
    760765               write(*,*)iq,' : ',trim(tnom(iq))
    761766             enddo
    762              write(*,*) '(choose between 1 and ',nqmx,')'
     767             write(*,*) '(choose between 1 and ',nqtot,')'
    763768             read(*,*) iq
    764              if ((iq.lt.1).or.(iq.gt.nqmx)) then
     769             if ((iq.lt.1).or.(iq.gt.nqtot)) then
    765770               ! wrong value for iq, go back to menu
    766771               write(*,*) "wrong input value:",iq
     
    793798             write(*,*) "followed by 2nd, etc. up to top of atmosphere)"
    794799             write(*,*) 'Which tracer do you want to set?'
    795              do iq=1,nqmx
     800             do iq=1,nqtot
    796801               write(*,*)iq,' : ',trim(tnom(iq))
    797802             enddo
    798              write(*,*) '(choose between 1 and ',nqmx,')'
     803             write(*,*) '(choose between 1 and ',nqtot,')'
    799804             read(*,*) iq
    800              if ((iq.lt.1).or.(iq.gt.nqmx)) then
     805             if ((iq.lt.1).or.(iq.gt.nqtot)) then
    801806               ! wrong value for iq, go back to menu
    802807               write(*,*) "wrong input value:",iq
     
    853858          endif
    854859         
    855           call inichim_newstart(q, qsurf, ps, flagh2o, flagthermo)
     860          call inichim_newstart(nq, q, qsurf, ps, flagh2o, flagthermo)
    856861
    857862         ! We want to have the very same value at lon -180 and lon 180
    858863          do l = 1,llm
    859864             do j = 1,jjp1
    860                 do iq = 1,nqmx
     865                do iq = 1,nqtot
    861866                   q(iip1,j,l,iq) = q(1,j,l,iq)
    862867                end do
     
    892897          do l = 1,llm
    893898             do j = 1,jjp1
    894                 do iq = 1,nqmx
     899                do iq = 1,nqtot
    895900                   q(iip1,j,l,iq) = q(1,j,l,iq)
    896901                end do
     
    14601465c    $    phi,conser,du,dv,dteta,dp,w, pbaru,pbarv, day_ini )
    14611466
    1462       CALL dynredem0("restart.nc",day_ini,anneeref,phis,nqmx)
     1467      CALL dynredem0("restart.nc",day_ini,anneeref,phis,nqtot)
    14631468      CALL dynredem1("restart.nc",hour_ini,vcov,ucov,teta,q,
    1464      .               nqmx,masse,ps)
     1469     .               nqtot,masse,ps)
    14651470C
    14661471C Ecriture etat initial physique
    14671472C
    14681473
    1469       call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,nqmx,
     1474      call physdem0("restartfi.nc",lonfi,latfi,nsoilmx,nqtot,
    14701475     .              dtphys,real(day_ini),0.0,
    14711476     .              airefi,albfi,ithfi,zmea,zstd,zsig,zgam,zthe)
    1472       call physdem1("restartfi.nc",nsoilmx,nqmx,
     1477      call physdem1("restartfi.nc",nsoilmx,nqtot,
    14731478     .              dtphys,hour_ini,
    14741479     .              tsurf,tsoil,co2ice,emis,q2,qsurf)
  • trunk/LMDZ.MARS/libf/dyn3d/paramet.h

    r38 r1036  
    33
    44      INTEGER  iip1,iip2,iip3,jjp1,llmp1,llmp2,llmm1
    5       INTEGER  kftd,ip1jm,ip1jmp1,ip1jmi1,ijp1llm
     5      INTEGER  ip1jm,ip1jmp1,ip1jmi1,ijp1llm
    66      INTEGER  ijmllm,mvar
    77      INTEGER jcfil,jcfllm
     
    1010      PARAMETER( jjp1=jjm+1-1/jjm)
    1111      PARAMETER( llmp1 = llm+1,  llmp2 = llm+2, llmm1 = llm-1 )
    12       PARAMETER( kftd  = iim/2 -ndm )
    1312      PARAMETER( ip1jm  = iip1*jjm,  ip1jmp1= iip1*jjp1 )
    1413      PARAMETER( ip1jmi1= ip1jm - iip1 )
  • trunk/LMDZ.MARS/libf/dyn3d/start2archive.F

    r999 r1036  
    1919c=======================================================================
    2020
     21      use infotrac, only: iniadvtrac, nqtot, tnom
    2122      implicit none
    2223
     
    3536#include "dimphys.h"
    3637#include "comsoil.h"
    37 #include"advtrac.h"
     38!#include"advtrac.h"
    3839#include "netcdf.inc"
    3940
     
    4647      REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants
    4748      REAL teta(ip1jmp1,llm)                    ! temperature potentielle
    48       REAL q(ip1jmp1,llm,nqmx)               ! champs advectes
     49      REAL,ALLOCATABLE :: q(:,:,:)   ! champs advectes
    4950      REAL pks(ip1jmp1)                      ! exner (f pour filtre)
    5051      REAL pk(ip1jmp1,llm)
     
    6162      REAL tsoil(ngridmx,nsoilmx) ! Soil temperature
    6263      REAL co2ice(ngridmx)      ! CO2 ice layer
    63       REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqmx)
     64      REAL q2(ngridmx,nlayermx+1)
     65      REAL,ALLOCATABLE :: qsurf(:,:)
    6466      REAL emis(ngridmx)
    6567      INTEGER start,length
     
    7577      REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia
    7678      REAL co2iceS(ip1jmp1)
    77       REAL q2S(ip1jmp1,llm+1),qsurfS(ip1jmp1,nqmx)
     79      REAL q2S(ip1jmp1,llm+1)
     80      REAL,ALLOCATABLE :: qsurfS(:,:)
    7881      REAL emisS(ip1jmp1)
    7982
     
    116119c Lecture des donnees
    117120c=======================================================================
    118 ! Load tracer names:
    119       call iniadvtrac(nq,numvanle)
     121! Load tracer number and names:
     122      call iniadvtrac(nqtot,numvanle)
     123
     124! allocate arrays:
     125      allocate(q(ip1jmp1,llm,nqtot))
     126      allocate(qsurf(ngridmx,nqtot))
     127      allocate(qsurfS(ip1jmp1,nqtot))
    120128
    121129      fichnom = 'start.nc'
    122       CALL dynetat0(fichnom,nqmx,vcov,ucov,teta,q,masse,
     130      CALL dynetat0(fichnom,nqtot,vcov,ucov,teta,q,masse,
    123131     .       ps,phis,timedyn)
    124132
     
    127135      Lmodif=0
    128136
    129       CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,nqmx,day_ini_fi,timefi,
     137      CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,nqtot,day_ini_fi,timefi,
    130138     .      tsurf,tsoil,emis,q2,qsurf,co2ice)
    131139
     
    233241      call gr_fi_dyn(1,ngridmx,iip1,jjp1,emis,emisS)
    234242      call gr_fi_dyn(llm+1,ngridmx,iip1,jjp1,q2,q2S)
    235       call gr_fi_dyn(nqmx,ngridmx,iip1,jjp1,qsurf,qsurfS)
     243      call gr_fi_dyn(nqtot,ngridmx,iip1,jjp1,qsurf,qsurfS)
    236244
    237245c=======================================================================
     
    334342
    335343c-----------------------------------------------------------------------
    336 c Ecriture du champs  q  ( q[1,nqmx] )
    337 c-----------------------------------------------------------------------
    338       do iq=1,nqmx
     344c Ecriture du champs  q  ( q[1,nqtot] )
     345c-----------------------------------------------------------------------
     346      do iq=1,nqtot
    339347c       write(str2,'(i2.2)') iq
    340348c        call write_archive(nid,ntime,'q'//str2,'tracer','kg/kg',
     
    344352      end do
    345353c-----------------------------------------------------------------------
    346 c Ecriture du champs  qsurf  ( qsurf[1,nqmx] )
    347 c-----------------------------------------------------------------------
    348       do iq=1,nqmx
     354c Ecriture du champs  qsurf  ( qsurf[1,nqtot] )
     355c-----------------------------------------------------------------------
     356      do iq=1,nqtot
    349357c       write(str2,'(i2.2)') iq
    350358c       call write_archive(nid,ntime,'qsurf'//str2,'Tracer on surface',
  • trunk/LMDZ.MARS/libf/dyn3d/test_period.F

    r1005 r1036  
    66c                           teta, q , p et phis                 ..........
    77c
    8 c     IMPLICIT NONE
     8      use infotrac,only: nqtot
     9      IMPLICIT NONE
    910c
    1011#include "dimensions.h"
     
    1415c
    1516      REAL ucov(ip1jmp1,llm), vcov(ip1jm,llm), teta(ip1jmp1,llm) ,
    16      ,      q(ip1jmp1,llm,nqmx), p(ip1jmp1,llmp1), phis(ip1jmp1)
     17     ,      q(ip1jmp1,llm,nqtot), p(ip1jmp1,llmp1), phis(ip1jmp1)
    1718c
    1819c   .....  Variables  locales  .....
     
    5657     
    5758c
    58       DO nq =1, nqmx
     59      DO nq =1, nqtot
    5960        DO l =1, llm
    6061          DO ij = 1, ip1jmp1, iip1
  • trunk/LMDZ.MARS/libf/grid/dimension/makdim

    r38 r1036  
    1 nqmx=$1
    2 shift
     1
    32for i in $* ; do
    43   list=$list.$i
    54done
    6 fichdim=dimensions${list}.t${nqmx}
     5fichdim=dimensions${list}
    76
    87
     
    1514   lm=$3
    1615   n2=$1
    17    ndm=1
     16#   ndm=1
    1817
    1918#  while [ "$n2" -gt 2 ]; do
     
    3029       jm=$1
    3130      lm=$2
    32       ndm=1
     31#      ndm=1
    3332 else if [ $# -ge 1 ] ; then
    3433         im=1
    3534         jm=1
    3635         lm=$1
    37          ndm=1
     36#         ndm=1
    3837 else
    3938         echo il faut au moins une dimension
     
    4948!   dimensions.h contient les dimensions du modele
    5049!   ndm est tel que iim=2**ndm
    51 !   nqmx est la dimension de la variable traceur q
    5250!-----------------------------------------------------------------------
    5351
    54       INTEGER, parameter :: iim= $im
     52      INTEGER, parameter :: iim=$im
    5553      INTEGER, parameter :: jjm=$jm
    5654      INTEGER, parameter :: llm=$lm
    57       INTEGER, parameter :: ndm=$ndm
    58 
    59       integer, parameter :: nqmx=$nqmx
    6055
    6156!-----------------------------------------------------------------------
  • trunk/LMDZ.MARS/libf/phymars/aeropacity.F

    r677 r1036  
    44                                                   
    55! to use  'getin'
    6       USE ioipsl_getincom
     6      USE ioipsl_getincom, only: getin
     7      use tracer_mod, only: noms, igcm_h2o_ice, igcm_dust_mass,
     8     &                      igcm_dust_submicron, rho_dust, rho_ice
    79       IMPLICIT NONE
    810c=======================================================================
     
    5355#include "dimradmars.h"
    5456#include "yomaer.h"
    55 #include "tracer.h"
     57!#include "tracer.h"
    5658#include "planete.h"
    5759#include "aerkind.h"
     
    119121
    120122! indexes of water ice and dust tracers:
    121       INTEGER,SAVE :: nqdust(nqmx) ! to store the indexes of dust tracers
     123      INTEGER,ALLOCATABLE,SAVE :: nqdust(:) ! to store the indexes of dust tracers
    122124      INTEGER,SAVE :: i_ice=0  ! water ice
    123125      real,parameter :: odpref=610. ! DOD reference pressure (Pa)
     
    143145        ENDDO
    144146        ! identify tracers which are dust
     147        allocate(nqdust(nq))
    145148        i=0
    146149        DO iq=1,nq
  • trunk/LMDZ.MARS/libf/phymars/callradite.F

    r740 r1036  
    272272          name_iaer(1) = "dust_conrath"   !! default choice is good old Conrath profile
    273273          IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme
    274           if (nqmx.gt.1) then
     274          if (nq.gt.1) then
    275275           ! trick to avoid problems compiling with 1 tracer
    276276           ! and picky compilers who know name_iaer(2) is out of bounds
     
    278278          IF (water.AND.activice) name_iaer(j) = "h2o_ice"      !! radiatively-active clouds
    279279          IF (submicron.AND.active) name_iaer(j) = "dust_submicron" !! JBM experimental stuff
    280           endif ! of if (nqmx.gt.1)
     280          endif ! of if (nq.gt.1)
    281281c        ----------------------------------------------------------
    282282
  • trunk/LMDZ.MARS/libf/phymars/callsedim.F

    r1005 r1036  
    55     &                tau,tauscaling)
    66! to use  'getin'
    7       USE ioipsl_getincom
    8       USE updaterad,only: updaterdust,updaterice_micro,updaterice_typ
     7      USE ioipsl_getincom, only: getin
     8      USE updaterad, only: updaterdust,updaterice_micro,updaterice_typ
     9      USE tracer_mod, only: noms, igcm_dust_mass, igcm_dust_number,
     10     &                      rho_dust, rho_q, radius, varian,
     11     &                      igcm_ccn_mass, igcm_ccn_number,
     12     &                      igcm_h2o_ice, nuice_sed, nuice_ref
    913      IMPLICIT NONE
    1014
     
    2832#include "dimphys.h"
    2933#include "comcstfi.h"
    30 #include "tracer.h"
     34!#include "tracer.h"
    3135#include "callkeys.h"
    3236
  • trunk/LMDZ.MARS/libf/phymars/calltherm_interface.F90

    r1033 r1036  
    4545
    4646      use comtherm_h
     47      use tracer_mod, only: nqmx,noms
    4748      implicit none
    4849
  • trunk/LMDZ.MARS/libf/phymars/convadj.F

    r161 r1036  
    66     &                   pdqadj)
    77
     8      use tracer_mod, only: noms, ! tracer names
     9     &                      igcm_h2o_vap ! index of water vapor tracer
    810      implicit none
    911
     
    3335#include "comcstfi.h"
    3436#include "callkeys.h"
    35 #include "tracer.h"
     37!#include "tracer.h"
    3638
    3739
     
    7375      INTEGER iq,ico2
    7476      save ico2
    75       REAL zq(ngridmx,nlayermx,nqmx), zq2(ngridmx,nlayermx,nqmx)
    76       REAL zqm(nqmx),zqco2m
     77      REAL zq(ngridmx,nlayermx,nq), zq2(ngridmx,nlayermx,nq)
     78      REAL zqm(nq),zqco2m
    7779      real m_co2, m_noco2, A , B
    7880      save A, B
     
    101103        if (tracer) then
    102104!     Prepare Special treatment if one of the tracers is CO2 gas
    103            do iq=1,nqmx
     105           do iq=1,nq
    104106             if (noms(iq).eq."co2") then
    105107                ico2=iq
  • trunk/LMDZ.MARS/libf/phymars/dustdevil.F

    r224 r1036  
    11      SUBROUTINE dustdevil(ngrid,nlay,nq, pplev,pu,pv,pt, ptsurf,pq2,
    22     &                pdqdev,pdqs_dev)
     3
     4      use tracer_mod, only: alpha_devil
    35      IMPLICIT NONE
    46
     
    3234#include "surfdat.h"
    3335#include "comgeomfi.h"
    34 #include "tracer.h"
     36!#include "tracer.h"
    3537c   arguments:
    3638c   ----------
  • trunk/LMDZ.MARS/libf/phymars/dustlift.F

    r310 r1036  
    22     $                  pcdh_true,pcdh,co2ice,
    33     $                  dqslift)
     4
     5      use tracer_mod, only: alpha_lift, radius
    46      IMPLICIT NONE
    57
     
    1921#include "dimphys.h"
    2022#include "comcstfi.h"
    21 #include "tracer.h"
     23!#include "tracer.h"
    2224
    2325c
  • trunk/LMDZ.MARS/libf/phymars/growthrate.F

    r633 r1036  
    11      subroutine growthrate(temp,pmid,psat,rcrystal,res)
    22
     3      use tracer_mod, only: rho_ice
    34      IMPLICIT NONE
    45
     
    2122#include "dimphys.h"
    2223#include "comcstfi.h"
    23 #include "tracer.h"
     24!#include "tracer.h"
    2425#include "microphys.h"
    2526
  • trunk/LMDZ.MARS/libf/phymars/improvedclouds.F

    r1020 r1036  
    66      USE ioipsl_getincom
    77      USE updaterad
     8      use tracer_mod, only: rho_ice, nuice_sed, igcm_h2o_vap,
     9     &                      igcm_h2o_ice, igcm_dust_mass,
     10     &                      igcm_dust_number, igcm_ccn_mass,
     11     &                      igcm_ccn_number
    812      implicit none
    913     
     
    3337#include "comcstfi.h"
    3438#include "callkeys.h"
    35 #include "tracer.h"
     39!#include "tracer.h"
    3640#include "comgeomfi.h"
    3741#include "dimradmars.h"
     
    7377      INTEGER ig,l,i
    7478     
    75       REAL zq(ngridmx,nlayermx,nqmx)  ! local value of tracers
    76       REAL zq0(ngridmx,nlayermx,nqmx) ! local initial value of tracers
     79      REAL zq(ngridmx,nlayermx,nq)  ! local value of tracers
     80      REAL zq0(ngridmx,nlayermx,nq) ! local initial value of tracers
    7781      REAL zt(ngridmx,nlayermx)       ! local value of temperature
    7882      REAL zqsat(ngridmx,nlayermx)    ! saturation
  • trunk/LMDZ.MARS/libf/phymars/inifis.F

    r1028 r1036  
    11      SUBROUTINE inifis(
    2      $           ngrid,nlayer
     2     $           ngrid,nlayer,nq
    33     $           ,day_ini,pdaysec,ptimestep
    44     $           ,plat,plon,parea
     
    4646!   -------------
    4747! to use  'getin'
    48       USE ioipsl_getincom
     48      USE ioipsl_getincom, only : getin
     49      use tracer_mod, only : nqmx, nuice_sed, ccn_factor
     50     
    4951      IMPLICIT NONE
    5052#include "dimensions.h"
     
    6264#include "slope.h"
    6365#include "microphys.h"
    64 #include "tracer.h"
     66!#include "tracer.h"
    6567#ifdef MESOSCALE
    6668#include "comsoil.h"     !!MESOSCALE -- needed to fill volcapa
    6769#include "meso_inc/meso_inc_inifisvar.F"
    6870#endif
    69       REAL prad,pg,pr,pcpp,pdaysec
    70 
    71       REAL ptimestep
    72       INTEGER day_ini
    73 
    74       INTEGER ngrid,nlayer
    75       REAL plat(ngrid),plon(ngrid),parea(ngridmx)
     71      REAL,INTENT(IN) :: prad,pg,pr,pcpp,pdaysec
     72
     73      REAL,INTENT(IN) :: ptimestep
     74      INTEGER,INTENT(IN) :: day_ini
     75
     76      INTEGER,INTENT(IN) :: ngrid,nlayer,nq
     77      REAL,INTENT(IN) :: plat(ngrid),plon(ngrid),parea(ngrid)
    7678      INTEGER ig,ierr
    7779 
     
    9597      daysec=pdaysec
    9698      dtphys=ptimestep
     99
     100      nqmx=nq
     101
    97102#ifdef MESOSCALE
    98103#include "meso_inc/meso_inc_inifisini.F"
     
    375380           stop
    376381         endif
    377          if (doubleq.and.submicron.and.(nqmx.LT.3)) then
     382         if (doubleq.and.submicron.and.(nq.LT.3)) then
    378383           print*,'If doubleq is used with a submicron tracer,'
    379384           print*,' then the number of tracers has to be'
     
    804809!         print*,' 1 water vapour tracer'
    805810!         print*,' 1 water ice tracer'
    806 !         print*,nqmx-4,' chemistry tracers'
     811!         print*,nq-4,' chemistry tracers'
    807812!       endif
    808813!
     
    812817!         print*,' 1 water vapour tracer'
    813818!         print*,' 1 water ice tracer'
    814 !         if (nqmx.LT.4) then
    815 !           print*,'nqmx should be at least equal to'
     819!         if (nq.LT.4) then
     820!           print*,'nq should be at least equal to'
    816821!           print*,'4 with these options.'
    817822!           stop
     
    824829!           print*,dustbin,' dust bins'
    825830!         endif
    826 !         print*,nqmx-2-dustbin,' chemistry tracers'
     831!         print*,nq-2-dustbin,' chemistry tracers'
    827832!         print*,' 1 water vapour tracer'
    828833!         print*,' 1 water ice tracer'
     
    836841!         print*,' 1 water vapour tracer'
    837842!         print*,' 1 water ice tracer'
    838 !         if (nqmx.gt.(dustbin+2)) then
    839 !           print*,'nqmx should be ',(dustbin+2),
     843!         if (nq.gt.(dustbin+2)) then
     844!           print*,'nq should be ',(dustbin+2),
    840845!     $            ' with these options...'
    841846!                  print*,'(or check callphys.def)'
    842847!         endif
    843 !         if (nqmx.lt.(dustbin+2)) then
    844 !           write(*,*) "inifis: nqmx.lt.(dustbin+2)"
     848!         if (nq.lt.(dustbin+2)) then
     849!           write(*,*) "inifis: nq.lt.(dustbin+2)"
    845850!           stop
    846851!         endif
  • trunk/LMDZ.MARS/libf/phymars/initracer.F

    r1005 r1036  
    1       SUBROUTINE initracer(qsurf,co2ice)
    2 
     1      SUBROUTINE initracer(ngrid,nq,qsurf,co2ice)
     2
     3       use infotrac, only: tnom
     4       use tracer_mod
    35       IMPLICIT NONE
    46c=======================================================================
     
    1113c
    1214c   Test of dimension :
    13 c   Initialize COMMON tracer in tracer.h, using tracer names provided
    14 c   by the dynamics in "advtrac.h"
     15c   Initialize tracer related data in tracer_mod, using tracer names provided
     16c   by the dynamics in "infotrac"
    1517c
    1618c
     
    2628#include "comcstfi.h"
    2729#include "callkeys.h"
    28 #include "tracer.h"
    29 #include "advtrac.h"
     30!#include "tracer.h"
     31!#include "advtrac.h"
    3032#include "comgeomfi.h"
    3133
    3234#include "surfdat.h"
    3335
    34       real qsurf(ngridmx,nqmx)       ! tracer on surface (e.g.  kg.m-2)
    35       real co2ice(ngridmx)           ! co2 ice mass on surface (e.g.  kg.m-2)
     36      integer,intent(in) :: ngrid ! number of atmospheric columns
     37      integer,intent(in) :: nq ! number of tracers
     38      real,intent(out) :: qsurf(ngrid,nq) ! tracer on surface (e.g.  kg.m-2)
     39      real,intent(out) :: co2ice(ngrid) ! co2 ice mass on surface (e.g.  kg.m-2)
     40
    3641      integer iq,ig,count
    3742      real r0_lift , reff_lift, nueff_lift
     
    4348
    4449c-----------------------------------------------------------------------
    45 c  radius(nqmx)      ! aerosol particle radius (m)
    46 c  rho_q(nqmx)       ! tracer densities (kg.m-3)
    47 c  alpha_lift(nqmx)  ! saltation vertical flux/horiz flux ratio (m-1)
    48 c  alpha_devil(nqmx) ! lifting coeeficient by dust devil
     50c  radius(nq)      ! aerosol particle radius (m)
     51c  rho_q(nq)       ! tracer densities (kg.m-3)
     52c  alpha_lift(nq)  ! saltation vertical flux/horiz flux ratio (m-1)
     53c  alpha_devil(nq) ! lifting coeeficient by dust devil
    4954c  rho_dust          ! Mars dust density
    5055c  rho_ice           ! Water ice density
     
    5560c-----------------------------------------------------------------------
    5661
     62! Initialization: allocate arrays in tracer_mod
     63      allocate(noms(nq))
     64      allocate(mmol(nq))
     65      allocate(radius(nq))
     66      allocate(rho_q(nq))
     67      allocate(alpha_lift(nq))
     68      allocate(alpha_devil(nq))
     69      allocate(dryness(ngridmx))
     70      allocate(igcm_dustbin(nq))
     71
    5772! Initialization: get tracer names from the dynamics and check if we are
    5873!                 using 'old' tracer convention ('q01',q02',...)
     
    6075      ! check if tracers have 'old' names
    6176      count=0
    62       do iq=1,nqmx
     77      do iq=1,nq
    6378        txt=" "
    6479        write(txt,'(a1,i2.2)') 'q',iq
     
    6681          count=count+1
    6782        endif
    68       enddo ! of do iq=1,nqmx
     83      enddo ! of do iq=1,nq
    6984     
    70       if (count.eq.nqmx) then
     85      if (count.eq.nq) then
    7186        write(*,*) "initracer: tracers seem to follow old naming ",
    7287     &             "convention (q01,q02,...)"
     
    7691
    7792      ! copy tracer names from dynamics
    78       do iq=1,nqmx
     93      do iq=1,nq
    7994        noms(iq)=tnom(iq)
    8095      enddo
     
    86101! Identify tracers by their names: (and set corresponding values of mmol)
    87102      ! 0. initialize tracer indexes to zero:
    88       do iq=1,nqmx
    89         igcm_dustbin(iq)=0
    90       enddo
     103      igcm_dustbin(1:nq)=0
     104
    91105      igcm_dust_mass=0
    92106      igcm_dust_number=0
     
    130144      count=0
    131145      if (dustbin.gt.0) then
    132         do iq=1,nqmx
     146        do iq=1,nq
    133147          txt=" "
    134148          write(txt,'(a4,i2.2)')'dust',count+1
     
    138152            mmol(iq)=100.
    139153          endif
    140         enddo !do iq=1,nqmx
     154        enddo !do iq=1,nq
    141155      endif ! of if (dustbin.gt.0)
    142156      if (doubleq) then
    143         do iq=1,nqmx
     157        do iq=1,nq
    144158          if (noms(iq).eq."dust_mass") then
    145159            igcm_dust_mass=iq
     
    153167      endif ! of if (doubleq)
    154168      if (microphys) then
    155         do iq=1,nqmx
     169        do iq=1,nq
    156170          if (noms(iq).eq."ccn_mass") then
    157171            igcm_ccn_mass=iq
     
    165179      endif ! of if (microphys)
    166180      if (submicron) then
    167         do iq=1,nqmx
     181        do iq=1,nq
    168182          if (noms(iq).eq."dust_submicron") then
    169183            igcm_dust_submicron=iq
     
    174188      endif ! of if (submicron)
    175189      ! 2. find chemistry and water tracers
    176       do iq=1,nqmx
     190      do iq=1,nq
    177191        if (noms(iq).eq."co2") then
    178192          igcm_co2=iq
     
    337351        endif
    338352
    339       enddo ! of do iq=1,nqmx
     353      enddo ! of do iq=1,nq
    340354     
    341355      ! check that we identified all tracers:
    342       if (count.ne.nqmx) then
     356      if (count.ne.nq) then
    343357        write(*,*) "initracer: found only ",count," tracers"
    344         write(*,*) "               expected ",nqmx
     358        write(*,*) "               expected ",nq
    345359        do iq=1,count
    346360          write(*,*)'      ',iq,' ',trim(noms(iq))
     
    349363      else
    350364        write(*,*) "initracer: found all expected tracers, namely:"
    351         do iq=1,nqmx
     365        do iq=1,nq
    352366          write(*,*)'      ',iq,' ',trim(noms(iq))
    353367        enddo
     
    365379       ! as qsurf(i_h2o_vap) & as qsurf(i_h2o_ice), so to be clean:
    366380       if (igcm_h2o_vap.ne.0) then
    367          qsurf(1:ngridmx,igcm_h2o_vap)=0
     381         qsurf(1:ngrid,igcm_h2o_vap)=0
    368382       endif
    369383      endif
    370384
    371385c------------------------------------------------------------
    372 c     Initialize tracers .... (in tracer.h)
     386c     Initialize tracers .... (in tracer_mod)
    373387c------------------------------------------------------------
    374388      ! start by setting everything to (default) zero
    375       rho_q(1:nqmx)=0     ! tracer density (kg.m-3)
    376       radius(1:nqmx)=0.   ! tracer particle radius (m)
    377       alpha_lift(1:nqmx) =0.  ! tracer saltation vertical flux/horiz flux ratio (m-1)
    378       alpha_devil(1:nqmx)=0.  ! tracer lifting coefficient by dust devils
     389      rho_q(1:nq)=0     ! tracer density (kg.m-3)
     390      radius(1:nq)=0.   ! tracer particle radius (m)
     391      alpha_lift(1:nq) =0.  ! tracer saltation vertical flux/horiz flux ratio (m-1)
     392      alpha_devil(1:nq)=0.  ! tracer lifting coefficient by dust devils
    379393
    380394
     
    393407c       iq=1: Q mass mixing ratio, iq=2: N number mixing ratio
    394408
    395         if( (nqmx.lt.2).or.(water.and.(nqmx.lt.4)) ) then
    396           write(*,*)'initracer: nqmx is too low : nqmx=', nqmx
     409        if( (nq.lt.2).or.(water.and.(nq.lt.4)) ) then
     410          write(*,*)'initracer: nq is too low : nq=', nq
    397411          write(*,*)'water= ',water,' doubleq= ',doubleq   
    398412        end if
     
    499513         alpha_lift(igcm_h2o_vap) =0.
    500514         alpha_devil(igcm_h2o_vap)=0.
    501          if(water.and.(nqmx.ge.2)) then
     515         if(water.and.(nq.ge.2)) then
    502516           radius(igcm_h2o_ice)=3.e-6
    503517           rho_q(igcm_h2o_ice)=rho_ice
    504518           alpha_lift(igcm_h2o_ice) =0.
    505519           alpha_devil(igcm_h2o_ice)=0.
    506          elseif(water.and.(nqmx.lt.2)) then
    507             write(*,*) 'nqmx is too low : nqmx=', nqmx
     520         elseif(water.and.(nq.lt.2)) then
     521            write(*,*) 'nq is too low : nq=', nq
    508522            write(*,*) 'water= ',water
    509523         endif
  • trunk/LMDZ.MARS/libf/phymars/newcondens.F

    r890 r1036  
    66     $                  fluxsurf_sw,zls)
    77                                                   
     8       use tracer_mod, only: noms
    89       IMPLICIT NONE
    910c=======================================================================
     
    6162#include "paramet.h"
    6263#include "callkeys.h"
    63 #include "tracer.h"
     64!#include "tracer.h"
    6465
    6566c-----------------------------------------------------------------------
     
    195196         if (tracer) then
    196197c          Prepare Special treatment if one of the tracer is CO2 gas
    197            do iq=1,nqmx
     198           do iq=1,nq
    198199             if (noms(iq).eq."co2") then
    199200                ico2=iq
     
    238239      END DO
    239240         
    240       DO iq=1,nqmx         
     241      DO iq=1,nq
    241242      DO l=1,nlayer
    242243         DO ig=1,ngrid
     
    531532             zu(l)   =pu(ig,l)   +pdu( ig,l)  *ptimestep
    532533             zv(l)   =pv(ig,l)   +pdv( ig,l)  *ptimestep
    533             do iq=1,nqmx
     534            do iq=1,nq
    534535             zq(l,iq)=pq(ig,l,iq)+pdq(ig,l,iq)*ptimestep
    535536            enddo
     
    564565            zum(1) = 0 
    565566            zvm(1) = 0 
    566             do iq=1,nqmx
     567            do iq=1,nq
    567568              zqm(1,iq)=0. ! most tracer do not condense !
    568569            enddo
     
    577578            call vl1d(zu ,2.,masse,w,zum)
    578579            call vl1d(zv ,2.,masse,w,zvm)
    579             do iq=1,nqmx
     580            do iq=1,nq
    580581             do l=1,nlayer
    581582              zq1(l)=zq(l,iq)
     
    602603            zum(nlayer+1)= zu(nlayer)  ! should not be used, but...
    603604            zvm(nlayer+1)= zv(nlayer)  ! should not be used, but...
    604             do iq=1,nqmx
     605            do iq=1,nq
    605606             zqm(nlayer+1,iq)= zq(nlayer,iq)
    606607            enddo
     
    637638
    638639c           Tendencies on Q
    639             do iq=1,nqmx
     640            do iq=1,nq
    640641!              if (noms(iq).eq.'co2') then
    641642              if (iq.eq.ico2) then
     
    668669             if(pq(ig,1,ico2)+(pdq(ig,1,ico2)+pdqc(ig,1,ico2))*ptimestep
    669670     &       .lt.qco2min) then
    670                 do iq=1,nqmx
     671                do iq=1,nq
    671672                  zq(1,iq)=pq(ig,1,iq)
    672673     &                     +(pdq(ig,1,iq)+pdqc(ig,1,iq))*ptimestep
     
    675676                Sm(1)  = masse(1)
    676677                do l =2,nlayermx
    677                   do iq=1,nqmx
     678                  do iq=1,nq
    678679                     zq(l,iq)=pq(ig,l,iq)
    679680     &                        +(pdq(ig,l,iq)+pdqc(ig,l,iq))*ptimestep
     
    693694                 end do
    694695 99              continue
    695                  do iq=1,nqmx
     696                 do iq=1,nq
    696697                   qmix=zq(nmix,iq)
    697698     &             +(Smq(nmix-1,iq)-zq(nmix,iq)*Sm(nmix-1))/mixmas
  • trunk/LMDZ.MARS/libf/phymars/nirco2abs.F

    r690 r1036  
    22     $     mu0,fract,declin,pdtnirco2)
    33                                                   
     4       use tracer_mod, only: igcm_co2, igcm_o
    45       IMPLICIT NONE
    56c=======================================================================
     
    5051#include "comdiurn.h"
    5152#include "nirdata.h"
    52 #include "tracer.h"
     53!#include "tracer.h"
    5354
    5455c-----------------------------------------------------------------------
  • trunk/LMDZ.MARS/libf/phymars/nltecool.F

    r472 r1036  
    3030c***************************************************************************
    3131
     32      use tracer_mod, only: igcm_co2, igcm_co, igcm_o, igcm_n2, mmol
    3233      implicit none
    3334
     
    3738#include "chimiedata.h"
    3839#include "conc.h" !Added to have "dynamic composition" in the scheme
    39 #include "tracer.h" !"
     40!#include "tracer.h" !"
    4041#include "callkeys.h"
    4142
  • trunk/LMDZ.MARS/libf/phymars/nuclea.F

    r706 r1036  
    1717#include "dimphys.h"
    1818#include "comcstfi.h"
    19 #include "tracer.h"
     19!#include "tracer.h"
    2020#include "microphys.h"
    2121
  • trunk/LMDZ.MARS/libf/phymars/phyetat0.F

    r999 r1036  
    44
    55      use netcdf
     6      use infotrac, only: nqtot, tnom
    67
    78      implicit none
     
    2526#include "comcstfi.h"
    2627!#include "tracer.h"
    27 #include "advtrac.h"
     28!#include "advtrac.h"
    2829#include "control.h"
    2930c======================================================================
     
    9697!                    qsurf02, ...)
    9798      count=0
    98       do iq=1,nqmx
     99      do iq=1,nqtot
    99100        txt= " "
    100101        write(txt,'(a5,i2.2)')'qsurf',iq
     
    108109        endif
    109110      enddo
    110       if (count.eq.nqmx) then
     111      if (count.eq.nqtot) then
    111112        write(*,*) "phyetat0:tracers seem to follow old naming ",
    112113     &             "convention (qsurf01,qsurf02,...)"
     
    650651c        case when new tracer are added in addition to old ones
    651652             write(*,*)'qsurf 1 to ', nqold,'were already present'
    652              write(*,*)'qsurf ', nqold+1,' to ', nqmx,'are new'
     653             write(*,*)'qsurf ', nqold+1,' to ', nqtot,'are new'
    653654!            yes=' '
    654655!            do while ((yes.ne.'y').and.(yes.ne.'n'))
    655656!             write(*,*) 'Would you like to reindex qsurf # 1 ->',nqold
    656 !             write(*,*) 'to #',nqmx-nqold+1,'->', nqmx,'   (y or n) ?'
     657!             write(*,*) 'to #',nqtot-nqold+1,'->', nqtot,'   (y or n) ?'
    657658!             read(*,fmt='(a)') yes
    658659!            end do
     
    660661!              write(*,*) 'OK, let s reindex qsurf'
    661662!                 do ig=1,ngridmx
    662 !                    do iq=nqmx,nqmx-nqold+1,-1
    663 !                       qsurf(ig,iq)=qsurf(ig,iq-nqmx+nqold)
     663!                    do iq=nqtot,nqtot-nqold+1,-1
     664!                       qsurf(ig,iq)=qsurf(ig,iq-nqtot+nqold)
    664665!                    end do
    665 !                    do iq=nqmx-nqold,1,-1
     666!                    do iq=nqtot-nqold,1,-1
    666667!                       qsurf(ig,iq)= 0.
    667668!                    end do
  • trunk/LMDZ.MARS/libf/phymars/physdem.F

    r999 r1036  
    33     .                   alb,ith,pzmea,pzstd,pzsig,pzgam,pzthe)
    44
     5      use infotrac, only: nqtot, tnom
    56      implicit none
    67c
     
    3233#include "netcdf.inc"
    3334#include "dimphys.h"
    34 #include "advtrac.h"
     35!#include "advtrac.h"
    3536#include "callkeys.h"
    3637c
     
    585586!                    qsurf02, ...)
    586587      count=0
    587       do iq=1,nqmx
     588      do iq=1,nqtot
    588589        txt= " "
    589590        write(txt,'(a1,i2.2)')'q',iq
     
    596597        endif
    597598      enddo
    598       if (count.eq.nqmx) then
     599      if (count.eq.nqtot) then
    599600        write(*,*) "physdem0:tracers seem to follow old naming ",
    600601     &             "convention (qsurf01,qsurf02,...)"
     
    602603        write(*,*) "     but you should run newstart to rename them"
    603604        oldtracernames=.true.
    604       endif ! of if (count.eq.nqmx)
     605      endif ! of if (count.eq.nqtot)
    605606
    606607      IF(nq.GE.1) THEN
     
    693694     .                   phystep,time,
    694695     .                   tsurf,tsoil,co2ice,emis,q2,qsurf)
     696      use infotrac, only: nqtot, tnom
    695697      implicit none
    696698c
     
    720722#include "netcdf.inc"
    721723#include "dimphys.h"
    722 #include "advtrac.h"
     724!#include "advtrac.h"
    723725#include "callkeys.h"
    724726c
     
    918920      IF (firstcall) THEN
    919921        count=0
    920         do iq=1,nqmx
     922        do iq=1,nqtot
    921923          txt= " "
    922924          write(txt,'(a1,i2.2)')'q',iq
     
    929931          endif
    930932        enddo
    931         if (count.eq.nqmx) then
     933        if (count.eq.nqtot) then
    932934          write(*,*) "physdem1:tracers seem to follow old naming ",
    933935     &               "convention (qsurf01,qsurf02,...)"
     
    935937          write(*,*) "     but you should run newstart to rename them"
    936938          oldtracernames=.true.
    937         endif ! of if (count.eq.nqmx)
     939        endif ! of if (count.eq.nqtot)
    938940      ENDIF ! of if(firstcall)
    939941     
    940942      ! If computing water cycle with ice, move surface ice
    941       ! back to qsurf(nqmx)
     943      ! back to qsurf(nqtot)
    942944      IF (oldtracernames .and. water) THEN
    943945       !"loop" to avoid potential out-of-bounds on arrays
    944         write(*,*)'physdem1: moving surface water ice to index ',nqmx
    945         do iq=nqmx,nqmx
     946        write(*,*)'physdem1: moving surface water ice to index ',nqtot
     947        do iq=nqtot,nqtot
    946948          qsurf(1:ngridmx,iq)=qsurf(1:ngridmx,iq-1)
    947949          qsurf(1:ngridmx,iq-1)=0
  • trunk/LMDZ.MARS/libf/phymars/physiq.F

    r1032 r1036  
    1212     $            )
    1313
    14 
     14      use tracer_mod, only: noms, mmol, igcm_co2, igcm_n2,
     15     &                      igcm_co, igcm_o, igcm_h2o_vap, igcm_h2o_ice,
     16     &                      igcm_ccn_mass, igcm_ccn_number,
     17     &                      igcm_dust_mass, igcm_dust_number, igcm_h2o2,
     18     &                      nuice_ref, rho_ice, rho_dust, ref_r0
     19
     20#ifdef MESOSCALE
     21      use infotrac !!! this is necessary for tracers
     22#endif
    1523      IMPLICIT NONE
    1624c=======================================================================
     
    103111c    pdv(ngrid,nlayermx)       |  Temporal derivative of the corresponding
    104112c    pdt(ngrid,nlayermx)       |  variables due to physical processes.
    105 c    pdq(ngrid,nlayermx,nqmx)  |
     113c    pdq(ngrid,nlayermx,nq  |
    106114c    pdpsrf(ngrid)             |
    107115c    tracerdyn                 call tracer in dynamical part of GCM ?
     
    126134#include "dimradmars.h"
    127135#include "comg1d.h"
    128 #include "tracer.h"
     136!#include "tracer.h"
    129137#include "nlteparams.h"
    130138#include "comvert.h"
     
    142150#include "wrf_output_2d.h"
    143151#include "wrf_output_3d.h"
    144 #include "advtrac.h"   !!! this is necessary for tracers (in dyn3d)
     152!#include "advtrac.h"   !!! this is necessary for tracers (in dyn3d)
    145153#include "meso_inc/meso_inc_var.F"
    146154#endif
     
    192200      REAL capcal(ngridmx)           ! surface heat capacity (J m-2 K-1)
    193201      REAL fluxgrd(ngridmx)          ! surface conduction flux (W.m-2)
    194       REAL qsurf(ngridmx,nqmx)      ! tracer on surface (e.g. kg.m-2)
     202      REAL,ALLOCATABLE,SAVE :: qsurf(:,:) ! tracer on surface (e.g. kg.m-2)
    195203      REAL q2(ngridmx,nlayermx+1)    ! Turbulent Kinetic Energy
    196204     
     
    217225      SAVE aerosol, tsurf,tsoil
    218226      SAVE co2ice,albedo,emis, q2
    219       SAVE capcal,fluxgrd,dtrad,fluxrad,fluxrad_sky,qsurf
     227      SAVE capcal,fluxgrd,dtrad,fluxrad,fluxrad_sky
    220228
    221229      REAL stephan   
     
    229237      EXTERNAL CBRT
    230238
    231       CHARACTER*80 fichier
    232       INTEGER l,ig,ierr,igout,iq,i, tapphys
     239!      CHARACTER*80 fichier
     240      INTEGER l,ig,ierr,igout,iq,tapphys
    233241
    234242      REAL fluxsurf_lw(ngridmx)      !incident LW (IR) surface flux (W.m-2)
     
    243251      REAL zzlay(ngridmx,nlayermx)   ! altitude at the middle of the layers
    244252      REAL zzlev(ngridmx,nlayermx+1) ! altitude at layer boundaries
    245       REAL latvl1,lonvl1             ! Viking Lander 1 point (for diagnostic)
     253!      REAL latvl1,lonvl1             ! Viking Lander 1 point (for diagnostic)
    246254
    247255c     Tendancies due to various processes:
    248       REAL dqsurf(ngridmx,nqmx)
     256      REAL dqsurf(ngridmx,nq)
    249257      REAL zdtlw(ngridmx,nlayermx)     ! (K/s)
    250258      REAL zdtsw(ngridmx,nlayermx)     ! (K/s)
    251       REAL cldtlw(ngridmx,nlayermx)     ! (K/s) LW heating rate for clear area
    252       REAL cldtsw(ngridmx,nlayermx)     ! (K/s) SW heating rate for clear area
     259!      REAL cldtlw(ngridmx,nlayermx)     ! (K/s) LW heating rate for clear area
     260!      REAL cldtsw(ngridmx,nlayermx)     ! (K/s) SW heating rate for clear area
    253261      REAL zdtnirco2(ngridmx,nlayermx) ! (K/s)
    254262      REAL zdtnlte(ngridmx,nlayermx)   ! (K/s)
     
    264272      REAL zdvc(ngridmx,nlayermx),zduc(ngridmx,nlayermx)
    265273
    266       REAL zdqdif(ngridmx,nlayermx,nqmx), zdqsdif(ngridmx,nqmx)
    267       REAL zdqsed(ngridmx,nlayermx,nqmx), zdqssed(ngridmx,nqmx)
    268       REAL zdqdev(ngridmx,nlayermx,nqmx), zdqsdev(ngridmx,nqmx)
    269       REAL zdqadj(ngridmx,nlayermx,nqmx)
    270       REAL zdqc(ngridmx,nlayermx,nqmx)
    271       REAL zdqcloud(ngridmx,nlayermx,nqmx)
    272       REAL zdqscloud(ngridmx,nqmx)
    273       REAL zdqchim(ngridmx,nlayermx,nqmx)
    274       REAL zdqschim(ngridmx,nqmx)
     274      REAL zdqdif(ngridmx,nlayermx,nq), zdqsdif(ngridmx,nq)
     275      REAL zdqsed(ngridmx,nlayermx,nq), zdqssed(ngridmx,nq)
     276      REAL zdqdev(ngridmx,nlayermx,nq), zdqsdev(ngridmx,nq)
     277      REAL zdqadj(ngridmx,nlayermx,nq)
     278      REAL zdqc(ngridmx,nlayermx,nq)
     279      REAL zdqcloud(ngridmx,nlayermx,nq)
     280      REAL zdqscloud(ngridmx,nq)
     281      REAL zdqchim(ngridmx,nlayermx,nq)
     282      REAL zdqschim(ngridmx,nq)
    275283
    276284      REAL zdteuv(ngridmx,nlayermx)    ! (K/s)
     
    278286      REAL zdumolvis(ngridmx,nlayermx)
    279287      REAL zdvmolvis(ngridmx,nlayermx)
    280       real zdqmoldiff(ngridmx,nlayermx,nqmx)
     288      real zdqmoldiff(ngridmx,nlayermx,nq)
    281289
    282290c     Local variable for local intermediate calcul:
     
    295303      REAL ps(ngridmx), zt(ngridmx,nlayermx)
    296304      REAL zu(ngridmx,nlayermx),zv(ngridmx,nlayermx)
    297       REAL zq(ngridmx,nlayermx,nqmx)
     305      REAL zq(ngridmx,nlayermx,nq)
    298306      REAL fluxtop_sw_tot(ngridmx), fluxsurf_sw_tot(ngridmx)
    299307      character*2 str2
    300       character*5 str5
     308!      character*5 str5
    301309      real zdtdif(ngridmx,nlayermx), zdtadj(ngridmx,nlayermx)
    302310      REAL tauscaling(ngridmx)   ! Convertion factor for qdust and Ndust
     
    310318      ! instead, use zplay and zplev :
    311319      REAL zplev(ngrid,nlayermx+1),zplay(ngrid,nlayermx)
    312       REAL zstress(ngrid), cd
    313       real hco2(nqmx),tmean, zlocal(nlayermx)
     320!      REAL zstress(ngrid),cd
     321      real tmean, zlocal(nlayermx)
    314322      real rho(ngridmx,nlayermx)  ! density
    315323      real vmr(ngridmx,nlayermx)  ! volume mixing ratio
    316324      real rhopart(ngridmx,nlayermx) ! number density of a given species
    317       real colden(ngridmx,nqmx)   ! vertical column of tracers
     325      real colden(ngridmx,nq   ! vertical column of tracers
    318326      REAL mtot(ngridmx)          ! Total mass of water vapor (kg/m2)
    319327      REAL icetot(ngridmx)        ! Total mass of water ice (kg/m2)
     
    357365      REAL, SAVE :: hfmax_th(ngridmx)
    358366      REAL pdu_th(ngridmx,nlayermx),pdv_th(ngridmx,nlayermx)
    359       REAL pdt_th(ngridmx,nlayermx),pdq_th(ngridmx,nlayermx,nqmx)
     367      REAL pdt_th(ngridmx,nlayermx),pdq_th(ngridmx,nlayermx,nq)
    360368      INTEGER lmax_th(ngridmx),dimout,n_out,n
    361369      CHARACTER(50) zstring
     
    364372      REAL, ALLOCATABLE, DIMENSION(:,:) :: T_out
    365373      REAL, ALLOCATABLE, DIMENSION(:,:) :: u_out ! Interpolated teta and u at z_out
    366       REAL u_out1(ngridmx), T_out1(ngridmx)
     374!      REAL u_out1(ngridmx)
     375      REAL T_out1(ngridmx)
    367376      REAL, ALLOCATABLE, DIMENSION(:) :: z_out     ! height of interpolation between z0 and z1 [meters]
    368377      REAL ustar(ngridmx),tstar(ngridmx)  ! friction velocity and friction potential temp
    369378      REAL L_mo(ngridmx),vhf(ngridmx),vvv(ngridmx)
    370       REAL zu2(ngridmx),sensibFlux(ngridmx)
     379!      REAL zu2(ngridmx)
     380      REAL sensibFlux(ngridmx)
    371381
    372382c=======================================================================
     
    379389      IF (firstcall) THEN
    380390
     391        ! allocate local (saved) arrays:
     392        allocate(qsurf(ngrid,nq))
     393       
    381394c        variables set to 0
    382395c        ~~~~~~~~~~~~~~~~~~
     
    417430         tracerdyn=tracer
    418431         IF (tracer) THEN
    419             CALL initracer(qsurf,co2ice)
     432            CALL initracer(ngrid,nq,qsurf,co2ice)
    420433         ENDIF  ! end tracer
    421434
     
    570583
    571584      if(photochem.or.callthermos) then
    572          call concentrations(zplay,pt,pdt,pq,pdq,ptimestep)
     585         call concentrations(nq,zplay,pt,pdt,pq,pdq,ptimestep)
    573586      endif
    574587#endif
     
    12141227     $                       surfdust, surfice)
    12151228!           call photochemistry
    1216             call calchim(ptimestep,zplay,zplev,pt,pdt,dist_sol,mu0,
     1229            call calchim(nq,
     1230     &                   ptimestep,zplay,zplev,pt,pdt,dist_sol,mu0,
    12171231     $                   zzlev,zzlay,zday,pq,pdq,zdqchim,zdqschim,
    12181232     $                   zdqcloud,zdqscloud,tauref,co2ice,
  • trunk/LMDZ.MARS/libf/phymars/simpleclouds.F

    r740 r1036  
    44     &             nq,tau,rice)
    55      USE updaterad
     6      use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice
    67      implicit none
    78c------------------------------------------------------------------
     
    3233#include "comcstfi.h"
    3334#include "callkeys.h"
    34 #include "tracer.h"
     35!#include "tracer.h"
    3536#include "comgeomfi.h"
    3637#include "dimradmars.h"
     
    7374      INTEGER ig,l
    7475
    75       REAL zq(ngridmx,nlayermx,nqmx)  ! local value of tracers
    76       REAL zq0(ngridmx,nlayermx,nqmx) ! local initial value of tracers
     76      REAL zq(ngridmx,nlayermx,nq  ! local value of tracers
     77      REAL zq0(ngridmx,nlayermx,nq ! local initial value of tracers
    7778      REAL zt(ngridmx,nlayermx)       ! local value of temperature
    7879      REAL zqsat(ngridmx,nlayermx)    ! saturation
     
    9192c    -----------------
    9293
    93 c    On "update" la valeur de q(nqmx) (water vapor) et temperature.
     94c    On "update" la valeur de q(nq) (water vapor) et temperature.
    9495c    On effectue qqes calculs preliminaires sur les couches :
    9596
  • trunk/LMDZ.MARS/libf/phymars/soil_tifeedback.F

    r857 r1036  
    11      SUBROUTINE soil_tifeedback(ngrid,nsoil,icecover,newtherm_i)
     2
     3      use tracer_mod, only: nqmx, igcm_h2o_ice, rho_ice
    24      IMPLICIT NONE
    35
     
    2426#include "dimphys.h"
    2527#include "comsoil.h"
    26 #include "tracer.h"
     28!#include "tracer.h"
    2729#include "surfdat.h"
    2830
     
    4143
    4244      REAL icecover(ngrid,nqmx)         ! tracer on the surface (kg.m-2)
    43                                         ! last one (iq=nqmx) is surface
     45                                        ! (iq=igcm_h2o_ice) is surface
    4446                                        ! water ice
    4547c Outputs
  • trunk/LMDZ.MARS/libf/phymars/surfini.F

    r740 r1036  
    33      USE ioipsl_getincom
    44      use netcdf
     5      use tracer_mod, only: nqmx, noms, dryness
    56      IMPLICIT NONE
    67c=======================================================================
     
    1617#include "surfdat.h"
    1718#include "callkeys.h"
    18 #include "tracer.h"
     19!#include "tracer.h"
    1920#include "comgeomfi.h"
    2021#include "comcstfi.h"
  • trunk/LMDZ.MARS/libf/phymars/testphys1d.F

    r999 r1036  
    22      PROGRAM testphys1d
    33! to use  'getin'
    4       USE ioipsl_getincom
     4      USE ioipsl_getincom, only: getin
     5      use infotrac, only: nqtot, tnom
    56      IMPLICIT NONE
    67
     
    4243#include "comg1d.h"
    4344#include "logic.h"
    44 #include "advtrac.h"
     45!#include "advtrac.h"
    4546
    4647c --------------------------------------------------------------
     
    6465      REAL gru,grv   ! prescribed "geostrophic" background wind
    6566      REAL temp(nlayermx)   ! temperature at the middle of the layers
    66       REAL q(nlayermx,nqmx) ! tracer mixing ratio (e.g. kg/kg)
    67       REAL qsurf(nqmx)      ! tracer surface budget (e.g. kg.m-2)
     67      REAL,ALLOCATABLE :: q(:,:) ! tracer mixing ratio (e.g. kg/kg)
     68      REAL,ALLOCATABLE :: qsurf(:) ! tracer surface budget (e.g. kg.m-2)
    6869      REAL tsoil(nsoilmx)   ! subsurface soik temperature (K)
    6970      REAL co2ice           ! co2ice layer (kg.m-2)
     
    7677      REAL dudyn(nlayermx),dvdyn(nlayermx),dtempdyn(nlayermx)
    7778      REAL dpsurf   
    78       REAL dq(nlayermx,nqmx)
    79       REAL dqdyn(nlayermx,nqmx)
     79      REAL,ALLOCATABLE :: dq(:,:)
     80      REAL,ALLOCATABLE :: dqdyn(:,:)
    8081
    8182c   Various intermediate variables
     
    8485      REAL phi(nlayermx),h(nlayermx),s(nlayermx)
    8586      REAL pks, ptif, w(nlayermx)
    86       REAL qtotinit, mqtot(nqmx),qtot
     87      REAL qtotinit,qtot
     88      real,allocatable :: mqtot(:)
    8789      INTEGER ierr, aslun
    8890      REAL tmp1(0:nlayermx),tmp2(0:nlayermx)
     
    169171
    170172! while we're at it, check if there is a 'traceur.def' file
    171 ! and preocess it, if necessary. Otherwise initialize tracer names
     173! and process it.
    172174      if (tracer) then
    173175      ! load tracer names from file 'traceur.def'
     
    183185          ! read number of tracers:
    184186          read(90,*,iostat=ierr) nq
     187          nqtot=nq ! set value of nqtot (in infotrac module) as nq
    185188          if (ierr.ne.0) then
    186189            write(*,*) "testphys1d: error reading number of tracers"
    187190            write(*,*) "   (first line of traceur.def) "
    188191            stop
    189           else
    190             ! check that the number of tracers is indeed nqmx
    191             if (nq.ne.nqmx) then
    192               write(*,*) "testphys1d: error, wrong number of tracers:"
    193               write(*,*) "nq=",nq," whereas nqmx=",nqmx
    194               stop
    195             endif
    196192          endif
    197193        endif
     194        ! allocate arrays:
     195        allocate(tnom(nq))
     196        allocate(q(nlayermx,nq))
     197        allocate(qsurf(nq))
     198        allocate(dq(nlayermx,nq))
     199        allocate(dqdyn(nlayermx,nq))
     200        allocate(mqtot(nq))
     201       
    198202        ! read tracer names from file traceur.def
    199         do iq=1,nqmx
     203        do iq=1,nq
    200204          read(90,*,iostat=ierr) tnom(iq)
    201205          if (ierr.ne.0) then
     
    212216        ! "smarter" initialization of some tracers
    213217        ! (get values from "profile_*" files, if these are available)
    214         do iq=1,nqmx
     218        do iq=1,nq
    215219          txt=""
    216220          write(txt,"(a)") tnom(iq)
     
    346350            close(91)
    347351          endif ! of if (txt.eq."ccn_number")
    348         enddo ! of do iq=1,nqmx
     352        enddo ! of do iq=1,nq
    349353
    350354      else
    351       ! we still need to set (dummy) tracer names for physdem1
    352         nq=nqmx
     355      ! we still need to set (dummy) tracer number and names for physdem1
     356        nq=1
     357        ! allocate arrays:
     358        allocate(tnom(nq))
     359        allocate(q(nlayermx,nq))
     360        allocate(qsurf(nq))
     361        allocate(dq(nlayermx,nq))
     362        allocate(dqdyn(nlayermx,nq))
     363        allocate(mqtot(nq))
    353364        do iq=1,nq
    354365          write(str7,'(a1,i2.2)')'q',iq
     
    496507
    497508!Mars possible matter with dtphys in input and include!!!
    498       CALL inifis(1,llm,day0,daysec,dtphys,
     509      CALL inifis(1,llm,nq,day0,daysec,dtphys,
    499510     .            lati,long,area,rad,g,r,cpp)
    500511
     
    612623         ! thermo=0: initialize over all atmospheric layers
    613624         thermo=0
    614          call inichim_newstart(q,psurf,sig,nqmx,lati,long,area,
     625         call inichim_newstart(q,psurf,sig,nq,lati,long,area,
    615626     $   thermo,qsurf)
    616627      endif
     
    641652c  It is needed to transfert physics variables to "physiq"...
    642653
    643       call physdem0("startfi.nc",long,lati,nsoilmx,nqmx,
     654      call physdem0("startfi.nc",long,lati,nsoilmx,nq,
    644655     .              dtphys,float(day0),time,area,
    645656     .              albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe)
    646       call physdem1("startfi.nc",nsoilmx,nqmx,
     657      call physdem1("startfi.nc",nsoilmx,nq,
    647658     .              dtphys,time,
    648659     .              tsurf,tsoil,co2ice,emis,q2,qsurf)
     
    688699c       --------------------
    689700!      write(*,*) "testphys1d avant q", q(1,:)
    690       CALL physiq (1,llm,nqmx,
     701      CALL physiq (1,llm,nq,
    691702     ,     firstcall,lastcall,
    692703     ,     day,time,dtphys,
     
    749760
    750761!       increment tracers
    751         DO iq = 1, nqmx
     762        DO iq = 1, nq
    752763          DO ilayer=1,nlayer
    753764             q(ilayer,iq)=q(ilayer,iq)+dtphys*dq(ilayer,iq)
  • trunk/LMDZ.MARS/libf/phymars/updaterad.F90

    r882 r1036  
    6262! Update ice radius if microphys == true
    6363subroutine updaterice_micro(qice,qccn,nccn,coeff,rice,rhocloud)
    64 implicit none
    65 
    66 #include "dimensions.h"
    67 #include "dimphys.h"
    68 #include "comcstfi.h"
    69 #include "tracer.h"
     64use tracer_mod, only: rho_dust, rho_ice
     65implicit none
     66
     67#include "dimensions.h"
     68#include "dimphys.h"
     69#include "comcstfi.h"
     70!#include "tracer.h"
    7071
    7172real, intent(in)  :: qice,qccn,nccn
     
    118119! Update ice radius from a typical profile if microphys == false
    119120subroutine updaterice_typ(qice,tau,pzlay,rice)
    120 implicit none
    121 
    122 #include "dimensions.h"
    123 #include "dimphys.h"
    124 #include "comcstfi.h"
    125 #include "tracer.h"
     121use tracer_mod, only: rho_ice
     122implicit none
     123
     124#include "dimensions.h"
     125#include "dimphys.h"
     126#include "comcstfi.h"
     127!#include "tracer.h"
    126128
    127129real, intent(in)  :: qice
     
    175177! To be used with doubleq == true. otherwise, rdust is constant !!!
    176178subroutine updaterdust(qdust,ndust,rdust,tauscaling)
    177 implicit none
    178 
    179 #include "dimensions.h"
    180 #include "dimphys.h"
    181 #include "comcstfi.h"
    182 #include "tracer.h"
     179use tracer_mod, only: r3n_q
     180implicit none
     181
     182#include "dimensions.h"
     183#include "dimphys.h"
     184#include "comcstfi.h"
     185!#include "tracer.h"
    183186
    184187real, intent(in) :: qdust,ndust ! needed if doubleq
     
    230233! geometric mean radius = mass mean radius x exp(-1.5 sigma0^2)
    231234subroutine updaterccn(qccn,nccn,rccn,tauscaling)
    232 implicit none
    233 
    234 #include "dimensions.h"
    235 #include "dimphys.h"
    236 #include "comcstfi.h"
    237 #include "tracer.h"
     235use tracer_mod, only: rho_dust
     236implicit none
     237
     238#include "dimensions.h"
     239#include "dimphys.h"
     240#include "comcstfi.h"
     241!#include "tracer.h"
    238242
    239243real, intent(in) :: qccn,nccn ! needed if doubleq
  • trunk/LMDZ.MARS/libf/phymars/updatereffrad.F

    r744 r1036  
    44     &                pq,tauscaling,tau,pplay)
    55       USE updaterad
     6       use tracer_mod, only: nqmx, igcm_dust_mass, igcm_dust_number,
     7     &                       igcm_h2o_ice, igcm_ccn_mass, radius,
     8     &                       igcm_ccn_number, nuice_ref, varian,
     9     &                       ref_r0, igcm_dust_submicron
    610       IMPLICIT NONE
    711c=======================================================================
     
    3135#include "callkeys.h"
    3236#include "dimradmars.h"
    33 #include "tracer.h"
     37!#include "tracer.h"
    3438#include "aerkind.h"
    3539#include "yomaer.h"
  • trunk/LMDZ.MARS/libf/phymars/vdif_kc.F

    r325 r1036  
    11      SUBROUTINE vdif_kc(dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn,zq)
     2
     3      use tracer_mod, only: nqmx, noms
    24      IMPLICIT NONE
    35c.......................................................................
    46#include "dimensions.h"
    57#include "dimphys.h"
    6 #include "tracer.h"
     8!#include "tracer.h"
    79#include "callkeys.h"
    810c.......................................................................
  • trunk/LMDZ.MARS/libf/phymars/vdifc.F

    r1035 r1036  
    1111#endif
    1212     &                )
     13      use tracer_mod, only: noms, igcm_dust_mass, igcm_dust_number,
     14     &                      igcm_dust_submicron, igcm_h2o_vap,
     15     &                      igcm_h2o_ice, dryness, alpha_lift, nqmx
    1316      IMPLICIT NONE
    1417
     
    3942#include "surfdat.h"
    4043#include "comgeomfi.h"
    41 #include "tracer.h"
     44!#include "tracer.h"
    4245#include "microphys.h"
    4346
     
    4649c   ----------
    4750
    48       INTEGER ngrid,nlay
    49       REAL ptimestep
    50       REAL pplay(ngrid,nlay),pplev(ngrid,nlay+1)
    51       REAL pzlay(ngrid,nlay),pzlev(ngrid,nlay+1)
    52       REAL pu(ngrid,nlay),pv(ngrid,nlay),ph(ngrid,nlay),pt(ngrid,nlay)
    53       REAL ptsrf(ngrid),pemis(ngrid)
    54       REAL pdufi(ngrid,nlay),pdvfi(ngrid,nlay),pdhfi(ngrid,nlay)
    55       REAL pfluxsrf(ngrid)
    56       REAL pdudif(ngrid,nlay),pdvdif(ngrid,nlay),pdhdif(ngrid,nlay)
    57       REAL pdtsrf(ngrid),pcapcal(ngrid)
     51      INTEGER,INTENT(IN) :: ngrid,nlay
     52      REAL,INTENT(IN) :: ptimestep
     53      REAL,INTENT(IN) :: pplay(ngrid,nlay),pplev(ngrid,nlay+1)
     54      REAL,INTENT(IN) :: pzlay(ngrid,nlay),pzlev(ngrid,nlay+1)
     55      REAL,INTENT(IN) :: pu(ngrid,nlay),pv(ngrid,nlay)
     56      REAL,INTENT(IN) :: ph(ngrid,nlay)
     57      REAL :: pt(ngrid,nlay)
     58      REAL,INTENT(IN) :: ptsrf(ngrid),pemis(ngrid)
     59      REAL,INTENT(IN) :: pdufi(ngrid,nlay),pdvfi(ngrid,nlay)
     60      REAL,INTENT(IN) :: pdhfi(ngrid,nlay)
     61      REAL,INTENT(IN) :: pfluxsrf(ngrid)
     62      REAL,INTENT(OUT) :: pdudif(ngrid,nlay),pdvdif(ngrid,nlay)
     63      REAL,INTENT(OUT) :: pdtsrf(ngrid),pdhdif(ngrid,nlay)
     64      REAL,INTENT(IN) ::pcapcal(ngrid)
    5865      REAL pq2(ngrid,nlay+1)
    5966
    6067c    Argument added for condensation:
    61       REAL co2ice (ngrid), ppopsk(ngrid,nlay)
    62       logical lecrit
    63 
    64       REAL pz0(ngridmx) ! surface roughness length (m)
     68      REAL,INTENT(IN) :: co2ice (ngrid), ppopsk(ngrid,nlay)
     69      logical,INTENT(IN) :: lecrit
     70
     71      REAL,INTENT(IN) :: pz0(ngrid) ! surface roughness length (m)
    6572
    6673c    Argument added to account for subgrid gustiness :
    6774
    68       REAL wstar(ngridmx), hfmax(ngridmx), zi(ngridmx)
     75      REAL wstar(ngrid), hfmax(ngrid)!, zi(ngrid)
    6976
    7077c    Traceurs :
    71       integer nq
    72       REAL pqsurf(ngrid,nq)
    73       real pq(ngrid,nlay,nq), pdqfi(ngrid,nlay,nq)
    74       real pdqdif(ngrid,nlay,nq)
    75       real pdqsdif(ngrid,nq)
     78      integer,intent(in) :: nq
     79      REAL,INTENT(IN) :: pqsurf(ngrid,nq)
     80      real,intent(in) :: pq(ngrid,nlay,nq), pdqfi(ngrid,nlay,nq)
     81      real,intent(out) :: pdqdif(ngrid,nlay,nq)
     82      real,intent(out) :: pdqsdif(ngrid,nq)
    7683     
    7784c   local:
     
    99106      EXTERNAL SSUM,SCOPY
    100107      REAL SSUM
    101       LOGICAL firstcall
    102       SAVE firstcall
     108      LOGICAL,SAVE :: firstcall=.true.
    103109
    104110
     
    112118     
    113119c     For latent heat release from ground ice sublimation   
    114       REAL tsrf_lw(ngridmx)
    115       REAL alpha
     120!      REAL tsrf_lw(ngridmx)
     121!      REAL alpha
    116122      REAL T1,T2
    117123      SAVE T1,T2
     
    125131      REAL rho(ngridmx) ! near surface air density
    126132      REAL qsat(ngridmx)
    127       DATA firstcall/.true./
    128133
    129134      REAL kmixmin
     
    179184         if (tracer) then
    180185c          Prepare Special treatment if one of the tracer is CO2 gas
    181            do iq=1,nqmx
     186           do iq=1,nq
    182187             if (noms(iq).eq."co2") then
    183188                ico2=iq
     
    196201        firstcall=.false.
    197202      ENDIF
    198 
    199 
    200 
    201203
    202204
     
    398400
    399401      pt(:,:)=ph(:,:)*ppopsk(:,:)
    400       CALL yamada4(ngrid,nlay,ptimestep,g,r,pplev,pt
     402      CALL yamada4(ngrid,nlay,nq,ptimestep,g,r,pplev,pt
    401403     s   ,pzlev,pzlay,pu,pv,ph,pq,zcdv_true,pq2,zkv,zkh,zkq,ust
    402404     s   ,9)
    403 
    404405      ENDIF
    405406
     
    900901
    901902      RETURN
    902       END
     903      END SUBROUTINE vdifc
  • trunk/LMDZ.MARS/libf/phymars/watercloud.F

    r951 r1036  
    77      USE ioipsl_getincom
    88      USE updaterad
     9      use tracer_mod, only: nqmx, igcm_h2o_vap, igcm_h2o_ice,
     10     &                      igcm_dust_mass, igcm_dust_number,
     11     &                      igcm_ccn_mass, igcm_ccn_number,
     12     &                      rho_dust, nuice_sed, nuice_ref
    913      IMPLICIT NONE
    1014
     
    3438#include "comcstfi.h"
    3539#include "callkeys.h"
    36 #include "tracer.h"
     40!#include "tracer.h"
    3741#include "comgeomfi.h"
    3842#include "dimradmars.h"
  • trunk/LMDZ.MARS/libf/phymars/yamada4.F

    r690 r1036  
    88!************************************************************
    99!************************************************************
    10       SUBROUTINE yamada4(ngrid,nlay,dt,g,rconst,plev,temp
     10      SUBROUTINE yamada4(ngrid,nlay,nq,dt,g,rconst,plev,temp
    1111     s   ,zlev,zlay,u,v,phc,pq,cd,q2,km,kn,kq,ustar
    1212     s   ,iflag_pbl)
     13      use tracer_mod, only: noms
    1314      IMPLICIT NONE
    1415!.......................................................................
     
    1617#include "dimensions.h"
    1718#include "dimphys.h"
    18 #include "tracer.h"
     19!#include "tracer.h"
    1920#include "callkeys.h"
    2021!.......................................................................
     
    6162      INTEGER, INTENT(IN)    :: iflag_pbl,ngrid
    6263      INTEGER, INTENT(IN)    :: nlay
     64      INTEGER, INTENT(IN)    :: nq
    6365      REAL,    INTENT(INOUT) :: q2(ngrid,nlay+1)
    6466      REAL,    INTENT(OUT)   :: km(ngrid,nlay+1)
     
    119121      SAVE A, B
    120122      REAL teta(ngrid,nlay)
    121       REAL pq(ngrid,nlay,nqmx)
     123      REAL pq(ngrid,nlay,nq)
    122124      REAL kminfact
    123125      INTEGER i
     
    135137        if (tracer) then
    136138!     Prepare Special treatment if one of the tracers is CO2 gas
    137            do iq=1,nqmx
     139           do iq=1,nq
    138140             if (noms(iq).eq."co2") then
    139141                ico2=iq
     
    603605#include "dimensions.h"
    604606#include "dimphys.h"
    605 #include "tracer.h"
     607!#include "tracer.h"
    606608#include "callkeys.h"
    607609!.......................................................................
     
    684686#include "dimensions.h"
    685687#include "dimphys.h"
    686 #include "tracer.h"
     688!#include "tracer.h"
    687689#include "callkeys.h"
    688690!.......................................................................
  • trunk/LMDZ.MARS/makegcm_g95

    r882 r1036  
    530530# Build the appropriate 'dimensions.h' file
    531531cd dimension
    532 ./makdim $ntrac $dim
     532./makdim $dim
    533533# echo contents of dimensions.h to standard output
    534534cat $libf/grid/dimensions.h
     
    556556echo dimension $dimension dim $dim
    557557if ( $dimension == 1 ) then
    558   echo pas de dynamique
    559   set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     558  echo "No dynamics"
     559##  set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     560## NB: we still need to have L_DYN=libdyn3d to reach routines and module
     561## objects which are located in dyn3d
     562  set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
    560563endif
    561564endif
  • trunk/LMDZ.MARS/makegcm_gfortran

    r882 r1036  
    528528# Build the appropriate 'dimensions.h' file
    529529cd dimension
    530 ./makdim $ntrac $dim
     530./makdim $dim
    531531# echo contents of dimensions.h to standard output
    532532cat $libf/grid/dimensions.h
     
    554554echo dimension $dimension dim $dim
    555555if ( $dimension == 1 ) then
    556   echo pas de dynamique
    557   set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     556  echo "No dynamics"
     557##  set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     558## NB: we still need to have L_DYN=libdyn3d to reach routines and module
     559## objects which are located in dyn3d
     560  set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
    558561endif
    559562endif
  • trunk/LMDZ.MARS/makegcm_ifort

    r1035 r1036  
    184184# Ehouarn 'ifort' compiler
    185185   #NB: on gnome -O3 ==> NaNs ...
    186    set optim=" -O2 -fp-model precise -ip -mkl=sequential -align all "
    187    set optim90=" -O2 -fp-model precise -ip -mkl=sequential -align all "
    188    set optimtru90=" -O2 -fp-model precise -ip -mkl=sequential -align all "
     186   set optim="-auto -O2 -fp-model precise -ip -mkl=sequential -align all "
     187   set optim90="-auto -O2 -fp-model precise -ip -mkl=sequential -align all "
     188   set optimtru90="-auto -O2 -fp-model precise -ip -mkl=sequential -align all "
    189189#   set opt_link=" -Mfree -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$NCDFLIB -lnetcdf -Bstatic "
    190190#   set mod_loc_dir=$LIBOGCM
     
    531531# Build the appropriate 'dimensions.h' file
    532532cd dimension
    533 ./makdim $ntrac $dim
     533./makdim $dim
    534534# echo contents of dimensions.h to standard output
    535535cat $libf/grid/dimensions.h
     
    557557echo dimension $dimension dim $dim
    558558if ( $dimension == 1 ) then
    559   echo pas de dynamique
    560   set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     559  echo "No dynamics"
     560##  set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     561## NB: we still need to have L_DYN=libdyn3d to reach routines and module
     562## objects which are located in dyn3d
     563  set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
    561564endif
    562565endif
  • trunk/LMDZ.MARS/makegcm_pgf

    r882 r1036  
    532532# Build the appropriate 'dimensions.h' file
    533533cd dimension
    534 ./makdim $ntrac $dim
     534./makdim $dim
    535535# echo contents of dimensions.h to standard output
    536536cat $libf/grid/dimensions.h
     
    558558echo dimension $dimension dim $dim
    559559if ( $dimension == 1 ) then
    560   echo pas de dynamique
    561   set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     560  echo "No dynamics"
     561##  set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique "
     562## NB: we still need to have L_DYN=libdyn3d to reach routines and module
     563## objects which are located in dyn3d
     564  set dyn="L_DYN=-ldyn3d DYN= L_FILTRE= DIRMAIN=phy$physique "
    562565endif
    563566endif
Note: See TracChangeset for help on using the changeset viewer.