Ignore:
Timestamp:
Sep 8, 2023, 6:47:24 PM (16 months ago)
Author:
jbclement
Message:

Mars PCM 1D:
In testphys1D.F, "dtphys" was renamed into a local variable "dttestphys" because "dtphys" is also a variable of time_phylmdz_mod.F90. Thus, it could have been modified by the physics through the module (for ex. by tabfi.F when reading startfi.nc) and affect the dynamics which is prohibited.
JBC

File:
1 edited

Legend:

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

    r3027 r3036  
    2323     &                     obliquit, emin_turb, lmixmin
    2424      use comcstfi_h, only: pi, rad, omeg, g, mugaz, rcp, r, cpp
    25       use time_phylmdz_mod, only: daysec, dtphys, day_step,
    26      &                            ecritphy, iphysiq
     25      use time_phylmdz_mod, only: daysec, day_step, ecritphy, iphysiq
    2726      use dimradmars_mod, only: tauvis,totcloudfrac
    2827      use dust_param_mod, only: tauscaling
     
    9594      real,parameter :: odpref=610. ! DOD reference pressure (Pa)
    9695c
    97       INTEGER day0,dayn          ! date initial (sol ; =0 a Ls=0) and final
    98       REAL day           ! date durant le run
    99       REAL time             ! time (0<time<1 ; time=0.5 a midi)
     96      INTEGER day0,dayn   ! initial (sol ; =0 at Ls=0) and final date
     97      REAL day            ! date during the run
     98      REAL time           ! time (0<time<1 ; time=0.5 a midi)
     99      REAL dttestphys         ! testphys1d timestep
    100100      REAL play(nlayer)   ! Pressure at the middle of the layers (Pa)
    101101      REAL plev(nlayer+1) ! intermediate pressure levels (pa)
    102102      REAL psurf,tsurf(1)     
    103       REAL u(nlayer),v(nlayer)  ! zonal, meridional wind
    104       REAL gru,grv   ! prescribed "geostrophic" background wind
    105       REAL temp(nlayer)   ! temperature at the middle of the layers
    106       REAL,ALLOCATABLE :: q(:,:) ! tracer mixing ratio (e.g. kg/kg)
     103      REAL u(nlayer),v(nlayer) ! zonal, meridional wind
     104      REAL gru,grv             ! prescribed "geostrophic" background wind
     105      REAL temp(nlayer)        ! temperature at the middle of the layers
     106      REAL,ALLOCATABLE :: q(:,:)   ! tracer mixing ratio (e.g. kg/kg)
    107107      REAL,ALLOCATABLE :: qsurf(:) ! tracer surface budget (e.g. kg.m-2)
    108108      REAL tsoil(nsoilmx)   ! subsurface soik temperature (K)
    109109      REAL emis(1)          ! surface layer
    110110      REAL albedo(1,1)      ! surface albedo
    111       REAL :: wstar(1)=0.    ! Thermals vertical velocity
    112       REAL q2(nlayer+1)   ! Turbulent Kinetic Energy
    113       REAL zlay(nlayer)   ! altitude estimee dans les couches (km)
     111      REAL :: wstar(1)=0.   ! Thermals vertical velocity
     112      REAL q2(nlayer+1)     ! Turbulent Kinetic Energy
     113      REAL zlay(nlayer)     ! altitude estimee dans les couches (km)
    114114
    115115c    Physical and dynamical tandencies (e.g.  m.s-2, K/s, Pa/s)
     
    416416      dayn=day0+ndt
    417417      ndt=ndt*day_step     
    418       dtphys=daysec/day_step 
     418      dttestphys=daysec/day_step
    419419
    420420c Imposed surface pressure
     
    498498!  some initializations (some of which have already been
    499499!  done above!) and loads parameters set in callphys.def
    500 !  and allocates some arrays 
    501 !Mars possible matter with dtphys in input and include!!!
     500!  and allocates some arrays
     501! Mars possible matter with dttestphys in input and include!!!
    502502! Initializations below should mimick what is done in iniphysiq for 3D GCM
    503503      call init_interface_dyn_phys
     
    513513      call phys_state_var_init(1,llm,nq,tname,
    514514     .          day0,dayn,time,
    515      .          daysec,dtphys,
     515     .          daysec,dttestphys,
    516516     .          rad,g,r,cpp,
    517517     .          nqperes,nqfils)! MVals: variables isotopes
     
    838838      atm_wat_tau = -1. ! Default: no time relaxation
    839839      if (water) then
    840       print*, 'Relax atmospheric water vapor profile?'
     840      write(*,*) 'Relax atmospheric water vapor profile?'
    841841      call getin("atm_wat_tau",atm_wat_tau)
    842842      write(*,*) "atm_wat_tau = ", atm_wat_tau
     
    864864
    865865      call physdem0("startfi.nc",longitude,latitude,nsoilmx,ngrid,
    866      &              llm,nq,dtphys,float(day0),0.,cell_area,
     866     &              llm,nq,dttestphys,float(day0),0.,cell_area,
    867867     &              albedodat,inertiedat,def_slope,subslope_dist)
    868868      call physdem1("startfi.nc",nsoilmx,ngrid,llm,nq,
    869      &              dtphys,time,
     869     &              dttestphys,time,
    870870     &              tsurf,tsoil,inertiesoil,albedo,emis,
    871871     &              q2,qsurf,tauscaling,
     
    922922          else ! Relaxation towards the value atm_wat_profile with relaxation time atm_wat_tau
    923923        q(:,igcm_h2o_vap) = atm_wat_profile*g/psurf + (q(:,igcm_h2o_vap)
    924      &              - atm_wat_profile*g/psurf)*dexp(-dtphys/atm_wat_tau)
     924     &          - atm_wat_profile*g/psurf)*dexp(-dttestphys/atm_wat_tau)
    925925            q(:,igcm_h2o_vap) = min(zqsat(:),q(:,igcm_h2o_vap))
    926926            q(:,igcm_h2o_ice) = 0. ! reset h2o ice
     
    932932c       call physics
    933933c       --------------------
    934       CALL physiq (1,llm,nq,
    935      ,     firstcall,lastcall,
    936      ,     day,time,dtphys,
    937      ,     plev,play,phi,
    938      ,     u, v,temp, q, 
    939      ,     w,
     934      CALL physiq (1,llm,nq,firstcall,lastcall,
     935     ,     day,time,dttestphys,plev,play,phi,
     936     ,     u,v,temp,q,w,
    940937C - outputs
    941938     s     du, dv, dtemp, dq,dpsurf)
     
    963960c       ---------------------------------------
    964961        firstcall=.false.
    965         time=time+dtphys/daysec
     962        time=time+dttestphys/daysec
    966963        IF (time.gt.1.E+0) then
    967964            time=time-1.E+0
     
    973970
    974971        DO ilayer=1,nlayer
    975            u(ilayer)=u(ilayer)+dtphys*du(ilayer)
    976            v(ilayer)=v(ilayer)+dtphys*dv(ilayer)
    977            temp(ilayer)=temp(ilayer)+dtphys*dtemp(ilayer)
     972           u(ilayer)=u(ilayer)+dttestphys*du(ilayer)
     973           v(ilayer)=v(ilayer)+dttestphys*dv(ilayer)
     974           temp(ilayer)=temp(ilayer)+dttestphys*dtemp(ilayer)
    978975        ENDDO
    979976
    980977c       compute pressure for next time step
    981978c       ----------------------------------------------------------
    982            psurf=psurf+dtphys*dpsurf(1)   ! surface pressure change
     979           psurf=psurf+dttestphys*dpsurf(1)   ! surface pressure change
    983980           DO ilevel=1,nlevel
    984981             plev(ilevel)=ap(ilevel)+psurf*bp(ilevel)
     
    991988        DO iq = 1, nq
    992989          DO ilayer=1,nlayer
    993              q(ilayer,iq)=q(ilayer,iq)+dtphys*dq(ilayer,iq)
     990             q(ilayer,iq)=q(ilayer,iq)+dttestphys*dq(ilayer,iq)
    994991          ENDDO
    995992        ENDDO
Note: See TracChangeset for help on using the changeset viewer.