71 use vrbls4d, only: dust,suso, salt, soot, waso
72 use vrbls3d, only: qqw, qqr, t, zint, cfr, qqi, qqs, q, ext, zmid,pmid,&
73 pint, duem, dusd, dudp, duwt, dusv, ssem, sssd,ssdp,&
74 sswt, sssv, bcem, bcsd, bcdp, bcwt, bcsv, ocem,ocsd,&
75 ocdp, ocwt, ocsv, sca, asy,cfr_raw
76 use vrbls2d, only: cldefi, cfracl, avgcfracl, cfracm, avgcfracm, cfrach,&
77 avgcfrach, avgtcdc, ncfrst, acfrst, ncfrcv, acfrcv, &
78 hbot, hbotd, hbots, htop, htopd, htops, fis, pblh, &
79 pbot, pbotl, pbotm, pboth, cnvcfr, ptop, ptopl, &
80 ptopm, ptoph, ttopl, ttopm, ttoph, pblcfr, cldwork, &
81 aswin, auvbin, auvbinc, aswout,alwout, aswtoa, &
82 rlwtoa, czmean, czen, rswin, alwin, alwtoa, rlwin, &
83 sigt4, rswout, radot, rswinc, aswinc, aswoutc, &
84 aswtoac, alwoutc, aswtoac, avisbeamswin, &
85 avisdiffswin, aswintoa, aswtoac, airbeamswin, &
86 airdiffswin, dusmass, dusmass25, ducmass, ducmass25, &
87 alwinc, alwtoac, swddni, swddif, swdnbc, swddnic, &
88 swddifc, swupbc, lwdnbc, lwupbc, swupt, &
89 taod5502d, aerssa2d, aerasy2d, mean_frp, lwp, iwp, &
91 dustcb,sscb,bccb,occb,sulfcb,dustpm,sspm,aod550, &
92 du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550, &
94 use masks, only: lmh, htm
95 use params_mod, only: tfrz, d00, h99999, qcldmin, small, d608, h1, rog, &
96 gi, rd, qconv, abscoefi, abscoef, stbol, pq0, a2, &
98 use ctlblk_mod
, only: jsta, jend, spval, modelname, grib, cfld,datapd, &
99 fld_info, avrain, theat, ifhr, ifmin, avcnvc, &
100 tclod, ardsw, trdsw, ardlw, nbin_du, trdlw, im, &
101 nbin_ss, nbin_oc, nbin_bc, nbin_su, dtq2, &
102 jm, lm, gocart_on, me, rdaod
103 use rqstfld_mod
, only: iget, id, lvls, iavblfld
104 use gridspec_mod
, only: dyval, gridtype
105 use cmassi_mod
, only: trad_ice
106 use machine_post
, only: kind_phys
112 REAL,
PARAMETER :: c2k=273.15, ptop_low=64200., ptop_mid=35000., &
118 INTEGER :: lcbot,lctop,jc,ic
119 INTEGER,
dimension(im,jsta:jend) :: ibott, ibotcu, ibotdcu, ibotscu, ibotgr, &
120 itopt, itopcu, itopdcu, itopscu, itopgr
121 REAL,
dimension(im,jm) :: grid1
122 REAL,
dimension(im,jsta:jend) :: grid2, egrid1, egrid2, egrid3, &
123 cldp, cldz, cldt, cldzcu
124 REAL,
dimension(lm) :: rhb, watericetotal, pabovesfc
125 REAL :: watericemax, wimin, zcldbase, zcldtop, zpbltop, &
126 rhoice, coeffp, exponfp, const1, cloud_def_p, &
127 pcldbase, rhoair, vovermd, concfp, betav, &
128 vertvis, tx, tv, pol, esx, es, e, zsf, zcld, frac
129 integer nfog, nfogn(7),npblcld,nlifr, k1, k2, ll, ii, ib, n, jj, &
131 real,
dimension(lm) :: cldfra, cfr_layer_sum
132 real :: ceiling_thresh_cldfra, cldfra_max, &
133 zceil, zceil1, zceil2, previous_sum, &
134 ceil_min, ceil_neighbor
136 real,
dimension(im,jm) :: ceil
139 REAL,
dimension(im,jsta:jend) :: tcld, ceiling
140 real cu_ir(lm), q_conv
142 integer i,j,l,k,ibot,itclod,lbot,ltop,itrdsw,itrdlw, &
143 llmh,itheat,ifincr,itype,itop,num_thick
144 real dpbnd,rrnum,qcld,rsum,tlmh,factrs,factrl,dp, &
145 opdepth, tmp,qsat,rhum,tcext,delz,dely,dy_m
148 real,
allocatable :: full_ceil(:,:), full_fis(:,:)
150 real dummy(im,jsta:jend)
151 integer idummy(im,jsta:jend)
160 integer,
parameter :: krhlev = 36
161 integer,
parameter :: kcm1 = 5
162 integer,
parameter :: kcm2 = 5
163 integer,
parameter :: nbdsw = 7
164 integer,
parameter :: noaer = 20
165 integer,
parameter :: naero=kcm2
166 CHARACTER :: aerosolname(kcm2)*4, aerosolname_rd*4, aerosol_file*30
167 CHARACTER :: aername_rd*4, aeropt*3
170 REAL,
ALLOCATABLE :: extrhd_du(:,:,:), extrhd_ss(:,:,:), &
171 & extrhd_SU(:,:,:), extrhd_BC(:,:,:), &
175 REAL,
ALLOCATABLE :: scarhd_du(:,:,:), scarhd_ss(:,:,:), &
176 & scarhd_SU(:,:,:), scarhd_BC(:,:,:), &
180 REAL,
ALLOCATABLE :: asyrhd_du(:,:,:), asyrhd_ss(:,:,:), &
181 & asyrhd_SU(:,:,:), asyrhd_BC(:,:,:), &
185 REAL,
ALLOCATABLE :: ssarhd_du(:,:,:), ssarhd_ss(:,:,:), &
186 & ssarhd_SU(:,:,:), ssarhd_BC(:,:,:), &
191 real (kind=kind_phys) :: extrhi(kcm1,nbdsw)
194 real (kind=kind_phys) :: extrhd(krhlev,kcm2,nbdsw)
196 REAL,
dimension(im,jsta:jend) :: p1d,t1d,q1d,egrid4
198 real,
allocatable:: rdrh(:,:,:)
199 integer,
allocatable :: ihh(:,:,:)
200 REAL :: rh3d, drh0, drh1, ext01, ext02,sca01,asy01
202 INTEGER :: ios, indx, issam, isscm, isuso, iwaso, isoot, nbin
203 REAL :: ccdry, ccwet, ssam, sscm
204 REAL,
dimension(im,jsta:jend) :: aod_du, aod_ss, aod_su, aod_oc, aod_bc, aod
205 REAL,
dimension(im,jsta:jend) :: sca_du, sca_ss, sca_su, sca_oc,sca_bc, sca2d
206 REAL,
dimension(im,jsta:jend) :: asy_du, asy_ss, asy_su, asy_oc, asy_bc,asy2d
207 REAL,
dimension(im,jsta:jend) :: angst, aod_440, aod_860
209 INTEGER :: indx_ext(naero), indx_sca(naero)
210 LOGICAL :: laeropt, lext, lsca, lasy
212 REAL,
allocatable :: fpm25_du(:),fpm25_ss(:)
213 REAL,
allocatable,
dimension(:,:) :: rhosfc, smass_du_cr,smass_du_fn, &
214 & smass_ss_cr, smass_ss_fn, smass_oc,smass_bc, &
215 & smass_su, smass_cr, smass_fn
217 real (kind=kind_phys),
dimension(KRHLEV) :: rhlev
218 data rhlev(:)/ .0, .05, .10, .15, .20, .25, .30, .35, &
219 & .40, .45, .50, .55, .60, .65, .70, .75, &
220 & .80, .81, .82, .83, .84, .85, .86, .87, &
221 & .88, .89, .90, .91, .92, .93, .94, .95, &
222 & .96, .97, .98, .99/
224 data aerosolname /
'DUST',
'SALT',
'SUSO',
'SOOT',
'WASO'/
226 data indx_ext / 610, 611, 612, 613, 614 /
227 data indx_sca / 651, 652, 653, 654, 655 /
228 logical,
parameter :: debugprint = .false.
229 logical :: model_pwat
245 IF (iget(030)>0.OR.iget(572)>0)
THEN
255 IF(modelname ==
'RAPR')
THEN
259 IF(egrid1(i,j) < spval) grid1(i,j) = egrid1(i,j)
266 IF(egrid1(i,j) < spval) grid1(i,j) = egrid1(i,j) + tfrz
271 if(iget(030) > 0)
then
272 if(grib ==
"grib2" )
then
274 fld_info(cfld)%ifld = iavblfld(iget(030))
279 datapd(i,j,cfld) = grid1(i,jj)
285 if(iget(572) > 0)
then
286 if(grib ==
"grib2" )
then
288 fld_info(cfld)%ifld = iavblfld(iget(572))
294 if (grid1(i,jj) /= spval) grid1(i,jj) = grid1(i,jj) - tfrz
295 datapd(i,j,cfld) = grid1(i,jj)
307 IF ((iget(032) > 0))
THEN
310 IF ( (lvls(1,iget(032))>0) )
THEN
315 CALL calcape(itype,dpbnd,dummy,dummy,dummy,idummy,egrid1,egrid2, &
320 IF(fis(i,j) < spval) grid1(i,j) = egrid1(i,j)
323 CALL bound(grid1,d00,h99999)
324 if(grib ==
"grib2" )
then
326 fld_info(cfld)%ifld = iavblfld(iget(032))
331 datapd(i,j,cfld) = grid1(i,jj)
339 IF ((iget(107) > 0))
THEN
342 IF ( (lvls(1,iget(107)) > 0) )
THEN
343 IF ((iget(032) > 0))
THEN
344 IF ( (lvls(1,iget(032)) > 0) )
THEN
348 IF(fis(i,j) < spval) grid1(i,j) = - egrid2(i,j)
357 CALL calcape(itype,dpbnd,dummy,dummy,dummy,idummy,egrid1,egrid2, &
362 IF(fis(i,j) < spval) grid1(i,j) = - egrid2(i,j)
366 CALL bound(grid1,d00,h99999)
370 IF(fis(i,j) < spval) grid1(i,j) = - grid1(i,j)
373 if(grib ==
"grib2" )
then
375 fld_info(cfld)%ifld = iavblfld(iget(107))
380 datapd(i,j,cfld) = grid1(i,jj)
390 IF (iget(080) > 0)
THEN
396 IF(abs(pwat(i,j)-spval)>small)
THEN
405 grid1(i,j) = pwat(i,j)
409 CALL calpw(grid1(1,jsta),1)
412 IF(fis(i,j) >= spval) grid1(i,j)=spval
416 CALL bound(grid1,d00,h99999)
417 if(grib ==
"grib2" )
then
419 fld_info(cfld)%ifld = iavblfld(iget(080))
424 datapd(i,j,cfld) = grid1(i,jj)
433 IF (iget(735) > 0)
THEN
434 CALL calpw(grid1(1,jsta),19)
435 CALL bound(grid1,d00,h99999)
436 if(grib ==
"grib2" )
then
438 fld_info(cfld)%ifld = iavblfld(iget(735))
443 datapd(i,j,cfld) = grid1(i,jj)
452 IF (iget(736) > 0)
THEN
453 CALL calpw(grid1(1,jsta),18)
454 CALL bound(grid1,d00,h99999)
455 if(grib ==
"grib2" )
then
457 fld_info(cfld)%ifld = iavblfld(iget(736))
462 datapd(i,j,cfld) = grid1(i,jj)
469 IF (iget(200) > 0 .or. iget(575) > 0)
THEN
472 IF (modelname ==
'RAPR')
THEN
475 IF(lwp(i,j) < spval) grid1(i,j) = lwp(i,j)/1000.0
479 CALL calpw(grid1(1,jsta),2)
480 IF(modelname ==
'GFS')
then
482 CALL calpw(grid2(1,jsta),3)
486 IF(grid1(i,j)<spval.and.grid2(i,j)<spval)
THEN
487 grid1(i,j) = grid1(i,j) + grid2(i,j)
496 CALL bound(grid1,d00,h99999)
497 if(iget(200) > 0)
then
498 if(grib ==
"grib2" )
then
500 fld_info(cfld)%ifld = iavblfld(iget(200))
505 datapd(i,j,cfld) = grid1(i,jj)
510 if(iget(575) > 0)
then
511 if(grib ==
"grib2" )
then
513 fld_info(cfld)%ifld = iavblfld(iget(575))
518 datapd(i,j,cfld) = grid1(i,jj)
527 IF (iget(201) > 0)
THEN
529 IF (modelname ==
'RAPR')
THEN
532 IF(iwp(i,j) < spval) grid1(i,j) = iwp(i,j)/1000.0
536 CALL calpw(grid1(1,jsta),3)
538 CALL bound(grid1,d00,h99999)
539 if(grib ==
"grib2" )
then
541 fld_info(cfld)%ifld = iavblfld(iget(201))
546 datapd(i,j,cfld) = grid1(i,jj)
553 IF (iget(202) > 0)
THEN
554 CALL calpw(grid1(1,jsta),4)
555 CALL bound(grid1,d00,h99999)
556 if(grib==
"grib2" )
then
558 fld_info(cfld)%ifld=iavblfld(iget(202))
563 datapd(i,j,cfld) = grid1(i,jj)
570 IF (iget(203) > 0)
THEN
571 CALL calpw(grid1(1,jsta),5)
572 CALL bound(grid1,d00,h99999)
573 if(grib==
"grib2" )
then
575 fld_info(cfld)%ifld=iavblfld(iget(203))
580 datapd(i,j,cfld) = grid1(i,jj)
588 IF (iget(428) > 0)
THEN
589 CALL calpw(grid1(1,jsta),16)
590 CALL bound(grid1,d00,h99999)
591 if(grib==
"grib2" )
then
593 fld_info(cfld)%ifld=iavblfld(iget(428))
598 datapd(i,j,cfld) = grid1(i,jj)
606 IF (iget(204) > 0)
THEN
607 CALL calpw(grid1(1,jsta),6)
608 CALL bound(grid1,d00,h99999)
609 if(grib==
"grib2" )
then
611 fld_info(cfld)%ifld=iavblfld(iget(204))
616 datapd(i,j,cfld) = grid1(i,jj)
623 IF (iget(285) > 0)
THEN
624 CALL calpw(grid1(1,jsta),7)
625 CALL bound(grid1,d00,h99999)
626 if(grib==
"grib2" )
then
628 fld_info(cfld)%ifld=iavblfld(iget(285))
633 datapd(i,j,cfld) = grid1(i,jj)
640 IF (iget(286) > 0)
THEN
641 CALL calpw(grid1(1,jsta),8)
642 CALL bound(grid1,d00,h99999)
643 if(grib==
"grib2" )
then
645 fld_info(cfld)%ifld=iavblfld(iget(286))
650 datapd(i,j,cfld) = grid1(i,jj)
657 IF (iget(290) > 0)
THEN
658 CALL calpw(grid1(1,jsta),9)
659 if(grib==
"grib2" )
then
661 fld_info(cfld)%ifld=iavblfld(iget(290))
666 datapd(i,j,cfld) = grid1(i,jj)
673 IF (iget(291) > 0)
THEN
674 CALL calpw(grid1(1,jsta),10)
675 if(grib==
"grib2" )
then
677 fld_info(cfld)%ifld=iavblfld(iget(291))
682 datapd(i,j,cfld) = grid1(i,jj)
689 IF (iget(292) > 0)
THEN
690 CALL calpw(grid1(1,jsta),11)
699 IF(grid1(i,j) < spval) grid1(i,j) = grid1(i,j)*rrnum
704 IF (itheat /= 0)
THEN
705 ifincr = mod(ifhr,itheat)
710 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
717 IF(ifmin >= 1)id(18)=id(18)*60
718 IF (id(18)<0) id(18) = 0
719 if(grib==
"grib2" )
then
721 fld_info(cfld)%ifld=iavblfld(iget(292))
723 fld_info(cfld)%ntrange=1
725 fld_info(cfld)%ntrange=0
727 fld_info(cfld)%tinvstat=ifhr-id(18)
732 datapd(i,j,cfld) = grid1(i,jj)
739 IF (iget(293) > 0)
THEN
740 CALL calpw(grid1(1,jsta),12)
749 IF(grid1(i,j) < spval) grid1(i,j) = grid1(i,j)*rrnum
754 IF (itheat /= 0)
THEN
755 ifincr = mod(ifhr,itheat)
760 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
767 IF(ifmin >= 1)id(18)=id(18)*60
768 IF (id(18)<0) id(18) = 0
769 if(grib==
"grib2" )
then
771 fld_info(cfld)%ifld=iavblfld(iget(293))
773 fld_info(cfld)%ntrange=1
775 fld_info(cfld)%ntrange=0
777 fld_info(cfld)%tinvstat=ifhr-id(18)
782 datapd(i,j,cfld) = grid1(i,jj)
789 IF (iget(295)>0)
THEN
790 CALL calpw(grid1(1,jsta),13)
791 if(grib==
"grib2" )
then
793 fld_info(cfld)%ifld=iavblfld(iget(295))
794 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
799 IF (iget(312)>0)
THEN
800 CALL calpw(grid1(1,jsta),14)
801 if(grib==
"grib2" )
then
803 fld_info(cfld)%ifld=iavblfld(iget(312))
804 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
809 IF (iget(299) > 0)
THEN
810 CALL calpw(grid1(1,jsta),15)
811 if(grib==
"grib2" )
then
813 fld_info(cfld)%ifld=iavblfld(iget(299))
818 datapd(i,j,cfld) = grid1(i,jj)
825 IF (iget(287)>0 .OR. iget(288)>0)
THEN
834 qcld=qqw(i,j,l)+qqr(i,j,l)
835 IF (qcld>=qcldmin .AND. t(i,j,l)<tfrz)
THEN
844 grid1(i,j)=zint(i,j,lbot+1)
846 qcld=qqw(i,j,l)+qqr(i,j,l)
847 IF (qcld>=qcldmin .AND. t(i,j,l)<tfrz)
THEN
853 grid2(i,j)=zint(i,j,ltop)
857 IF (iget(287)>0)
THEN
858 if(grib==
"grib2" )
then
860 fld_info(cfld)%ifld=iavblfld(iget(287))
861 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
864 IF (iget(288)>0)
THEN
868 grid1(i,j)=grid2(i,j)
871 if(grib==
"grib2" )
then
873 fld_info(cfld)%ifld=iavblfld(iget(288))
878 datapd(i,j,cfld) = grid1(i,jj)
888 IF (iget(197)>0)
THEN
891 grid1(i,j) = cldefi(i,j)
894 if(grib==
"grib2" )
then
896 fld_info(cfld)%ifld=iavblfld(iget(197))
897 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
901 IF ((modelname==
'NMM' .AND. gridtype==
'B') .OR. &
902 modelname==
'FV3R')
THEN
921 if(grib ==
"grib2" )
then
930 if(cfr(i,j,l)<spval)
then
931 full_cld(i,j)=cfr(i,j,l)
937 CALL allgetherv(full_cld)
942 DO jc=max(1,j-numr),min(jm,j+numr)
943 DO ic=max(1,i-numr),min(im,i+numr)
945 IF(full_cld(ic,jc) /= spval)
THEN
947 frac=frac+full_cld(ic,jc)
954 IF (numpts>0) frac=frac/
REAL(numpts)
955 if(pmid(i,j,l)<spval)
then
957 IF (pcldbase>=ptop_low)
THEN
958 cfracl(i,j)=max(cfracl(i,j),frac)
959 ELSE IF (pcldbase>=ptop_mid)
THEN
960 cfracm(i,j)=max(cfracm(i,j),frac)
962 cfrach(i,j)=max(cfrach(i,j),frac)
964 tcld(i,j)=max(tcld(i,j),frac)
975 ELSEIF (modelname==
'GFS')
THEN
995 IF (pcldbase>=ptop_low)
THEN
996 cfracl(i,j)=max(cfracl(i,j),frac)
997 ELSE IF (pcldbase>=ptop_mid)
THEN
998 cfracm(i,j)=max(cfracm(i,j),frac)
1000 cfrach(i,j)=max(cfrach(i,j),frac)
1002 tcld(i,j)=max(tcld(i,j),frac)
1011 IF (iget(799)>0)
THEN
1017 IF (zmid(i,j,lm-k+1) <= pblh(i,j)+1000.0)
THEN
1018 grid1(i,j)=max(grid1(i,j),cfr(i,j,lm-k+1)*100.0)
1023 if(grib==
"grib2" )
then
1025 fld_info(cfld)%ifld=iavblfld(iget(799))
1026 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1031 IF (iget(037) > 0)
THEN
1035 IF(cfracl(i,j) < spval)
then
1036 grid1(i,j) = cfracl(i,j)*100.
1042 if(grib==
"grib2" )
then
1044 fld_info(cfld)%ifld=iavblfld(iget(037))
1049 datapd(i,j,cfld) = grid1(i,jj)
1056 IF (iget(300) > 0)
THEN
1060 IF(avgcfracl(i,j) < spval)
then
1061 grid1(i,j) = avgcfracl(i,j)*100.
1068 itclod = nint(tclod)
1069 IF(itclod /= 0)
then
1070 ifincr = mod(ifhr,itclod)
1071 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1077 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1080 id(18) = ifhr-itclod
1082 id(18) = ifhr-ifincr
1083 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1085 IF (id(18)<0) id(18) = 0
1086 if(grib==
"grib2" )
then
1088 fld_info(cfld)%ifld=iavblfld(iget(300))
1090 fld_info(cfld)%ntrange=1
1092 fld_info(cfld)%ntrange=0
1094 fld_info(cfld)%tinvstat=ifhr-id(18)
1099 datapd(i,j,cfld) = grid1(i,jj)
1106 IF (iget(038) > 0)
THEN
1111 IF(cfracm(i,j) < spval)
then
1112 grid1(i,j) = cfracm(i,j)*100.
1118 if(grib==
"grib2" )
then
1120 fld_info(cfld)%ifld=iavblfld(iget(038))
1125 datapd(i,j,cfld) = grid1(i,jj)
1132 IF (iget(301) > 0)
THEN
1136 IF(abs(avgcfracm(i,j)-spval)>small)
THEN
1137 grid1(i,j) = avgcfracm(i,j)*100.
1144 itclod = nint(tclod)
1145 IF(itclod /= 0)
then
1146 ifincr = mod(ifhr,itclod)
1147 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1153 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1156 id(18) = ifhr-itclod
1158 id(18) = ifhr-ifincr
1159 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1161 IF (id(18)<0) id(18) = 0
1162 if(grib==
"grib2" )
then
1164 fld_info(cfld)%ifld=iavblfld(iget(301))
1166 fld_info(cfld)%ntrange=1
1168 fld_info(cfld)%ntrange=0
1170 fld_info(cfld)%tinvstat=ifhr-id(18)
1175 datapd(i,j,cfld) = grid1(i,jj)
1182 IF (iget(039)>0)
THEN
1187 IF(cfrach(i,j) < spval)
then
1188 grid1(i,j) = cfrach(i,j)*100.
1194 if(grib==
"grib2" )
then
1196 fld_info(cfld)%ifld=iavblfld(iget(039))
1201 datapd(i,j,cfld) = grid1(i,jj)
1208 IF (iget(302) > 0)
THEN
1213 IF(avgcfrach(i,j) < spval)
then
1214 grid1(i,j) = avgcfrach(i,j)*100.
1221 itclod = nint(tclod)
1222 IF(itclod /= 0)
then
1223 ifincr = mod(ifhr,itclod)
1224 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1230 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1233 id(18) = ifhr-itclod
1235 id(18) = ifhr-ifincr
1236 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1238 IF (id(18)<0) id(18) = 0
1239 if(grib==
"grib2" )
then
1241 fld_info(cfld)%ifld=iavblfld(iget(302))
1243 fld_info(cfld)%ntrange=1
1245 fld_info(cfld)%ntrange=0
1247 fld_info(cfld)%tinvstat=ifhr-id(18)
1252 datapd(i,j,cfld) = grid1(i,jj)
1259 IF ((iget(161) > 0) .OR. (iget(260) > 0))
THEN
1261 IF(modelname==
'NCAR' .OR. modelname==
'RAPR')
THEN
1268 egrid1(i,j)=max(egrid1(i,j),cfr(i,j,l))
1273 ELSE IF (modelname==
'NMM'.OR.modelname==
'FV3R' &
1274 .OR. modelname==
'GFS')
THEN
1282 egrid1(i,j)=tcld(i,j)
1289 IF(abs(egrid1(i,j)-spval) > small)
THEN
1290 grid1(i,j) = egrid1(i,j)*100.
1291 tcld(i,j) = egrid1(i,j)*100.
1295 IF (iget(161)>0)
THEN
1296 if(grib==
"grib2" )
then
1298 fld_info(cfld)%ifld=iavblfld(iget(161))
1303 datapd(i,j,cfld) = grid1(i,jj)
1311 IF (iget(144) > 0)
THEN
1313 IF(modelname ==
'GFS' .OR. modelname ==
'FV3R')
THEN
1317 IF(abs(avgtcdc(i,j)-spval) > small)
then
1318 grid1(i,j) = avgtcdc(i,j)*100.
1325 ELSE IF(modelname ==
'NMM')
THEN
1336 IF (ncfrst(i,j)<spval.and.acfrst(i,j)<spval)
THEN
1337 IF (ncfrst(i,j) > 0) rsum=acfrst(i,j)/ncfrst(i,j)
1338 IF (ncfrcv(i,j) > 0) &
1339 rsum=max(rsum, acfrcv(i,j)/ncfrcv(i,j))
1340 grid1(i,j) = rsum*100.
1347 IF(modelname ==
'NMM' .OR. modelname ==
'GFS' .OR. &
1348 modelname ==
'FV3R')
THEN
1350 itclod = nint(tclod)
1351 IF(itclod /= 0)
then
1352 ifincr = mod(ifhr,itclod)
1353 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1359 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1362 id(18) = ifhr-itclod
1364 id(18) = ifhr-ifincr
1365 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1367 IF (id(18)<0) id(18) = 0
1369 if(grib==
"grib2" )
then
1371 fld_info(cfld)%ifld=iavblfld(iget(144))
1373 fld_info(cfld)%ntrange=1
1375 fld_info(cfld)%ntrange=0
1377 fld_info(cfld)%tinvstat=ifhr-id(18)
1382 datapd(i,j,cfld) = grid1(i,jj)
1389 IF (iget(139)>0)
THEN
1390 IF(modelname /=
'NMM')
THEN
1395 IF (ncfrst(i,j)<spval.and.acfrst(i,j)<spval)
THEN
1396 IF (ncfrst(i,j)>0.0)
THEN
1397 grid1(i,j) = acfrst(i,j)/ncfrst(i,j)*100.
1407 IF(modelname==
'NMM' .or. modelname==
'FV3R')
THEN
1409 itclod = nint(tclod)
1410 IF(itclod /= 0)
then
1411 ifincr = mod(ifhr,itclod)
1412 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1417 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1420 id(18) = ifhr-itclod
1422 id(18) = ifhr-ifincr
1423 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1425 IF (id(18)<0) id(18) = 0
1427 if(grib==
"grib2" )
then
1429 fld_info(cfld)%ifld=iavblfld(iget(139))
1431 fld_info(cfld)%ntrange=1
1433 fld_info(cfld)%ntrange=0
1435 fld_info(cfld)%tinvstat=ifhr-id(18)
1436 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1441 IF (iget(143)>0)
THEN
1442 IF(modelname /=
'NMM')
THEN
1447 IF (ncfrcv(i,j)<spval.and.acfrcv(i,j)<spval)
THEN
1448 IF (ncfrcv(i,j)>0.0)
THEN
1449 grid1(i,j) = acfrcv(i,j)/ncfrcv(i,j)*100.
1459 IF(modelname==
'NMM')
THEN
1461 itclod = nint(tclod)
1462 IF(itclod /= 0)
then
1463 ifincr = mod(ifhr,itclod)
1464 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
1469 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
1472 id(18) = ifhr-itclod
1474 id(18) = ifhr-ifincr
1475 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
1477 IF (id(18)<0) id(18) = 0
1479 if(grib==
"grib2" )
then
1481 fld_info(cfld)%ifld=iavblfld(iget(143))
1483 fld_info(cfld)%ntrange=1
1485 fld_info(cfld)%ntrange=0
1487 fld_info(cfld)%tinvstat=ifhr-id(18)
1488 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1493 IF((iget(148)>0) .OR. (iget(149)>0) .OR. &
1494 (iget(168)>0) .OR. (iget(178)>0) .OR. &
1495 (iget(179)>0) .OR. (iget(194)>0) .OR. &
1496 (iget(408)>0) .OR. &
1497 (iget(409)>0) .OR. (iget(406)>0) .OR. &
1498 (iget(195)>0) .OR. (iget(260)>0) .OR. &
1520 if (hbot(i,j) /= spval)
then
1521 ibotcu(i,j) = nint(hbot(i,j))
1523 if (hbotd(i,j) /= spval)
then
1524 ibotdcu(i,j) = nint(hbotd(i,j))
1526 if (hbots(i,j) /= spval)
then
1527 ibotscu(i,j) = nint(hbots(i,j))
1529 if (htop(i,j) /= spval)
then
1530 itopcu(i,j) = nint(htop(i,j))
1532 if (htopd(i,j) /= spval)
then
1533 itopdcu(i,j) = nint(htopd(i,j))
1535 if (htops(i,j) /= spval)
then
1536 itopscu(i,j) = nint(htops(i,j))
1538 IF (ibotcu(i,j)-itopcu(i,j) <= 1)
THEN
1542 IF (ibotdcu(i,j)-itopdcu(i,j) <= 1)
THEN
1546 IF (ibotscu(i,j)-itopscu(i,j) <= 1)
THEN
1552 IF (itop > 0 .AND. itop < 100)
THEN
1555 IF (itop > 0 .AND. itop <= nint(lmh(i,j)))
THEN
1556 cldzcu(i,j) = zmid(i,j,itop)
1558 cldzcu(i,j) = -5000.
1567 if(modelname ==
'RAPR')
then
1569 DO l=nint(lmh(i,j)),1,-1
1570 qcld=qqw(i,j,l)+qqi(i,j,l)+qqs(i,j,l)
1571 IF (qcld >= qcldmin)
THEN
1577 DO l=1,nint(lmh(i,j))
1578 qcld=qqw(i,j,l)+qqi(i,j,l)+qqs(i,j,l)
1579 IF (qcld >= qcldmin)
THEN
1586 zpbltop = pblh(i,j)+zint(i,j,nint(lmh(i,j))+1)
1587 DO l=nint(lmh(i,j)),1,-1
1588 qcld = qqw(i,j,l)+qqi(i,j,l)
1589 IF (qcld >= qcldmin)
THEN
1593 snow_check:
IF (qqs(i,j,l)>=qcldmin)
THEN
1596 qsat=pq0/pmid(i,j,l)*exp(a2*(tmp-a3)/(tmp-a4))
1600 qsat=pq0/pmid(i,j,l)*exp(21.8745584*(tmp-a3)/(tmp-7.66))
1603 IF (rhum>=0.98 .AND. zmid(i,j,l)>=zpbltop)
THEN
1610 DO l=1,nint(lmh(i,j))
1611 qcld=qqw(i,j,l)+qqi(i,j,l)+qqs(i,j,l)
1612 IF (qcld >= qcldmin)
THEN
1620 IF(modelname ==
'NCAR' .OR. modelname ==
'RAPR')
THEN
1621 ibott(i,j) = ibotgr(i,j)
1622 itopt(i,j) = itopgr(i,j)
1624 ibott(i,j) = max(ibotgr(i,j), ibotcu(i,j))
1627 itopt(i,j) = min(itopgr(i,j), itopcu(i,j))
1634 IF (iget(758)>0)
THEN
1638 grid1(i,j) = cldzcu(i,j)
1641 if(grib==
"grib2" )
then
1643 fld_info(cfld)%ifld=iavblfld(iget(758))
1644 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1654 IF ((iget(148)>0) .OR. (iget(178)>0) .OR.(iget(260)>0) )
THEN
1658 IF(modelname ==
'RAPR')
then
1662 ELSE IF (ibot <= nint(lmh(i,j)))
THEN
1663 cldp(i,j) = pmid(i,j,ibot)
1664 IF (ibot == lm)
THEN
1665 cldz(i,j) = zint(i,j,lm)
1667 cldz(i,j) = htm(i,j,ibot+1)*t(i,j,ibot+1) &
1668 *(q(i,j,ibot+1)*d608+h1)*rog* &
1669 (log(pint(i,j,ibot+1))-log(cldp(i,j)))&
1674 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
1675 cldp(i,j) = pmid(i,j,ibot)
1676 cldz(i,j) = zmid(i,j,ibot)
1685 IF (iget(148)>0)
THEN
1688 grid1(i,j) = cldp(i,j)
1691 if(grib==
"grib2" )
then
1693 fld_info(cfld)%ifld=iavblfld(iget(148))
1694 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1698 IF (iget(178)>0)
THEN
1702 grid1(i,j) = cldz(i,j)
1705 if(grib==
"grib2" )
then
1707 fld_info(cfld)%ifld=iavblfld(iget(178))
1708 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1716 IF (iget(408)>0)
THEN
1734 cloud_def_p = 0.0000001
1742 watericemax = -99999.
1745 watericetotal(k) = qqw(i,j,ll) + qqi(i,j,ll)
1746 watericemax = max(watericemax,watericetotal(k))
1749 if (watericemax>=cloud_def_p)
then
1756 pabovesfc(k) = pint(i,j,lm) - pint(i,j,lm-k+1)
1757 if (watericetotal(k)<cloud_def_p)
then
1761 wimin = min(wimin,watericetotal(k1))
1763 if (wimin>cloud_def_p)
then
1764 nfogn(k)= nfogn(k)+1
1773 if (watericetotal(k)<cloud_def_p)
then
1774 if (watericetotal(1)>cloud_def_p)
then
1777 if (watericetotal(k1)>=cloud_def_p)
then
1778 watericetotal(k1)=0.
1796 if (watericetotal(k)>cloud_def_p)
then
1800 zcldbase = zmid(i,j,lm-k1+1)
1801 pcldbase = pmid(i,j,lm-k1+1)
1804 zcldbase = zmid(i,j,lm-k1+1) + (cloud_def_p-watericetotal(k1)) &
1805 * (zmid(i,j,lm-k1+2)-zmid(i,j,lm-k1+1)) &
1806 / (watericetotal(k1-1) - watericetotal(k1))
1807 pcldbase = pmid(i,j,lm-k1+1) + (cloud_def_p-watericetotal(k1)) &
1808 * (pmid(i,j,lm-k1+2)-pmid(i,j,lm-k1+1)) &
1809 / (watericetotal(k1-1) - watericetotal(k1))
1811 zcldbase = max(zcldbase,fis(i,j)*gi+5.)
1817 if (qqs(i,j,lm)>0.)
then
1818 tv=t(i,j,lm)*(h1+d608*q(i,j,lm))
1819 rhoair=pmid(i,j,lm)/(rd*tv)
1820 vovermd = (1.+q(i,j,lm))/rhoair + qqs(i,j,lm)/rhoice
1821 concfp = qqs(i,j,lm)/vovermd*1000.
1822 betav = coeffp*concfp**exponfp + 1.e-10
1823 vertvis = 1000.*min(90., const1/betav)
1824 if (vertvis < zcldbase-fis(i,j)*gi )
then
1825 zcldbase = fis(i,j)*gi + vertvis
1826 loop3741:
do k2=2,lm
1828 if (zmid(i,j,lm-k2+1) > zcldbase)
then
1829 pcldbase = pmid(i,j,lm-k1+2) + (zcldbase-zmid(i,j,lm-k1+2)) &
1830 *(pmid(i,j,lm-k1+1)-pmid(i,j,lm-k1+2) ) &
1831 /(zmid(i,j,lm-k1+1)-zmid(i,j,lm-k1+2) )
1843 cldz(i,j) = zcldbase
1844 cldp(i,j) = pcldbase
1857 pol = 0.99999683 + tx*(-0.90826951e-02 + &
1858 tx*(0.78736169e-04 + tx*(-0.61117958e-06 + &
1859 tx*(0.43884187e-08 + tx*(-0.29883885e-10 + &
1860 tx*(0.21874425e-12 + tx*(-0.17892321e-14 + &
1861 tx*(0.11112018e-16 + tx*(-0.30994571e-19)))))))))
1865 e = pmid(i,j,ll)/100.*q(i,j,ll)/(0.62197+q(i,j,ll)*0.37803)
1866 rhb(k) = 100.*min(1.,e/es)
1874 zsf=zint(i,j,nint(lmh(i,j))+1)
1875 zpbltop = pblh(i,j)+zsf
1882 if (zpbltop<zmid(i,j,lm-k2+1))
then
1883 if (rhb(k2-1)>95. )
then
1884 zcldbase = zmid(i,j,lm-k2+2)
1885 if (cldz(i,j)<-100.)
then
1887 cldz(i,j) = zcldbase
1888 cldp(i,j) = pmid(i,j,lm-k2+2)
1891 if ( zcldbase<cldz(i,j))
then
1892 cldz(i,j) = zcldbase
1902 if(cldz(i,j)<-100.)
then
1903 cldz(i,j)=zmid(i,j,ibot)
1905 if(zmid(i,j,ibot)<cldz(i,j))
then
1906 cldz(i,j)=zmid(i,j,ibot)
1914 write(6,*)
'No. pts with PBL-cloud =',npblcld
1915 write(6,*)
'No. pts to eliminate fog =',nfog
1917 write(6,*)
'No. pts with fog below lev',k,
' =',nfogn(k)
1923 zcld = cldz(i,j) - fis(i,j)*gi
1924 if (cldz(i,j)>=0..and.zcld<160.) nlifr = nlifr+1
1927 write(6,*)
'No. pts w/ LIFR ceiling =',nlifr
1930 IF (iget(408)>0)
THEN
1934 grid1(i,j) = cldz(i,j)
1937 if(grib==
"grib2" )
then
1939 fld_info(cfld)%ifld=iavblfld(iget(408))
1940 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1948 IF (iget(487)>0)
THEN
1955 ceiling_thresh_cldfra = 0.5
1964 cldfra(k) = cfr(i,j,ll)
1965 cldfra_max = max(cldfra_max,cldfra(k))
1968 if (cldfra_max >= ceiling_thresh_cldfra)
then
1973 if (cldfra(k) < ceiling_thresh_cldfra)
then
1974 if (cldfra(1) > ceiling_thresh_cldfra)
then
1976 if (cldfra(k1) >= ceiling_thresh_cldfra)
then
1989 if (cldfra(k) >= ceiling_thresh_cldfra)
then
1991 zceil = zmid(i,j,lm-k1+1)
1993 zceil = zmid(i,j,lm-k1+1) + (ceiling_thresh_cldfra-cldfra(k1)) &
1994 * (zmid(i,j,lm-k1+2)-zmid(i,j,lm-k1+1)) &
1995 / (cldfra(k1-1) - cldfra(k1))
1997 zceil = max(zceil,fis(i,j)*gi+5.)
2001 if (qqs(i,j,lm)>0.)
then
2002 tv=t(i,j,lm)*(h1+d608*q(i,j,lm))
2003 rhoair=pmid(i,j,lm)/(rd*tv)
2004 vovermd = (1.+q(i,j,lm))/rhoair + qqs(i,j,lm)/rhoice
2005 concfp = qqs(i,j,lm)/vovermd*1000.
2006 betav = coeffp*concfp**exponfp + 1.e-10
2007 vertvis = 1000.*min(90., const1/betav)
2008 if (vertvis < zceil-fis(i,j)*gi )
then
2009 zceil = fis(i,j)*gi + vertvis
2025 grid1(i,j) = ceil(i,j)
2028 if(grib==
"grib2" )
then
2030 fld_info(cfld)%ifld=iavblfld(iget(487))
2031 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2045 IF ((iget(711)>0) .OR. (iget(798)>0))
THEN
2047 ceiling_thresh_cldfra = 0.4
2065 cldfra(k) = cfr(i,j,lm-k+1)
2072 if (cldfra(1) >= ceiling_thresh_cldfra)
then
2074 if (cldfra(k) < 0.6)
then
2082 if (cldfra(k) >= ceiling_thresh_cldfra)
then
2084 zceil1 = zmid(i,j,lm-k+1)
2086 zceil1 = zmid(i,j,lm-k+1) + (ceiling_thresh_cldfra-cldfra(k)) &
2087 * (zmid(i,j,lm-k+2)-zmid(i,j,lm-k+1)) &
2088 / (cldfra(k-1) - cldfra(k))
2108 cfr_layer_sum(1:lm)=0.0
2111 if ( (cldfra(k) >= 0.05 ) .and. &
2112 (cldfra(k) > cldfra(k-1)) .and. &
2113 (cldfra(k) >= cldfra(k+1)) ) &
2123 cfr_layer_sum(k) = min(1.0, previous_sum + cldfra(k))
2124 previous_sum = min(1.0, cfr_layer_sum(k))
2126 if (cfr_layer_sum(k) >= ceiling_thresh_cldfra)
then
2127 zceil2 = zmid(i,j,lm-k+1) + (ceiling_thresh_cldfra-cfr_layer_sum(k)) &
2128 * (zmid(i,j,lm-k+2)-zmid(i,j,lm-k+1)) &
2129 / (cfr_layer_sum(k-1) - cfr_layer_sum(k))
2137 zceil = min(zceil1,zceil2)
2142 if (qqs(i,j,lm)>1.e-10)
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
2151 zceil = fis(i,j)*gi + vertvis
2171 allocate(full_ceil(im,jm),full_fis(im,jm))
2174 full_ceil(i,j)=ceil(i,j)
2175 full_fis(i,j)=fis(i,j)
2178 CALL allgetherv(full_ceil)
2179 CALL allgetherv(full_fis)
2183 ceil_min = max( ceil(i,j)-fis(i,j)*gi , 5.0)
2184 do jc = max(1,j-numr),min(jm,j+numr)
2185 do ic = max(1,i-numr),min(im,i+numr)
2186 ceil_neighbor = max( full_ceil(ic,jc)-full_fis(ic,jc)*gi , 5.0)
2187 ceil_min = min( ceil_min, ceil_neighbor )
2190 cldz(i,j) = ceil_min + fis(i,j)*gi
2191 cldz(i,j) = max(min(cldz(i,j), 20000.0),0.0)
2194 if ( zmid(i,j,lm-k+1) >= cldz(i,j) )
then
2195 cldp(i,j) = pmid(i,j,lm-k+2) + (cldz(i,j)-zmid(i,j,lm-k+2)) &
2196 *(pmid(i,j,lm-k+1)-pmid(i,j,lm-k+2) ) &
2197 /(zmid(i,j,lm-k+1)-zmid(i,j,lm-k+2) )
2203 if (
allocated(full_ceil))
deallocate(full_ceil)
2204 if (
allocated(full_fis))
deallocate(full_fis)
2207 IF (iget(711)>0)
THEN
2211 grid1(i,j) = cldz(i,j)
2214 if(grib==
"grib2" )
then
2216 fld_info(cfld)%ifld=iavblfld(iget(711))
2217 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2222 IF (iget(798)>0)
THEN
2226 grid1(i,j) = cldp(i,j)
2229 if(grib==
"grib2" )
then
2231 fld_info(cfld)%ifld=iavblfld(iget(798))
2232 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2240 IF (iget(260)>0)
THEN
2241 CALL calceiling(cldz,tcld,ceiling)
2244 grid1(i,j) = ceiling(i,j)
2247 if(grib==
"grib2" )
then
2249 fld_info(cfld)%ifld=iavblfld(iget(260))
2250 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2254 IF (iget(261) > 0)
THEN
2255 CALL calfltcnd(ceiling,grid1(1,jsta))
2261 if(grib==
"grib2" )
then
2263 fld_info(cfld)%ifld=iavblfld(iget(261))
2268 datapd(i,j,cfld) = grid1(i,jj)
2276 IF (iget(188) > 0)
THEN
2277 IF(modelname ==
'GFS')
THEN
2281 grid1(i,j) = pbot(i,j)
2288 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2289 grid1(i,j) = pmid(i,j,ibot)
2291 grid1(i,j) = -50000.
2296 if(grib==
"grib2" )
then
2298 fld_info(cfld)%ifld=iavblfld(iget(188))
2303 datapd(i,j,cfld) = grid1(i,jj)
2311 IF (iget(192) > 0)
THEN
2315 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2316 grid1(i,j) = pmid(i,j,ibot)
2318 grid1(i,j) = -50000.
2322 if(grib==
"grib2" )
then
2324 fld_info(cfld)%ifld=iavblfld(iget(192))
2325 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2330 IF (iget(190) > 0)
THEN
2334 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2335 grid1(i,j) = pmid(i,j,ibot)
2337 grid1(i,j) = -50000.
2341 if(grib==
"grib2" )
then
2343 fld_info(cfld)%ifld=iavblfld(iget(190))
2344 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2349 IF (iget(194) > 0)
THEN
2353 IF (ibot>0 .AND. ibot<=nint(lmh(i,j)))
THEN
2354 grid1(i,j) = pmid(i,j,ibot)
2356 grid1(i,j) = -50000.
2360 if(grib==
"grib2" )
then
2362 fld_info(cfld)%ifld=iavblfld(iget(194))
2363 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2369 IF (iget(303) > 0)
THEN
2373 grid1(i,j) = pbotl(i,j)
2380 itclod = nint(tclod)
2381 IF(itclod /= 0)
then
2382 ifincr = mod(ifhr,itclod)
2383 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2388 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2391 id(18) = ifhr-itclod
2393 id(18) = ifhr-ifincr
2394 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2396 IF (id(18)<0) id(18) = 0
2397 if(grib==
"grib2" )
then
2399 fld_info(cfld)%ifld=iavblfld(iget(303))
2401 fld_info(cfld)%ntrange=0
2403 fld_info(cfld)%ntrange=1
2405 fld_info(cfld)%tinvstat=ifhr-id(18)
2407 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2412 IF (iget(306) > 0)
THEN
2415 IF(pbotm(i,j) > small)
THEN
2416 grid1(i,j) = pbotm(i,j)
2423 itclod = nint(tclod)
2424 IF(itclod /= 0)
then
2425 ifincr = mod(ifhr,itclod)
2426 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2431 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2434 id(18) = ifhr-itclod
2436 id(18) = ifhr-ifincr
2437 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2439 IF (id(18)<0) id(18) = 0
2440 if(grib==
"grib2" )
then
2442 fld_info(cfld)%ifld=iavblfld(iget(306))
2444 fld_info(cfld)%ntrange=0
2446 fld_info(cfld)%ntrange=1
2448 fld_info(cfld)%tinvstat=ifhr-id(18)
2450 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2455 IF (iget(309) > 0)
THEN
2458 IF(pboth(i,j) > small)
THEN
2459 grid1(i,j) = pboth(i,j)
2466 itclod = nint(tclod)
2467 IF(itclod /= 0)
then
2468 ifincr = mod(ifhr,itclod)
2469 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2474 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2477 id(18) = ifhr-itclod
2479 id(18) = ifhr-ifincr
2480 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2482 IF (id(18)<0) id(18) = 0
2483 if(grib==
"grib2" )
then
2485 fld_info(cfld)%ifld=iavblfld(iget(309))
2487 fld_info(cfld)%ntrange=0
2489 fld_info(cfld)%ntrange=1
2491 fld_info(cfld)%tinvstat=ifhr-id(18)
2493 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2503 IF ((iget(149)>0) .OR. (iget(179)>0) .OR. &
2504 (iget(168)>0) .OR. (iget(275)>0))
THEN
2508 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2509 IF(t(i,j,itop)<spval .AND. &
2510 pmid(i,j,itop)<spval .AND. &
2511 zmid(i,j,itop)<spval)
THEN
2512 cldp(i,j) = pmid(i,j,itop)
2513 cldz(i,j) = zmid(i,j,itop)
2514 cldt(i,j) = t(i,j,itop)
2516 IF(modelname ==
'RAPR')
then
2526 IF(modelname ==
'RAPR')
then
2540 IF (iget(149)>0)
THEN
2543 grid1(i,j) = cldp(i,j)
2546 if(grib==
"grib2" )
then
2548 fld_info(cfld)%ifld=iavblfld(iget(149))
2549 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2554 IF (iget(179)>0)
THEN
2557 grid1(i,j) = cldz(i,j)
2560 if(grib==
"grib2" )
then
2562 fld_info(cfld)%ifld=iavblfld(iget(179))
2563 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2569 IF ((iget(409)>0) .OR. (iget(406)>0))
THEN
2571 cloud_def_p = 0.0000001
2578 IF(modelname ==
'RAPR') zcldtop = spval
2581 watericetotal(k) = qqw(i,j,ll) + qqi(i,j,ll)
2584 if (watericetotal(lm)<=cloud_def_p)
then
2585 loop373 :
do k=lm-1,2,-1
2586 if (watericetotal(k)>cloud_def_p)
then
2587 zcldtop = zmid(i,j,lm-k+1) + (cloud_def_p-watericetotal(k)) &
2588 * (zmid(i,j,lm-k)-zmid(i,j,lm-k+1)) &
2589 / (watericetotal(k+1) - watericetotal(k))
2594 zcldtop = zmid(i,j,1)
2598 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2599 cldp(i,j) = pmid(i,j,itop)
2600 cldt(i,j) = t(i,j,itop)
2603 IF(modelname ==
'RAPR') cldp(i,j) = spval
2612 if(zcldtop <-100.)
then
2615 zcldtop=zmid(i,j,itop)
2616 else if(zmid(i,j,itop)>zcldtop)
then
2620 zcldtop=zmid(i,j,itop)
2625 if(cldz(i,j)>-100. .and. zcldtop<-100.)
then
2626 zcldtop = cldz(i,j) + 200.
2636 IF (iget(406)>0)
THEN
2639 grid1(i,j) = cldp(i,j)
2642 if(grib==
"grib2" )
then
2644 fld_info(cfld)%ifld=iavblfld(iget(406))
2645 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2650 IF (iget(409)>0)
THEN
2653 grid1(i,j) = cldz(i,j)
2656 if(grib==
"grib2" )
then
2658 fld_info(cfld)%ifld=iavblfld(iget(409))
2659 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2666 IF (iget(168)>0)
THEN
2669 grid1(i,j) = cldt(i,j)
2672 if(grib==
"grib2" )
then
2674 fld_info(cfld)%ifld=iavblfld(iget(168))
2675 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2680 IF (iget(275)>0)
THEN
2693 if((hbot(i,j)-spval)>small .and. (htop(i,j)-spval)>small)
then
2694 lcbot=nint(hbot(i,j))
2695 lctop=nint(htop(i,j))
2696 if (lcbot-lctop > 1)
then
2697 q_conv=cnvcfr(i,j)*qconv
2699 if (t(i,j,k) < trad_ice)
then
2700 cu_ir(k)=abscoefi*q_conv
2702 cu_ir(k)=abscoef*q_conv
2712 if(pint(i,j,k)<spval.and.qqw(i,j,k)<spval.and. &
2713 qqi(i,j,k)<spval.and.qqs(i,j,k)<spval)
then
2714 dp=pint(i,j,k+1)-pint(i,j,k)
2715 opdepth=opdepth+( cu_ir(k) + abscoef*qqw(i,j,k)+ &
2717 & abscoefi*( qqi(i,j,k)+qqs(i,j,k) ) )*dp
2719 if (opdepth > 1.)
exit
2721 if (opdepth > 1.) num_thick=num_thick+1
2773 if(grib==
"grib2" )
then
2775 fld_info(cfld)%ifld=iavblfld(iget(275))
2776 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2783 IF (iget(189) > 0)
THEN
2784 IF(modelname ==
'GFS')
THEN
2788 grid1(i,j) = ptop(i,j)
2795 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2796 grid1(i,j) = pmid(i,j,itop)
2798 grid1(i,j) = -50000.
2803 if(grib==
"grib2" )
then
2805 fld_info(cfld)%ifld=iavblfld(iget(189))
2810 datapd(i,j,cfld) = grid1(i,jj)
2818 IF (iget(193) > 0)
THEN
2822 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2823 grid1(i,j) = pmid(i,j,itop)
2825 grid1(i,j) = -50000.
2829 if(grib==
"grib2" )
then
2831 fld_info(cfld)%ifld=iavblfld(iget(193))
2832 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2837 IF (iget(191) > 0)
THEN
2841 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2842 grid1(i,j) = pmid(i,j,itop)
2844 grid1(i,j) = -50000.
2848 if(grib==
"grib2" )
then
2850 fld_info(cfld)%ifld=iavblfld(iget(191))
2851 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2857 IF (iget(195) > 0)
THEN
2861 IF (itop>0 .AND. itop<=nint(lmh(i,j)))
THEN
2862 grid1(i,j) = pmid(i,j,itop)
2864 grid1(i,j) = -50000.
2868 if(grib==
"grib2" )
then
2870 fld_info(cfld)%ifld=iavblfld(iget(195))
2871 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2877 IF (iget(304) > 0)
THEN
2880 IF(ptopl(i,j) > small)
THEN
2881 grid1(i,j) = ptopl(i,j)
2888 itclod = nint(tclod)
2889 IF(itclod /= 0)
then
2890 ifincr = mod(ifhr,itclod)
2891 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2896 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2899 id(18) = ifhr-itclod
2901 id(18) = ifhr-ifincr
2902 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2904 IF (id(18)<0) id(18) = 0
2905 if(grib==
"grib2" )
then
2907 fld_info(cfld)%ifld=iavblfld(iget(304))
2909 fld_info(cfld)%ntrange=0
2911 fld_info(cfld)%ntrange=1
2913 fld_info(cfld)%tinvstat=ifhr-id(18)
2915 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2920 IF (iget(307) > 0)
THEN
2923 grid1(i,j) = ptopm(i,j)
2927 itclod = nint(tclod)
2928 IF(itclod /= 0)
then
2929 ifincr = mod(ifhr,itclod)
2930 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2935 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2938 id(18) = ifhr-itclod
2940 id(18) = ifhr-ifincr
2941 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2943 IF (id(18)<0) id(18) = 0
2944 if(grib==
"grib2" )
then
2946 fld_info(cfld)%ifld=iavblfld(iget(307))
2948 fld_info(cfld)%ntrange=0
2950 fld_info(cfld)%ntrange=1
2952 fld_info(cfld)%tinvstat=ifhr-id(18)
2954 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2959 IF (iget(310) > 0)
THEN
2962 grid1(i,j) = ptoph(i,j)
2966 itclod = nint(tclod)
2967 IF(itclod /= 0)
then
2968 ifincr = mod(ifhr,itclod)
2969 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
2974 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2977 id(18) = ifhr-itclod
2979 id(18) = ifhr-ifincr
2980 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2982 IF (id(18)<0) id(18) = 0
2983 if(grib==
"grib2" )
then
2985 fld_info(cfld)%ifld=iavblfld(iget(310))
2987 fld_info(cfld)%ntrange=0
2989 fld_info(cfld)%ntrange=1
2991 fld_info(cfld)%tinvstat=ifhr-id(18)
2993 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
2999 IF (iget(305) > 0)
THEN
3002 grid1(i,j) = ttopl(i,j)
3006 itclod = nint(tclod)
3007 IF(itclod /= 0)
then
3008 ifincr = mod(ifhr,itclod)
3009 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3014 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3017 id(18) = ifhr-itclod
3019 id(18) = ifhr-ifincr
3020 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3022 IF (id(18)<0) id(18) = 0
3023 if(grib==
"grib2" )
then
3025 fld_info(cfld)%ifld=iavblfld(iget(305))
3027 fld_info(cfld)%ntrange=0
3029 fld_info(cfld)%ntrange=1
3031 fld_info(cfld)%tinvstat=ifhr-id(18)
3033 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3038 IF (iget(308) > 0)
THEN
3041 grid1(i,j) = ttopm(i,j)
3045 itclod = nint(tclod)
3046 IF(itclod /= 0)
then
3047 ifincr = mod(ifhr,itclod)
3048 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3053 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3056 id(18) = ifhr-itclod
3058 id(18) = ifhr-ifincr
3059 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3061 IF (id(18)<0) id(18) = 0
3062 if(grib==
"grib2" )
then
3064 fld_info(cfld)%ifld=iavblfld(iget(308))
3066 fld_info(cfld)%ntrange=0
3068 fld_info(cfld)%ntrange=1
3070 fld_info(cfld)%tinvstat=ifhr-id(18)
3072 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3077 IF (iget(311) > 0)
THEN
3080 grid1(i,j) = ttoph(i,j)
3084 itclod = nint(tclod)
3085 IF(itclod /= 0)
then
3086 ifincr = mod(ifhr,itclod)
3087 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3092 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3095 id(18) = ifhr-itclod
3097 id(18) = ifhr-ifincr
3098 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3100 IF (id(18)<0) id(18) = 0
3101 if(grib==
"grib2" )
then
3103 fld_info(cfld)%ifld=iavblfld(iget(311))
3105 fld_info(cfld)%ntrange=0
3107 fld_info(cfld)%ntrange=1
3109 fld_info(cfld)%tinvstat=ifhr-id(18)
3110 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3116 IF (iget(196) > 0.or.iget(570)>0)
THEN
3120 if(cnvcfr(i,j)/=spval)grid1(i,j)=100.*cnvcfr(i,j)
3123 if(iget(196)>0)
then
3124 if(grib==
"grib2" )
then
3126 fld_info(cfld)%ifld=iavblfld(iget(196))
3127 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3129 elseif(iget(570)>0)
then
3130 if(grib==
"grib2" )
then
3132 fld_info(cfld)%ifld=iavblfld(iget(570))
3133 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3140 IF (iget(342) > 0)
THEN
3144 if(pblcfr(i,j)/=spval)grid1(i,j)=100.*pblcfr(i,j)
3148 itclod = nint(tclod)
3149 IF(itclod /= 0)
then
3150 ifincr = mod(ifhr,itclod)
3151 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3156 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3159 id(18) = ifhr-itclod
3161 id(18) = ifhr-ifincr
3162 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3164 IF (id(18)<0) id(18) = 0
3165 if(grib==
"grib2" )
then
3167 fld_info(cfld)%ifld=iavblfld(iget(342))
3169 fld_info(cfld)%ntrange=0
3171 fld_info(cfld)%ntrange=1
3173 fld_info(cfld)%tinvstat=ifhr-id(18)
3175 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3181 IF (iget(313) > 0)
THEN
3184 grid1(i,j)=cldwork(i,j)
3188 itclod = nint(tclod)
3189 IF(itclod /= 0)
then
3190 ifincr = mod(ifhr,itclod)
3191 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itclod*60)
3196 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3199 id(18) = ifhr-itclod
3201 id(18) = ifhr-ifincr
3202 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3204 IF (id(18)<0) id(18) = 0
3205 if(grib==
"grib2" )
then
3207 fld_info(cfld)%ifld=iavblfld(iget(313))
3209 fld_info(cfld)%ntrange=0
3211 fld_info(cfld)%ntrange=1
3213 fld_info(cfld)%tinvstat=ifhr-id(18)
3215 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3223 IF (iget(126)>0)
THEN
3224 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3236 IF(aswin(i,j)/=spval)
THEN
3237 grid1(i,j) = aswin(i,j)*rrnum
3239 grid1(i,j)=aswin(i,j)
3244 itrdsw = nint(trdsw)
3245 IF(itrdsw /= 0)
then
3246 ifincr = mod(ifhr,itrdsw)
3247 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3252 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3255 id(18) = ifhr-itrdsw
3257 id(18) = ifhr-ifincr
3258 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3260 IF (id(18)<0) id(18) = 0
3262 if(grib==
"grib2" )
then
3264 fld_info(cfld)%ifld=iavblfld(iget(126))
3266 fld_info(cfld)%ntrange=1
3268 fld_info(cfld)%ntrange=0
3270 fld_info(cfld)%tinvstat=ifhr-id(18)
3271 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3276 IF (iget(298)>0)
THEN
3277 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3289 IF(auvbin(i,j)/=spval)
THEN
3290 grid1(i,j) = auvbin(i,j)*rrnum
3292 grid1(i,j) = auvbin(i,j)
3298 itrdsw = nint(trdsw)
3299 IF(itrdsw /= 0)
then
3300 ifincr = mod(ifhr,itrdsw)
3301 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3306 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3309 id(18) = ifhr-itrdsw
3311 id(18) = ifhr-ifincr
3312 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3314 IF (id(18)<0) id(18) = 0
3316 if(grib==
"grib2" )
then
3318 fld_info(cfld)%ifld=iavblfld(iget(298))
3320 fld_info(cfld)%ntrange=1
3322 fld_info(cfld)%ntrange=0
3324 fld_info(cfld)%tinvstat=ifhr-id(18)
3325 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3330 IF (iget(297)>0)
THEN
3331 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3343 IF(auvbinc(i,j)/=spval)
THEN
3344 grid1(i,j) = auvbinc(i,j)*rrnum
3346 grid1(i,j) = auvbinc(i,j)
3352 itrdsw = nint(trdsw)
3353 IF(itrdsw /= 0)
then
3354 ifincr = mod(ifhr,itrdsw)
3355 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3360 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3363 id(18) = ifhr-itrdsw
3365 id(18) = ifhr-ifincr
3366 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3368 IF (id(18)<0) id(18) = 0
3370 if(grib==
"grib2" )
then
3372 fld_info(cfld)%ifld=iavblfld(iget(297))
3374 fld_info(cfld)%ntrange=1
3376 fld_info(cfld)%ntrange=0
3378 fld_info(cfld)%tinvstat=ifhr-id(18)
3379 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3384 IF (iget(127)>0)
THEN
3385 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3396 IF(alwin(i,j)/=spval)
THEN
3397 grid1(i,j) = alwin(i,j)*rrnum
3399 grid1(i,j)=alwin(i,j)
3404 itrdlw = nint(trdlw)
3405 IF(itrdlw /= 0)
then
3406 ifincr = mod(ifhr,itrdlw)
3407 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
3412 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3415 id(18) = ifhr-itrdlw
3417 id(18) = ifhr-ifincr
3418 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3420 IF (id(18)<0) id(18) = 0
3422 if(grib==
"grib2" )
then
3424 fld_info(cfld)%ifld=iavblfld(iget(127))
3426 fld_info(cfld)%ntrange=1
3428 fld_info(cfld)%ntrange=0
3430 fld_info(cfld)%tinvstat=ifhr-id(18)
3431 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3436 IF (iget(128)>0)
THEN
3437 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3448 IF(aswout(i,j)/=spval)
THEN
3449 grid1(i,j) = -1.0*aswout(i,j)*rrnum
3451 grid1(i,j)=aswout(i,j)
3456 itrdsw = nint(trdsw)
3457 IF(itrdsw /= 0)
then
3458 ifincr = mod(ifhr,itrdsw)
3459 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3464 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3467 id(18) = ifhr-itrdsw
3469 id(18) = ifhr-ifincr
3470 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3472 IF (id(18)<0) id(18) = 0
3474 if(grib==
"grib2" )
then
3476 fld_info(cfld)%ifld=iavblfld(iget(128))
3478 fld_info(cfld)%ntrange=1
3480 fld_info(cfld)%ntrange=0
3482 fld_info(cfld)%tinvstat=ifhr-id(18)
3483 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3488 IF (iget(129)>0)
THEN
3489 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3500 IF(alwout(i,j)/=spval)
THEN
3501 grid1(i,j) = -1.0*alwout(i,j)*rrnum
3503 grid1(i,j)=alwout(i,j)
3508 itrdlw = nint(trdlw)
3509 IF(itrdlw /= 0)
then
3510 ifincr = mod(ifhr,itrdlw)
3511 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
3516 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3519 id(18) = ifhr-itrdlw
3521 id(18) = ifhr-ifincr
3522 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3524 IF (id(18)<0) id(18) = 0
3526 if(grib==
"grib2" )
then
3528 fld_info(cfld)%ifld=iavblfld(iget(129))
3530 fld_info(cfld)%ntrange=1
3532 fld_info(cfld)%ntrange=0
3534 fld_info(cfld)%tinvstat=ifhr-id(18)
3535 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3540 IF (iget(130)>0)
THEN
3541 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3552 IF(aswtoa(i,j)/=spval)
THEN
3553 grid1(i,j) = aswtoa(i,j)*rrnum
3555 grid1(i,j)=aswtoa(i,j)
3560 itrdsw = nint(trdsw)
3561 IF(itrdsw /= 0)
then
3562 ifincr = mod(ifhr,itrdsw)
3563 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3568 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3571 id(18) = ifhr-itrdsw
3573 id(18) = ifhr-ifincr
3574 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3576 IF (id(18)<0) id(18) = 0
3578 if(grib==
"grib2" )
then
3580 fld_info(cfld)%ifld=iavblfld(iget(130))
3582 fld_info(cfld)%ntrange=1
3584 fld_info(cfld)%ntrange=0
3586 fld_info(cfld)%tinvstat=ifhr-id(18)
3587 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3592 IF (iget(131)>0)
THEN
3593 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3604 IF(alwtoa(i,j)/=spval)
THEN
3605 grid1(i,j) = alwtoa(i,j)*rrnum
3607 grid1(i,j)=alwtoa(i,j)
3612 itrdlw = nint(trdlw)
3613 IF(itrdlw /= 0)
then
3614 ifincr = mod(ifhr,itrdlw)
3615 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
3620 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3623 id(18) = ifhr-itrdlw
3625 id(18) = ifhr-ifincr
3626 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3628 IF (id(18)<0) id(18) = 0
3630 if(grib==
"grib2" )
then
3632 fld_info(cfld)%ifld=iavblfld(iget(131))
3634 fld_info(cfld)%ntrange=1
3636 fld_info(cfld)%ntrange=0
3638 fld_info(cfld)%tinvstat=ifhr-id(18)
3639 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3644 IF (iget(274)>0)
THEN
3645 IF(modelname ==
'NCAR'.OR.modelname==
'RSM')
THEN
3650 grid1(i,j) = rlwtoa(i,j)
3654 if(grib==
"grib2" )
then
3656 fld_info(cfld)%ifld=iavblfld(iget(274))
3657 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3662 IF (iget(265)>0)
THEN
3664 IF(modelname ==
'NCAR'.OR.modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3669 IF(rlwtoa(i,j) < spval) &
3670 & grid1(i,j) = (rlwtoa(i,j)*stbol)**0.25
3674 if(grib==
"grib2" )
then
3676 fld_info(cfld)%ifld=iavblfld(iget(265))
3677 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3682 IF (iget(156)>0)
THEN
3686 IF(rswin(i,j)<spval)
THEN
3687 IF(czmean(i,j)>1.e-6)
THEN
3688 factrs=czen(i,j)/czmean(i,j)
3692 IF(rswin(i,j)<spval) grid1(i,j)=rswin(i,j)*factrs
3697 if(grib==
"grib2" )
then
3699 fld_info(cfld)%ifld=iavblfld(iget(156))
3700 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3705 IF (iget(157)>0)
THEN
3710 IF(modelname==
'RSM' .OR. modelname ==
'RAPR')
THEN
3711 grid1(i,j)=rlwin(i,j)
3713 IF(sigt4(i,j)<spval.and.t(i,j,nint(lmh(i,j)))<spval)
THEN
3714 IF(sigt4(i,j)>0.0)
THEN
3717 factrl=5.67e-8*tlmh*tlmh*tlmh*tlmh/sigt4(i,j)
3721 IF(rlwin(i,j) < spval) grid1(i,j)=rlwin(i,j)*factrl
3727 if(grib==
"grib2" )
then
3729 fld_info(cfld)%ifld=iavblfld(iget(157))
3730 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3735 IF (iget(141)>0)
THEN
3740 IF(rswout(i,j)<spval)
THEN
3741 IF(czmean(i,j)>1.e-6)
THEN
3742 factrs=czen(i,j)/czmean(i,j)
3746 IF(rswout(i,j)<spval) grid1(i,j)=rswout(i,j)*factrs
3751 if(grib==
"grib2" )
then
3753 fld_info(cfld)%ifld=iavblfld(iget(141))
3754 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3759 IF (iget(743)>0)
THEN
3762 grid1(i,j) = swupbc(i,j)
3765 if(grib==
'grib2')
then
3767 fld_info(cfld)%ifld=iavblfld(iget(743))
3768 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3773 IF (iget(142)>0)
THEN
3777 grid1(i,j) = radot(i,j)
3780 if(grib==
"grib2" )
then
3782 fld_info(cfld)%ifld=iavblfld(iget(142))
3783 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3788 IF (iget(744)>0)
THEN
3791 grid1(i,j) = lwdnbc(i,j)
3794 if(grib==
'grib2')
then
3796 fld_info(cfld)%ifld=iavblfld(iget(744))
3797 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3802 IF (iget(745)>0)
THEN
3805 grid1(i,j) = lwupbc(i,j)
3808 if(grib==
'grib2')
then
3810 fld_info(cfld)%ifld=iavblfld(iget(745))
3811 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3816 IF (iget(740)>0)
THEN
3820 grid1(i,j) = mean_frp(i,j)
3823 if(grib==
'grib2')
then
3826 fld_info(cfld)%ifld=iavblfld(iget(740))
3827 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3832 IF (iget(262)>0)
THEN
3837 IF(rswinc(i,j)<spval)
THEN
3838 IF(czmean(i,j)>1.e-6)
THEN
3839 factrs=czen(i,j)/czmean(i,j)
3843 IF(rswinc(i,j)<spval) grid1(i,j) = rswinc(i,j)*factrs
3847 if(grib==
"grib2" )
then
3849 fld_info(cfld)%ifld=iavblfld(iget(262))
3850 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3855 IF (iget(742)>0)
THEN
3858 grid1(i,j) = swdnbc(i,j)
3861 if(grib==
'grib2')
then
3863 fld_info(cfld)%ifld=iavblfld(iget(742))
3864 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3869 IF (iget(772)>0)
THEN
3873 grid1(i,j) = swddni(i,j)
3876 if(grib==
'grib2')
then
3878 fld_info(cfld)%ifld=iavblfld(iget(772))
3879 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3884 IF (iget(796)>0)
THEN
3887 grid1(i,j) = swddnic(i,j)
3890 if(grib==
'grib2')
then
3892 fld_info(cfld)%ifld=iavblfld(iget(796))
3893 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3898 IF (iget(773)>0)
THEN
3902 grid1(i,j) = swddif(i,j)
3905 if(grib==
'grib2')
then
3907 fld_info(cfld)%ifld=iavblfld(iget(773))
3908 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3913 IF (iget(797)>0)
THEN
3916 grid1(i,j) = swddifc(i,j)
3919 if(grib==
'grib2')
then
3921 fld_info(cfld)%ifld=iavblfld(iget(797))
3922 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3927 IF (iget(383)>0)
THEN
3930 grid1(i,j) = aswinc(i,j)
3934 itrdsw = nint(trdsw)
3935 IF(itrdsw /= 0)
then
3936 ifincr = mod(ifhr,itrdsw)
3937 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3942 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3945 id(18) = ifhr-itrdsw
3947 id(18) = ifhr-ifincr
3948 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3950 IF (id(18)<0) id(18) = 0
3951 if(grib==
"grib2" )
then
3953 fld_info(cfld)%ifld=iavblfld(iget(383))
3955 fld_info(cfld)%ntrange=1
3957 fld_info(cfld)%ntrange=0
3959 fld_info(cfld)%tinvstat=ifhr-id(18)
3960 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3965 IF (iget(386)>0)
THEN
3968 grid1(i,j) = aswoutc(i,j)
3972 itrdsw = nint(trdsw)
3973 IF(itrdsw /= 0)
then
3974 ifincr = mod(ifhr,itrdsw)
3975 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
3980 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3983 id(18) = ifhr-itrdsw
3985 id(18) = ifhr-ifincr
3986 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3988 IF (id(18)<0) id(18) = 0
3989 if(grib==
"grib2" )
then
3991 fld_info(cfld)%ifld=iavblfld(iget(386))
3993 fld_info(cfld)%ntrange=1
3995 fld_info(cfld)%ntrange=0
3997 fld_info(cfld)%tinvstat=ifhr-id(18)
3998 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4003 IF (iget(719)>0)
THEN
4006 grid1(i,j) = swupt(i,j)
4009 if(grib==
'grib2')
then
4011 fld_info(cfld)%ifld=iavblfld(iget(719))
4012 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4017 IF (iget(387)>0)
THEN
4020 grid1(i,j) = aswtoac(i,j)
4024 itrdsw = nint(trdsw)
4025 IF(itrdsw /= 0)
then
4026 ifincr = mod(ifhr,itrdsw)
4027 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4032 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4035 id(18) = ifhr-itrdsw
4037 id(18) = ifhr-ifincr
4038 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4040 IF (id(18)<0) id(18) = 0
4041 if(grib==
"grib2" )
then
4043 fld_info(cfld)%ifld=iavblfld(iget(387))
4045 fld_info(cfld)%ntrange=1
4047 fld_info(cfld)%ntrange=0
4049 fld_info(cfld)%tinvstat=ifhr-id(18)
4050 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4055 IF (iget(388)>0)
THEN
4058 grid1(i,j) = aswintoa(i,j)
4062 itrdsw = nint(trdsw)
4063 IF(itrdsw /= 0)
then
4064 ifincr = mod(ifhr,itrdsw)
4065 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4070 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4073 id(18) = ifhr-itrdsw
4075 id(18) = ifhr-ifincr
4076 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4078 IF (id(18)<0) id(18) = 0
4079 if(grib==
"grib2" )
then
4081 fld_info(cfld)%ifld=iavblfld(iget(388))
4083 fld_info(cfld)%ntrange=1
4085 fld_info(cfld)%ntrange=0
4087 fld_info(cfld)%tinvstat=ifhr-id(18)
4088 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4093 IF (iget(382)>0)
THEN
4096 grid1(i,j) = alwinc(i,j)
4100 itrdlw = nint(trdlw)
4101 IF(itrdlw /= 0)
then
4102 ifincr = mod(ifhr,itrdlw)
4103 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
4108 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4111 id(18) = ifhr-itrdlw
4113 id(18) = ifhr-ifincr
4114 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4116 IF (id(18)<0) id(18) = 0
4117 if(grib==
"grib2" )
then
4119 fld_info(cfld)%ifld=iavblfld(iget(382))
4121 fld_info(cfld)%ntrange=1
4123 fld_info(cfld)%ntrange=0
4125 fld_info(cfld)%tinvstat=ifhr-id(18)
4126 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4131 IF (iget(384)>0)
THEN
4134 grid1(i,j) = alwoutc(i,j)
4138 itrdlw = nint(trdlw)
4139 IF(itrdlw /= 0)
then
4140 ifincr = mod(ifhr,itrdlw)
4141 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
4146 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4149 id(18) = ifhr-itrdlw
4151 id(18) = ifhr-ifincr
4152 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4154 IF (id(18)<0) id(18) = 0
4155 if(grib==
"grib2" )
then
4157 fld_info(cfld)%ifld=iavblfld(iget(384))
4159 fld_info(cfld)%ntrange=1
4161 fld_info(cfld)%ntrange=0
4163 fld_info(cfld)%tinvstat=ifhr-id(18)
4164 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4169 IF (iget(385)>0)
THEN
4172 grid1(i,j) = alwtoac(i,j)
4176 itrdlw = nint(trdlw)
4177 IF(itrdlw /= 0)
then
4178 ifincr = mod(ifhr,itrdlw)
4179 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdlw*60)
4184 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4187 id(18) = ifhr-itrdlw
4189 id(18) = ifhr-ifincr
4190 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4192 IF (id(18)<0) id(18) = 0
4193 if(grib==
"grib2" )
then
4195 fld_info(cfld)%ifld=iavblfld(iget(385))
4197 fld_info(cfld)%ntrange=1
4199 fld_info(cfld)%ntrange=0
4201 fld_info(cfld)%tinvstat=ifhr-id(18)
4202 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4207 IF (iget(401)>0)
THEN
4210 grid1(i,j) = avisbeamswin(i,j)
4214 itrdsw = nint(trdsw)
4215 IF(itrdsw /= 0)
then
4216 ifincr = mod(ifhr,itrdsw)
4217 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4222 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4225 id(18) = ifhr-itrdsw
4227 id(18) = ifhr-ifincr
4228 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4230 IF (id(18)<0) id(18) = 0
4232 IF(itrdsw < 0)id(1:25)=0
4233 if(grib==
"grib2" )
then
4235 fld_info(cfld)%ifld=iavblfld(iget(401))
4237 fld_info(cfld)%ntrange=1
4239 fld_info(cfld)%ntrange=0
4241 fld_info(cfld)%tinvstat=ifhr-id(18)
4242 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4247 IF (iget(402)>0)
THEN
4250 grid1(i,j) = avisdiffswin(i,j)
4254 itrdsw = nint(trdsw)
4255 IF(itrdsw /= 0)
then
4256 ifincr = mod(ifhr,itrdsw)
4257 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4262 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4265 id(18) = ifhr-itrdsw
4267 id(18) = ifhr-ifincr
4268 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4270 IF (id(18)<0) id(18) = 0
4271 IF(itrdsw < 0)id(1:25)=0
4272 if(grib==
"grib2" )
then
4274 fld_info(cfld)%ifld=iavblfld(iget(402))
4276 fld_info(cfld)%ntrange=1
4278 fld_info(cfld)%ntrange=0
4280 fld_info(cfld)%tinvstat=ifhr-id(18)
4281 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4286 IF (iget(403)>0)
THEN
4289 grid1(i,j) = airbeamswin(i,j)
4293 itrdsw = nint(trdsw)
4294 IF(itrdsw /= 0)
then
4295 ifincr = mod(ifhr,itrdsw)
4296 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4301 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4304 id(18) = ifhr-itrdsw
4306 id(18) = ifhr-ifincr
4307 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4309 IF (id(18)<0) id(18) = 0
4310 IF(itrdsw < 0)id(1:25)=0
4311 if(grib==
"grib2" )
then
4313 fld_info(cfld)%ifld=iavblfld(iget(403))
4315 fld_info(cfld)%ntrange=1
4317 fld_info(cfld)%ntrange=0
4319 fld_info(cfld)%tinvstat=ifhr-id(18)
4320 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4325 IF (iget(404)>0)
THEN
4328 grid1(i,j) = airdiffswin(i,j)
4332 itrdsw = nint(trdsw)
4333 IF(itrdsw /= 0)
then
4334 ifincr = mod(ifhr,itrdsw)
4335 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itrdsw*60)
4340 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
4343 id(18) = ifhr-itrdsw
4345 id(18) = ifhr-ifincr
4346 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
4348 IF (id(18)<0) id(18) = 0
4349 IF(itrdsw < 0)id(1:25)=0
4350 if(grib==
"grib2" )
then
4352 fld_info(cfld)%ifld=iavblfld(iget(404))
4354 fld_info(cfld)%ntrange=1
4356 fld_info(cfld)%ntrange=0
4358 fld_info(cfld)%tinvstat=ifhr-id(18)
4359 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4365 IF (iget(609).GT.0)
THEN
4368 grid1(i,j)=aod550(i,j)
4371 if(grib==
"grib2" )
then
4373 fld_info(cfld)%ifld=iavblfld(iget(609))
4374 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4378 IF (iget(610).GT.0)
THEN
4381 grid1(i,j)=du_aod550(i,j)
4384 if(grib==
"grib2" )
then
4386 fld_info(cfld)%ifld=iavblfld(iget(610))
4387 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4391 IF (iget(611).GT.0)
THEN
4394 grid1(i,j)=ss_aod550(i,j)
4397 if(grib==
"grib2" )
then
4399 fld_info(cfld)%ifld=iavblfld(iget(611))
4400 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4404 IF (iget(612).GT.0)
THEN
4407 grid1(i,j)=su_aod550(i,j)
4410 if(grib==
"grib2" )
then
4412 fld_info(cfld)%ifld=iavblfld(iget(612))
4413 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4417 IF (iget(613).GT.0)
THEN
4420 grid1(i,j)=oc_aod550(i,j)
4423 if(grib==
"grib2" )
then
4425 fld_info(cfld)%ifld=iavblfld(iget(613))
4426 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4431 IF (iget(614).GT.0)
THEN
4434 grid1(i,j)=bc_aod550(i,j)
4437 if(grib==
"grib2" )
then
4439 fld_info(cfld)%ifld=iavblfld(iget(614))
4440 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4446 IF (iget(715)>0)
THEN
4449 grid1(i,j)=taod5502d(i,j)
4452 if(grib==
"grib2" )
then
4454 fld_info(cfld)%ifld=iavblfld(iget(715))
4455 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4460 IF (iget(716)>0)
THEN
4463 grid1(i,j)=aerasy2d(i,j)
4466 if(grib==
"grib2" )
then
4468 fld_info(cfld)%ifld=iavblfld(iget(716))
4469 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4474 IF (iget(717)>0)
THEN
4477 grid1(i,j)=aerssa2d(i,j)
4480 if(grib==
"grib2" )
then
4482 fld_info(cfld)%ifld=iavblfld(iget(717))
4483 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4503 IF ( iget(i)>0 ) laeropt = .true.
4506 IF ( iget(i)>0 ) laeropt = .true.
4509 IF ( iget(i)>0 ) laeropt = .true.
4515 IF ( iget(i)>0 ) laersmass = .true.
4523 print *,
'COMPUTE AEROSOL OPTICAL PROPERTIES'
4526 ALLOCATE ( extrhd_du(krhlev,nbin_du,nbdsw))
4527 ALLOCATE ( extrhd_ss(krhlev,nbin_ss,nbdsw))
4528 ALLOCATE ( extrhd_su(krhlev,nbin_su,nbdsw))
4529 ALLOCATE ( extrhd_bc(krhlev,nbin_bc,nbdsw))
4530 ALLOCATE ( extrhd_oc(krhlev,nbin_oc,nbdsw))
4532 ALLOCATE ( scarhd_du(krhlev,nbin_du,nbdsw))
4533 ALLOCATE ( scarhd_ss(krhlev,nbin_ss,nbdsw))
4534 ALLOCATE ( scarhd_su(krhlev,nbin_su,nbdsw))
4535 ALLOCATE ( scarhd_bc(krhlev,nbin_bc,nbdsw))
4536 ALLOCATE ( scarhd_oc(krhlev,nbin_oc,nbdsw))
4538 ALLOCATE ( asyrhd_du(krhlev,nbin_du,nbdsw))
4539 ALLOCATE ( asyrhd_ss(krhlev,nbin_ss,nbdsw))
4540 ALLOCATE ( asyrhd_su(krhlev,nbin_su,nbdsw))
4541 ALLOCATE ( asyrhd_bc(krhlev,nbin_bc,nbdsw))
4542 ALLOCATE ( asyrhd_oc(krhlev,nbin_oc,nbdsw))
4544 ALLOCATE ( ssarhd_du(krhlev,nbin_du,nbdsw))
4545 ALLOCATE ( ssarhd_ss(krhlev,nbin_ss,nbdsw))
4546 ALLOCATE ( ssarhd_su(krhlev,nbin_su,nbdsw))
4547 ALLOCATE ( ssarhd_bc(krhlev,nbin_bc,nbdsw))
4548 ALLOCATE ( ssarhd_oc(krhlev,nbin_oc,nbdsw))
4549 print *,
'aft AEROSOL allocate, nbin_du=',nbin_du, &
4550 'nbin_ss=',nbin_ss,
'nbin_su=',nbin_su,
'nbin_bc=', &
4551 'nbin_oc=',nbin_oc,
'nAero=',naero
4556 aerosol_file=
'optics_luts_'//aerosolname(i)//
'.dat'
4557 open(unit=noaer, file=aerosol_file, status=
'OLD', iostat=ios)
4559 print *,
' ERROR! Non-zero iostat for rd_LUTS ', aerosol_file
4562 if(debugprint)print *,
'i=',i,
'read aerosol_file=',trim(aerosol_file),
'ios=',ios
4564 IF (aerosolname(i) ==
'DUST') nbin = nbin_du
4565 IF (aerosolname(i) ==
'SALT') nbin = nbin_ss
4566 IF (aerosolname(i) ==
'SUSO') nbin = nbin_su
4567 IF (aerosolname(i) ==
'SOOT') nbin = nbin_bc
4568 IF (aerosolname(i) ==
'WASO') nbin = nbin_oc
4570 read(noaer,
'(2x,a4,1x,i1,1x,a3)')aername_rd,ib, aeropt
4571 IF (aername_rd /= aerosolname(i)) stop
4573 IF (aeropt /=
'ext' ) stop
4575 IF (aerosolname(i) ==
'DUST')
THEN
4577 read(noaer,
'(8f10.5)') (extrhd_du(ii,j,ib), ii=1,krhlev)
4579 read(noaer,
'(2x,a4)') aername_rd
4581 read(noaer,
'(8f10.5)') (scarhd_du(ii,j,ib), ii=1,krhlev)
4583 read(noaer,
'(2x,a4)') aername_rd
4585 read(noaer,
'(8f10.5)') (asyrhd_du(ii,j,ib), ii=1,krhlev)
4587 read(noaer,
'(2x,a4)') aername_rd
4589 read(noaer,
'(8f10.5)') (ssarhd_du(ii,j,ib), ii=1,krhlev)
4592 ELSEIF (aerosolname(i) ==
'SALT')
THEN
4594 read(noaer,
'(8f10.5)') (extrhd_ss(ii,j,ib), ii=1,krhlev)
4596 read(noaer,
'(2x,a4)') aername_rd
4598 read(noaer,
'(8f10.5)') (scarhd_ss(ii,j,ib), ii=1,krhlev)
4600 read(noaer,
'(2x,a4)') aername_rd
4602 read(noaer,
'(8f10.5)') (asyrhd_ss(ii,j,ib), ii=1,krhlev)
4604 read(noaer,
'(2x,a4)') aername_rd
4606 read(noaer,
'(8f10.5)') (ssarhd_ss(ii,j,ib), ii=1,krhlev)
4609 ELSEIF (aerosolname(i) ==
'SUSO')
THEN
4611 read(noaer,
'(8f10.5)') (extrhd_su(ii,j,ib), ii=1,krhlev)
4613 read(noaer,
'(2x,a4)') aername_rd
4615 read(noaer,
'(8f10.5)') (scarhd_su(ii,j,ib), ii=1,krhlev)
4617 read(noaer,
'(2x,a4)') aername_rd
4619 read(noaer,
'(8f10.5)') (asyrhd_su(ii,j,ib), ii=1,krhlev)
4621 read(noaer,
'(2x,a4)') aername_rd
4623 read(noaer,
'(8f10.5)') (ssarhd_su(ii,j,ib), ii=1,krhlev)
4626 ELSEIF (aerosolname(i) ==
'SOOT')
THEN
4628 read(noaer,
'(8f10.5)') (extrhd_bc(ii,j,ib), ii=1,krhlev)
4630 read(noaer,
'(2x,a4)') aername_rd
4632 read(noaer,
'(8f10.5)') (scarhd_bc(ii,j,ib), ii=1,krhlev)
4634 read(noaer,
'(2x,a4)') aername_rd
4636 read(noaer,
'(8f10.5)') (asyrhd_bc(ii,j,ib), ii=1,krhlev)
4638 read(noaer,
'(2x,a4)') aername_rd
4640 read(noaer,
'(8f10.5)') (ssarhd_bc(ii,j,ib), ii=1,krhlev)
4643 ELSEIF (aerosolname(i) ==
'WASO')
THEN
4645 read(noaer,
'(8f10.5)') (extrhd_oc(ii,j,ib), ii=1,krhlev)
4647 read(noaer,
'(2x,a4)') aername_rd
4649 read(noaer,
'(8f10.5)') (scarhd_oc(ii,j,ib), ii=1,krhlev)
4651 read(noaer,
'(2x,a4)') aername_rd
4653 read(noaer,
'(8f10.5)') (asyrhd_oc(ii,j,ib), ii=1,krhlev)
4655 read(noaer,
'(2x,a4)') aername_rd
4657 read(noaer,
'(8f10.5)') (ssarhd_oc(ii,j,ib), ii=1,krhlev)
4670 allocate (rdrh(im,jsta:jend,lm))
4671 allocate (ihh(im,jsta:jend,lm))
4677 p1d(i,j) = pmid(i,j,ll)
4678 t1d(i,j) = t(i,j,ll)
4679 q1d(i,j) = q(i,j,ll)
4682 CALL calrh(p1d,t1d,q1d,egrid4)
4689 IF ( rh3d > rhlev(krhlev) )
THEN
4694 ELSEIF ( rh3d < rhlev(1))
THEN
4701 DO WHILE ( rh3d > rhlev(ih2))
4703 IF ( ih2 > krhlev )
EXIT
4705 ih2 = min( krhlev, ih2 )
4706 ih1 = max( 1, ih2-1 )
4707 drh0 = rhlev(ih2) - rhlev(ih1)
4709 drh1 = rh3d - rhlev(ih1)
4710 rdrh(i,j,ll) = drh1 / drh0
4723 IF (ib == 1 ) indx = 623
4725 IF (ib == 2 ) indx = 624
4727 IF (ib == 3 ) indx = 609
4729 IF (ib == 4 ) indx = 625
4731 IF (ib == 5 ) indx = 626
4733 IF (ib == 6 ) indx = 627
4735 IF (ib == 7 ) indx = 628
4742 IF (iget(indx)>0 ) lext =.true.
4745 IF (iget(650)>0 ) lsca =.true.
4747 IF (iget(indx_ext(i))>0 ) lext = .true.
4748 IF (iget(indx_sca(i))>0 ) lsca = .true.
4753 IF (iget(648)>0 ) lsca =.true.
4754 IF (iget(649)>0 ) lasy =.true.
4757 IF (iget(656)>0 )
THEN
4758 IF ( ib == 2 ) lext = .true.
4759 IF ( ib == 5 ) lext = .true.
4763 IF ( lext .OR. lsca .OR. lasy )
THEN
4775 ext01 = extrhd_du(1,n,ib)
4776 sca01 = scarhd_du(1,n,ib)
4777 asy01 = asyrhd_du(1,n,ib)
4778 ext(i,j,l) = ext(i,j,l)+1e-9*dust(i,j,l,n) * ext01
4779 sca(i,j,l) = sca(i,j,l)+1e-9*dust(i,j,l,n) * sca01
4780 asy(i,j,l) = asy(i,j,l)+1e-9*dust(i,j,l,n) * sca01*asy01
4782 ext(i,j,l) = ext(i,j,l) * 1000.
4783 sca(i,j,l) = sca(i,j,l) * 1000.
4784 asy(i,j,l) = asy(i,j,l) * 1000.
4788 CALL calpw(aod_du,17)
4789 CALL calpw(sca_du,20)
4790 CALL calpw(asy_du,21)
4804 ext01 = extrhd_su(ih1,n,ib) &
4805 & + rdrh(i,j,l)*(extrhd_su(ih2,n,ib)-extrhd_su(ih1,n,ib))
4806 sca01 = scarhd_su(ih1,n,ib) &
4807 & + rdrh(i,j,l)*(scarhd_su(ih2,n,ib)-scarhd_su(ih1,n,ib))
4808 asy01 = asyrhd_su(ih1,n,ib) &
4809 & + rdrh(i,j,l)*(asyrhd_su(ih2,n,ib)-asyrhd_su(ih1,n,ib))
4810 ext(i,j,l) = ext(i,j,l)+1e-9*suso(i,j,l,n) * ext01
4811 sca(i,j,l) = sca(i,j,l)+1e-9*suso(i,j,l,n)*sca01
4812 asy(i,j,l) = asy(i,j,l)+1e-9*suso(i,j,l,n)*sca01*asy01
4815 ext(i,j,l) = ext(i,j,l) * 1000.
4816 sca(i,j,l) = sca(i,j,l) * 1000.
4817 asy(i,j,l) = asy(i,j,l) * 1000.
4821 CALL calpw(aod_su,17)
4822 CALL calpw(sca_su,20)
4823 CALL calpw(asy_su,21)
4838 ext01 = extrhd_ss(ih1,n,ib) &
4839 & + rdrh(i,j,l)*(extrhd_ss(ih2,n,ib)-extrhd_ss(ih1,n,ib))
4840 sca01 = scarhd_ss(ih1,n,ib) &
4841 & + rdrh(i,j,l)*(scarhd_ss(ih2,n,ib)-scarhd_ss(ih1,n,ib))
4842 asy01 = asyrhd_ss(ih1,n,ib) &
4843 & + rdrh(i,j,l)*(asyrhd_ss(ih2,n,ib)-asyrhd_ss(ih1,n,ib))
4844 ext(i,j,l) = ext(i,j,l)+1e-9*salt(i,j,l,n)*ext01
4845 sca(i,j,l) = sca(i,j,l)+1e-9*salt(i,j,l,n)*sca01
4846 asy(i,j,l) = asy(i,j,l)+1e-9*salt(i,j,l,n)*sca01*asy01
4848 ext(i,j,l) = ext(i,j,l) * 1000.
4849 sca(i,j,l) = sca(i,j,l) * 1000.
4850 asy(i,j,l) = asy(i,j,l) * 1000.
4854 CALL calpw(aod_ss,17)
4855 CALL calpw(sca_ss,20)
4856 CALL calpw(asy_ss,21)
4871 ext01 = extrhd_bc(ih1,n,ib) &
4872 & + rdrh(i,j,l)*(extrhd_bc(ih2,n,ib)-extrhd_bc(ih1,n,ib))
4873 sca01 = scarhd_bc(ih1,n,ib) &
4874 & + rdrh(i,j,l)*(scarhd_bc(ih2,n,ib)-scarhd_bc(ih1,n,ib))
4875 asy01 = asyrhd_bc(ih1,n,ib) &
4876 & + rdrh(i,j,l)*(asyrhd_bc(ih2,n,ib)-asyrhd_bc(ih1,n,ib))
4877 ext(i,j,l) = ext(i,j,l)+1e-9*soot(i,j,l,n)*ext01
4878 sca(i,j,l) = sca(i,j,l)+1e-9*soot(i,j,l,n)*sca01
4879 asy(i,j,l) = asy(i,j,l)+1e-9*soot(i,j,l,n)*sca01*asy01
4881 ext(i,j,l) = ext(i,j,l) * 1000.
4882 sca(i,j,l) = sca(i,j,l) * 1000.
4883 asy(i,j,l) = asy(i,j,l) * 1000.
4887 CALL calpw(aod_bc,17)
4888 CALL calpw(sca_bc,20)
4889 CALL calpw(asy_bc,21)
4903 ext01 = extrhd_oc(ih1,n,ib) &
4904 & + rdrh(i,j,l)*(extrhd_oc(ih2,n,ib)-extrhd_oc(ih1,n,ib))
4905 sca01 = scarhd_oc(ih1,n,ib) &
4906 & + rdrh(i,j,l)*(scarhd_oc(ih2,n,ib)-scarhd_oc(ih1,n,ib))
4907 asy01 = asyrhd_oc(ih1,n,ib) &
4908 & + rdrh(i,j,l)*(asyrhd_oc(ih2,n,ib)-asyrhd_oc(ih1,n,ib))
4909 ext(i,j,l) = ext(i,j,l)+1e-9*waso(i,j,l,n)*ext01
4910 sca(i,j,l) = sca(i,j,l)+1e-9*waso(i,j,l,n)*sca01
4911 asy(i,j,l) = asy(i,j,l)+1e-9*waso(i,j,l,n)*sca01*asy01
4913 ext(i,j,l) = ext(i,j,l) * 1000.
4914 sca(i,j,l) = sca(i,j,l) * 1000.
4915 asy(i,j,l) = asy(i,j,l) * 1000.
4919 CALL calpw(aod_oc,17)
4920 CALL calpw(sca_oc,20)
4921 CALL calpw(asy_oc,21)
4929 aod_du(i,j) = max(aod_du(i,j), 0.0)
4930 aod_bc(i,j) = max(aod_bc(i,j), 0.0)
4931 aod_oc(i,j) = max(aod_oc(i,j), 0.0)
4932 aod_su(i,j) = max(aod_su(i,j), 0.0)
4933 aod_ss(i,j) = max(aod_ss(i,j), 0.0)
4935 sca_du(i,j) = max(sca_du(i,j), 0.0)
4936 sca_bc(i,j) = max(sca_bc(i,j), 0.0)
4937 sca_oc(i,j) = max(sca_oc(i,j), 0.0)
4938 sca_su(i,j) = max(sca_su(i,j), 0.0)
4939 sca_ss(i,j) = max(sca_ss(i,j), 0.0)
4941 asy_du(i,j) = max(asy_du(i,j), 0.0)
4942 asy_bc(i,j) = max(asy_bc(i,j), 0.0)
4943 asy_oc(i,j) = max(asy_oc(i,j), 0.0)
4944 asy_su(i,j) = max(asy_su(i,j), 0.0)
4945 asy_ss(i,j) = max(asy_ss(i,j), 0.0)
4947 aod(i,j) = aod_du(i,j) + aod_bc(i,j) + aod_oc(i,j) + &
4948 & aod_su(i,j) + aod_ss(i,j)
4949 sca2d(i,j) = sca_du(i,j) + sca_bc(i,j) + sca_oc(i,j) + &
4950 & sca_su(i,j) + sca_ss(i,j)
4951 asy2d(i,j) = asy_du(i,j) + asy_bc(i,j) + asy_oc(i,j) + &
4952 & asy_su(i,j) + asy_ss(i,j)
4956 IF ( iget(656) > 0 )
THEN
4961 aod_440(i,j) = aod(i,j)
4970 aod_860(i,j) = aod(i,j)
4977 IF ( iget(indx) > 0)
THEN
4981 grid1(i,j) = aod(i,j)
4984 CALL bound(grid1,d00,h99999)
4985 if(grib==
"grib2" )
then
4987 fld_info(cfld)%ifld=iavblfld(iget(indx))
4988 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
4996 IF ( iget(649) > 0 )
THEN
5001 IF(sca2d(i,j)<spval.and.asy2d(i,j)<spval)
THEN
5002 IF ( sca2d(i,j) > 0.0 )
THEN
5003 asy2d(i,j) = asy2d(i,j) / sca2d(i,j)
5007 IF(asy2d(i,j)<spval) grid1(i,j)=asy2d(i,j)
5011 CALL bound(grid1,d00,h99999)
5012 if(grib==
"grib2" )
then
5014 fld_info(cfld)%ifld=iavblfld(iget(649))
5015 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5020 IF ( iget(648) > 0 )
THEN
5025 IF(aod(i,j)<spval.and.sca2d(i,j)<spval)
THEN
5026 IF ( aod(i,j) > 0.0 )
THEN
5027 sca2d(i,j) = sca2d(i,j) / aod(i,j)
5031 IF(sca2d(i,j)<spval) grid1(i,j)=sca2d(i,j)
5035 CALL bound(grid1,d00,h99999)
5036 if(grib==
"grib2" )
then
5038 fld_info(cfld)%ifld=iavblfld(iget(648))
5039 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5052 IF ( iget(650) > 0 )
THEN
5056 grid1(i,j)=sca2d(i,j)
5059 CALL bound(grid1,d00,h99999)
5060 if(grib==
"grib2" )
then
5062 fld_info(cfld)%ifld=iavblfld(iget(650))
5063 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5071 IF ( iget(jj) > 0)
THEN
5075 IF ( ii == 1 ) grid1(i,j) = aod_du(i,j)
5076 IF ( ii == 2 ) grid1(i,j) = aod_ss(i,j)
5077 IF ( ii == 3 ) grid1(i,j) = aod_su(i,j)
5078 IF ( ii == 4 ) grid1(i,j) = aod_oc(i,j)
5079 IF ( ii == 5 ) grid1(i,j) = aod_bc(i,j)
5082 CALL bound(grid1,d00,h99999)
5083 if(grib==
"grib2" )
then
5085 fld_info(cfld)%ifld=iavblfld(iget(jj))
5086 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5092 IF ( iget(jj) > 0)
THEN
5096 IF ( ii == 1 ) grid1(i,j) = sca_du(i,j)
5097 IF ( ii == 2 ) grid1(i,j) = sca_ss(i,j)
5098 IF ( ii == 3 ) grid1(i,j) = sca_su(i,j)
5099 IF ( ii == 4 ) grid1(i,j) = sca_oc(i,j)
5100 IF ( ii == 5 ) grid1(i,j) = sca_bc(i,j)
5103 CALL bound(grid1,d00,h99999)
5104 if(grib==
"grib2" )
then
5106 fld_info(cfld)%ifld=iavblfld(iget(jj))
5107 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5118 IF ( iget(656) > 0 )
THEN
5121 ang2 = log( 860. / 440. )
5125 IF (aod_860(i,j) > 0.)
THEN
5126 ang1 = log( aod_440(i,j)/aod_860(i,j) )
5127 angst(i,j) = ang1 / ang2
5129 grid1(i,j)=angst(i,j)
5132 if(debugprint)print *,
'output angstrom exp,angst=',maxval(angst(1:im,jsta:jend)), &
5133 minval(angst(1:im,jsta:jend))
5134 CALL bound(grid1,d00,h99999)
5135 if(grib==
"grib2" )
then
5137 fld_info(cfld)%ifld=iavblfld(iget(656))
5138 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5145 IF (iget(659)>0)
THEN
5150 IF(duem(i,j,1)<spval) grid1(i,j) = duem(i,j,1)*1.e-6
5152 IF(duem(i,j,k)<spval)&
5153 grid1(i,j) = grid1(i,j) + duem(i,j,k)*1.e-6
5157 if(grib==
'grib2')
then
5159 fld_info(cfld)%ifld=iavblfld(iget(659))
5160 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5165 IF (iget(667)>0)
THEN
5170 IF(bcem(i,j,1)<spval) grid1(i,j) = bcem(i,j,1)
5172 IF(bcem(i,j,k)<spval)&
5173 grid1(i,j) = grid1(i,j) + bcem(i,j,k)
5177 if(grib==
'grib2')
then
5179 fld_info(cfld)%ifld=iavblfld(iget(667))
5180 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5184 IF (iget(660)>0)
THEN
5189 IF(dusd(i,j,1)<spval) grid1(i,j) = dusd(i,j,1)*1.e-6
5191 IF(dusd(i,j,k)<spval)&
5192 grid1(i,j) = grid1(i,j)+ dusd(i,j,k)*1.e-6
5196 if(grib==
'grib2')
then
5198 fld_info(cfld)%ifld=iavblfld(iget(660))
5199 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5203 IF (iget(699)>0)
THEN
5208 grid1(i,j) = maod(i,j)
5211 if(grib==
'grib2')
then
5213 fld_info(cfld)%ifld=iavblfld(iget(699))
5214 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5240 IF (iget(686)>0 )
THEN
5245 grid1(i,j) = dustpm(i,j)
5248 if(grib==
'grib2')
then
5250 fld_info(cfld)%ifld=iavblfld(iget(686))
5251 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5255 IF (iget(685)>0 )
THEN
5259 grid1(i,j) = dustpm10(i,j)
5262 if(grib==
'grib2')
then
5264 fld_info(cfld)%ifld=iavblfld(iget(685))
5265 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5291 IF (iget(684)>0 )
THEN
5296 grid1(i,j) = sspm(i,j)
5299 if(grib==
'grib2')
then
5301 fld_info(cfld)%ifld=iavblfld(iget(684))
5302 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5306 IF (iget(619)>0 )
THEN
5311 grid1(i,j) = dusmass(i,j)
5314 if(grib==
'grib2')
then
5316 fld_info(cfld)%ifld=iavblfld(iget(619))
5317 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5322 IF (iget(620)>0 )
THEN
5327 grid1(i,j) = dusmass25(i,j)
5330 if(grib==
'grib2')
then
5332 fld_info(cfld)%ifld=iavblfld(iget(620))
5333 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5337 IF (iget(621)>0 )
THEN
5343 IF(ducmass(i,j)<spval) grid1(i,j) = ducmass(i,j) * 1.e-9
5346 if(grib==
'grib2')
then
5348 fld_info(cfld)%ifld=iavblfld(iget(621))
5349 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5354 IF (iget(622)>0 )
THEN
5360 IF(ducmass25(i,j)<spval) grid1(i,j) = ducmass25(i,j) * 1.e-9
5363 if(grib==
'grib2')
then
5365 fld_info(cfld)%ifld=iavblfld(iget(622))
5366 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5371 IF (iget(646)>0 )
THEN
5376 IF(dustcb(i,j)<spval) grid1(i,j) = dustcb(i,j) * 1.e-9
5379 if(grib==
'grib2')
then
5381 fld_info(cfld)%ifld=iavblfld(iget(646))
5382 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5387 IF (iget(647)>0 )
THEN
5392 IF(sscb(i,j)<spval) grid1(i,j) = sscb(i,j) * 1.e-9
5395 if(grib==
'grib2')
then
5397 fld_info(cfld)%ifld=iavblfld(iget(647))
5398 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5402 IF (iget(616)>0 )
THEN
5407 IF(bccb(i,j)<spval) grid1(i,j) = bccb(i,j) * 1.e-9
5410 if(grib==
'grib2')
then
5412 fld_info(cfld)%ifld=iavblfld(iget(616))
5413 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5418 IF (iget(617)>0 )
THEN
5423 IF(occb(i,j)<spval) grid1(i,j) = occb(i,j) * 1.e-9
5426 if(grib==
'grib2')
then
5428 fld_info(cfld)%ifld=iavblfld(iget(617))
5429 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5434 IF (iget(618)>0 )
THEN
5439 IF(sulfcb(i,j)<spval) grid1(i,j) = sulfcb(i,j) * 1.e-9
5442 if(grib==
'grib2')
then
5444 fld_info(cfld)%ifld=iavblfld(iget(618))
5445 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5451 IF (iget(659)>0) call wrt_aero_diag(659,nbin_du,duem)
5453 IF (iget(660)>0) call wrt_aero_diag(660,nbin_du,dusd)
5454 IF (iget(661)>0) call wrt_aero_diag(661,nbin_du,dudp)
5455 IF (iget(662)>0) call wrt_aero_diag(662,nbin_du,duwt)
5456 IF (iget(679)>0) call wrt_aero_diag(679,nbin_du,dusv)
5460 IF (iget(663)>0) call wrt_aero_diag(663,nbin_ss,ssem)
5461 IF (iget(664)>0) call wrt_aero_diag(664,nbin_ss,sssd)
5462 IF (iget(665)>0) call wrt_aero_diag(665,nbin_ss,ssdp)
5463 IF (iget(666)>0) call wrt_aero_diag(666,nbin_ss,sswt)
5464 IF (iget(680)>0) call wrt_aero_diag(680,nbin_ss,sssv)
5468 IF (iget(667)>0) call wrt_aero_diag(667,nbin_bc,bcem)
5469 IF (iget(668)>0) call wrt_aero_diag(668,nbin_bc,bcsd)
5470 IF (iget(669)>0) call wrt_aero_diag(669,nbin_bc,bcdp)
5471 IF (iget(670)>0) call wrt_aero_diag(670,nbin_bc,bcwt)
5472 IF (iget(681)>0) call wrt_aero_diag(681,nbin_bc,bcsv)
5476 IF (iget(671)>0) call wrt_aero_diag(671,nbin_oc,ocem)
5477 IF (iget(672)>0) call wrt_aero_diag(672,nbin_oc,ocsd)
5478 IF (iget(673)>0) call wrt_aero_diag(673,nbin_oc,ocdp)
5479 IF (iget(674)>0) call wrt_aero_diag(674,nbin_oc,ocwt)
5480 IF (iget(682)>0) call wrt_aero_diag(682,nbin_oc,ocsv)
5483 IF (iget(699).GT.0) call wrt_aero_diag(699,1,maod)
5484 print *,
'aft wrt disg maod'
5495 if(iget(473)>0 .or. iget(474)>0 .or. iget(475)>0)
then
5500 if(avgcprate(i,j) /= spval)
then
5501 egrid1(i,j) = avgcprate(i,j)*(1000./dtq2)
5511 IF(modelname ==
'GFS' .OR. modelname ==
'FV3R')
then
5514 egrid2(i,j) = pbot(i,j)
5515 egrid3(i,j) = ptop(i,j)
5523 if(egrid1(i,j)<= 0. .or. egrid2(i,j)<= 0. .or. egrid3(i,j) <= 0.)
then
5532 IF(egrid2(i,j) == spval .or. egrid3(i,j) == spval) cycle
5533 if(egrid3(i,j) < 400.*100. .and. &
5534 (egrid2(i,j)-egrid3(i,j)) > 300.*100)
then
5536 if(egrid2(i,j) > pmid(i,j,lm))
then
5540 if(egrid2(i,j) >= pmid(i,j,l))
then
5541 if(egrid2(i,j)-pmid(i,j,l)<0.5)
then
5542 egrid2(i,j) = zmid(i,j,l)
5544 dp = (log(egrid2(i,j)) - log(pmid(i,j,l)))/ &
5545 max(1.e-6,(log(pmid(i,j,l+1))-log(pmid(i,j,l))))
5546 egrid2(i,j) = zmid(i,j,l)+(zmid(i,j,l+1)-zmid(i,j,l))*dp
5553 if(egrid3(i,j) < pmid(i,j,1))
then
5554 egrid3(i,j) = zmid(i,j,1)
5557 if(egrid3(i,j) <= pmid(i,j,l))
then
5558 if(pmid(i,j,l)-egrid3(i,j)<0.5)
then
5559 egrid3(i,j) = zmid(i,j,l)
5561 dp = (log(egrid3(i,j)) - log(pmid(i,j,l)))/ &
5562 max(1.e-6,(log(pmid(i,j,l))-log(pmid(i,j,l-1))))
5563 egrid3(i,j) = zmid(i,j,l)+(zmid(i,j,l)-zmid(i,j,l-1))*dp
5577 IF(iget(473) > 0)
THEN
5581 grid1(i,j) = egrid1(i,j)
5585 fld_info(cfld)%ifld=iavblfld(iget(473))
5590 datapd(i,j,cfld) = grid1(i,jj)
5595 IF(iget(474) > 0)
THEN
5599 grid1(i,j) = egrid2(i,j)
5603 fld_info(cfld)%ifld=iavblfld(iget(474))
5608 datapd(i,j,cfld) = grid1(i,jj)
5613 IF(iget(475) > 0)
THEN
5617 grid1(i,j) = egrid3(i,j)
5621 fld_info(cfld)%ifld=iavblfld(iget(475))
5626 datapd(i,j,cfld) = grid1(i,jj)
5642 use ctlblk_mod
, only: spval,jsta,jend,im
5644 real,
intent(inout) :: cbcov(im,jsta:jend)
5652 integer,
parameter :: np=10
5653 real :: x(np), y(np)
5658 x = (/ 1.6,3.6,8.1,18.5,39.0,89.0,197.0,440.0,984.0,10000.0 /)
5659 y = (/ 0.0,0.1,0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.8 /)
5665 if(cbcov(i,j) == spval) cycle
5666 if(cbcov(i,j) <= 0.)
then
5669 val=log(1.0e6*cbcov(i,j))
5670 if (val <= x(1))
then
5672 else if (val >= x(np))
then
5676 if (val < x(k))
then
5677 delta = x(k) - x(k-1)
5678 if (delta <= 0.0)
then
5681 cbcov(i,j) = (y(k) * (val-x(k-1)) + &
5682 y(k-1) * (x(k)-val)) / delta
5693 subroutine wrt_aero_diag(igetfld,nbin,data)
5694 use ctlblk_mod
, only: jsta, jend, spval, im, jm, grib, &
5695 cfld, datapd, fld_info, jsta_2l, jend_2u
5696 use rqstfld_mod
, only: iget, id, lvls, iavblfld
5699 integer igetfld,nbin
5700 real,
dimension(1:im,jsta_2l:jend_2u,nbin) :: data
5703 REAL,
dimension(im,jm) :: grid1
5709 if(
data(i,j,1)<spval) grid1(i,j) =
data(i,j,1)
5711 if(
data(i,j,k)<spval)&
5712 grid1(i,j) = grid1(i,j)+
data(i,j,k)
5716 if(grib==
'grib2')
then
5718 fld_info(cfld)%ifld=iavblfld(iget(igetfld))
5719 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
5722 end subroutine wrt_aero_diag
subroutine cb_cover(cbcov)
calcape() computes CAPE/CINS and other storm related variables.