Ignore:
Timestamp:
Apr 27, 2022, 2:37:49 PM (3 years ago)
Author:
emillour
Message:

Mars GCM:
Fixed option to initialize chemistry in testphys1d (inichim_newstart call
arguments were wrong).
Turned inichim_newstart.F90 into a module.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F

    r2565 r2672  
    3232      USE physiq_mod, ONLY: physiq
    3333      USE read_profile_mod, ONLY: read_profile
     34      use inichim_newstart_mod, only: inichim_newstart
    3435      IMPLICIT NONE
    3536
     
    107108
    108109c   Various intermediate variables
    109       INTEGER thermo
     110      INTEGER flagthermo,flagh2o
    110111      REAL zls
    111112      REAL phi(nlayer),h(nlayer),s(nlayer)
     
    117118      integer :: nq=1 ! number of tracers
    118119      real :: latitude(1), longitude(1), cell_area(1)
     120      ! dummy variables along "dynamics scalar grid"
     121      real,allocatable :: qdyn(:,:,:,:),psdyn(:,:)
    119122
    120123      character*2 str2
     
    132135      INTEGER ierr0
    133136      LOGICAL :: continu
     137
     138      logical :: present
    134139
    135140c=======================================================================
     
    644649      if (photochem.or.callthermos) then
    645650         write(*,*) 'Initializing chemical species'
    646          ! thermo=0: initialize over all atmospheric layers
    647          thermo=0
    648          call inichim_newstart(q,psurf,sig,nq,latitude,longitude,
    649      $   cell_area,thermo,qsurf)
     651         ! flagthermo=0: initialize over all atmospheric layers
     652         flagthermo=0
     653         ! check if "h2o_vap" has already been initialized
     654         ! (it has been if there is a "profile_h2o_vap" file around)
     655         inquire(file="profile_h2o_vap",exist=present)
     656         if (present) then
     657           flagh2o=0 ! 0: do not initialize h2o_vap
     658         else
     659           flagh2o=1 ! 1: initialize h2o_vap in inichim_newstart
     660         endif
     661         
     662         ! hack to accomodate that inichim_newstart assumes that
     663         ! q & psurf arrays are on the dynamics scalar grid
     664         allocate(qdyn(2,1,llm,nq),psdyn(2,1))
     665         qdyn(1,1,1:llm,1:nq)=q(1:llm,1:nq)
     666         psdyn(1:2,1)=psurf
     667         call inichim_newstart(ngrid,nq,qdyn,qsurf,psdyn,
     668     $                         flagh2o,flagthermo)
     669         q(1:llm,1:nq)=qdyn(1,1,1:llm,1:nq)
    650670      endif
    651671
Note: See TracChangeset for help on using the changeset viewer.