83 use vrbls4d, only: dust, salt, suso, waso, soot, smoke
84 use vrbls3d, only: zmid, t, pmid, q, cwm, f_ice, f_rain, f_rimef, qqw, qqi,&
85 qqr, qqs, cfr, cfr_raw, dbz, dbzr, dbzi, dbzc, qqw, nlice, nrain, qqg, zint, qqni,&
86 qqnr, qqnw, qqnwfa, qqnifa, uh, vh, mcvg, omga, wh, q2, ttnd, rswtt, &
87 rlwtt, train, tcucn, o3, rhomid, dpres, el_pbl, pint, icing_gfip, icing_gfis, &
88 catedr,mwt,gtg, ref_10cm, pmtf, ozcon
90 use vrbls2d, only: slp, hbot, htop, cnvcfr, cprate, cnvcfr, sfcshx,sfclhx,ustar,z0,&
91 sr, prec, vis, czen, pblh, pblhgust, u10, v10, avgprec, avgcprate, &
92 ref1km_10cm,ref4km_10cm,refc_10cm,refd_max
93 use masks, only: lmh, gdlat, gdlon,sm,sice,dx,dy
94 use params_mod, only: rd, gi, g, rog, h1, tfrz, d00, dbzmin, d608, small,&
95 h100, h1m12, h99999,pi,erad
96 use pmicrph_mod
, only: r1, const1r, qr0, delqr0, const2r, ron, topr, son,&
97 tops, dsnow, drain,const_ng1, const_ng2, gon, topg, dgraupel
98 use ctlblk_mod
, only: jsta_2l, jend_2u, lm, jsta, jend, grib, cfld, datapd,&
99 fld_info, modelname, imp_physics, dtq2, spval, icount_calmict,&
100 me, dt, avrain, theat, ifhr, ifmin, avcnvc, lp1, im, jm, aqfcmaq_on
101 use rqstfld_mod
, only: iget, id, lvls, iavblfld, lvlsxml
102 use gridspec_mod
, only: gridtype,maptype,dxval
104 use upp_math, only: h2u, h2v, u2h, v2h
110 REAL,
PARAMETER :: curate=24.*1000., ctim1=0., ctim2=24.*3600. &
111 &, RAINCON=0.8333*1.1787E4, SNOCON=0.94*1.4594E5 &
116 &, dbzmax=80., zr_a=300., zr_b=1.4
121 DATA cc / 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 /
122 DATA ppt/ 0., .14, .31, .70, 1.6, 3.4, 7.7, 17., 38., 85. /
123 INTEGER,
dimension(im,jsta_2l:jend_2u) :: icbot, ictop, lpbl
131 real,
dimension(im,jm) :: grid1, grid2
132 real,
dimension(im,jsta_2l:jend_2u) :: egrid1, egrid2, egrid3, egrid4, egrid5,&
133 el0, p1d, t1d, q1d, c1d, &
134 fi1d, fr1d, fs1d, qw1, qi1, &
135 qr1, qs1, curefl_s, &
136 curefl, curefl_i, zfrz, dbz1, dbzr1, &
137 dbzi1, dbzc1, egrid6, egrid7, nlice1, &
138 qi, qint, tt, ppp, qv, &
139 qcd, qice1, qrain1, qsno1, refl, &
140 qg1, refl1km, refl4km, rh, gust, nrain1,zm10c
143 REAL,
ALLOCATABLE :: el(:,:,:),richno(:,:,:) ,pblri(:,:), pblregime(:,:)
145 integer i,j,l,lctop,llmh,iice,ll,ii,jj,ifincr,itheat,nc,nmod,lll &
146 ,iz1km,iz4km, lcount, hcount, itype, item
148 real rdtphs,cfrdum,pmod,cc1,cc2,p1,p2,cuprate,facr,rrnum &
149 ,rainrate,term1,term2,term3,qrold,snorate,dens,delz,fctr,hgt &
150 ,rain,ronv,slor,snow,rhoqs,temp_c,sonv,slos &
151 ,graupel,rhoqg,gonv,slog, alpha, rhod, bb &
152 ,ze_s, ze_r, ze_g, ze_max, ze_nc, ze_conv, ze_sum &
153 ,ze_smax, ze_rmax,ze_gmax, ze_nc_1km, ze_nc_4km, dz &
154 ,lapses, expo,expinv,tsfcnew, gam,gamd,gams, pblhold &
155 ,psfc,tsfc,zsfc,dp,dpbnd,zmin
157 real,
allocatable :: rh3d(:,:,:)
161 REAL sdummy(im,2),dxm
163 real,
dimension(im,jsta:jend) :: dummy, cape, cin
164 integer idummy(im,jsta:jend)
166 real,
PARAMETER :: zsl=0.0, taucr=rd*gi*290.66, const=0.005*g/rd, gord=g/rd
167 logical,
parameter :: debugprint = .false.
176 zmin=10.**(0.1*dbzmin)
185 model_radar = .false.
190 IF(abs(ref_10cm(i,j,l)-spval)>small)
THEN
197 if(debugprint .and. me==0)print*,
'Did post read in model derived radar ref ',model_radar, &
198 'MODELNAME=',trim(modelname),
' imp_physics=',imp_physics
199 ALLOCATE(el(im,jsta_2l:jend_2u,lm))
200 ALLOCATE(richno(im,jsta_2l:jend_2u,lm))
201 ALLOCATE(pblri(im,jsta_2l:jend_2u))
204 IF (iget(105) > 0 .OR. iget(445) > 0)
THEN
207 IF (iget(105) > 0)
THEN
211 grid1(i,j) = slp(i,j)
214 if(grib==
"grib2")
then
216 fld_info(cfld)%ifld=iavblfld(iget(105))
221 datapd(i,j,cfld) = grid1(i,jj)
231 IF (modelname==
'NMM' .OR. imp_physics==5 .or. &
232 imp_physics==85 .or. imp_physics==95)
THEN
234 rdtphs=24.*3.6e6/dtq2
237 IF ((hbot(i,j)-htop(i,j)) <= 1.0)
THEN
242 icbot(i,j)=nint(hbot(i,j))
243 ictop(i,j)=nint(htop(i,j))
245 pmod=rdtphs*cprate(i,j)
246 IF (pmod > ppt(1))
THEN
248 IF(pmod>ppt(nc)) nmod=nc
257 cfrdum=cc1+(cc2-cc1)*(pmod-p1)/(p2-p1)
259 cfrdum=min(h1, cfrdum)
269 IF (modelname==
'NMM' .AND. imp_physics==9)
THEN
278 IF(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95 &
279 .or. nmm_gfsmicro)
THEN
283 cuprate=rdtphs*cprate(i,j)
285 zfrz(i,j)=zmid(i,j,nint(lmh(i,j)))
286 DO l=1,nint(lmh(i,j))
287 IF (t(i,j,l) >= tfrz)
THEN
288 zfrz(i,j)=zmid(i,j,l)
293 IF (cuprate <= 0. .or. htop(i,j)>=spval)
THEN
297 curefl_s(i,j)=zr_a*cuprate**zr_b
298 lctop=nint(htop(i,j))
305 curefl_i(i,j)=-2./max( 1000., zmid(i,j,lctop)-zfrz(i,j) )
315 if(icount_calmict==0)
then
323 fi1d(i,j)=f_ice(i,j,l)
324 fr1d(i,j)=f_rain(i,j,l)
325 fs1d(i,j)=max(h1, f_rimef(i,j,l))
330 IF (curefl_s(i,j) > 0.)
THEN
332 llmh = nint(lmh(i,j))
333 lctop=nint(htop(i,j))
334 IF (l>=lctop .AND. l<=llmh)
THEN
335 delz=zmid(i,j,l)-zfrz(i,j)
342 fctr=10.**(curefl_i(i,j)*delz)
345 curefl(i,j)=fctr*curefl_s(i,j)
350 IF(imp_physics==5 .or. imp_physics==85 .or. imp_physics==95)
THEN
351 fer_mic:
IF (imp_physics==5)
THEN
360 CALL calmict_new(p1d,t1d,q1d,c1d,fi1d,fr1d,fs1d,curefl &
361 & ,qw1,qi1,qr1,qs1,dbz1,dbzr1,dbzi1,dbzc1,nlice1, nrain1)
362 IF(modelname ==
'NMM' .and. gridtype==
'B')
THEN
368 refl_miss:
IF (model_radar)
THEN
372 IF(p1d(i,j)<spval.and.t1d(i,j)<spval.and.q1d(i,j)<spval)
THEN
373 ze_nc=10.**(0.1*ref_10cm(i,j,l))
374 dbz1(i,j)=10.*log10(max(zmin,(ze_nc+curefl(i,j))))
375 dbzr1(i,j)=min(dbzr1(i,j), ref_10cm(i,j,l))
376 dbzi1(i,j)=min(dbzi1(i,j), ref_10cm(i,j,l))
377 ze_max=max(dbzr1(i,j),dbzi1(i,j))
378 refl_comp:
IF(ref_10cm(i,j,l)>dbzmin .OR. ze_max>dbzmin)
THEN
379 refl_adj:
IF(ref_10cm(i,j,l)<=dbzmin)
THEN
382 ELSE IF(ze_max<=dbzmin)
THEN
383 IF(qr1(i,j)>qs1(i,j))
THEN
384 dbzr1(i,j)=ref_10cm(i,j,l)
385 ELSE IF(qs1(i,j)>qr1(i,j))
THEN
386 dbzi1(i,j)=ref_10cm(i,j,l)
388 IF(t1d(i,j)>=tfrz)
THEN
389 dbzr1(i,j)=ref_10cm(i,j,l)
391 dbzi1(i,j)=ref_10cm(i,j,l)
395 ze_nc=10.**(0.1*ref_10cm(i,j,l))
396 ze_r=10.**(0.1*dbzr1(i,j))
397 ze_s=10.**(0.1*dbzi1(i,j))
402 dbzr1(i,j)=10.*log10(ze_r)
403 dbzi1(i,j)=10.*log10(ze_s)
414 IF (me==0 .AND. l==1)
THEN
415 WRITE(6,
'(4A,1x,F7.2)')
'WARNING - MDLFLD: REF_10CM NOT ', &
416 'IN NMMB OUTPUT. CHECK ', &
417 'SOLVER_STATE.TXT FILE. USING ', &
418 'REFL OUTPUT FROM CALMICT.'
429 CALL calmict_old(p1d,t1d,q1d,c1d,fi1d,fr1d,fs1d,curefl &
430 & ,qw1,qi1,qr1,qs1,dbz1,dbzr1,dbzi1,dbzc1,nlice1, nrain1)
439 IF(c1d(i,j)<spval.and.fi1d(i,j)<spval)
THEN
440 qi1(i,j)=c1d(i,j)*fi1d(i,j)
441 qw1(i,j)=c1d(i,j)-qi1(i,j)
457 llmh = nint(lmh(i,j))
469 qqw(i,j,l) = max(d00, qw1(i,j))
470 qqi(i,j,l) = max(d00, qi1(i,j))
471 qqr(i,j,l) = max(d00, qr1(i,j))
472 qqs(i,j,l) = max(d00, qs1(i,j))
473 dbz(i,j,l) = max(dbzmin, dbz1(i,j))
474 dbzr(i,j,l) = max(dbzmin, dbzr1(i,j))
475 dbzi(i,j,l) = max(dbzmin, dbzi1(i,j))
476 dbzc(i,j,l) = max(dbzmin, dbzc1(i,j))
477 nlice(i,j,l) = max(d00, nlice1(i,j))
478 nrain(i,j,l) = max(d00, nrain1(i,j))
485 icount_calmict=icount_calmict+1
486 if(debugprint .and. me==0)print*,
'debug calmict:icount_calmict= ',icount_calmict
495 ELSE IF(modelname ==
'NMM' .and. gridtype==
'B' .and. imp_physics==99)
THEN
499 llmh = nint(lmh(i,j))
511 qqi(i,j,l) = max(d00, cwm(i,j,l)*f_ice(i,j,l))
512 qqw(i,j,l) = max(d00, cwm(i,j,l)-qqi(i,j,l))
523 ELSE IF(modelname ==
'NMM' .and. gridtype==
'B' .and. imp_physics==6)
THEN
527 llmh = nint(lmh(i,j))
540 qqw(i,j,l)=max(d00, (1.-f_ice(i,j,l))*cwm(i,j,l)*(1.-f_rain(i,j,l)))
541 qqr(i,j,l)=max(d00,(1.-f_ice(i,j,l))*cwm(i,j,l)*f_rain(i,j,l))
542 qqs(i,j,l)=max(d00, cwm(i,j,l)*f_ice(i,j,l))
543 dens=pmid(i,j,l)/(rd*t(i,j,l)*(q(i,j,l)*d608+1.0))
544 dbzr(i,j,l)=((qqr(i,j,l)*dens)**1.75)* &
545 & 3.630803e-9 * 1.e18
546 dbzi(i,j,l)= dbzi(i,j,l)+((qqs(i,j,l)*dens)**1.75)* &
547 & 2.18500e-10 * 1.e18
548 dbz(i,j,l)=dbzr(i,j,l)+dbzi(i,j,l)
549 IF (dbz(i,j,l)>0.) dbz(i,j,l)=10.0*log10(dbz(i,j,l))
550 IF (dbzr(i,j,l)>0.)dbzr(i,j,l)=10.0*log10(dbzr(i,j,l))
551 IF (dbzi(i,j,l)>0.) &
552 & dbzi(i,j,l)=10.0*log10(dbzi(i,j,l))
553 dbz(i,j,l)=max(dbzmin, dbz(i,j,l))
554 dbzr(i,j,l)=max(dbzmin, dbzr(i,j,l))
555 dbzi(i,j,l)=max(dbzmin, dbzi(i,j,l))
561 ELSE IF(((modelname ==
'NMM' .and. gridtype==
'B') .OR. modelname ==
'FV3R') &
562 .and. imp_physics==8)
THEN
566 dbz(i,j,l)=ref_10cm(i,j,l)
570 ELSE IF(imp_physics==99 .or. imp_physics==98)
THEN
579 if(debugprint .and. me==0)print*,
'calculating radar ref for non-Ferrier/non-Zhao schemes'
581 IF(imp_physics == 1 .OR. imp_physics == 3)
THEN
592 cuprate=rdtphs*cprate(i,j)
593 zfrz(i,j)=zmid(i,j,nint(lmh(i,j)))
594 DO l=1,nint(lmh(i,j))
595 IF (t(i,j,l) >= tfrz)
THEN
596 zfrz(i,j)=zmid(i,j,l)
601 IF (cuprate <= 0. .or. htop(i,j)>=spval)
THEN
605 curefl_s(i,j)=zr_a*cuprate**zr_b
606 lctop=nint(htop(i,j))
613 curefl_i(i,j)=-2./max( 1000., zmid(i,j,lctop)-zfrz(i,j) )
618 IF(imp_physics /= 8 .AND. imp_physics /= 9 .and. imp_physics /= 28)
THEN
627 IF (curefl_s(i,j) > 0.)
THEN
629 llmh = nint(lmh(i,j))
630 lctop=nint(htop(i,j))
631 IF (l>=lctop .AND. l<=llmh)
THEN
632 delz=zmid(i,j,l)-zfrz(i,j)
639 fctr=10.**(curefl_i(i,j)*delz)
642 curefl(i,j)=fctr*curefl_s(i,j)
643 dbzc(i,j,l)=curefl(i,j)
646 IF(t(i,j,l)<spval)
THEN
648 IF(t(i,j,l) > 1.0e-3) &
649 & dens = pmid(i,j,l)/(rd*t(i,j,l)*(q(i,j,l)*d608+1.0))
654 qqr(i,j,l) = max(qqr(i,j,l),0.0)
655 qqs(i,j,l) = max(qqs(i,j,l),0.0)
657 IF (t(i,j,l) >= tfrz)
THEN
658 dbz(i,j,l) = ((qqr(i,j,l)*dens)**1.75)* &
659 & 3.630803e-9 * 1.e18
660 dbzr(i,j,l) = dbz(i,j,l)
663 dbz(i,j,l) = ((qqs(i,j,l)*dens)**1.75)* &
664 & 2.18500e-10 * 1.e18
665 dbzi(i,j,l) = dbz(i,j,l)
667 ELSEIF (iice == 1)
THEN
669 qqg(i,j,l) = max(qqg(i,j,l),0.0)
670 if(qqr(i,j,l) < spval .and. qqr(i,j,l)> 0.0)
then
671 dbzr(i,j,l) = ((qqr(i,j,l)*dens)**1.75) * 3.630803e-9 * 1.e18
675 if(qqs(i,j,l) < spval .and. qqs(i,j,l) > 0.0)
then
676 dbzi(i,j,l) = ((qqs(i,j,l)*dens)**1.75) * &
677 & 2.18500e-10 * 1.e18
681 IF (qqg(i,j,l) < spval .and. qqg(i,j,l)> 0.0)
then
682 dbzi(i,j,l) = dbzi(i,j,l) + ((qqg(i,j,l)*dens)**1.75) * &
683 & 1.033267e-9 * 1.e18
685 dbzi(i,j,l) = dbzi(i,j,l)
687 IF (model_radar)
THEN
688 ze_nc=10.**(0.1*ref_10cm(i,j,l))
689 dbz(i,j,l) = ze_nc+curefl(i,j)
691 dbz(i,j,l) = dbzr(i,j,l) + dbzi(i,j,l) + curefl(i,j)
696 IF (dbz(i,j,l) > 0.) dbz(i,j,l) = 10.0*log10(dbz(i,j,l))
697 IF (dbzr(i,j,l) > 0.) dbzr(i,j,l) = 10.0*log10(dbzr(i,j,l))
698 IF (dbzi(i,j,l) > 0.) dbzi(i,j,l) = 10.0*log10(dbzi(i,j,l))
699 IF (dbzc(i,j,l) > 0.) dbzc(i,j,l) = 10.0*log10(dbzc(i,j,l))
700 llmh = nint(lmh(i,j))
707 dbz(i,j,l) = max(dbzmin, dbz(i,j,l))
708 dbzr(i,j,l) = max(dbzmin, dbzr(i,j,l))
709 dbzi(i,j,l) = max(dbzmin, dbzi(i,j,l))
710 dbzc(i,j,l) = max(dbzmin, dbzc(i,j,l))
749 IF(t(i,j,ll)<spval)
THEN
750 IF(t(i,j,ll) < 1.0e-3)print*,
'ZERO T'
751 IF(t(i,j,ll) > 1.0e-3) &
753 (rd*t(i,j,ll)*(q(i,j,ll)*d608+1.0))
754 dz=zint(i,j,ll)-zint(i,j,lm+1)
769 if (qqr(i,j,ll) >= 1.e-6)
then
770 rain = max(r1,qqr(i,j,ll))
771 ronv = (const1r*tanh((qr0 - rain)/delqr0) + &
773 slor=(rhod*rain/(topr*ronv))**0.25
774 ze_r = 720.*ronv*ron*slor**7
779 if (qqs(i,j,ll) >= 1.e-6)
then
780 snow = max(r1,qqs(i,j,ll))
783 temp_c = min(-0.001, t(i,j,ll)-273.15)
784 sonv = (min(2.0e8, 2.0e6*exp(-0.12*temp_c)))/son
785 slos=(rhoqs/(tops*sonv))**0.25
786 ze_s = 720.*alpha*sonv*son*slos**7*(dsnow/drain)**2
791 IF (t(i,j,ll) > 273.15) &
792 ze_s = ze_s*(1. + 4.28*bb)
797 if (qqg(i,j,ll) >= 1.e-6)
then
798 graupel = max(r1,qqg(i,j,ll))
801 gonv=const_ng1*(rhoqg**const_ng2)
802 gonv = max(1.e4, min(gonv,gon))
804 slog=(rhoqg/(topg*gonv))**0.25
805 ze_g = 720.*alpha*gonv*gon*slog**7*(dgraupel/drain)**2
809 IF (t(i,j,ll) > 273.15) &
810 ze_g = ze_g*(1. + 4.28*bb)
814 ze_nc = ze_r + ze_s + ze_g
816 if (iz1km==0 .and. dz>1000.)
then
821 if (iz4km==0 .and. dz>4000.)
then
826 ze_rmax = max(ze_r,ze_rmax)
827 ze_smax = max(ze_s,ze_smax)
828 ze_gmax = max(ze_g,ze_gmax)
840 ze_max = max(ze_max, ze_sum )
843 dbzr(i,j,ll) = ze_r*1.e18
844 dbzi(i,j,ll) = (ze_s+ze_g)*1.e18
847 dbzr(i,j,ll) = dbzmin
848 dbzi(i,j,ll) = dbzmin
857 cuprate=rdtphs*cprate(i,j)
861 ze_conv= max(0.1,300*(cuprate)**1.4)
866 ze_sum = ze_max + ze_conv
867 refl(i,j) = 10.*log10(ze_sum)
868 refl1km(i,j) = 10.*log10(ze_nc_1km*1.e18 + ze_conv)
869 refl4km(i,j) = 10.*log10(ze_nc_4km*1.e18 + ze_conv)
874 ze_rmax = 10.*log10(ze_rmax*1.e18)
875 ze_smax = 10.*log10(ze_smax*1.e18)
876 ze_gmax = 10.*log10(ze_gmax*1.e18)
878 write (6,*)
'dbze_max-r/s/g',ze_rmax,ze_smax,ze_gmax
888 allocate (rh3d(im,jsta_2l:jend_2u,lm))
889 IF ( (iget(001)>0).OR.(iget(077)>0).OR. &
890 (iget(002)>0).OR.(iget(003)>0).OR. &
891 (iget(004)>0).OR.(iget(005)>0).OR. &
892 (iget(006)>0).OR.(iget(083)>0).OR. &
893 (iget(007)>0).OR.(iget(008)>0).OR. &
894 (iget(009)>0).OR.(iget(010)>0).OR. &
895 (iget(084)>0).OR.(iget(011)>0).OR. &
896 (iget(041)>0).OR.(iget(124)>0).OR. &
897 (iget(078)>0).OR.(iget(079)>0).OR. &
898 (iget(125)>0).OR.(iget(145)>0).OR. &
899 (iget(140)>0).OR.(iget(040)>0).OR. &
900 (iget(181)>0).OR.(iget(182)>0).OR. &
901 (iget(199)>0).OR.(iget(185)>0).OR. &
902 (iget(186)>0).OR.(iget(187)>0).OR. &
903 (iget(250)>0).OR.(iget(252)>0).OR. &
904 (iget(276)>0).OR.(iget(277)>0).OR. &
905 (iget(750)>0).OR.(iget(751)>0).OR. &
906 (iget(752)>0).OR.(iget(754)>0).OR. &
907 (iget(278)>0).OR.(iget(264)>0).OR. &
908 (iget(450)>0).OR.(iget(480)>0).OR. &
909 (iget(774)>0).OR.(iget(747)>0).OR. &
910 (iget(464)>0).OR.(iget(467)>0).OR. &
911 (iget(629)>0).OR.(iget(630)>0).OR. &
913 (iget(909)>0).OR.(iget(737)>0).OR. &
914 (iget(994)>0).OR.(iget(995)>0) )
THEN
919 IF (iget(001)>0)
THEN
920 IF (lvls(l,iget(001))>0)
THEN
925 grid1(i,j) = pmid(i,j,ll)
928 if(grib==
"grib2" )
then
930 fld_info(cfld)%ifld=iavblfld(iget(001))
931 fld_info(cfld)%lvl=lvlsxml(l,iget(001))
936 datapd(i,j,cfld) = grid1(i,jj)
946 IF (iget(124) > 0)
THEN
947 IF (lvls(l,iget(124)) > 0)
THEN
952 grid1(i,j) = qqw(i,j,ll)
953 if(grid1(i,j)<1e-20) grid1(i,j) = 0.0
956 if(grib==
"grib2" )
then
958 fld_info(cfld)%ifld=iavblfld(iget(124))
959 fld_info(cfld)%lvl=lvlsxml(l,iget(124))
964 datapd(i,j,cfld) = grid1(i,jj)
973 IF (iget(125) > 0)
THEN
974 IF (lvls(l,iget(125)) > 0)
THEN
979 grid1(i,j) = qqi(i,j,ll)
980 if(grid1(i,j)<1e-20) grid1(i,j) = 0.0
983 if(grib==
"grib2" )
then
985 fld_info(cfld)%ifld=iavblfld(iget(125))
986 fld_info(cfld)%lvl=lvlsxml(l,iget(125))
991 datapd(i,j,cfld) = grid1(i,jj)
1000 IF (iget(181) > 0)
THEN
1001 IF (lvls(l,iget(181)) > 0)
THEN
1006 grid1(i,j) = qqr(i,j,ll)
1007 if(grid1(i,j)<1e-20) grid1(i,j) = 0.0
1010 if(grib==
"grib2" )
then
1012 fld_info(cfld)%ifld=iavblfld(iget(181))
1013 fld_info(cfld)%lvl=lvlsxml(l,iget(181))
1018 datapd(i,j,cfld) = grid1(i,jj)
1027 IF (iget(182) > 0)
THEN
1028 IF (lvls(l,iget(182)) > 0)
THEN
1033 grid1(i,j) = qqs(i,j,ll)
1034 if(grid1(i,j)<1e-20) grid1(i,j) = 0.0
1037 if(grib==
"grib2" )
then
1039 fld_info(cfld)%ifld=iavblfld(iget(182))
1040 fld_info(cfld)%lvl=lvlsxml(l,iget(182))
1045 datapd(i,j,cfld) = grid1(i,jj)
1054 IF (iget(415) > 0)
THEN
1055 IF (lvls(l,iget(415)) > 0)
THEN
1060 if(qqg(i,j,ll) < 1.e-12) qqg(i,j,ll) = 0.
1061 grid1(i,j) = qqg(i,j,ll)
1064 if(grib==
"grib2" )
then
1066 fld_info(cfld)%ifld=iavblfld(iget(415))
1067 fld_info(cfld)%lvl=lvlsxml(l,iget(415))
1072 datapd(i,j,cfld) = grid1(i,jj)
1081 IF (iget(747) > 0)
THEN
1082 IF (lvls(l,iget(747)) > 0)
THEN
1087 if(qqnw(i,j,ll) < 1.e-8) qqnw(i,j,ll) = 0.
1088 grid1(i,j) = qqnw(i,j,ll)
1091 if(grib==
"grib2" )
then
1093 fld_info(cfld)%ifld=iavblfld(iget(747))
1094 fld_info(cfld)%lvl=lvlsxml(l,iget(747))
1099 datapd(i,j,cfld) = grid1(i,jj)
1108 IF (iget(752) > 0)
THEN
1109 IF (lvls(l,iget(752)) > 0)
THEN
1114 if(qqni(i,j,ll) < 1.e-8) qqni(i,j,ll) = 0.
1115 grid1(i,j) = qqni(i,j,ll)
1118 if(grib==
"grib2" )
then
1120 fld_info(cfld)%ifld=iavblfld(iget(752))
1121 fld_info(cfld)%lvl=lvlsxml(l,iget(752))
1126 datapd(i,j,cfld) = grid1(i,jj)
1135 IF (iget(754) > 0)
THEN
1136 IF (lvls(l,iget(754)) > 0)
THEN
1141 if(qqnr(i,j,ll) < 1.e-8) qqnr(i,j,ll) = 0.
1142 grid1(i,j) = qqnr(i,j,ll)
1145 if(grib==
"grib2" )
then
1147 fld_info(cfld)%ifld=iavblfld(iget(754))
1148 fld_info(cfld)%lvl=lvlsxml(l,iget(754))
1153 datapd(i,j,cfld) = grid1(i,jj)
1161 IF (iget(766) > 0)
THEN
1162 IF (lvls(l,iget(766)) > 0)
THEN
1166 if(qqnwfa(i,j,ll)<1.e-8)qqnwfa(i,j,ll)=0.
1167 grid1(i,j)=qqnwfa(i,j,ll)
1170 if(grib==
"grib2" )
then
1172 fld_info(cfld)%ifld=iavblfld(iget(766))
1173 fld_info(cfld)%lvl=lvlsxml(l,iget(766))
1174 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1181 IF (iget(767) > 0)
THEN
1182 IF (lvls(l,iget(767)) > 0)
THEN
1186 if(qqnifa(i,j,ll)<1.e-8)qqnifa(i,j,ll)=0.
1187 grid1(i,j)=qqnifa(i,j,ll)
1190 if(grib==
"grib2" )
then
1192 fld_info(cfld)%ifld=iavblfld(iget(767))
1193 fld_info(cfld)%lvl=lvlsxml(l,iget(767))
1194 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1201 IF (iget(145) > 0)
THEN
1202 IF (lvls(l,iget(145)) > 0)
THEN
1207 IF(abs(cfr(i,j,ll)-spval) > small) &
1208 & grid1(i,j) = cfr(i,j,ll)*h100
1211 CALL bound(grid1,d00,h100)
1212 if(grib==
"grib2" )
then
1214 fld_info(cfld)%ifld=iavblfld(iget(145))
1215 fld_info(cfld)%lvl=lvlsxml(l,iget(145))
1220 datapd(i,j,cfld) = grid1(i,jj)
1229 IF (iget(774) > 0)
THEN
1230 IF (lvls(l,iget(774)) > 0)
THEN
1235 IF(modelname ==
'RAPR')
THEN
1236 grid1(i,j) = cfr(i,j,ll)
1238 grid1(i,j) = cfr_raw(i,j,ll)
1242 if(grib==
"grib2" )
then
1244 fld_info(cfld)%ifld=iavblfld(iget(774))
1245 fld_info(cfld)%lvl=lvlsxml(l,iget(774))
1250 datapd(i,j,cfld) = grid1(i,jj)
1259 IF (iget(250) > 0)
THEN
1260 IF (lvls(l,iget(250)) > 0)
THEN
1270 IF(imp_physics == 8 .or. imp_physics == 28)
THEN
1274 grid1(i,j) = ref_10cm(i,j,ll)
1281 grid1(i,j) = dbz(i,j,ll)
1286 CALL bound(grid1,dbzmin,dbzmax)
1287 if(grib==
"grib2" )
then
1289 fld_info(cfld)%ifld=iavblfld(iget(250))
1290 fld_info(cfld)%lvl=lvlsxml(l,iget(250))
1295 datapd(i,j,cfld) = grid1(i,jj)
1305 IF (iget(199)>0)
THEN
1306 IF (lvls(l,iget(199))>0)
THEN
1311 grid1(i,j) = cwm(i,j,ll)
1314 if(grib==
"grib2" )
then
1316 fld_info(cfld)%ifld=iavblfld(iget(199))
1317 fld_info(cfld)%lvl=lvlsxml(l,iget(199))
1322 datapd(i,j,cfld) = grid1(i,jj)
1331 IF (iget(185)>0)
THEN
1332 IF (lvls(l,iget(185))>0)
THEN
1337 grid1(i,j) = f_rain(i,j,ll)
1340 if(grib==
"grib2" )
then
1342 fld_info(cfld)%ifld=iavblfld(iget(185))
1343 fld_info(cfld)%lvl=lvlsxml(l,iget(185))
1348 datapd(i,j,cfld) = grid1(i,jj)
1357 IF (iget(186)>0)
THEN
1358 IF (lvls(l,iget(186))>0)
THEN
1363 grid1(i,j) = f_ice(i,j,ll)
1366 if(grib==
"grib2" )
then
1368 fld_info(cfld)%ifld=iavblfld(iget(186))
1369 fld_info(cfld)%lvl=lvlsxml(l,iget(186))
1374 datapd(i,j,cfld) = grid1(i,jj)
1383 IF (iget(187)>0)
THEN
1384 IF (lvls(l,iget(187))>0)
THEN
1390 grid1(i,j) = f_rimef(i,j,ll)
1393 if(grib==
"grib2" )
then
1395 fld_info(cfld)%ifld=iavblfld(iget(187))
1396 fld_info(cfld)%lvl=lvlsxml(l,iget(187))
1401 datapd(i,j,cfld) = grid1(i,jj)
1410 IF (iget(077)>0)
THEN
1411 IF (lvls(l,iget(077))>0)
THEN
1416 grid1(i,j) = zmid(i,j,ll)
1419 if(grib==
"grib2" )
then
1421 fld_info(cfld)%ifld=iavblfld(iget(077))
1422 fld_info(cfld)%lvl=lvlsxml(l,iget(077))
1427 datapd(i,j,cfld) = grid1(i,jj)
1436 IF (iget(002)>0)
THEN
1437 IF (lvls(l,iget(002))>0)
THEN
1442 grid1(i,j) = t(i,j,ll)
1445 if(grib==
"grib2" )
then
1447 fld_info(cfld)%ifld=iavblfld(iget(002))
1448 fld_info(cfld)%lvl=lvlsxml(l,iget(002))
1453 datapd(i,j,cfld) = grid1(i,jj)
1462 IF (iget(909)>0)
THEN
1463 IF (lvls(l,iget(909))>0)
THEN
1468 IF(t(i,j,ll)<spval.and.q(i,j,ll)<spval)
THEN
1469 grid1(i,j)=t(i,j,ll)*(1.+d608*q(i,j,ll))
1475 if(grib==
"grib2" )
then
1477 fld_info(cfld)%ifld=iavblfld(iget(909))
1478 fld_info(cfld)%lvl=lvlsxml(l,iget(909))
1479 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
1486 IF (iget(003)>0)
THEN
1487 IF (lvls(l,iget(003))>0)
THEN
1492 p1d(i,j) = pmid(i,j,ll)
1493 t1d(i,j) = t(i,j,ll)
1496 CALL calpot(p1d(1,jsta),t1d(1,jsta),egrid3(1,jsta))
1501 grid1(i,j) = egrid3(i,j)
1504 if(grib==
"grib2")
then
1506 fld_info(cfld)%ifld=iavblfld(iget(003))
1507 fld_info(cfld)%lvl=lvlsxml(l,iget(003))
1512 datapd(i,j,cfld) = grid1(i,jj)
1521 IF (iget(751)>0)
THEN
1522 IF (lvls(l,iget(751))>0)
THEN
1527 p1d(i,j) = pmid(i,j,ll)
1528 t1d(i,j) = t(i,j,ll)
1531 CALL calpot(p1d(1,jsta),t1d(1,jsta),egrid3(1,jsta))
1536 IF(p1d(i,j)<spval.and.t1d(i,j)<spval.and.q(i,j,ll)<spval)
THEN
1537 grid1(i,j) = egrid3(i,j) * (1.+d608*q(i,j,ll))
1543 if(grib==
"grib2")
then
1545 fld_info(cfld)%ifld=iavblfld(iget(751))
1546 fld_info(cfld)%lvl=lvlsxml(l,iget(751))
1551 datapd(i,j,cfld) = grid1(i,jj)
1561 IF (iget(006) > 0) item = lvls(l,iget(006))
1562 IF (item > 0 .OR. iget(450) > 0 .OR. iget(480) > 0)
THEN
1567 p1d(i,j) = pmid(i,j,ll)
1568 t1d(i,j) = t(i,j,ll)
1569 q1d(i,j) = q(i,j,ll)
1573 CALL calrh(p1d(1,jsta),t1d(1,jsta),q1d(1,jsta),egrid4(1,jsta))
1578 IF(p1d(i,j)<spval.and.t1d(i,j)<spval.and.q1d(i,j)<spval)
THEN
1579 grid1(i,j) = egrid4(i,j)*100.
1580 rh3d(i,j,ll) = grid1(i,j)
1581 egrid2(i,j) = q(i,j,ll)/max(1.e-8,egrid4(i,j))
1584 rh3d(i,j,ll) = spval
1590 if(grib==
"grib2")
then
1592 fld_info(cfld)%ifld=iavblfld(iget(006))
1593 fld_info(cfld)%lvl=lvlsxml(l,iget(006))
1598 datapd(i,j,cfld) = grid1(i,jj)
1607 IF (iget(004)>0)
THEN
1608 IF (lvls(l,iget(004))>0)
THEN
1613 p1d(i,j) = pmid(i,j,ll)
1614 t1d(i,j) = t(i,j,ll)
1615 q1d(i,j) = q(i,j,ll)
1618 CALL caldwp(p1d(1,jsta),q1d(1,jsta),egrid3(1,jsta),t1d(1,jsta))
1622 IF(p1d(i,j)<spval.and.t1d(i,j)<spval.and.q1d(i,j)<spval)
THEN
1623 grid1(i,j) = egrid3(i,j)
1629 if(grib==
"grib2")
then
1631 fld_info(cfld)%ifld=iavblfld(iget(004))
1632 fld_info(cfld)%lvl=lvlsxml(l,iget(004))
1637 datapd(i,j,cfld) = grid1(i,jj)
1645 IF (iget(005)>0)
THEN
1646 IF (lvls(l,iget(005))>0)
THEN
1651 grid1(i,j) = q(i,j,ll)
1654 CALL bound(grid1,h1m12,h99999)
1655 if(grib==
"grib2")
then
1657 fld_info(cfld)%ifld=iavblfld(iget(005))
1658 fld_info(cfld)%lvl=lvlsxml(l,iget(005))
1663 datapd(i,j,cfld) = grid1(i,jj)
1671 IF (iget(750)>0)
THEN
1672 IF (lvls(l,iget(750))>0)
THEN
1677 IF(q(i,j,ll)<spval)
THEN
1678 grid1(i,j) = q(i,j,ll) / (1.-q(i,j,ll))
1684 CALL bound(grid1,h1m12,h99999)
1685 if(grib==
"grib2")
then
1687 fld_info(cfld)%ifld=iavblfld(iget(750))
1688 fld_info(cfld)%lvl=lvlsxml(l,iget(750))
1693 datapd(i,j,cfld) = grid1(i,jj)
1703 if (iget(083) > 0) lll = lvls(l,iget(083))
1704 IF (iget(083)>0 .OR. iget(295)>0)
THEN
1705 IF (lll >0 .OR. iget(295)>0)
THEN
1708 DO j=jsta_2l,jend_2u
1710 q1d(i,j) = q(i,j,ll)
1711 egrid1(i,j) = uh(i,j,ll)
1712 egrid2(i,j) = vh(i,j,ll)
1715 CALL calmcvg(q1d,egrid1,egrid2,egrid3)
1719 IF(q1d(i,j)<spval.and.egrid1(i,j)<spval.and.egrid2(i,j)<spval)
THEN
1720 grid1(i,j) = egrid3(i,j)
1721 mcvg(i,j,ll) = egrid3(i,j)
1724 mcvg(i,j,ll) = spval
1728 IF(iget(083)>0 .AND. lll>0)
THEN
1729 if(grib==
"grib2")
then
1731 fld_info(cfld)%ifld=iavblfld(iget(083))
1732 fld_info(cfld)%lvl=lvlsxml(l,iget(083))
1737 datapd(i,j,cfld) = grid1(i,jj)
1747 IF (iget(007)>0.OR.iget(008)>0)
THEN
1748 IF (lvls(l,iget(007))>0.OR.lvls(l,iget(008))>0 )
THEN
1753 grid1(i,j) = uh(i,j,ll)
1754 grid2(i,j) = vh(i,j,ll)
1757 if(grib==
"grib2")
then
1759 fld_info(cfld)%ifld=iavblfld(iget(007))
1760 fld_info(cfld)%lvl=lvlsxml(l,iget(007))
1765 datapd(i,j,cfld) = grid1(i,jj)
1769 fld_info(cfld)%ifld=iavblfld(iget(008))
1770 fld_info(cfld)%lvl=lvlsxml(l,iget(008))
1775 datapd(i,j,cfld) = grid2(i,jj)
1783 IF (iget(009)>0)
THEN
1784 IF (lvls(l,iget(009))>0)
THEN
1789 grid1(i,j) = omga(i,j,ll)
1792 if(grib==
"grib2")
then
1794 fld_info(cfld)%ifld=iavblfld(iget(009))
1795 fld_info(cfld)%lvl=lvlsxml(l,iget(009))
1800 datapd(i,j,cfld) = grid1(i,jj)
1808 IF (iget(264)>0)
THEN
1809 IF (lvls(l,iget(264))>0)
THEN
1814 grid1(i,j)=wh(i,j,ll)
1817 if(grib==
"grib2")
then
1819 fld_info(cfld)%ifld=iavblfld(iget(264))
1820 fld_info(cfld)%lvl=lvlsxml(l,iget(264))
1825 datapd(i,j,cfld) = grid1(i,jj)
1833 IF (iget(010)>0)
THEN
1834 IF (lvls(l,iget(010))>0)
THEN
1837 DO j=jsta_2l,jend_2u
1839 egrid1(i,j) = uh(i,j,ll)
1840 egrid2(i,j) = vh(i,j,ll)
1843 CALL calvor(egrid1,egrid2,egrid3)
1847 IF(egrid3(i,j)<spval)
THEN
1848 grid1(i,j) = egrid3(i,j)
1854 if(grib==
"grib2")
then
1856 fld_info(cfld)%ifld=iavblfld(iget(010))
1857 fld_info(cfld)%lvl=lvlsxml(l,iget(010))
1862 datapd(i,j,cfld) = grid1(i,jj)
1870 IF (iget(084)>0)
THEN
1871 IF (lvls(l,iget(084))>0)
THEN
1876 egrid1(i,j) = zmid(i,j,ll)
1879 CALL calstrm(egrid1(1,jsta),egrid2(1,jsta))
1883 grid1(i,j) = egrid2(i,j)
1886 if(grib==
"grib2")
then
1888 fld_info(cfld)%ifld=iavblfld(iget(084))
1889 fld_info(cfld)%lvl=lvlsxml(l,iget(084))
1894 datapd(i,j,cfld) = grid1(i,jj)
1902 IF (iget(011)>0)
THEN
1903 IF (lvls(l,iget(011))>0)
THEN
1908 grid1(i,j) = q2(i,j,ll)
1911 if(grib==
"grib2")
then
1913 fld_info(cfld)%ifld=iavblfld(iget(011))
1914 fld_info(cfld)%lvl=lvlsxml(l,iget(011))
1919 datapd(i,j,cfld) = grid1(i,jj)
1972 IF (iget(140)>0)
THEN
1973 IF (lvls(l,iget(140))>0)
THEN
1978 grid1(i,j) = ttnd(i,j,ll)
1981 if(grib==
"grib2")
then
1983 fld_info(cfld)%ifld=iavblfld(iget(140))
1984 fld_info(cfld)%lvl=lvlsxml(l,iget(140))
1989 datapd(i,j,cfld) = grid1(i,jj)
1998 IF (iget(040)>0)
THEN
1999 IF (lvls(l,iget(040))>0)
THEN
2004 grid1(i,j) = rswtt(i,j,ll)
2007 if(grib==
"grib2")
then
2009 fld_info(cfld)%ifld=iavblfld(iget(040))
2010 fld_info(cfld)%lvl=lvlsxml(l,iget(040))
2015 datapd(i,j,cfld) = grid1(i,jj)
2024 IF (iget(041)>0)
THEN
2025 IF (lvls(l,iget(041))>0)
THEN
2030 grid1(i,j) = rlwtt(i,j,ll)
2033 if(grib==
"grib2")
then
2035 fld_info(cfld)%ifld=iavblfld(iget(041))
2036 fld_info(cfld)%lvl=lvlsxml(l,iget(041))
2041 datapd(i,j,cfld) = grid1(i,jj)
2052 IF (iget(078)>0)
THEN
2053 IF (lvls(l,iget(078))>0)
THEN
2063 IF(train(i,j,ll)<spval)
THEN
2064 grid1(i,j) = train(i,j,ll)*rrnum
2072 IF (itheat /= 0)
THEN
2073 ifincr = mod(ifhr,itheat)
2078 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2081 id(18) = ifhr-itheat
2083 id(18) = ifhr-ifincr
2085 IF(ifmin >= 1)id(18)=id(18)*60
2086 if(grib==
"grib2")
then
2088 fld_info(cfld)%ifld=iavblfld(iget(078))
2089 fld_info(cfld)%lvl=lvlsxml(l,iget(078))
2091 fld_info(cfld)%ntrange=0
2093 fld_info(cfld)%ntrange=1
2095 fld_info(cfld)%tinvstat=ifhr-id(18)
2100 datapd(i,j,cfld) = grid1(i,jj)
2108 IF (iget(079)>0)
THEN
2109 IF (lvls(l,iget(079))>0)
THEN
2119 IF(tcucn(i,j,ll)<spval)
THEN
2120 grid1(i,j) = tcucn(i,j,ll)*rrnum
2128 IF (itheat /= 0)
THEN
2129 ifincr = mod(ifhr,itheat)
2134 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2137 id(18) = ifhr-itheat
2139 id(18) = ifhr-ifincr
2141 IF(ifmin >= 1)id(18)=id(18)*60
2142 if(grib==
"grib2")
then
2144 fld_info(cfld)%ifld=iavblfld(iget(079))
2145 fld_info(cfld)%lvl=lvlsxml(l,iget(079))
2147 fld_info(cfld)%ntrange=0
2149 fld_info(cfld)%ntrange=1
2151 fld_info(cfld)%tinvstat=ifhr-id(18)
2156 datapd(i,j,cfld) = grid1(i,jj)
2164 IF (iget(267)>0)
THEN
2165 IF (lvls(l,iget(267))>0)
THEN
2170 grid1(i,j) = o3(i,j,ll)
2173 if(grib==
"grib2")
then
2175 fld_info(cfld)%ifld=iavblfld(iget(267))
2176 fld_info(cfld)%lvl=lvlsxml(l,iget(267))
2181 datapd(i,j,cfld) = grid1(i,jj)
2192 if (aqfcmaq_on)
then
2194 IF (iget(994)>0)
THEN
2195 IF (lvls(l,iget(994))>0)
THEN
2200 grid1(i,j) = ozcon(i,j,ll)*1000.
2204 if(grib==
"grib2")
then
2206 fld_info(cfld)%ifld=iavblfld(iget(994))
2207 fld_info(cfld)%lvl=lvlsxml(l,iget(994))
2212 datapd(i,j,cfld) = grid1(i,jj)
2222 IF (iget(995)>0)
THEN
2223 IF (lvls(l,iget(995))>0)
THEN
2228 dens=pmid(i,j,ll)/(rd*t(i,j,ll)*(q(i,j,ll)*d608+1.0))
2229 grid1(i,j) = pmtf(i,j,ll)*dens
2233 if(grib==
"grib2")
then
2235 fld_info(cfld)%ifld=iavblfld(iget(995))
2236 fld_info(cfld)%lvl=lvlsxml(l,iget(995))
2241 datapd(i,j,cfld) = grid1(i,jj)
2255 IF (iget(737)>0)
THEN
2256 IF (lvls(l,iget(737))>0)
THEN
2261 IF(pmid(i,j,ll)<spval.and.t(i,j,ll)<spval.and.smoke(i,j,ll,1)<spval)
THEN
2262 grid1(i,j) = (1./rd)*(pmid(i,j,ll)/t(i,j,ll))*smoke(i,j,ll,1)
2268 if(grib==
"grib2")
then
2270 fld_info(cfld)%ifld=iavblfld(iget(737))
2271 fld_info(cfld)%lvl=lvlsxml(l,iget(737))
2276 datapd(i,j,cfld) = grid1(i,jj)
2284 IF (iget(629)>0)
THEN
2285 IF (lvls(l,iget(629))>0)
THEN
2290 IF(dust(i,j,ll,1)<spval.and.rhomid(i,j,ll)<spval)
THEN
2292 grid1(i,j) = dust(i,j,ll,1)*rhomid(i,j,ll)
2298 if(grib==
"grib2")
then
2300 fld_info(cfld)%ifld=iavblfld(iget(629))
2301 fld_info(cfld)%lvl=lvlsxml(l,iget(629))
2306 datapd(i,j,cfld) = grid1(i,jj)
2314 IF (iget(630)>0)
THEN
2315 IF (lvls(l,iget(630))>0)
THEN
2320 IF(dust(i,j,ll,2)<spval.and.rhomid(i,j,ll)<spval)
THEN
2322 grid1(i,j) = dust(i,j,ll,2)*rhomid(i,j,ll)
2328 if(grib==
"grib2")
then
2330 fld_info(cfld)%ifld=iavblfld(iget(630))
2331 fld_info(cfld)%lvl=lvlsxml(l,iget(630))
2336 datapd(i,j,cfld) = grid1(i,jj)
2344 IF (iget(631)>0)
THEN
2345 IF (lvls(l,iget(631))>0)
THEN
2350 IF(dust(i,j,ll,3)<spval.and.rhomid(i,j,ll)<spval)
THEN
2352 grid1(i,j) = dust(i,j,ll,3)*rhomid(i,j,ll)
2358 if(grib==
"grib2")
then
2360 fld_info(cfld)%ifld=iavblfld(iget(631))
2361 fld_info(cfld)%lvl=lvlsxml(l,iget(631))
2366 datapd(i,j,cfld) = grid1(i,jj)
2374 IF (iget(632)>0)
THEN
2375 IF (lvls(l,iget(632))>0)
THEN
2380 IF(dust(i,j,ll,4)<spval.and.rhomid(i,j,ll)<spval)
THEN
2382 grid1(i,j) = dust(i,j,ll,4)*rhomid(i,j,ll)
2388 if(grib==
"grib2")
then
2390 fld_info(cfld)%ifld=iavblfld(iget(632))
2391 fld_info(cfld)%lvl=lvlsxml(l,iget(632))
2396 datapd(i,j,cfld) = grid1(i,jj)
2404 IF (iget(633)>0)
THEN
2405 IF (lvls(l,iget(633))>0)
THEN
2410 IF(dust(i,j,ll,5)<spval.and.rhomid(i,j,ll)<spval)
THEN
2412 grid1(i,j) = dust(i,j,ll,5)*rhomid(i,j,ll)
2418 if(grib==
"grib2")
then
2420 fld_info(cfld)%ifld=iavblfld(iget(633))
2421 fld_info(cfld)%lvl=lvlsxml(l,iget(633))
2426 datapd(i,j,cfld) = grid1(i,jj)
2434 IF (iget(634)>0)
THEN
2435 IF (lvls(l,iget(634))>0)
THEN
2440 IF(salt(i,j,ll,1)<spval.and.rhomid(i,j,ll)<spval)
THEN
2441 grid1(i,j) = salt(i,j,ll,1)*rhomid(i,j,ll)
2447 if(grib==
"grib2")
then
2449 fld_info(cfld)%ifld=iavblfld(iget(634))
2450 fld_info(cfld)%lvl=lvlsxml(l,iget(634))
2455 datapd(i,j,cfld) = grid1(i,jj)
2463 IF (iget(635)>0)
THEN
2464 IF (lvls(l,iget(635))>0)
THEN
2469 IF(salt(i,j,ll,2)<spval.and.rhomid(i,j,ll)<spval)
THEN
2470 grid1(i,j) = salt(i,j,ll,2)*rhomid(i,j,ll)
2476 if(grib==
"grib2")
then
2478 fld_info(cfld)%ifld=iavblfld(iget(635))
2479 fld_info(cfld)%lvl=lvlsxml(l,iget(635))
2484 datapd(i,j,cfld) = grid1(i,jj)
2492 IF (iget(636)>0)
THEN
2493 IF (lvls(l,iget(636))>0)
THEN
2498 IF(salt(i,j,ll,3)<spval.and.rhomid(i,j,ll)<spval)
THEN
2499 grid1(i,j) = salt(i,j,ll,3)*rhomid(i,j,ll)
2505 if(grib==
"grib2")
then
2507 fld_info(cfld)%ifld=iavblfld(iget(636))
2508 fld_info(cfld)%lvl=lvlsxml(l,iget(636))
2513 datapd(i,j,cfld) = grid1(i,jj)
2521 IF (iget(637)>0)
THEN
2522 IF (lvls(l,iget(637))>0)
THEN
2527 IF(salt(i,j,ll,4)<spval.and.rhomid(i,j,ll)<spval)
THEN
2528 grid1(i,j) = salt(i,j,ll,4)*rhomid(i,j,ll)
2534 if(grib==
"grib2")
then
2536 fld_info(cfld)%ifld=iavblfld(iget(637))
2537 fld_info(cfld)%lvl=lvlsxml(l,iget(637))
2542 datapd(i,j,cfld) = grid1(i,jj)
2550 IF (iget(638)>0)
THEN
2551 IF (lvls(l,iget(638))>0)
THEN
2556 IF(salt(i,j,ll,5)<spval.and.rhomid(i,j,ll)<spval)
THEN
2557 grid1(i,j) = salt(i,j,ll,5)*rhomid(i,j,ll)
2563 if(grib==
"grib2")
then
2565 fld_info(cfld)%ifld=iavblfld(iget(638))
2566 fld_info(cfld)%lvl=lvlsxml(l,iget(638))
2571 datapd(i,j,cfld) = grid1(i,jj)
2579 IF (iget(639)>0)
THEN
2580 IF (lvls(l,iget(639))>0)
THEN
2585 IF(suso(i,j,ll,1)<spval.and.rhomid(i,j,ll)<spval)
THEN
2587 grid1(i,j) = suso(i,j,ll,1)*rhomid(i,j,ll)
2593 if(grib==
"grib2")
then
2595 fld_info(cfld)%ifld=iavblfld(iget(639))
2596 fld_info(cfld)%lvl=lvlsxml(l,iget(639))
2601 datapd(i,j,cfld) = grid1(i,jj)
2609 IF (iget(640)>0)
THEN
2610 IF (lvls(l,iget(640))>0)
THEN
2615 IF(waso(i,j,ll,1)<spval.and.rhomid(i,j,ll)<spval)
THEN
2617 grid1(i,j) = waso(i,j,ll,1)*rhomid(i,j,ll)
2623 if(grib==
"grib2")
then
2625 fld_info(cfld)%ifld=iavblfld(iget(640))
2626 fld_info(cfld)%lvl=lvlsxml(l,iget(640))
2631 datapd(i,j,cfld) = grid1(i,jj)
2639 IF (iget(641)>0)
THEN
2640 IF (lvls(l,iget(641))>0)
THEN
2645 IF(waso(i,j,ll,2)<spval.and.rhomid(i,j,ll)<spval)
THEN
2647 grid1(i,j) = waso(i,j,ll,2)*rhomid(i,j,ll)
2653 if(grib==
"grib2")
then
2655 fld_info(cfld)%ifld=iavblfld(iget(641))
2656 fld_info(cfld)%lvl=lvlsxml(l,iget(641))
2661 datapd(i,j,cfld) = grid1(i,jj)
2669 IF (iget(642)>0)
THEN
2670 IF (lvls(l,iget(642))>0)
THEN
2675 IF(soot(i,j,ll,1)<spval.and.rhomid(i,j,ll)<spval)
THEN
2677 grid1(i,j) = soot(i,j,ll,1)*rhomid(i,j,ll)
2683 if(grib==
"grib2")
then
2685 fld_info(cfld)%ifld=iavblfld(iget(642))
2686 fld_info(cfld)%lvl=lvlsxml(l,iget(642))
2691 datapd(i,j,cfld) = grid1(i,jj)
2699 IF (iget(643)>0)
THEN
2700 IF (lvls(l,iget(643))>0)
THEN
2705 IF(soot(i,j,ll,2)<spval.and.rhomid(i,j,ll)<spval)
THEN
2707 grid1(i,j) = soot(i,j,ll,2)*rhomid(i,j,ll)
2713 if(grib==
"grib2")
then
2715 fld_info(cfld)%ifld=iavblfld(iget(643))
2716 fld_info(cfld)%lvl=lvlsxml(l,iget(643))
2721 datapd(i,j,cfld) = grid1(i,jj)
2729 IF (iget(644)>0)
THEN
2730 IF (lvls(l,iget(644))>0)
THEN
2735 grid1(i,j) = rhomid(i,j,ll)
2738 if(grib==
"grib2")
then
2740 fld_info(cfld)%ifld=iavblfld(iget(644))
2741 fld_info(cfld)%lvl=lvlsxml(l,iget(644))
2746 datapd(i,j,cfld) = grid1(i,jj)
2754 IF (iget(645)>0)
THEN
2755 IF (lvls(l,iget(645))>0)
THEN
2760 grid1(i,j) = dpres(i,j,ll)
2763 if(grib==
"grib2")
then
2765 fld_info(cfld)%ifld=iavblfld(iget(645))
2766 fld_info(cfld)%lvl=lvlsxml(l,iget(645))
2771 datapd(i,j,cfld) = grid1(i,jj)
2852 IF (iget(252) > 0)
THEN
2853 IF(imp_physics /= 8 .and. imp_physics /= 28)
THEN
2858 DO l=1,nint(lmh(i,j))
2859 grid1(i,j) = max( grid1(i,j), dbz(i,j,l) )
2869 IF(imp_physics == 8 .or. imp_physics == 28)
THEN
2871 IF(modelname==
'NMM' .and. gridtype==
'B' .or. &
2872 modelname==
'NCAR'.or. modelname==
'FV3R' .or. &
2873 modelname==
'NMM' .and. gridtype==
'E')
THEN
2878 DO l=1,nint(lmh(i,j))
2879 grid1(i,j) = max( grid1(i,j), ref_10cm(i,j,l) )
2887 grid1(i,j) = refc_10cm(i,j)
2891 CALL bound(grid1,dbzmin,dbzmax)
2896 grid1(i,j) = refl(i,j)
2902 if(grib==
"grib2")
then
2904 fld_info(cfld)%ifld=iavblfld(iget(252))
2909 datapd(i,j,cfld) = grid1(i,jj)
2918 IF (iget(581)>0)
THEN
2922 DO l=1,nint(lmh(i,j))
2923 if(zint(i,j,l) < spval .and.zint(i,j,l+1)<spval.and.dbz(i,j,l)<spval)
then
2924 grid1(i,j)=grid1(i,j)+0.00344* &
2925 (10.**(dbz(i,j,l)/10.))**0.57143*(zint(i,j,l)-zint(i,j,l+1))/1000.
2930 if(grib==
"grib2")
then
2932 fld_info(cfld)%ifld=iavblfld(iget(581))
2937 datapd(i,j,cfld) = grid1(i,jj)
2945 IF (iget(276)>0)
THEN
2949 DO l=1,nint(lmh(i,j))
2950 grid1(i,j)=max( grid1(i,j), dbzr(i,j,l) )
2954 if(grib==
"grib2")
then
2956 fld_info(cfld)%ifld=iavblfld(iget(276))
2961 datapd(i,j,cfld) = grid1(i,jj)
2970 IF (iget(277)>0)
THEN
2974 DO l=1,nint(lmh(i,j))
2975 grid1(i,j)=max( grid1(i,j), dbzi(i,j,l) )
2979 if(grib==
"grib2")
then
2981 fld_info(cfld)%ifld=iavblfld(iget(277))
2986 datapd(i,j,cfld) = grid1(i,jj)
2997 IF (iget(278)>0)
THEN
3001 DO l=1,nint(lmh(i,j))
3002 grid1(i,j)=max( grid1(i,j), dbzc(i,j,l) )
3006 if(grib==
"grib2")
then
3008 fld_info(cfld)%ifld=iavblfld(iget(278))
3013 datapd(i,j,cfld) = grid1(i,jj)
3023 IF (iget(426)>0)
THEN
3027 DO l=1,nint(lmh(i,j))
3028 IF (dbz(i,j,l)>=18.0)
THEN
3029 grid1(i,j)=zmid(i,j,l)*3.2808/1000.
3035 if(grib==
"grib2")
then
3037 fld_info(cfld)%ifld=iavblfld(iget(426))
3042 datapd(i,j,cfld) = grid1(i,jj)
3057 IF (iget(768) > 0)
THEN
3058 IF(modelname ==
'RAPR' .AND. (imp_physics == 8 .or. imp_physics == 28))
THEN
3062 DO l=1,nint(lmh(i,j))
3063 IF (ref_10cm(i,j,l)>=18.0)
THEN
3064 grid1(i,j)=zmid(i,j,l)
3068 IF(grid1(i,j) >= -900)
THEN
3069 DO l=1,nint(lmh(i,j))
3070 IF (ref_10cm(i,j,l) >= 11.0)
THEN
3072 grid1(i,j) = zmid(i,j,l)
3073 ELSE IF(ref_10cm(i,j,l-1) == ref_10cm(i,j,l))
THEN
3074 grid1(i,j) = zmid(i,j,l)
3076 grid1(i,j) = zmid(i,j,l) + &
3077 (11.0 - ref_10cm(i,j,l)) * &
3078 (zmid(i,j,l-1) - zmid(i,j,l)) / &
3079 (ref_10cm(i,j,l-1) - ref_10cm(i,j,l))
3091 DO l=1,nint(lmh(i,j))
3092 IF (dbz(i,j,l) >= 18.0)
THEN
3093 grid1(i,j) = zmid(i,j,l)
3100 if(grib==
"grib2")
then
3102 fld_info(cfld)%ifld=iavblfld(iget(768))
3107 datapd(i,j,cfld) = grid1(i,jj)
3115 IF (iget(769)>0)
THEN
3119 DO l=1,nint(lmh(i,j))
3120 IF(qqr(i,j,l)<spval.and.qqs(i,j,l)<spval.and.qqg(i,j,l)<spval.and.&
3121 zint(i,j,l)<spval.and.zint(i,j,l+1)<spval.and.&
3122 pmid(i,j,l)<spval.and.t(i,j,l)<spval.and.q(i,j,l)<spval)
THEN
3123 grid1(i,j)=grid1(i,j) + (qqr(i,j,l) + &
3124 qqs(i,j,l) + qqg(i,j,l))* &
3125 (zint(i,j,l)-zint(i,j,l+1))*pmid(i,j,l)/ &
3126 (rd*t(i,j,l)*(q(i,j,l)*d608+1.0))
3133 if(grib==
"grib2")
then
3135 fld_info(cfld)%ifld=iavblfld(iget(769))
3140 datapd(i,j,cfld) = grid1(i,jj)
3150 IF (iget(770) > 0)
THEN
3151 IF(modelname ==
'RAPR' .AND. (imp_physics == 8 .or. imp_physics == 28))
THEN
3155 DO l=1,nint(lmh(i,j))
3156 IF (ref_10cm(i,j,l) > -10.0 )
THEN
3157 grid1(i,j) = grid1(i,j) + 0.00344 * &
3158 (10.**(ref_10cm(i,j,l)/10.))**0.57143 * &
3159 (zint(i,j,l)-zint(i,j,l+1))/1000.
3168 DO l=1,nint(lmh(i,j))
3169 grid1(i,j) = grid1(i,j) + 0.00344 * &
3170 (10.**(dbz(i,j,l)/10.))**0.57143 * &
3171 (zint(i,j,l)-zint(i,j,l+1))/1000.
3176 if(grib==
"grib2")
then
3178 fld_info(cfld)%ifld=iavblfld(iget(770))
3183 datapd(i,j,cfld) = grid1(i,jj)
3193 IF (iget(180)>0)
THEN
3201 q1d(i,j)=q(i,j,llmh)
3202 if(q1d(i,j)<=0.) q1d(i,j)=0.
3203 qw1(i,j)=qqw(i,j,llmh)
3204 qr1(i,j)=qqr(i,j,llmh)
3205 qi1(i,j)=qqi(i,j,llmh)
3206 qs1(i,j)=qqs(i,j,llmh)
3207 qg1(i,j)=qqg(i,j,llmh)
3208 t1d(i,j)=t(i,j,llmh)
3209 p1d(i,j)=pmid(i,j,llmh)
3215 IF(imp_physics/=99)
THEN
3216 IF (cprate(i,j) > 0. .and. cprate(i,j) < spval &
3217 .and. pmid(i,j,lm) < spval .and. qr1(i,j) < spval)
THEN
3219 rainrate=(1-sr(i,j))*cprate(i,j)*rdtphs
3221 term1=(t(i,j,lm)/pmid(i,j,lm))**0.4167
3222 term2=(t1d(i,j)/p1d(i,j))**0.5833
3223 term3=rainrate**0.8333
3225 qr1(i,j)=qr1(i,j)+raincon*term1*term2*term3
3226 IF (sr(i,j) > 0. .and. qs1(i,j) < spval)
THEN
3227 snorate=sr(i,j)*cprate(i,j)*rdtphs
3229 term1=(t(i,j,lm)/pmid(i,j,lm))**0.47
3230 term2=(t1d(i,j)/p1d(i,j))**0.53
3232 qs1(i,j)=qs1(i,j)+snocon*term1*term2*term3
3241 IF (prec(i,j) < spval .and. prec(i,j) > 0. .and. &
3244 rainrate=(1-sr(i,j))*prec(i,j)*rdtphs
3246 term1=(t(i,j,lm)/pmid(i,j,lm))**0.4167
3247 term2=(t1d(i,j)/p1d(i,j))**0.5833
3248 term3=rainrate**0.8333
3250 qr1(i,j)=qr1(i,j)+raincon*term1*term2*term3
3251 IF (sr(i,j) > 0.)
THEN
3252 snorate=sr(i,j)*prec(i,j)*rdtphs
3254 term1=(t(i,j,lm)/pmid(i,j,lm))**0.47
3255 term2=(t1d(i,j)/p1d(i,j))**0.53
3257 qs1(i,j)=qs1(i,j)+snocon*term1*term2*term3
3272 CALL calvis(q1d,qw1,qr1,qi1,qs1,t1d,p1d,vis)
3280 IF(vis(i,j)/=spval.and.abs(vis(i,j))>24135.1)print*,
'bad visbility' &
3281 , i,j,q1d(i,j),qw1(i,j),qr1(i,j),qi1(i,j) &
3282 , qs1(i,j),t1d(i,j),p1d(i,j),vis(i,j)
3287 if(grib==
"grib2")
then
3289 fld_info(cfld)%ifld=iavblfld(iget(180))
3290 fld_info(cfld)%lvl=lvlsxml(1,iget(180))
3291 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3298 IF (iget(410)>0)
THEN
3299 CALL calvis_gsd(czen,vis)
3305 if(grib==
"grib2")
then
3307 fld_info(cfld)%ifld=iavblfld(iget(410))
3308 fld_info(cfld)%lvl=lvlsxml(1,iget(410))
3309 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3315 IF (iget(748) > 0)
THEN
3320 IF(modelname ==
'RAPR' .AND. (imp_physics == 8 .or. imp_physics == 28))
THEN
3325 grid1(i,j) = ref1km_10cm(i,j)
3328 CALL bound(grid1,dbzmin,dbzmax)
3333 grid1(i,j) = refl1km(i,j)
3339 if(grib==
"grib2")
then
3341 fld_info(cfld)%ifld=iavblfld(iget(748))
3342 fld_info(cfld)%lvl=lvlsxml(1,iget(748))
3343 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3350 IF (iget(757) > 0)
THEN
3355 IF(modelname ==
'RAPR' .AND. (imp_physics == 8 .or. imp_physics == 28))
THEN
3359 grid1(i,j) = ref4km_10cm(i,j)
3362 CALL bound(grid1,dbzmin,dbzmax)
3367 grid1(i,j) = refl4km(i,j)
3373 if(grib==
"grib2")
then
3375 fld_info(cfld)%ifld=iavblfld(iget(757))
3376 fld_info(cfld)%lvl=lvlsxml(1,iget(757))
3377 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3382 IF (iget(912)>0)
THEN
3387 if (slp(i,j) < spval)
then
3388 zm10c(i,j)=zmid(i,j,nint(lmh(i,j)))
3389 DO l=nint(lmh(i,j)),1,-1
3390 IF (t(i,j,l) <= 263.15)
THEN
3406 IF(imp_physics==8 .or. imp_physics==28)
THEN
3412 if (slp(i,j) < spval)
then
3413 grid1(i,j)=ref_10cm(i,j,zm10c(i,j))
3423 if (slp(i,j) < spval)
then
3424 grid1(i,j)=dbz(i,j,zm10c(i,j))
3430 CALL bound(grid1,dbzmin,dbzmax)
3432 if(grib==
"grib2" )
then
3434 fld_info(cfld)%ifld=iavblfld(iget(912))
3435 fld_info(cfld)%lvl=lvlsxml(l,iget(912))
3436 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3443 IF ( (iget(111)>0) .OR. (iget(146)>0) .OR. &
3444 (iget(147)>0) )
THEN
3447 CALL clmax(el0(1,jsta),egrid2(1,jsta),egrid3(1,jsta),egrid4(1,jsta),egrid5(1,jsta))
3450 IF (iget(147)>0)
THEN
3454 grid1(i,j) = el0(i,j)
3457 if(grib==
"grib2")
then
3459 fld_info(cfld)%ifld=iavblfld(iget(147))
3460 datapd(1:im,1:jend-jsta+1,cfld)=grid1(1:im,jsta:jend)
3467 IF ( (iget(111)>0) .OR. (iget(146)>0) )
THEN
3479 IF(modelname ==
'NCAR'.OR.modelname==
'RSM'.OR. modelname ==
'RAPR')
THEN
3481 ELSE IF(modelname ==
'NMM')
THEN
3485 el(i,j,l)=el_pbl(i,j,l)
3493 IF ( (iget(111)>0) ) CALL calrch(el,richno)
3500 IF (iget(146)>0)
THEN
3503 IF (lvls(l,iget(146))>0)
THEN
3508 grid1(i,j) = el(i,j,ll)
3511 if(grib==
"grib2")
then
3513 fld_info(cfld)%ifld=iavblfld(iget(146))
3514 fld_info(cfld)%lvl=lvlsxml(l,iget(146))
3519 datapd(i,j,cfld) = grid1(i,jj)
3529 IF (iget(111)>0)
THEN
3530 IF (lvls(l,iget(111))>0)
THEN
3535 grid1(i,j) = richno(i,j,ll)
3538 if(grib==
"grib2")
then
3540 fld_info(cfld)%ifld=iavblfld(iget(111))
3541 fld_info(cfld)%lvl=lvlsxml(l,iget(111))
3546 datapd(i,j,cfld) = grid1(i,jj)
3562 IF ( (iget(289)>0) .OR. (iget(389)>0) .OR. (iget(454)>0) &
3563 .OR. (iget(245)>0) .or. iget(464)>0 .or. iget(467)>0 &
3564 .or. iget(470)>0 )
THEN
3568 IF(modelname ==
'GFS')
THEN
3575 IF (iget(289) > 0)
THEN
3579 grid1(i,j) = pblri(i,j)
3583 if(grib==
"grib2")
then
3585 fld_info(cfld)%ifld=iavblfld(iget(289))
3590 datapd(i,j,cfld) = grid1(i,jj)
3600 IF ( (iget(389) > 0) .OR. (iget(454) > 0) )
THEN
3604 IF(pblri(i,j)<spval.and.zint(i,j,lm+1)<spval)
THEN
3605 egrid3(i,j) = pblri(i,j) + zint(i,j,lm+1)
3612 CALL h2u(egrid3(1:im,jsta_2l:jend_2u),egrid4)
3620 vert_loopu:
DO l=lm,1,-1
3621 CALL h2u(zmid(1:im,jsta_2l:jend_2u,l), egrid5)
3622 CALL h2u(pint(1:im,jsta_2l:jend_2u,l+1),egrid6)
3623 CALL h2u(pint(1:im,jsta_2l:jend_2u,l), egrid7)
3627 if (egrid4(i,j)<spval.and.egrid5(i,j)<spval.and.&
3628 egrid6(i,j)<spval.and.egrid7(i,j)<spval.and.&
3629 uh(i,j,1)<spval)
THEN
3630 if (egrid5(i,j) <= egrid4(i,j))
then
3635 dp = egrid6(i,j) - egrid7(i,j)
3636 egrid1(i,j) = egrid1(i,j) + uh(i,j,l)*dp
3637 egrid2(i,j) = egrid2(i,j) + dp
3644 if(hcount < 1 )
exit vert_loopu
3649 IF(egrid2(i,j) > 0.)
THEN
3650 grid1(i,j) = egrid1(i,j)/egrid2(i,j)
3652 grid1(i,j) = u10(i,j)
3657 CALL h2v(egrid3(1:im,jsta_2l:jend_2u),egrid4)
3668 vert_loopv:
DO l=lm,1,-1
3669 CALL h2v(zmid(1:im,jsta_2l:jend_2u,l), egrid5)
3670 CALL h2v(pint(1:im,jsta_2l:jend_2u,l+1),egrid6)
3671 CALL h2v(pint(1:im,jsta_2l:jend_2u,l), egrid7)
3675 if (egrid4(i,j)<spval.and.egrid5(i,j)<spval.and.&
3676 egrid6(i,j)<spval.and.egrid7(i,j)<spval.and.&
3677 vh(i,j,1)<spval)
THEN
3678 if (egrid5(i,j) <= egrid4(i,j))
then
3680 dp = egrid6(i,j) - egrid7(i,j)
3681 egrid1(i,j) = egrid1(i,j) + vh(i,j,l)*dp
3682 egrid2(i,j) = egrid2(i,j) + dp
3689 if(hcount<1)
exit vert_loopv
3694 IF(egrid2(i,j) > 0.)
THEN
3695 grid2(i,j) = egrid1(i,j)/egrid2(i,j)
3697 grid2(i,j) = v10(i,j)
3703 CALL u2h(grid1(1,jsta_2l),egrid1)
3704 CALL v2h(grid2(1,jsta_2l),egrid2)
3711 IF (egrid1(i,j)<spval .and. egrid2(i,j)<spval)
THEN
3712 egrid3(i,j) = sqrt((egrid1(i,j)*egrid1(i,j)+egrid2(i,j)*egrid2(i,j)))
3725 IF(iget(389) > 0)
THEN
3726 if(grib==
'grib2')
then
3728 fld_info(cfld)%ifld=iavblfld(iget(389))
3733 datapd(i,j,cfld) = grid1(i,jj)
3737 fld_info(cfld)%ifld=iavblfld(iget(390))
3742 datapd(i,j,cfld) = grid2(i,jj)
3754 IF ( (iget(454) > 0) )
THEN
3761 IF (pblri(i,j) /= spval .and. egrid3(i,j)/=spval)
then
3762 grid1(i,j) = egrid3(i,j)*pblri(i,j)
3776 if(grib==
'grib2')
then
3778 fld_info(cfld)%ifld=iavblfld(iget(454))
3783 datapd(i,j,cfld) = grid1(i,jj)
3792 IF (iget(245)>0 .or. iget(464)>0 .or. iget(467)>0.or. iget(470)>0)
THEN
3793 IF(modelname==
'RAPR')
THEN
3795 if(maptype == 6)
then
3796 if(grib==
'grib2')
then
3797 dxm = (dxval / 360.)*(erad*2.*pi)/1.d6
3802 if(grib ==
'grib2')
then
3806 nsmooth = nint(5.*(13500./dxm))
3807 do j = jsta_2l, jend_2u
3809 grid1(i,j)=pblhgust(i,j)
3812 call allgetherv(grid1)
3814 CALL smooth(grid1,sdummy,im,jm,0.5)
3816 do j = jsta_2l, jend_2u
3818 pblhgust(i,j)=grid1(i,j)
3827 if(zint(i,j,nint(lmh(i,j))+1) <spval)
then
3829 zsfc=zint(i,j,nint(lmh(i,j))+1)
3830 loopl:
DO l=nint(lmh(i,j)),1,-1
3831 IF(modelname==
'RAPR')
THEN
3833 pblhold=pblhgust(i,j)
3838 IF(hgt > pblhold+zsfc)
THEN
3840 IF(lpbl(i,j)>=lp1) lpbl(i,j) = lm
3848 if(lpbl(i,j)<1)print*,
'zero lpbl',i,j,pblri(i,j),lpbl(i,j)
3851 IF(modelname==
'RAPR')
THEN
3852 CALL calgust(lpbl,pblhgust,gust)
3854 CALL calgust(lpbl,pblri,gust)
3856 IF (iget(245)>0)
THEN
3862 grid1(i,j) = gust(i,j)
3865 if(grib==
'grib2')
then
3867 fld_info(cfld)%ifld=iavblfld(iget(245))
3872 datapd(i,j,cfld) = grid1(i,jj)
3882 IF (iget(344)>0)
THEN
3883 allocate(pblregime(im,jsta_2l:jend_2u))
3884 CALL calpblregime(pblregime)
3888 grid1(i,j) = pblregime(i,j)
3891 if(grib==
"grib2")
then
3893 fld_info(cfld)%ifld=iavblfld(iget(344))
3898 datapd(i,j,cfld) = grid1(i,jj)
3902 deallocate(pblregime)
3914 IF(imp_physics == 8.)
then
3915 DO l=1,nint(lmh(i,j))
3916 IF(ref_10cm(i,j,l) > 18.3)
then
3917 grid1(i,j) = zmid(i,j,l)
3922 DO l=1,nint(lmh(i,j))
3923 IF(dbz(i,j,l) > 18.3)
then
3924 grid1(i,j) = zmid(i,j,l)
3934 if(grib==
"grib2")
then
3936 fld_info(cfld)%ifld=iavblfld(iget(400))
3941 datapd(i,j,cfld) = grid1(i,jj)
3949 IF(iget(464)>0 .or. iget(467)>0 .or. iget(470)>0)
THEN
3958 call gtg_algo(im,jm,lm,jsta,jend,jsta_2l,jend_2u,&
3959 uh,vh,wh,zmid,pmid,t,q,qqw,qqr,qqs,qqg,qqi,&
3960 zint(1:im,jsta_2l:jend_2u,lp1),pblh,sfcshx,sfclhx,ustar,&
3961 z0,gdlat,gdlon,dx,dy,u10,v10,gust,avgprec,sm,sice,catedr,mwt,el,gtg,richno,item)
3971 IF (iget(470)>0)
THEN
3973 IF (lvls(l,iget(470))>0)
THEN
3977 grid1(i,j)=gtg(i,j,ll)
3980 if(grib==
"grib2")
then
3982 fld_info(cfld)%ifld=iavblfld(iget(470))
3983 fld_info(cfld)%lvl=lvlsxml(l,iget(470))
3988 datapd(i,j,cfld) = grid1(i,jj)
3996 grid1(i,j)=catedr(i,j,ll)
3999 if(grib==
"grib2")
then
4001 fld_info(cfld)%ifld=iavblfld(iget(471))
4002 fld_info(cfld)%lvl=lvlsxml(l,iget(471))
4007 datapd(i,j,cfld) = grid1(i,jj)
4014 grid1(i,j)=mwt(i,j,ll)
4017 if(grib==
"grib2")
then
4019 fld_info(cfld)%ifld=iavblfld(iget(472))
4020 fld_info(cfld)%lvl=lvlsxml(l,iget(472))
4025 datapd(i,j,cfld) = grid1(i,jj)
4035 IF(iget(450)>0 .or. iget(480)>0)
THEN
4042 CALL calcape(itype,dpbnd,dummy,dummy,dummy,idummy,cape,cin, &
4049 if(debugprint .and. i==50 .and. j==jsta .and. me == 0)
then
4050 print*,
'sending input to FIP ',i,j,lm,gdlat(i,j),gdlon(i,j), &
4051 zint(i,j,lp1),cprate(i,j),prec(i,j),avgcprate(i,j),cape(i,j),cin(i,j)
4053 if(debugprint)print*,
'l,P,T,RH,CWM,QQW,QQI,QQR,QQS,QQG,OMEG',&
4054 l,pmid(i,j,l),t(i,j,l),rh3d(i,j,l),cwm(i,j,l), &
4055 q(i,j,l),qqw(i,j,l),qqi(i,j,l), &
4056 qqr(i,j,l),qqs(i,j,l),qqg(i,j,l),&
4057 rh3d(i,j,l),zmid(i,j,l),cwm(i,j,l),omga(i,j,l)
4060 CALL icing_algo(i,j,pmid(i,j,1:lm),t(i,j,1:lm),rh3d(i,j,1:lm) &
4061 ,zmid(i,j,1:lm),omga(i,j,1:lm),wh(i,j,1:lm) &
4062 ,q(i,j,1:lm),cwm(i,j,1:lm),qqw(i,j,1:lm),qqi(i,j,1:lm) &
4063 ,qqr(i,j,1:lm),qqs(i,j,1:lm),qqg(i,j,1:lm) &
4064 ,lm,gdlat(i,j),gdlon(i,j),zint(i,j,lp1) &
4065 ,prec(i,j),cprate(i,j),cape(i,j),cin(i,j) &
4066 ,icing_gfip(i,j,1:lm),icing_gfis(i,j,1:lm))
4092 DEALLOCATE(el, richno, pblri)
4093 if (
allocated(rh3d))
deallocate(rh3d)
dvdxdudy() computes dudy, dvdx, uwnd
calcape() computes CAPE/CINS and other storm related variables.