forked from altMITgcm/MITgcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phy_lscond.F
123 lines (97 loc) · 3.52 KB
/
phy_lscond.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/phy_lscond.F,v 1.3 2006/03/28 04:26:21 jmc Exp $
C $Name: $
#include "AIM_OPTIONS.h"
SUBROUTINE LSCOND (PSA,dpFac,QA,QSAT,
O PRECLS,DTLSC,DQLSC,
I kGrd,bi,bj,myThid)
C--
C-- SUBROUTINE LSCOND (PSA,QA,QSAT,
C-- * PRECLS,DTLSC,DQLSC)
C--
C-- Purpose: Compute large-scale precipitation and
C-- associated tendencies of temperature and moisture
C-- Input: PSA = norm. surface pressure [p/p0] (2-dim)
C dpFac = cell delta_P fraction (3-dim)
C-- QA = specific humidity [g/kg] (3-dim)
C-- QSAT = saturation spec. hum. [g/kg] (3-dim)
C-- Output: PRECLS = large-scale precipitation [g/(m^2 s)] (2-dim)
C-- DTLSC = temperature tendency from l.s. cond (3-dim)
C-- DQLSC = hum. tendency [g/(kg s)] from l.s. cond (3-dim)
C Input: kGrd = Ground level index (2-dim)
C bi,bj = tile index
C myThid = Thread number for this instance of the routine
C--
IMPLICIT NONE
C Resolution parameters
C-- size for MITgcm & Physics package :
#include "AIM_SIZE.h"
#include "EEPARAMS.h"
C Physical constants + functions of sigma and latitude
#include "com_physcon.h"
C Large-scale condensation constants
#include "com_lsccon.h"
C-- Routine arguments:
_RL PSA(NGP), dpFac(NGP,NLEV), QA(NGP,NLEV), QSAT(NGP,NLEV)
_RL PRECLS(NGP), DTLSC(NGP,NLEV), DQLSC(NGP,NLEV)
INTEGER kGrd(NGP)
INTEGER bi,bj,myThid
#ifdef ALLOW_AIM
C-- Local variables:
INTEGER J, K
_RL PSA2(NGP)
C- jmc: declare all local variables:
_RL RTLSC, TFACT, PRG
_RL SIG2, RHREF, DQMAX, PFACT
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
C-- 1. Initialization
c_FM QSMAX = 50.
RTLSC = 1./(TRLSC*3600.)
TFACT = ALHC/CP
PRG = P0/GG
DO J=1,NGP
DTLSC(J,1) = 0.
DQLSC(J,1) = 0.
PRECLS(J) = 0.
PSA2(J) = PSA(J)*PSA(J)
ENDDO
C-- 2. Tendencies of temperature and moisture
C NB. A maximum heating rate is imposed to avoid
C grid-point-storm instability
DO K=2,NLEV
SIG2=SIG(K)*SIG(K)
c_FM RHREF = RHLSC+DRHLSC*(SIG2-1.)
c_FM DQMAX = (1.1-RHREF)*QSMAX*SIG2*RTLSC
DO J=1,NGP
RHREF = RHLSC+DRHLSC*(SIG2/PSA2(J) - 1. _d 0)
DQMAX = (1.1 _d 0-RHREF)*QSMAX*SIG2*RTLSC
DQLSC(J,K) = MIN(0. _d 0,(RHREF*QSAT(J,K)-QA(J,K)))*RTLSC
c_FM DTLSC(J,K) = TFACT*MIN(-DQLSC(J,K),DQMAX*PSA2(J))
c DTLSC(J,K) = TFACT*MIN(-DQLSC(J,K),DQMAX)
C-jmc: the threshold on latent heat (above) breaks the energy conservation;
C to fix this, apply the threshold directly to the condensation
DQLSC(J,K) = MAX(-DQMAX, DQLSC(J,K) )
DTLSC(J,K) = -TFACT*DQLSC(J,K)
ENDDO
ENDDO
C-- Scale LSC tendencies by dpFac (=Partial-Cell factor) (=> Mass Weighted)
C to get homogenous units & scaling across all physics tendencies.
DO K=2,NLEV
DO J=1,NGP
DQLSC(J,K) = DQLSC(J,K)*dpFac(J,K)
DTLSC(J,K) = DTLSC(J,K)*dpFac(J,K)
ENDDO
ENDDO
C-- 3. Large-scale precipitation
DO J=1,NGP
DO K=2,kGrd(J)
PFACT = DSIG(K)*PRG
PRECLS(J) = PRECLS(J)-PFACT*DQLSC(J,K)
ENDDO
ENDDO
c_FM DO J=1,NGP
c_FM PRECLS(J) = PRECLS(J)*PSA(J)
c_FM ENDDO
C--
#endif /* ALLOW_AIM */
RETURN
END