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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.