Ignore:
Timestamp:
Jul 11, 2014, 11:48:09 AM (11 years ago)
Author:
emillour
Message:

Generic and Mars GCM:
LMDZ.COMMON dynamics sends mass flux to physics and not vertical velocity.
Add the computation of vertical velocity from input mass flux in the physics,
and also modify "old" LMDZ.GENERIC and LMDZ.MARS dynamics to be consistent.
EM

File:
1 edited

Legend:

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

    r1292 r1312  
    55     $            ,pplev,pplay,pphi
    66     $            ,pu,pv,pt,pq
    7      $            ,pw
     7     $            ,flxw
    88     $            ,pdu,pdv,pdt,pdq,pdpsrf,tracerdyn)
    99
     
    128128c    ptdyn(ngrid,nlayer)    | corresponding variables
    129129c    pqdyn(ngrid,nlayer,nq) |
    130 c    pw(ngrid,?)           vertical velocity
     130c    flxw(ngrid,nlayer)      vertical mass flux (kg/s) at layer lower boundary
    131131c
    132132c   output:
     
    159159c   inputs:
    160160c   -------
    161       INTEGER ngrid,nlayer,nq
    162       REAL ptimestep
    163       REAL pplev(ngrid,nlayer+1),pplay(ngrid,nlayer)
    164       REAL pphi(ngrid,nlayer)
    165       REAL pu(ngrid,nlayer),pv(ngrid,nlayer)
    166       REAL pt(ngrid,nlayer),pq(ngrid,nlayer,nq)
    167       REAL pw(ngrid,nlayer) !Mars pvervel transmit par dyn3d
    168       REAL zh(ngrid,nlayer)      ! potential temperature (K)
    169       LOGICAL firstcall,lastcall
    170 
    171       REAL pday
    172       REAL ptime
    173       logical tracerdyn
     161      INTEGER,INTENT(in) :: ngrid ! number of atmospheric columns
     162      INTEGER,INTENT(in) :: nlayer ! number of atmospheric layers
     163      INTEGER,INTENT(in) :: nq ! number of tracers
     164      LOGICAL,INTENT(in) :: firstcall ! signals first call to physics
     165      LOGICAL,INTENT(in) :: lastcall ! signals last call to physics
     166      REAL,INTENT(in) :: pday ! number of elapsed sols since reference Ls=0
     167      REAL,INTENT(in) :: ptime ! "universal time", given as fraction of sol (e.g.: 0.5 for noon)
     168      REAL,INTENT(in) :: ptimestep ! physics timestep (s)
     169      REAL,INTENT(in) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa)
     170      REAL,INTENT(IN) :: pplay(ngrid,nlayer) ! mid-layer pressure (Pa)
     171      REAL,INTENT(IN) :: pphi(ngrid,nlayer) ! geopotential at mid-layer (m2s-2)
     172      REAL,INTENT(in) :: pu(ngrid,nlayer) ! zonal wind component (m/s)
     173      REAL,INTENT(in) :: pv(ngrid,nlayer) ! meridional wind component (m/s)
     174      REAL,INTENT(in) :: pt(ngrid,nlayer) ! temperature (K)
     175      REAL,INTENT(in) :: pq(ngrid,nlayer,nq) ! tracers (.../kg_of_air)
     176      REAL,INTENT(in) :: flxw(ngrid,nlayer) ! vertical mass flux (ks/s)
     177                                            ! at lower boundary of layer
    174178
    175179c   outputs:
    176180c   --------
    177181c     physical tendencies
    178       REAL pdu(ngrid,nlayer),pdv(ngrid,nlayer)
    179       REAL pdt(ngrid,nlayer),pdq(ngrid,nlayer,nq)
    180       REAL pdpsrf(ngrid) ! surface pressure tendency
     182      REAL,INTENT(out) :: pdu(ngrid,nlayer) ! zonal wind tendency (m/s/s)
     183      REAL,INTENT(out) :: pdv(ngrid,nlayer) ! meridional wind tendency (m/s/s)
     184      REAL,INTENT(out) :: pdt(ngrid,nlayer) ! temperature tendency (K/s)
     185      REAL,INTENT(out) :: pdq(ngrid,nlayer,nq) ! tracer tendencies (../kg/s)
     186      REAL,INTENT(out) :: pdpsrf(ngrid) ! surface pressure tendency (Pa/s)
     187      LOGICAL,INTENT(out) :: tracerdyn ! signal to the dynamics to advect tracers or not
    181188
    182189
     
    273280      REAL ztime_fin
    274281      REAL zdh(ngrid,nlayer)
     282      REAL pw(ngrid,nlayer) ! vertical velocity (m/s) (>0 when downwards)
    275283      INTEGER length
    276284      PARAMETER (length=100)
     
    569577      endif
    570578#endif
     579
     580     ! Compute vertical velocity (m/s) from vertical mass flux
     581     ! w = F / (rho*area) and rho = r*T/P
     582     ! but first linearly interpolate mass flux to mid-layers
     583     do l=1,nlayer-1
     584       pw(1:ngrid,l)=0.5*(flxw(1:ngrid,l)+flxw(1:ngrid,l+1))
     585     enddo
     586     pw(1:ngrid,nlayer)=0.5*flxw(1:ngrid,nlayer) ! since flxw(nlayer+1)=0
     587     do l=1,nlayer
     588       pw(1:ngrid,l)=(pw(1:ngrid,l)*pplay(1:ngrid,l)) /  &
     589                     (r*pt(1:ngrid,l)*area(1:ngrid))
     590       ! NB: here we use r and nor rnew since this diagnostic comes
     591       ! from the dynamics
     592     enddo
     593
    571594c-----------------------------------------------------------------------
    572595c    2. Compute radiative tendencies :
Note: See TracChangeset for help on using the changeset viewer.