90 use vrbls4d,
only: dust,suso, salt, soot, waso,no3,nh4,ebb
91 use vrbls3d,
only: qqw, qqr, t, zint, cfr, qqi, qqs, q, ext, zmid,pmid,&
92 pint, duem, dusd, dudp, duwt, dusv, ssem, sssd,ssdp,&
93 sswt, sssv, bcem, bcsd, bcdp, bcwt, bcsv, ocem,ocsd,&
94 ocdp, ocwt, ocsv, sca, asy,cfr_raw
95 use vrbls2d,
only: cldefi, cfracl, avgcfracl, cfracm, avgcfracm, cfrach,&
96 avgcfrach, avgtcdc, ncfrst, acfrst, ncfrcv, acfrcv, &
97 hbot, hbotd, hbots, htop, htopd, htops, fis, pblh, &
98 pbot, pbotl, pbotm, pboth, cnvcfr, ptop, ptopl, &
99 ptopm, ptoph, ttopl, ttopm, ttoph, pblcfr, cldwork, &
100 aswin, auvbin, auvbinc, aswout,alwout, aswtoa, &
101 rlwtoa, czmean, czen, rswin, alwin, alwtoa, rlwin, &
102 sigt4, rswout, radot, rswinc, aswinc, aswoutc, &
103 aswtoac, alwoutc, aswtoac, avisbeamswin, &
104 avisdiffswin, aswintoa, aswtoac, airbeamswin, &
105 airdiffswin, dusmass, dusmass25, ducmass, ducmass25, &
106 alwinc, alwtoac, swddni, swddif, swdnbc, swddnic, &
107 swddifc, swupbc, lwdnbc, lwupbc, swupt, &
108 taod5502d, aerssa2d, aerasy2d, mean_frp, hwp, &
109 lwp, iwp, avgcprate, &
110 dustcb,sscb,bccb,occb,sulfcb,dustpm,sspm,aod550, &
111 du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550, &
112 pwat,dustpm10,maod,no3cb,nh4cb,aqm_aod550
113 use masks,
only: lmh, htm
114 use params_mod,
only: tfrz, d00, h99999, qcldmin, small, d608, h1, rog, &
115 gi, rd, qconv, abscoefi, abscoef, stbol, pq0, a2, &
117 use ctlblk_mod,
only: jsta, jend, spval, modelname, grib, cfld,datapd, &
118 fld_info, avrain, theat, ifhr, ifmin, avcnvc, &
119 tclod, ardsw, trdsw, ardlw, nbin_du, trdlw, im, &
120 nbin_ss, nbin_oc,nbin_bc,nbin_su,nbin_no3,dtq2, &
121 jm, lm, gocart_on, gccpp_on, nasa_on, me, rdaod, &
122 ista, iend,aqf_on,tsrfc
123 use rqstfld_mod,
only: iget, id, lvls, iavblfld
124 use gridspec_mod,
only: dyval, gridtype
125 use cmassi_mod,
only: trad_ice
126 use machine_post,
only: kind_phys
127 use upp_physics,
only: calrh, calcape
132 REAL,
PARAMETER :: C2K=273.15, ptop_low=64200., ptop_mid=35000., &
138 INTEGER :: lcbot,lctop,jc,ic
139 INTEGER,
dimension(ista:iend,jsta:jend) :: IBOTT, IBOTCu, IBOTDCu, IBOTSCu, IBOTGr, &
140 itopt, itopcu, itopdcu, itopscu, itopgr
141 REAL,
dimension(im,jm) :: GRID1
142 REAL,
dimension(ista:iend,jsta:jend) :: GRID2, EGRID1, EGRID2, EGRID3, &
143 cldp, cldz, cldt, cldzcu
144 REAL,
dimension(lm) :: RHB, watericetotal, pabovesfc
145 REAL :: watericemax, wimin, zcldbase, zcldtop, zpbltop, &
146 rhoice, coeffp, exponfp, const1, cloud_def_p, &
147 pcldbase, rhoair, vovermd, concfp, betav, &
148 vertvis, tx, tv, pol, esx, es, e, zsf, zcld, frac
149 integer nfog, nfogn(7),npblcld,nlifr, k1, k2, ll, ii, ib, n, jj, &
151 real,
dimension(lm) :: cldfra, cfr_layer_sum
152 real :: ceiling_thresh_cldfra, cldfra_max, &
153 zceil, zceil1, zceil2, previous_sum, &
154 ceil_min, ceil_neighbor
156 real,
dimension(im,jm) :: ceil
159 REAL,
dimension(ista:iend,jsta:jend) :: TCLD, CEILING
160 real CU_ir(LM), q_conv
162 integer I,J,L,K,IBOT,ITCLOD,LBOT,LTOP,ITRDSW,ITRDLW,ITSRFC, &
163 llmh,itheat,ifincr,itype,itop,num_thick
164 real DPBND,RRNUM,QCLD,RSUM,TLMH,FACTRS,FACTRL,DP, &
165 opdepth, tmp,qsat,rhum,tcext,delz,dely,dy_m
168 real,
allocatable :: full_ceil(:,:), full_fis(:,:)
170 real dummy(ista:iend,jsta:jend)
171 integer idummy(ista:iend,jsta:jend)
172 real full_dummy(im,jm)
181 integer,
parameter :: KRHLEV = 36
182 integer,
parameter :: KCM1 = 5
183 integer,
parameter :: KCM2 = 6
184 integer,
parameter :: NBDSW = 7
185 integer,
parameter :: NOAER = 20
186 CHARACTER :: AerosolName(KCM2)*4, AerosolName_rd*4, aerosol_file*30
187 CHARACTER :: AerName_rd*4, AerOpt*3
190 REAL,
ALLOCATABLE :: extrhd_DU(:,:,:), extrhd_SS(:,:,:), &
191 & extrhd_SU(:,:,:), extrhd_BC(:,:,:), &
192 & extrhd_OC(:,:,:), extrhd_NI(:,:,:)
195 REAL,
ALLOCATABLE :: scarhd_DU(:,:,:), scarhd_SS(:,:,:), &
196 & scarhd_SU(:,:,:), scarhd_BC(:,:,:), &
197 & scarhd_OC(:,:,:), scarhd_NI(:,:,:)
200 REAL,
ALLOCATABLE :: asyrhd_DU(:,:,:), asyrhd_SS(:,:,:), &
201 & asyrhd_SU(:,:,:), asyrhd_BC(:,:,:), &
202 & asyrhd_OC(:,:,:), asyrhd_NI(:,:,:)
205 REAL,
ALLOCATABLE :: ssarhd_DU(:,:,:), ssarhd_SS(:,:,:), &
206 & ssarhd_SU(:,:,:), ssarhd_BC(:,:,:), &
207 & ssarhd_OC(:,:,:), ssarhd_NI(:,:,:)
211 real (kind=kind_phys) :: extrhi(kcm2,nbdsw)
214 real (kind=kind_phys) :: extrhd(krhlev,kcm2,nbdsw)
216 REAL,
dimension(ista:iend,jsta:jend) :: P1D,T1D,Q1D,EGRID4
218 real,
allocatable:: rdrh(:,:,:)
219 integer,
allocatable :: ihh(:,:,:)
220 REAL :: rh3d, DRH0, DRH1, EXT01, EXT02,SCA01,ASY01
221 INTEGER :: IH1, IH2,nAero
222 INTEGER :: IOS, INDX, ISSAM, ISSCM, ISUSO, IWASO, ISOOT, NBIN
223 REAL :: CCDRY, CCWET, SSAM, SSCM
224 REAL,
dimension(ista:iend,jsta:jend) :: AOD_DU, AOD_SS, AOD_SU, AOD_OC, AOD_BC, AOD_NI, AOD
225 REAL,
dimension(ista:iend,jsta:jend) :: SCA_DU, SCA_SS, SCA_SU, SCA_OC,SCA_BC, SCA_NI,SCA2D
226 REAL,
dimension(ista:iend,jsta:jend) :: ASY_DU, ASY_SS, ASY_SU, ASY_OC, ASY_BC,ASY_NI,ASY2D
227 REAL,
dimension(ista:iend,jsta:jend) :: ANGST, AOD_440, AOD_860
229 INTEGER :: INDX_EXT(KCM2), INDX_SCA(KCM2)
230 LOGICAL :: LAEROPT, LEXT, LSCA, LASY
232 REAL,
allocatable :: fPM25_DU(:),fPM25_SS(:)
233 REAL,
allocatable,
dimension(:,:) :: RHOsfc, smass_du_cr,smass_du_fn, &
234 & smass_ss_cr, smass_ss_fn, smass_oc,smass_bc, &
235 & smass_su, smass_cr, smass_fn
236 real (kind=kind_phys),
dimension(KRHLEV) :: rhlev
237 data rhlev(:)/ .0, .05, .10, .15, .20, .25, .30, .35, &
238 & .40, .45, .50, .55, .60, .65, .70, .75, &
239 & .80, .81, .82, .83, .84, .85, .86, .87, &
240 & .88, .89, .90, .91, .92, .93, .94, .95, &
241 & .96, .97, .98, .99/
243 data aerosolname /
'DUST',
'SALT',
'SUSO',
'SOOT',
'WASO',
'NITR'/
245 data indx_ext / 610, 611, 612, 613, 614, 615 /
246 data indx_sca / 651, 652, 653, 654, 655, 687 /
247 logical,
parameter :: debugprint = .false.
248 logical :: Model_Pwat
264 IF (iget(030)>0.OR.iget(572)>0)
THEN
274 IF(modelname ==
'RAPR')
THEN
278 IF(egrid1(i,j) < spval) grid1(i,j) = egrid1(i,j)
285 IF(egrid1(i,j) < spval) grid1(i,j) = egrid1(i,j) + tfrz
290 if(iget(030) > 0)
then
291 if(grib ==
"grib2" )
then
293 fld_info(cfld)%ifld = iavblfld(iget(030))
299 datapd(i,j,cfld) = grid1(ii,jj)
305 if(iget(572) > 0)
then
306 if(grib ==
"grib2" )
then
308 fld_info(cfld)%ifld = iavblfld(iget(572))
315 if (grid1(ii,jj) /= spval) grid1(ii,jj) = grid1(ii,jj) - tfrz
316 datapd(i,j,cfld) = grid1(ii,jj)
328 IF ((iget(032) > 0))
THEN
331 IF ( (lvls(1,iget(032))>0) )
THEN
336 CALL calcape(itype,dpbnd,dummy,dummy,dummy,idummy,egrid1,egrid2, &
341 IF(fis(i,j) < spval) grid1(i,j) = egrid1(i,j)
344 CALL bound(grid1,d00,h99999)
345 if(grib ==
"grib2" )
then
347 fld_info(cfld)%ifld = iavblfld(iget(032))
353 datapd(i,j,cfld) = grid1(ii,jj)
361 IF ((iget(107) > 0))
THEN
364 IF ( (lvls(1,iget(107)) > 0) )
THEN
365 IF ((iget(032) > 0))
THEN
366 IF ( (lvls(1,iget(032)) > 0) )
THEN
370 IF(fis(i,j) < spval) grid1(i,j) = - egrid2(i,j)
379 CALL calcape(itype,dpbnd,dummy,dummy,dummy,idummy,egrid1,egrid2, &
384 IF(fis(i,j) < spval) grid1(i,j) = - egrid2(i,j)
388 CALL bound(grid1,d00,h99999)
392 IF(fis(i,j) < spval) grid1(i,j) = - grid1(i,j)
395 if(grib ==
"grib2" )
then
397 fld_info(cfld)%ifld = iavblfld(iget(107))
403 datapd(i,j,cfld) = grid1(ii,jj)
413 IF (iget(080) > 0)
THEN
419 IF(abs(pwat(i,j)-spval)>small)
THEN
428 grid1(i,j) = pwat(i,j)
432 CALL calpw(grid1(ista:iend,jsta:jend),1)
435 IF(fis(i,j) >= spval) grid1(i,j)=spval
439 CALL bound(grid1,d00,h99999)
440 if(grib ==
"grib2" )
then
442 fld_info(cfld)%ifld = iavblfld(iget(080))
448 datapd(i,j,cfld) = grid1(ii,jj)
457 IF (iget(735) > 0)
THEN
458 IF (modelname ==
'RAPR' .OR. modelname ==
'FV3R')
THEN
459 CALL calpw(grid1(ista:iend,jsta:jend),19)
460 CALL bound(grid1,d00,h99999)
462 if(grib ==
"grib2" )
then
464 fld_info(cfld)%ifld = iavblfld(iget(735))
470 datapd(i,j,cfld) = grid1(ii,jj)
479 IF (iget(736) > 0)
THEN
480 CALL calpw(grid1(ista:iend,jsta:iend),18)
481 CALL bound(grid1,d00,h99999)
482 if(grib ==
"grib2" )
then
484 fld_info(cfld)%ifld = iavblfld(iget(736))
490 datapd(i,j,cfld) = grid1(ii,jj)
498 IF (iget(741) > 0)
THEN
499 CALL calpw(grid1(ista:iend,jsta:iend),22)
500 CALL bound(grid1,d00,h99999)
501 if(grib ==
"grib2" )
then
503 fld_info(cfld)%ifld = iavblfld(iget(741))
509 datapd(i,j,cfld) = grid1(ii,jj)
517 IF (iget(1011) > 0)
THEN
518 CALL calpw(grid1(ista:iend,jsta:iend),23)
519 CALL bound(grid1,d00,h99999)
520 if(grib ==
"grib2" )
then
522 fld_info(cfld)%ifld = iavblfld(iget(1011))
528 datapd(i,j,cfld) = grid1(ii,jj)
536 IF (iget(745) > 0)
THEN
545 if(ebb(ii,jj,k,1)/=spval)
then
546 grid1(ii,jj) = grid1(ii,jj) + ebb(ii,jj,k,1)/(1e9)
551 if(grib ==
"grib2" )
then
553 fld_info(cfld)%ifld = iavblfld(iget(745))
559 datapd(i,j,cfld) = grid1(ii,jj)
566 IF (iget(200) > 0 .or. iget(575) > 0)
THEN
569 IF (modelname ==
'RAPR')
THEN
572 IF(lwp(i,j) < spval) grid1(i,j) = lwp(i,j)/1000.0
576 CALL calpw(grid1(ista:iend,jsta:jend),2)
577 IF(modelname ==
'GFS')
then
579 CALL calpw(grid2(ista:iend,jsta:jend),3)
583 IF(grid1(i,j)<spval.and.grid2(i,j)<spval)
THEN
584 grid1(i,j) = grid1(i,j) + grid2(i,j)
593 CALL bound(grid1,d00,h99999)
594 if(iget(200) > 0)
then
595 if(grib ==
"grib2" )
then
597 fld_info(cfld)%ifld = iavblfld(iget(200))
603 datapd(i,j,cfld) = grid1(ii,jj)
608 if(iget(575) > 0)
then
609 if(grib ==
"grib2" )
then
611 fld_info(cfld)%ifld = iavblfld(iget(575))
617 datapd(i,j,cfld) = grid1(ii,jj)
626 IF (iget(201) > 0)
THEN
628 IF (modelname ==
'RAPR')
THEN
631 IF(iwp(i,j) < spval) grid1(i,j) = iwp(i,j)/1000.0
635 CALL calpw(grid1(ista:iend,jsta:jend),3)
637 CALL bound(grid1,d00,h99999)
638 if(grib ==
"grib2" )
then
640 fld_info(cfld)%ifld = iavblfld(iget(201))
646 datapd(i,j,cfld) = grid1(ii,jj)
653 IF (iget(202) > 0)
THEN
654 CALL calpw(grid1(ista:iend,jsta:jend),4)
655 CALL bound(grid1,d00,h99999)
656 if(grib==
"grib2" )
then
658 fld_info(cfld)%ifld=iavblfld(iget(202))
664 datapd(i,j,cfld) = grid1(ii,jj)
671 IF (iget(203) > 0)
THEN
672 CALL calpw(grid1(ista:iend,jsta:jend),5)
673 CALL bound(grid1,d00,h99999)
674 if(grib==
"grib2" )
then
676 fld_info(cfld)%ifld=iavblfld(iget(203))
682 datapd(i,j,cfld) = grid1(ii,jj)
690 IF (iget(428) > 0)
THEN
691 CALL calpw(grid1(ista:iend,jsta:jend),16)
692 CALL bound(grid1,d00,h99999)
693 if(grib==
"grib2" )
then
695 fld_info(cfld)%ifld=iavblfld(iget(428))
701 datapd(i,j,cfld) = grid1(ii,jj)
709 IF (iget(204) > 0)
THEN
710 CALL calpw(grid1(ista:iend,jsta:jend),6)
711 CALL bound(grid1,d00,h99999)
712 if(grib==
"grib2" )
then
714 fld_info(cfld)%ifld=iavblfld(iget(204))
720 datapd(i,j,cfld) = grid1(ii,jj)
727 IF (iget(285) > 0)
THEN
728 CALL calpw(grid1(ista:iend,jsta:jend),7)
729 CALL bound(grid1,d00,h99999)
730 if(grib==
"grib2" )
then
732 fld_info(cfld)%ifld=iavblfld(iget(285))
738 datapd(i,j,cfld) = grid1(ii,jj)
745 IF (iget(286) > 0)
THEN
746 CALL calpw(grid1(ista:iend,jsta:jend),8)
747 CALL bound(grid1,d00,h99999)
748 if(grib==
"grib2" )
then
750 fld_info(cfld)%ifld=iavblfld(iget(286))
756 datapd(i,j,cfld) = grid1(ii,jj)
763 IF (iget(290) > 0)
THEN
764 CALL calpw(grid1(ista:iend,jsta:jend),9)
765 if(grib==
"grib2" )
then
767 fld_info(cfld)%ifld=iavblfld(iget(290))
773 datapd(i,j,cfld) = grid1(ii,jj)
780 IF (iget(291) > 0)
THEN
781 CALL calpw(grid1(ista:iend,jsta:jend),10)
782 if(grib==
"grib2" )
then
784 fld_info(cfld)%ifld=iavblfld(iget(291))
790 datapd(i,j,cfld) = grid1(ii,jj)
797 IF (iget(292) > 0)
THEN
798 CALL calpw(grid1(ista:iend,jsta:jend),11)
807 IF(grid1(i,j) < spval) grid1(i,j) = grid1(i,j)*rrnum
812 IF (itheat /= 0)
THEN
813 ifincr = mod(ifhr,itheat)
818 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
825 IF(ifmin >= 1)id(18)=id(18)*60
826 IF (id(18)<0) id(18) = 0
827 if(grib==
"grib2" )
then
829 fld_info(cfld)%ifld=iavblfld(iget(292))
831 fld_info(cfld)%ntrange=1
833 fld_info(cfld)%ntrange=0
835 fld_info(cfld)%tinvstat=ifhr-id(18)
841 datapd(i,j,cfld) = grid1(ii,jj)
848 IF (iget(293) > 0)
THEN
849 CALL calpw(grid1(ista:iend,jsta:jend),12)
858 IF(grid1(i,j) < spval) grid1(i,j) = grid1(i,j)*rrnum
863 IF (itheat /= 0)
THEN
864 ifincr = mod(ifhr,itheat)
869 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
876 IF(ifmin >= 1)id(18)=id(18)*60
877 IF (id(18)<0) id(18) = 0
878 if(grib==
"grib2" )
then
880 fld_info(cfld)%ifld=iavblfld(iget(293))
882 fld_info(cfld)%ntrange=1
884 fld_info(cfld)%ntrange=0
886 fld_info(cfld)%tinvstat=ifhr-id(18)
892 datapd(i,j,cfld) = grid1(ii,jj)
899 IF (iget(295)>0)
THEN
900 CALL calpw(grid1(ista:iend,jsta:jend),13)
901 if(grib==
"grib2" )
then
903 fld_info(cfld)%ifld=iavblfld(iget(295))
904 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
909 IF (iget(312)>0)
THEN
910 CALL calpw(grid1(ista:iend,jsta:jend),14)
911 if(grib==
"grib2" )
then
913 fld_info(cfld)%ifld=iavblfld(iget(312))
914 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
919 IF (iget(299) > 0)
THEN
920 CALL calpw(grid1(ista:iend,jsta:jend),15)
921 if(grib==
"grib2" )
then
923 fld_info(cfld)%ifld=iavblfld(iget(299))
929 datapd(i,j,cfld) = grid1(ii,jj)
936 IF (iget(287)>0 .OR. iget(288)>0)
THEN
945 qcld=qqw(i,j,l)+qqr(i,j,l)
946 IF (qcld>=qcldmin .AND. t(i,j,l)<tfrz)
THEN
955 grid1(i,j)=zint(i,j,lbot+1)
957 qcld=qqw(i,j,l)+qqr(i,j,l)
958 IF (qcld>=qcldmin .AND. t(i,j,l)<tfrz)
THEN
964 grid2(i,j)=zint(i,j,ltop)
968 IF (iget(287)>0)
THEN
969 if(grib==
"grib2" )
then
971 fld_info(cfld)%ifld=iavblfld(iget(287))
972 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
975 IF (iget(288)>0)
THEN
979 grid1(i,j)=grid2(i,j)
982 if(grib==
"grib2" )
then
984 fld_info(cfld)%ifld=iavblfld(iget(288))
990 datapd(i,j,cfld) = grid1(ii,jj)
1000 IF (iget(197)>0)
THEN
1003 grid1(i,j) = cldefi(i,j)
1006 if(grib==
"grib2" )
then
1008 fld_info(cfld)%ifld=iavblfld(iget(197))
1009 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1013 IF ((modelname==
'NMM' .AND. gridtype==
'B') .OR. &
1014 modelname==
'FV3R')
THEN
1033 if(grib ==
"grib2" )
then
1041 if(cfr(i,j,l)<spval)
then
1042 full_cld(i,j)=cfr(i,j,l)
1050 CALL collect_all(full_cld(ista:iend,jsta:jend),full_dummy)
1056 DO jc=max(1,j-numr),min(jm,j+numr)
1057 DO ic=max(1,i-numr),min(im,i+numr)
1059 IF(full_cld(ic,jc) /= spval)
THEN
1061 frac=frac+full_cld(ic,jc)
1068 IF (numpts>0) frac=frac/real(numpts)
1069 if(pmid(i,j,l)<spval)
then
1070 pcldbase=pmid(i,j,l)
1071 IF (pcldbase>=ptop_low)
THEN
1072 cfracl(i,j)=max(cfracl(i,j),frac)
1073 ELSE IF (pcldbase>=ptop_mid)
THEN
1074 cfracm(i,j)=max(cfracm(i,j),frac)
1076 cfrach(i,j)=max(cfrach(i,j),frac)
1078 tcld(i,j)=max(tcld(i,j),frac)
1089 ELSEIF (modelname==
'GFS')
THEN
1108 pcldbase=pmid(i,j,l)
1109 IF (pcldbase>=ptop_low)
THEN
1110 cfracl(i,j)=max(cfracl(i,j),frac)
1111 ELSE IF (pcldbase>=ptop_mid)
THEN
1112 cfracm(i,j)=max(cfracm(i,j),frac)
1114 cfrach(i,j)=max(cfrach(i,j),frac)
1116 tcld(i,j)=max(tcld(i,j),frac)
1125 IF (iget(799)>0)
THEN
1131 IF (zmid(i,j,lm-k+1) <= pblh(i,j)+1000.0)
THEN
1132 grid1(i,j)=max(grid1(i,j),cfr(i,j,lm-k+1)*100.0)
1137 if(grib==
"grib2" )
then
1139 fld_info(cfld)%ifld=iavblfld(iget(799))
1140 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1145 IF (iget(037) > 0)
THEN
1149 IF(cfracl(i,j) < spval)
then
1150 grid1(i,j) = cfracl(i,j)*100.
1156 if(grib==
"grib2" )
then
1158 fld_info(cfld)%ifld=iavblfld(iget(037))
1164 datapd(i,j,cfld) = grid1(ii,jj)
1171 IF (iget(300) > 0)
THEN
1175 IF(avgcfracl(i,j) < spval)
then
1176 grid1(i,j) = avgcfracl(i,j)*100.
1183 itclod = nint(tclod)
1184 IF(itclod /= 0)
then
1185 ifincr = mod(ifhr,itclod)
1186 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1192 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1195 id(18) = ifhr-itclod
1197 id(18) = ifhr-ifincr
1198 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1200 IF (id(18)<0) id(18) = 0
1201 if(grib==
"grib2" )
then
1203 fld_info(cfld)%ifld=iavblfld(iget(300))
1205 fld_info(cfld)%ntrange=1
1207 fld_info(cfld)%ntrange=0
1209 fld_info(cfld)%tinvstat=ifhr-id(18)
1215 datapd(i,j,cfld) = grid1(ii,jj)
1222 IF (iget(038) > 0)
THEN
1227 IF(cfracm(i,j) < spval)
then
1228 grid1(i,j) = cfracm(i,j)*100.
1234 if(grib==
"grib2" )
then
1236 fld_info(cfld)%ifld=iavblfld(iget(038))
1242 datapd(i,j,cfld) = grid1(ii,jj)
1249 IF (iget(301) > 0)
THEN
1253 IF(abs(avgcfracm(i,j)-spval)>small)
THEN
1254 grid1(i,j) = avgcfracm(i,j)*100.
1261 itclod = nint(tclod)
1262 IF(itclod /= 0)
then
1263 ifincr = mod(ifhr,itclod)
1264 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1270 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1273 id(18) = ifhr-itclod
1275 id(18) = ifhr-ifincr
1276 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1278 IF (id(18)<0) id(18) = 0
1279 if(grib==
"grib2" )
then
1281 fld_info(cfld)%ifld=iavblfld(iget(301))
1283 fld_info(cfld)%ntrange=1
1285 fld_info(cfld)%ntrange=0
1287 fld_info(cfld)%tinvstat=ifhr-id(18)
1293 datapd(i,j,cfld) = grid1(ii,jj)
1300 IF (iget(039)>0)
THEN
1305 IF(cfrach(i,j) < spval)
then
1306 grid1(i,j) = cfrach(i,j)*100.
1312 if(grib==
"grib2" )
then
1314 fld_info(cfld)%ifld=iavblfld(iget(039))
1320 datapd(i,j,cfld) = grid1(ii,jj)
1327 IF (iget(302) > 0)
THEN
1332 IF(avgcfrach(i,j) < spval)
then
1333 grid1(i,j) = avgcfrach(i,j)*100.
1340 itclod = nint(tclod)
1341 IF(itclod /= 0)
then
1342 ifincr = mod(ifhr,itclod)
1343 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1349 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1352 id(18) = ifhr-itclod
1354 id(18) = ifhr-ifincr
1355 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1357 IF (id(18)<0) id(18) = 0
1358 if(grib==
"grib2" )
then
1360 fld_info(cfld)%ifld=iavblfld(iget(302))
1362 fld_info(cfld)%ntrange=1
1364 fld_info(cfld)%ntrange=0
1366 fld_info(cfld)%tinvstat=ifhr-id(18)
1372 datapd(i,j,cfld) = grid1(ii,jj)
1379 IF ((iget(161) > 0) .OR. (iget(260) > 0))
THEN
1381 IF(modelname==
'NCAR' .OR. modelname==
'RAPR')
THEN
1388 egrid1(i,j)=max(egrid1(i,j),cfr(i,j,l))
1393 ELSE IF (modelname==
'NMM'.OR.modelname==
'FV3R' &
1394 .OR. modelname==
'GFS')
THEN
1402 egrid1(i,j)=tcld(i,j)
1409 IF(abs(egrid1(i,j)-spval) > small)
THEN
1410 grid1(i,j) = egrid1(i,j)*100.
1411 tcld(i,j) = egrid1(i,j)*100.
1415 IF (iget(161)>0)
THEN
1416 if(grib==
"grib2" )
then
1418 fld_info(cfld)%ifld=iavblfld(iget(161))
1424 datapd(i,j,cfld) = grid1(ii,jj)
1432 IF (iget(144) > 0)
THEN
1434 IF(modelname ==
'GFS' .OR. modelname ==
'FV3R')
THEN
1438 IF(abs(avgtcdc(i,j)-spval) > small)
then
1439 grid1(i,j) = avgtcdc(i,j)*100.
1446 ELSE IF(modelname ==
'NMM')
THEN
1457 IF (ncfrst(i,j)<spval.and.acfrst(i,j)<spval)
THEN
1458 IF (ncfrst(i,j) > 0) rsum=acfrst(i,j)/ncfrst(i,j)
1459 IF (ncfrcv(i,j) > 0) &
1460 rsum=max(rsum, acfrcv(i,j)/ncfrcv(i,j))
1461 grid1(i,j) = rsum*100.
1468 IF(modelname ==
'NMM' .OR. modelname ==
'GFS' .OR. &
1469 modelname ==
'FV3R')
THEN
1471 itclod = nint(tclod)
1472 IF(itclod /= 0)
then
1473 ifincr = mod(ifhr,itclod)
1474 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1480 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1483 id(18) = ifhr-itclod
1485 id(18) = ifhr-ifincr
1486 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1488 IF (id(18)<0) id(18) = 0
1490 if(grib==
"grib2" )
then
1492 fld_info(cfld)%ifld=iavblfld(iget(144))
1494 fld_info(cfld)%ntrange=1
1496 fld_info(cfld)%ntrange=0
1498 fld_info(cfld)%tinvstat=ifhr-id(18)
1504 datapd(i,j,cfld) = grid1(ii,jj)
1511 IF (iget(139)>0)
THEN
1512 IF(modelname /=
'NMM')
THEN
1517 IF (ncfrst(i,j)<spval.and.acfrst(i,j)<spval)
THEN
1518 IF (ncfrst(i,j)>0.0)
THEN
1519 grid1(i,j) = acfrst(i,j)/ncfrst(i,j)*100.
1529 IF(modelname==
'NMM' .or. modelname==
'FV3R')
THEN
1531 itclod = nint(tclod)
1532 IF(itclod /= 0)
then
1533 ifincr = mod(ifhr,itclod)
1534 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1539 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1542 id(18) = ifhr-itclod
1544 id(18) = ifhr-ifincr
1545 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1547 IF (id(18)<0) id(18) = 0
1549 if(grib==
"grib2" )
then
1551 fld_info(cfld)%ifld=iavblfld(iget(139))
1553 fld_info(cfld)%ntrange=1
1555 fld_info(cfld)%ntrange=0
1557 fld_info(cfld)%tinvstat=ifhr-id(18)
1558 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1563 IF (iget(143)>0)
THEN
1564 IF(modelname /=
'NMM')
THEN
1569 IF (ncfrcv(i,j)<spval.and.acfrcv(i,j)<spval)
THEN
1570 IF (ncfrcv(i,j)>0.0)
THEN
1571 grid1(i,j) = acfrcv(i,j)/ncfrcv(i,j)*100.
1581 IF(modelname==
'NMM')
THEN
1583 itclod = nint(tclod)
1584 IF(itclod /= 0)
then
1585 ifincr = mod(ifhr,itclod)
1586 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1591 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1594 id(18) = ifhr-itclod
1596 id(18) = ifhr-ifincr
1597 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1599 IF (id(18)<0) id(18) = 0
1601 if(grib==
"grib2" )
then
1603 fld_info(cfld)%ifld=iavblfld(iget(143))
1605 fld_info(cfld)%ntrange=1
1607 fld_info(cfld)%ntrange=0
1609 fld_info(cfld)%tinvstat=ifhr-id(18)
1610 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1615 IF((iget(148)>0) .OR. (iget(149)>0) .OR. &
1616 (iget(168)>0) .OR. (iget(178)>0) .OR. &
1617 (iget(179)>0) .OR. (iget(194)>0) .OR. &
1618 (iget(408)>0) .OR. &
1619 (iget(409)>0) .OR. (iget(406)>0) .OR. &
1620 (iget(195)>0) .OR. (iget(260)>0) .OR. &
1642 if (hbot(i,j) /= spval)
then
1643 ibotcu(i,j) = nint(hbot(i,j))
1645 if (hbotd(i,j) /= spval)
then
1646 ibotdcu(i,j) = nint(hbotd(i,j))
1648 if (hbots(i,j) /= spval)
then
1649 ibotscu(i,j) = nint(hbots(i,j))
1651 if (htop(i,j) /= spval)
then
1652 itopcu(i,j) = nint(htop(i,j))
1654 if (htopd(i,j) /= spval)
then
1655 itopdcu(i,j) = nint(htopd(i,j))
1657 if (htops(i,j) /= spval)
then
1658 itopscu(i,j) = nint(htops(i,j))
1660 IF (ibotcu(i,j)-itopcu(i,j) <= 1)
THEN
1664 IF (ibotdcu(i,j)-itopdcu(i,j) <= 1)
THEN
1668 IF (ibotscu(i,j)-itopscu(i,j) <= 1)
THEN
1674 IF (itop > 0 .AND. itop < 100)
THEN
1677 IF (itop > 0 .AND. itop <= nint(lmh(i,j)))
THEN
1678 cldzcu(i,j) = zmid(i,j,itop)
1680 cldzcu(i,j) = -5000.
1690 if(modelname ==
'RAPR')
then
1692 DO l=nint(lmh(i,j)),1,-1
1693 qcld=qqw(i,j,l)+qqi(i,j,l)+qqs(i,j,l)
1694 IF (qcld >= qcldmin)
THEN
1700 DO l=1,nint(lmh(i,j))
1701 qcld=qqw(i,j,l)+qqi(i,j,l)+qqs(i,j,l)
1702 IF (qcld >= qcldmin)
THEN
1707 else if (modelname ==
'FV3R')
then
1709 DO l=nint(lmh(i,j)),1,-1
1710 IF (cfr(i,j,l) >= 0.02)
THEN
1716 DO l=1,nint(lmh(i,j))
1717 IF (cfr(i,j,l) >= 0.02)
THEN
1724 zpbltop = pblh(i,j)+zint(i,j,nint(lmh(i,j))+1)
1725 DO l=nint(lmh(i,j)),1,-1
1726 qcld = qqw(i,j,l)+qqi(i,j,l)
1727 IF (qcld >= qcldmin)
THEN
1731snow_check:
IF (qqs(i,j,l)>=qcldmin)
THEN
1734 qsat=pq0/pmid(i,j,l)*exp(a2*(tmp-a3)/(tmp-a4))
1738 qsat=pq0/pmid(i,j,l)*exp(21.8745584*(tmp-a3)/(tmp-7.66))
1741 IF (rhum>=0.98 .AND. zmid(i,j,l)>=zpbltop)
THEN
1748 DO l=1,nint(lmh(i,j))
1749 qcld=qqw(i,j,l)+qqi(i,j,l)+qqs(i,j,l)
1750 IF (qcld >= qcldmin)
THEN
1758 IF(modelname ==
'NCAR' .OR. modelname ==
'RAPR' .OR. modelname ==
'FV3R')
THEN
1759 ibott(i,j) = ibotgr(i,j)
1760 itopt(i,j) = itopgr(i,j)
1762 ibott(i,j) = max(ibotgr(i,j), ibotcu(i,j))
1765 itopt(i,j) = min(itopgr(i,j), itopcu(i,j))
1772 IF (iget(758)>0)
THEN
1776 grid1(i,j) = cldzcu(i,j)
1779 if(grib==
"grib2" )
then
1781 fld_info(cfld)%ifld=iavblfld(iget(758))
1782 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1792 IF ((iget(148)>0) .OR. (iget(178)>0) .OR.(iget(260)>0) )
THEN
1796 IF(modelname ==
'RAPR')
then
1800 ELSE IF (ibot <= nint(lmh(i,j)))
THEN
1801 cldp(i,j) = pmid(i,j,ibot)
1802 IF (ibot == lm)
THEN
1803 cldz(i,j) = zint(i,j,lm)
1805 cldz(i,j) = htm(i,j,ibot+1)*t(i,j,ibot+1) &
1806 *(q(i,j,ibot+1)*d608+h1)*rog* &
1807 (log(pint(i,j,ibot+1))-log(cldp(i,j)))&
1811 ELSE IF(modelname ==
'FV3R')
then
1812 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
1813 cldp(i,j) = pint(i,j,ibot+1)
1814 cldz(i,j) = zint(i,j,ibot+1)
1820 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
1821 cldp(i,j) = pmid(i,j,ibot)
1822 cldz(i,j) = zmid(i,j,ibot)
1831 IF (iget(148)>0)
THEN
1834 grid1(i,j) = cldp(i,j)
1837 if(grib==
"grib2" )
then
1839 fld_info(cfld)%ifld=iavblfld(iget(148))
1840 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1844 IF (iget(178)>0)
THEN
1848 grid1(i,j) = cldz(i,j)
1851 if(grib==
"grib2" )
then
1853 fld_info(cfld)%ifld=iavblfld(iget(178))
1854 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
1862 IF (iget(408)>0)
THEN
1880 cloud_def_p = 0.0000001
1889 watericemax = -99999.
1892 watericetotal(k) = qqw(i,j,ll) + qqi(i,j,ll)
1893 watericemax = max(watericemax,watericetotal(k))
1896 if (watericemax>=cloud_def_p)
then
1903 pabovesfc(k) = pint(i,j,lm) - pint(i,j,lm-k+1)
1904 if (watericetotal(k)<cloud_def_p)
then
1908 wimin = min(wimin,watericetotal(k1))
1910 if (wimin>cloud_def_p)
then
1911 nfogn(k)= nfogn(k)+1
1920 if (watericetotal(k)<cloud_def_p)
then
1921 if (watericetotal(1)>cloud_def_p)
then
1924 if (watericetotal(k1)>=cloud_def_p)
then
1925 watericetotal(k1)=0.
1943 if (watericetotal(k)>cloud_def_p)
then
1947 zcldbase = zmid(i,j,lm-k1+1)
1948 pcldbase = pmid(i,j,lm-k1+1)
1951 zcldbase = zmid(i,j,lm-k1+1) + (cloud_def_p-watericetotal(k1)) &
1952 * (zmid(i,j,lm-k1+2)-zmid(i,j,lm-k1+1)) &
1953 / (watericetotal(k1-1) - watericetotal(k1))
1954 pcldbase = pmid(i,j,lm-k1+1) + (cloud_def_p-watericetotal(k1)) &
1955 * (pmid(i,j,lm-k1+2)-pmid(i,j,lm-k1+1)) &
1956 / (watericetotal(k1-1) - watericetotal(k1))
1958 zcldbase = max(zcldbase,fis(i,j)*gi+5.)
1964 if (qqs(i,j,lm)>0.)
then
1965 tv=t(i,j,lm)*(h1+d608*q(i,j,lm))
1966 rhoair=pmid(i,j,lm)/(rd*tv)
1967 vovermd = (1.+q(i,j,lm))/rhoair + qqs(i,j,lm)/rhoice
1968 concfp = qqs(i,j,lm)/vovermd*1000.
1969 betav = coeffp*concfp**exponfp + 1.e-10
1970 vertvis = 1000.*min(90., const1/betav)
1971 if (vertvis < zcldbase-fis(i,j)*gi )
then
1972 zcldbase = fis(i,j)*gi + vertvis
1973 loop3741:
do k2=2,lm
1975 if (zmid(i,j,lm-k2+1) > zcldbase)
then
1976 pcldbase = pmid(i,j,lm-k1+2) + (zcldbase-zmid(i,j,lm-k1+2)) &
1977 *(pmid(i,j,lm-k1+1)-pmid(i,j,lm-k1+2) ) &
1978 /(zmid(i,j,lm-k1+1)-zmid(i,j,lm-k1+2) )
1990 cldz(i,j) = zcldbase
1991 cldp(i,j) = pcldbase
2004 pol = 0.99999683 + tx*(-0.90826951e-02 + &
2005 tx*(0.78736169e-04 + tx*(-0.61117958e-06 + &
2006 tx*(0.43884187e-08 + tx*(-0.29883885e-10 + &
2007 tx*(0.21874425e-12 + tx*(-0.17892321e-14 + &
2008 tx*(0.11112018e-16 + tx*(-0.30994571e-19)))))))))
2012 e = pmid(i,j,ll)/100.*q(i,j,ll)/(0.62197+q(i,j,ll)*0.37803)
2013 rhb(k) = 100.*min(1.,e/es)
2021 zsf=zint(i,j,nint(lmh(i,j))+1)
2022 zpbltop = pblh(i,j)+zsf
2029 if (zpbltop<zmid(i,j,lm-k2+1))
then
2030 if (rhb(k2-1)>95. )
then
2031 zcldbase = zmid(i,j,lm-k2+2)
2032 if (cldz(i,j)<-100.)
then
2034 cldz(i,j) = zcldbase
2035 cldp(i,j) = pmid(i,j,lm-k2+2)
2038 if ( zcldbase<cldz(i,j))
then
2039 cldz(i,j) = zcldbase
2049 if(cldz(i,j)<-100.)
then
2050 cldz(i,j)=zmid(i,j,ibot)
2052 if(zmid(i,j,ibot)<cldz(i,j))
then
2053 cldz(i,j)=zmid(i,j,ibot)
2070 zcld = cldz(i,j) - fis(i,j)*gi
2071 if (cldz(i,j)>=0..and.zcld<160.) nlifr = nlifr+1
2077 IF (iget(408)>0)
THEN
2081 grid1(i,j) = cldz(i,j)
2084 if(grib==
"grib2" )
then
2086 fld_info(cfld)%ifld=iavblfld(iget(408))
2087 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2095 IF (iget(487)>0)
THEN
2102 ceiling_thresh_cldfra = 0.41
2111 cldfra(k) = cfr(i,j,ll)
2112 cldfra_max = max(cldfra_max,cldfra(k))
2115 if (cldfra_max >= ceiling_thresh_cldfra)
then
2119 if (cldfra(1) > 0.)
then
2121 if (cldfra(k) < 0.8)
then
2130 if (cldfra(k) >= ceiling_thresh_cldfra)
then
2132 zceil = zmid(i,j,lm-k1+1)
2134 zceil = zmid(i,j,lm-k1+1) + (ceiling_thresh_cldfra-cldfra(k1)) &
2135 * (zmid(i,j,lm-k1+2)-zmid(i,j,lm-k1+1)) &
2136 / (cldfra(k1-1) - cldfra(k1))
2138 zceil = max(zceil,fis(i,j)*gi+5.)
2142 if (qqs(i,j,lm)>0.)
then
2143 tv=t(i,j,lm)*(h1+d608*q(i,j,lm))
2144 rhoair=pmid(i,j,lm)/(rd*tv)
2145 vovermd = (1.+q(i,j,lm))/rhoair + qqs(i,j,lm)/rhoice
2146 concfp = qqs(i,j,lm)/vovermd*1000.
2147 betav = coeffp*concfp**exponfp + 1.e-10
2148 vertvis = 1000.*min(90., const1/betav)
2149 if (vertvis < zceil-fis(i,j)*gi )
then
2150 zceil = fis(i,j)*gi + vertvis
2166 grid1(i,j) = ceil(i,j)
2169 if(grib==
"grib2" )
then
2171 fld_info(cfld)%ifld=iavblfld(iget(487))
2172 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2192 IF ((iget(711)>0) .OR. (iget(798)>0))
THEN
2195 ceiling_thresh_cldfra = 0.5
2213 cldfra(k) = cfr(i,j,lm-k+1)
2220 if (cldfra(1) >= ceiling_thresh_cldfra)
then
2222 if (cldfra(k) < 0.6)
then
2230 if (cldfra(k) >= ceiling_thresh_cldfra)
then
2232 zceil1 = zmid(i,j,lm-k+1)
2234 zceil1 = zmid(i,j,lm-k+1) + (ceiling_thresh_cldfra-cldfra(k)) &
2235 * (zmid(i,j,lm-k+2)-zmid(i,j,lm-k+1)) &
2236 / (cldfra(k-1) - cldfra(k))
2256 cfr_layer_sum(1:lm)=0.0
2259 if ( (cldfra(k) >= 0.05 ) .and. &
2260 (cldfra(k) > cldfra(k-1)) .and. &
2261 (cldfra(k) >= cldfra(k+1)) ) &
2271 cfr_layer_sum(k) = min(1.0, previous_sum + cldfra(k))
2272 previous_sum = min(1.0, cfr_layer_sum(k))
2274 if (cfr_layer_sum(k) >= ceiling_thresh_cldfra)
then
2275 zceil2 = zmid(i,j,lm-k+1) + (ceiling_thresh_cldfra-cfr_layer_sum(k)) &
2276 * (zmid(i,j,lm-k+2)-zmid(i,j,lm-k+1)) &
2277 / (cfr_layer_sum(k-1) - cfr_layer_sum(k))
2320 allocate(full_ceil(im,jm),full_fis(im,jm))
2323 full_ceil(i,j)=ceil(i,j)
2324 full_fis(i,j)=fis(i,j)
2329 CALL collect_all(full_ceil(ista:iend,jsta:jend),full_dummy)
2330 full_ceil=full_dummy
2333 CALL collect_all(full_fis(ista:iend,jsta:jend),full_dummy)
2339 ceil_min = max( ceil(i,j)-fis(i,j)*gi , 5.0)
2340 do jc = max(1,j-numr),min(jm,j+numr)
2341 do ic = max(1,i-numr),min(im,i+numr)
2342 ceil_neighbor = max( full_ceil(ic,jc)-full_fis(ic,jc)*gi , 5.0)
2346 cldz(i,j) = ceil_min + fis(i,j)*gi
2347 cldz(i,j) = max(min(cldz(i,j), 20000.0),0.0)
2350 if ( zmid(i,j,lm-k+1) >= cldz(i,j) )
then
2351 cldp(i,j) = pmid(i,j,lm-k+2) + (cldz(i,j)-zmid(i,j,lm-k+2)) &
2352 *(pmid(i,j,lm-k+1)-pmid(i,j,lm-k+2) ) &
2353 /(zmid(i,j,lm-k+1)-zmid(i,j,lm-k+2) )
2359 if (
allocated(full_ceil))
deallocate(full_ceil)
2360 if (
allocated(full_fis))
deallocate(full_fis)
2363 IF (iget(711)>0)
THEN
2367 grid1(i,j) = cldz(i,j)
2370 if(grib==
"grib2" )
then
2372 fld_info(cfld)%ifld=iavblfld(iget(711))
2373 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2378 IF (iget(798)>0)
THEN
2382 grid1(i,j) = cldp(i,j)
2385 if(grib==
"grib2" )
then
2387 fld_info(cfld)%ifld=iavblfld(iget(798))
2388 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2396 IF (iget(260)>0)
THEN
2400 grid1(i,j) = ceiling(i,j)
2403 if(grib==
"grib2" )
then
2405 fld_info(cfld)%ifld=iavblfld(iget(260))
2406 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2410 IF (iget(261) > 0)
THEN
2417 if(grib==
"grib2" )
then
2419 fld_info(cfld)%ifld=iavblfld(iget(261))
2425 datapd(i,j,cfld) = grid1(ii,jj)
2433 IF (iget(188) > 0)
THEN
2434 IF(modelname ==
'GFS')
THEN
2438 grid1(i,j) = pbot(i,j)
2445 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2446 grid1(i,j) = pmid(i,j,ibot)
2448 grid1(i,j) = -50000.
2453 if(grib==
"grib2" )
then
2455 fld_info(cfld)%ifld=iavblfld(iget(188))
2461 datapd(i,j,cfld) = grid1(ii,jj)
2469 IF (iget(192) > 0)
THEN
2473 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2474 grid1(i,j) = pmid(i,j,ibot)
2476 grid1(i,j) = -50000.
2480 if(grib==
"grib2" )
then
2482 fld_info(cfld)%ifld=iavblfld(iget(192))
2483 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2488 IF (iget(190) > 0)
THEN
2492 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2493 grid1(i,j) = pmid(i,j,ibot)
2495 grid1(i,j) = -50000.
2499 if(grib==
"grib2" )
then
2501 fld_info(cfld)%ifld=iavblfld(iget(190))
2502 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2507 IF (iget(194) > 0)
THEN
2511 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2512 grid1(i,j) = pmid(i,j,ibot)
2514 grid1(i,j) = -50000.
2518 if(grib==
"grib2" )
then
2520 fld_info(cfld)%ifld=iavblfld(iget(194))
2521 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2527 IF (iget(303) > 0)
THEN
2531 grid1(i,j) = pbotl(i,j)
2538 itclod = nint(tclod)
2539 IF(itclod /= 0)
then
2540 ifincr = mod(ifhr,itclod)
2541 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2546 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2549 id(18) = ifhr-itclod
2551 id(18) = ifhr-ifincr
2552 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2554 IF (id(18)<0) id(18) = 0
2555 if(grib==
"grib2" )
then
2557 fld_info(cfld)%ifld=iavblfld(iget(303))
2559 fld_info(cfld)%ntrange=0
2561 fld_info(cfld)%ntrange=1
2563 fld_info(cfld)%tinvstat=ifhr-id(18)
2565 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2570 IF (iget(306) > 0)
THEN
2573 IF(pbotm(i,j) > small)
THEN
2574 grid1(i,j) = pbotm(i,j)
2581 itclod = nint(tclod)
2582 IF(itclod /= 0)
then
2583 ifincr = mod(ifhr,itclod)
2584 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2589 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2592 id(18) = ifhr-itclod
2594 id(18) = ifhr-ifincr
2595 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2597 IF (id(18)<0) id(18) = 0
2598 if(grib==
"grib2" )
then
2600 fld_info(cfld)%ifld=iavblfld(iget(306))
2602 fld_info(cfld)%ntrange=0
2604 fld_info(cfld)%ntrange=1
2606 fld_info(cfld)%tinvstat=ifhr-id(18)
2608 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2613 IF (iget(309) > 0)
THEN
2616 IF(pboth(i,j) > small)
THEN
2617 grid1(i,j) = pboth(i,j)
2624 itclod = nint(tclod)
2625 IF(itclod /= 0)
then
2626 ifincr = mod(ifhr,itclod)
2627 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2632 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2635 id(18) = ifhr-itclod
2637 id(18) = ifhr-ifincr
2638 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2640 IF (id(18)<0) id(18) = 0
2641 if(grib==
"grib2" )
then
2643 fld_info(cfld)%ifld=iavblfld(iget(309))
2645 fld_info(cfld)%ntrange=0
2647 fld_info(cfld)%ntrange=1
2649 fld_info(cfld)%tinvstat=ifhr-id(18)
2651 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2661 IF ((iget(149)>0) .OR. (iget(179)>0) .OR. &
2662 (iget(168)>0) .OR. (iget(275)>0))
THEN
2666 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2667 IF(t(i,j,itop)<spval .AND. &
2668 pmid(i,j,itop)<spval .AND. &
2669 zmid(i,j,itop)<spval)
THEN
2670 cldp(i,j) = pmid(i,j,itop)
2671 cldz(i,j) = zmid(i,j,itop)
2672 cldt(i,j) = t(i,j,itop)
2674 IF(modelname ==
'RAPR')
then
2684 IF(modelname ==
'RAPR')
then
2698 IF (iget(149)>0)
THEN
2701 grid1(i,j) = cldp(i,j)
2704 if(grib==
"grib2" )
then
2706 fld_info(cfld)%ifld=iavblfld(iget(149))
2707 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2712 IF (iget(179)>0)
THEN
2715 grid1(i,j) = cldz(i,j)
2718 if(grib==
"grib2" )
then
2720 fld_info(cfld)%ifld=iavblfld(iget(179))
2721 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2727 IF ((iget(409)>0) .OR. (iget(406)>0))
THEN
2729 cloud_def_p = 0.0000001
2736 IF(modelname ==
'RAPR') zcldtop = spval
2739 watericetotal(k) = qqw(i,j,ll) + qqi(i,j,ll)
2742 if (watericetotal(lm)<=cloud_def_p)
then
2743 loop373 :
do k=lm-1,2,-1
2744 if (watericetotal(k)>cloud_def_p)
then
2745 zcldtop = zmid(i,j,lm-k+1) + (cloud_def_p-watericetotal(k)) &
2746 * (zmid(i,j,lm-k)-zmid(i,j,lm-k+1)) &
2747 / (watericetotal(k+1) - watericetotal(k))
2752 zcldtop = zmid(i,j,1)
2756 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2757 cldp(i,j) = pmid(i,j,itop)
2758 cldt(i,j) = t(i,j,itop)
2761 IF(modelname ==
'RAPR') cldp(i,j) = spval
2770 if(zcldtop <-100.)
then
2773 zcldtop=zmid(i,j,itop)
2774 else if(zmid(i,j,itop)>zcldtop)
then
2778 zcldtop=zmid(i,j,itop)
2783 if(cldz(i,j)>-100. .and. zcldtop<-100.)
then
2784 zcldtop = cldz(i,j) + 200.
2794 IF (iget(406)>0)
THEN
2797 grid1(i,j) = cldp(i,j)
2800 if(grib==
"grib2" )
then
2802 fld_info(cfld)%ifld=iavblfld(iget(406))
2803 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2808 IF (iget(409)>0)
THEN
2811 grid1(i,j) = cldz(i,j)
2814 if(grib==
"grib2" )
then
2816 fld_info(cfld)%ifld=iavblfld(iget(409))
2817 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2824 IF (iget(168)>0)
THEN
2827 grid1(i,j) = cldt(i,j)
2830 if(grib==
"grib2" )
then
2832 fld_info(cfld)%ifld=iavblfld(iget(168))
2833 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2838 IF (iget(275)>0)
THEN
2851 if((hbot(i,j)-spval)>small .and. (htop(i,j)-spval)>small)
then
2852 lcbot=nint(hbot(i,j))
2853 lctop=nint(htop(i,j))
2854 if (lcbot-lctop > 1)
then
2855 q_conv=cnvcfr(i,j)*qconv
2857 if (t(i,j,k) < trad_ice)
then
2858 cu_ir(k)=abscoefi*q_conv
2860 cu_ir(k)=abscoef*q_conv
2870 if(pint(i,j,k)<spval.and.qqw(i,j,k)<spval.and. &
2871 qqi(i,j,k)<spval.and.qqs(i,j,k)<spval)
then
2872 dp=pint(i,j,k+1)-pint(i,j,k)
2873 opdepth=opdepth+( cu_ir(k) + abscoef*qqw(i,j,k)+ &
2875 & abscoefi*( qqi(i,j,k)+qqs(i,j,k) ) )*dp
2877 if (opdepth > 1.)
exit
2879 if (opdepth > 1.) num_thick=num_thick+1
2931 if(grib==
"grib2" )
then
2933 fld_info(cfld)%ifld=iavblfld(iget(275))
2934 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2941 IF (iget(189) > 0)
THEN
2942 IF(modelname ==
'GFS')
THEN
2946 grid1(i,j) = ptop(i,j)
2953 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2954 grid1(i,j) = pmid(i,j,itop)
2956 grid1(i,j) = -50000.
2961 if(grib==
"grib2" )
then
2963 fld_info(cfld)%ifld=iavblfld(iget(189))
2969 datapd(i,j,cfld) = grid1(ii,jj)
2977 IF (iget(193) > 0)
THEN
2981 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2982 grid1(i,j) = pmid(i,j,itop)
2984 grid1(i,j) = -50000.
2988 if(grib==
"grib2" )
then
2990 fld_info(cfld)%ifld=iavblfld(iget(193))
2991 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
2996 IF (iget(191) > 0)
THEN
3000 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
3001 grid1(i,j) = pmid(i,j,itop)
3003 grid1(i,j) = -50000.
3007 if(grib==
"grib2" )
then
3009 fld_info(cfld)%ifld=iavblfld(iget(191))
3010 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3016 IF (iget(195) > 0)
THEN
3020 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
3021 grid1(i,j) = pmid(i,j,itop)
3023 grid1(i,j) = -50000.
3027 if(grib==
"grib2" )
then
3029 fld_info(cfld)%ifld=iavblfld(iget(195))
3030 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3036 IF (iget(304) > 0)
THEN
3039 IF(ptopl(i,j) > small)
THEN
3040 grid1(i,j) = ptopl(i,j)
3047 itclod = nint(tclod)
3048 IF(itclod /= 0)
then
3049 ifincr = mod(ifhr,itclod)
3050 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3055 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3058 id(18) = ifhr-itclod
3060 id(18) = ifhr-ifincr
3061 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3063 IF (id(18)<0) id(18) = 0
3064 if(grib==
"grib2" )
then
3066 fld_info(cfld)%ifld=iavblfld(iget(304))
3068 fld_info(cfld)%ntrange=0
3070 fld_info(cfld)%ntrange=1
3072 fld_info(cfld)%tinvstat=ifhr-id(18)
3074 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3079 IF (iget(307) > 0)
THEN
3082 grid1(i,j) = ptopm(i,j)
3086 itclod = nint(tclod)
3087 IF(itclod /= 0)
then
3088 ifincr = mod(ifhr,itclod)
3089 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3094 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3097 id(18) = ifhr-itclod
3099 id(18) = ifhr-ifincr
3100 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3102 IF (id(18)<0) id(18) = 0
3103 if(grib==
"grib2" )
then
3105 fld_info(cfld)%ifld=iavblfld(iget(307))
3107 fld_info(cfld)%ntrange=0
3109 fld_info(cfld)%ntrange=1
3111 fld_info(cfld)%tinvstat=ifhr-id(18)
3113 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3118 IF (iget(310) > 0)
THEN
3121 grid1(i,j) = ptoph(i,j)
3125 itclod = nint(tclod)
3126 IF(itclod /= 0)
then
3127 ifincr = mod(ifhr,itclod)
3128 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3133 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3136 id(18) = ifhr-itclod
3138 id(18) = ifhr-ifincr
3139 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3141 IF (id(18)<0) id(18) = 0
3142 if(grib==
"grib2" )
then
3144 fld_info(cfld)%ifld=iavblfld(iget(310))
3146 fld_info(cfld)%ntrange=0
3148 fld_info(cfld)%ntrange=1
3150 fld_info(cfld)%tinvstat=ifhr-id(18)
3152 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3158 IF (iget(305) > 0)
THEN
3161 grid1(i,j) = ttopl(i,j)
3165 itclod = nint(tclod)
3166 IF(itclod /= 0)
then
3167 ifincr = mod(ifhr,itclod)
3168 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3173 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3176 id(18) = ifhr-itclod
3178 id(18) = ifhr-ifincr
3179 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3181 IF (id(18)<0) id(18) = 0
3182 if(grib==
"grib2" )
then
3184 fld_info(cfld)%ifld=iavblfld(iget(305))
3186 fld_info(cfld)%ntrange=0
3188 fld_info(cfld)%ntrange=1
3190 fld_info(cfld)%tinvstat=ifhr-id(18)
3192 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3197 IF (iget(308) > 0)
THEN
3200 grid1(i,j) = ttopm(i,j)
3204 itclod = nint(tclod)
3205 IF(itclod /= 0)
then
3206 ifincr = mod(ifhr,itclod)
3207 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3212 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3215 id(18) = ifhr-itclod
3217 id(18) = ifhr-ifincr
3218 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3220 IF (id(18)<0) id(18) = 0
3221 if(grib==
"grib2" )
then
3223 fld_info(cfld)%ifld=iavblfld(iget(308))
3225 fld_info(cfld)%ntrange=0
3227 fld_info(cfld)%ntrange=1
3229 fld_info(cfld)%tinvstat=ifhr-id(18)
3231 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3236 IF (iget(311) > 0)
THEN
3239 grid1(i,j) = ttoph(i,j)
3243 itclod = nint(tclod)
3244 IF(itclod /= 0)
then
3245 ifincr = mod(ifhr,itclod)
3246 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3251 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3254 id(18) = ifhr-itclod
3256 id(18) = ifhr-ifincr
3257 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3259 IF (id(18)<0) id(18) = 0
3260 if(grib==
"grib2" )
then
3262 fld_info(cfld)%ifld=iavblfld(iget(311))
3264 fld_info(cfld)%ntrange=0
3266 fld_info(cfld)%ntrange=1
3268 fld_info(cfld)%tinvstat=ifhr-id(18)
3269 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3275 IF (iget(196) > 0.or.iget(570)>0)
THEN
3279 if(cnvcfr(i,j)/=spval)grid1(i,j)=100.*cnvcfr(i,j)
3282 if(iget(196)>0)
then
3283 if(grib==
"grib2" )
then
3285 fld_info(cfld)%ifld=iavblfld(iget(196))
3286 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3288 elseif(iget(570)>0)
then
3289 if(grib==
"grib2" )
then
3291 fld_info(cfld)%ifld=iavblfld(iget(570))
3292 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3299 IF (iget(342) > 0)
THEN
3303 if(pblcfr(i,j)/=spval)grid1(i,j)=100.*pblcfr(i,j)
3307 itclod = nint(tclod)
3308 IF(itclod /= 0)
then
3309 ifincr = mod(ifhr,itclod)
3310 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3315 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3318 id(18) = ifhr-itclod
3320 id(18) = ifhr-ifincr
3321 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3323 IF (id(18)<0) id(18) = 0
3324 if(grib==
"grib2" )
then
3326 fld_info(cfld)%ifld=iavblfld(iget(342))
3328 fld_info(cfld)%ntrange=0
3330 fld_info(cfld)%ntrange=1
3332 fld_info(cfld)%tinvstat=ifhr-id(18)
3334 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3340 IF (iget(313) > 0)
THEN
3343 grid1(i,j)=cldwork(i,j)
3347 itclod = nint(tclod)
3348 IF(itclod /= 0)
then
3349 ifincr = mod(ifhr,itclod)
3350 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3355 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3358 id(18) = ifhr-itclod
3360 id(18) = ifhr-ifincr
3361 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3363 IF (id(18)<0) id(18) = 0
3364 if(grib==
"grib2" )
then
3366 fld_info(cfld)%ifld=iavblfld(iget(313))
3368 fld_info(cfld)%ntrange=0
3370 fld_info(cfld)%ntrange=1
3372 fld_info(cfld)%tinvstat=ifhr-id(18)
3374 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3382 IF (iget(126)>0)
THEN
3383 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3395 IF(aswin(i,j)/=spval)
THEN
3396 grid1(i,j) = aswin(i,j)*rrnum
3398 grid1(i,j)=aswin(i,j)
3403 itrdsw = nint(trdsw)
3404 IF(itrdsw /= 0)
then
3405 ifincr = mod(ifhr,itrdsw)
3406 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3411 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3414 id(18) = ifhr-itrdsw
3416 id(18) = ifhr-ifincr
3417 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3419 IF (id(18)<0) id(18) = 0
3421 if(grib==
"grib2" )
then
3423 fld_info(cfld)%ifld=iavblfld(iget(126))
3425 fld_info(cfld)%ntrange=1
3427 fld_info(cfld)%ntrange=0
3429 fld_info(cfld)%tinvstat=ifhr-id(18)
3430 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3435 IF (iget(298)>0)
THEN
3436 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3448 IF(auvbin(i,j)/=spval)
THEN
3449 grid1(i,j) = auvbin(i,j)*rrnum
3451 grid1(i,j) = auvbin(i,j)
3457 itrdsw = nint(trdsw)
3458 IF(itrdsw /= 0)
then
3459 ifincr = mod(ifhr,itrdsw)
3460 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3465 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3468 id(18) = ifhr-itrdsw
3470 id(18) = ifhr-ifincr
3471 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3473 IF (id(18)<0) id(18) = 0
3475 if(grib==
"grib2" )
then
3477 fld_info(cfld)%ifld=iavblfld(iget(298))
3479 fld_info(cfld)%ntrange=1
3481 fld_info(cfld)%ntrange=0
3483 fld_info(cfld)%tinvstat=ifhr-id(18)
3484 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3489 IF (iget(297)>0)
THEN
3490 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3502 IF(auvbinc(i,j)/=spval)
THEN
3503 grid1(i,j) = auvbinc(i,j)*rrnum
3505 grid1(i,j) = auvbinc(i,j)
3511 itrdsw = nint(trdsw)
3512 IF(itrdsw /= 0)
then
3513 ifincr = mod(ifhr,itrdsw)
3514 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3519 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3522 id(18) = ifhr-itrdsw
3524 id(18) = ifhr-ifincr
3525 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3527 IF (id(18)<0) id(18) = 0
3529 if(grib==
"grib2" )
then
3531 fld_info(cfld)%ifld=iavblfld(iget(297))
3533 fld_info(cfld)%ntrange=1
3535 fld_info(cfld)%ntrange=0
3537 fld_info(cfld)%tinvstat=ifhr-id(18)
3538 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3543 IF (iget(127)>0)
THEN
3544 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3555 IF(alwin(i,j)/=spval)
THEN
3556 grid1(i,j) = alwin(i,j)*rrnum
3558 grid1(i,j)=alwin(i,j)
3563 itrdlw = nint(trdlw)
3564 IF(itrdlw /= 0)
then
3565 ifincr = mod(ifhr,itrdlw)
3566 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
3571 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3574 id(18) = ifhr-itrdlw
3576 id(18) = ifhr-ifincr
3577 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3579 IF (id(18)<0) id(18) = 0
3581 if(grib==
"grib2" )
then
3583 fld_info(cfld)%ifld=iavblfld(iget(127))
3585 fld_info(cfld)%ntrange=1
3587 fld_info(cfld)%ntrange=0
3589 fld_info(cfld)%tinvstat=ifhr-id(18)
3590 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3595 IF (iget(128)>0)
THEN
3596 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3607 IF(aswout(i,j)/=spval)
THEN
3608 grid1(i,j) = -1.0*aswout(i,j)*rrnum
3610 grid1(i,j)=aswout(i,j)
3615 itrdsw = nint(trdsw)
3616 IF(itrdsw /= 0)
then
3617 ifincr = mod(ifhr,itrdsw)
3618 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3623 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3626 id(18) = ifhr-itrdsw
3628 id(18) = ifhr-ifincr
3629 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3631 IF (id(18)<0) id(18) = 0
3633 if(grib==
"grib2" )
then
3635 fld_info(cfld)%ifld=iavblfld(iget(128))
3637 fld_info(cfld)%ntrange=1
3639 fld_info(cfld)%ntrange=0
3641 fld_info(cfld)%tinvstat=ifhr-id(18)
3642 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3647 IF (iget(129)>0)
THEN
3648 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3659 IF(alwout(i,j)/=spval)
THEN
3660 grid1(i,j) = -1.0*alwout(i,j)*rrnum
3662 grid1(i,j)=alwout(i,j)
3667 itrdlw = nint(trdlw)
3668 IF(itrdlw /= 0)
then
3669 ifincr = mod(ifhr,itrdlw)
3670 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
3675 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3678 id(18) = ifhr-itrdlw
3680 id(18) = ifhr-ifincr
3681 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3683 IF (id(18)<0) id(18) = 0
3685 if(grib==
"grib2" )
then
3687 fld_info(cfld)%ifld=iavblfld(iget(129))
3689 fld_info(cfld)%ntrange=1
3691 fld_info(cfld)%ntrange=0
3693 fld_info(cfld)%tinvstat=ifhr-id(18)
3694 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3699 IF (iget(130)>0)
THEN
3700 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3711 IF(aswtoa(i,j)/=spval)
THEN
3712 grid1(i,j) = aswtoa(i,j)*rrnum
3714 grid1(i,j)=aswtoa(i,j)
3719 itrdsw = nint(trdsw)
3720 IF(itrdsw /= 0)
then
3721 ifincr = mod(ifhr,itrdsw)
3722 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3727 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3730 id(18) = ifhr-itrdsw
3732 id(18) = ifhr-ifincr
3733 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3735 IF (id(18)<0) id(18) = 0
3737 if(grib==
"grib2" )
then
3739 fld_info(cfld)%ifld=iavblfld(iget(130))
3741 fld_info(cfld)%ntrange=1
3743 fld_info(cfld)%ntrange=0
3745 fld_info(cfld)%tinvstat=ifhr-id(18)
3746 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3751 IF (iget(131)>0)
THEN
3752 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3763 IF(alwtoa(i,j)/=spval)
THEN
3764 grid1(i,j) = alwtoa(i,j)*rrnum
3766 grid1(i,j)=alwtoa(i,j)
3771 itrdlw = nint(trdlw)
3772 IF(itrdlw /= 0)
then
3773 ifincr = mod(ifhr,itrdlw)
3774 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
3779 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3782 id(18) = ifhr-itrdlw
3784 id(18) = ifhr-ifincr
3785 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3787 IF (id(18)<0) id(18) = 0
3789 if(grib==
"grib2" )
then
3791 fld_info(cfld)%ifld=iavblfld(iget(131))
3793 fld_info(cfld)%ntrange=1
3795 fld_info(cfld)%ntrange=0
3797 fld_info(cfld)%tinvstat=ifhr-id(18)
3798 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3803 IF (iget(274)>0)
THEN
3804 IF(modelname ==
'NCAR'.OR.modelname==
'RSM')
THEN
3809 grid1(i,j) = rlwtoa(i,j)
3813 if(grib==
"grib2" )
then
3815 fld_info(cfld)%ifld=iavblfld(iget(274))
3816 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3821 IF (iget(265)>0)
THEN
3823 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3828 IF(rlwtoa(i,j) < spval) &
3829 & grid1(i,j) = (rlwtoa(i,j)*stbol)**0.25
3833 if(grib==
"grib2" )
then
3835 fld_info(cfld)%ifld=iavblfld(iget(265))
3836 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3841 IF (iget(156)>0)
THEN
3845 IF(rswin(i,j)<spval)
THEN
3846 IF(czmean(i,j)>1.e-6)
THEN
3847 factrs=czen(i,j)/czmean(i,j)
3851 IF(rswin(i,j)<spval) grid1(i,j)=rswin(i,j)*factrs
3856 if(grib==
"grib2" )
then
3858 fld_info(cfld)%ifld=iavblfld(iget(156))
3859 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3864 IF (iget(157)>0)
THEN
3869 IF(modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3870 grid1(i,j)=rlwin(i,j)
3872 IF(sigt4(i,j)<spval.and.t(i,j,nint(lmh(i,j)))<spval)
THEN
3873 IF(sigt4(i,j)>0.0)
THEN
3876 factrl=5.67e-8*tlmh*tlmh*tlmh*tlmh/sigt4(i,j)
3880 IF(rlwin(i,j) < spval) grid1(i,j)=rlwin(i,j)*factrl
3886 if(grib==
"grib2" )
then
3888 fld_info(cfld)%ifld=iavblfld(iget(157))
3889 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3894 IF (iget(141)>0)
THEN
3899 IF(rswout(i,j)<spval)
THEN
3900 IF(czmean(i,j)>1.e-6)
THEN
3901 factrs=czen(i,j)/czmean(i,j)
3905 IF(rswout(i,j)<spval) grid1(i,j)=rswout(i,j)*factrs
3910 if(grib==
"grib2" )
then
3912 fld_info(cfld)%ifld=iavblfld(iget(141))
3913 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3918 IF (iget(142)>0)
THEN
3922 grid1(i,j) = radot(i,j)
3925 if(grib==
"grib2" )
then
3927 fld_info(cfld)%ifld=iavblfld(iget(142))
3928 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3933 IF (iget(764)>0)
THEN
3936 grid1(i,j) = lwdnbc(i,j)
3939 if(grib==
'grib2')
then
3941 fld_info(cfld)%ifld=iavblfld(iget(764))
3942 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3947 IF (iget(765)>0)
THEN
3950 grid1(i,j) = lwupbc(i,j)
3953 if(grib==
'grib2')
then
3955 fld_info(cfld)%ifld=iavblfld(iget(765))
3956 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3961 IF (iget(740)>0)
THEN
3964 grid1(i,j) = mean_frp(i,j)
3967 if(grib==
'grib2')
then
3969 fld_info(cfld)%ifld=iavblfld(iget(740))
3970 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
3975 IF (iget(755)>0)
THEN
3978 IF (hwp(i,j)<spval)
THEN
3979 grid1(i,j) = hwp(i,j)
3986 itsrfc = nint(tsrfc)
3987 IF(itsrfc /= 0)
then
3988 ifincr = mod(ifhr,itsrfc)
3989 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itsrfc*60)
3994 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3997 id(18) = ifhr-itsrfc
3999 id(18) = ifhr-ifincr
4000 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4002 IF (id(18)<0) id(18) = 0
4003 if(grib==
'grib2')
then
4005 fld_info(cfld)%ifld=iavblfld(iget(755))
4007 fld_info(cfld)%ntrange=1
4009 fld_info(cfld)%ntrange=0
4011 fld_info(cfld)%tinvstat=ifhr-id(18)
4012 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4017 IF (iget(262)>0)
THEN
4022 IF(rswinc(i,j)<spval)
THEN
4023 IF(czmean(i,j)>1.e-6)
THEN
4024 factrs=czen(i,j)/czmean(i,j)
4028 IF(rswinc(i,j)<spval) grid1(i,j) = rswinc(i,j)*factrs
4032 if(grib==
"grib2" )
then
4034 fld_info(cfld)%ifld=iavblfld(iget(262))
4035 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4040 IF (iget(772)>0)
THEN
4044 grid1(i,j) = swddni(i,j)
4047 if(grib==
'grib2')
then
4049 fld_info(cfld)%ifld=iavblfld(iget(772))
4050 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4055 IF (iget(796)>0)
THEN
4058 grid1(i,j) = swddnic(i,j)
4061 if(grib==
'grib2')
then
4063 fld_info(cfld)%ifld=iavblfld(iget(796))
4064 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4069 IF (iget(773)>0)
THEN
4073 grid1(i,j) = swddif(i,j)
4076 if(grib==
'grib2')
then
4078 fld_info(cfld)%ifld=iavblfld(iget(773))
4079 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4084 IF (iget(797)>0)
THEN
4087 grid1(i,j) = swddifc(i,j)
4090 if(grib==
'grib2')
then
4092 fld_info(cfld)%ifld=iavblfld(iget(797))
4093 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4098 IF (iget(383)>0)
THEN
4101 grid1(i,j) = aswinc(i,j)
4105 itrdsw = nint(trdsw)
4106 IF(itrdsw /= 0)
then
4107 ifincr = mod(ifhr,itrdsw)
4108 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4113 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4116 id(18) = ifhr-itrdsw
4118 id(18) = ifhr-ifincr
4119 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4121 IF (id(18)<0) id(18) = 0
4122 if(grib==
"grib2" )
then
4124 fld_info(cfld)%ifld=iavblfld(iget(383))
4126 fld_info(cfld)%ntrange=1
4128 fld_info(cfld)%ntrange=0
4130 fld_info(cfld)%tinvstat=ifhr-id(18)
4131 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4136 IF (iget(386)>0)
THEN
4139 grid1(i,j) = aswoutc(i,j)
4143 itrdsw = nint(trdsw)
4144 IF(itrdsw /= 0)
then
4145 ifincr = mod(ifhr,itrdsw)
4146 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4151 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4154 id(18) = ifhr-itrdsw
4156 id(18) = ifhr-ifincr
4157 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4159 IF (id(18)<0) id(18) = 0
4160 if(grib==
"grib2" )
then
4162 fld_info(cfld)%ifld=iavblfld(iget(386))
4164 fld_info(cfld)%ntrange=1
4166 fld_info(cfld)%ntrange=0
4168 fld_info(cfld)%tinvstat=ifhr-id(18)
4169 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4174 IF (iget(719)>0)
THEN
4177 grid1(i,j) = swupt(i,j)
4180 if(grib==
'grib2')
then
4182 fld_info(cfld)%ifld=iavblfld(iget(719))
4183 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4188 IF (iget(387)>0)
THEN
4191 grid1(i,j) = aswtoac(i,j)
4195 itrdsw = nint(trdsw)
4196 IF(itrdsw /= 0)
then
4197 ifincr = mod(ifhr,itrdsw)
4198 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4203 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4206 id(18) = ifhr-itrdsw
4208 id(18) = ifhr-ifincr
4209 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4211 IF (id(18)<0) id(18) = 0
4212 if(grib==
"grib2" )
then
4214 fld_info(cfld)%ifld=iavblfld(iget(387))
4216 fld_info(cfld)%ntrange=1
4218 fld_info(cfld)%ntrange=0
4220 fld_info(cfld)%tinvstat=ifhr-id(18)
4221 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4226 IF (iget(388)>0)
THEN
4229 grid1(i,j) = aswintoa(i,j)
4233 itrdsw = nint(trdsw)
4234 IF(itrdsw /= 0)
then
4235 ifincr = mod(ifhr,itrdsw)
4236 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4241 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4244 id(18) = ifhr-itrdsw
4246 id(18) = ifhr-ifincr
4247 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4249 IF (id(18)<0) id(18) = 0
4250 if(grib==
"grib2" )
then
4252 fld_info(cfld)%ifld=iavblfld(iget(388))
4254 fld_info(cfld)%ntrange=1
4256 fld_info(cfld)%ntrange=0
4258 fld_info(cfld)%tinvstat=ifhr-id(18)
4259 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4264 IF (iget(382)>0)
THEN
4267 grid1(i,j) = alwinc(i,j)
4271 itrdlw = nint(trdlw)
4272 IF(itrdlw /= 0)
then
4273 ifincr = mod(ifhr,itrdlw)
4274 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
4279 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4282 id(18) = ifhr-itrdlw
4284 id(18) = ifhr-ifincr
4285 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4287 IF (id(18)<0) id(18) = 0
4288 if(grib==
"grib2" )
then
4290 fld_info(cfld)%ifld=iavblfld(iget(382))
4292 fld_info(cfld)%ntrange=1
4294 fld_info(cfld)%ntrange=0
4296 fld_info(cfld)%tinvstat=ifhr-id(18)
4297 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4302 IF (iget(384)>0)
THEN
4305 grid1(i,j) = alwoutc(i,j)
4309 itrdlw = nint(trdlw)
4310 IF(itrdlw /= 0)
then
4311 ifincr = mod(ifhr,itrdlw)
4312 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
4317 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4320 id(18) = ifhr-itrdlw
4322 id(18) = ifhr-ifincr
4323 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4325 IF (id(18)<0) id(18) = 0
4326 if(grib==
"grib2" )
then
4328 fld_info(cfld)%ifld=iavblfld(iget(384))
4330 fld_info(cfld)%ntrange=1
4332 fld_info(cfld)%ntrange=0
4334 fld_info(cfld)%tinvstat=ifhr-id(18)
4335 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4340 IF (iget(385)>0)
THEN
4343 grid1(i,j) = alwtoac(i,j)
4347 itrdlw = nint(trdlw)
4348 IF(itrdlw /= 0)
then
4349 ifincr = mod(ifhr,itrdlw)
4350 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
4355 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4358 id(18) = ifhr-itrdlw
4360 id(18) = ifhr-ifincr
4361 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4363 IF (id(18)<0) id(18) = 0
4364 if(grib==
"grib2" )
then
4366 fld_info(cfld)%ifld=iavblfld(iget(385))
4368 fld_info(cfld)%ntrange=1
4370 fld_info(cfld)%ntrange=0
4372 fld_info(cfld)%tinvstat=ifhr-id(18)
4373 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4378 IF (iget(401)>0)
THEN
4381 grid1(i,j) = avisbeamswin(i,j)
4385 itrdsw = nint(trdsw)
4386 IF(itrdsw /= 0)
then
4387 ifincr = mod(ifhr,itrdsw)
4388 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4393 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4396 id(18) = ifhr-itrdsw
4398 id(18) = ifhr-ifincr
4399 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4401 IF (id(18)<0) id(18) = 0
4403 IF(itrdsw < 0)id(1:25)=0
4404 if(grib==
"grib2" )
then
4406 fld_info(cfld)%ifld=iavblfld(iget(401))
4408 fld_info(cfld)%ntrange=1
4410 fld_info(cfld)%ntrange=0
4412 fld_info(cfld)%tinvstat=ifhr-id(18)
4413 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4418 IF (iget(402)>0)
THEN
4421 grid1(i,j) = avisdiffswin(i,j)
4425 itrdsw = nint(trdsw)
4426 IF(itrdsw /= 0)
then
4427 ifincr = mod(ifhr,itrdsw)
4428 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4433 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4436 id(18) = ifhr-itrdsw
4438 id(18) = ifhr-ifincr
4439 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4441 IF (id(18)<0) id(18) = 0
4442 IF(itrdsw < 0)id(1:25)=0
4443 if(grib==
"grib2" )
then
4445 fld_info(cfld)%ifld=iavblfld(iget(402))
4447 fld_info(cfld)%ntrange=1
4449 fld_info(cfld)%ntrange=0
4451 fld_info(cfld)%tinvstat=ifhr-id(18)
4452 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4457 IF (iget(403)>0)
THEN
4460 grid1(i,j) = airbeamswin(i,j)
4464 itrdsw = nint(trdsw)
4465 IF(itrdsw /= 0)
then
4466 ifincr = mod(ifhr,itrdsw)
4467 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4472 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4475 id(18) = ifhr-itrdsw
4477 id(18) = ifhr-ifincr
4478 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4480 IF (id(18)<0) id(18) = 0
4481 IF(itrdsw < 0)id(1:25)=0
4482 if(grib==
"grib2" )
then
4484 fld_info(cfld)%ifld=iavblfld(iget(403))
4486 fld_info(cfld)%ntrange=1
4488 fld_info(cfld)%ntrange=0
4490 fld_info(cfld)%tinvstat=ifhr-id(18)
4491 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4496 IF (iget(404)>0)
THEN
4499 grid1(i,j) = airdiffswin(i,j)
4503 itrdsw = nint(trdsw)
4504 IF(itrdsw /= 0)
then
4505 ifincr = mod(ifhr,itrdsw)
4506 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4511 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4514 id(18) = ifhr-itrdsw
4516 id(18) = ifhr-ifincr
4517 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4519 IF (id(18)<0) id(18) = 0
4520 IF(itrdsw < 0)id(1:25)=0
4521 if(grib==
"grib2" )
then
4523 fld_info(cfld)%ifld=iavblfld(iget(404))
4525 fld_info(cfld)%ntrange=1
4527 fld_info(cfld)%ntrange=0
4529 fld_info(cfld)%tinvstat=ifhr-id(18)
4530 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4536 IF (iget(600).GT.0)
THEN
4539 grid1(i,j)=aod550(i,j)
4542 if(grib==
"grib2" )
then
4544 fld_info(cfld)%ifld=iavblfld(iget(600))
4545 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4549 IF (iget(601).GT.0)
THEN
4552 grid1(i,j)=du_aod550(i,j)
4555 if(grib==
"grib2" )
then
4557 fld_info(cfld)%ifld=iavblfld(iget(601))
4558 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4562 IF (iget(602).GT.0)
THEN
4565 grid1(i,j)=ss_aod550(i,j)
4568 if(grib==
"grib2" )
then
4570 fld_info(cfld)%ifld=iavblfld(iget(602))
4571 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4575 IF (iget(603).GT.0)
THEN
4578 grid1(i,j)=su_aod550(i,j)
4581 if(grib==
"grib2" )
then
4583 fld_info(cfld)%ifld=iavblfld(iget(603))
4584 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4588 IF (iget(604).GT.0)
THEN
4591 grid1(i,j)=oc_aod550(i,j)
4594 if(grib==
"grib2" )
then
4596 fld_info(cfld)%ifld=iavblfld(iget(604))
4597 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4602 IF (iget(605).GT.0)
THEN
4605 grid1(i,j)=bc_aod550(i,j)
4608 if(grib==
"grib2" )
then
4610 fld_info(cfld)%ifld=iavblfld(iget(605))
4611 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4618 IF (iget(712).GT.0)
THEN
4621 grid1(i,j)=aqm_aod550(i,j)
4624 if(grib==
"grib2" )
then
4626 fld_info(cfld)%ifld=iavblfld(iget(712))
4627 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4633 IF (iget(715)>0)
THEN
4636 grid1(i,j)=taod5502d(i,j)
4639 if(grib==
"grib2" )
then
4641 fld_info(cfld)%ifld=iavblfld(iget(715))
4642 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4647 IF (iget(716)>0)
THEN
4650 grid1(i,j)=aerasy2d(i,j)
4653 if(grib==
"grib2" )
then
4655 fld_info(cfld)%ifld=iavblfld(iget(716))
4656 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4661 IF (iget(717)>0)
THEN
4664 grid1(i,j)=aerssa2d(i,j)
4667 if(grib==
"grib2" )
then
4669 fld_info(cfld)%ifld=iavblfld(iget(717))
4670 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
4674 if (gocart_on .or. gccpp_on .or. nasa_on)
then
4690 IF ( iget(i)>0 ) laeropt = .true.
4693 IF ( iget(i)>0 ) laeropt = .true.
4696 IF ( iget(i)>0 ) laeropt = .true.
4702 IF ( iget(i)>0 ) laersmass = .true.
4706 print *,
'COMPUTE AEROSOL OPTICAL PROPERTIES'
4709 ALLOCATE ( extrhd_du(krhlev,nbin_du,nbdsw))
4710 ALLOCATE ( extrhd_ss(krhlev,nbin_ss,nbdsw))
4711 ALLOCATE ( extrhd_su(krhlev,nbin_su,nbdsw))
4712 ALLOCATE ( extrhd_bc(krhlev,nbin_bc,nbdsw))
4713 ALLOCATE ( extrhd_oc(krhlev,nbin_oc,nbdsw))
4715 ALLOCATE ( scarhd_du(krhlev,nbin_du,nbdsw))
4716 ALLOCATE ( scarhd_ss(krhlev,nbin_ss,nbdsw))
4717 ALLOCATE ( scarhd_su(krhlev,nbin_su,nbdsw))
4718 ALLOCATE ( scarhd_bc(krhlev,nbin_bc,nbdsw))
4719 ALLOCATE ( scarhd_oc(krhlev,nbin_oc,nbdsw))
4721 ALLOCATE ( asyrhd_du(krhlev,nbin_du,nbdsw))
4722 ALLOCATE ( asyrhd_ss(krhlev,nbin_ss,nbdsw))
4723 ALLOCATE ( asyrhd_su(krhlev,nbin_su,nbdsw))
4724 ALLOCATE ( asyrhd_bc(krhlev,nbin_bc,nbdsw))
4725 ALLOCATE ( asyrhd_oc(krhlev,nbin_oc,nbdsw))
4727 ALLOCATE ( ssarhd_du(krhlev,nbin_du,nbdsw))
4728 ALLOCATE ( ssarhd_ss(krhlev,nbin_ss,nbdsw))
4729 ALLOCATE ( ssarhd_su(krhlev,nbin_su,nbdsw))
4730 ALLOCATE ( ssarhd_bc(krhlev,nbin_bc,nbdsw))
4731 ALLOCATE ( ssarhd_oc(krhlev,nbin_oc,nbdsw))
4733 ALLOCATE ( extrhd_ni(krhlev,nbin_no3,nbdsw))
4734 ALLOCATE ( scarhd_ni(krhlev,nbin_no3,nbdsw))
4735 ALLOCATE ( asyrhd_ni(krhlev,nbin_no3,nbdsw))
4736 ALLOCATE ( ssarhd_ni(krhlev,nbin_no3,nbdsw))
4738 if (gocart_on .or. gccpp_on)
then
4740 else if (nasa_on)
then
4743 print *,
'aft AEROSOL allocate, nbin_du=',nbin_du, &
4744 'nbin_ss=',nbin_ss,
'nbin_su=',nbin_su,
'nbin_bc=', &
4745 'nbin_oc=',nbin_oc,
'nbin_ni=',nbin_no3,
'nAero=',naero
4751 aerosol_file=
'optics_luts_'//aerosolname(i)//
'.dat'
4752 else if ( gccpp_on )
then
4753 aerosol_file=
'optics_luts_'//aerosolname(i)//
'_nasa.dat'
4754 else if ( nasa_on )
then
4755 aerosol_file=
'optics_luts_'//aerosolname(i)//
'_nasa.dat'
4757 open(unit=noaer, file=aerosol_file, status=
'OLD', iostat=ios)
4759 print *,
' ERROR! Non-zero iostat for rd_LUTS ', aerosol_file
4762 if(debugprint)print *,
'i=',i,
'read aerosol_file=',trim(aerosol_file),
'ios=',ios
4764 IF (aerosolname(i) ==
'DUST') nbin = nbin_du
4765 IF (aerosolname(i) ==
'SALT') nbin = nbin_ss
4766 IF (aerosolname(i) ==
'SUSO') nbin = nbin_su
4767 IF (aerosolname(i) ==
'SOOT') nbin = nbin_bc
4768 IF (aerosolname(i) ==
'WASO') nbin = nbin_oc
4770 IF (aerosolname(i) ==
'NITR') nbin = nbin_no3
4773 read(noaer,
'(2x,a4,1x,i1,1x,a3)')aername_rd,ib, aeropt
4774 IF (aername_rd /= aerosolname(i)) stop
4776 IF (aeropt /=
'ext' ) stop
4778 IF (aerosolname(i) ==
'DUST')
THEN
4780 read(noaer,
'(8f10.5)') (extrhd_du(ii,j,ib), ii=1,krhlev)
4782 read(noaer,
'(2x,a4)') aername_rd
4784 read(noaer,
'(8f10.5)') (scarhd_du(ii,j,ib), ii=1,krhlev)
4786 read(noaer,
'(2x,a4)') aername_rd
4788 read(noaer,
'(8f10.5)') (asyrhd_du(ii,j,ib), ii=1,krhlev)
4790 read(noaer,
'(2x,a4)') aername_rd
4792 read(noaer,
'(8f10.5)') (ssarhd_du(ii,j,ib), ii=1,krhlev)
4795 ELSEIF (aerosolname(i) ==
'SALT')
THEN
4797 read(noaer,
'(8f10.5)') (extrhd_ss(ii,j,ib), ii=1,krhlev)
4799 read(noaer,
'(2x,a4)') aername_rd
4801 read(noaer,
'(8f10.5)') (scarhd_ss(ii,j,ib), ii=1,krhlev)
4803 read(noaer,
'(2x,a4)') aername_rd
4805 read(noaer,
'(8f10.5)') (asyrhd_ss(ii,j,ib), ii=1,krhlev)
4807 read(noaer,
'(2x,a4)') aername_rd
4809 read(noaer,
'(8f10.5)') (ssarhd_ss(ii,j,ib), ii=1,krhlev)
4812 ELSEIF (aerosolname(i) ==
'SUSO')
THEN
4814 read(noaer,
'(8f10.5)') (extrhd_su(ii,j,ib), ii=1,krhlev)
4816 read(noaer,
'(2x,a4)') aername_rd
4818 read(noaer,
'(8f10.5)') (scarhd_su(ii,j,ib), ii=1,krhlev)
4820 read(noaer,
'(2x,a4)') aername_rd
4822 read(noaer,
'(8f10.5)') (asyrhd_su(ii,j,ib), ii=1,krhlev)
4824 read(noaer,
'(2x,a4)') aername_rd
4826 read(noaer,
'(8f10.5)') (ssarhd_su(ii,j,ib), ii=1,krhlev)
4829 ELSEIF (aerosolname(i) ==
'SOOT')
THEN
4831 read(noaer,
'(8f10.5)') (extrhd_bc(ii,j,ib), ii=1,krhlev)
4833 read(noaer,
'(2x,a4)') aername_rd
4835 read(noaer,
'(8f10.5)') (scarhd_bc(ii,j,ib), ii=1,krhlev)
4837 read(noaer,
'(2x,a4)') aername_rd
4839 read(noaer,
'(8f10.5)') (asyrhd_bc(ii,j,ib), ii=1,krhlev)
4841 read(noaer,
'(2x,a4)') aername_rd
4843 read(noaer,
'(8f10.5)') (ssarhd_bc(ii,j,ib), ii=1,krhlev)
4846 ELSEIF (aerosolname(i) ==
'WASO')
THEN
4848 read(noaer,
'(8f10.5)') (extrhd_oc(ii,j,ib), ii=1,krhlev)
4850 read(noaer,
'(2x,a4)') aername_rd
4852 read(noaer,
'(8f10.5)') (scarhd_oc(ii,j,ib), ii=1,krhlev)
4854 read(noaer,
'(2x,a4)') aername_rd
4856 read(noaer,
'(8f10.5)') (asyrhd_oc(ii,j,ib), ii=1,krhlev)
4858 read(noaer,
'(2x,a4)') aername_rd
4860 read(noaer,
'(8f10.5)') (ssarhd_oc(ii,j,ib), ii=1,krhlev)
4864 IF (aerosolname(i) ==
'NITR')
THEN
4866 read(noaer,
'(8f10.5)') (extrhd_ni(ii,j,ib), ii=1,krhlev)
4868 read(noaer,
'(2x,a4)') aername_rd
4870 read(noaer,
'(8f10.5)') (scarhd_ni(ii,j,ib), ii=1,krhlev)
4872 read(noaer,
'(2x,a4)') aername_rd
4874 read(noaer,
'(8f10.5)') (asyrhd_ni(ii,j,ib), ii=1,krhlev)
4876 read(noaer,
'(2x,a4)') aername_rd
4878 read(noaer,
'(8f10.5)') (ssarhd_ni(ii,j,ib), ii=1,krhlev)
4891 allocate (rdrh(ista:iend,jsta:jend,lm))
4892 allocate (ihh(ista:iend,jsta:jend,lm))
4898 p1d(i,j) = pmid(i,j,ll)
4899 t1d(i,j) = t(i,j,ll)
4900 q1d(i,j) = q(i,j,ll)
4904 CALL calrh(p1d,t1d,q1d,egrid4)
4911 IF ( rh3d > rhlev(krhlev) )
THEN
4916 ELSEIF ( rh3d < rhlev(1))
THEN
4923 DO WHILE ( rh3d > rhlev(ih2))
4925 IF ( ih2 > krhlev )
EXIT
4927 ih2 = min( krhlev, ih2 )
4928 ih1 = max( 1, ih2-1 )
4929 drh0 = rhlev(ih2) - rhlev(ih1)
4931 drh1 = rh3d - rhlev(ih1)
4932 rdrh(i,j,ll) = drh1 / drh0
4945 IF (ib == 1 ) indx = 623
4947 IF (ib == 2 ) indx = 624
4949 IF (ib == 3 ) indx = 609
4951 IF (ib == 4 ) indx = 625
4953 IF (ib == 5 ) indx = 626
4955 IF (ib == 6 ) indx = 627
4957 IF (ib == 7 ) indx = 628
4964 IF (iget(indx)>0 ) lext =.true.
4967 IF (iget(650)>0 ) lsca =.true.
4969 IF (iget(indx_ext(i))>0 ) lext = .true.
4970 IF (iget(indx_sca(i))>0 ) lsca = .true.
4975 IF (iget(648)>0 ) lsca =.true.
4976 IF (iget(649)>0 ) lasy =.true.
4979 IF (iget(656)>0 )
THEN
4980 IF ( ib == 2 ) lext = .true.
4981 IF ( ib == 5 ) lext = .true.
4985 IF ( lext .OR. lsca .OR. lasy )
THEN
4997 ext01 = extrhd_du(1,n,ib)
4998 sca01 = scarhd_du(1,n,ib)
4999 asy01 = asyrhd_du(1,n,ib)
5000 ext(i,j,l) = ext(i,j,l)+1e-9*dust(i,j,l,n) * ext01
5001 sca(i,j,l) = sca(i,j,l)+1e-9*dust(i,j,l,n) * sca01
5002 asy(i,j,l) = asy(i,j,l)+1e-9*dust(i,j,l,n) * sca01*asy01
5004 ext(i,j,l) = ext(i,j,l) * 1000.
5005 sca(i,j,l) = sca(i,j,l) * 1000.
5006 asy(i,j,l) = asy(i,j,l) * 1000.
5010 CALL calpw(aod_du,17)
5011 CALL calpw(sca_du,20)
5012 CALL calpw(asy_du,21)
5026 ext01 = extrhd_su(ih1,n,ib) &
5027 & + rdrh(i,j,l)*(extrhd_su(ih2,n,ib)-extrhd_su(ih1,n,ib))
5028 sca01 = scarhd_su(ih1,n,ib) &
5029 & + rdrh(i,j,l)*(scarhd_su(ih2,n,ib)-scarhd_su(ih1,n,ib))
5030 asy01 = asyrhd_su(ih1,n,ib) &
5031 & + rdrh(i,j,l)*(asyrhd_su(ih2,n,ib)-asyrhd_su(ih1,n,ib))
5032 ext(i,j,l) = ext(i,j,l)+1e-9*suso(i,j,l,n) * ext01
5033 sca(i,j,l) = sca(i,j,l)+1e-9*suso(i,j,l,n)*sca01
5034 asy(i,j,l) = asy(i,j,l)+1e-9*suso(i,j,l,n)*sca01*asy01
5037 ext(i,j,l) = ext(i,j,l) * 1000.
5038 sca(i,j,l) = sca(i,j,l) * 1000.
5039 asy(i,j,l) = asy(i,j,l) * 1000.
5043 CALL calpw(aod_su,17)
5044 CALL calpw(sca_su,20)
5045 CALL calpw(asy_su,21)
5060 ext01 = extrhd_ss(ih1,n,ib) &
5061 & + rdrh(i,j,l)*(extrhd_ss(ih2,n,ib)-extrhd_ss(ih1,n,ib))
5062 sca01 = scarhd_ss(ih1,n,ib) &
5063 & + rdrh(i,j,l)*(scarhd_ss(ih2,n,ib)-scarhd_ss(ih1,n,ib))
5064 asy01 = asyrhd_ss(ih1,n,ib) &
5065 & + rdrh(i,j,l)*(asyrhd_ss(ih2,n,ib)-asyrhd_ss(ih1,n,ib))
5066 ext(i,j,l) = ext(i,j,l)+1e-9*salt(i,j,l,n)*ext01
5067 sca(i,j,l) = sca(i,j,l)+1e-9*salt(i,j,l,n)*sca01
5068 asy(i,j,l) = asy(i,j,l)+1e-9*salt(i,j,l,n)*sca01*asy01
5070 ext(i,j,l) = ext(i,j,l) * 1000.
5071 sca(i,j,l) = sca(i,j,l) * 1000.
5072 asy(i,j,l) = asy(i,j,l) * 1000.
5076 CALL calpw(aod_ss,17)
5077 CALL calpw(sca_ss,20)
5078 CALL calpw(asy_ss,21)
5093 ext01 = extrhd_bc(ih1,n,ib) &
5094 & + rdrh(i,j,l)*(extrhd_bc(ih2,n,ib)-extrhd_bc(ih1,n,ib))
5095 sca01 = scarhd_bc(ih1,n,ib) &
5096 & + rdrh(i,j,l)*(scarhd_bc(ih2,n,ib)-scarhd_bc(ih1,n,ib))
5097 asy01 = asyrhd_bc(ih1,n,ib) &
5098 & + rdrh(i,j,l)*(asyrhd_bc(ih2,n,ib)-asyrhd_bc(ih1,n,ib))
5099 ext(i,j,l) = ext(i,j,l)+1e-9*soot(i,j,l,n)*ext01
5100 sca(i,j,l) = sca(i,j,l)+1e-9*soot(i,j,l,n)*sca01
5101 asy(i,j,l) = asy(i,j,l)+1e-9*soot(i,j,l,n)*sca01*asy01
5103 ext(i,j,l) = ext(i,j,l) * 1000.
5104 sca(i,j,l) = sca(i,j,l) * 1000.
5105 asy(i,j,l) = asy(i,j,l) * 1000.
5109 CALL calpw(aod_bc,17)
5110 CALL calpw(sca_bc,20)
5111 CALL calpw(asy_bc,21)
5125 ext01 = extrhd_oc(ih1,n,ib) &
5126 & + rdrh(i,j,l)*(extrhd_oc(ih2,n,ib)-extrhd_oc(ih1,n,ib))
5127 sca01 = scarhd_oc(ih1,n,ib) &
5128 & + rdrh(i,j,l)*(scarhd_oc(ih2,n,ib)-scarhd_oc(ih1,n,ib))
5129 asy01 = asyrhd_oc(ih1,n,ib) &
5130 & + rdrh(i,j,l)*(asyrhd_oc(ih2,n,ib)-asyrhd_oc(ih1,n,ib))
5131 ext(i,j,l) = ext(i,j,l)+1e-9*waso(i,j,l,n)*ext01
5132 sca(i,j,l) = sca(i,j,l)+1e-9*waso(i,j,l,n)*sca01
5133 asy(i,j,l) = asy(i,j,l)+1e-9*waso(i,j,l,n)*sca01*asy01
5135 ext(i,j,l) = ext(i,j,l) * 1000.
5136 sca(i,j,l) = sca(i,j,l) * 1000.
5137 asy(i,j,l) = asy(i,j,l) * 1000.
5141 CALL calpw(aod_oc,17)
5142 CALL calpw(sca_oc,20)
5143 CALL calpw(asy_oc,21)
5159 ext01 = extrhd_ni(ih1,n,ib) &
5160 & + rdrh(i,j,l)*(extrhd_ni(ih2,n,ib)-extrhd_ni(ih1,n,ib))
5161 sca01 = scarhd_ni(ih1,n,ib) &
5162 & + rdrh(i,j,l)*(scarhd_ni(ih2,n,ib)-scarhd_ni(ih1,n,ib))
5163 asy01 = asyrhd_ni(ih1,n,ib) &
5164 & + rdrh(i,j,l)*(asyrhd_ni(ih2,n,ib)-asyrhd_ni(ih1,n,ib))
5165 ext(i,j,l) = ext(i,j,l)+1e-9*no3(i,j,l,n)*ext01
5166 sca(i,j,l) = sca(i,j,l)+1e-9*no3(i,j,l,n)*sca01
5167 asy(i,j,l) = asy(i,j,l)+1e-9*no3(i,j,l,n)*sca01*asy01
5169 ext(i,j,l) = ext(i,j,l) * 1000.
5170 sca(i,j,l) = sca(i,j,l) * 1000.
5171 asy(i,j,l) = asy(i,j,l) * 1000.
5175 CALL calpw(aod_ni,17)
5176 CALL calpw(sca_ni,20)
5177 CALL calpw(asy_ni,21)
5187 aod_du(i,j) = max(aod_du(i,j), 0.0)
5188 aod_bc(i,j) = max(aod_bc(i,j), 0.0)
5189 aod_oc(i,j) = max(aod_oc(i,j), 0.0)
5190 aod_su(i,j) = max(aod_su(i,j), 0.0)
5191 aod_ss(i,j) = max(aod_ss(i,j), 0.0)
5193 sca_du(i,j) = max(sca_du(i,j), 0.0)
5194 sca_bc(i,j) = max(sca_bc(i,j), 0.0)
5195 sca_oc(i,j) = max(sca_oc(i,j), 0.0)
5196 sca_su(i,j) = max(sca_su(i,j), 0.0)
5197 sca_ss(i,j) = max(sca_ss(i,j), 0.0)
5199 asy_du(i,j) = max(asy_du(i,j), 0.0)
5200 asy_bc(i,j) = max(asy_bc(i,j), 0.0)
5201 asy_oc(i,j) = max(asy_oc(i,j), 0.0)
5202 asy_su(i,j) = max(asy_su(i,j), 0.0)
5203 asy_ss(i,j) = max(asy_ss(i,j), 0.0)
5206 aod_ni(i,j) = max(aod_ni(i,j), 0.0)
5207 sca_ni(i,j) = max(sca_ni(i,j), 0.0)
5208 asy_ni(i,j) = max(asy_ni(i,j), 0.0)
5210 aod(i,j) = aod_du(i,j) + aod_bc(i,j) + aod_oc(i,j) + &
5211 & aod_su(i,j) + aod_ss(i,j) + aod_ni(i,j)
5212 sca2d(i,j) = sca_du(i,j) + sca_bc(i,j) + sca_oc(i,j) + &
5213 & sca_su(i,j) + sca_ss(i,j) + sca_ni(i,j)
5214 asy2d(i,j) = asy_du(i,j) + asy_bc(i,j) + asy_oc(i,j) + &
5215 & asy_su(i,j) + asy_ss(i,j) + asy_ni(i,j)
5218 if (gocart_on .or. gccpp_on)
then
5219 aod(i,j) = aod_du(i,j) + aod_bc(i,j) + aod_oc(i,j) + &
5220 & aod_su(i,j) + aod_ss(i,j)
5221 sca2d(i,j) = sca_du(i,j) + sca_bc(i,j) + sca_oc(i,j) + &
5222 & sca_su(i,j) + sca_ss(i,j)
5223 asy2d(i,j) = asy_du(i,j) + asy_bc(i,j) + asy_oc(i,j) + &
5224 & asy_su(i,j) + asy_ss(i,j)
5230 IF ( iget(656) > 0 )
THEN
5235 aod_440(i,j) = aod(i,j)
5244 aod_860(i,j) = aod(i,j)
5251 IF ( iget(indx) > 0)
THEN
5255 grid1(i,j) = aod(i,j)
5258 CALL bound(grid1,d00,h99999)
5259 if(grib==
"grib2" )
then
5261 fld_info(cfld)%ifld=iavblfld(iget(indx))
5262 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5270 IF ( iget(649) > 0 )
THEN
5275 IF(sca2d(i,j)<spval.and.asy2d(i,j)<spval)
THEN
5276 IF ( sca2d(i,j) > 0.0 )
THEN
5277 asy2d(i,j) = asy2d(i,j) / sca2d(i,j)
5281 IF(asy2d(i,j)<spval) grid1(i,j)=asy2d(i,j)
5285 CALL bound(grid1,d00,h99999)
5286 if(grib==
"grib2" )
then
5288 fld_info(cfld)%ifld=iavblfld(iget(649))
5289 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5294 IF ( iget(648) > 0 )
THEN
5299 IF(aod(i,j)<spval.and.sca2d(i,j)<spval)
THEN
5300 IF ( aod(i,j) > 0.0 )
THEN
5301 sca2d(i,j) = sca2d(i,j) / aod(i,j)
5305 IF(sca2d(i,j)<spval) grid1(i,j)=sca2d(i,j)
5309 CALL bound(grid1,d00,h99999)
5310 if(grib==
"grib2" )
then
5312 fld_info(cfld)%ifld=iavblfld(iget(648))
5313 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5326 IF ( iget(650) > 0 )
THEN
5330 grid1(i,j)=sca2d(i,j)
5333 CALL bound(grid1,d00,h99999)
5334 if(grib==
"grib2" )
then
5336 fld_info(cfld)%ifld=iavblfld(iget(650))
5337 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5345 IF ( iget(jj) > 0)
THEN
5349 IF ( ii == 1 ) grid1(i,j) = aod_du(i,j)
5350 IF ( ii == 2 ) grid1(i,j) = aod_ss(i,j)
5351 IF ( ii == 3 ) grid1(i,j) = aod_su(i,j)
5352 IF ( ii == 4 ) grid1(i,j) = aod_oc(i,j)
5353 IF ( ii == 5 ) grid1(i,j) = aod_bc(i,j)
5354 IF ( ii == 6 ) grid1(i,j) = aod_ni(i,j)
5357 CALL bound(grid1,d00,h99999)
5358 if(grib==
"grib2" )
then
5360 fld_info(cfld)%ifld=iavblfld(iget(jj))
5361 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5367 IF ( iget(jj) > 0)
THEN
5371 IF ( ii == 1 ) grid1(i,j) = sca_du(i,j)
5372 IF ( ii == 2 ) grid1(i,j) = sca_ss(i,j)
5373 IF ( ii == 3 ) grid1(i,j) = sca_su(i,j)
5374 IF ( ii == 4 ) grid1(i,j) = sca_oc(i,j)
5375 IF ( ii == 5 ) grid1(i,j) = sca_bc(i,j)
5376 IF ( ii == 6 ) grid1(i,j) = sca_ni(i,j)
5379 CALL bound(grid1,d00,h99999)
5380 if(grib==
"grib2" )
then
5382 fld_info(cfld)%ifld=iavblfld(iget(jj))
5383 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5394 IF ( iget(656) > 0 )
THEN
5397 ang2 = log( 860. / 440. )
5401 IF (aod_860(i,j) > 0.)
THEN
5402 ang1 = log( aod_440(i,j)/aod_860(i,j) )
5403 angst(i,j) = ang1 / ang2
5405 grid1(i,j)=angst(i,j)
5408 if(debugprint)print *,
'output angstrom exp,angst=',maxval(angst(ista:iend,jsta:jend)), &
5409 minval(angst(ista:iend,jsta:jend))
5410 CALL bound(grid1,d00,h99999)
5411 if(grib==
"grib2" )
then
5413 fld_info(cfld)%ifld=iavblfld(iget(656))
5414 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5422 IF (iget(686)>0 )
THEN
5427 grid1(i,j) = dustpm(i,j)
5430 if(grib==
'grib2')
then
5432 fld_info(cfld)%ifld=iavblfld(iget(686))
5433 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5437 IF (iget(685)>0 )
THEN
5441 grid1(i,j) = dustpm10(i,j)
5444 if(grib==
'grib2')
then
5446 fld_info(cfld)%ifld=iavblfld(iget(685))
5447 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5453 IF (iget(684)>0 )
THEN
5458 grid1(i,j) = sspm(i,j)
5461 if(grib==
'grib2')
then
5463 fld_info(cfld)%ifld=iavblfld(iget(684))
5464 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5468 IF (iget(619)>0 )
THEN
5473 grid1(i,j) = dusmass(i,j)
5476 if(grib==
'grib2')
then
5478 fld_info(cfld)%ifld=iavblfld(iget(619))
5479 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5484 IF (iget(620)>0 )
THEN
5489 grid1(i,j) = dusmass25(i,j)
5492 if(grib==
'grib2')
then
5494 fld_info(cfld)%ifld=iavblfld(iget(620))
5495 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5499 IF (iget(621)>0 )
THEN
5505 IF(ducmass(i,j)<spval) grid1(i,j) = ducmass(i,j) * 1.e-9
5508 if(grib==
'grib2')
then
5510 fld_info(cfld)%ifld=iavblfld(iget(621))
5511 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5516 IF (iget(622)>0 )
THEN
5522 IF(ducmass25(i,j)<spval) grid1(i,j) = ducmass25(i,j) * 1.e-9
5525 if(grib==
'grib2')
then
5527 fld_info(cfld)%ifld=iavblfld(iget(622))
5528 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5533 IF (iget(646)>0 )
THEN
5538 IF(dustcb(i,j)<spval) grid1(i,j) = dustcb(i,j) * 1.e-9
5541 if(grib==
'grib2')
then
5543 fld_info(cfld)%ifld=iavblfld(iget(646))
5544 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5549 IF (iget(647)>0 )
THEN
5554 IF(sscb(i,j)<spval) grid1(i,j) = sscb(i,j) * 1.e-9
5557 if(grib==
'grib2')
then
5559 fld_info(cfld)%ifld=iavblfld(iget(647))
5560 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5564 IF (iget(616)>0 )
THEN
5569 IF(bccb(i,j)<spval) grid1(i,j) = bccb(i,j) * 1.e-9
5572 if(grib==
'grib2')
then
5574 fld_info(cfld)%ifld=iavblfld(iget(616))
5575 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5580 IF (iget(617)>0 )
THEN
5585 IF(occb(i,j)<spval) grid1(i,j) = occb(i,j) * 1.e-9
5588 if(grib==
'grib2')
then
5590 fld_info(cfld)%ifld=iavblfld(iget(617))
5591 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5596 IF (iget(618)>0 )
THEN
5601 IF(sulfcb(i,j)<spval) grid1(i,j) = sulfcb(i,j) * 1.e-9
5604 if(grib==
'grib2')
then
5606 fld_info(cfld)%ifld=iavblfld(iget(618))
5607 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5613 IF (iget(657)>0 )
THEN
5618 IF(no3cb(i,j)<spval) grid1(i,j) = no3cb(i,j) * 1.e-9
5621 if(grib==
'grib2')
then
5623 fld_info(cfld)%ifld=iavblfld(iget(657))
5624 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5629 IF (iget(658)>0 )
THEN
5634 IF(nh4cb(i,j)<spval) grid1(i,j) = nh4cb(i,j) * 1.e-9
5637 if(grib==
'grib2')
then
5639 fld_info(cfld)%ifld=iavblfld(iget(658))
5640 datapd(1:iend-ista+1,1:jend-jsta+1,cfld)=grid1(ista:iend,jsta:jend)
5646 if (gocart_on .or. gccpp_on )
then
5683 print *,
'aft wrt disg maod'
5695 if(iget(473)>0 .or. iget(474)>0 .or. iget(475)>0)
then
5700 if(avgcprate(i,j) /= spval)
then
5701 egrid1(i,j) = avgcprate(i,j)*(1000./dtq2)
5711 IF(modelname ==
'GFS' .OR. modelname ==
'FV3R')
then
5714 egrid2(i,j) = pbot(i,j)
5715 egrid3(i,j) = ptop(i,j)
5723 if(egrid1(i,j)<= 0. .or. egrid2(i,j)<= 0. .or. egrid3(i,j) <= 0.)
then
5732 IF(egrid2(i,j) == spval .or. egrid3(i,j) == spval) cycle
5733 if(egrid3(i,j) < 400.*100. .and. &
5734 (egrid2(i,j)-egrid3(i,j)) > 300.*100)
then
5736 if(egrid2(i,j) > pmid(i,j,lm))
then
5740 if(egrid2(i,j) >= pmid(i,j,l))
then
5741 if(egrid2(i,j)-pmid(i,j,l)<0.5)
then
5742 egrid2(i,j) = zmid(i,j,l)
5744 dp = (log(egrid2(i,j)) - log(pmid(i,j,l)))/ &
5745 max(1.e-6,(log(pmid(i,j,l+1))-log(pmid(i,j,l))))
5746 egrid2(i,j) = zmid(i,j,l)+(zmid(i,j,l+1)-zmid(i,j,l))*dp
5753 if(egrid3(i,j) < pmid(i,j,1))
then
5754 egrid3(i,j) = zmid(i,j,1)
5757 if(egrid3(i,j) <= pmid(i,j,l))
then
5758 if(pmid(i,j,l)-egrid3(i,j)<0.5)
then
5759 egrid3(i,j) = zmid(i,j,l)
5761 dp = (log(egrid3(i,j)) - log(pmid(i,j,l)))/ &
5762 max(1.e-6,(log(pmid(i,j,l))-log(pmid(i,j,l-1))))
5763 egrid3(i,j) = zmid(i,j,l)+(zmid(i,j,l)-zmid(i,j,l-1))*dp
5777 IF(iget(473) > 0)
THEN
5781 grid1(i,j) = egrid1(i,j)
5785 fld_info(cfld)%ifld=iavblfld(iget(473))
5791 datapd(i,j,cfld) = grid1(ii,jj)
5796 IF(iget(474) > 0)
THEN
5800 grid1(i,j) = egrid2(i,j)
5804 fld_info(cfld)%ifld=iavblfld(iget(474))
5810 datapd(i,j,cfld) = grid1(ii,jj)
5815 IF(iget(475) > 0)
THEN
5819 grid1(i,j) = egrid3(i,j)
5823 fld_info(cfld)%ifld=iavblfld(iget(475))
5829 datapd(i,j,cfld) = grid1(ii,jj)