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