16 |
|
|
17 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |
18 |
#include "SIZE.h" |
#include "SIZE.h" |
19 |
#include "diagnostics_SIZE.h" |
#include "DIAGNOSTICS_SIZE.h" |
20 |
#include "diagnostics.h" |
#include "DIAGNOSTICS.h" |
21 |
#endif |
#endif |
22 |
|
|
23 |
c Input Variables |
c Input Variables |
196 |
|
|
197 |
c Determine Total number of Random Clouds to Check |
c Determine Total number of Random Clouds to Check |
198 |
c --------------------------------------------- |
c --------------------------------------------- |
199 |
C ncrnd = (lm-nltop+1)/2 |
ncrnd = (lm-nltop+1)/2 |
|
ncrnd = 0 |
|
200 |
|
|
201 |
if(first .and. myid.eq.1 .and. bi.eq.1 ) then |
if(first .and. myid.eq.1 .and. bi.eq.1 ) then |
202 |
print * |
print * |
370 |
endif |
endif |
371 |
enddo |
enddo |
372 |
|
|
|
|
|
373 |
C Initiate a do-loop around RAS for the number of different |
C Initiate a do-loop around RAS for the number of different |
374 |
C sub-cloud layer depths in this strip |
C sub-cloud layer depths in this strip |
375 |
C --If all subcloud depths are the same, execute loop once |
C --If all subcloud depths are the same, execute loop once |
1216 |
integer IC(ICM), IRND(icm) |
integer IC(ICM), IRND(icm) |
1217 |
_RL cmass(lng,K) |
_RL cmass(lng,K) |
1218 |
LOGICAL SETRAS |
LOGICAL SETRAS |
1219 |
|
integer ifound |
1220 |
|
_RL temp |
1221 |
|
_RL thbef(lng,K) |
1222 |
|
|
1223 |
integer i,L,nc,ib,nt |
integer i,L,nc,ib,nt |
1224 |
integer km1,kp1,kprv,kcr,kfx,ncmx |
integer km1,kp1,kprv,kcr,kfx,ncmx |
1237 |
C allowed to entrain into the cloud |
C allowed to entrain into the cloud |
1238 |
|
|
1239 |
CCC FRAC = 1./dt |
CCC FRAC = 1./dt |
1240 |
|
CCC FRAC = 0.5/dt |
1241 |
FRAC = 0.5/dt |
FRAC = 0.5/dt |
1242 |
|
|
1243 |
KM1 = K - 1 |
KM1 = K - 1 |
1248 |
KPRV = KM1 |
KPRV = KM1 |
1249 |
C Removed KRMAX parameter |
C Removed KRMAX parameter |
1250 |
KCR = MIN(KM1,nlayr-2) |
KCR = MIN(KM1,nlayr-2) |
1251 |
CCC KFX = KM1 - KCR |
KFX = KM1 - KCR |
|
KFX = KM1 |
|
1252 |
NCMX = KFX + NCRND |
NCMX = KFX + NCRND |
1253 |
C |
C |
1254 |
IF (KFX .GT. 0) THEN |
IF (KFX .GT. 0) THEN |
1328 |
|
|
1329 |
DO L=IB,K |
DO L=IB,K |
1330 |
DO I=1,LENC |
DO I=1,LENC |
1331 |
|
thbef(I,L) = POI(I,L) |
1332 |
POI(I,L) = POI(I,L) + TCU(I,L) * DT * rhfrac(i) |
POI(I,L) = POI(I,L) + TCU(I,L) * DT * rhfrac(i) |
1333 |
QOI(I,L) = QOI(I,L) + QCU(I,L) * DT * rhfrac(i) |
QOI(I,L) = QOI(I,L) + QCU(I,L) * DT * rhfrac(i) |
1334 |
ENDDO |
ENDDO |
1344 |
rains(I,ib) = rains(I,ib) + PCU(I)*dt * rhfrac(i) |
rains(I,ib) = rains(I,ib) + PCU(I)*dt * rhfrac(i) |
1345 |
ENDDO |
ENDDO |
1346 |
|
|
1347 |
|
do i = 1,lenc |
1348 |
|
ifound = 0 |
1349 |
|
do L = 1,k |
1350 |
|
if(tcu(i,L).ne.0.)ifound = ifound + 1 |
1351 |
|
enddo |
1352 |
|
if(ifound.ne.0) then |
1353 |
|
c print *,i,' made a cloud detraining at ',ib |
1354 |
|
do L = 1,k |
1355 |
|
temp = TCU(I,L) * DT * rhfrac(i) |
1356 |
|
c write(6,122)L,thbef(i,L),poi(i,L),temp |
1357 |
|
enddo |
1358 |
|
endif |
1359 |
|
enddo |
1360 |
|
|
1361 |
100 CONTINUE |
100 CONTINUE |
1362 |
|
|
1363 |
|
122 format(' ',i3,' TH B ',e10.3,' TH A ',e10.3,' DTH ',e10.3) |
1364 |
|
|
1365 |
c Fill Convective Cloud Fractions based on 3-D Rain Amounts |
c Fill Convective Cloud Fractions based on 3-D Rain Amounts |
1366 |
c --------------------------------------------------------- |
c --------------------------------------------------------- |
1400 |
|
|
1401 |
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 |
1402 |
c ---------------------------------------------------------------------------- |
c ---------------------------------------------------------------------------- |
1403 |
|
c print *,' RNDCLOUD: first ',first,' iras ',iras,' iras0 ',iras0 |
1404 |
|
c print *,' RNDCLOUD: irm,nrnd,mcheck=',irm,nrnd,mcheck |
1405 |
if( first.and.(iras.gt.1) .or. iras.ne.iras0+1 )then |
if( first.and.(iras.gt.1) .or. iras.ne.iras0+1 )then |
1406 |
print *,' first ',first,' iras ',iras,' iras0 ',iras0 |
print *,' first ',first,' iras ',iras,' iras0 ',iras0 |
1407 |
if( myid.eq.1 ) print *, 'Recreating Rand Numb Array in RNDCLOUD' |
if( myid.eq.1 ) print *, 'Recreating Rand Numb Array in RNDCLOUD' |
1447 |
integer iseed |
integer iseed |
1448 |
real *8 seed,port_rand |
real *8 seed,port_rand |
1449 |
_RL random_numbx |
_RL random_numbx |
|
random_numbx = 0 |
|
1450 |
#ifdef CRAY |
#ifdef CRAY |
1451 |
_RL ranf |
_RL ranf |
1452 |
random_numbx = ranf() |
random_numbx = ranf() |
1454 |
#ifdef SGI |
#ifdef SGI |
1455 |
_RL rand |
_RL rand |
1456 |
random_numbx = rand() |
random_numbx = rand() |
1457 |
#endif |
#else |
1458 |
|
seed = -1.d0 |
1459 |
random_numbx = port_rand(seed) |
random_numbx = port_rand(seed) |
1460 |
#endif |
#endif |
1461 |
|
#endif |
1462 |
return |
return |
1463 |
end |
end |
1464 |
subroutine random_seedx (iseed) |
subroutine random_seedx (iseed) |
1466 |
integer iseed |
integer iseed |
1467 |
#ifdef CRAY |
#ifdef CRAY |
1468 |
call ranset (iseed) |
call ranset (iseed) |
1469 |
#endif |
#else |
1470 |
#ifdef SGI |
#ifdef SGI |
1471 |
integer*4 seed |
integer*4 seed |
1472 |
seed = iseed |
seed = iseed |
1473 |
call srand (seed) |
call srand (seed) |
1474 |
|
#else |
1475 |
|
real*8 tmpRdN |
1476 |
|
real*8 seed |
1477 |
|
seed = iseed |
1478 |
|
tmpRdN = port_rand(seed) |
1479 |
|
#endif |
1480 |
#endif |
#endif |
1481 |
return |
return |
1482 |
end |
end |