34 SUBROUTINE mdl2p(iostatusD3D)
39 use vrbls3d, only: pint, o3, pmid, t, q, uh, vh, wh, omga, q2, cwm, &
40 qqw, qqi, qqr, qqs, qqg, dbz, f_rimef, ttnd, cfr, &
41 rlwtt, rswtt, vdifftt, tcucn, tcucns, &
42 train, vdiffmois, dconvmois, sconvmois,nradtt, &
43 o3vdiff, o3prod, o3tndy, mwpv, unknown, vdiffzacce, &
44 zgdrag, cnvctvmmixing, vdiffmacce, mgdrag, &
45 cnvctummixing, ncnvctcfrac, cnvctumflx, cnvctdetmflx, &
46 cnvctzgdrag, cnvctmgdrag, zmid, zint, pmidv, &
48 use vrbls2d, only: t500,t700,w_up_max,w_dn_max,w_mean,pslp,fis,z1000,z700,&
50 use masks, only: lmh, sm
51 use physcons_post,only: con_fvirt, con_rog, con_eps, con_epsm1
52 use params_mod, only: h1m12, dbzmin, h1, pq0, a2, a3, a4, rhmin, g, &
53 rgamog, rd, d608, gi, erad, pi, small, h100, &
55 use ctlblk_mod
, only: modelname, lp1, me, jsta, jend, lm, spval, spl, &
56 alsl, jend_m, smflag, grib, cfld, fld_info, datapd,&
57 td3d, ifhr, ifmin, im, jm, nbin_du, jsta_2l, &
58 jend_2u, lsm, d3d_on, gocart_on, ioform, nbin_sm, &
60 use rqstfld_mod
, only: iget, lvls, id, iavblfld, lvlsxml
61 use gridspec_mod
, only: gridtype, maptype, dxval
72 real,
parameter:: gammam=-1*gamma,zshul=75.,tvshul=290.66
76 real,
PARAMETER :: capa=0.28589641,p1000=1000.e2
78 real,
dimension(im,jm) :: grid1, grid2
79 real,
dimension(im,jsta_2l:jend_2u) :: fsl, tsl, qsl, osl, usl, vsl &
80 &, Q2SL, WSL, CFRSL, O3SL, TDSL &
82 &, FSL_OLD, USL_OLD, VSL_OLD &
85 REAL,
allocatable :: d3dsl(:,:,:), dustsl(:,:,:), smokesl(:,:,:)
87 integer,
intent(in) :: iostatusd3d
88 INTEGER,
dimension(im,jsta_2l:jend_2u) :: nl1x, nl1xf
89 real,
dimension(IM,JSTA_2L:JEND_2U,LSM) :: tprs, qprs, fprs
103 REAL,
dimension(im,jsta_2l:jend_2u) :: c1d, qw1, qi1, qr1, qs1, qg1, dbz1 &
109 REAL savrh(im,jsta:jend)
111 integer i,j,l,lp,ll,llmh,jjb,jje,ii,jj,li,ifincr,itd3d,ista,imois,luhi,la
112 real fact,alpsl,psfc,qblo,pnl1,tblo,tvrl,tvrblo,fac,pslpij, &
113 alpth,ahf,pdv,ql,tvu,tvd,gammas,qsat,rhl,zl,tl,pl,es,part,dum1
121 if (modelname ==
'GFS')
then
127 if (.not.
allocated(d3dsl))
allocate(d3dsl(im,jm,27))
138 if (.not.
allocated(dustsl))
allocate(dustsl(im,jm,nbin_du))
143 dustsl(i,j,l) = spval
148 if (.not.
allocated(smokesl))
allocate(smokesl(im,jm,nbin_sm))
153 smokesl(i,j,l) = spval
167 IF((iget(012) > 0) .OR. (iget(013) > 0) .OR. &
168 (iget(014) > 0) .OR. (iget(015) > 0) .OR. &
169 (iget(016) > 0) .OR. (iget(017) > 0) .OR. &
170 (iget(018) > 0) .OR. (iget(019) > 0) .OR. &
171 (iget(020) > 0) .OR. (iget(030) > 0) .OR. &
172 (iget(021) > 0) .OR. (iget(022) > 0) .OR. &
173 (iget(023) > 0) .OR. (iget(085) > 0) .OR. &
174 (iget(086) > 0) .OR. (iget(284) > 0) .OR. &
175 (iget(153) > 0) .OR. (iget(166) > 0) .OR. &
176 (iget(183) > 0) .OR. (iget(184) > 0) .OR. &
177 (iget(198) > 0) .OR. (iget(251) > 0) .OR. &
178 (iget(257) > 0) .OR. (iget(258) > 0) .OR. &
179 (iget(294) > 0) .OR. (iget(268) > 0) .OR. &
180 (iget(331) > 0) .OR. (iget(326) > 0) .OR. &
182 (iget(354) > 0) .OR. (iget(355) > 0) .OR. &
183 (iget(356) > 0) .OR. (iget(357) > 0) .OR. &
184 (iget(358) > 0) .OR. (iget(359) > 0) .OR. &
185 (iget(360) > 0) .OR. (iget(361) > 0) .OR. &
186 (iget(362) > 0) .OR. (iget(363) > 0) .OR. &
187 (iget(364) > 0) .OR. (iget(365) > 0) .OR. &
188 (iget(366) > 0) .OR. (iget(367) > 0) .OR. &
189 (iget(368) > 0) .OR. (iget(369) > 0) .OR. &
190 (iget(370) > 0) .OR. (iget(371) > 0) .OR. &
191 (iget(372) > 0) .OR. (iget(373) > 0) .OR. &
192 (iget(374) > 0) .OR. (iget(375) > 0) .OR. &
193 (iget(391) > 0) .OR. (iget(392) > 0) .OR. &
194 (iget(393) > 0) .OR. (iget(394) > 0) .OR. &
195 (iget(395) > 0) .OR. (iget(379) > 0) .OR. &
197 (iget(438) > 0) .OR. (iget(439) > 0) .OR. &
198 (iget(440) > 0) .OR. (iget(441) > 0) .OR. &
199 (iget(442) > 0) .OR. (iget(455) > 0) .OR. &
201 (iget(738) > 0) .OR. (modelname ==
'RAPR') .OR.&
203 (iget(030)>0) .OR. (iget(031)>0) .OR. (iget(075)>0))
THEN
213 if(gridtype ==
'B' .or. gridtype ==
'E') &
214 call exch(pint(1:im,jsta_2l:jend_2u,lp1))
253 IF(nl1x(i,j) == lp1 .AND. pmid(i,j,l) > spl(lp))
THEN
263 IF(nl1x(i,j) == lp1 .AND. pint(i,j,lp1) > spl(lp))
THEN
269 IF(nl1xf(i,j) == (lp1+1) .AND. pint(i,j,l) > spl(lp))
THEN
299 llmh = nint(lmh(i,j))
303 IF(spl(lp) < pint(i,j,2))
THEN
304 IF(t(i,j,1) < spval) tsl(i,j) = t(i,j,1)
305 IF(q(i,j,1) < spval) qsl(i,j) = q(i,j,1)
307 IF(gridtype ==
'A')
THEN
308 IF(uh(i,j,1) < spval) usl(i,j) = uh(i,j,1)
309 IF(vh(i,j,1) < spval) vsl(i,j) = vh(i,j,1)
315 IF(wh(i,j,1) < spval) wsl(i,j) = wh(i,j,1)
316 IF(omga(i,j,1) < spval) osl(i,j) = omga(i,j,1)
317 IF(q2(i,j,1) < spval) q2sl(i,j) = q2(i,j,1)
318 IF(cwm(i,j,1) < spval) c1d(i,j) = cwm(i,j,1)
319 c1d(i,j) = max(c1d(i,j),zero)
320 IF(qqw(i,j,1) < spval) qw1(i,j) = qqw(i,j,1)
321 qw1(i,j) = max(qw1(i,j),zero)
322 IF(qqi(i,j,1) < spval) qi1(i,j) = qqi(i,j,1)
323 qi1(i,j) = max(qi1(i,j),zero)
324 IF(qqr(i,j,1) < spval) qr1(i,j) = qqr(i,j,1)
325 qr1(i,j) = max(qr1(i,j),zero)
326 IF(qqs(i,j,1) < spval) qs1(i,j) = qqs(i,j,1)
327 qs1(i,j) = max(qs1(i,j),zero)
328 IF(qqg(i,j,1) < spval) qg1(i,j) = qqg(i,j,1)
329 qg1(i,j) = max(qg1(i,j),zero)
330 IF(dbz(i,j,1) < spval) dbz1(i,j) = dbz(i,j,1)
331 dbz1(i,j) = max(dbz1(i,j),dbzmin)
332 IF(f_rimef(i,j,1) < spval) frime(i,j) = f_rimef(i,j,1)
333 frime(i,j) = max(frime(i,j),h1)
334 IF(ttnd(i,j,1) < spval) rad(i,j) = ttnd(i,j,1)
335 IF(o3(i,j,1) < spval) o3sl(i,j) = o3(i,j,1)
336 IF(cfr(i,j,1) < spval) cfrsl(i,j) = cfr(i,j,1)
340 IF(dust(i,j,1,k) < spval) dustsl(i,j,k) = dust(i,j,1,k)
344 IF(smoke(i,j,1,k) < spval) smokesl(i,j,k)=smoke(i,j,1,k)
350 IF((iget(354) > 0) .OR. (iget(355) > 0) .OR. &
351 (iget(356) > 0) .OR. (iget(357) > 0) .OR. &
352 (iget(358) > 0) .OR. (iget(359) > 0) .OR. &
353 (iget(360) > 0) .OR. (iget(361) > 0) .OR. &
354 (iget(362) > 0) .OR. (iget(363) > 0) .OR. &
355 (iget(364) > 0) .OR. (iget(365) > 0) .OR. &
356 (iget(366) > 0) .OR. (iget(367) > 0) .OR. &
357 (iget(368) > 0) .OR. (iget(369) > 0) .OR. &
358 (iget(370) > 0) .OR. (iget(371) > 0) .OR. &
359 (iget(372) > 0) .OR. (iget(373) > 0) .OR. &
360 (iget(374) > 0) .OR. (iget(375) > 0) .OR. &
361 (iget(391) > 0) .OR. (iget(392) > 0) .OR. &
362 (iget(393) > 0) .OR. (iget(394) > 0) .OR. &
363 (iget(395) > 0) .OR. (iget(379) > 0))
THEN
364 d3dsl(i,j,1) = rlwtt(i,j,1)
365 d3dsl(i,j,2) = rswtt(i,j,1)
366 d3dsl(i,j,3) = vdifftt(i,j,1)
367 d3dsl(i,j,4) = tcucn(i,j,1)
368 d3dsl(i,j,5) = tcucns(i,j,1)
369 d3dsl(i,j,6) = train(i,j,1)
370 d3dsl(i,j,7) = vdiffmois(i,j,1)
371 d3dsl(i,j,8) = dconvmois(i,j,1)
372 d3dsl(i,j,9) = sconvmois(i,j,1)
373 d3dsl(i,j,10) = nradtt(i,j,1)
374 d3dsl(i,j,11) = o3vdiff(i,j,1)
375 d3dsl(i,j,12) = o3prod(i,j,1)
376 d3dsl(i,j,13) = o3tndy(i,j,1)
377 d3dsl(i,j,14) = mwpv(i,j,1)
378 d3dsl(i,j,15) = unknown(i,j,1)
379 d3dsl(i,j,16) = vdiffzacce(i,j,1)
380 d3dsl(i,j,17) = zgdrag(i,j,1)
381 d3dsl(i,j,18) = cnvctummixing(i,j,1)
382 d3dsl(i,j,19) = vdiffmacce(i,j,1)
383 d3dsl(i,j,20) = mgdrag(i,j,1)
384 d3dsl(i,j,21) = cnvctvmmixing(i,j,1)
385 d3dsl(i,j,22) = ncnvctcfrac(i,j,1)
386 d3dsl(i,j,23) = cnvctumflx(i,j,1)
387 d3dsl(i,j,24) = cnvctdmflx(i,j,1)
388 d3dsl(i,j,25) = cnvctdetmflx(i,j,1)
389 d3dsl(i,j,26) = cnvctzgdrag(i,j,1)
390 d3dsl(i,j,27) = cnvctmgdrag(i,j,1)
394 ELSE IF(ll <= llmh)
THEN
404 IF (modelname ==
'RAPR' .OR. modelname ==
'NCAR' .OR. modelname ==
'NMM')
THEN
405 fact = (alsl(lp)-log(pmid(i,j,ll)))/ &
406 max(1.e-6,(log(pmid(i,j,ll))-log(pmid(i,j,ll-1))))
407 fact = max(-10.0,min(fact, 10.0))
408 ELSEIF (modelname ==
'GFS' .OR. modelname ==
'FV3R')
THEN
409 fact = (alsl(lp)-log(pmid(i,j,ll)))/ &
410 max(1.e-6,(log(pmid(i,j,ll))-log(pmid(i,j,ll-1))))
411 fact = max(-10.0,min(fact, 10.0))
412 IF ( abs(pmid(i,j,ll)-pmid(i,j,ll-1)) < 0.5 )
THEN
416 fact = (alsl(lp)-log(pmid(i,j,ll)))/ &
417 (log(pmid(i,j,ll))-log(pmid(i,j,ll-1)))
419 IF(t(i,j,ll) < spval .AND. t(i,j,ll-1) < spval) &
420 tsl(i,j) = t(i,j,ll)+(t(i,j,ll)-t(i,j,ll-1))*fact
421 IF(q(i,j,ll) < spval .AND. q(i,j,ll-1) < spval) &
422 qsl(i,j) = q(i,j,ll)+(q(i,j,ll)-q(i,j,ll-1))*fact
424 IF(gridtype==
'A')
THEN
425 IF(uh(i,j,ll) < spval .AND. uh(i,j,ll-1) < spval) &
426 usl(i,j) = uh(i,j,ll)+(uh(i,j,ll)-uh(i,j,ll-1))*fact
427 IF(vh(i,j,ll) < spval .AND. vh(i,j,ll-1) < spval) &
428 vsl(i,j) = vh(i,j,ll)+(vh(i,j,ll)-vh(i,j,ll-1))*fact
431 IF(wh(i,j,ll) < spval .AND. wh(i,j,ll-1) < spval) &
432 wsl(i,j) = wh(i,j,ll)+(wh(i,j,ll)-wh(i,j,ll-1))*fact
433 IF(omga(i,j,ll) < spval .AND. omga(i,j,ll-1) < spval) &
434 osl(i,j) = omga(i,j,ll)+(omga(i,j,ll)-omga(i,j,ll-1))*fact
435 IF(q2(i,j,ll) < spval .AND. q2(i,j,ll-1) < spval) &
436 q2sl(i,j) = q2(i,j,ll)+(q2(i,j,ll)-q2(i,j,ll-1))*fact
442 if (modelname ==
'GFS')
then
443 es = min(
fpvsnew(tsl(i,j)), spl(lp))
444 qsat = con_eps*es/(spl(lp)+con_epsm1*es)
446 qsat = pq0/spl(lp)*exp(a2*(tsl(i,j)-a3)/(tsl(i,j)-a4))
449 rhl = max(rhmin, min(1.0, qsl(i,j)/qsat))
456 IF(q2sl(i,j) < 0.0) q2sl(i,j) = 0.0
459 IF(cwm(i,j,ll) < spval .AND. cwm(i,j,ll-1) < spval) &
460 c1d(i,j) = cwm(i,j,ll) + (cwm(i,j,ll)-cwm(i,j,ll-1))*fact
461 c1d(i,j) = max(c1d(i,j),zero)
463 IF(qqw(i,j,ll) < spval .AND. qqw(i,j,ll-1) < spval) &
464 qw1(i,j) = qqw(i,j,ll) + (qqw(i,j,ll)-qqw(i,j,ll-1))*fact
465 qw1(i,j) = max(qw1(i,j),zero)
467 IF(qqi(i,j,ll) < spval .AND. qqi(i,j,ll-1) < spval) &
468 qi1(i,j) = qqi(i,j,ll) + (qqi(i,j,ll)-qqi(i,j,ll-1))*fact
469 qi1(i,j) = max(qi1(i,j),zero)
471 IF(qqr(i,j,ll) < spval .AND. qqr(i,j,ll-1) < spval) &
472 qr1(i,j) = qqr(i,j,ll) + (qqr(i,j,ll)-qqr(i,j,ll-1))*fact
473 qr1(i,j) = max(qr1(i,j),zero)
475 IF(qqs(i,j,ll) < spval .AND. qqs(i,j,ll-1) < spval) &
476 qs1(i,j) = qqs(i,j,ll) + (qqs(i,j,ll)-qqs(i,j,ll-1))*fact
477 qs1(i,j) = max(qs1(i,j),zero)
479 IF(qqg(i,j,ll) < spval .AND. qqg(i,j,ll-1) < spval) &
480 qg1(i,j) = qqg(i,j,ll) + (qqg(i,j,ll)-qqg(i,j,ll-1))*fact
481 qg1(i,j) = max(qg1(i,j),zero)
483 IF(dbz(i,j,ll) < spval .AND. dbz(i,j,ll-1) < spval) &
484 dbz1(i,j) = dbz(i,j,ll) + (dbz(i,j,ll)-dbz(i,j,ll-1))*fact
485 dbz1(i,j) = max(dbz1(i,j),dbzmin)
487 IF(f_rimef(i,j,ll) < spval .AND. f_rimef(i,j,ll-1) < spval) &
488 frime(i,j) = f_rimef(i,j,ll) + (f_rimef(i,j,ll) - f_rimef(i,j,ll-1))*fact
489 frime(i,j)=max(frime(i,j),h1)
491 IF(ttnd(i,j,ll) < spval .AND. ttnd(i,j,ll-1) < spval) &
492 rad(i,j) = ttnd(i,j,ll) + (ttnd(i,j,ll)-ttnd(i,j,ll-1))*fact
494 IF(o3(i,j,ll) < spval .AND. o3(i,j,ll-1) < spval) &
495 o3sl(i,j) = o3(i,j,ll) + (o3(i,j,ll)-o3(i,j,ll-1))*fact
497 IF(cfr(i,j,ll) < spval .AND. cfr(i,j,ll-1) < spval) &
498 cfrsl(i,j) = cfr(i,j,ll) + (cfr(i,j,ll)-cfr(i,j,ll-1))*fact
502 IF(dust(i,j,ll,k) < spval .AND. dust(i,j,ll-1,k) < spval) &
503 dustsl(i,j,k) = dust(i,j,ll,k) + (dust(i,j,ll,k)-dust(i,j,ll-1,k))*fact
507 IF(smoke(i,j,ll,k) < spval .AND. smoke(i,j,ll-1,k) < spval) &
508 smokesl(i,j,k)=smoke(i,j,ll,k)+(smoke(i,j,ll,k)-smoke(i,j,ll-1,k))*fact
514 IF((iget(354) > 0) .OR. (iget(355) > 0) .OR. &
515 (iget(356) > 0) .OR. (iget(357) > 0) .OR. &
516 (iget(358) > 0) .OR. (iget(359) > 0) .OR. &
517 (iget(360) > 0) .OR. (iget(361) > 0) .OR. &
518 (iget(362) > 0) .OR. (iget(363) > 0) .OR. &
519 (iget(364) > 0) .OR. (iget(365) > 0) .OR. &
520 (iget(366) > 0) .OR. (iget(367) > 0) .OR. &
521 (iget(368) > 0) .OR. (iget(369) > 0) .OR. &
522 (iget(370) > 0) .OR. (iget(371) > 0) .OR. &
523 (iget(372) > 0) .OR. (iget(373) > 0) .OR. &
524 (iget(374) > 0) .OR. (iget(375) > 0) .OR. &
525 (iget(391) > 0) .OR. (iget(392) > 0) .OR. &
526 (iget(393) > 0) .OR. (iget(394) > 0) .OR. &
527 (iget(395) > 0) .OR. (iget(379) > 0))
THEN
528 d3dsl(i,j,1) = rlwtt(i,j,ll)+(rlwtt(i,j,ll) &
529 - rlwtt(i,j,ll-1))*fact
530 d3dsl(i,j,2) = rswtt(i,j,ll)+(rswtt(i,j,ll) &
531 - rswtt(i,j,ll-1))*fact
532 d3dsl(i,j,3) = vdifftt(i,j,ll)+(vdifftt(i,j,ll) &
533 - vdifftt(i,j,ll-1))*fact
534 d3dsl(i,j,4) = tcucn(i,j,ll)+(tcucn(i,j,ll) &
535 - tcucn(i,j,ll-1))*fact
536 d3dsl(i,j,5) = tcucns(i,j,ll)+(tcucns(i,j,ll) &
537 - tcucns(i,j,ll-1))*fact
538 d3dsl(i,j,6) = train(i,j,ll)+(train(i,j,ll) &
539 - train(i,j,ll-1))*fact
540 d3dsl(i,j,7) = vdiffmois(i,j,ll)+ &
541 (vdiffmois(i,j,ll)-vdiffmois(i,j,ll-1))*fact
542 d3dsl(i,j,8) = dconvmois(i,j,ll)+ &
543 (dconvmois(i,j,ll)-dconvmois(i,j,ll-1))*fact
544 d3dsl(i,j,9) = sconvmois(i,j,ll)+ &
545 (sconvmois(i,j,ll)-sconvmois(i,j,ll-1))*fact
546 d3dsl(i,j,10) = nradtt(i,j,ll)+ &
547 (nradtt(i,j,ll)-nradtt(i,j,ll-1))*fact
548 d3dsl(i,j,11) = o3vdiff(i,j,ll)+ &
549 (o3vdiff(i,j,ll)-o3vdiff(i,j,ll-1))*fact
550 d3dsl(i,j,12) = o3prod(i,j,ll)+ &
551 (o3prod(i,j,ll)-o3prod(i,j,ll-1))*fact
552 d3dsl(i,j,13) = o3tndy(i,j,ll)+ &
553 (o3tndy(i,j,ll)-o3tndy(i,j,ll-1))*fact
554 d3dsl(i,j,14) = mwpv(i,j,ll)+ &
555 (mwpv(i,j,ll)-mwpv(i,j,ll-1))*fact
556 d3dsl(i,j,15) = unknown(i,j,ll)+ &
557 (unknown(i,j,ll)-unknown(i,j,ll-1))*fact
558 d3dsl(i,j,16) = vdiffzacce(i,j,ll)+ &
559 (vdiffzacce(i,j,ll)-vdiffzacce(i,j,ll-1))*fact
560 d3dsl(i,j,17) = zgdrag(i,j,ll)+ &
561 (zgdrag(i,j,ll)-zgdrag(i,j,ll-1))*fact
562 d3dsl(i,j,18) = cnvctummixing(i,j,ll)+ &
563 (cnvctummixing(i,j,ll)-cnvctummixing(i,j,ll-1))*fact
564 d3dsl(i,j,19) = vdiffmacce(i,j,ll)+ &
565 (vdiffmacce(i,j,ll)-vdiffmacce(i,j,ll-1))*fact
566 d3dsl(i,j,20) = mgdrag(i,j,ll)+ &
567 (mgdrag(i,j,ll)-mgdrag(i,j,ll-1))*fact
568 d3dsl(i,j,21) = cnvctvmmixing(i,j,ll)+ &
569 (cnvctvmmixing(i,j,ll)-cnvctvmmixing(i,j,ll-1))*fact
570 d3dsl(i,j,22) = ncnvctcfrac(i,j,ll)+ &
571 (ncnvctcfrac(i,j,ll)-ncnvctcfrac(i,j,ll-1))*fact
572 d3dsl(i,j,23) = cnvctumflx(i,j,ll)+ &
573 (cnvctumflx(i,j,ll)-cnvctumflx(i,j,ll-1))*fact
574 d3dsl(i,j,24) = cnvctdmflx(i,j,ll)+ &
575 (cnvctdmflx(i,j,ll)-cnvctdmflx(i,j,ll-1))*fact
576 d3dsl(i,j,25) = cnvctdetmflx(i,j,ll)+ &
577 (cnvctdetmflx(i,j,ll)-cnvctdetmflx(i,j,ll-1))*fact
578 d3dsl(i,j,26) = cnvctzgdrag(i,j,ll)+ &
579 (cnvctzgdrag(i,j,ll)-cnvctzgdrag(i,j,ll-1))*fact
580 d3dsl(i,j,27) = cnvctmgdrag(i,j,ll)+ &
581 (cnvctmgdrag(i,j,ll)-cnvctmgdrag(i,j,ll-1))*fact
590 IF(modelname ==
'GFS')
THEN
591 tvu = t(i,j,lm) * (1.+con_fvirt*q(i,j,lm))
592 if(zmid(i,j,lm) > zshul)
then
593 tvd = tvu + gamma*zmid(i,j,lm)
594 if(tvd > tvshul)
then
595 if(tvu > tvshul)
then
596 tvd = tvshul - 5.e-3*(tvu-tvshul)*(tvu-tvshul)
601 gammas = (tvu-tvd)/zmid(i,j,lm)
605 part = con_rog*(alsl(lp)-log(pmid(i,j,lm)))
606 fsl(i,j) = zmid(i,j,lm) - tvu*part/(1.+0.5*gammas*part)
608 tsl(i,j) = t(i,j,lm) - gamma*(fsl(i,j)-zmid(i,j,lm))
609 fsl(i,j) = fsl(i,j)*g
613 es = min(
fpvsnew(t(i,j,lm)), pmid(i,j,lm))
614 qsat = con_eps*es/(pmid(i,j,lm)+con_epsm1*es)
617 es = min(
fpvsnew(tsl(i,j)), spl(lp))
618 qsat = con_eps*es/(spl(lp)+con_epsm1*es)
625 tl = 0.5*(t(i,j,lm-2)+t(i,j,lm-1))
626 ql = 0.5*(q(i,j,lm-2)+q(i,j,lm-1))
636 qsat = pq0/pl*exp(a2*(tl-a3)/(tl-a4))
649 tvrl = tl*(1.+0.608*ql)
650 tvrblo = tvrl*(spl(lp)/pl)**rgamog
651 tblo = tvrblo/(1.+0.608*ql)
662 qsat = pq0/spl(lp)*exp(a2*(tblo-a3)/(tblo-a4))
665 qsl(i,j) = max(1.e-12,qblo)
671 IF(gridtype ==
'A')
THEN
672 usl(i,j) = uh(i,j,llmh)
673 vsl(i,j) = vh(i,j,llmh)
677 wsl(i,j) = wh(i,j,llmh)
678 osl(i,j) = omga(i,j,llmh)
679 q2sl(i,j) = max(0.0,0.5*(q2(i,j,llmh-1)+q2(i,j,llmh)))
717 o3sl(i,j) = o3(i,j,llmh)
723 IF(modelname ==
'GFS')
then
725 IF(spl(lp) < pmid(i,j,1))
THEN
726 tvd = t(i,j,1)*(1+con_fvirt*q(i,j,1))
727 fsl(i,j) = zmid(i,j,1)-con_rog*tvd *(alsl(lp)-log(pmid(i,j,1)))
728 fsl(i,j) = fsl(i,j)*g
729 ELSE IF(l <= llmh)
THEN
730 tvd = t(i,j,l)*(1+con_fvirt*q(i,j,l))
731 tvu = tsl(i,j)*(1+con_fvirt*qsl(i,j))
732 fsl(i,j) = zmid(i,j,l)-con_rog*0.5*(tvd+tvu) &
733 * (alsl(lp)-log(pmid(i,j,l)))
734 fsl(i,j) = fsl(i,j)*g
738 IF(nl1xf(i,j)<=(llmh+1))
THEN
739 fact = (alsl(lp)-log(pint(i,j,la)))/ &
740 (log(pint(i,j,la))-log(pint(i,j,la-1)))
741 IF(zint(i,j,la) < spval .AND. zint(i,j,la-1) < spval) &
742 fsl(i,j) = zint(i,j,la)+(zint(i,j,la)-zint(i,j,la-1))*fact
743 fsl(i,j) = fsl(i,j)*g
745 fsl(i,j) = fprs(i,j,lp-1)-rd*(tprs(i,j,lp-1) &
746 * (h1+d608*qprs(i,j,lp-1)) &
747 + tsl(i,j)*(h1+d608*qsl(i,j))) &
748 * log(spl(lp)/spl(lp-1))/2.0
761 tprs(i,j,lp) = tsl(i,j)
762 qprs(i,j,lp) = qsl(i,j)
763 fprs(i,j,lp) = fsl(i,j)
769 IF(gridtype ==
'E')
THEN
807 IF(nl1x(i,j) == lp1.AND.pmidv(i,j,l) > spl(lp))
THEN
820 IF(nl1x(i,j) == lp1)
THEN
821 IF(j == 1 .AND. i < im)
THEN
822 pdv = 0.5*(pint(i,j,lp1)+pint(i+1,j,lp1))
823 ELSE IF(j == jm .AND. i < im)
THEN
824 pdv = 0.5*(pint(i,j,lp1)+pint(i+1,j,lp1))
825 ELSE IF(i == 1 .AND. mod(j,2) == 0)
THEN
826 pdv = 0.5*(pint(i,j-1,lp1)+pint(i,j+1,lp1))
827 ELSE IF(i == im .AND. mod(j,2) == 0)
THEN
828 pdv = 0.5*(pint(i,j-1,lp1)+pint(i,j+1,lp1))
829 ELSE IF (mod(j,2) < 1)
THEN
830 pdv = 0.25*(pint(i,j,lp1)+pint(i-1,j,lp1) &
831 + pint(i,j+1,lp1)+pint(i,j-1,lp1))
833 pdv = 0.25*(pint(i,j,lp1)+pint(i+1,j,lp1) &
834 + pint(i,j+1,lp1)+pint(i,j-1,lp1))
836 IF(pdv > spl(lp))
THEN
853 llmh = nint(lmh(i,j))
855 IF(spl(lp) < pint(i,j,2))
THEN
856 IF(uh(i,j,1) < spval) usl(i,j) = uh(i,j,1)
857 IF(vh(i,j,1) < spval) vsl(i,j) = vh(i,j,1)
859 ELSE IF(nl1x(i,j)<=llmh)
THEN
869 fact = (alsl(lp)-log(pmidv(i,j,ll)))/ &
870 (log(pmidv(i,j,ll))-log(pmidv(i,j,ll-1)))
871 IF(uh(i,j,ll) < spval .AND. uh(i,j,ll-1) < spval) &
872 usl(i,j) = uh(i,j,ll)+(uh(i,j,ll)-uh(i,j,ll-1))*fact
873 IF(vh(i,j,ll) < spval .AND. vh(i,j,ll-1) < spval) &
874 vsl(i,j) = vh(i,j,ll)+(vh(i,j,ll)-vh(i,j,ll-1))*fact
883 IF(uh(i,j,llmh) < spval) usl(i,j) = uh(i,j,llmh)
884 IF(vh(i,j,llmh) < spval) vsl(i,j) = vh(i,j,llmh)
891 IF(mod(jsta,2) == 0) jjb = jsta+1
893 IF(mod(jend,2) == 0) jje = jend-1
895 usl(im,j) = usl(im-1,j)
896 vsl(im,j) = vsl(im-1,j)
898 ELSE IF(gridtype==
'B')
THEN
906 IF(nl1x(i,j) == lp1.AND.pmidv(i,j,l) > spl(lp))
THEN
918 IF(nl1x(i,j)==lp1)
THEN
919 pdv = 0.25*(pint(i,j,lp1)+pint(i+1,j,lp1) &
920 + pint(i,j+1,lp1)+pint(i+1,j+1,lp1))
921 IF(pdv > spl(lp))
THEN
938 llmh = nint(lmh(i,j))
940 IF(spl(lp) < pint(i,j,2))
THEN
941 IF(uh(i,j,1) < spval) usl(i,j) = uh(i,j,1)
942 IF(vh(i,j,1) < spval) vsl(i,j) = vh(i,j,1)
944 ELSE IF(nl1x(i,j)<=llmh)
THEN
954 fact = (alsl(lp)-log(pmidv(i,j,ll)))/ &
955 (log(pmidv(i,j,ll))-log(pmidv(i,j,ll-1)))
956 IF(uh(i,j,ll) < spval .AND. uh(i,j,ll-1) < spval) &
957 usl(i,j)=uh(i,j,ll)+(uh(i,j,ll)-uh(i,j,ll-1))*fact
958 IF(vh(i,j,ll) < spval .AND. vh(i,j,ll-1) < spval) &
959 vsl(i,j)=vh(i,j,ll)+(vh(i,j,ll)-vh(i,j,ll-1))*fact
968 IF(uh(i,j,llmh) < spval)usl(i,j)=uh(i,j,llmh)
969 IF(vh(i,j,llmh) < spval)vsl(i,j)=vh(i,j,llmh)
985 IF(nint(spl(lp)) == 50000)
THEN
990 z500(i,j) = fsl(i,j)*gi
998 IF(nint(spl(lp)) == 70000)
THEN
1002 t700(i,j) = tsl(i,j)
1003 z700(i,j) = fsl(i,j)*gi
1066 IF(iget(012) > 0)
THEN
1067 IF(lvls(lp,iget(012)) > 0)
THEN
1068 IF((iget(023) > 0 .OR. iget(445) > 0) .AND. nint(spl(lp)) == 100000)
THEN
1074 IF(fsl(i,j) < spval)
THEN
1075 grid1(i,j) = fsl(i,j)*gi
1084 if(maptype == 6)
then
1085 if(grib==
'grib2')
then
1086 dxm = (dxval / 360.)*(erad*2.*pi)/1.d6
1091 if(grib ==
'grib2')
then
1095 nsmooth = nint(5.*(13500./dxm))
1096 call allgetherv(grid1)
1098 CALL smooth(grid1,sdummy,im,jm,0.5)
1101 if(grib ==
'grib2')
then
1103 fld_info(cfld)%ifld=iavblfld(iget(012))
1104 fld_info(cfld)%lvl=lvlsxml(lp,iget(012))
1109 datapd(i,j,cfld) = grid1(i,jj)
1120 IF(iget(013) > 0)
THEN
1121 IF(lvls(lp,iget(013)) > 0)
THEN
1125 grid1(i,j) = tsl(i,j)
1130 nsmooth = nint(3.*(13500./dxm))
1131 call allgetherv(grid1)
1133 CALL smooth(grid1,sdummy,im,jm,0.5)
1137 if(grib ==
'grib2')
then
1139 fld_info(cfld)%ifld = iavblfld(iget(013))
1140 fld_info(cfld)%lvl = lvlsxml(lp,iget(013))
1145 datapd(i,j,cfld) = grid1(i,jj)
1154 IF(iget(910)>0)
THEN
1155 IF(lvls(lp,iget(910))>0)
THEN
1159 IF(tsl(i,j) < spval .AND. qsl(i,j) < spval)
THEN
1160 grid1(i,j) = tsl(i,j)*(1.+0.608*qsl(i,j))
1168 nsmooth = nint(3.*(13500./dxm))
1169 call allgetherv(grid1)
1171 CALL smooth(grid1,sdummy,im,jm,0.5)
1175 if(grib==
'grib2')
then
1177 fld_info(cfld)%ifld = iavblfld(iget(910))
1178 fld_info(cfld)%lvl = lvlsxml(lp,iget(910))
1183 datapd(i,j,cfld) = grid1(i,jj)
1193 IF(iget(014) > 0)
THEN
1194 IF(lvls(lp,iget(014)) > 0)
THEN
1196 tem = (p1000/spl(lp)) ** capa
1200 IF(tsl(i,j) < spval)
THEN
1201 grid1(i,j) = tsl(i,j) * tem
1222 if(grib ==
'grib2')
then
1224 fld_info(cfld)%ifld=iavblfld(iget(014))
1225 fld_info(cfld)%lvl=lvlsxml(lp,iget(014))
1230 datapd(i,j,cfld) = grid1(i,jj)
1240 IF(iget(017) > 0 .OR. iget(257) > 0)
THEN
1244 IF(iget(017) > 0.)
then
1245 if(lvls(lp,iget(017)) > 0 ) log1=.true.
1247 IF(iget(257) > 0)
then
1248 if(lvls(lp,iget(257)) > 0 ) log1=.true.
1254 egrid2(i,j) = spl(lp)
1258 CALL calrh(egrid2(1,jsta),tsl(1,jsta),qsl(1,jsta),egrid1(1,jsta))
1263 IF(egrid1(i,j) < spval)
THEN
1264 grid1(i,j) = egrid1(i,j)*100.
1266 grid1(i,j) = egrid1(i,j)
1272 nsmooth=nint(2.*(13500./dxm))
1273 call allgetherv(grid1)
1275 CALL smooth(grid1,sdummy,im,jm,0.5)
1278 if(grib ==
'grib2')
then
1280 fld_info(cfld)%ifld=iavblfld(iget(017))
1281 fld_info(cfld)%lvl=lvlsxml(lp,iget(017))
1286 datapd(i,j,cfld) = grid1(i,jj)
1294 savrh(i,j) = grid1(i,j)
1303 IF(iget(331) > 0)
THEN
1304 IF(lvls(lp,iget(331)) > 0)
THEN
1309 cfrsl(i,j) = min(max(0.0,cfrsl(i,j)),1.0)
1310 IF(abs(cfrsl(i,j)-spval) > small) &
1311 grid1(i,j) = cfrsl(i,j)*h100
1314 if(grib ==
'grib2')
then
1316 fld_info(cfld)%ifld = iavblfld(iget(331))
1317 fld_info(cfld)%lvl = lvlsxml(lp,iget(331))
1322 datapd(i,j,cfld) = grid1(i,jj)
1331 IF(iget(015) > 0)
THEN
1332 IF(lvls(lp,iget(015)) > 0)
THEN
1336 egrid2(i,j) = spl(lp)
1340 CALL caldwp(egrid2(1,jsta),qsl(1,jsta),egrid1(1,jsta),tsl(1,jsta))
1344 IF(tsl(i,j) < spval)
THEN
1345 grid1(i,j) = egrid1(i,j)
1351 if(grib ==
'grib2')
then
1353 fld_info(cfld)%ifld=iavblfld(iget(015))
1354 fld_info(cfld)%lvl=lvlsxml(lp,iget(015))
1359 datapd(i,j,cfld) = grid1(i,jj)
1368 IF(iget(016) > 0)
THEN
1369 IF(lvls(lp,iget(016)) > 0)
THEN
1373 grid1(i,j) = qsl(i,j)
1376 CALL bound(grid1,zero,h99999)
1377 if(grib ==
'grib2')
then
1379 fld_info(cfld)%ifld=iavblfld(iget(016))
1380 fld_info(cfld)%lvl=lvlsxml(lp,iget(016))
1385 datapd(i,j,cfld) = grid1(i,jj)
1394 IF(iget(020) > 0)
THEN
1395 IF(lvls(lp,iget(020)) > 0)
THEN
1399 grid1(i,j) = osl(i,j)
1403 IF (smflag .or. ioform ==
'binarympiio' )
THEN
1404 call allgetherv(grid1)
1405 if (ioform ==
'binarympiio')
then
1408 CALL smoothc(grid1,sdummy,im,jm,0.5)
1409 CALL smoothc(grid1,sdummy,im,jm,-0.5)
1412 nsmooth = nint(3.*(13500./dxm))
1415 CALL smooth(grid1,sdummy,im,jm,0.5)
1420 if(grib ==
'grib2')
then
1422 fld_info(cfld)%ifld=iavblfld(iget(020))
1423 fld_info(cfld)%lvl=lvlsxml(lp,iget(020))
1428 datapd(i,j,cfld) = grid1(i,jj)
1437 IF(iget(284) > 0)
THEN
1438 IF(lvls(lp,iget(284)) > 0)
THEN
1442 grid1(i,j) = wsl(i,j)
1445 if(grib ==
'grib2')
then
1447 fld_info(cfld)%ifld=iavblfld(iget(284))
1448 fld_info(cfld)%lvl=lvlsxml(lp,iget(284))
1453 datapd(i,j,cfld) = grid1(i,jj)
1462 IF(iget(085) > 0)
THEN
1463 IF(lvls(lp,iget(085)) > 0)
THEN
1464 CALL calmcvg(qsl(1,jsta_2l),usl(1,jsta_2l),vsl(1,jsta_2l),egrid1(1,jsta_2l))
1469 grid1(i,j) = egrid1(i,j)
1477 if(grib ==
'grib2')
then
1479 fld_info(cfld)%ifld=iavblfld(iget(085))
1480 fld_info(cfld)%lvl=lvlsxml(lp,iget(085))
1485 datapd(i,j,cfld) = grid1(i,jj)
1495 IF(iget(018) > 0.OR.iget(019) > 0)
THEN
1497 IF(iget(018) > 0.)
then
1498 if(lvls(lp,iget(018)) > 0 ) log1=.true.
1500 IF(iget(019) > 0)
then
1501 if(lvls(lp,iget(019)) > 0 ) log1=.true.
1507 grid1(i,j) = usl(i,j)
1508 grid2(i,j) = vsl(i,j)
1513 nsmooth=nint(5.*(13500./dxm))
1514 call allgetherv(grid1)
1516 CALL smooth(grid1,sdummy,im,jm,0.5)
1518 nsmooth=nint(5.*(13500./dxm))
1519 call allgetherv(grid2)
1521 CALL smooth(grid2,sdummy,im,jm,0.5)
1525 if(grib ==
'grib2')
then
1527 fld_info(cfld)%ifld=iavblfld(iget(018))
1528 fld_info(cfld)%lvl=lvlsxml(lp,iget(018))
1533 datapd(i,j,cfld) = grid1(i,jj)
1538 fld_info(cfld)%ifld=iavblfld(iget(019))
1539 fld_info(cfld)%lvl=lvlsxml(lp,iget(019))
1544 datapd(i,j,cfld) = grid2(i,jj)
1553 IF (iget(021) > 0)
THEN
1554 IF (lvls(lp,iget(021)) > 0)
THEN
1555 CALL calvor(usl,vsl,egrid1)
1560 grid1(i,j) = egrid1(i,j)
1564 IF (smflag .or. ioform ==
'binarympiio' )
THEN
1565 call allgetherv(grid1)
1566 if (ioform ==
'binarympiio')
then
1569 CALL smoothc(grid1,sdummy,im,jm,0.5)
1570 CALL smoothc(grid1,sdummy,im,jm,-0.5)
1573 nsmooth = nint(4.*(13500./dxm))
1576 CALL smooth(grid1,sdummy,im,jm,0.5)
1581 if(grib ==
'grib2')
then
1583 fld_info(cfld)%ifld=iavblfld(iget(021))
1584 fld_info(cfld)%lvl=lvlsxml(lp,iget(021))
1589 datapd(i,j,cfld) = grid1(i,jj)
1597 IF (iget(086) > 0)
THEN
1598 IF (lvls(lp,iget(086)) > 0)
THEN
1602 IF(fsl(i,j)<spval)
THEN
1603 egrid2(i,j) = fsl(i,j)*gi
1607 CALL calstrm(egrid2(1,jsta),egrid1(1,jsta))
1611 IF(fsl(i,j) < spval)
THEN
1612 grid1(i,j) = egrid1(i,j)
1618 if(grib ==
'grib2')
then
1620 fld_info(cfld)%ifld=iavblfld(iget(086))
1621 fld_info(cfld)%lvl=lvlsxml(lp,iget(086))
1626 datapd(i,j,cfld) = grid1(i,jj)
1635 IF (iget(022) > 0)
THEN
1636 IF (lvls(lp,iget(022)) > 0)
THEN
1640 grid1(i,j) = q2sl(i,j)
1643 if(grib ==
'grib2')
then
1645 fld_info(cfld)%ifld=iavblfld(iget(022))
1646 fld_info(cfld)%lvl=lvlsxml(lp,iget(022))
1651 datapd(i,j,cfld) = grid1(i,jj)
1660 IF (iget(153) > 0)
THEN
1661 IF (lvls(lp,iget(153)) > 0)
THEN
1662 IF(imp_physics==99 .or. imp_physics==98)
then
1667 IF(qw1(i,j) < spval .AND. qi1(i,j) < spval)
THEN
1668 grid1(i,j) = qw1(i,j) + qi1(i,j)
1679 grid1(i,j) = qw1(i,j)
1683 if(grib ==
'grib2')
then
1685 fld_info(cfld)%ifld=iavblfld(iget(153))
1686 fld_info(cfld)%lvl=lvlsxml(lp,iget(153))
1691 datapd(i,j,cfld) = grid1(i,jj)
1700 IF (iget(166) > 0)
THEN
1701 IF (lvls(lp,iget(166)) > 0)
THEN
1705 grid1(i,j) = qi1(i,j)
1708 if(grib ==
'grib2')
then
1710 fld_info(cfld)%ifld=iavblfld(iget(166))
1711 fld_info(cfld)%lvl=lvlsxml(lp,iget(166))
1716 datapd(i,j,cfld) = grid1(i,jj)
1724 IF (iget(183) > 0)
THEN
1725 IF (lvls(lp,iget(183)) > 0)
THEN
1729 grid1(i,j) = qr1(i,j)
1732 if(grib ==
'grib2')
then
1734 fld_info(cfld)%ifld=iavblfld(iget(183))
1735 fld_info(cfld)%lvl=lvlsxml(lp,iget(183))
1740 datapd(i,j,cfld) = grid1(i,jj)
1748 IF (iget(184) > 0)
THEN
1749 IF (lvls(lp,iget(184)) > 0)
THEN
1753 grid1(i,j) = qs1(i,j)
1756 if(grib ==
'grib2')
then
1758 fld_info(cfld)%ifld=iavblfld(iget(184))
1759 fld_info(cfld)%lvl=lvlsxml(lp,iget(184))
1764 datapd(i,j,cfld) = grid1(i,jj)
1772 IF (iget(416) > 0)
THEN
1773 IF (lvls(lp,iget(416)) > 0)
THEN
1777 grid1(i,j) = qg1(i,j)
1780 if(grib ==
'grib2')
then
1782 fld_info(cfld)%ifld=iavblfld(iget(416))
1783 fld_info(cfld)%lvl=lvlsxml(lp,iget(416))
1788 datapd(i,j,cfld) = grid1(i,jj)
1797 IF (iget(198) > 0)
THEN
1798 IF (lvls(lp,iget(198)) > 0)
THEN
1802 grid1(i,j) = c1d(i,j)
1805 if(grib ==
'grib2')
then
1807 fld_info(cfld)%ifld=iavblfld(iget(198))
1808 fld_info(cfld)%lvl=lvlsxml(lp,iget(198))
1813 datapd(i,j,cfld) = grid1(i,jj)
1821 IF (iget(263) > 0)
THEN
1822 IF (lvls(lp,iget(263)) > 0)
THEN
1826 grid1(i,j) = frime(i,j)
1829 if(grib ==
'grib2')
then
1831 fld_info(cfld)%ifld=iavblfld(iget(263))
1832 fld_info(cfld)%lvl=lvlsxml(lp,iget(263))
1837 datapd(i,j,cfld) = grid1(i,jj)
1845 IF (iget(294) > 0)
THEN
1846 IF (lvls(lp,iget(294)) > 0)
THEN
1850 grid1(i,j) = rad(i,j)
1853 if(grib ==
'grib2')
then
1855 fld_info(cfld)%ifld=iavblfld(iget(294))
1856 fld_info(cfld)%lvl=lvlsxml(lp,iget(294))
1861 datapd(i,j,cfld) = grid1(i,jj)
1869 IF (iget(251) > 0)
THEN
1870 IF (lvls(lp,iget(251)) > 0)
THEN
1874 grid1(i,j) = dbz1(i,j)
1877 if(grib ==
'grib2')
then
1879 fld_info(cfld)%ifld=iavblfld(iget(251))
1880 fld_info(cfld)%lvl=lvlsxml(lp,iget(251))
1885 datapd(i,j,cfld) = grid1(i,jj)
1893 IF(iget(257) > 0)
THEN
1894 IF(lvls(lp,iget(257)) > 0)
THEN
1895 CALL calicing(tsl(1,jsta), savrh, osl(1,jsta), egrid1(1,jsta))
1900 grid1(i,j) = egrid1(i,j)
1903 if(grib ==
'grib2')
then
1905 fld_info(cfld)%ifld=iavblfld(iget(257))
1906 fld_info(cfld)%lvl=lvlsxml(lp,iget(257))
1911 datapd(i,j,cfld) = grid1(i,jj)
1922 IF(iget(258) > 0)
THEN
1923 IF(lvls(lp,iget(258)) > 0)
THEN
1927 IF(fsl(i,j)<spval)
THEN
1928 grid1(i,j) = fsl(i,j)*gi
1935 CALL calcat(usl(1,jsta_2l),vsl(1,jsta_2l),grid1(1,jsta_2l) &
1936 ,usl_old(1,jsta_2l),vsl_old(1,jsta_2l) &
1937 ,fsl_old(1,jsta_2l),egrid1(1,jsta_2l))
1941 grid1(i,j) = egrid1(i,j)
1946 if(grib ==
'grib2')
then
1948 fld_info(cfld)%ifld=iavblfld(iget(258))
1949 fld_info(cfld)%lvl=lvlsxml(lp,iget(258))
1954 datapd(i,j,cfld) = grid1(i,jj)
1964 DO j=jsta_2l,jend_2u
1966 usl_old(i,j) = usl(i,j)
1967 vsl_old(i,j) = vsl(i,j)
1968 IF(fsl(i,j)<spval)
THEN
1969 fsl_old(i,j) = fsl(i,j)*gi
1971 fsl_old(i,j) = spval
1977 IF (iget(268) > 0)
THEN
1978 IF (lvls(lp,iget(268)) > 0)
THEN
1982 grid1(i,j) = o3sl(i,j)
1987 if(grib ==
'grib2')
then
1989 fld_info(cfld)%ifld=iavblfld(iget(268))
1990 fld_info(cfld)%lvl=lvlsxml(lp,iget(268))
1995 datapd(i,j,cfld) = grid1(i,jj)
2003 IF (iget(738) > 0)
THEN
2004 IF (lvls(lp,iget(738)) > 0)
THEN
2008 IF(smokesl(i,j,1)<spval.and.spl(lp)<spval.and.tsl(i,j)<spval)
THEN
2009 grid1(i,j) = (1./rd)*smokesl(i,j,1)*(spl(lp)/tsl(i,j))
2015 if(grib ==
'grib2')
then
2017 fld_info(cfld)%ifld=iavblfld(iget(738))
2018 fld_info(cfld)%lvl=lvlsxml(lp,iget(738))
2023 datapd(i,j,cfld) = grid1(i,jj)
2031 IF (iget(438) > 0)
THEN
2032 IF (lvls(lp,iget(438)) > 0)
THEN
2036 grid1(i,j) = dustsl(i,j,1)
2039 if(grib ==
'grib2')
then
2041 fld_info(cfld)%ifld=iavblfld(iget(438))
2042 fld_info(cfld)%lvl=lvlsxml(lp,iget(438))
2047 datapd(i,j,cfld) = grid1(i,jj)
2054 IF (iget(439) > 0)
THEN
2055 IF (lvls(lp,iget(439)) > 0)
THEN
2059 grid1(i,j) = dustsl(i,j,2)
2062 if(grib ==
'grib2')
then
2064 fld_info(cfld)%ifld=iavblfld(iget(439))
2065 fld_info(cfld)%lvl=lvlsxml(lp,iget(439))
2070 datapd(i,j,cfld) = grid1(i,jj)
2077 IF (iget(440) > 0)
THEN
2078 IF (lvls(lp,iget(440)) > 0)
THEN
2082 grid1(i,j) = dustsl(i,j,3)
2085 if(grib ==
'grib2')
then
2087 fld_info(cfld)%ifld=iavblfld(iget(440))
2088 fld_info(cfld)%lvl=lvlsxml(lp,iget(440))
2093 datapd(i,j,cfld) = grid1(i,jj)
2100 IF (iget(441) > 0)
THEN
2101 IF (lvls(lp,iget(441)) > 0)
THEN
2105 grid1(i,j) = dustsl(i,j,4)
2108 if(grib ==
'grib2')
then
2110 fld_info(cfld)%ifld=iavblfld(iget(441))
2111 fld_info(cfld)%lvl=lvlsxml(lp,iget(441))
2116 datapd(i,j,cfld) = grid1(i,jj)
2123 IF (iget(442) > 0)
THEN
2124 IF (lvls(lp,iget(442)) > 0)
THEN
2128 grid1(i,j) = dustsl(i,j,5)
2131 if(grib ==
'grib2')
then
2133 fld_info(cfld)%ifld=iavblfld(iget(442))
2134 fld_info(cfld)%lvl=lvlsxml(lp,iget(442))
2139 datapd(i,j,cfld) = grid1(i,jj)
2148 if(iostatusd3d==0 .and. d3d_on)
then
2150 IF (iget(355) > 0)
THEN
2151 IF (lvls(lp,iget(355)) > 0)
THEN
2155 grid1(i,j) = d3dsl(i,j,1)
2160 if (itd3d /= 0)
then
2161 ifincr = mod(ifhr,itd3d)
2162 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2168 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2170 IF (ifincr == 0)
THEN
2173 id(18) = ifhr-ifincr
2174 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2176 if(grib ==
'grib2')
then
2178 fld_info(cfld)%ifld=iavblfld(iget(355))
2179 fld_info(cfld)%lvl=lvlsxml(lp,iget(355))
2181 fld_info(cfld)%ntrange=0
2183 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2185 fld_info(cfld)%tinvstat=itd3d
2190 datapd(i,j,cfld) = grid1(i,jj)
2197 IF (iget(354) > 0)
THEN
2198 IF (lvls(lp,iget(354)) > 0)
THEN
2202 grid1(i,j) = d3dsl(i,j,2)
2207 if (itd3d /= 0)
then
2208 ifincr = mod(ifhr,itd3d)
2209 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2215 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2217 IF (ifincr == 0)
THEN
2220 id(18) = ifhr-ifincr
2221 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2223 if(grib ==
'grib2')
then
2225 fld_info(cfld)%ifld=iavblfld(iget(354))
2226 fld_info(cfld)%lvl=lvlsxml(lp,iget(354))
2228 fld_info(cfld)%ntrange=0
2230 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2232 fld_info(cfld)%tinvstat=itd3d
2237 datapd(i,j,cfld) = grid1(i,jj)
2244 IF (iget(356) > 0)
THEN
2245 IF (lvls(lp,iget(356)) > 0)
THEN
2249 grid1(i,j) = d3dsl(i,j,3)
2254 if (itd3d /= 0)
then
2255 ifincr = mod(ifhr,itd3d)
2256 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2262 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2264 IF (ifincr == 0)
THEN
2267 id(18) = ifhr-ifincr
2268 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2270 if(grib ==
'grib2')
then
2272 fld_info(cfld)%ifld=iavblfld(iget(356))
2273 fld_info(cfld)%lvl=lvlsxml(lp,iget(356))
2275 fld_info(cfld)%ntrange=0
2277 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2279 fld_info(cfld)%tinvstat=itd3d
2284 datapd(i,j,cfld) = grid1(i,jj)
2291 IF (iget(357) > 0)
THEN
2292 IF (lvls(lp,iget(357)) > 0)
THEN
2296 grid1(i,j) = d3dsl(i,j,4)
2301 if (itd3d /= 0)
then
2302 ifincr = mod(ifhr,itd3d)
2303 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2309 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2311 IF (ifincr == 0)
THEN
2314 id(18) = ifhr-ifincr
2315 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2317 if(grib ==
'grib2')
then
2319 fld_info(cfld)%ifld=iavblfld(iget(357))
2320 fld_info(cfld)%lvl=lvlsxml(lp,iget(357))
2322 fld_info(cfld)%ntrange=0
2324 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2326 fld_info(cfld)%tinvstat=itd3d
2331 datapd(i,j,cfld) = grid1(i,jj)
2338 IF (iget(358) > 0)
THEN
2339 IF (lvls(lp,iget(358)) > 0)
THEN
2343 grid1(i,j) = d3dsl(i,j,5)
2348 if (itd3d /= 0)
then
2349 ifincr = mod(ifhr,itd3d)
2350 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2356 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2358 IF (ifincr == 0)
THEN
2361 id(18) = ifhr-ifincr
2362 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2364 if(grib ==
'grib2')
then
2366 fld_info(cfld)%ifld=iavblfld(iget(358))
2367 fld_info(cfld)%lvl=lvlsxml(lp,iget(358))
2369 fld_info(cfld)%ntrange=0
2371 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2373 fld_info(cfld)%tinvstat=itd3d
2378 datapd(i,j,cfld) = grid1(i,jj)
2385 IF (iget(359) > 0)
THEN
2386 IF (lvls(lp,iget(359)) > 0)
THEN
2390 grid1(i,j) = d3dsl(i,j,6)
2395 if (itd3d /= 0)
then
2396 ifincr = mod(ifhr,itd3d)
2397 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2403 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2405 IF (ifincr == 0)
THEN
2408 id(18) = ifhr-ifincr
2409 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2411 if(grib ==
'grib2')
then
2413 fld_info(cfld)%ifld=iavblfld(iget(359))
2414 fld_info(cfld)%lvl=lvlsxml(lp,iget(359))
2416 fld_info(cfld)%ntrange=0
2418 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2420 fld_info(cfld)%tinvstat=itd3d
2425 datapd(i,j,cfld) = grid1(i,jj)
2432 IF (iget(360) > 0)
THEN
2433 IF (lvls(lp,iget(360)) > 0)
THEN
2437 grid1(i,j) = d3dsl(i,j,7)
2442 if (itd3d /= 0)
then
2443 ifincr = mod(ifhr,itd3d)
2444 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2450 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2452 IF (ifincr == 0)
THEN
2455 id(18) = ifhr-ifincr
2456 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2458 if(grib ==
'grib2')
then
2460 fld_info(cfld)%ifld=iavblfld(iget(360))
2461 fld_info(cfld)%lvl=lvlsxml(lp,iget(360))
2463 fld_info(cfld)%ntrange=0
2465 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2467 fld_info(cfld)%tinvstat=itd3d
2472 datapd(i,j,cfld) = grid1(i,jj)
2479 IF (iget(361) > 0)
THEN
2480 IF (lvls(lp,iget(361)) > 0)
THEN
2484 grid1(i,j) = d3dsl(i,j,8)
2489 if (itd3d /= 0)
then
2490 ifincr = mod(ifhr,itd3d)
2491 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2497 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2499 IF (ifincr == 0)
THEN
2502 id(18) = ifhr-ifincr
2503 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2505 if(grib ==
'grib2')
then
2507 fld_info(cfld)%ifld=iavblfld(iget(361))
2508 fld_info(cfld)%lvl=lvlsxml(lp,iget(361))
2510 fld_info(cfld)%ntrange=0
2512 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2514 fld_info(cfld)%tinvstat=itd3d
2519 datapd(i,j,cfld) = grid1(i,jj)
2526 IF (iget(362) > 0)
THEN
2527 IF (lvls(lp,iget(362)) > 0)
THEN
2531 grid1(i,j) = d3dsl(i,j,9)
2536 if (itd3d /= 0)
then
2537 ifincr = mod(ifhr,itd3d)
2538 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2544 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2546 IF (ifincr == 0)
THEN
2549 id(18) = ifhr-ifincr
2550 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2552 if(grib ==
'grib2')
then
2554 fld_info(cfld)%ifld=iavblfld(iget(362))
2555 fld_info(cfld)%lvl=lvlsxml(lp,iget(362))
2557 fld_info(cfld)%ntrange=0
2559 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2561 fld_info(cfld)%tinvstat=itd3d
2566 datapd(i,j,cfld) = grid1(i,jj)
2573 IF (iget(363) > 0)
THEN
2574 IF (lvls(lp,iget(363)) > 0)
THEN
2578 grid1(i,j) = d3dsl(i,j,10)
2583 if (itd3d /= 0)
then
2584 ifincr = mod(ifhr,itd3d)
2585 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2592 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2594 IF (ifincr == 0)
THEN
2597 id(18) = ifhr-ifincr
2598 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2600 if(grib ==
'grib2')
then
2602 fld_info(cfld)%ifld=iavblfld(iget(363))
2603 fld_info(cfld)%lvl=lvlsxml(lp,iget(363))
2605 fld_info(cfld)%ntrange=0
2607 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2609 fld_info(cfld)%tinvstat=itd3d
2614 datapd(i,j,cfld) = grid1(i,jj)
2621 IF (iget(364) > 0)
THEN
2622 IF (lvls(lp,iget(364)) > 0)
THEN
2626 grid1(i,j) = d3dsl(i,j,11)
2631 if (itd3d /= 0)
then
2632 ifincr = mod(ifhr,itd3d)
2633 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2640 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2642 IF (ifincr == 0)
THEN
2645 id(18) = ifhr-ifincr
2646 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2648 if(grib ==
'grib2')
then
2650 fld_info(cfld)%ifld=iavblfld(iget(364))
2651 fld_info(cfld)%lvl=lvlsxml(lp,iget(364))
2653 fld_info(cfld)%ntrange=0
2655 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2657 fld_info(cfld)%tinvstat=itd3d
2662 datapd(i,j,cfld) = grid1(i,jj)
2669 IF (iget(365) > 0)
THEN
2670 IF (lvls(lp,iget(365)) > 0)
THEN
2674 grid1(i,j) = d3dsl(i,j,12)
2679 if (itd3d /= 0)
then
2680 ifincr = mod(ifhr,itd3d)
2681 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2688 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2690 IF (ifincr == 0)
THEN
2693 id(18) = ifhr-ifincr
2694 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2696 if(grib ==
'grib2')
then
2698 fld_info(cfld)%ifld=iavblfld(iget(365))
2699 fld_info(cfld)%lvl=lvlsxml(lp,iget(365))
2701 fld_info(cfld)%ntrange=0
2703 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2705 fld_info(cfld)%tinvstat=itd3d
2710 datapd(i,j,cfld) = grid1(i,jj)
2717 IF (iget(366) > 0)
THEN
2718 IF (lvls(lp,iget(366)) > 0)
THEN
2722 grid1(i,j) = d3dsl(i,j,13)
2727 if (itd3d /= 0)
then
2728 ifincr = mod(ifhr,itd3d)
2729 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2736 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2738 IF (ifincr == 0)
THEN
2741 id(18) = ifhr-ifincr
2742 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2744 if(grib ==
'grib2')
then
2746 fld_info(cfld)%ifld=iavblfld(iget(366))
2747 fld_info(cfld)%lvl=lvlsxml(lp,iget(366))
2749 fld_info(cfld)%ntrange=0
2751 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2753 fld_info(cfld)%tinvstat=itd3d
2758 datapd(i,j,cfld) = grid1(i,jj)
2765 IF (iget(367) > 0)
THEN
2766 IF (lvls(lp,iget(367)) > 0)
THEN
2770 grid1(i,j) = d3dsl(i,j,14)
2775 if (itd3d /= 0)
then
2776 ifincr = mod(ifhr,itd3d)
2777 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2784 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2786 IF (ifincr == 0)
THEN
2789 id(18) = ifhr-ifincr
2790 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2792 if(grib ==
'grib2')
then
2794 fld_info(cfld)%ifld=iavblfld(iget(367))
2795 fld_info(cfld)%lvl=lvlsxml(lp,iget(367))
2797 fld_info(cfld)%ntrange=0
2799 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2801 fld_info(cfld)%tinvstat=itd3d
2806 datapd(i,j,cfld) = grid1(i,jj)
2813 IF (iget(368) > 0)
THEN
2814 IF (lvls(lp,iget(368)) > 0)
THEN
2818 grid1(i,j) = d3dsl(i,j,15)
2823 if (itd3d /= 0)
then
2824 ifincr = mod(ifhr,itd3d)
2825 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2832 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2834 IF (ifincr == 0)
THEN
2837 id(18) = ifhr-ifincr
2838 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2840 if(grib ==
'grib2')
then
2842 fld_info(cfld)%ifld=iavblfld(iget(368))
2843 fld_info(cfld)%lvl=lvlsxml(lp,iget(368))
2845 fld_info(cfld)%ntrange=0
2847 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2849 fld_info(cfld)%tinvstat=itd3d
2854 datapd(i,j,cfld) = grid1(i,jj)
2861 IF (iget(369) > 0)
THEN
2862 IF (lvls(lp,iget(369)) > 0)
THEN
2866 grid1(i,j) = d3dsl(i,j,16)
2871 if (itd3d /= 0)
then
2872 ifincr = mod(ifhr,itd3d)
2873 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2879 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2881 IF (ifincr == 0)
THEN
2884 id(18) = ifhr-ifincr
2885 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2887 if(grib ==
'grib2')
then
2889 fld_info(cfld)%ifld=iavblfld(iget(369))
2890 fld_info(cfld)%lvl=lvlsxml(lp,iget(369))
2892 fld_info(cfld)%ntrange=0
2894 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2896 fld_info(cfld)%tinvstat=itd3d
2901 datapd(i,j,cfld) = grid1(i,jj)
2908 IF (iget(370) > 0)
THEN
2909 IF (lvls(lp,iget(370)) > 0)
THEN
2913 grid1(i,j) = d3dsl(i,j,17)
2918 if (itd3d /= 0)
then
2919 ifincr = mod(ifhr,itd3d)
2920 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2927 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2929 IF (ifincr == 0)
THEN
2932 id(18) = ifhr-ifincr
2933 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2935 if(grib ==
'grib2')
then
2937 fld_info(cfld)%ifld=iavblfld(iget(370))
2938 fld_info(cfld)%lvl=lvlsxml(lp,iget(370))
2940 fld_info(cfld)%ntrange=0
2942 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2944 fld_info(cfld)%tinvstat=itd3d
2949 datapd(i,j,cfld) = grid1(i,jj)
2956 IF (iget(371) > 0)
THEN
2957 IF (lvls(lp,iget(371)) > 0)
THEN
2961 grid1(i,j) = d3dsl(i,j,18)
2966 if (itd3d /= 0)
then
2967 ifincr = mod(ifhr,itd3d)
2968 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
2975 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
2977 IF (ifincr == 0)
THEN
2980 id(18) = ifhr-ifincr
2981 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
2983 if(grib ==
'grib2')
then
2985 fld_info(cfld)%ifld=iavblfld(iget(371))
2986 fld_info(cfld)%lvl=lvlsxml(lp,iget(371))
2988 fld_info(cfld)%ntrange=0
2990 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
2992 fld_info(cfld)%tinvstat=itd3d
2997 datapd(i,j,cfld) = grid1(i,jj)
3004 IF (iget(372) > 0)
THEN
3005 IF (lvls(lp,iget(372)) > 0)
THEN
3009 grid1(i,j) = d3dsl(i,j,19)
3014 if (itd3d /= 0)
then
3015 ifincr = mod(ifhr,itd3d)
3016 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3022 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3024 IF (ifincr == 0)
THEN
3027 id(18) = ifhr-ifincr
3028 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3030 if(grib ==
'grib2')
then
3032 fld_info(cfld)%ifld=iavblfld(iget(372))
3033 fld_info(cfld)%lvl=lvlsxml(lp,iget(372))
3035 fld_info(cfld)%ntrange=0
3037 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3039 fld_info(cfld)%tinvstat=itd3d
3044 datapd(i,j,cfld) = grid1(i,jj)
3051 IF (iget(373) > 0)
THEN
3052 IF (lvls(lp,iget(373)) > 0)
THEN
3056 grid1(i,j) = d3dsl(i,j,20)
3061 if (itd3d /= 0)
then
3062 ifincr = mod(ifhr,itd3d)
3063 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3070 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3072 IF (ifincr == 0)
THEN
3075 id(18) = ifhr-ifincr
3076 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3078 if(grib ==
'grib2')
then
3080 fld_info(cfld)%ifld=iavblfld(iget(373))
3081 fld_info(cfld)%lvl=lvlsxml(lp,iget(373))
3083 fld_info(cfld)%ntrange=0
3085 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3087 fld_info(cfld)%tinvstat=itd3d
3092 datapd(i,j,cfld) = grid1(i,jj)
3099 IF (iget(374) > 0)
THEN
3100 IF (lvls(lp,iget(374)) > 0)
THEN
3104 grid1(i,j) = d3dsl(i,j,21)
3109 if (itd3d /= 0)
then
3110 ifincr = mod(ifhr,itd3d)
3111 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3118 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3120 IF (ifincr == 0)
THEN
3123 id(18) = ifhr-ifincr
3124 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3126 if(grib ==
'grib2')
then
3128 fld_info(cfld)%ifld=iavblfld(iget(374))
3129 fld_info(cfld)%lvl=lvlsxml(lp,iget(374))
3131 fld_info(cfld)%ntrange=0
3133 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3135 fld_info(cfld)%tinvstat=itd3d
3140 datapd(i,j,cfld) = grid1(i,jj)
3147 IF (iget(375) > 0)
THEN
3148 IF (lvls(lp,iget(375)) > 0)
THEN
3152 grid1(i,j) = d3dsl(i,j,22)
3157 if (itd3d /= 0)
then
3158 ifincr = mod(ifhr,itd3d)
3159 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3165 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3167 IF (ifincr == 0)
THEN
3170 id(18) = ifhr-ifincr
3171 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3173 if(grib ==
'grib2')
then
3175 fld_info(cfld)%ifld=iavblfld(iget(375))
3176 fld_info(cfld)%lvl=lvlsxml(lp,iget(375))
3178 fld_info(cfld)%ntrange=0
3180 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3182 fld_info(cfld)%tinvstat=itd3d
3187 datapd(i,j,cfld) = grid1(i,jj)
3194 IF (iget(379) > 0)
THEN
3195 IF (lvls(lp,iget(379)) > 0)
THEN
3199 IF(d3dsl(i,j,1)/=spval)
THEN
3200 grid1(i,j) = d3dsl(i,j,1) + d3dsl(i,j,2) &
3201 + d3dsl(i,j,3) + d3dsl(i,j,4) &
3202 + d3dsl(i,j,5) + d3dsl(i,j,6)
3210 if (itd3d /= 0)
then
3211 ifincr = mod(ifhr,itd3d)
3212 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3218 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3220 IF (ifincr == 0)
THEN
3223 id(18) = ifhr-ifincr
3224 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3226 if(grib ==
'grib2')
then
3228 fld_info(cfld)%ifld=iavblfld(iget(379))
3229 fld_info(cfld)%lvl=lvlsxml(lp,iget(379))
3231 fld_info(cfld)%ntrange=0
3233 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3235 fld_info(cfld)%tinvstat=itd3d
3240 datapd(i,j,cfld) = grid1(i,jj)
3247 IF (iget(391) > 0)
THEN
3248 IF (lvls(lp,iget(391)) > 0)
THEN
3252 grid1(i,j) = d3dsl(i,j,23)
3257 if (itd3d /= 0)
then
3258 ifincr = mod(ifhr,itd3d)
3259 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3266 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3268 IF (ifincr == 0)
THEN
3271 id(18) = ifhr-ifincr
3272 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3274 if(grib ==
'grib2')
then
3276 fld_info(cfld)%ifld=iavblfld(iget(391))
3277 fld_info(cfld)%lvl=lvlsxml(lp,iget(391))
3279 fld_info(cfld)%ntrange=0
3281 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3283 fld_info(cfld)%tinvstat=itd3d
3288 datapd(i,j,cfld) = grid1(i,jj)
3295 IF (iget(392) > 0)
THEN
3296 IF (lvls(lp,iget(392)) > 0)
THEN
3300 grid1(i,j) = d3dsl(i,j,24)
3305 if (itd3d /= 0)
then
3306 ifincr = mod(ifhr,itd3d)
3307 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3314 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3316 IF (ifincr == 0)
THEN
3319 id(18) = ifhr-ifincr
3320 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3322 if(grib ==
'grib2')
then
3324 fld_info(cfld)%ifld=iavblfld(iget(392))
3325 fld_info(cfld)%lvl=lvlsxml(lp,iget(392))
3327 fld_info(cfld)%ntrange=0
3329 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3331 fld_info(cfld)%tinvstat=itd3d
3336 datapd(i,j,cfld) = grid1(i,jj)
3343 IF (iget(393) > 0)
THEN
3344 IF (lvls(lp,iget(393)) > 0)
THEN
3348 grid1(i,j) = d3dsl(i,j,25)
3353 if (itd3d /= 0)
then
3354 ifincr = mod(ifhr,itd3d)
3355 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3362 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3364 IF (ifincr == 0)
THEN
3367 id(18) = ifhr-ifincr
3368 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3370 if(grib ==
'grib2')
then
3372 fld_info(cfld)%ifld=iavblfld(iget(393))
3373 fld_info(cfld)%lvl=lvlsxml(lp,iget(393))
3375 fld_info(cfld)%ntrange=0
3377 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3379 fld_info(cfld)%tinvstat=itd3d
3384 datapd(i,j,cfld) = grid1(i,jj)
3391 IF (iget(394) > 0)
THEN
3392 IF (lvls(lp,iget(394)) > 0)
THEN
3396 grid1(i,j) = d3dsl(i,j,26)
3401 if (itd3d /= 0)
then
3402 ifincr = mod(ifhr,itd3d)
3403 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3410 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3412 IF (ifincr == 0)
THEN
3415 id(18) = ifhr-ifincr
3416 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3418 if(grib ==
'grib2')
then
3420 fld_info(cfld)%ifld=iavblfld(iget(394))
3421 fld_info(cfld)%lvl=lvlsxml(lp,iget(394))
3423 fld_info(cfld)%ntrange=0
3425 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3427 fld_info(cfld)%tinvstat=itd3d
3432 datapd(i,j,cfld) = grid1(i,jj)
3439 IF (iget(395) > 0)
THEN
3440 IF (lvls(lp,iget(395)) > 0)
THEN
3444 grid1(i,j) = d3dsl(i,j,27)
3449 if (itd3d /= 0)
then
3450 ifincr = mod(ifhr,itd3d)
3451 IF(ifmin >= 1)ifincr= mod(ifhr*60+ifmin,itd3d*60)
3458 IF(ifmin >= 1)id(19)=ifhr*60+ifmin
3460 IF (ifincr == 0)
THEN
3463 id(18) = ifhr-ifincr
3464 IF(ifmin >= 1)id(18)=ifhr*60+ifmin-ifincr
3466 if(grib ==
'grib2')
then
3468 fld_info(cfld)%ifld=iavblfld(iget(395))
3469 fld_info(cfld)%lvl=lvlsxml(lp,iget(395))
3471 fld_info(cfld)%ntrange=0
3473 fld_info(cfld)%ntrange=(ifhr-id(18))/itd3d
3475 fld_info(cfld)%tinvstat=itd3d
3480 datapd(i,j,cfld) = grid1(i,jj)
3489 IF (iget(455) > 0)
THEN
3491 jj=(jsta+jend)/2-100
3492 IF(abs(spl(lp)-50000.)<small) luhi=lp
3493 IF(abs(spl(lp)-70000.)<small)
THEN
3500 egrid2(i,j) = spl(lp)
3503 CALL caldwp(egrid2(1,jsta),qsl(1,jsta),tdsl(1,jsta),tsl(1,jsta))
3508 IF(sm(i,j) < 1.0 .AND. zint(i,j,lm+1) < fsl(i,j)*gi)
THEN
3509 dum1 = tsl(i,j)-tprs(i,j,luhi)
3512 ELSE IF(dum1 > 17. .AND. dum1 <= 21.)
THEN
3517 dum1 = tsl(i,j)-tdsl(i,j)
3518 IF(dum1 <= 14.)
THEN
3520 ELSE IF(dum1>14. .AND. dum1<=20.)
THEN
3525 IF(tsl(i,j)<spval.and.tprs(i,j,luhi)<spval.and.tdsl(i,j)<spval)
THEN
3526 haines(i,j) = ista + imois
3539 IF(abs(spl(lp)-85000.)<small)
THEN
3544 egrid2(i,j) = spl(lp)
3547 CALL caldwp(egrid2(1,jsta),qsl(1,jsta),tdsl(1,jsta),tsl(1,jsta))
3552 IF(sm(i,j) < 1.0 .AND. zint(i,j,lm+1) < fsl(i,j)*gi)
THEN
3553 dum1 = tsl(i,j)-tprs(i,j,luhi)
3556 ELSE IF(dum1 > 5. .AND. dum1 <= 10.)
THEN
3561 dum1 = tsl(i,j)-tdsl(i,j)
3564 ELSE IF(dum1 > 5. .AND. dum1 <= 12.)
THEN
3571 IF(tsl(i,j)<spval.and.tprs(i,j,luhi)<spval.and.tdsl(i,j)<spval)
THEN
3572 haines(i,j) = ista + imois
3583 IF(abs(spl(lp)-95000.)<small)
THEN
3591 CALL caldwp(egrid2(1,jsta),qsl(1,jsta),tdsl(1,jsta),tsl(1,jsta))
3596 IF(sm(i,j) < 1.0 .AND. zint(i,j,lm+1) < fsl(i,j)*gi)
THEN
3597 dum1 = tsl(i,j)-tprs(i,j,luhi)
3600 ELSE IF(dum1 > 3. .AND. dum1 <=7. )
THEN
3605 dum1 = tsl(i,j)-tdsl(i,j)
3608 ELSE IF(dum1 > 5. .AND. dum1 <= 9.)
THEN
3615 IF(tsl(i,j)<spval.and.tprs(i,j,luhi)<spval.and.tdsl(i,j)<spval)
THEN
3616 haines(i,j) = ista + imois
3624 if(grib ==
'grib2')
then
3626 fld_info(cfld)%ifld=iavblfld(iget(455))
3631 datapd(i,j,cfld) = haines(i,jj)
3647 IF (iget(423) > 0)
THEN
3653 grid1(i,j) = w_up_max(i,j)
3657 if(grib ==
'grib2')
then
3659 fld_info(cfld)%ifld = iavblfld(iget(423))
3660 fld_info(cfld)%lvl = lvlsxml(lp,iget(423))
3662 fld_info(cfld)%tinvstat=1
3664 fld_info(cfld)%tinvstat=0
3666 fld_info(cfld)%ntrange=1
3671 datapd(i,j,cfld) = grid1(i,jj)
3679 IF (iget(424) > 0)
THEN
3684 grid1(i,j) = w_dn_max(i,j)
3687 if(grib ==
'grib2')
then
3689 fld_info(cfld)%ifld=iavblfld(iget(424))
3690 fld_info(cfld)%lvl=lvlsxml(lp,iget(424))
3692 fld_info(cfld)%tinvstat=1
3694 fld_info(cfld)%tinvstat=0
3696 fld_info(cfld)%ntrange=1
3701 datapd(i,j,cfld) = grid1(i,jj)
3714 IF (iget(425) > 0)
THEN
3719 grid1(i,j) = w_mean(i,j)
3722 if(grib ==
'grib2')
then
3724 fld_info(cfld)%ifld = iavblfld(iget(425))
3725 fld_info(cfld)%lvl = lvlsxml(lp,iget(425))
3727 fld_info(cfld)%tinvstat = 0
3729 fld_info(cfld)%tinvstat = 1
3731 fld_info(cfld)%ntrange = 1
3736 datapd(i,j,cfld) = grid1(i,jj)
3747 IF(iget(023) > 0)
THEN
3748 IF(gridtype ==
'A'.OR. gridtype ==
'B')
then
3749 if(me==0)print*,
'CALLING MEMSLP for A or B grid'
3750 CALL memslp(tprs,qprs,fprs)
3751 if(me==0)print*,
'aft CALLING MEMSLP for A or B grid,pslp=', &
3752 maxval(pslp(1:im,jsta:jend)),minval(pslp(1:im,jsta:jend)),pslp(im/2,(jsta+jend)/2)
3753 ELSE IF (gridtype ==
'E')
THEN
3754 if(me==0)print*,
'CALLING MEMSLP_NMM for E grid'
3755 CALL memslp_nmm(tprs,qprs,fprs)
3757 print*,
'unknow grid type-> WONT DERIVE MESINGER SLP'
3762 grid1(i,j) = pslp(i,j)
3767 if(grib ==
'grib2')
then
3769 fld_info(cfld)%ifld = iavblfld(iget(023))
3774 datapd(i,j,cfld) = grid1(i,jj)
3781 IF(iget(445) > 0)
THEN
3782 if(me==0)print*,
'CALLING MAPS SLP'
3787 grid1(i,j) = pslp(i,j)
3790 if(grib ==
'grib2')
then
3792 fld_info(cfld)%ifld = iavblfld(iget(445))
3797 datapd(i,j,cfld) = grid1(i,jj)
3805 IF(iget(023) > 0.OR.iget(445) > 0)
THEN
3806 IF(iget(012) > 0)
THEN
3810 IF(abs(spl(lp)-1.0e5) <= 1.0e-5)
THEN
3811 IF(lvls(lp,iget(012)) > 0)
THEN
3813 IF(modelname ==
'GFS')
THEN
3819 IF(fsl(i,j)<spval)
THEN
3820 grid1(i,j) = fsl(i,j)*gi
3830 IF(pslp(i,j) < spval)
THEN
3833 psfc = pint(i,j,nint(lmh(i,j))+1)
3834 IF(abs(pslpij-psfc) < 5.e2)
THEN
3835 grid1(i,j) = rd*tprs(i,j,lp)*(alpsl-alpth)
3837 grid1(i,j) = fis(i,j)/(alpsl-log(psfc))*(alpsl-alpth)
3839 z1000(i,j) = grid1(i,j)*gi
3840 grid1(i,j) = z1000(i,j)
3850 nsmooth = nint(5.*(13500./dxm))
3851 call allgetherv(grid1)
3853 CALL smooth(grid1,sdummy,im,jm,0.5)
3857 if(grib ==
'grib2')
then
3859 fld_info(cfld)%ifld = iavblfld(iget(012))
3860 fld_info(cfld)%lvl = lvlsxml(lp,iget(012))
3865 datapd(i,j,cfld) = grid1(i,jj)
3876 if(
allocated(d3dsl))
deallocate(d3dsl)
3877 if(
allocated(dustsl))
deallocate(dustsl)
3878 if(
allocated(smokesl))
deallocate(smokesl)
elemental real function, public fpvsnew(t)
calcape() computes CAPE/CINS and other storm related variables.