53 use vrbls4d,
only: dust, smoke, fv3dust, coarsepm, ebb
54 use vrbls3d,
only: pint, o3, pmid, t, q, uh, vh, wh, omga, q2, cwm, &
55 qqw, qqi, qqr, qqs, qqg, dbz, f_rimef, ttnd, cfr, &
56 qqnw, qqni, qqnr, rlwtt, rswtt, vdifftt, tcucn, &
57 tcucns, train, vdiffmois, dconvmois, sconvmois,nradtt,&
58 o3vdiff, o3prod, o3tndy, mwpv, unknown, vdiffzacce, &
59 zgdrag, cnvctvmmixing, vdiffmacce, mgdrag, &
60 cnvctummixing, ncnvctcfrac, cnvctumflx, cnvctdetmflx, &
61 cnvctzgdrag, cnvctmgdrag, zmid, zint, pmidv, &
62 cnvctdmflx, icing_gfip, icing_gfis,gtg,cat=>catedr,mwt
63 use vrbls2d,
only: t500,t700,w_up_max,w_dn_max,w_mean,pslp,fis,z1000,z700,&
65 use masks,
only: lmh, sm
66 use physcons_post,
only: con_fvirt, con_rog, con_eps, con_epsm1
67 use params_mod,
only: h1m12, dbzmin, h1, pq0, a2, a3, a4, rhmin, g, &
68 rgamog, rd, d608, gi, erad, pi, small, h100, &
70 use ctlblk_mod,
only: modelname, lp1, me, jsta, jend, lm, spval, spl, &
71 alsl, jend_m, smflag, grib, cfld, fld_info, datapd,&
72 td3d, ifhr, ifmin, im, jm, nbin_du, jsta_2l, &
73 jend_2u, lsm, d3d_on, ioform, nbin_sm, &
74 imp_physics, ista, iend, ista_m, iend_m, ista_2l, &
75 iend_2u, slrutah_on, gtg_on
76 use rqstfld_mod,
only: iget, lvls, id, iavblfld, lvlsxml
77 use gridspec_mod,
only: gridtype, maptype, dxval
78 use upp_physics,
only: fpvsnew, calrh, calvor, calslr_roebber, calslr_uutah
89 real,
parameter:: gammam=-1*gamma,zshul=75.,tvshul=290.66
93 real,
PARAMETER :: CAPA=0.28589641,p1000=1000.e2
94 LOGICAL IOOMG,IOALL, gtg_interpolation
95 real,
dimension(im,jm) :: GRID1, GRID2
96 real,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: FSL, TSL, QSL, OSL, USL, VSL &
97 &, Q2SL, WSL, CFRSL, O3SL, TDSL &
99 &, FSL_OLD, USL_OLD, VSL_OLD &
101 &, ICINGFSL, ICINGVSL
102 REAL,
allocatable :: D3DSL(:,:,:), SMOKESL(:,:,:), FV3DUSTSL(:,:,:) &
103 &, COARSEPMSL(:,:,:), EBBSL(:,:,:)
104 REAL,
allocatable :: GTGSL(:,:),CATSL(:,:),MWTSL(:,:)
106 integer,
intent(in) :: iostatusD3D
107 INTEGER,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: NL1X, NL1XF
108 real,
dimension(ISTA_2L:IEND_2U,JSTA_2L:JEND_2U,LSM) :: TPRS, QPRS, FPRS
109 real,
dimension(ISTA_2L:IEND_2U,JSTA_2L:JEND_2U,LSM) :: RHPRS
126 REAL,
dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: C1D, QW1, QI1, QR1, QS1, QG1, DBZ1 &
127 , frime, rad, haines, qqnw1, qqni1, qqnr1
132 REAL SAVRH(ista:iend,jsta:jend)
134 integer I,J,L,LP,LL,LLMH,JJB,JJE,II,JJ,LI,IFINCR,ITD3D,istaa,imois,luhi,la
135 real fact,ALPSL,PSFC,QBLO,PNL1,TBLO,TVRL,TVRBLO,FAC,PSLPIJ, &
136 alpth,ahf,pdv,ql,tvu,tvd,gammas,qsat,rhl,zl,tl,pl,es,part,dum1
144 if (modelname ==
'GFS')
then
150 if (.not.
allocated(d3dsl))
allocate(d3dsl(im,jm,27))
160 if (.not.
allocated(smokesl))
allocate(smokesl(im,jm,nbin_sm))
165 smokesl(i,j,l) = spval
169 if (.not.
allocated(fv3dustsl))
allocate(fv3dustsl(im,jm,nbin_sm))
174 fv3dustsl(i,j,l) = spval
178 if (.not.
allocated(coarsepmsl))
allocate(coarsepmsl(im,jm,nbin_sm))
183 coarsepmsl(i,j,l) = spval
187 if (.not.
allocated(ebbsl))
allocate(ebbsl(im,jm,nbin_sm))
198 gtg_interpolation = .false.
199 if (gtg_on .and. (iget(464) > 0 .OR. iget(465) > 0 .OR. &
200 (iget(466) > 0))) gtg_interpolation=.true.
202 if(gtg_interpolation)
then
203 if (.not.
allocated(gtgsl))
allocate(gtgsl(ista_2l:iend_2u,jsta_2l:jend_2u))
204 if (.not.
allocated(catsl))
allocate(catsl(ista_2l:iend_2u,jsta_2l:jend_2u))
205 if (.not.
allocated(mwtsl))
allocate(mwtsl(ista_2l:iend_2u,jsta_2l:jend_2u))
217 IF((iget(012) > 0) .OR. (iget(013) > 0) .OR. &
218 (iget(014) > 0) .OR. (iget(015) > 0) .OR. &
219 (iget(016) > 0) .OR. (iget(017) > 0) .OR. &
220 (iget(018) > 0) .OR. (iget(019) > 0) .OR. &
221 (iget(020) > 0) .OR. (iget(030) > 0) .OR. &
222 (iget(021) > 0) .OR. (iget(022) > 0) .OR. &
223 (iget(023) > 0) .OR. (iget(085) > 0) .OR. &
224 (iget(086) > 0) .OR. (iget(284) > 0) .OR. &
225 (iget(153) > 0) .OR. (iget(166) > 0) .OR. &
226 (iget(183) > 0) .OR. (iget(184) > 0) .OR. &
227 (iget(198) > 0) .OR. (iget(251) > 0) .OR. &
228 (iget(257) > 0) .OR. (iget(258) > 0) .OR. &
229 (iget(294) > 0) .OR. (iget(268) > 0) .OR. &
230 (iget(331) > 0) .OR. (iget(326) > 0) .OR. &
232 (iget(354) > 0) .OR. (iget(355) > 0) .OR. &
233 (iget(356) > 0) .OR. (iget(357) > 0) .OR. &
234 (iget(358) > 0) .OR. (iget(359) > 0) .OR. &
235 (iget(360) > 0) .OR. (iget(361) > 0) .OR. &
236 (iget(362) > 0) .OR. (iget(363) > 0) .OR. &
237 (iget(364) > 0) .OR. (iget(365) > 0) .OR. &
238 (iget(366) > 0) .OR. (iget(367) > 0) .OR. &
239 (iget(368) > 0) .OR. (iget(369) > 0) .OR. &
240 (iget(370) > 0) .OR. (iget(371) > 0) .OR. &
241 (iget(372) > 0) .OR. (iget(373) > 0) .OR. &
242 (iget(374) > 0) .OR. (iget(375) > 0) .OR. &
243 (iget(391) > 0) .OR. (iget(392) > 0) .OR. &
244 (iget(393) > 0) .OR. (iget(394) > 0) .OR. &
245 (iget(395) > 0) .OR. (iget(379) > 0) .OR. &
246 iget(1018) > 0 .OR. iget(1019) > 0 .OR. &
247 iget(1020) > 0 .OR. &
249 (iget(455) > 0) .OR. &
251 (iget(450) > 0) .OR. (iget(480) > 0) .OR. &
252 gtg_interpolation .OR. &
254 (iget(738) > 0) .OR. (iget(743) > 0) .OR. &
255 (modelname ==
'RAPR') .OR.&
257 (iget(030)>0) .OR. (iget(031)>0) .OR. (iget(075)>0))
THEN
267 if(gridtype ==
'B' .or. gridtype ==
'E') &
268 call exch(pint(ista_2l:iend_2u,jsta_2l:jend_2u,lp1))
301 icingfsl(i,j) = spval
302 icingvsl(i,j) = spval
307 if (gtg_interpolation)
then
318 IF(nl1x(i,j) == lp1 .AND. pmid(i,j,l) > spl(lp))
THEN
328 IF(nl1x(i,j) == lp1 .AND. pint(i,j,lp1) > spl(lp))
THEN
334 IF(nl1xf(i,j) == (lp1+1) .AND. pint(i,j,l) > spl(lp))
THEN
364 llmh = nint(lmh(i,j))
368 IF(spl(lp) < pint(i,j,2))
THEN
369 IF(t(i,j,1) < spval) tsl(i,j) = t(i,j,1)
370 IF(q(i,j,1) < spval) qsl(i,j) = q(i,j,1)
372 IF(gridtype ==
'A')
THEN
373 IF(uh(i,j,1) < spval) usl(i,j) = uh(i,j,1)
374 IF(vh(i,j,1) < spval) vsl(i,j) = vh(i,j,1)
380 IF(wh(i,j,1) < spval) wsl(i,j) = wh(i,j,1)
381 IF(omga(i,j,1) < spval) osl(i,j) = omga(i,j,1)
382 IF(q2(i,j,1) < spval) q2sl(i,j) = q2(i,j,1)
383 IF(cwm(i,j,1) < spval) c1d(i,j) = cwm(i,j,1)
384 c1d(i,j) = max(c1d(i,j),zero)
385 IF(qqw(i,j,1) < spval) qw1(i,j) = qqw(i,j,1)
386 qw1(i,j) = max(qw1(i,j),zero)
387 IF(qqi(i,j,1) < spval) qi1(i,j) = qqi(i,j,1)
388 qi1(i,j) = max(qi1(i,j),zero)
389 IF(qqr(i,j,1) < spval) qr1(i,j) = qqr(i,j,1)
390 qr1(i,j) = max(qr1(i,j),zero)
391 IF(qqs(i,j,1) < spval) qs1(i,j) = qqs(i,j,1)
392 qs1(i,j) = max(qs1(i,j),zero)
393 IF(qqg(i,j,1) < spval) qg1(i,j) = qqg(i,j,1)
394 qg1(i,j) = max(qg1(i,j),zero)
395 IF(dbz(i,j,1) < spval) dbz1(i,j) = dbz(i,j,1)
396 dbz1(i,j) = max(dbz1(i,j),dbzmin)
397 IF(f_rimef(i,j,1) < spval) frime(i,j) = f_rimef(i,j,1)
398 frime(i,j) = max(frime(i,j),h1)
399 IF(qqnw(i,j,1) < spval) qqnw1(i,j) = qqnw(i,j,1)
400 qqnw1(i,j) = max(qqnw1(i,j),zero)
401 IF(qqni(i,j,1) < spval) qqni1(i,j) = qqni(i,j,1)
402 qqni1(i,j) = max(qqni1(i,j),zero)
403 IF(qqnr(i,j,1) < spval) qqnr1(i,j) = qqnr(i,j,1)
404 qqnr1(i,j) = max(qqnr1(i,j),zero)
405 IF(ttnd(i,j,1) < spval) rad(i,j) = ttnd(i,j,1)
406 IF(o3(i,j,1) < spval) o3sl(i,j) = o3(i,j,1)
407 IF(cfr(i,j,1) < spval) cfrsl(i,j) = cfr(i,j,1)
409 IF(icing_gfip(i,j,1) < spval) icingfsl(i,j) = icing_gfip(i,j,1)
410 IF(icing_gfis(i,j,1) < spval) icingvsl(i,j) = icing_gfis(i,j,1)
412 if(gtg_interpolation)
then
413 IF(gtg(i,j,1) < spval) gtgsl(i,j) = gtg(i,j,1)
414 IF(cat(i,j,1) < spval) catsl(i,j) = cat(i,j,1)
415 IF(mwt(i,j,1) < spval) mwtsl(i,j) = mwt(i,j,1)
419 IF(smoke(i,j,1,k) < spval) smokesl(i,j,k)=smoke(i,j,1,k)
420 IF(fv3dust(i,j,1,k) < spval) fv3dustsl(i,j,k)=fv3dust(i,j,1,k)
421 IF(coarsepm(i,j,1,k) < spval) coarsepmsl(i,j,k)=coarsepm(i,j,1,k)
422 IF(ebb(i,j,1,k) < spval) ebbsl(i,j,k)=ebb(i,j,1,k)
428 IF((iget(354) > 0) .OR. (iget(355) > 0) .OR. &
429 (iget(356) > 0) .OR. (iget(357) > 0) .OR. &
430 (iget(358) > 0) .OR. (iget(359) > 0) .OR. &
431 (iget(360) > 0) .OR. (iget(361) > 0) .OR. &
432 (iget(362) > 0) .OR. (iget(363) > 0) .OR. &
433 (iget(364) > 0) .OR. (iget(365) > 0) .OR. &
434 (iget(366) > 0) .OR. (iget(367) > 0) .OR. &
435 (iget(368) > 0) .OR. (iget(369) > 0) .OR. &
436 (iget(370) > 0) .OR. (iget(371) > 0) .OR. &
437 (iget(372) > 0) .OR. (iget(373) > 0) .OR. &
438 (iget(374) > 0) .OR. (iget(375) > 0) .OR. &
439 (iget(391) > 0) .OR. (iget(392) > 0) .OR. &
440 (iget(393) > 0) .OR. (iget(394) > 0) .OR. &
441 (iget(395) > 0) .OR. (iget(379) > 0))
THEN
442 d3dsl(i,j,1) = rlwtt(i,j,1)
443 d3dsl(i,j,2) = rswtt(i,j,1)
444 d3dsl(i,j,3) = vdifftt(i,j,1)
445 d3dsl(i,j,4) = tcucn(i,j,1)
446 d3dsl(i,j,5) = tcucns(i,j,1)
447 d3dsl(i,j,6) = train(i,j,1)
448 d3dsl(i,j,7) = vdiffmois(i,j,1)
449 d3dsl(i,j,8) = dconvmois(i,j,1)
450 d3dsl(i,j,9) = sconvmois(i,j,1)
451 d3dsl(i,j,10) = nradtt(i,j,1)
452 d3dsl(i,j,11) = o3vdiff(i,j,1)
453 d3dsl(i,j,12) = o3prod(i,j,1)
454 d3dsl(i,j,13) = o3tndy(i,j,1)
455 d3dsl(i,j,14) = mwpv(i,j,1)
456 d3dsl(i,j,15) = unknown(i,j,1)
457 d3dsl(i,j,16) = vdiffzacce(i,j,1)
458 d3dsl(i,j,17) = zgdrag(i,j,1)
459 d3dsl(i,j,18) = cnvctummixing(i,j,1)
460 d3dsl(i,j,19) = vdiffmacce(i,j,1)
461 d3dsl(i,j,20) = mgdrag(i,j,1)
462 d3dsl(i,j,21) = cnvctvmmixing(i,j,1)
463 d3dsl(i,j,22) = ncnvctcfrac(i,j,1)
464 d3dsl(i,j,23) = cnvctumflx(i,j,1)
465 d3dsl(i,j,24) = cnvctdmflx(i,j,1)
466 d3dsl(i,j,25) = cnvctdetmflx(i,j,1)
467 d3dsl(i,j,26) = cnvctzgdrag(i,j,1)
468 d3dsl(i,j,27) = cnvctmgdrag(i,j,1)
472 ELSE IF(ll <= llmh)
THEN
482 IF (modelname ==
'RAPR' .OR. modelname ==
'NCAR' .OR. modelname ==
'NMM')
THEN
483 fact = (alsl(lp)-log(pmid(i,j,ll)))/ &
484 max(1.e-6,(log(pmid(i,j,ll))-log(pmid(i,j,ll-1))))
485 fact = max(-10.0,min(fact, 10.0))
486 ELSEIF (modelname ==
'GFS' .OR. modelname ==
'FV3R')
THEN
487 fact = (alsl(lp)-log(pmid(i,j,ll)))/ &
488 max(1.e-6,(log(pmid(i,j,ll))-log(pmid(i,j,ll-1))))
489 fact = max(-10.0,min(fact, 10.0))
490 IF ( abs(pmid(i,j,ll)-pmid(i,j,ll-1)) < 0.5 )
THEN
494 fact = (alsl(lp)-log(pmid(i,j,ll)))/ &
495 (log(pmid(i,j,ll))-log(pmid(i,j,ll-1)))
497 IF(t(i,j,ll) < spval .AND. t(i,j,ll-1) < spval) &
498 tsl(i,j) = t(i,j,ll)+(t(i,j,ll)-t(i,j,ll-1))*fact
499 IF(q(i,j,ll) < spval .AND. q(i,j,ll-1) < spval) &
500 qsl(i,j) = q(i,j,ll)+(q(i,j,ll)-q(i,j,ll-1))*fact
502 IF(gridtype==
'A')
THEN
503 IF(uh(i,j,ll) < spval .AND. uh(i,j,ll-1) < spval) &
504 usl(i,j) = uh(i,j,ll)+(uh(i,j,ll)-uh(i,j,ll-1))*fact
505 IF(vh(i,j,ll) < spval .AND. vh(i,j,ll-1) < spval) &
506 vsl(i,j) = vh(i,j,ll)+(vh(i,j,ll)-vh(i,j,ll-1))*fact
509 IF(wh(i,j,ll) < spval .AND. wh(i,j,ll-1) < spval) &
510 wsl(i,j) = wh(i,j,ll)+(wh(i,j,ll)-wh(i,j,ll-1))*fact
511 IF(omga(i,j,ll) < spval .AND. omga(i,j,ll-1) < spval) &
512 osl(i,j) = omga(i,j,ll)+(omga(i,j,ll)-omga(i,j,ll-1))*fact
513 IF(q2(i,j,ll) < spval .AND. q2(i,j,ll-1) < spval) &
514 q2sl(i,j) = q2(i,j,ll)+(q2(i,j,ll)-q2(i,j,ll-1))*fact
520 if (modelname ==
'GFS')
then
521 es = min(fpvsnew(tsl(i,j)), spl(lp))
522 qsat = con_eps*es/(spl(lp)+con_epsm1*es)
524 qsat = pq0/spl(lp)*exp(a2*(tsl(i,j)-a3)/(tsl(i,j)-a4))
527 rhl = max(rhmin, min(1.0, qsl(i,j)/qsat))
534 IF(q2sl(i,j) < 0.0) q2sl(i,j) = 0.0
537 IF(cwm(i,j,ll) < spval .AND. cwm(i,j,ll-1) < spval) &
538 c1d(i,j) = cwm(i,j,ll) + (cwm(i,j,ll)-cwm(i,j,ll-1))*fact
539 c1d(i,j) = max(c1d(i,j),zero)
541 IF(qqw(i,j,ll) < spval .AND. qqw(i,j,ll-1) < spval) &
542 qw1(i,j) = qqw(i,j,ll) + (qqw(i,j,ll)-qqw(i,j,ll-1))*fact
543 qw1(i,j) = max(qw1(i,j),zero)
545 IF(qqi(i,j,ll) < spval .AND. qqi(i,j,ll-1) < spval) &
546 qi1(i,j) = qqi(i,j,ll) + (qqi(i,j,ll)-qqi(i,j,ll-1))*fact
547 qi1(i,j) = max(qi1(i,j),zero)
549 IF(qqr(i,j,ll) < spval .AND. qqr(i,j,ll-1) < spval) &
550 qr1(i,j) = qqr(i,j,ll) + (qqr(i,j,ll)-qqr(i,j,ll-1))*fact
551 qr1(i,j) = max(qr1(i,j),zero)
553 IF(qqs(i,j,ll) < spval .AND. qqs(i,j,ll-1) < spval) &
554 qs1(i,j) = qqs(i,j,ll) + (qqs(i,j,ll)-qqs(i,j,ll-1))*fact
555 qs1(i,j) = max(qs1(i,j),zero)
557 IF(qqg(i,j,ll) < spval .AND. qqg(i,j,ll-1) < spval) &
558 qg1(i,j) = qqg(i,j,ll) + (qqg(i,j,ll)-qqg(i,j,ll-1))*fact
559 qg1(i,j) = max(qg1(i,j),zero)
609 IF (modelname ==
'FV3R' .OR. modelname ==
'GFS')
THEN
610 IF ( tsl(i,j) <= tfrz .AND. &
611 t(i,j,ll-1) <= tfrz .AND. &
612 t(i,j,ll) > tfrz )
THEN
613 IF (qw1(i,j)<spval) qw1(i,j) = max(qqw(i,j,ll-1),zero)
614 IF (qi1(i,j)<spval) qi1(i,j) = max(qqi(i,j,ll-1),zero)
615 IF (qr1(i,j)<spval) qr1(i,j) = max(qqr(i,j,ll-1),zero)
616 IF (qs1(i,j)<spval) qs1(i,j) = max(qqs(i,j,ll-1),qs1(i,j))
617 IF (qg1(i,j)<spval) qg1(i,j) = max(qqg(i,j,ll-1),qg1(i,j))
618 IF (c1d(i,j)<spval) c1d(i,j) = qg1(i,j)+qs1(i,j)+qr1(i,j)+qi1(i,j)+qw1(i,j)
623 IF(dbz(i,j,ll) < spval .AND. dbz(i,j,ll-1) < spval) &
624 dbz1(i,j) = dbz(i,j,ll) + (dbz(i,j,ll)-dbz(i,j,ll-1))*fact
625 dbz1(i,j) = max(dbz1(i,j),dbzmin)
627 IF(f_rimef(i,j,ll) < spval .AND. f_rimef(i,j,ll-1) < spval) &
628 frime(i,j) = f_rimef(i,j,ll) + (f_rimef(i,j,ll) - f_rimef(i,j,ll-1))*fact
629 frime(i,j)=max(frime(i,j),h1)
631 IF(qqni(i,j,ll) < spval .AND. qqni(i,j,ll-1) < spval) &
632 qqni1(i,j) = qqni(i,j,ll) + (qqni(i,j,ll)-qqni(i,j,ll-1))*fact
633 qqni1(i,j) = max(qqni1(i,j),zero)
635 IF(qqnw(i,j,ll) < spval .AND. qqnw(i,j,ll-1) < spval) &
636 qqnw1(i,j) = qqnw(i,j,ll) + (qqnw(i,j,ll)-qqnw(i,j,ll-1))*fact
637 qqnw1(i,j) = max(qqnw1(i,j),zero)
639 IF(qqnr(i,j,ll) < spval .AND. qqnr(i,j,ll-1) < spval) &
640 qqnr1(i,j) = qqnr(i,j,ll) + (qqnr(i,j,ll)-qqnr(i,j,ll-1))*fact
641 qqnr1(i,j) = max(qqnr1(i,j),zero)
643 IF(ttnd(i,j,ll) < spval .AND. ttnd(i,j,ll-1) < spval) &
644 rad(i,j) = ttnd(i,j,ll) + (ttnd(i,j,ll)-ttnd(i,j,ll-1))*fact
646 IF(o3(i,j,ll) < spval .AND. o3(i,j,ll-1) < spval) &
647 o3sl(i,j) = o3(i,j,ll) + (o3(i,j,ll)-o3(i,j,ll-1))*fact
649 IF(cfr(i,j,ll) < spval .AND. cfr(i,j,ll-1) < spval) &
650 cfrsl(i,j) = cfr(i,j,ll) + (cfr(i,j,ll)-cfr(i,j,ll-1))*fact
652 IF(icing_gfip(i,j,ll) < spval .AND. icing_gfip(i,j,ll-1) < spval) &
653 icingfsl(i,j) = icing_gfip(i,j,ll) + (icing_gfip(i,j,ll)-icing_gfip(i,j,ll-1))*fact
654 icingfsl(i,j) = max(0.0, icingfsl(i,j))
655 icingfsl(i,j) = min(1.0, icingfsl(i,j))
656 IF(icing_gfis(i,j,ll) < spval .AND. icing_gfis(i,j,ll-1) < spval) &
657 icingvsl(i,j) = icing_gfis(i,j,ll) + (icing_gfis(i,j,ll)-icing_gfis(i,j,ll-1))*fact
665 if (icingvsl(i,j) < 0.08)
then
667 elseif (icingvsl(i,j) <= 0.21)
then
669 else if(icingvsl(i,j) <= 0.37)
then
671 else if(icingvsl(i,j) <= 0.67)
then
676 if(icingfsl(i,j)< 0.001) icingvsl(i,j) = 0.
678 IF(gtg_interpolation)
then
679 IF(gtg(i,j,ll) < spval .AND. gtg(i,j,ll-1) < spval)
THEN
680 gtgsl(i,j) = gtg(i,j,ll) + (gtg(i,j,ll)-gtg(i,j,ll-1))*fact
681 gtgsl(i,j) = max(0.0, gtgsl(i,j))
682 gtgsl(i,j) = min(1.0, gtgsl(i,j))
684 IF(cat(i,j,ll) < spval .AND. cat(i,j,ll-1) < spval)
THEN
685 catsl(i,j) = cat(i,j,ll) + (cat(i,j,ll)-cat(i,j,ll-1))*fact
686 catsl(i,j) = max(0.0, catsl(i,j))
687 catsl(i,j) = min(1.0, catsl(i,j))
689 IF(mwt(i,j,ll) < spval .AND. mwt(i,j,ll-1) < spval)
THEN
690 mwtsl(i,j) = mwt(i,j,ll) + (mwt(i,j,ll)-mwt(i,j,ll-1))*fact
691 mwtsl(i,j) = max(0.0, mwtsl(i,j))
692 mwtsl(i,j) = min(1.0, mwtsl(i,j))
696 IF(smoke(i,j,ll,k) < spval .AND. smoke(i,j,ll-1,k) < spval) &
697 smokesl(i,j,k)=smoke(i,j,ll,k)+(smoke(i,j,ll,k)-smoke(i,j,ll-1,k))*fact
698 IF(fv3dust(i,j,ll,k) < spval .AND. fv3dust(i,j,ll-1,k) < spval) &
699 fv3dustsl(i,j,k)=fv3dust(i,j,ll,k)+(fv3dust(i,j,ll,k)-fv3dust(i,j,ll-1,k))*fact
700 IF(coarsepm(i,j,ll,k) < spval .AND. coarsepm(i,j,ll-1,k) < spval) &
701 coarsepmsl(i,j,k)=coarsepm(i,j,ll,k)+(coarsepm(i,j,ll,k)-coarsepm(i,j,ll-1,k))*fact
702 IF(ebb(i,j,ll,k) < spval .AND. ebb(i,j,ll-1,k) < spval) &
703 ebbsl(i,j,k)=ebb(i,j,ll,k)+(ebb(i,j,ll,k)-ebb(i,j,ll-1,k))*fact
709 IF((iget(354) > 0) .OR. (iget(355) > 0) .OR. &
710 (iget(356) > 0) .OR. (iget(357) > 0) .OR. &
711 (iget(358) > 0) .OR. (iget(359) > 0) .OR. &
712 (iget(360) > 0) .OR. (iget(361) > 0) .OR. &
713 (iget(362) > 0) .OR. (iget(363) > 0) .OR. &
714 (iget(364) > 0) .OR. (iget(365) > 0) .OR. &
715 (iget(366) > 0) .OR. (iget(367) > 0) .OR. &
716 (iget(368) > 0) .OR. (iget(369) > 0) .OR. &
717 (iget(370) > 0) .OR. (iget(371) > 0) .OR. &
718 (iget(372) > 0) .OR. (iget(373) > 0) .OR. &
719 (iget(374) > 0) .OR. (iget(375) > 0) .OR. &
720 (iget(391) > 0) .OR. (iget(392) > 0) .OR. &
721 (iget(393) > 0) .OR. (iget(394) > 0) .OR. &
722 (iget(395) > 0) .OR. (iget(379) > 0))
THEN
723 d3dsl(i,j,1) = rlwtt(i,j,ll)+(rlwtt(i,j,ll) &
724 - rlwtt(i,j,ll-1))*fact
725 d3dsl(i,j,2) = rswtt(i,j,ll)+(rswtt(i,j,ll) &
726 - rswtt(i,j,ll-1))*fact
727 d3dsl(i,j,3) = vdifftt(i,j,ll)+(vdifftt(i,j,ll) &
728 - vdifftt(i,j,ll-1))*fact
729 d3dsl(i,j,4) = tcucn(i,j,ll)+(tcucn(i,j,ll) &
730 - tcucn(i,j,ll-1))*fact
731 d3dsl(i,j,5) = tcucns(i,j,ll)+(tcucns(i,j,ll) &
732 - tcucns(i,j,ll-1))*fact
733 d3dsl(i,j,6) = train(i,j,ll)+(train(i,j,ll) &
734 - train(i,j,ll-1))*fact
735 d3dsl(i,j,7) = vdiffmois(i,j,ll)+ &
736 (vdiffmois(i,j,ll)-vdiffmois(i,j,ll-1))*fact
737 d3dsl(i,j,8) = dconvmois(i,j,ll)+ &
738 (dconvmois(i,j,ll)-dconvmois(i,j,ll-1))*fact
739 d3dsl(i,j,9) = sconvmois(i,j,ll)+ &
740 (sconvmois(i,j,ll)-sconvmois(i,j,ll-1))*fact
741 d3dsl(i,j,10) = nradtt(i,j,ll)+ &
742 (nradtt(i,j,ll)-nradtt(i,j,ll-1))*fact
743 d3dsl(i,j,11) = o3vdiff(i,j,ll)+ &
744 (o3vdiff(i,j,ll)-o3vdiff(i,j,ll-1))*fact
745 d3dsl(i,j,12) = o3prod(i,j,ll)+ &
746 (o3prod(i,j,ll)-o3prod(i,j,ll-1))*fact
747 d3dsl(i,j,13) = o3tndy(i,j,ll)+ &
748 (o3tndy(i,j,ll)-o3tndy(i,j,ll-1))*fact
749 d3dsl(i,j,14) = mwpv(i,j,ll)+ &
750 (mwpv(i,j,ll)-mwpv(i,j,ll-1))*fact
751 d3dsl(i,j,15) = unknown(i,j,ll)+ &
752 (unknown(i,j,ll)-unknown(i,j,ll-1))*fact
753 d3dsl(i,j,16) = vdiffzacce(i,j,ll)+ &
754 (vdiffzacce(i,j,ll)-vdiffzacce(i,j,ll-1))*fact
755 d3dsl(i,j,17) = zgdrag(i,j,ll)+ &
756 (zgdrag(i,j,ll)-zgdrag(i,j,ll-1))*fact
757 d3dsl(i,j,18) = cnvctummixing(i,j,ll)+ &
758 (cnvctummixing(i,j,ll)-cnvctummixing(i,j,ll-1))*fact
759 d3dsl(i,j,19) = vdiffmacce(i,j,ll)+ &
760 (vdiffmacce(i,j,ll)-vdiffmacce(i,j,ll-1))*fact
761 d3dsl(i,j,20) = mgdrag(i,j,ll)+ &
762 (mgdrag(i,j,ll)-mgdrag(i,j,ll-1))*fact
763 d3dsl(i,j,21) = cnvctvmmixing(i,j,ll)+ &
764 (cnvctvmmixing(i,j,ll)-cnvctvmmixing(i,j,ll-1))*fact
765 d3dsl(i,j,22) = ncnvctcfrac(i,j,ll)+ &
766 (ncnvctcfrac(i,j,ll)-ncnvctcfrac(i,j,ll-1))*fact
767 d3dsl(i,j,23) = cnvctumflx(i,j,ll)+ &
768 (cnvctumflx(i,j,ll)-cnvctumflx(i,j,ll-1))*fact
769 d3dsl(i,j,24) = cnvctdmflx(i,j,ll)+ &
770 (cnvctdmflx(i,j,ll)-cnvctdmflx(i,j,ll-1))*fact
771 d3dsl(i,j,25) = cnvctdetmflx(i,j,ll)+ &
772 (cnvctdetmflx(i,j,ll)-cnvctdetmflx(i,j,ll-1))*fact
773 d3dsl(i,j,26) = cnvctzgdrag(i,j,ll)+ &
774 (cnvctzgdrag(i,j,ll)-cnvctzgdrag(i,j,ll-1))*fact
775 d3dsl(i,j,27) = cnvctmgdrag(i,j,ll)+ &
776 (cnvctmgdrag(i,j,ll)-cnvctmgdrag(i,j,ll-1))*fact
785 IF(modelname ==
'GFS')
THEN
786 tvu = t(i,j,lm) * (1.+con_fvirt*q(i,j,lm))
787 if(zmid(i,j,lm) > zshul)
then
788 tvd = tvu + gamma*zmid(i,j,lm)
789 if(tvd > tvshul)
then
790 if(tvu > tvshul)
then
791 tvd = tvshul - 5.e-3*(tvu-tvshul)*(tvu-tvshul)
796 gammas = (tvu-tvd)/zmid(i,j,lm)
800 part = con_rog*(alsl(lp)-log(pmid(i,j,lm)))
801 fsl(i,j) = zmid(i,j,lm) - tvu*part/(1.+0.5*gammas*part)
803 tsl(i,j) = t(i,j,lm) - gamma*(fsl(i,j)-zmid(i,j,lm))
804 fsl(i,j) = fsl(i,j)*g
808 es = min(fpvsnew(t(i,j,lm)), pmid(i,j,lm))
809 qsat = con_eps*es/(pmid(i,j,lm)+con_epsm1*es)
812 es = min(fpvsnew(tsl(i,j)), spl(lp))
813 qsat = con_eps*es/(spl(lp)+con_epsm1*es)
820 tl = 0.5*(t(i,j,lm-2)+t(i,j,lm-1))
821 ql = 0.5*(q(i,j,lm-2)+q(i,j,lm-1))
831 qsat = pq0/pl*exp(a2*(tl-a3)/(tl-a4))
844 tvrl = tl*(1.+0.608*ql)
845 tvrblo = tvrl*(spl(lp)/pl)**rgamog
846 tblo = tvrblo/(1.+0.608*ql)
857 qsat = pq0/spl(lp)*exp(a2*(tblo-a3)/(tblo-a4))
860 qsl(i,j) = max(1.e-12,qblo)
866 IF(gridtype ==
'A')
THEN
867 usl(i,j) = uh(i,j,llmh)
868 vsl(i,j) = vh(i,j,llmh)
872 wsl(i,j) = wh(i,j,llmh)
873 osl(i,j) = omga(i,j,llmh)
874 q2sl(i,j) = max(0.0,0.5*(q2(i,j,llmh-1)+q2(i,j,llmh)))
915 o3sl(i,j) = o3(i,j,llmh)
916 IF(cfr(i,j,1)<spval)cfrsl(i,j) = 0.
921 IF(modelname ==
'GFS')
then
923 IF(spl(lp) < pmid(i,j,1))
THEN
924 tvd = t(i,j,1)*(1+con_fvirt*q(i,j,1))
925 fsl(i,j) = zmid(i,j,1)-con_rog*tvd *(alsl(lp)-log(pmid(i,j,1)))
926 fsl(i,j) = fsl(i,j)*g
927 ELSE IF(l <= llmh)
THEN
928 tvd = t(i,j,l)*(1+con_fvirt*q(i,j,l))
929 tvu = tsl(i,j)*(1+con_fvirt*qsl(i,j))
930 fsl(i,j) = zmid(i,j,l)-con_rog*0.5*(tvd+tvu) &
931 * (alsl(lp)-log(pmid(i,j,l)))
932 fsl(i,j) = fsl(i,j)*g
936 IF(nl1xf(i,j)<=(llmh+1))
THEN
937 fact = (alsl(lp)-log(pint(i,j,la)))/ &
938 (log(pint(i,j,la))-log(pint(i,j,la-1)))
939 IF(zint(i,j,la) < spval .AND. zint(i,j,la-1) < spval) &
940 fsl(i,j) = zint(i,j,la)+(zint(i,j,la)-zint(i,j,la-1))*fact
941 fsl(i,j) = fsl(i,j)*g
943 fsl(i,j) = fprs(i,j,lp-1)-rd*(tprs(i,j,lp-1) &
944 * (h1+d608*qprs(i,j,lp-1)) &
945 + tsl(i,j)*(h1+d608*qsl(i,j))) &
946 * log(spl(lp)/spl(lp-1))/2.0
959 tprs(i,j,lp) = tsl(i,j)
960 qprs(i,j,lp) = qsl(i,j)
961 fprs(i,j,lp) = fsl(i,j)
967 IF(gridtype ==
'E')
THEN
970 DO i=ista_m,iend-mod(j,2)
1006 IF(nl1x(i,j) == lp1.AND.pmidv(i,j,l) > spl(lp))
THEN
1019 IF(nl1x(i,j) == lp1)
THEN
1020 IF(j == jsta .AND. i < iend)
THEN
1021 pdv = 0.5*(pint(i,j,lp1)+pint(i+1,j,lp1))
1022 ELSE IF(j == jend .AND. i < iend)
THEN
1023 pdv = 0.5*(pint(i,j,lp1)+pint(i+1,j,lp1))
1024 ELSE IF(i == ista .AND. mod(j,2) == 0)
THEN
1025 pdv = 0.5*(pint(i,j-1,lp1)+pint(i,j+1,lp1))
1026 ELSE IF(i == iend .AND. mod(j,2) == 0)
THEN
1027 pdv = 0.5*(pint(i,j-1,lp1)+pint(i,j+1,lp1))
1028 ELSE IF (mod(j,2) < 1)
THEN
1029 pdv = 0.25*(pint(i,j,lp1)+pint(i-1,j,lp1) &
1030 + pint(i,j+1,lp1)+pint(i,j-1,lp1))
1032 pdv = 0.25*(pint(i,j,lp1)+pint(i+1,j,lp1) &
1033 + pint(i,j+1,lp1)+pint(i,j-1,lp1))
1035 IF(pdv > spl(lp))
THEN
1045 DO i=ista,iend-mod(j,2)
1052 llmh = nint(lmh(i,j))
1054 IF(spl(lp) < pint(i,j,2))
THEN
1055 IF(uh(i,j,1) < spval) usl(i,j) = uh(i,j,1)
1056 IF(vh(i,j,1) < spval) vsl(i,j) = vh(i,j,1)
1058 ELSE IF(nl1x(i,j)<=llmh)
THEN
1068 fact = (alsl(lp)-log(pmidv(i,j,ll)))/ &
1069 (log(pmidv(i,j,ll))-log(pmidv(i,j,ll-1)))
1070 IF(uh(i,j,ll) < spval .AND. uh(i,j,ll-1) < spval) &
1071 usl(i,j) = uh(i,j,ll)+(uh(i,j,ll)-uh(i,j,ll-1))*fact
1072 IF(vh(i,j,ll) < spval .AND. vh(i,j,ll-1) < spval) &
1073 vsl(i,j) = vh(i,j,ll)+(vh(i,j,ll)-vh(i,j,ll-1))*fact
1082 IF(uh(i,j,llmh) < spval) usl(i,j) = uh(i,j,llmh)
1083 IF(vh(i,j,llmh) < spval) vsl(i,j) = vh(i,j,llmh)
1090 IF(mod(jsta,2) == 0) jjb = jsta+1
1092 IF(mod(jend,2) == 0) jje = jend-1
1094 usl(iend,j) = usl(iend-1,j)
1095 vsl(iend,j) = vsl(iend-1,j)
1097 ELSE IF(gridtype==
'B')
THEN
1106 IF(nl1x(i,j) == lp1.AND.pmidv(i,j,l) > spl(lp))
THEN
1118 IF(nl1x(i,j)==lp1)
THEN
1119 pdv = 0.25*(pint(i,j,lp1)+pint(i+1,j,lp1) &
1120 + pint(i,j+1,lp1)+pint(i+1,j+1,lp1))
1121 IF(pdv > spl(lp))
THEN
1138 llmh = nint(lmh(i,j))
1140 IF(spl(lp) < pint(i,j,2))
THEN
1141 IF(uh(i,j,1) < spval) usl(i,j) = uh(i,j,1)
1142 IF(vh(i,j,1) < spval) vsl(i,j) = vh(i,j,1)
1144 ELSE IF(nl1x(i,j)<=llmh)
THEN
1154 fact = (alsl(lp)-log(pmidv(i,j,ll)))/ &
1155 (log(pmidv(i,j,ll))-log(pmidv(i,j,ll-1)))
1156 IF(uh(i,j,ll) < spval .AND. uh(i,j,ll-1) < spval) &
1157 usl(i,j)=uh(i,j,ll)+(uh(i,j,ll)-uh(i,j,ll-1))*fact
1158 IF(vh(i,j,ll) < spval .AND. vh(i,j,ll-1) < spval) &
1159 vsl(i,j)=vh(i,j,ll)+(vh(i,j,ll)-vh(i,j,ll-1))*fact
1168 IF(uh(i,j,llmh) < spval)usl(i,j)=uh(i,j,llmh)
1169 IF(vh(i,j,llmh) < spval)vsl(i,j)=vh(i,j,llmh)
1185 IF(nint(spl(lp)) == 50000)
THEN
1189 t500(i,j) = tsl(i,j)
1190 z500(i,j) = fsl(i,j)*gi
1198 IF(nint(spl(lp)) == 70000)
THEN
1202 t700(i,j) = tsl(i,j)
1203 z700(i,j) = fsl(i,j)*gi
1266 IF(iget(012) > 0)
THEN
1267 IF(lvls(lp,iget(012)) > 0)
THEN
1268 IF((iget(023) > 0 .OR. iget(445) > 0) .AND. nint(spl(lp)) == 100000)
THEN
1274 IF(fsl(i,j) < spval)
THEN
1275 grid1(i,j) = fsl(i,j)*gi
1284 if(maptype == 6)
then
1285 if(grib==
'grib2')
then
1286 dxm = (dxval / 360.)*(erad*2.*pi)/1.d6
1291 if(grib ==
'grib2')
then
1295 nsmooth = nint(5.*(13500./dxm))
1296 call allgetherv(grid1)
1298 CALL smooth(grid1,sdummy,im,jm,0.5)
1301 if(grib ==
'grib2')
then
1303 fld_info(cfld)%ifld=iavblfld(iget(012))
1304 fld_info(cfld)%lvl=lvlsxml(lp,iget(012))
1310 datapd(i,j,cfld) = grid1(ii,jj)
1321 IF(iget(013) > 0)
THEN
1322 IF(lvls(lp,iget(013)) > 0)
THEN
1326 grid1(i,j) = tsl(i,j)
1331 nsmooth = nint(3.*(13500./dxm))
1332 call allgetherv(grid1)
1334 CALL smooth(grid1,sdummy,im,jm,0.5)
1338 if(grib ==
'grib2')
then
1340 fld_info(cfld)%ifld = iavblfld(iget(013))
1341 fld_info(cfld)%lvl = lvlsxml(lp,iget(013))
1347 datapd(i,j,cfld) = grid1(ii,jj)
1356 IF(iget(910)>0)
THEN
1357 IF(lvls(lp,iget(910))>0)
THEN
1361 IF(tsl(i,j) < spval .AND. qsl(i,j) < spval)
THEN
1362 grid1(i,j) = tsl(i,j)*(1.+0.608*qsl(i,j))
1370 nsmooth = nint(3.*(13500./dxm))
1371 call allgetherv(grid1)
1373 CALL smooth(grid1,sdummy,im,jm,0.5)
1377 if(grib==
'grib2')
then
1379 fld_info(cfld)%ifld = iavblfld(iget(910))
1380 fld_info(cfld)%lvl = lvlsxml(lp,iget(910))
1386 datapd(i,j,cfld) = grid1(ii,jj)
1396 IF(iget(014) > 0)
THEN
1397 IF(lvls(lp,iget(014)) > 0)
THEN
1399 tem = (p1000/spl(lp)) ** capa
1403 IF(tsl(i,j) < spval)
THEN
1404 grid1(i,j) = tsl(i,j) * tem
1425 if(grib ==
'grib2')
then
1427 fld_info(cfld)%ifld=iavblfld(iget(014))
1428 fld_info(cfld)%lvl=lvlsxml(lp,iget(014))
1434 datapd(i,j,cfld) = grid1(ii,jj)
1444 IF(iget(017) > 0 .OR. iget(257) > 0 .OR. iget(1006) > 0)
THEN
1448 IF(iget(017) > 0.)
then
1449 if(lvls(lp,iget(017)) > 0 ) log1=.true.
1451 IF(iget(257) > 0)
then
1452 if(lvls(lp,iget(257)) > 0 ) log1=.true.
1458 egrid2(i,j) = spl(lp)
1462 CALL calrh(egrid2(ista:iend,jsta:jend),tsl(ista:iend,jsta:jend),qsl(ista:iend,jsta:jend),egrid1(ista:iend,jsta:jend))
1467 IF(egrid1(i,j) < spval)
THEN
1468 grid1(i,j) = egrid1(i,j)*100.
1470 grid1(i,j) = egrid1(i,j)
1476 nsmooth=nint(2.*(13500./dxm))
1477 call allgetherv(grid1)
1479 CALL smooth(grid1,sdummy,im,jm,0.5)
1484 if(grib ==
'grib2')
then
1486 fld_info(cfld)%ifld=iavblfld(iget(017))
1487 fld_info(cfld)%lvl=lvlsxml(lp,iget(017))
1493 datapd(i,j,cfld) = grid1(ii,jj)
1501 savrh(i,j) = grid1(i,j)
1509 rhprs(i,j,lp) = grid1(i,j)
1516 IF(iget(331) > 0)
THEN
1517 IF(lvls(lp,iget(331)) > 0)
THEN
1522 IF(abs(cfrsl(i,j)-spval) > small)
THEN
1523 cfrsl(i,j) = min(max(0.0,cfrsl(i,j)),1.0)
1524 grid1(i,j) = cfrsl(i,j)*h100
1528 if(grib ==
'grib2')
then
1530 fld_info(cfld)%ifld = iavblfld(iget(331))
1531 fld_info(cfld)%lvl = lvlsxml(lp,iget(331))
1537 datapd(i,j,cfld) = grid1(ii,jj)
1546 IF(iget(015) > 0)
THEN
1547 IF(lvls(lp,iget(015)) > 0)
THEN
1551 egrid2(i,j) = spl(lp)
1555 CALL caldwp(egrid2(ista:iend,jsta:jend),qsl(ista:iend,jsta:jend),egrid1(ista:iend,jsta:jend),tsl(ista:iend,jsta:jend))
1559 IF(tsl(i,j) < spval)
THEN
1560 grid1(i,j) = egrid1(i,j)
1566 if(grib ==
'grib2')
then
1568 fld_info(cfld)%ifld=iavblfld(iget(015))
1569 fld_info(cfld)%lvl=lvlsxml(lp,iget(015))
1575 datapd(i,j,cfld) = grid1(ii,jj)
1584 IF(iget(016) > 0)
THEN
1585 IF(lvls(lp,iget(016)) > 0)
THEN
1589 grid1(i,j) = qsl(i,j)
1592 CALL bound(grid1,zero,h99999)
1593 if(grib ==
'grib2')
then
1595 fld_info(cfld)%ifld=iavblfld(iget(016))
1596 fld_info(cfld)%lvl=lvlsxml(lp,iget(016))
1602 datapd(i,j,cfld) = grid1(ii,jj)
1611 IF(iget(020) > 0)
THEN
1612 IF(lvls(lp,iget(020)) > 0)
THEN
1616 grid1(i,j) = osl(i,j)
1620 IF (smflag .or. ioform ==
'binarympiio' )
THEN
1621 call allgetherv(grid1)
1622 if (ioform ==
'binarympiio')
then
1625 CALL smoothc(grid1,sdummy,im,jm,0.5)
1626 CALL smoothc(grid1,sdummy,im,jm,-0.5)
1629 nsmooth = nint(3.*(13500./dxm))
1632 CALL smooth(grid1,sdummy,im,jm,0.5)
1637 if(grib ==
'grib2')
then
1639 fld_info(cfld)%ifld=iavblfld(iget(020))
1640 fld_info(cfld)%lvl=lvlsxml(lp,iget(020))
1646 datapd(i,j,cfld) = grid1(ii,jj)
1655 IF(iget(284) > 0)
THEN
1656 IF(lvls(lp,iget(284)) > 0)
THEN
1660 grid1(i,j) = wsl(i,j)
1663 if(grib ==
'grib2')
then
1665 fld_info(cfld)%ifld=iavblfld(iget(284))
1666 fld_info(cfld)%lvl=lvlsxml(lp,iget(284))
1672 datapd(i,j,cfld) = grid1(ii,jj)
1681 IF(iget(085) > 0)
THEN
1682 IF(lvls(lp,iget(085)) > 0)
THEN
1683 CALL calmcvg(qsl(ista_2l,jsta_2l),usl(ista_2l,jsta_2l),vsl(ista_2l,jsta_2l),egrid1(ista_2l,jsta_2l))
1688 grid1(i,j) = egrid1(i,j)
1696 if(grib ==
'grib2')
then
1698 fld_info(cfld)%ifld=iavblfld(iget(085))
1699 fld_info(cfld)%lvl=lvlsxml(lp,iget(085))
1705 datapd(i,j,cfld) = grid1(ii,jj)
1715 IF(iget(018) > 0.OR.iget(019) > 0)
THEN
1717 IF(iget(018) > 0.)
then
1718 if(lvls(lp,iget(018)) > 0 ) log1=.true.
1720 IF(iget(019) > 0)
then
1721 if(lvls(lp,iget(019)) > 0 ) log1=.true.
1727 grid1(i,j) = usl(i,j)
1728 grid2(i,j) = vsl(i,j)
1733 nsmooth=nint(5.*(13500./dxm))
1734 call allgetherv(grid1)
1736 CALL smooth(grid1,sdummy,im,jm,0.5)
1738 nsmooth=nint(5.*(13500./dxm))
1739 call allgetherv(grid2)
1741 CALL smooth(grid2,sdummy,im,jm,0.5)
1745 if(grib ==
'grib2')
then
1747 fld_info(cfld)%ifld=iavblfld(iget(018))
1748 fld_info(cfld)%lvl=lvlsxml(lp,iget(018))
1754 datapd(i,j,cfld) = grid1(ii,jj)
1759 fld_info(cfld)%ifld=iavblfld(iget(019))
1760 fld_info(cfld)%lvl=lvlsxml(lp,iget(019))
1766 datapd(i,j,cfld) = grid2(ii,jj)
1775 IF (iget(021) > 0)
THEN
1776 IF (lvls(lp,iget(021)) > 0)
THEN
1777 CALL calvor(usl,vsl,egrid1)
1782 grid1(i,j) = egrid1(i,j)
1786 IF (smflag .or. ioform ==
'binarympiio' )
THEN
1787 call allgetherv(grid1)
1788 if (ioform ==
'binarympiio')
then
1791 CALL smoothc(grid1,sdummy,im,jm,0.5)
1792 CALL smoothc(grid1,sdummy,im,jm,-0.5)
1795 nsmooth = nint(4.*(13500./dxm))
1798 CALL smooth(grid1,sdummy,im,jm,0.5)
1803 if(grib ==
'grib2')
then
1805 fld_info(cfld)%ifld=iavblfld(iget(021))
1806 fld_info(cfld)%lvl=lvlsxml(lp,iget(021))
1812 datapd(i,j,cfld) = grid1(ii,jj)
1820 IF (iget(086) > 0)
THEN
1821 IF (lvls(lp,iget(086)) > 0)
THEN
1825 IF(fsl(i,j)<spval)
THEN
1826 egrid2(i,j) = fsl(i,j)*gi
1830 CALL calstrm(egrid2(ista:iend,jsta:jend),egrid1(ista:iend,jsta:jend))
1834 IF(fsl(i,j) < spval)
THEN
1835 grid1(i,j) = egrid1(i,j)
1841 if(grib ==
'grib2')
then
1843 fld_info(cfld)%ifld=iavblfld(iget(086))
1844 fld_info(cfld)%lvl=lvlsxml(lp,iget(086))
1850 datapd(i,j,cfld) = grid1(ii,jj)
1859 IF (iget(022) > 0)
THEN
1860 IF (lvls(lp,iget(022)) > 0)
THEN
1864 grid1(i,j) = q2sl(i,j)
1867 if(grib ==
'grib2')
then
1869 fld_info(cfld)%ifld=iavblfld(iget(022))
1870 fld_info(cfld)%lvl=lvlsxml(lp,iget(022))
1876 datapd(i,j,cfld) = grid1(ii,jj)
1885 IF (iget(153) > 0)
THEN
1886 IF (lvls(lp,iget(153)) > 0)
THEN
1887 IF(imp_physics==99 .or. imp_physics==98)
then
1892 IF(qw1(i,j) < spval .AND. qi1(i,j) < spval)
THEN
1893 grid1(i,j) = qw1(i,j) + qi1(i,j)
1904 grid1(i,j) = qw1(i,j)
1908 if(grib ==
'grib2')
then
1910 fld_info(cfld)%ifld=iavblfld(iget(153))
1911 fld_info(cfld)%lvl=lvlsxml(lp,iget(153))
1917 datapd(i,j,cfld) = grid1(ii,jj)
1926 IF (iget(166) > 0)
THEN
1927 IF (lvls(lp,iget(166)) > 0)
THEN
1931 grid1(i,j) = qi1(i,j)
1934 if(grib ==
'grib2')
then
1936 fld_info(cfld)%ifld=iavblfld(iget(166))
1937 fld_info(cfld)%lvl=lvlsxml(lp,iget(166))
1943 datapd(i,j,cfld) = grid1(ii,jj)
1951 IF (iget(183) > 0)
THEN
1952 IF (lvls(lp,iget(183)) > 0)
THEN
1956 grid1(i,j) = qr1(i,j)
1959 if(grib ==
'grib2')
then
1961 fld_info(cfld)%ifld=iavblfld(iget(183))
1962 fld_info(cfld)%lvl=lvlsxml(lp,iget(183))
1968 datapd(i,j,cfld) = grid1(ii,jj)
1976 IF (iget(184) > 0)
THEN
1977 IF (lvls(lp,iget(184)) > 0)
THEN
1981 grid1(i,j) = qs1(i,j)
1984 if(grib ==
'grib2')
then
1986 fld_info(cfld)%ifld=iavblfld(iget(184))
1987 fld_info(cfld)%lvl=lvlsxml(lp,iget(184))
1993 datapd(i,j,cfld) = grid1(ii,jj)
2001 IF (iget(416) > 0)
THEN
2002 IF (lvls(lp,iget(416)) > 0)
THEN
2006 grid1(i,j) = qg1(i,j)
2009 if(grib ==
'grib2')
then
2011 fld_info(cfld)%ifld=iavblfld(iget(416))
2012 fld_info(cfld)%lvl=lvlsxml(lp,iget(416))
2018 datapd(i,j,cfld) = grid1(ii,jj)
2027 IF (iget(198) > 0)
THEN
2028 IF (lvls(lp,iget(198)) > 0)
THEN
2032 grid1(i,j) = c1d(i,j)
2035 if(grib ==
'grib2')
then
2037 fld_info(cfld)%ifld=iavblfld(iget(198))
2038 fld_info(cfld)%lvl=lvlsxml(lp,iget(198))
2044 datapd(i,j,cfld) = grid1(ii,jj)
2052 IF (iget(263) > 0)
THEN
2053 IF (lvls(lp,iget(263)) > 0)
THEN
2057 grid1(i,j) = frime(i,j)
2060 if(grib ==
'grib2')
then
2062 fld_info(cfld)%ifld=iavblfld(iget(263))
2063 fld_info(cfld)%lvl=lvlsxml(lp,iget(263))
2069 datapd(i,j,cfld) = grid1(ii,jj)
2077 IF (iget(1018) > 0)
THEN
2078 IF (lvls(lp,iget(1018)) > 0)
THEN
2079 if(grib ==
'grib2')
then
2081 fld_info(cfld)%ifld=iavblfld(iget(1018))
2082 fld_info(cfld)%lvl=lvlsxml(lp,iget(1018))
2088 datapd(i,j,cfld) = qqnw1(ii,jj)
2096 IF (iget(1019) > 0)
THEN
2097 IF (lvls(lp,iget(1019)) > 0)
THEN
2098 if(grib ==
'grib2')
then
2100 fld_info(cfld)%ifld=iavblfld(iget(1019))
2101 fld_info(cfld)%lvl=lvlsxml(lp,iget(1019))
2107 datapd(i,j,cfld) = qqni1(ii,jj)
2115 IF (iget(1020) > 0)
THEN
2116 IF (lvls(lp,iget(1020)) > 0)
THEN
2117 if(grib ==
'grib2')
then
2119 fld_info(cfld)%ifld=iavblfld(iget(1020))
2120 fld_info(cfld)%lvl=lvlsxml(lp,iget(1020))
2126 datapd(i,j,cfld) = qqnr1(ii,jj)
2134 IF (iget(294) > 0)
THEN
2135 IF (lvls(lp,iget(294)) > 0)
THEN
2139 grid1(i,j) = rad(i,j)
2142 if(grib ==
'grib2')
then
2144 fld_info(cfld)%ifld=iavblfld(iget(294))
2145 fld_info(cfld)%lvl=lvlsxml(lp,iget(294))
2151 datapd(i,j,cfld) = grid1(ii,jj)
2159 IF (iget(251) > 0)
THEN
2160 IF (lvls(lp,iget(251)) > 0)
THEN
2164 grid1(i,j) = dbz1(i,j)
2167 if(grib ==
'grib2')
then
2169 fld_info(cfld)%ifld=iavblfld(iget(251))
2170 fld_info(cfld)%lvl=lvlsxml(lp,iget(251))
2176 datapd(i,j,cfld) = grid1(ii,jj)
2184 IF(iget(257) > 0)
THEN
2185 IF(lvls(lp,iget(257)) > 0)
THEN
2186 CALL calicing(tsl(ista:iend,jsta:jend), savrh, osl(ista:iend,jsta:jend), egrid1(ista:iend,jsta:jend))
2191 grid1(i,j) = egrid1(i,j)
2194 if(grib ==
'grib2')
then
2196 fld_info(cfld)%ifld=iavblfld(iget(257))
2197 fld_info(cfld)%lvl=lvlsxml(lp,iget(257))
2203 datapd(i,j,cfld) = grid1(ii,jj)
2214 IF(iget(258) > 0)
THEN
2215 IF(lvls(lp,iget(258)) > 0)
THEN
2219 IF(fsl(i,j)<spval)
THEN
2220 grid1(i,j) = fsl(i,j)*gi
2227 CALL calcat(usl(ista_2l,jsta_2l),vsl(ista_2l,jsta_2l),grid1(ista_2l,jsta_2l) &
2228 ,usl_old(ista_2l,jsta_2l),vsl_old(ista_2l,jsta_2l) &
2229 ,fsl_old(ista_2l,jsta_2l),egrid1(ista_2l,jsta_2l))
2233 grid1(i,j) = egrid1(i,j)
2238 if(grib ==
'grib2')
then
2240 fld_info(cfld)%ifld=iavblfld(iget(258))
2241 fld_info(cfld)%lvl=lvlsxml(lp,iget(258))
2247 datapd(i,j,cfld) = grid1(ii,jj)
2257 IF(iget(450) > 0)
THEN
2258 IF(lvls(lp,iget(450)) > 0)
THEN
2262 grid1(i,j) = icingfsl(i,j)
2265 if(grib ==
'grib2')
then
2267 fld_info(cfld)%ifld=iavblfld(iget(450))
2268 fld_info(cfld)%lvl=lvlsxml(lp,iget(450))
2274 datapd(i,j,cfld) = grid1(ii,jj)
2281 IF(iget(480) > 0)
THEN
2282 IF(lvls(lp,iget(480)) > 0)
THEN
2286 grid1(i,j) = icingvsl(i,j)
2289 if(grib ==
'grib2')
then
2291 fld_info(cfld)%ifld=iavblfld(iget(480))
2292 fld_info(cfld)%lvl=lvlsxml(lp,iget(480))
2298 datapd(i,j,cfld) = grid1(ii,jj)
2305 IF(gtg_interpolation)
THEN
2307 IF(iget(464) > 0)
THEN
2308 IF(lvls(lp,iget(464)) > 0)
THEN
2312 grid1(i,j) = gtgsl(i,j)
2315 if(grib ==
'grib2')
then
2317 fld_info(cfld)%ifld=iavblfld(iget(464))
2318 fld_info(cfld)%lvl=lvlsxml(lp,iget(464))
2324 datapd(i,j,cfld) = grid1(ii,jj)
2331 IF(iget(465) > 0)
THEN
2332 IF(lvls(lp,iget(465)) > 0)
THEN
2336 grid1(i,j) = catsl(i,j)
2339 if(grib ==
'grib2')
then
2341 fld_info(cfld)%ifld=iavblfld(iget(465))
2342 fld_info(cfld)%lvl=lvlsxml(lp,iget(465))
2348 datapd(i,j,cfld) = grid1(ii,jj)
2355 IF(iget(466) > 0)
THEN
2356 IF(lvls(lp,iget(466)) > 0)
THEN
2360 grid1(i,j) = mwtsl(i,j)
2363 if(grib ==
'grib2')
then
2365 fld_info(cfld)%ifld=iavblfld(iget(466))
2366 fld_info(cfld)%lvl=lvlsxml(lp,iget(466))
2372 datapd(i,j,cfld) = grid1(ii,jj)
2381 DO j=jsta_2l,jend_2u
2382 DO i=ista_2l,iend_2u
2383 usl_old(i,j) = usl(i,j)
2384 vsl_old(i,j) = vsl(i,j)
2385 IF(fsl(i,j)<spval)
THEN
2386 fsl_old(i,j) = fsl(i,j)*gi
2388 fsl_old(i,j) = spval
2394 IF (iget(268) > 0)
THEN
2395 IF (lvls(lp,iget(268)) > 0)
THEN
2399 grid1(i,j) = o3sl(i,j)
2404 if(grib ==
'grib2')
then
2406 fld_info(cfld)%ifld=iavblfld(iget(268))
2407 fld_info(cfld)%lvl=lvlsxml(lp,iget(268))
2413 datapd(i,j,cfld) = grid1(ii,jj)
2421 IF (iget(738) > 0)
THEN
2422 IF (lvls(lp,iget(738)) > 0)
THEN
2426 IF(smokesl(i,j,1)<spval.and.spl(lp)<spval.and.tsl(i,j)<spval)
THEN
2427 grid1(i,j) = (1./rd)*smokesl(i,j,1)*(spl(lp)/(tsl(i,j)*(1e9)))
2433 if(grib ==
'grib2')
then
2435 fld_info(cfld)%ifld=iavblfld(iget(738))
2436 fld_info(cfld)%lvl=lvlsxml(lp,iget(738))
2442 datapd(i,j,cfld) = grid1(ii,jj)
2449 IF (iget(743) > 0)
THEN
2450 IF (lvls(lp,iget(743)) > 0)
THEN
2454 IF(fv3dustsl(i,j,1)<spval.and.spl(lp)<spval.and.tsl(i,j)<spval)
THEN
2455 grid1(i,j) = (1./rd)*fv3dustsl(i,j,1)*(spl(lp)/(tsl(i,j)*(1e9)))
2461 if(grib ==
'grib2')
then
2463 fld_info(cfld)%ifld=iavblfld(iget(743))
2464 fld_info(cfld)%lvl=lvlsxml(lp,iget(743))
2470 datapd(i,j,cfld) = grid1(ii,jj)
2477 IF (iget(1013) > 0)
THEN
2478 IF (lvls(lp,iget(1013)) > 0)
THEN
2482 IF(coarsepmsl(i,j,1)<spval.and.spl(lp)<spval.and.tsl(i,j)<spval)
THEN
2483 grid1(i,j) = (1./rd)*coarsepmsl(i,j,1)*(spl(lp)/(tsl(i,j)*(1e9)))
2489 if(grib ==
'grib2')
then
2491 fld_info(cfld)%ifld=iavblfld(iget(1013))
2492 fld_info(cfld)%lvl=lvlsxml(lp,iget(1013))
2498 datapd(i,j,cfld) = grid1(ii,jj)
2505 IF (iget(1016) > 0)
THEN
2506 IF (lvls(lp,iget(1016)) > 0)
THEN
2510 grid1(i,j) = ebbsl(i,j,1)/(1e9)
2513 if(grib ==
'grib2')
then
2515 fld_info(cfld)%ifld=iavblfld(iget(1016))
2516 fld_info(cfld)%lvl=lvlsxml(lp,iget(1016))
2522 datapd(i,j,cfld) = grid1(ii,jj)
2529 if(iostatusd3d==0 .and. d3d_on)
then
2531 IF (iget(355) > 0)
THEN
2532 IF (lvls(lp,iget(355)) > 0)
THEN
2536 grid1(i,j) = d3dsl(i,j,1)
2541 if (itd3d /= 0)
then
2542 ifincr = mod(ifhr,itd3d)
2543 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2549 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2551 IF (ifincr == 0)
THEN
2554 id(18) = ifhr-ifincr
2555 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2557 if(grib ==
'grib2')
then
2559 fld_info(cfld)%ifld=iavblfld(iget(355))
2560 fld_info(cfld)%lvl=lvlsxml(lp,iget(355))
2562 fld_info(cfld)%ntrange=0
2564 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2566 fld_info(cfld)%tinvstat=itd3d
2572 datapd(i,j,cfld) = grid1(ii,jj)
2579 IF (iget(354) > 0)
THEN
2580 IF (lvls(lp,iget(354)) > 0)
THEN
2584 grid1(i,j) = d3dsl(i,j,2)
2589 if (itd3d /= 0)
then
2590 ifincr = mod(ifhr,itd3d)
2591 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2597 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2599 IF (ifincr == 0)
THEN
2602 id(18) = ifhr-ifincr
2603 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2605 if(grib ==
'grib2')
then
2607 fld_info(cfld)%ifld=iavblfld(iget(354))
2608 fld_info(cfld)%lvl=lvlsxml(lp,iget(354))
2610 fld_info(cfld)%ntrange=0
2612 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2614 fld_info(cfld)%tinvstat=itd3d
2620 datapd(i,j,cfld) = grid1(ii,jj)
2627 IF (iget(356) > 0)
THEN
2628 IF (lvls(lp,iget(356)) > 0)
THEN
2632 grid1(i,j) = d3dsl(i,j,3)
2637 if (itd3d /= 0)
then
2638 ifincr = mod(ifhr,itd3d)
2639 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2645 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2647 IF (ifincr == 0)
THEN
2650 id(18) = ifhr-ifincr
2651 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2653 if(grib ==
'grib2')
then
2655 fld_info(cfld)%ifld=iavblfld(iget(356))
2656 fld_info(cfld)%lvl=lvlsxml(lp,iget(356))
2658 fld_info(cfld)%ntrange=0
2660 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2662 fld_info(cfld)%tinvstat=itd3d
2668 datapd(i,j,cfld) = grid1(ii,jj)
2675 IF (iget(357) > 0)
THEN
2676 IF (lvls(lp,iget(357)) > 0)
THEN
2680 grid1(i,j) = d3dsl(i,j,4)
2685 if (itd3d /= 0)
then
2686 ifincr = mod(ifhr,itd3d)
2687 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2693 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2695 IF (ifincr == 0)
THEN
2698 id(18) = ifhr-ifincr
2699 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2701 if(grib ==
'grib2')
then
2703 fld_info(cfld)%ifld=iavblfld(iget(357))
2704 fld_info(cfld)%lvl=lvlsxml(lp,iget(357))
2706 fld_info(cfld)%ntrange=0
2708 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2710 fld_info(cfld)%tinvstat=itd3d
2716 datapd(i,j,cfld) = grid1(ii,jj)
2723 IF (iget(358) > 0)
THEN
2724 IF (lvls(lp,iget(358)) > 0)
THEN
2728 grid1(i,j) = d3dsl(i,j,5)
2733 if (itd3d /= 0)
then
2734 ifincr = mod(ifhr,itd3d)
2735 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2741 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2743 IF (ifincr == 0)
THEN
2746 id(18) = ifhr-ifincr
2747 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2749 if(grib ==
'grib2')
then
2751 fld_info(cfld)%ifld=iavblfld(iget(358))
2752 fld_info(cfld)%lvl=lvlsxml(lp,iget(358))
2754 fld_info(cfld)%ntrange=0
2756 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2758 fld_info(cfld)%tinvstat=itd3d
2764 datapd(i,j,cfld) = grid1(ii,jj)
2771 IF (iget(359) > 0)
THEN
2772 IF (lvls(lp,iget(359)) > 0)
THEN
2776 grid1(i,j) = d3dsl(i,j,6)
2781 if (itd3d /= 0)
then
2782 ifincr = mod(ifhr,itd3d)
2783 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2789 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2791 IF (ifincr == 0)
THEN
2794 id(18) = ifhr-ifincr
2795 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2797 if(grib ==
'grib2')
then
2799 fld_info(cfld)%ifld=iavblfld(iget(359))
2800 fld_info(cfld)%lvl=lvlsxml(lp,iget(359))
2802 fld_info(cfld)%ntrange=0
2804 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2806 fld_info(cfld)%tinvstat=itd3d
2812 datapd(i,j,cfld) = grid1(ii,jj)
2819 IF (iget(360) > 0)
THEN
2820 IF (lvls(lp,iget(360)) > 0)
THEN
2824 grid1(i,j) = d3dsl(i,j,7)
2829 if (itd3d /= 0)
then
2830 ifincr = mod(ifhr,itd3d)
2831 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2837 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2839 IF (ifincr == 0)
THEN
2842 id(18) = ifhr-ifincr
2843 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2845 if(grib ==
'grib2')
then
2847 fld_info(cfld)%ifld=iavblfld(iget(360))
2848 fld_info(cfld)%lvl=lvlsxml(lp,iget(360))
2850 fld_info(cfld)%ntrange=0
2852 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2854 fld_info(cfld)%tinvstat=itd3d
2860 datapd(i,j,cfld) = grid1(ii,jj)
2867 IF (iget(361) > 0)
THEN
2868 IF (lvls(lp,iget(361)) > 0)
THEN
2872 grid1(i,j) = d3dsl(i,j,8)
2877 if (itd3d /= 0)
then
2878 ifincr = mod(ifhr,itd3d)
2879 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2885 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2887 IF (ifincr == 0)
THEN
2890 id(18) = ifhr-ifincr
2891 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2893 if(grib ==
'grib2')
then
2895 fld_info(cfld)%ifld=iavblfld(iget(361))
2896 fld_info(cfld)%lvl=lvlsxml(lp,iget(361))
2898 fld_info(cfld)%ntrange=0
2900 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2902 fld_info(cfld)%tinvstat=itd3d
2908 datapd(i,j,cfld) = grid1(ii,jj)
2915 IF (iget(362) > 0)
THEN
2916 IF (lvls(lp,iget(362)) > 0)
THEN
2920 grid1(i,j) = d3dsl(i,j,9)
2925 if (itd3d /= 0)
then
2926 ifincr = mod(ifhr,itd3d)
2927 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2933 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2935 IF (ifincr == 0)
THEN
2938 id(18) = ifhr-ifincr
2939 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2941 if(grib ==
'grib2')
then
2943 fld_info(cfld)%ifld=iavblfld(iget(362))
2944 fld_info(cfld)%lvl=lvlsxml(lp,iget(362))
2946 fld_info(cfld)%ntrange=0
2948 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2950 fld_info(cfld)%tinvstat=itd3d
2956 datapd(i,j,cfld) = grid1(ii,jj)
2963 IF (iget(363) > 0)
THEN
2964 IF (lvls(lp,iget(363)) > 0)
THEN
2968 grid1(i,j) = d3dsl(i,j,10)
2973 if (itd3d /= 0)
then
2974 ifincr = mod(ifhr,itd3d)
2975 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2982 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2984 IF (ifincr == 0)
THEN
2987 id(18) = ifhr-ifincr
2988 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2990 if(grib ==
'grib2')
then
2992 fld_info(cfld)%ifld=iavblfld(iget(363))
2993 fld_info(cfld)%lvl=lvlsxml(lp,iget(363))
2995 fld_info(cfld)%ntrange=0
2997 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2999 fld_info(cfld)%tinvstat=itd3d
3005 datapd(i,j,cfld) = grid1(ii,jj)
3012 IF (iget(364) > 0)
THEN
3013 IF (lvls(lp,iget(364)) > 0)
THEN
3017 grid1(i,j) = d3dsl(i,j,11)
3022 if (itd3d /= 0)
then
3023 ifincr = mod(ifhr,itd3d)
3024 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3031 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3033 IF (ifincr == 0)
THEN
3036 id(18) = ifhr-ifincr
3037 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3039 if(grib ==
'grib2')
then
3041 fld_info(cfld)%ifld=iavblfld(iget(364))
3042 fld_info(cfld)%lvl=lvlsxml(lp,iget(364))
3044 fld_info(cfld)%ntrange=0
3046 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3048 fld_info(cfld)%tinvstat=itd3d
3054 datapd(i,j,cfld) = grid1(ii,jj)
3061 IF (iget(365) > 0)
THEN
3062 IF (lvls(lp,iget(365)) > 0)
THEN
3066 grid1(i,j) = d3dsl(i,j,12)
3071 if (itd3d /= 0)
then
3072 ifincr = mod(ifhr,itd3d)
3073 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3080 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3082 IF (ifincr == 0)
THEN
3085 id(18) = ifhr-ifincr
3086 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3088 if(grib ==
'grib2')
then
3090 fld_info(cfld)%ifld=iavblfld(iget(365))
3091 fld_info(cfld)%lvl=lvlsxml(lp,iget(365))
3093 fld_info(cfld)%ntrange=0
3095 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3097 fld_info(cfld)%tinvstat=itd3d
3103 datapd(i,j,cfld) = grid1(ii,jj)
3110 IF (iget(366) > 0)
THEN
3111 IF (lvls(lp,iget(366)) > 0)
THEN
3115 grid1(i,j) = d3dsl(i,j,13)
3120 if (itd3d /= 0)
then
3121 ifincr = mod(ifhr,itd3d)
3122 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3129 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3131 IF (ifincr == 0)
THEN
3134 id(18) = ifhr-ifincr
3135 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3137 if(grib ==
'grib2')
then
3139 fld_info(cfld)%ifld=iavblfld(iget(366))
3140 fld_info(cfld)%lvl=lvlsxml(lp,iget(366))
3142 fld_info(cfld)%ntrange=0
3144 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3146 fld_info(cfld)%tinvstat=itd3d
3152 datapd(i,j,cfld) = grid1(ii,jj)
3159 IF (iget(367) > 0)
THEN
3160 IF (lvls(lp,iget(367)) > 0)
THEN
3164 grid1(i,j) = d3dsl(i,j,14)
3169 if (itd3d /= 0)
then
3170 ifincr = mod(ifhr,itd3d)
3171 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3178 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3180 IF (ifincr == 0)
THEN
3183 id(18) = ifhr-ifincr
3184 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3186 if(grib ==
'grib2')
then
3188 fld_info(cfld)%ifld=iavblfld(iget(367))
3189 fld_info(cfld)%lvl=lvlsxml(lp,iget(367))
3191 fld_info(cfld)%ntrange=0
3193 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3195 fld_info(cfld)%tinvstat=itd3d
3201 datapd(i,j,cfld) = grid1(ii,jj)
3208 IF (iget(368) > 0)
THEN
3209 IF (lvls(lp,iget(368)) > 0)
THEN
3213 grid1(i,j) = d3dsl(i,j,15)
3218 if (itd3d /= 0)
then
3219 ifincr = mod(ifhr,itd3d)
3220 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3227 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3229 IF (ifincr == 0)
THEN
3232 id(18) = ifhr-ifincr
3233 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3235 if(grib ==
'grib2')
then
3237 fld_info(cfld)%ifld=iavblfld(iget(368))
3238 fld_info(cfld)%lvl=lvlsxml(lp,iget(368))
3240 fld_info(cfld)%ntrange=0
3242 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3244 fld_info(cfld)%tinvstat=itd3d
3250 datapd(i,j,cfld) = grid1(ii,jj)
3257 IF (iget(369) > 0)
THEN
3258 IF (lvls(lp,iget(369)) > 0)
THEN
3262 grid1(i,j) = d3dsl(i,j,16)
3267 if (itd3d /= 0)
then
3268 ifincr = mod(ifhr,itd3d)
3269 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3275 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3277 IF (ifincr == 0)
THEN
3280 id(18) = ifhr-ifincr
3281 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3283 if(grib ==
'grib2')
then
3285 fld_info(cfld)%ifld=iavblfld(iget(369))
3286 fld_info(cfld)%lvl=lvlsxml(lp,iget(369))
3288 fld_info(cfld)%ntrange=0
3290 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3292 fld_info(cfld)%tinvstat=itd3d
3298 datapd(i,j,cfld) = grid1(ii,jj)
3305 IF (iget(370) > 0)
THEN
3306 IF (lvls(lp,iget(370)) > 0)
THEN
3310 grid1(i,j) = d3dsl(i,j,17)
3315 if (itd3d /= 0)
then
3316 ifincr = mod(ifhr,itd3d)
3317 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3324 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3326 IF (ifincr == 0)
THEN
3329 id(18) = ifhr-ifincr
3330 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3332 if(grib ==
'grib2')
then
3334 fld_info(cfld)%ifld=iavblfld(iget(370))
3335 fld_info(cfld)%lvl=lvlsxml(lp,iget(370))
3337 fld_info(cfld)%ntrange=0
3339 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3341 fld_info(cfld)%tinvstat=itd3d
3347 datapd(i,j,cfld) = grid1(ii,jj)
3354 IF (iget(371) > 0)
THEN
3355 IF (lvls(lp,iget(371)) > 0)
THEN
3359 grid1(i,j) = d3dsl(i,j,18)
3364 if (itd3d /= 0)
then
3365 ifincr = mod(ifhr,itd3d)
3366 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3373 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3375 IF (ifincr == 0)
THEN
3378 id(18) = ifhr-ifincr
3379 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3381 if(grib ==
'grib2')
then
3383 fld_info(cfld)%ifld=iavblfld(iget(371))
3384 fld_info(cfld)%lvl=lvlsxml(lp,iget(371))
3386 fld_info(cfld)%ntrange=0
3388 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3390 fld_info(cfld)%tinvstat=itd3d
3396 datapd(i,j,cfld) = grid1(ii,jj)
3403 IF (iget(372) > 0)
THEN
3404 IF (lvls(lp,iget(372)) > 0)
THEN
3408 grid1(i,j) = d3dsl(i,j,19)
3413 if (itd3d /= 0)
then
3414 ifincr = mod(ifhr,itd3d)
3415 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3421 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3423 IF (ifincr == 0)
THEN
3426 id(18) = ifhr-ifincr
3427 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3429 if(grib ==
'grib2')
then
3431 fld_info(cfld)%ifld=iavblfld(iget(372))
3432 fld_info(cfld)%lvl=lvlsxml(lp,iget(372))
3434 fld_info(cfld)%ntrange=0
3436 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3438 fld_info(cfld)%tinvstat=itd3d
3444 datapd(i,j,cfld) = grid1(ii,jj)
3451 IF (iget(373) > 0)
THEN
3452 IF (lvls(lp,iget(373)) > 0)
THEN
3456 grid1(i,j) = d3dsl(i,j,20)
3461 if (itd3d /= 0)
then
3462 ifincr = mod(ifhr,itd3d)
3463 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3470 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3472 IF (ifincr == 0)
THEN
3475 id(18) = ifhr-ifincr
3476 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3478 if(grib ==
'grib2')
then
3480 fld_info(cfld)%ifld=iavblfld(iget(373))
3481 fld_info(cfld)%lvl=lvlsxml(lp,iget(373))
3483 fld_info(cfld)%ntrange=0
3485 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3487 fld_info(cfld)%tinvstat=itd3d
3493 datapd(i,j,cfld) = grid1(ii,jj)
3500 IF (iget(374) > 0)
THEN
3501 IF (lvls(lp,iget(374)) > 0)
THEN
3505 grid1(i,j) = d3dsl(i,j,21)
3510 if (itd3d /= 0)
then
3511 ifincr = mod(ifhr,itd3d)
3512 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3519 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3521 IF (ifincr == 0)
THEN
3524 id(18) = ifhr-ifincr
3525 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3527 if(grib ==
'grib2')
then
3529 fld_info(cfld)%ifld=iavblfld(iget(374))
3530 fld_info(cfld)%lvl=lvlsxml(lp,iget(374))
3532 fld_info(cfld)%ntrange=0
3534 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3536 fld_info(cfld)%tinvstat=itd3d
3542 datapd(i,j,cfld) = grid1(ii,jj)
3549 IF (iget(375) > 0)
THEN
3550 IF (lvls(lp,iget(375)) > 0)
THEN
3554 grid1(i,j) = d3dsl(i,j,22)
3559 if (itd3d /= 0)
then
3560 ifincr = mod(ifhr,itd3d)
3561 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3567 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3569 IF (ifincr == 0)
THEN
3572 id(18) = ifhr-ifincr
3573 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3575 if(grib ==
'grib2')
then
3577 fld_info(cfld)%ifld=iavblfld(iget(375))
3578 fld_info(cfld)%lvl=lvlsxml(lp,iget(375))
3580 fld_info(cfld)%ntrange=0
3582 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3584 fld_info(cfld)%tinvstat=itd3d
3590 datapd(i,j,cfld) = grid1(ii,jj)
3597 IF (iget(379) > 0)
THEN
3598 IF (lvls(lp,iget(379)) > 0)
THEN
3602 IF(d3dsl(i,j,1)/=spval)
THEN
3603 grid1(i,j) = d3dsl(i,j,1) + d3dsl(i,j,2) &
3604 + d3dsl(i,j,3) + d3dsl(i,j,4) &
3605 + d3dsl(i,j,5) + d3dsl(i,j,6)
3613 if (itd3d /= 0)
then
3614 ifincr = mod(ifhr,itd3d)
3615 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3621 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3623 IF (ifincr == 0)
THEN
3626 id(18) = ifhr-ifincr
3627 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3629 if(grib ==
'grib2')
then
3631 fld_info(cfld)%ifld=iavblfld(iget(379))
3632 fld_info(cfld)%lvl=lvlsxml(lp,iget(379))
3634 fld_info(cfld)%ntrange=0
3636 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3638 fld_info(cfld)%tinvstat=itd3d
3644 datapd(i,j,cfld) = grid1(ii,jj)
3651 IF (iget(391) > 0)
THEN
3652 IF (lvls(lp,iget(391)) > 0)
THEN
3656 grid1(i,j) = d3dsl(i,j,23)
3661 if (itd3d /= 0)
then
3662 ifincr = mod(ifhr,itd3d)
3663 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3670 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3672 IF (ifincr == 0)
THEN
3675 id(18) = ifhr-ifincr
3676 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3678 if(grib ==
'grib2')
then
3680 fld_info(cfld)%ifld=iavblfld(iget(391))
3681 fld_info(cfld)%lvl=lvlsxml(lp,iget(391))
3683 fld_info(cfld)%ntrange=0
3685 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3687 fld_info(cfld)%tinvstat=itd3d
3693 datapd(i,j,cfld) = grid1(ii,jj)
3700 IF (iget(392) > 0)
THEN
3701 IF (lvls(lp,iget(392)) > 0)
THEN
3705 grid1(i,j) = d3dsl(i,j,24)
3710 if (itd3d /= 0)
then
3711 ifincr = mod(ifhr,itd3d)
3712 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3719 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3721 IF (ifincr == 0)
THEN
3724 id(18) = ifhr-ifincr
3725 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3727 if(grib ==
'grib2')
then
3729 fld_info(cfld)%ifld=iavblfld(iget(392))
3730 fld_info(cfld)%lvl=lvlsxml(lp,iget(392))
3732 fld_info(cfld)%ntrange=0
3734 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3736 fld_info(cfld)%tinvstat=itd3d
3742 datapd(i,j,cfld) = grid1(ii,jj)
3749 IF (iget(393) > 0)
THEN
3750 IF (lvls(lp,iget(393)) > 0)
THEN
3754 grid1(i,j) = d3dsl(i,j,25)
3759 if (itd3d /= 0)
then
3760 ifincr = mod(ifhr,itd3d)
3761 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3768 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3770 IF (ifincr == 0)
THEN
3773 id(18) = ifhr-ifincr
3774 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3776 if(grib ==
'grib2')
then
3778 fld_info(cfld)%ifld=iavblfld(iget(393))
3779 fld_info(cfld)%lvl=lvlsxml(lp,iget(393))
3781 fld_info(cfld)%ntrange=0
3783 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3785 fld_info(cfld)%tinvstat=itd3d
3791 datapd(i,j,cfld) = grid1(ii,jj)
3798 IF (iget(394) > 0)
THEN
3799 IF (lvls(lp,iget(394)) > 0)
THEN
3803 grid1(i,j) = d3dsl(i,j,26)
3808 if (itd3d /= 0)
then
3809 ifincr = mod(ifhr,itd3d)
3810 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3817 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3819 IF (ifincr == 0)
THEN
3822 id(18) = ifhr-ifincr
3823 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3825 if(grib ==
'grib2')
then
3827 fld_info(cfld)%ifld=iavblfld(iget(394))
3828 fld_info(cfld)%lvl=lvlsxml(lp,iget(394))
3830 fld_info(cfld)%ntrange=0
3832 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3834 fld_info(cfld)%tinvstat=itd3d
3840 datapd(i,j,cfld) = grid1(ii,jj)
3847 IF (iget(395) > 0)
THEN
3848 IF (lvls(lp,iget(395)) > 0)
THEN
3852 grid1(i,j) = d3dsl(i,j,27)
3857 if (itd3d /= 0)
then
3858 ifincr = mod(ifhr,itd3d)
3859 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3866 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3868 IF (ifincr == 0)
THEN
3871 id(18) = ifhr-ifincr
3872 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3874 if(grib ==
'grib2')
then
3876 fld_info(cfld)%ifld=iavblfld(iget(395))
3877 fld_info(cfld)%lvl=lvlsxml(lp,iget(395))
3879 fld_info(cfld)%ntrange=0
3881 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3883 fld_info(cfld)%tinvstat=itd3d
3889 datapd(i,j,cfld) = grid1(ii,jj)
3898 IF (iget(455) > 0)
THEN
3899 ii=(ista+iend)/2+100
3900 jj=(jsta+jend)/2-100
3901 IF(abs(spl(lp)-50000.)<small) luhi=lp
3902 IF(abs(spl(lp)-70000.)<small)
THEN
3909 egrid2(i,j) = spl(lp)
3912 CALL caldwp(egrid2(ista:iend,jsta:jend),qsl(ista:iend,jsta:jend),tdsl(ista:iend,jsta:jend),tsl(ista:iend,jsta:jend))
3917 IF(sm(i,j) < 1.0 .AND. zint(i,j,lm+1) < fsl(i,j)*gi)
THEN
3918 dum1 = tsl(i,j)-tprs(i,j,luhi)
3921 ELSE IF(dum1 > 17. .AND. dum1 <= 21.)
THEN
3926 dum1 = tsl(i,j)-tdsl(i,j)
3927 IF(dum1 <= 14.)
THEN
3929 ELSE IF(dum1>14. .AND. dum1<=20.)
THEN
3934 IF(tsl(i,j)<spval.and.tprs(i,j,luhi)<spval.and.tdsl(i,j)<spval)
THEN
3935 haines(i,j) = istaa + imois
3948 IF(abs(spl(lp)-85000.)<small)
THEN
3953 egrid2(i,j) = spl(lp)
3956 CALL caldwp(egrid2(ista:iend,jsta:jend),qsl(ista:iend,jsta:jend),tdsl(ista:iend,jsta:jend),tsl(ista:iend,jsta:jend))
3961 IF(sm(i,j) < 1.0 .AND. zint(i,j,lm+1) < fsl(i,j)*gi)
THEN
3962 dum1 = tsl(i,j)-tprs(i,j,luhi)
3965 ELSE IF(dum1 > 5. .AND. dum1 <= 10.)
THEN
3970 dum1 = tsl(i,j)-tdsl(i,j)
3973 ELSE IF(dum1 > 5. .AND. dum1 <= 12.)
THEN
3980 IF(tsl(i,j)<spval.and.tprs(i,j,luhi)<spval.and.tdsl(i,j)<spval)
THEN
3981 haines(i,j) = istaa + imois
3992 IF(abs(spl(lp)-95000.)<small)
THEN
4000 CALL caldwp(egrid2(ista:iend,jsta:jend),qsl(ista:iend,jsta:jend),tdsl(ista:iend,jsta:jend),tsl(ista:iend,jsta:jend))
4005 IF(sm(i,j) < 1.0 .AND. zint(i,j,lm+1) < fsl(i,j)*gi)
THEN
4006 dum1 = tsl(i,j)-tprs(i,j,luhi)
4009 ELSE IF(dum1 > 3. .AND. dum1 <=7. )
THEN
4014 dum1 = tsl(i,j)-tdsl(i,j)
4017 ELSE IF(dum1 > 5. .AND. dum1 <= 9.)
THEN
4024 IF(tsl(i,j)<spval.and.tprs(i,j,luhi)<spval.and.tdsl(i,j)<spval)
THEN
4025 haines(i,j) = istaa + imois
4033 if(grib ==
'grib2')
then
4035 fld_info(cfld)%ifld=iavblfld(iget(455))
4041 datapd(i,j,cfld) = haines(ii,jj)
4057 IF (iget(423) > 0)
THEN
4063 grid1(i,j) = w_up_max(i,j)
4067 if(grib ==
'grib2')
then
4069 fld_info(cfld)%ifld = iavblfld(iget(423))
4070 fld_info(cfld)%lvl = lvlsxml(lp,iget(423))
4072 fld_info(cfld)%tinvstat=1
4074 fld_info(cfld)%tinvstat=0
4076 fld_info(cfld)%ntrange=1
4082 datapd(i,j,cfld) = grid1(ii,jj)
4090 IF (iget(424) > 0)
THEN
4095 grid1(i,j) = w_dn_max(i,j)
4098 if(grib ==
'grib2')
then
4100 fld_info(cfld)%ifld=iavblfld(iget(424))
4101 fld_info(cfld)%lvl=lvlsxml(lp,iget(424))
4103 fld_info(cfld)%tinvstat=1
4105 fld_info(cfld)%tinvstat=0
4107 fld_info(cfld)%ntrange=1
4113 datapd(i,j,cfld) = grid1(ii,jj)
4126 IF (iget(425) > 0)
THEN
4131 grid1(i,j) = w_mean(i,j)
4134 if(grib ==
'grib2')
then
4136 fld_info(cfld)%ifld = iavblfld(iget(425))
4137 fld_info(cfld)%lvl = lvlsxml(lp,iget(425))
4139 fld_info(cfld)%tinvstat = 0
4141 fld_info(cfld)%tinvstat = 1
4143 fld_info(cfld)%ntrange = 1
4149 datapd(i,j,cfld) = grid1(ii,jj)
4160 IF(iget(023) > 0)
THEN
4161 IF(gridtype ==
'A'.OR. gridtype ==
'B')
then
4162 CALL memslp(tprs,qprs,fprs)
4163 ELSE IF (gridtype ==
'E')
THEN
4166 print*,
'unknow grid type-> WONT DERIVE MESINGER SLP'
4171 grid1(i,j) = pslp(i,j)
4176 if(grib ==
'grib2')
then
4178 fld_info(cfld)%ifld = iavblfld(iget(023))
4184 datapd(i,j,cfld) = grid1(ii,jj)
4191 IF(iget(445) > 0)
THEN
4196 grid1(i,j) = pslp(i,j)
4199 if(grib ==
'grib2')
then
4201 fld_info(cfld)%ifld = iavblfld(iget(445))
4207 datapd(i,j,cfld) = grid1(ii,jj)
4215 IF(iget(023) > 0.OR.iget(445) > 0)
THEN
4216 IF(iget(012) > 0)
THEN
4220 IF(abs(spl(lp)-1.0e5) <= 1.0e-5)
THEN
4221 IF(lvls(lp,iget(012)) > 0)
THEN
4223 IF(modelname ==
'GFS')
THEN
4229 IF(fsl(i,j)<spval)
THEN
4230 grid1(i,j) = fsl(i,j)*gi
4240 IF(pslp(i,j) < spval)
THEN
4243 psfc = pint(i,j,nint(lmh(i,j))+1)
4244 IF(abs(pslpij-psfc) < 5.e2)
THEN
4245 grid1(i,j) = rd*tprs(i,j,lp)*(alpsl-alpth)
4247 grid1(i,j) = fis(i,j)/(alpsl-log(psfc))*(alpsl-alpth)
4249 z1000(i,j) = grid1(i,j)*gi
4250 grid1(i,j) = z1000(i,j)
4260 nsmooth = nint(5.*(13500./dxm))
4261 call allgetherv(grid1)
4263 CALL smooth(grid1,sdummy,im,jm,0.5)
4267 if(grib ==
'grib2')
then
4269 fld_info(cfld)%ifld = iavblfld(iget(012))
4270 fld_info(cfld)%lvl = lvlsxml(lp,iget(012))
4276 datapd(i,j,cfld) = grid1(ii,jj)
4288 IF ( iget(1006)>0 )
THEN
4291 call calslr_uutah(egrid1)
4293 call calslr_roebber(tprs,rhprs,egrid1)
4299 if(egrid1(i,j) < spval)
then
4300 if(egrid1(i,j)>=1.)
then
4301 grid1(i,j)=1000./egrid1(i,j)
4308 if(grib==
'grib2')
then
4310 fld_info(cfld)%ifld=iavblfld(iget(1006))
4316 datapd(i,j,cfld) = grid1(ii,jj)
4322if(
allocated(d3dsl))
deallocate(d3dsl)
4323if(
allocated(smokesl))
deallocate(smokesl)
4324if(
allocated(fv3dustsl))
deallocate(fv3dustsl)
4325if(
allocated(coarsepmsl))
deallocate(coarsepmsl)
4326if(
allocated(ebbsl))
deallocate(ebbsl)
4328if(
allocated(gtgsl))
deallocate(gtgsl)
4329if(
allocated(catsl))
deallocate(catsl)
4330if(
allocated(mwtsl))
deallocate(mwtsl)