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
0007
1a72cb671e Jean*0008
d676f916b2 Jean*0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 IMPLICIT NONE
0025
0026
0027
0028
1a72cb671e Jean*0029 #include "AIM_SIZE.h"
d676f916b2 Jean*0030
0031 #include "EEPARAMS.h"
0032
0033
0034
0035 #include "com_physcon.h"
0036
0037
0038
0039 #include "com_lsccon.h"
0040
0041
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
d676f916b2 Jean*0050 INTEGER J, K
0051 _RL PSA2(NGP)
0052
0053
0054 _RL RTLSC, TFACT, PRG
0055 _RL SIG2, RHREF, DQMAX, PFACT
0056
0057
0058
0059
0060
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
1a72cb671e Jean*0074
0075
d676f916b2 Jean*0076
0077 DO K=2,NLEV
0078 SIG2=SIG(K)*SIG(K)
0079
0080
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
386345b184 Jean*0086
0087
0088
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
0095
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
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
0113
0114
0115
0116
1a72cb671e Jean*0117 #endif /* ALLOW_AIM */
d676f916b2 Jean*0118
0119 RETURN
0120 END