/[MITgcm]/MITgcm/pkg/fizhi/fizhi_moist.F
ViewVC logotype

Diff of /MITgcm/pkg/fizhi/fizhi_moist.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.11 by molod, Fri Jul 16 20:11:04 2004 UTC revision 1.17 by molod, Thu Aug 12 15:21:22 2004 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4  #include "PACKAGES_CONFIG.h"  #include "FIZHI_OPTIONS.h"
 #include "CPP_OPTIONS.h"  
5        subroutine moistio (ndmoist,istrip,npcs,        subroutine moistio (ndmoist,istrip,npcs,
6       .   lowlevel,midlevel,nltop,nsubmin,nsubmax,Lup,       .   lowlevel,midlevel,nltop,nsubmin,nsubmax,Lup,
7       .   pz,plz,plze,dpres,pkht,pkl,tz,qz,bi,bj,ntracer,ptracer,       .   pz,plz,plze,dpres,pkht,pkl,tz,qz,bi,bj,ntracer,ptracer,
# Line 27  c --------------- Line 26  c ---------------
26        integer ndmoist,istrip,npcs        integer ndmoist,istrip,npcs
27        integer bi,bj,ntracer,ptracer                integer bi,bj,ntracer,ptracer        
28        integer lowlevel,midlevel,nltop,nsubmin,nsubmax,Lup        integer lowlevel,midlevel,nltop,nsubmin,nsubmax,Lup
29        real pz(im,jm),plz(im,jm,lm),plze(im,jm,lm+1),dpres(im,jm,lm)        _RL pz(im,jm),plz(im,jm,lm),plze(im,jm,lm+1),dpres(im,jm,lm)
30        real pkht(im,jm,lm+1),pkl(im,jm,lm)        _RL pkht(im,jm,lm+1),pkl(im,jm,lm)
31        real tz(im,jm,lm),qz(im,jm,lm,ntracer)              _RL tz(im,jm,lm),qz(im,jm,lm,ntracer)      
32        real qqz(im,jm,lm)        _RL qqz(im,jm,lm)
33        real dumoist(im,jm,lm),dvmoist(im,jm,lm)        _RL dumoist(im,jm,lm),dvmoist(im,jm,lm)
34        real dtmoist(im,jm,lm),dqmoist(im,jm,lm,ntracer)        _RL dtmoist(im,jm,lm),dqmoist(im,jm,lm,ntracer)
35        real ptop        _RL ptop
36        integer iras        integer iras
37        real rainlsp(im,jm),rainconv(im,jm),snowfall(im,jm)        _RL rainlsp(im,jm),rainconv(im,jm),snowfall(im,jm)
38        integer nswcld,nswlz        integer nswcld,nswlz
39        real cldlsp_sw(im,jm,lm),cldras_sw(im,jm,lm)        _RL cldlsp_sw(im,jm,lm),cldras_sw(im,jm,lm)
40        real cldtot_sw(im,jm,lm),swlz(im,jm,lm)        _RL cldtot_sw(im,jm,lm),swlz(im,jm,lm)
41        integer nlwcld,nlwlz        integer nlwcld,nlwlz
42        real  cldlsp_lw(im,jm,lm),cldras_lw(im,jm,lm)        _RL  cldlsp_lw(im,jm,lm),cldras_lw(im,jm,lm)
43        real  cldtot_lw(im,jm,lm),lwlz(im,jm,lm)        _RL  cldtot_lw(im,jm,lm),lwlz(im,jm,lm)
44        logical lpnt        logical lpnt
45        integer myid        integer myid
46    
# Line 49  c Local Variables Line 48  c Local Variables
48  c ---------------  c ---------------
49        integer    ncrnd,nsecf        integer    ncrnd,nsecf
50    
51        real       fracqq, dum        _RL       fracqq, dum
52        integer    snowcrit        integer    snowcrit
53        parameter (fracqq = 0.1)        parameter (fracqq = 0.1)
54          _RL one
55          parameter (one=1.)
56    
57        real   cldsr(im,jm,lm)        _RL   cldsr(im,jm,lm)
58        real   srcld(istrip,lm)        _RL   srcld(istrip,lm)
59    
60        real plev        _RL plev
61        real cldnow,cldlsp_mem,cldlsp,cldras_mem,cldras        _RL cldnow,cldlsp_mem,cldlsp,cldras_mem,cldras
62        real watnow,watmin,cldmin        _RL watnow,watmin,cldmin
63        real cldprs(im,jm),cldtmp(im,jm)        _RL cldprs(im,jm),cldtmp(im,jm)
64        real cldhi (im,jm),cldlow(im,jm)        _RL cldhi (im,jm),cldlow(im,jm)
65        real cldmid(im,jm),totcld(im,jm)        _RL cldmid(im,jm),totcld(im,jm)
66    
67        real   CLDLS(im,jm,lm)  , CPEN(im,jm,lm)        _RL   CLDLS(im,jm,lm)  , CPEN(im,jm,lm)
68        real    tmpimjm(im,jm)        _RL    tmpimjm(im,jm)
69        real    lsp_new(im,jm)        _RL    lsp_new(im,jm)
70        real   conv_new(im,jm)        _RL   conv_new(im,jm)
71        real   snow_new(im,jm)        _RL   snow_new(im,jm)
72    
73        real  qqcolmin(im,jm)        _RL  qqcolmin(im,jm)
74        real  qqcolmax(im,jm)        _RL  qqcolmax(im,jm)
75        integer levpbl(im,jm)        integer levpbl(im,jm)
76    
77  c Gathered Arrays for Variable Cloud Base  c Gathered Arrays for Variable Cloud Base
78  c ---------------------------------------  c ---------------------------------------
79        real    raincgath(im*jm)        _RL    raincgath(im*jm)
80        real     pigather(im*jm)        _RL     pigather(im*jm)
81        real     thgather(im*jm,lm)        _RL     thgather(im*jm,lm)
82        real     shgather(im*jm,lm)        _RL     shgather(im*jm,lm)
83        real    pkzgather(im*jm,lm)        _RL    pkzgather(im*jm,lm)
84        real    pkegather(im*jm,lm+1)        _RL    pkegather(im*jm,lm+1)
85        real    plzgather(im*jm,lm)        _RL    plzgather(im*jm,lm)
86        real    plegather(im*jm,lm+1)        _RL    plegather(im*jm,lm+1)
87        real     dpgather(im*jm,lm)        _RL     dpgather(im*jm,lm)
88        real    tmpgather(im*jm,lm)        _RL    tmpgather(im*jm,lm)
89        real   deltgather(im*jm,lm)        _RL   deltgather(im*jm,lm)
90        real   delqgather(im*jm,lm)        _RL   delqgather(im*jm,lm)
91        real      ugather(im*jm,lm,ntracer)        _RL      ugather(im*jm,lm,ntracer)
92        real   delugather(im*jm,lm,ntracer)        _RL   delugather(im*jm,lm,ntracer)
93        real     deltrnev(im*jm,lm)        _RL     deltrnev(im*jm,lm)
94        real     delqrnev(im*jm,lm)        _RL     delqrnev(im*jm,lm)
95    
96        integer  nindeces(lm)        integer  nindeces(lm)
97        integer  pblindex(im*jm)        integer  pblindex(im*jm)
# Line 98  c -------------------------------------- Line 99  c --------------------------------------
99    
100  c Stripped Arrays  c Stripped Arrays
101  c ---------------  c ---------------
102        real saveth (istrip,lm)        _RL saveth (istrip,lm)
103        real saveq  (istrip,lm)        _RL saveq  (istrip,lm)
104        real saveu  (istrip,lm,ntracer)        _RL saveu  (istrip,lm,ntracer)
105        real usubcl (istrip,   ntracer)        _RL usubcl (istrip,   ntracer)
106    
107        real     ple(istrip,lm+1)        _RL     ple(istrip,lm+1)
108        real      dp(istrip,lm)        _RL      dp(istrip,lm)
109        real      TL(ISTRIP,lm)  , SHL(ISTRIP,lm)        _RL      TL(ISTRIP,lm)  , SHL(ISTRIP,lm)
110        real      PL(ISTRIP,lm)  , PLK(ISTRIP,lm)        _RL      PL(ISTRIP,lm)  , PLK(ISTRIP,lm)
111        real    PLKE(ISTRIP,lm+1)        _RL    PLKE(ISTRIP,lm+1)
112        real      TH(ISTRIP,lm)  ,CVTH(ISTRIP,lm)        _RL      TH(ISTRIP,lm)  ,CVTH(ISTRIP,lm)
113        real   CVQ(ISTRIP,lm)        _RL   CVQ(ISTRIP,lm)
114        real      UL(ISTRIP,lm,ntracer)        _RL      UL(ISTRIP,lm,ntracer)
115        real     cvu(istrip,lm,ntracer)        _RL     cvu(istrip,lm,ntracer)
116        real  CLMAXO(ISTRIP,lm),CLBOTH(ISTRIP,lm)        _RL  CLMAXO(ISTRIP,lm),CLBOTH(ISTRIP,lm)
117        real  CLSBTH(ISTRIP,lm)        _RL  CLSBTH(ISTRIP,lm)
118        real    TMP1(ISTRIP,lm),  TMP2(ISTRIP,lm)        _RL    TMP1(ISTRIP,lm),  TMP2(ISTRIP,lm)
119        real    TMP3(ISTRIP,lm),  TMP4(ISTRIP,lm+1)        _RL    TMP3(ISTRIP,lm),  TMP4(ISTRIP,lm+1)
120        real    TMP5(ISTRIP,lm+1)        _RL    TMP5(ISTRIP,lm+1)
121        integer   ITMP1(ISTRIP,lm), ITMP2(ISTRIP,lm)        integer   ITMP1(ISTRIP,lm), ITMP2(ISTRIP,lm)
122    
123        real   PRECIP(ISTRIP), PCNET(ISTRIP)        _RL   PRECIP(ISTRIP), PCNET(ISTRIP)
124        real   SP(ISTRIP),  PREP(ISTRIP)        _RL   SP(ISTRIP),  PREP(ISTRIP)
125        real   PCPEN (ISTRIP,lm)        _RL   PCPEN (ISTRIP,lm)
126        integer pbl(istrip),depths(lm)        integer pbl(istrip),depths(lm)
127    
128        real   cldlz(istrip,lm), cldwater(im,jm,lm)        _RL   cldlz(istrip,lm), cldwater(im,jm,lm)
129        real   rhfrac(istrip), rhmin, pup, ppbl, rhcrit(istrip,lm)        _RL   rhfrac(istrip), rhmin, pup, ppbl, rhcrit(istrip,lm)
130        real   offset, alpha, rasmax        _RL   offset, alpha, rasmax
131    
132        logical first        logical first
133        logical lras        logical lras
134        real    clfrac (istrip,lm)        _RL    clfrac (istrip,lm)
135        real    cldmas (istrip,lm)        _RL    cldmas (istrip,lm)
136        real    detrain(istrip,lm)        _RL    detrain(istrip,lm)
137        real    psubcld    (istrip), psubcldg (im,jm)        _RL    psubcld    (istrip), psubcldg (im,jm)
138        real    psubcld_cnt(istrip), psubcldgc(im,jm)        _RL    psubcld_cnt(istrip), psubcldgc(im,jm)
139        real rnd(lm/2)        _RL rnd(lm/2)
140        DATA      FIRST /.TRUE./        DATA      FIRST /.TRUE./
141    
142        integer imstp,nsubcl,nlras        integer imstp,nsubcl,nlras
143        integer i,j,iloop,index,l,nn,num,numdeps,nt        integer i,j,iloop,indx,indgath,l,nn,num,numdeps,nt
144        real tmstp,tminv,sday,grav,alhl,cp,elocp,gamfac        _RL tmstp,tminv,sday,grav,alhl,cp,elocp,gamfac
145        real rkappa,p0kappa,p0kinv,ptopkap,pcheck        _RL rkappa,p0kappa,p0kinv,ptopkap,pcheck
146        real tice,getcon,pi        _RL tice,getcon,pi
147    
148  C **********************************************************************  C **********************************************************************
149  C ****                     INITIALIZATION                           ****  C ****                     INITIALIZATION                           ****
# Line 185  c Determine Total number of Random Cloud Line 186  c Determine Total number of Random Cloud
186  c ---------------------------------------------  c ---------------------------------------------
187        ncrnd = (lm-nltop+1)/2        ncrnd = (lm-nltop+1)/2
188    
189        if(first .and. myid.eq.0) then        if(first .and. myid.eq.1) then
190         print *         print *
191         print *,'Top Level Allowed for Convection : ',nltop         print *,'Top Level Allowed for Convection : ',nltop
192         print *,'          Highest Sub-Cloud Level: ',nsubmax         print *,'          Highest Sub-Cloud Level: ',nsubmax
# Line 229  c -------------------------------------- Line 230  c --------------------------------------
230    
231  c Set up the array of indeces of subcloud levels for the gathering  c Set up the array of indeces of subcloud levels for the gathering
232  c ----------------------------------------------------------------  c ----------------------------------------------------------------
233        index = 0        indx = 0
234        do L = nsubmin,nltop,-1        do L = nsubmin,nltop,-1
235         do j = 1,jm         do j = 1,jm
236         do i = 1,im         do i = 1,im
237          if(levpbl(i,j).eq.L) then          if(levpbl(i,j).eq.L) then
238           index = index + 1           indx = indx + 1
239           pblindex(index) = (j-1)*im + i           pblindex(indx) = (j-1)*im + i
240          endif          endif
241         enddo         enddo
242         enddo         enddo
243        enddo        enddo
244    
245        do index = 1,im*jm        do indx = 1,im*jm
246         levgather(index) = levpbl(pblindex(index),1)         levgather(indx) = levpbl(pblindex(indx),1)
247          pigather(index) =     pz(pblindex(index),1)          pigather(indx) =     pz(pblindex(indx),1)
248          pkegather(index,lm+1) = pkht(pblindex(index),1,lm+1)          pkegather(indx,lm+1) = pkht(pblindex(indx),1,lm+1)
249          plegather(index,lm+1) = plze(pblindex(index),1,lm+1)          plegather(indx,lm+1) = plze(pblindex(indx),1,lm+1)
250        enddo        enddo
251    
252        do L = 1,lm        do L = 1,lm
253         do index = 1,im*jm         do indx = 1,im*jm
254           thgather(index,L) = tz(pblindex(index),1,L)           thgather(indx,L) = tz(pblindex(indx),1,L)
255           shgather(index,L) = qz(pblindex(index),1,L,1)           shgather(indx,L) = qz(pblindex(indx),1,L,1)
256          pkegather(index,L) = pkht(pblindex(index),1,L)          pkegather(indx,L) = pkht(pblindex(indx),1,L)
257          pkzgather(index,L) = pkl(pblindex(index),1,L)          pkzgather(indx,L) = pkl(pblindex(indx),1,L)
258          plegather(index,L) = plze(pblindex(index),1,L)          plegather(indx,L) = plze(pblindex(indx),1,L)
259          plzgather(index,L) = plz(pblindex(index),1,L)          plzgather(indx,L) = plz(pblindex(indx),1,L)
260           dpgather(index,L) = dpres(pblindex(index),1,L)           dpgather(indx,L) = dpres(pblindex(indx),1,L)
261         enddo         enddo
262        enddo        enddo
263        do nt = 1,ntracer-ptracer        do nt = 1,ntracer-ptracer
264        do L = 1,lm        do L = 1,lm
265         do index = 1,im*jm         do indx = 1,im*jm
266          ugather(index,L,nt) = qz(pblindex(index),1,L,nt+ptracer)          ugather(indx,L,nt) = qz(pblindex(indx),1,L,nt+ptracer)
267         enddo         enddo
268        enddo        enddo
269        enddo        enddo
# Line 603  C ************************************** Line 604  C **************************************
604    
605         CALL RNEVP (NN,ISTRIP,lm,TL,SHL,PCPEN,PL,CLFRAC,SP,DP,PLKE,         CALL RNEVP (NN,ISTRIP,lm,TL,SHL,PCPEN,PL,CLFRAC,SP,DP,PLKE,
606       .  PLK,TH,TMP1,TMP2,TMP3,ITMP1,ITMP2,PCNET,PRECIP,       .  PLK,TH,TMP1,TMP2,TMP3,ITMP1,ITMP2,PCNET,PRECIP,
607       .  CLSBTH,TMSTP,1.,cp,grav,alhl,gamfac,cldlz,rhcrit,offset,alpha)       .  CLSBTH,TMSTP,one,cp,grav,alhl,gamfac,cldlz,rhcrit,offset,alpha)
608    
609  C **********************************************************************  C **********************************************************************
610  C ****                     TENDENCY UPDATES                         ****  C ****                     TENDENCY UPDATES                         ****
# Line 775  C ************************************** Line 776  C **************************************
776  C                          BUMP DIAGNOSTICS  C                          BUMP DIAGNOSTICS
777  C **********************************************************************  C **********************************************************************
778    
779    
780  c Sub-Cloud Layer  c Sub-Cloud Layer
781  c -------------------------  c -------------------------
782        if( ipsubcld.ne.0 ) then        if( ipsubcld.ne.0 ) then
# Line 806  c Moist Processes Heating Rate Line 808  c Moist Processes Heating Rate
808  c ----------------------------  c ----------------------------
809        if(imoistt.gt.0) then        if(imoistt.gt.0) then
810        do L = 1,lm        do L = 1,lm
811        do i = 1,im*jm        do j = 1,jm
812        qdiag(i,1,imoistt+L-1,bi,bj) = qdiag(i,1,imoistt+L-1,bi,bj) +        do i = 1,im
813       .                      (dtmoist(i,1,L)*sday*pkzgather(i,L)/pz(i,1))         indgath = (j-1)*im + i
814          qdiag(i,j,imoistt+L-1,bi,bj) = qdiag(i,j,imoistt+L-1,bi,bj) +
815         .    (dtmoist(i,j,L)*sday*pkzgather(indgath,L)/pz(i,j))
816          enddo
817        enddo        enddo
818        enddo        enddo
819        endif        endif
# Line 830  c Cloud Mass Flux Line 835  c Cloud Mass Flux
835  c ---------------  c ---------------
836        if(icldmas.gt.0) then        if(icldmas.gt.0) then
837        do L = 1,lm        do L = 1,lm
838        do i = 1,im*jm        do j = 1,jm
839        qdiag(i,1,icldmas+L-1,bi,bj) = qdiag(i,1,icldmas+L-1,bi,bj) +        do i = 1,im
840       .                                                  tmpgather(i,L)         indgath = (j-1)*im + i
841          qdiag(i,j,icldmas+L-1,bi,bj) = qdiag(i,j,icldmas+L-1,bi,bj) +
842         .                               tmpgather(indgath,L)
843          enddo
844        enddo        enddo
845        enddo        enddo
846        endif        endif
# Line 841  c Detrained Cloud Mass Flux Line 849  c Detrained Cloud Mass Flux
849  c -------------------------  c -------------------------
850        if(idtrain.gt.0) then        if(idtrain.gt.0) then
851        do L = 1,lm        do L = 1,lm
852        do i = 1,im*jm        do j = 1,jm
853        qdiag(i,1,idtrain+L-1,bi,bj) = qdiag(i,1,idtrain+L-1,bi,bj) +        do i = 1,im
854       .                                                  pkegather(i,L)         indgath = (j-1)*im + i
855          qdiag(i,j,idtrain+L-1,bi,bj) = qdiag(i,j,idtrain+L-1,bi,bj) +
856         .                                pkegather(indgath,L)
857          enddo
858        enddo        enddo
859        enddo        enddo
860        endif        endif
# Line 852  c Grid-Scale Condensational Heating Rate Line 863  c Grid-Scale Condensational Heating Rate
863  c --------------------------------------  c --------------------------------------
864        if(idtls.gt.0) then        if(idtls.gt.0) then
865        do L = 1,lm        do L = 1,lm
866        do i = 1,im*jm        do j = 1,jm
867        qdiag(i,1,idtls+L-1,bi,bj) = qdiag(i,1,idtls+L-1,bi,bj) +        do i = 1,im
868       .                                                  deltrnev(i,L)         indgath = (j-1)*im + i
869          qdiag(i,j,idtls+L-1,bi,bj) = qdiag(i,j,idtls+L-1,bi,bj) +
870         .                               deltrnev(indgath,L)
871          enddo
872        enddo        enddo
873        enddo        enddo
874        endif        endif
# Line 863  c Grid-Scale Condensational Moistening R Line 877  c Grid-Scale Condensational Moistening R
877  c -----------------------------------------  c -----------------------------------------
878        if(idqls.gt.0) then        if(idqls.gt.0) then
879        do L = 1,lm        do L = 1,lm
880        do i = 1,im*jm        do j = 1,jm
881        qdiag(i,1,idqls+L-1,bi,bj) = qdiag(i,1,idqls+L-1,bi,bj) +        do i = 1,im
882       .                                                  delqrnev(i,L)         indgath = (j-1)*im + i
883          qdiag(i,j,idqls+L-1,bi,bj) = qdiag(i,j,idqls+L-1,bi,bj) +
884         .                                delqrnev(indgath,L)
885          enddo
886        enddo        enddo
887        enddo        enddo
888        endif        endif
# Line 886  c ------------------- Line 903  c -------------------
903  c Convective Precipitation  c Convective Precipitation
904  c ------------------------  c ------------------------
905        if(iprecon.gt.0) then        if(iprecon.gt.0) then
906        do i = 1,im*jm        do j = 1,jm
907        qdiag(i,1,iprecon,bi,bj) = qdiag(i,1,iprecon,bi,bj) +        do i = 1,im
908       .                                         raincgath(i)*sday*tminv         indgath = (j-1)*im + i
909          qdiag(i,j,iprecon,bi,bj) = qdiag(i,j,iprecon,bi,bj) +
910         .                      raincgath(indgath)*sday*tminv
911          enddo
912        enddo        enddo
913        endif        endif
914    
# Line 1042  C ************************************** Line 1062  C **************************************
1062         nlwcld   = nlwcld   + 1         nlwcld   = nlwcld   + 1
1063         nswcld   = nswcld   + 1         nswcld   = nswcld   + 1
1064    
1065    #ifdef ALLOW_DIAGNOSTICS
1066           if( (bi.eq.1) .and. (bj.eq.1) ) then
1067         nmoistt  = nmoistt  + 1         nmoistt  = nmoistt  + 1
1068         nmoistq  = nmoistq  + 1         nmoistq  = nmoistq  + 1
1069         npreacc  = npreacc  + 1         npreacc  = npreacc  + 1
# Line 1052  C ************************************** Line 1074  C **************************************
1074    
1075         ndtls  = ndtls  + 1         ndtls  = ndtls  + 1
1076         ndqls  = ndqls  + 1         ndqls  = ndqls  + 1
1077           endif
1078    #endif
1079    
1080        RETURN        RETURN
1081        END        END
1082        SUBROUTINE RAS( NN, LEN, LENC, K, NLTOP, nlayr, DT        SUBROUTINE RAS( NN, LNG, LENC, K, NLTOP, nlayr, DT
1083       *,               UOI, ntracer, POI, QOI, PRS, PRJ, rnd, ncrnd       *,               UOI, ntracer, POI, QOI, PRS, PRJ, rnd, ncrnd
1084       *,               RAINS, CLN, CLF, cldmas, detrain       *,               RAINS, CLN, CLF, cldmas, detrain
1085       *,               cp,grav,rkappa,alhl,rhfrac,rasmax )       *,               cp,grav,rkappa,alhl,rhfrac,rasmax )
# Line 1068  C Line 1092  C
1092        implicit none        implicit none
1093    
1094  C Argument List  C Argument List
1095        integer nn,len,lenc,k,nltop,nlayr        integer nn,lng,lenc,k,nltop,nlayr
1096        integer ntracer        integer ntracer
1097        integer ncrnd        integer ncrnd
1098        real dt        _RL dt
1099        real UOI(len,nlayr,ntracer),   POI(len,K)        _RL UOI(lng,nlayr,ntracer),   POI(lng,K)
1100        real QOI(len,K), PRS(len,K+1), PRJ(len,K+1)        _RL QOI(lng,K), PRS(lng,K+1), PRJ(lng,K+1)
1101        real rnd(ncrnd)        _RL rnd(ncrnd)
1102        real RAINS(len,K), CLN(len,K), CLF(len,K)        _RL RAINS(lng,K), CLN(lng,K), CLF(lng,K)
1103        real cldmas(len,K), detrain(len,K)        _RL cldmas(lng,K), detrain(lng,K)
1104        real cp,grav,rkappa,alhl,rhfrac(len),rasmax        _RL cp,grav,rkappa,alhl,rhfrac(lng),rasmax
1105    
1106  C Local Variables  C Local Variables
1107        real TCU(len,K), QCU(len,K)        _RL TCU(lng,K), QCU(lng,K)
1108        real ucu(len,K,ntracer)        _RL ucu(lng,K,ntracer)
1109        real ALF(len,K), BET(len,K), GAM(len,K)        _RL ALF(lng,K), BET(lng,K), GAM(lng,K)
1110       *,         ETA(len,K), HOI(len,K)       *,         ETA(lng,K), HOI(lng,K)
1111       *,         PRH(len,K), PRI(len,K)       *,         PRH(lng,K), PRI(lng,K)
1112        real HST(len,K), QOL(len,K), GMH(len,K)        _RL HST(lng,K), QOL(lng,K), GMH(lng,K)
1113    
1114        real TX1(len), TX2(len), TX3(len), TX4(len), TX5(len)        _RL TX1(lng), TX2(lng), TX3(lng), TX4(lng), TX5(lng)
1115       *,         TX6(len), TX7(len), TX8(len), TX9(len)       *,         TX6(lng), TX7(lng), TX8(lng), TX9(lng)
1116       *,         TX11(len), TX12(len), TX13(len), TX14(len,ntracer)       *,         TX11(lng), TX12(lng), TX13(lng), TX14(lng,ntracer)
1117       *,         TX15(len)       *,         TX15(lng)
1118       *,         WFN(len)       *,         WFN(lng)
1119        integer IA1(len), IA2(len), IA3(len)        integer IA1(lng), IA2(lng), IA3(lng)
1120        real cloudn(len), pcu(len)        _RL cloudn(lng), pcu(lng)
1121    
1122        integer krmin,icm        integer krmin,icm
1123        real rknob, cmb2pa        _RL rknob, cmb2pa
1124        PARAMETER (KRMIN=01)        PARAMETER (KRMIN=01)
1125        PARAMETER (ICM=1000)        PARAMETER (ICM=1000)
1126        PARAMETER (CMB2PA=100.0)        PARAMETER (CMB2PA=100.0)
1127        PARAMETER (rknob = 10.)        PARAMETER (rknob = 10.)
1128    
1129        integer IC(ICM),   IRND(icm)        integer IC(ICM),   IRND(icm)
1130        real cmass(len,K)        _RL cmass(lng,K)
1131        LOGICAL SETRAS        LOGICAL SETRAS
1132    
1133        integer i,L,nc,ib,nt        integer i,L,nc,ib,nt
1134        integer km1,kp1,kprv,kcr,kfx,ncmx        integer km1,kp1,kprv,kcr,kfx,ncmx
1135        real p00, crtmsf, frac, rasblf        _RL p00, crtmsf, frac, rasblf
1136    
1137        do L = 1,k        do L = 1,k
1138        do I = 1,LENC        do I = 1,LENC
# Line 1168  c ------------------------------- Line 1192  c -------------------------------
1192        cloudn(i) = 0.0        cloudn(i) = 0.0
1193        enddo        enddo
1194    
1195         CALL CLOUD(nn,LEN, LENC, K, NLTOP, nlayr, IB, RASBLF,SETRAS,FRAC         CALL CLOUD(nn,lng, LENC, K, NLTOP, nlayr, IB, RASBLF,SETRAS,FRAC
1196       *,           CP,  ALHL, RKAPPA, GRAV, P00, CRTMSF       *,           CP,  ALHL, RKAPPA, GRAV, P00, CRTMSF
1197       *,           POI, QOI, UOI, Ntracer, PRS, PRJ       *,           POI, QOI, UOI, Ntracer, PRS, PRJ
1198       *,           PCU, CLOUDN, TCU, QCU, UCU, CMASS       *,           PCU, CLOUDN, TCU, QCU, UCU, CMASS
# Line 1244  c -------------------------------------- Line 1268  c --------------------------------------
1268        subroutine rndcloud (iras,nrnd,rnd,myid)        subroutine rndcloud (iras,nrnd,rnd,myid)
1269        implicit none        implicit none
1270        integer n,iras,nrnd,myid        integer n,iras,nrnd,myid
1271        real random_numbx        _RL random_numbx
1272        real rnd(nrnd)        _RL rnd(nrnd)
1273        integer irm        integer irm
1274        parameter (irm = 1000)        parameter (irm = 1000)
1275        real random(irm)        _RL random(irm)
1276        integer i,mcheck,numrand,iseed,index        integer i,mcheck,numrand,iseed,indx
1277        logical first        logical first
1278        data    first /.true./        data    first /.true./
1279        integer iras0        integer iras0
# Line 1260  c -------------------------------------- Line 1284  c --------------------------------------
1284         do i = 1,nrnd         do i = 1,nrnd
1285          rnd(i) = 0          rnd(i) = 0
1286         enddo         enddo
1287         if(first .and. myid.eq.0) print *,' NO RANDOM CLOUDS IN RAS '         if(first .and. myid.eq.1) print *,' NO RANDOM CLOUDS IN RAS '
1288         go to 100         go to 100
1289        endif        endif
1290    
# Line 1269  c -------------------------------------- Line 1293  c --------------------------------------
1293  c First Time In From a Continuing RESTART (IRAS.GT.1) or Reading a New RESTART  c First Time In From a Continuing RESTART (IRAS.GT.1) or Reading a New RESTART
1294  c ----------------------------------------------------------------------------  c ----------------------------------------------------------------------------
1295        if( first.and.(iras.gt.1) .or. iras.ne.iras0+1 )then        if( first.and.(iras.gt.1) .or. iras.ne.iras0+1 )then
1296         if( myid.eq.0 ) print *, 'Recreating Rand Numb Array in RNDCLOUD'         if( myid.eq.1 ) print *, 'Recreating Rand Numb Array in RNDCLOUD'
1297         if( myid.eq.0 ) print *, 'IRAS: ',iras,'  IRAS0: ',iras0         if( myid.eq.1 ) print *, 'IRAS: ',iras,'  IRAS0: ',iras0
1298         numrand = mod(iras,irm/nrnd) * nrnd         numrand = mod(iras,irm/nrnd) * nrnd
1299         iseed   = iras * nrnd - numrand         iseed   = iras * nrnd - numrand
1300         call random_seedx(iseed)         call random_seedx(iseed)
1301         do i = 1,irm         do i = 1,irm
1302          random(i) = random_numbx()          random(i) = random_numbx(iseed)
1303         enddo         enddo
1304         index = (iras-1)*nrnd         indx = (iras-1)*nrnd
1305    
1306  c Multiple Time In But have Used Up all 1000 numbers (MCHECK.EQ.0)  c Multiple Time In But have Used Up all 1000 numbers (MCHECK.EQ.0)
1307  c ----------------------------------------------------------------  c ----------------------------------------------------------------
# Line 1285  c -------------------------------------- Line 1309  c --------------------------------------
1309            iseed = (iras-1)*nrnd            iseed = (iras-1)*nrnd
1310            call random_seedx(iseed)            call random_seedx(iseed)
1311            do i = 1,irm            do i = 1,irm
1312             random(i) = random_numbx()             random(i) = random_numbx(iseed)
1313            enddo            enddo
1314            index = iseed            indx = iseed
1315    
1316  c Multiple Time In But have NOT Used Up all 1000 numbers (MCHECK.NE.0)  c Multiple Time In But have NOT Used Up all 1000 numbers (MCHECK.NE.0)
1317  c --------------------------------------------------------------------  c --------------------------------------------------------------------
1318        else        else
1319            index = (iras-1)*nrnd            indx = (iras-1)*nrnd
1320        endif        endif
1321    
1322            index = mod(index,irm)            indx = mod(indx,irm)
1323        if( index+nrnd.gt.1000 ) index=1000-nrnd        if( indx+nrnd.gt.1000 ) indx=1000-nrnd
1324    
1325        do n = 1,nrnd        do n = 1,nrnd
1326         rnd(n) = random(index+n)         rnd(n) = random(indx+n)
1327        enddo        enddo
1328    
1329   100  continue   100  continue
# Line 1307  c -------------------------------------- Line 1331  c --------------------------------------
1331        iras0 = iras        iras0 = iras
1332        return        return
1333        end        end
1334        function random_numbx()        function random_numbx(iseed)
1335        implicit none        implicit none
1336        real random_numbx        integer iseed
1337          real *8 seed,port_rand
1338          _RL random_numbx
1339        random_numbx = 0        random_numbx = 0
1340  #ifdef CRAY  #ifdef CRAY
1341        real ranf        _RL ranf
1342        random_numbx = ranf()        random_numbx = ranf()
1343  #endif  #else
1344  #ifdef SGI  #ifdef SGI
1345        real rand        _RL rand
1346        random_numbx = rand()        random_numbx = rand()
1347  #endif  #endif
1348          random_numbx = port_rand(seed)
1349    #endif
1350        return        return
1351        end        end
1352        subroutine random_seedx (iseed)        subroutine random_seedx (iseed)
# Line 1334  c -------------------------------------- Line 1362  c --------------------------------------
1362  #endif  #endif
1363        return        return
1364        end        end
1365        SUBROUTINE CLOUD(nn,LEN, LENC, K, NLTOP, nlayr, IC, RASALF        SUBROUTINE CLOUD(nn,lng, LENC, K, NLTOP, nlayr, IC, RASALF
1366       *,                 SETRAS, FRAC       *,                 SETRAS, FRAC
1367       *,                 CP,  ALHL, RKAP, GRAV, P00, CRTMSF       *,                 CP,  ALHL, RKAP, GRAV, P00, CRTMSF
1368       *,                 POI, QOI, UOI, Ntracer, PRS,  PRJ       *,                 POI, QOI, UOI, Ntracer, PRS,  PRJ
# Line 1376  C Line 1404  C
1404  C  Input:  C  Input:
1405  C  ------  C  ------
1406  C  C
1407  C     LEN     : The inner dimension of update and input arrays.  C     lng     : The inner dimension of update and input arrays.
1408  C  C
1409  C     LENC    : The run: the number of soundings processes in a single call.  C     LENC    : The run: the number of soundings processes in a single call.
1410  C               RAS works on the first LENC of the LEN soundings  C               RAS works on the first LENC of the lng soundings
1411  C               passed. This allows working on pieces of the world  C               passed. This allows working on pieces of the world
1412  C               say for multitasking, without declaring temporary arrays  C               say for multitasking, without declaring temporary arrays
1413  C               and copying the data to and from them.  This is an f77  C               and copying the data to and from them.  This is an f77
1414  C               version. An F90 version would have to allow more  C               version. An F90 version would have to allow more
1415  C               flexibility in the argument declarations.  Obviously  C               flexibility in the argument declarations.  Obviously
1416  C               (LENC<=LEN).    C               (LENC<=lng).  
1417  C  C
1418  C     K       : Number of vertical layers (increasing downwards).  C     K       : Number of vertical layers (increasing downwards).
1419  C               Need not be the same as the number of layers in the  C               Need not be the same as the number of layers in the
# Line 1416  C     CRTMSF  : Critical value of mass f Line 1444  C     CRTMSF  : Critical value of mass f
1444  C               the detrainment layer of that cloud-type is assumed.  C               the detrainment layer of that cloud-type is assumed.
1445  C               Affects only cloudiness calculation.  C               Affects only cloudiness calculation.
1446  C  C
1447  C     POI     : 2D array of dimension (LEN,K) containing potential  C     POI     : 2D array of dimension (lng,K) containing potential
1448  C               temperature. Updated but not initialized by RAS.  C               temperature. Updated but not initialized by RAS.
1449  C  C
1450  C     QOI     : 2D array of dimension (LEN,K) containing specific  C     QOI     : 2D array of dimension (lng,K) containing specific
1451  C               humidity. Updated but not initialized by RAS.  C               humidity. Updated but not initialized by RAS.
1452  C  C
1453  C     UOI     : 3D array of dimension (LEN,K,NTRACER) containing tracers  C     UOI     : 3D array of dimension (lng,K,NTRACER) containing tracers
1454  C               Updated but not initialized by RAS.  C               Updated but not initialized by RAS.
1455  C  C
1456  C     PRS     : 2D array of dimension (LEN,K+1) containing pressure  C     PRS     : 2D array of dimension (lng,K+1) containing pressure
1457  C               in hPa at the interfaces of K-layers from top of the  C               in hPa at the interfaces of K-layers from top of the
1458  C               atmosphere to the bottom. Not modified.  C               atmosphere to the bottom. Not modified.
1459  C  C
1460  C     PRJ     : 2D array of dimension (LEN,K+1) containing (PRS/P00) **  C     PRJ     : 2D array of dimension (lng,K+1) containing (PRS/P00) **
1461  C               RKAP.  i.e. Exner function at layer edges. Not modified.  C               RKAP.  i.e. Exner function at layer edges. Not modified.
1462  C  C
1463  C     rhfrac  : 1D array of dimension (LEN) containing a rel.hum. scaling  C     rhfrac  : 1D array of dimension (lng) containing a rel.hum. scaling
1464  C               fraction. Not modified.  C               fraction. Not modified.
1465  C  C
1466  C  Output:  C  Output:
1467  C  -------  C  -------
1468  C  C
1469  C     PCU     : 1D array of length LEN containing accumulated  C     PCU     : 1D array of length lng containing accumulated
1470  C               precipitation in mm/sec.  C               precipitation in mm/sec.
1471  C  C
1472  C     CLN     : 2D array of dimension (LEN,K) containing cloudiness  C     CLN     : 2D array of dimension (lng,K) containing cloudiness
1473  C               Note:  CLN is bumped but NOT initialized  C               Note:  CLN is bumped but NOT initialized
1474  C  C
1475  C     TCU     : 2D array of dimension (LEN,K) containing accumulated  C     TCU     : 2D array of dimension (lng,K) containing accumulated
1476  C               convective heating (K/sec).  C               convective heating (K/sec).
1477  C  C
1478  C     QCU     : 2D array of dimension (LEN,K) containing accumulated  C     QCU     : 2D array of dimension (lng,K) containing accumulated
1479  C               convective drying (kg/kg/sec).  C               convective drying (kg/kg/sec).
1480  C  C
1481  C     CMASS   : 2D array of dimension (LEN,K) containing the  C     CMASS   : 2D array of dimension (lng,K) containing the
1482  C               cloud mass flux (kg/sec). Filled from cloud top  C               cloud mass flux (kg/sec). Filled from cloud top
1483  C               to base.  C               to base.
1484  C  C
# Line 1470  C Line 1498  C
1498  C************************************************************************  C************************************************************************
1499        implicit none        implicit none
1500  C Argument List declarations  C Argument List declarations
1501        integer nn,LEN,LENC,K,NLTOP,nlayr,ic,ntracer        integer nn,lng,LENC,K,NLTOP,nlayr,ic,ntracer
1502        real rasalf        _RL rasalf
1503        LOGICAL SETRAS        LOGICAL SETRAS
1504        real frac, cp,  alhl, rkap, grav, p00, crtmsf        _RL frac, cp,  alhl, rkap, grav, p00, crtmsf
1505        real POI(LEN,K),QOI(LEN,K),PRS(LEN,K+1),PRJ(LEN,K+1)        _RL POI(lng,K),QOI(lng,K),PRS(lng,K+1),PRJ(lng,K+1)
1506        real uoi(len,nlayr,ntracer)        _RL uoi(lng,nlayr,ntracer)
1507        real PCU(LENC), CLN(LEN)        _RL PCU(LENC), CLN(lng)
1508        real TCU(LEN,K),  QCU(LEN,K),  ucu(len,k,ntracer), CMASS(LEN,K)        _RL TCU(lng,K),  QCU(lng,K),  ucu(lng,k,ntracer), CMASS(lng,K)
1509        real ALF(LEN,K), BET(LEN,K),  GAM(LEN,K), PRH(LEN,K), PRI(LEN,K)        _RL ALF(lng,K), BET(lng,K),  GAM(lng,K), PRH(lng,K), PRI(lng,K)
1510        real HOL(LENC,K), ETA(LENC,K), HST(LENC,K), QOL(LENC,K)        _RL HOL(LENC,K), ETA(LENC,K), HST(LENC,K), QOL(LENC,K)
1511        real GMH(LENC,K)        _RL GMH(LENC,K)
1512        real TX1(LENC), TX2(LENC), TX3(LENC), TX4(LENC)        _RL TX1(LENC), TX2(LENC), TX3(LENC), TX4(LENC)
1513        real TX5(LENC), TX6(LENC), TX7(LENC), TX8(LENC)        _RL TX5(LENC), TX6(LENC), TX7(LENC), TX8(LENC)
1514        real ALM(LENC), WFN(LENC), AKM(LENC), QS1(LENC)        _RL ALM(LENC), WFN(LENC), AKM(LENC), QS1(LENC)
1515        real WLQ(LENC), CLF(LENC)        _RL WLQ(LENC), CLF(LENC)
1516        real uht(len,ntracer)        _RL uht(lng,ntracer)
1517        integer IA(LENC), I1(LENC),I2(LENC)        integer IA(LENC), I1(LENC),I2(LENC)
1518        real      rhfrac(len)        _RL      rhfrac(lng)
1519    
1520  C Local Variables  C Local Variables
1521        real daylen,half,one,zero,cmb2pa,rhmax        _RL daylen,half,one,zero,cmb2pa,rhmax
1522        PARAMETER (DAYLEN=86400.0,  HALF=0.5,  ONE=1.0, ZERO=0.0)        PARAMETER (DAYLEN=86400.0,  HALF=0.5,  ONE=1.0, ZERO=0.0)
1523        PARAMETER (CMB2PA=100.0)        PARAMETER (CMB2PA=100.0)
1524        PARAMETER (RHMAX=0.9999)        PARAMETER (RHMAX=0.9999)
1525        real rkapp1,onebcp,albcp,onebg,cpbg,twobal        _RL rkapp1,onebcp,albcp,onebg,cpbg,twobal
1526  C  C
1527        integer nt,km1,ic1,i,L,len1,len2,isav,len11,ii        integer nt,km1,ic1,i,L,len1,len2,isav,len11,ii
1528        integer lena,lena1,lenb,tem,tem1        integer lena,lena1,lenb
1529          _RL tem,tem1
1530    
1531  c Explicit Inline Directives  c Explicit Inline Directives
1532  c --------------------------  c --------------------------
# Line 1546  C Line 1575  C
1575  C  C
1576  C  C
1577        DO 10 L=1,K        DO 10 L=1,K
1578        DO 10 I=1,LEN        DO 10 I=1,lng
1579        TCU(I,L) = 0.0        TCU(I,L) = 0.0
1580        QCU(I,L) = 0.0        QCU(I,L) = 0.0
1581        CMASS(I,L) = 0.0        CMASS(I,L) = 0.0
# Line 2080  C Line 2109  C
2109    
2110        RETURN        RETURN
2111        END        END
2112        SUBROUTINE RNCL(LEN, PL, RNO, CLF)        SUBROUTINE RNCL(lng, PL, RNO, CLF)
2113  C  C
2114  C*********************************************************************  C*********************************************************************
2115  C********************** Relaxed Arakawa-Schubert *********************  C********************** Relaxed Arakawa-Schubert *********************
# Line 2089  C**************************** 23 July 19 Line 2118  C**************************** 23 July 19
2118  C*********************************************************************  C*********************************************************************
2119        implicit none        implicit none
2120  C Argument List declarations  C Argument List declarations
2121        integer len        integer lng
2122        real PL(LEN),  RNO(LEN), CLF(LEN)        _RL PL(lng),  RNO(lng), CLF(lng)
2123    
2124  C Local Variables  C Local Variables
2125        real p5,p8,pt8,pt2,pfac,p4,p6,p7,p9,cucld,cfac        _RL p5,p8,pt8,pt2,pfac,p4,p6,p7,p9,cucld,cfac
2126        PARAMETER (P5=500.0,  P8=800.0, PT8=0.8, PT2=0.2)        PARAMETER (P5=500.0,  P8=800.0, PT8=0.8, PT2=0.2)
2127        PARAMETER (PFAC=PT2/(P8-P5))        PARAMETER (PFAC=PT2/(P8-P5))
2128        PARAMETER (P4=400.0,    P6=401.0)        PARAMETER (P4=400.0,    P6=401.0)
# Line 2102  C Local Variables Line 2131  C Local Variables
2131    
2132        integer i        integer i
2133  C  C
2134        DO 10 I=1,LEN        DO 10 I=1,lng
2135                             rno(i) = 1.0                             rno(i) = 1.0
2136  ccc   if( pl(i).le.400.0 ) rno(i) = max( 0.75, 1.0-0.0025*(400.0-pl(i)) )  ccc   if( pl(i).le.400.0 ) rno(i) = max( 0.75, 1.0-0.0025*(400.0-pl(i)) )
2137    
# Line 2129  CARIES Line 2158  CARIES
2158  C  C
2159        RETURN        RETURN
2160        END        END
2161        SUBROUTINE ACRITN ( LEN,PL,PLB,ACR )        SUBROUTINE ACRITN ( lng,PL,PLB,ACR )
2162    
2163  C*********************************************************************  C*********************************************************************
2164  C********************** Relaxed Arakawa-Schubert *********************  C********************** Relaxed Arakawa-Schubert *********************
# Line 2142  C**** Line 2171  C****
2171  C*********************************************************************  C*********************************************************************
2172        implicit none        implicit none
2173  C Argument List declarations  C Argument List declarations
2174        integer len        integer lng
2175        real PL(LEN), PLB(LEN), ACR(LEN)        _RL PL(lng), PLB(lng), ACR(lng)
2176    
2177  C Local variables  C Local variables
2178        integer lma        integer lma
2179        parameter  (lma=18)        parameter  (lma=18)
2180        real p(lma)        _RL p(lma)
2181        real a(lma)        _RL a(lma)
2182        integer i,L        integer i,L
2183        real temp        _RL temp
2184    
2185        data p  / 93.81, 111.65, 133.46, 157.80, 186.51,        data p  / 93.81, 111.65, 133.46, 157.80, 186.51,
2186       .         219.88, 257.40, 301.21, 352.49, 409.76,       .         219.88, 257.40, 301.21, 352.49, 409.76,
# Line 2165  C Local variables Line 2194  C Local variables
2194    
2195    
2196        do L=1,lma-1        do L=1,lma-1
2197        do i=1,len        do i=1,lng
2198           if( pl(i).ge.p(L)   .and.           if( pl(i).ge.p(L)   .and.
2199       .       pl(i).le.p(L+1)) then       .       pl(i).le.p(L+1)) then
2200           temp = ( pl(i)-p(L) )/( p(L+1)-p(L) )           temp = ( pl(i)-p(L) )/( p(L+1)-p(L) )
# Line 2174  C Local variables Line 2203  C Local variables
2203        enddo        enddo
2204        enddo        enddo
2205    
2206        do i=1,len        do i=1,lng
2207        if( pl(i).lt.p(1)   ) acr(i) = a(1)        if( pl(i).lt.p(1)   ) acr(i) = a(1)
2208        if( pl(i).gt.p(lma) ) acr(i) = a(lma)        if( pl(i).gt.p(lma) ) acr(i) = a(lma)
2209        enddo        enddo
2210    
2211        do i=1,len        do i=1,lng
2212        acr(i) = acr(i) * (plb(i)-pl(i))        acr(i) = acr(i) * (plb(i)-pl(i))
2213        enddo        enddo
2214    
# Line 2192  C Local variables Line 2221  C Local variables
2221        implicit none        implicit none
2222  C Argument List declarations  C Argument List declarations
2223        integer nn,irun,nlay        integer nn,irun,nlay
2224        real TL(IRUN,NLAY),QL(IRUN,NLAY),RAIN(IRUN,NLAY),        _RL TL(IRUN,NLAY),QL(IRUN,NLAY),RAIN(IRUN,NLAY),
2225       . PL(IRUN,NLAY),CLFRAC(IRUN,NLAY),SP(IRUN),TEMP1(IRUN,NLAY),       . PL(IRUN,NLAY),CLFRAC(IRUN,NLAY),SP(IRUN),TEMP1(IRUN,NLAY),
2226       . TEMP2(IRUN,NLAY),PLKE(IRUN,NLAY+1),       . TEMP2(IRUN,NLAY),PLKE(IRUN,NLAY+1),
2227       . RCON(IRUN),RLAR(IRUN),DP(IRUN,NLAY),PLK(IRUN,NLAY),TH(IRUN,NLAY),       . RCON(IRUN),RLAR(IRUN),DP(IRUN,NLAY),PLK(IRUN,NLAY),TH(IRUN,NLAY),
2228       . TEMP3(IRUN,NLAY)       . TEMP3(IRUN,NLAY)
2229        integer ITMP1(IRUN,NLAY),ITMP2(IRUN,NLAY)        integer ITMP1(IRUN,NLAY),ITMP2(IRUN,NLAY)
2230        real CLSBTH(IRUN,NLAY)        _RL CLSBTH(IRUN,NLAY)
2231        real tmscl,tmfrc,cp,gravity,alhl,gamfac,offset,alpha        _RL tmscl,tmfrc,cp,gravity,alhl,gamfac,offset,alpha
2232        real cldlz(irun,nlay)        _RL cldlz(irun,nlay)
2233        real rhcrit(irun,nlay)        _RL rhcrit(irun,nlay)
2234  C  C
2235  C Local Variables  C Local Variables
2236        real zm1p04,zero,two89,zp44,zp01,half,zp578,one,thousand,z3600        _RL zm1p04,zero,two89,zp44,zp01,half,zp578,one,thousand,z3600
2237        real zp1,zp001        _RL zp1,zp001
2238        PARAMETER (ZM1P04 = -1.04E-4 )        PARAMETER (ZM1P04 = -1.04E-4 )
2239        PARAMETER (ZERO = 0.)        PARAMETER (ZERO = 0.)
2240        PARAMETER (TWO89= 2.89E-5)        PARAMETER (TWO89= 2.89E-5)
# Line 2219  C Local Variables Line 2248  C Local Variables
2248        PARAMETER ( THOUSAND = 1000.)        PARAMETER ( THOUSAND = 1000.)
2249        PARAMETER ( Z3600 = 3600.)        PARAMETER ( Z3600 = 3600.)
2250  C  C
2251        real EVP9(IRUN,NLAY)        _RL EVP9(IRUN,NLAY)
2252        real water(irun),crystal(irun)        _RL water(irun),crystal(irun)
2253        real watevap(irun),iceevap(irun)        _RL watevap(irun),iceevap(irun)
2254        real fracwat,fracice, tice,rh,fact,dum        _RL fracwat,fracice, tice,rh,fact,dum
2255        real rainmax(irun)        _RL rainmax(irun)
2256        real getcon,rphf,elocp,cpog,relax        _RL getcon,rphf,elocp,cpog,relax
2257        real exparg,arearat,rpow        _RL exparg,arearat,rpow
2258    
2259        integer i,L,n,nlaym1,irnlay,irnlm1        integer i,L,n,nlaym1,irnlay,irnlm1
2260    
# Line 2433  C*************************************** Line 2462  C***************************************
2462        implicit none        implicit none
2463        integer  irun,irise        integer  irun,irise
2464    
2465        real   th(irun,irise)        _RL   th(irun,irise)
2466        real    q(irun,irise)        _RL    q(irun,irise)
2467        real  plk(irun,irise)        _RL  plk(irun,irise)
2468        real   pl(irun,irise)        _RL   pl(irun,irise)
2469        real plke(irun,irise+1)        _RL plke(irun,irise+1)
2470    
2471        real  cloud(irun,irise)        _RL  cloud(irun,irise)
2472        real cldwat(irun,irise)        _RL cldwat(irun,irise)
2473        real     qs(irun,irise)        _RL     qs(irun,irise)
2474    
2475        real cp, alhl, getcon, akap        _RL cp, alhl, getcon, akap
2476        real ratio, temp, elocp        _RL ratio, temp, elocp
2477        real rhcrit,rh,dum        _RL rhcrit,rh,dum
2478        integer i,L        integer i,L
2479    
2480        real rhc(irun,irise)        _RL rhc(irun,irise)
2481        real offset,alpha        _RL offset,alpha
2482    
2483  c Explicit Inline Directives  c Explicit Inline Directives
2484  c --------------------------  c --------------------------
# Line 2495  c -------------------------------------- Line 2524  c --------------------------------------
2524        subroutine ctei ( th,q,cldfrc,cldwat,pl,plk,plke,im,lm )        subroutine ctei ( th,q,cldfrc,cldwat,pl,plk,plke,im,lm )
2525        implicit none        implicit none
2526        integer im,lm        integer im,lm
2527        real  th(im,lm),q(im,lm),plke(im,lm+1),cldwat(im,lm)        _RL  th(im,lm),q(im,lm),plke(im,lm+1),cldwat(im,lm)
2528        real plk(im,lm),pl(im,lm),cldfrc(im,lm)        _RL plk(im,lm),pl(im,lm),cldfrc(im,lm)
2529        integer i,L        integer i,L
2530        real    getcon,cp,alhl,elocp,cpoel,t,p,s,qs,dqsdt,dq        _RL    getcon,cp,alhl,elocp,cpoel,t,p,s,qs,dqsdt,dq
2531        real    k,krd,kmm,f        _RL    k,krd,kmm,f
2532    
2533        cp     = getcon('CP')        cp     = getcon('CP')
2534        alhl   = getcon('LATENT HEAT COND')        alhl   = getcon('LATENT HEAT COND')
# Line 2536  c -------------------------------------- Line 2565  c --------------------------------------
2565        subroutine back2grd(gathered,indeces,scattered,irun)        subroutine back2grd(gathered,indeces,scattered,irun)
2566        implicit none        implicit none
2567        integer i,irun,indeces(irun)        integer i,irun,indeces(irun)
2568        real gathered(irun),scattered(irun)        _RL gathered(irun),scattered(irun)
2569        real temp(irun)        _RL temp(irun)
2570        do i = 1,irun        do i = 1,irun
2571         temp(indeces(i)) = gathered(i)         temp(indeces(i)) = gathered(i)
2572        enddo        enddo

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.22