Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:37:25 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d676f916b2 Jean*0001 #include "AIM_OPTIONS.h"
                0002 
                0003       SUBROUTINE LSCOND (PSA,dpFac,QA,QSAT,
                0004      O                   PRECLS,DTLSC,DQLSC,
                0005      I                   kGrd,bi,bj,myThid)
                0006 C--
                0007 C--   SUBROUTINE LSCOND (PSA,QA,QSAT,
1a72cb671e Jean*0008 C--  *                   PRECLS,DTLSC,DQLSC)
d676f916b2 Jean*0009 C--
                0010 C--   Purpose: Compute large-scale precipitation and
                0011 C--            associated tendencies of temperature and moisture
                0012 C--   Input:   PSA    = norm. surface pressure [p/p0]           (2-dim)
                0013 C              dpFac  = cell delta_P fraction                   (3-dim)
                0014 C--            QA     = specific humidity [g/kg]                (3-dim)
                0015 C--            QSAT   = saturation spec. hum. [g/kg]            (3-dim)
                0016 C--   Output:  PRECLS = large-scale precipitation [g/(m^2 s)]   (2-dim)
                0017 C--            DTLSC  = temperature tendency from l.s. cond     (3-dim)
                0018 C--            DQLSC  = hum. tendency [g/(kg s)] from l.s. cond (3-dim)
                0019 C    Input:    kGrd   = Ground level index              (2-dim)
                0020 C              bi,bj  = tile index
                0021 C              myThid = Thread number for this instance of the routine
                0022 C--
                0023 
                0024       IMPLICIT NONE
                0025 
                0026 C     Resolution parameters
                0027 
                0028 C-- size for MITgcm & Physics package :
1a72cb671e Jean*0029 #include "AIM_SIZE.h"
d676f916b2 Jean*0030 
                0031 #include "EEPARAMS.h"
                0032 
                0033 C     Physical constants + functions of sigma and latitude
                0034 
                0035 #include "com_physcon.h"
                0036 
                0037 C     Large-scale condensation constants
                0038 
                0039 #include "com_lsccon.h"
                0040 
                0041 C-- Routine arguments:
                0042       _RL PSA(NGP), dpFac(NGP,NLEV), QA(NGP,NLEV), QSAT(NGP,NLEV)
                0043       _RL PRECLS(NGP), DTLSC(NGP,NLEV), DQLSC(NGP,NLEV)
                0044       INTEGER  kGrd(NGP)
                0045       INTEGER  bi,bj,myThid
                0046 
                0047 #ifdef ALLOW_AIM
                0048 
1a72cb671e Jean*0049 C-- Local variables:
d676f916b2 Jean*0050       INTEGER J, K
                0051       _RL PSA2(NGP)
                0052 
                0053 C- jmc: declare all local variables:
                0054       _RL RTLSC, TFACT, PRG
                0055       _RL SIG2, RHREF, DQMAX, PFACT
                0056 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0057 
                0058 C--   1. Initialization
                0059 
                0060 c_FM  QSMAX = 50.
                0061 
                0062       RTLSC = 1./(TRLSC*3600.)
                0063       TFACT = ALHC/CP
                0064       PRG = P0/GG
                0065 
                0066       DO J=1,NGP
                0067         DTLSC(J,1) = 0.
                0068         DQLSC(J,1) = 0.
                0069         PRECLS(J)  = 0.
                0070         PSA2(J)    = PSA(J)*PSA(J)
                0071       ENDDO
                0072 
                0073 C--   2. Tendencies of temperature and moisture
1a72cb671e Jean*0074 C        NB. A maximum heating rate is imposed to avoid
                0075 C            grid-point-storm instability
d676f916b2 Jean*0076 
                0077       DO K=2,NLEV
                0078         SIG2=SIG(K)*SIG(K)
                0079 c_FM    RHREF = RHLSC+DRHLSC*(SIG2-1.)
                0080 c_FM    DQMAX = (1.1-RHREF)*QSMAX*SIG2*RTLSC
                0081         DO J=1,NGP
                0082           RHREF = RHLSC+DRHLSC*(SIG2/PSA2(J) - 1. _d 0)
                0083           DQMAX = (1.1 _d 0-RHREF)*QSMAX*SIG2*RTLSC
                0084           DQLSC(J,K) = MIN(0. _d 0,(RHREF*QSAT(J,K)-QA(J,K)))*RTLSC
                0085 c_FM      DTLSC(J,K) = TFACT*MIN(-DQLSC(J,K),DQMAX*PSA2(J))
386345b184 Jean*0086 c         DTLSC(J,K) = TFACT*MIN(-DQLSC(J,K),DQMAX)
                0087 C-jmc: the threshold on latent heat (above) breaks the energy conservation;
                0088 C      to fix this, apply the threshold directly to the condensation
                0089           DQLSC(J,K) = MAX(-DQMAX, DQLSC(J,K) )
                0090           DTLSC(J,K) = -TFACT*DQLSC(J,K)
d676f916b2 Jean*0091         ENDDO
                0092       ENDDO
                0093 
1a72cb671e Jean*0094 C--   Scale LSC tendencies by dpFac (=Partial-Cell factor) (=> Mass Weighted)
                0095 C     to get homogenous units & scaling across all physics tendencies.
                0096       DO K=2,NLEV
                0097         DO J=1,NGP
                0098           DQLSC(J,K) = DQLSC(J,K)*dpFac(J,K)
                0099           DTLSC(J,K) = DTLSC(J,K)*dpFac(J,K)
                0100         ENDDO
                0101       ENDDO
                0102 
d676f916b2 Jean*0103 C--   3. Large-scale precipitation
                0104 
                0105       DO J=1,NGP
                0106         DO K=2,kGrd(J)
1a72cb671e Jean*0107           PFACT = DSIG(K)*PRG
d676f916b2 Jean*0108           PRECLS(J) = PRECLS(J)-PFACT*DQLSC(J,K)
                0109         ENDDO
                0110       ENDDO
                0111 
                0112 c_FM  DO J=1,NGP
                0113 c_FM    PRECLS(J) = PRECLS(J)*PSA(J)
                0114 c_FM  ENDDO
                0115 
                0116 C--
1a72cb671e Jean*0117 #endif /* ALLOW_AIM */
d676f916b2 Jean*0118 
                0119       RETURN
                0120       END