34 use vrbls3d,
only: pmid, t, uh, q, vh, zmid, omga, pint
36 use masks,
only: gdlat, gdlon, dx, dy
37 use physcons_post,
only: con_eps, con_epsm1
38 use params_mod,
only: dtr, small, erad, d608, rhmin
39 use ctlblk_mod,
only: spval, lm, jsta_2l, jend_2u, grib, cfld, datapd, fld_info,&
40 im, jm, jsta, jend, jsta_m, jend_m, modelname, global,gdsdegr,me,&
41 ista, iend, ista_m, iend_m, ista_2l, iend_2u
42 use rqstfld_mod,
only: iget, lvls, id, iavblfld, lvlsxml
43 use gridspec_mod,
only: gridtype,dyval
44 use upp_physics,
only: fpvsnew
45 use upp_math,
only: dvdxdudy, ddvdx, ddudy, uuavg, h2u
51 integer,
intent(in) :: kth, kpv
52 real,
intent(in) :: th(kth), pv(kpv)
53 real,
dimension(ista:iend,jsta:jend) :: grid1, grid2
54 real,
dimension(kpv) :: pvpt, pvpb
57 LOGICAL LTH(KTH), LPV(KPV)
59 REAL,
allocatable:: DUM1D1(:), DUM1D2(:), DUM1D3(:),DUM1D4(:) &
60 , dum1d5(:), dum1d6(:), dum1d7(:),dum1d8(:) &
61 , dum1d9(:), dum1d10(:),dum1d11(:) &
62 , dum1d12(:),dum1d13(:),dum1d14(:)
64 real,
dimension(ISTA:IEND,JSTA:JEND,KTH) :: UTH, VTH, HMTH, TTH, PVTH, &
66 real,
dimension(ISTA:IEND,JSTA:JEND,KPV) :: UPV, VPV, HPV, TPV, PPV, SPV
67 real,
dimension(IM,2) :: GLATPOLES, COSLPOLES, PVPOLES
68 real,
dimension(IM,2,LM) :: UPOLES, TPOLES, PPOLES
69 real,
dimension(IM,JSTA:JEND) :: COSLTEMP, PVTEMP
71 real,
allocatable :: wrk1(:,:), wrk2(:,:), wrk3(:,:), wrk4(:,:), cosl(:,:), dum2d(:,:)
72 real,
allocatable :: tuv(:,:,:),pmiduv(:,:,:)
74 integer,
dimension(im) :: iw, ie
75 integer I,J,L,K,lp,imb2,ip1,im1,ii,jj,jmt2,ihw,ihe
76 real DVDX,DUDY,UAVG,TPHI, es, qstl, eradi, tem
77 real,
allocatable :: DVDXL(:,:,:), DUDYL(:,:,:), UAVGL(:,:,:)
93 IF((iget(332) > 0).OR.(iget(333) > 0).OR. &
94 (iget(334) > 0).OR.(iget(335) > 0).OR. &
95 (iget(336) > 0).OR.(iget(337) > 0).OR. &
96 (iget(338) > 0).OR.(iget(339) > 0).OR. &
97 (iget(340) > 0).OR.(iget(341) > 0).OR. &
98 (iget(351) > 0).OR.(iget(352) > 0).OR. &
99 (iget(353) > 0).OR.(iget(378) > 0) )
THEN
120 sigmath(i,j,k) = spval
139 ALLOCATE(dum1d1(lm), dum1d2(lm), dum1d3(lm),dum1d4(lm))
140 ALLOCATE(dum1d5(lm), dum1d6(lm))
141 ALLOCATE(dum1d7(lm), dum1d8(lm), dum1d9(lm),dum1d10(lm))
142 ALLOCATE(dum1d11(lm),dum1d12(lm),dum1d13(lm))
143 ALLOCATE(dum1d14(lm))
146 CALL exch(pmid(ista_2l:iend_2u,jsta_2l:jend_2u,l))
147 CALL exch(t(ista_2l:iend_2u,jsta_2l:jend_2u,l))
148 CALL exch(uh(ista_2l:iend_2u,jsta_2l:jend_2u,l))
149 CALL exch(vh(ista_2l:iend_2u,jsta_2l:jend_2u,l))
151 CALL exch(gdlat(ista_2l,jsta_2l))
152 CALL exch(gdlon(ista_2l,jsta_2l))
159 allocate (wrk1(ista:iend,jsta:jend), wrk2(ista:iend,jsta:jend), &
160 & wrk3(ista:iend,jsta:jend), cosl(ista_2l:iend_2u,jsta_2l:jend_2u))
161 allocate (dum2d(ista_2l:iend_2u,jsta_2l:jend_2u))
162 allocate (wrk4(ista:iend,jsta:jend))
168 IF(gridtype ==
'A')
THEN
182 cosl(i,j) = cos(gdlat(i,j)*dtr)
183 IF(cosl(i,j) >= small)
then
184 wrk1(i,j) = eradi / cosl(i,j)
188 if(i == im .or. i == 1)
then
189 wrk2(i,j) = 1.0 / ((360.+gdlon(ip1,j)-gdlon(im1,j))*dtr)
191 wrk2(i,j) = 1.0 / ((gdlon(ip1,j)-gdlon(im1,j))*dtr)
193 wrk4(i,j) = wrk1(i,j) * wrk2(i,j)
199 call fullpole(gdlat(ista_2l:iend_2u,jsta_2l:jend_2u),glatpoles)
206 if (ii > im) ii = ii - im
208 wrk3(i,j) = 1.0 / ((180.-gdlat(i,j+1)-glatpoles(ii,1))*dtr)
210 elseif (j == jm)
then
213 if (ii > im) ii = ii - im
215 wrk3(i,j) = 1.0 / ((180.+gdlat(i,j-1)+glatpoles(ii,2))*dtr)
218 !print *,
' j=',j,
' GDLATJm1=',gdlat(:,j-1)
219 !print *,
' j=',j,
' GDLATJp1=',gdlat(:,j+1)
221 tem = gdlat(i,j-1) - gdlat(i,j+1)
222 if (abs(tem) > small)
then
223 wrk3(i,j) = 1.0 / (tem*dtr)
236 wrk2(i,j) = 0.5 / dx(i,j)
237 wrk3(i,j) = 0.5 / dy(i,j)
243 IF(gridtype ==
'E')
THEN
244 allocate(tuv(ista_2l:iend_2u,jsta_2l:jend_2u,lm))
245 allocate(pmiduv(ista_2l:iend_2u,jsta_2l:jend_2u,lm))
247 call h2u(t(ista_2l:iend_2u,jsta_2l:jend_2u,l),tuv(ista_2l:iend_2u,jsta_2l:jend_2u,l))
248 call h2u(pmid(ista_2l:iend_2u,jsta_2l:jend_2u,l),pmiduv(ista_2l:iend_2u,jsta_2l:jend_2u,l))
253 IF(gridtype ==
'A')
THEN
254 IF(modelname ==
'GFS' .or. global)
THEN
257 CALL fullpole(pmid(ista_2l:iend_2u,jsta_2l:jend_2u,l),ppoles(:,:,l))
258 CALL fullpole( t(ista_2l:iend_2u,jsta_2l:jend_2u,l),tpoles(:,:,l))
259 CALL fullpole( uh(ista_2l:iend_2u,jsta_2l:jend_2u,l),upoles(:,:,l))
267 if (ii > im) ii = ii - im
270 IF(cosl(i,j) >= small)
THEN
271 tem = wrk3(i,j) * eradi
274 dum1d5(l) = t(i,j,l)*(1.+d608*q(i,j,l))
275 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
276 dum1d14(l) = q(i,j,l) * (pmid(i,j,l)+con_epsm1*es)/(con_eps*es)
277 dum1d1(l) = (pmid(ip1,j,l)- pmid(im1,j,l)) * wrk4(i,j)
278 dum1d3(l) = (t(ip1,j,l) - t(im1,j,l)) * wrk4(i,j)
280 dum1d2(l) = (ppoles(ii,1,l) - pmid(i,j+1,l)) * tem
282 dum1d4(l) = (tpoles(ii,1,l) - t(i,j+1,l)) * tem
283 dum1d6(l) = ((vh(ip1,j,l)-vh(im1,j,l))*wrk2(i,j) &
285 & + (upoles(ii,1,l)*coslpoles(ii,1) &
286 & + uh(i,j+1,l)*cosl(i,j+1))*wrk3(i,j))*wrk1(i,j) &
291 tem = wrk3(i,jj) * eradi
294 dum1d5(l) = t(i,j,l)*(1.+d608*q(i,j,l))
295 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
296 dum1d14(l) = q(i,j,l) * (pmid(i,j,l)+con_epsm1*es)/(con_eps*es)
297 dum1d1(l) = (pmid(ip1,jj,l)- pmid(im1,jj,l)) * wrk4(i,jj)
298 dum1d3(l) = (t(ip1,jj,l) - t(im1,jj,l)) * wrk4(i,jj)
299 dum1d2(l) = (pmid(i,j,l)-pmid(i,jj+1,l)) * tem
300 dum1d4(l) = (t(i,j,l) - t(i,jj+1,l)) * tem
301 dum1d6(l) = ((vh(ip1,jj,l)-vh(im1,jj,l))*wrk2(i,jj) &
302 & + (uh(i,j,l)*cosl(i,j) &
303 + uh(i,jj+1,l)*cosl(i,jj+1))*wrk3(i,jj))*wrk1(i,jj) &
307 ELSE IF(j == jm)
THEN
308 IF(cosl(i,j) >= small)
THEN
309 tem = wrk3(i,j) * eradi
312 dum1d5(l) = t(i,j,l)*(1.+d608*q(i,j,l))
313 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
314 dum1d14(l) = q(i,j,l) * (pmid(i,j,l)+con_epsm1*es)/(con_eps*es)
315 dum1d1(l) = (pmid(ip1,j,l)- pmid(im1,j,l)) * wrk4(i,j)
316 dum1d3(l) = (t(ip1,j,l) - t(im1,j,l)) * wrk4(i,j)
318 dum1d2(l) = (pmid(i,j-1,l)-ppoles(ii,2,l)) * tem
320 dum1d4(l) = (t(i,j-1,l)-tpoles(ii,2,l)) * tem
321 dum1d6(l) = ((vh(ip1,j,l)-vh(im1,j,l))* wrk2(i,j) &
322 & + (uh(i,j-1,l)*cosl(i,j-1) &
324 & + upoles(ii,2,l)*coslpoles(ii,2))*wrk3(i,j))*wrk1(i,j) &
329 tem = wrk3(i,jj) * eradi
332 dum1d5(l) = t(i,j,l)*(1.+d608*q(i,j,l))
333 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
334 dum1d14(l) = q(i,j,l) * (pmid(i,j,l)+con_epsm1*es)/(con_eps*es)
335 dum1d1(l) = (pmid(ip1,jj,l)- pmid(im1,jj,l)) * wrk4(i,jj)
336 dum1d3(l) = (t(ip1,jj,l) - t(im1,jj,l)) * wrk4(i,jj)
337 dum1d2(l) = (pmid(i,jj-1,l)-pmid(i,j,l)) * tem
338 dum1d4(l) = (t(i,jj-1,l)-t(i,j,l)) * tem
339 dum1d6(l) = ((vh(ip1,jj,l)-vh(im1,jj,l))*wrk2(i,jj) &
340 & + (uh(i,jj-1,l)*cosl(i,jj-1) &
341 & + uh(i,j,l)*cosl(i,j))*wrk3(i,jj))*wrk1(i,jj) &
346 tem = wrk3(i,j) * eradi
349 dum1d5(l) = t(i,j,l)*(1.+d608*q(i,j,l))
350 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
351 dum1d14(l) = q(i,j,l) * (pmid(i,j,l)+con_epsm1*es)/(con_eps*es)
352 dum1d1(l) = (pmid(ip1,j,l)- pmid(im1,j,l)) * wrk4(i,j)
353 dum1d3(l) = (t(ip1,j,l) - t(im1,j,l)) * wrk4(i,j)
356 dum1d2(l) = (pmid(i,j-1,l)-pmid(i,j+1,l)) * tem
357 dum1d4(l) = (t(i,j-1,l)-t(i,j+1,l)) * tem
358 dum1d6(l) = ((vh(ip1,j,l)-vh(im1,j,l))* wrk2(i,j) &
359 & - (uh(i,j-1,l)*cosl(i,j-1) &
360 & - uh(i,j+1,l)*cosl(i,j+1))*wrk3(i,j))*wrk1(i,j) &
365 CALL pvetc(lm,pmid(i,j,1:lm),dum1d1,dum1d2 &
366 ,dum1d5,dum1d3,dum1d4,zmid(i,j,1:lm),uh(i,j,1:lm) &
367 ,vh(i,j,1:lm),dum1d6 &
368 ,dum1d7,dum1d8,dum1d9,dum1d10,dum1d11,dum1d12,dum1d13)
370 IF((iget(332) > 0).OR.(iget(333) > 0).OR. &
371 (iget(334) > 0).OR.(iget(335) > 0).OR. &
372 (iget(351) > 0).OR.(iget(352) > 0).OR. &
373 (iget(353) > 0).OR.(iget(378) > 0))
THEN
375 CALL p2th(lm,dum1d11,uh(i,j,1:lm),vh(i,j,1:lm) &
376 ,dum1d7,t(i,j,1:lm),dum1d13,dum1d12,dum1d14 &
377 ,omga(i,j,1:lm),kth,th &
378 ,lth,uth(i,j,1:kth),vth(i,j,1:kth) &
381 ,tth(i,j,1:kth),pvth(i,j,1:kth) &
382 ,sigmath(i,j,1:kth),rhth(i,j,1:kth) &
386 IF((iget(336) > 0).OR.(iget(337) > 0).OR. &
387 (iget(338) > 0).OR.(iget(339) > 0).OR. &
388 (iget(340) > 0).OR.(iget(341) > 0))
THEN
389 CALL p2pv(lm,dum1d13,zmid(i,j,1:lm),t(i,j,1:lm),pmid(i,j,1:lm) &
390 ,uh(i,j,1:lm),vh(i,j,1:lm),kpv,pv,pvpt,pvpb*pint(i,j,lm+1)&
391 ,lpv,upv(i,j,1:kpv),vpv(i,j,1:kpv),hpv(i,j,1:kpv) &
393 ,tpv(i,j,1:kpv),ppv(i,j,1:kpv),spv(i,j,1:kpv) )
404 tphi=(j-jmt2)*(dyval/gdsdegr)*dtr
408 tem = wrk3(i,j) * eradi
411 dum1d5(l) = t(i,j,l)*(1.+d608*q(i,j,l))
412 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
413 dum1d14(l) = q(i,j,l) * (pmid(i,j,l)+con_epsm1*es)/(con_eps*es)
414 dum1d1(l) = (pmid(ip1,j,l)- pmid(im1,j,l)) * wrk4(i,j)
415 dum1d3(l) = (t(ip1,j,l) - t(im1,j,l)) * wrk4(i,j)
416 dum1d2(l) = (pmid(i,j+1,l)-pmid(i,j-1,l)) * tem
417 dum1d4(l) = (t(i,j+1,l)-t(i,j-1,l)) * tem
418 dum1d6(l) = ((vh(ip1,j,l)-vh(im1,j,l))* wrk2(i,j) &
419 & - (uh(i,j+1,l)*cosl(i,j+1) &
420 & - uh(i,j-1,l)*cosl(i,j-1))*wrk3(i,j))*wrk1(i,j) &
424 CALL pvetc(lm,pmid(i,j,1:lm),dum1d1,dum1d2 &
425 ,dum1d5,dum1d3,dum1d4,zmid(i,j,1:lm),uh(i,j,1:lm) &
426 ,vh(i,j,1:lm),dum1d6 &
427 ,dum1d7,dum1d8,dum1d9,dum1d10,dum1d11,dum1d12,dum1d13)
429 IF((iget(332) > 0).OR.(iget(333) > 0).OR. &
430 (iget(334) > 0).OR.(iget(335) > 0).OR. &
431 (iget(351) > 0).OR.(iget(352) > 0).OR. &
432 (iget(353) > 0).OR.(iget(378) > 0))
THEN
434 CALL p2th(lm,dum1d11,uh(i,j,1:lm),vh(i,j,1:lm) &
435 ,dum1d7,t(i,j,1:lm),dum1d13,dum1d12,dum1d14 &
436 ,omga(i,j,1:lm),kth,th &
437 ,lth,uth(i,j,1:kth),vth(i,j,1:kth) &
440 ,tth(i,j,1:kth),pvth(i,j,1:kth) &
441 ,sigmath(i,j,1:kth),rhth(i,j,1:kth) &
445 IF((iget(336) > 0).OR.(iget(337) > 0).OR. &
446 (iget(338) > 0).OR.(iget(339) > 0).OR. &
447 (iget(340) > 0).OR.(iget(341) > 0))
THEN
448 CALL p2pv(lm,dum1d13,zmid(i,j,1:lm),t(i,j,1:lm),pmid(i,j,1:lm) &
449 ,uh(i,j,1:lm),vh(i,j,1:lm),kpv,pv,pvpt,pvpb*pint(i,j,lm+1)&
450 ,lpv,upv(i,j,1:kpv),vpv(i,j,1:kpv),hpv(i,j,1:kpv) &
452 ,tpv(i,j,1:kpv),ppv(i,j,1:kpv),spv(i,j,1:kpv) )
460 ELSE IF (gridtype ==
'B')
THEN
461 allocate(dvdxl(ista_m:iend_m,jsta_m:jend_m,lm))
462 allocate(dudyl(ista_m:iend_m,jsta_m:jend_m,lm))
463 allocate(uavgl(ista_m:iend_m,jsta_m:jend_m,lm))
465 CALL exch(vh(ista_2l:iend_2u,jsta_2l:jend_2u,l))
466 CALL exch(uh(ista_2l:iend_2u,jsta_2l:jend_2u,l))
467 CALL dvdxdudy(uh(:,:,l),vh(:,:,l))
470 dvdxl(i,j,l) = ddvdx(i,j)
471 dudyl(i,j,l) = ddudy(i,j)
472 uavgl(i,j,l) = uuavg(i,j)
478 tphi=(j-jmt2)*(dyval/gdsdegr)*dtr
483 dum1d5(l) = t(i,j,l)*(1.+d608*q(i,j,l))
484 es = min(fpvsnew(t(i,j,l)),pmid(i,j,l))
485 qstl = con_eps*es/(pmid(i,j,l)+con_epsm1*es)
486 dum1d14(l) = q(i,j,l)/qstl
487 dum1d1(l) = (pmid(ip1,j,l)- pmid(im1,j,l)) * wrk2(i,j)
488 dum1d3(l) = (t(ip1,j,l) - t(im1,j,l)) * wrk2(i,j)
489 dum1d2(l) = (pmid(i,j+1,l)-pmid(i,j-1,l)) * wrk3(i,j)
490 dum1d4(l) = (t(i,j+1,l)-t(i,j-1,l)) * wrk3(i,j)
495 dum1d6(l) = dvdx - dudy + f(i,j) + uavg*tan(tphi)/erad
499 CALL pvetc(lm,pmid(i,j,1:lm),dum1d1,dum1d2 &
500 ,dum1d5,dum1d3,dum1d4,zmid(i,j,1:lm),uh(i,j,1:lm) &
501 ,vh(i,j,1:lm),dum1d6 &
502 ,dum1d7,dum1d8,dum1d9,dum1d10,dum1d11,dum1d12,dum1d13)
504 IF((iget(332)>0).OR.(iget(333)>0).OR. &
505 (iget(334)>0).OR.(iget(335)>0).OR. &
506 (iget(351)>0).OR.(iget(352)>0).OR. &
507 (iget(353)>0).OR.(iget(378)>0))
THEN
509 CALL p2th(lm,dum1d11,uh(i,j,1:lm),vh(i,j,1:lm) &
510 ,dum1d7,t(i,j,1:lm),dum1d13,dum1d12,dum1d14 &
511 ,omga(i,j,1:lm),kth,th &
512 ,lth,uth(i,j,1:kth),vth(i,j,1:kth) &
515 ,tth(i,j,1:kth),pvth(i,j,1:kth) &
516 ,sigmath(i,j,1:kth),rhth(i,j,1:kth) &
520 IF((iget(336)>0).OR.(iget(337)>0).OR. &
521 (iget(338)>0).OR.(iget(339)>0).OR. &
522 (iget(340)>0).OR.(iget(341)>0))
THEN
523 CALL p2pv(lm,dum1d13,zmid(i,j,1:lm),t(i,j,1:lm),pmid(i,j,1:lm) &
524 ,uh(i,j,1:lm),vh(i,j,1:lm),kpv,pv,pvpt,pvpb*pint(i,j,lm+1) &
525 ,lpv,upv(i,j,1:kpv),vpv(i,j,1:kpv),hpv(i,j,1:kpv) &
527 ,tpv(i,j,1:kpv),ppv(i,j,1:kpv),spv(i,j,1:kpv) )
531 deallocate(dvdxl,dudyl,uavgl)
532 ELSE IF (gridtype ==
'E')
THEN
535 tphi = (j-jmt2)*(dyval/gdsdegr)*dtr
542 dum1d5(l)=t(i,j,l)*(1.+d608*q(i,j,l))
544 es=min(es,pmid(i,j,l))
545 qstl=con_eps*es/(pmid(i,j,l)+con_epsm1*es)
546 dum1d14(l)=q(i,j,l)/qstl
547 dum1d1(l) = (pmiduv(i+ihe,j,l)- pmiduv(i+ihw,j,l))*wrk2(i,j)
548 dum1d3(l) = (tuv(i+ihe,j,l) - tuv(i+ihw,j,l)) * wrk2(i,j)
549 dum1d2(l) = (pmiduv(i,j+1,l)- pmiduv(i,j-1,l))*wrk3(i,j)
550 dum1d4(l)= (tuv(i,j+1,l)- tuv(i,j-1,l))*wrk3(i,j)
551 dvdx=(vh(i+ihe,j,l)-vh(i+ihw,j,l))* wrk2(i,j)
552 dudy=(uh(i,j+1,l)-uh(i,j-1,l))* wrk3(i,j)
553 uavg=0.25*(uh(i+ihe,j,l)+uh(i+ihw,j,l)+uh(i,j-1,l)+uh(i,j+1,l))
555 dum1d6(l)=dvdx-dudy+f(i,j)+uavg*tan(tphi)/erad
558 CALL pvetc(lm,pmid(i,j,1:lm),dum1d1,dum1d2 &
559 ,dum1d5,dum1d3,dum1d4,zmid(i,j,1:lm),uh(i,j,1:lm) &
560 ,vh(i,j,1:lm),dum1d6 &
561 ,dum1d7,dum1d8,dum1d9,dum1d10,dum1d11,dum1d12,dum1d13)
563 IF((iget(332) > 0).OR.(iget(333) > 0).OR. &
564 (iget(334) > 0).OR.(iget(335) > 0).OR. &
565 (iget(351) > 0).OR.(iget(352) > 0).OR. &
566 (iget(353) > 0).OR.(iget(378) > 0))
THEN
568 CALL p2th(lm,dum1d11,uh(i,j,1:lm),vh(i,j,1:lm) &
569 ,dum1d7,t(i,j,1:lm),dum1d13,dum1d12,dum1d14 &
570 ,omga(i,j,1:lm),kth,th &
571 ,lth,uth(i,j,1:kth),vth(i,j,1:kth) &
574 ,tth(i,j,1:kth),pvth(i,j,1:kth) &
575 ,sigmath(i,j,1:kth),rhth(i,j,1:kth) &
579 IF((iget(336) > 0) .OR. (iget(337) > 0).OR. &
580 (iget(338) > 0) .OR. (iget(339) > 0).OR. &
581 (iget(340) > 0) .OR. (iget(341) > 0))
THEN
582 CALL p2pv(lm,dum1d13,zmid(i,j,1:lm),t(i,j,1:lm),pmid(i,j,1:lm) &
583 ,uh(i,j,1:lm),vh(i,j,1:lm),kpv,pv,pvpt,pvpb*pint(i,j,lm+1) &
584 ,lpv,upv(i,j,1:kpv),vpv(i,j,1:kpv),hpv(i,j,1:kpv) &
586 ,tpv(i,j,1:kpv),ppv(i,j,1:kpv),spv(i,j,1:kpv) )
609 IF(iget(332) > 0 .OR. iget(333) > 0)
THEN
610 IF(lvls(lp,iget(332)) > 0 .OR. lvls(lp,iget(333)) > 0)
THEN
614 grid1(i,j) = uth(i,j,lp)
615 grid2(i,j) = vth(i,j,lp)
618 if(grib==
'grib2')
then
620 fld_info(cfld)%ifld = iavblfld(iget(332))
621 fld_info(cfld)%lvl = lvlsxml(lp,iget(332))
627 datapd(i,j,cfld) = grid1(ii,jj)
631 fld_info(cfld)%ifld = iavblfld(iget(333))
632 fld_info(cfld)%lvl = lvlsxml(lp,iget(333))
638 datapd(i,j,cfld) = grid2(ii,jj)
647 IF(iget(334) > 0)
THEN
648 IF(lvls(lp,iget(334)) > 0)
THEN
674 grid1(i,j) = tth(i,j,lp)
677 if(grib==
'grib2')
then
679 fld_info(cfld)%ifld=iavblfld(iget(334))
680 fld_info(cfld)%lvl=lvlsxml(lp,iget(334))
686 datapd(i,j,cfld) = grid1(ii,jj)
695 IF(iget(335) > 0)
THEN
696 IF(lvls(lp,iget(335)) > 0)
THEN
702 dum2d(ista:iend,jsta:jend)=pvth(ista:iend,jsta:jend,lp)
706 IF(jsta== 1) cosltemp(1:im, 1)=coslpoles(1:im,1)
707 IF(jend==jm) cosltemp(1:im,jm)=coslpoles(1:im,2)
709 IF(jsta== 1) pvtemp(1:im, 1)=pvpoles(1:im,1)
710 IF(jend==jm) pvtemp(1:im,jm)=pvpoles(1:im,2)
712 call poleavg(im,jm,jsta,jend,small,cosltemp(1:im,jsta:jend) &
713 ,spval,pvtemp(1:im,jsta:jend))
715 IF(jsta== 1) pvth(ista:iend, 1,lp)=pvtemp(ista:iend, 1)
716 IF(jend==jm) pvth(ista:iend,jm,lp)=pvtemp(ista:iend,jm)
721 IF(pvth(i,j,lp) /= spval)
THEN
722 grid1(i,j) = pvth(i,j,lp)*1.0e-6
724 grid1(i,j) = pvth(i,j,lp)
728 if(grib==
'grib2')
then
730 fld_info(cfld)%ifld=iavblfld(iget(335))
731 fld_info(cfld)%lvl=lvlsxml(lp,iget(335))
737 datapd(i,j,cfld) = grid1(ii,jj)
746 IF(iget(353) > 0)
THEN
747 IF(lvls(lp,iget(353)) > 0)
THEN
751 grid1(i,j) = hmth(i,j,lp)
754 if(grib==
'grib2')
then
756 fld_info(cfld)%ifld=iavblfld(iget(353))
757 fld_info(cfld)%lvl=lvlsxml(lp,iget(353))
763 datapd(i,j,cfld) = grid1(ii,jj)
772 IF(iget(351) > 0)
THEN
773 IF(lvls(lp,iget(351)) > 0)
THEN
777 grid1(i,j) = sigmath(i,j,lp)
780 if(grib==
'grib2')
then
782 fld_info(cfld)%ifld=iavblfld(iget(351))
783 fld_info(cfld)%lvl=lvlsxml(lp,iget(351))
789 datapd(i,j,cfld) = grid1(ii,jj)
798 IF(iget(352) > 0)
THEN
799 IF(lvls(lp,iget(352)) > 0)
THEN
803 IF(rhth(i,j,lp) /= spval)
THEN
804 grid1(i,j) = 100.0 * min(1.,max(rhmin,rhth(i,j,lp)))
810 if(grib==
'grib2')
then
812 fld_info(cfld)%ifld=iavblfld(iget(352))
813 fld_info(cfld)%lvl=lvlsxml(lp,iget(352))
819 datapd(i,j,cfld) = grid1(ii,jj)
828 IF(iget(378) > 0)
THEN
829 IF(lvls(lp,iget(378)) > 0)
THEN
833 grid1(i,j) = oth(i,j,lp)
836 if(grib==
'grib2')
then
838 fld_info(cfld)%ifld=iavblfld(iget(378))
839 fld_info(cfld)%lvl=lvlsxml(lp,iget(378))
845 datapd(i,j,cfld) = grid1(ii,jj)
856 IF(iget(336) > 0.OR.iget(337) > 0)
THEN
857 IF(lvls(lp,iget(336)) > 0.OR.lvls(lp,iget(337)) > 0)
THEN
861 dum2d(ista:iend,jsta:jend)=vpv(ista:iend,jsta:jend,lp)
865 IF(jsta== 1) cosltemp(1:im, 1)=coslpoles(1:im,1)
866 IF(jend==jm) cosltemp(1:im,jm)=coslpoles(1:im,2)
868 IF(jsta== 1) pvtemp(1:im, 1)=pvpoles(1:im,1)
869 IF(jend==jm) pvtemp(1:im,jm)=pvpoles(1:im,2)
871 call poleavg(im,jm,jsta,jend,small,cosltemp(1:im,jsta:jend) &
872 ,spval,pvtemp(1:im,jsta:jend))
874 IF(jsta== 1) vpv(ista:iend, 1,lp)=pvtemp(ista:iend, 1)
875 IF(jend==jm) vpv(ista:iend,jm,lp)=pvtemp(ista:iend,jm)
880 grid1(i,j) = upv(i,j,lp)
881 grid2(i,j) = vpv(i,j,lp)
884 if(grib==
'grib2')
then
886 fld_info(cfld)%ifld=iavblfld(iget(336))
887 fld_info(cfld)%lvl=lvlsxml(lp,iget(336))
893 datapd(i,j,cfld) = grid1(ii,jj)
897 fld_info(cfld)%ifld=iavblfld(iget(337))
898 fld_info(cfld)%lvl=lvlsxml(lp,iget(337))
904 datapd(i,j,cfld) = grid2(ii,jj)
914 IF(iget(338) > 0)
THEN
915 IF(lvls(lp,iget(338)) > 0)
THEN
919 dum2d(ista:iend,jsta:jend)=tpv(ista:iend,jsta:jend,lp)
923 IF(jsta== 1) cosltemp(1:im, 1)=coslpoles(1:im,1)
924 IF(jend==jm) cosltemp(1:im,jm)=coslpoles(1:im,2)
926 IF(jsta== 1) pvtemp(1:im, 1)=pvpoles(1:im,1)
927 IF(jend==jm) pvtemp(1:im,jm)=pvpoles(1:im,2)
929 call poleavg(im,jm,jsta,jend,small,cosltemp(1:im,jsta:jend) &
930 ,spval,pvtemp(1:im,jsta:jend))
932 IF(jsta== 1) tpv(ista:iend, 1,lp)=pvtemp(ista:iend, 1)
933 IF(jend==jm) tpv(ista:iend,jm,lp)=pvtemp(ista:iend,jm)
938 grid1(i,j) = tpv(i,j,lp)
941 if(grib==
'grib2')
then
943 fld_info(cfld)%ifld=iavblfld(iget(338))
944 fld_info(cfld)%lvl=lvlsxml(lp,iget(338))
950 datapd(i,j,cfld) = grid1(ii,jj)
959 IF(iget(339) > 0)
THEN
960 IF(lvls(lp,iget(339)) > 0)
THEN
964 dum2d(ista:iend,jsta:jend)=hpv(ista:iend,jsta:jend,lp)
968 IF(jsta== 1) cosltemp(1:im, 1)=coslpoles(1:im,1)
969 IF(jend==jm) cosltemp(1:im,jm)=coslpoles(1:im,2)
971 IF(jsta== 1) pvtemp(1:im, 1)=pvpoles(1:im,1)
972 IF(jend==jm) pvtemp(1:im,jm)=pvpoles(1:im,2)
974 call poleavg(im,jm,jsta,jend,small,cosltemp(1:im,jsta:jend) &
975 ,spval,pvtemp(1:im,jsta:jend))
977 IF(jsta== 1) hpv(ista:iend, 1,lp)=pvtemp(ista:iend, 1)
978 IF(jend==jm) hpv(ista:iend,jm,lp)=pvtemp(ista:iend,jm)
983 grid1(i,j) = hpv(i,j,lp)
986 if(grib==
'grib2')
then
988 fld_info(cfld)%ifld=iavblfld(iget(339))
989 fld_info(cfld)%lvl=lvlsxml(lp,iget(339))
995 datapd(i,j,cfld) = grid1(ii,jj)
1004 IF(iget(340) > 0)
THEN
1005 IF(lvls(lp,iget(340)) > 0)
THEN
1009 dum2d(ista:iend,jsta:jend)=ppv(ista:iend,jsta:jend,lp)
1013 IF(jsta== 1) cosltemp(1:im, 1)=coslpoles(1:im,1)
1014 IF(jend==jm) cosltemp(1:im,jm)=coslpoles(1:im,2)
1016 IF(jsta== 1) pvtemp(1:im, 1)=pvpoles(1:im,1)
1017 IF(jend==jm) pvtemp(1:im,jm)=pvpoles(1:im,2)
1019 call poleavg(im,jm,jsta,jend,small,cosltemp(1:im,jsta:jend) &
1020 ,spval,pvtemp(1:im,jsta:jend))
1022 IF(jsta== 1) ppv(ista:iend, 1,lp)=pvtemp(ista:iend, 1)
1023 IF(jend==jm) ppv(ista:iend,jm,lp)=pvtemp(ista:iend,jm)
1028 grid1(i,j) = ppv(i,j,lp)
1031 if(grib==
'grib2')
then
1033 fld_info(cfld)%ifld=iavblfld(iget(340))
1034 fld_info(cfld)%lvl=lvlsxml(lp,iget(340))
1040 datapd(i,j,cfld) = grid1(ii,jj)
1049 IF(iget(341) > 0)
THEN
1050 IF(lvls(lp,iget(341)) > 0)
THEN
1054 dum2d(ista:iend,jsta:jend)=spv(ista:iend,jsta:jend,lp)
1058 IF(jsta== 1) cosltemp(1:im, 1)=coslpoles(1:im,1)
1059 IF(jend==jm) cosltemp(1:im,jm)=coslpoles(1:im,2)
1061 IF(jsta== 1) pvtemp(1:im, 1)=pvpoles(1:im,1)
1062 IF(jend==jm) pvtemp(1:im,jm)=pvpoles(1:im,2)
1064 call poleavg(im,jm,jsta,jend,small,cosltemp(1:im,jsta:jend) &
1065 ,spval,pvtemp(1:im,jsta:jend))
1067 IF(jsta== 1) spv(ista:iend, 1,lp)=pvtemp(ista:iend, 1)
1068 IF(jend==jm) spv(ista:iend,jm,lp)=pvtemp(ista:iend,jm)
1073 grid1(i,j) = spv(i,j,lp)
1076 if(grib==
'grib2')
then
1078 fld_info(cfld)%ifld=iavblfld(iget(341))
1079 fld_info(cfld)%lvl=lvlsxml(lp,iget(341))
1085 datapd(i,j,cfld) = grid1(ii,jj)
1094 DEALLOCATE(dum1d1,dum1d2,dum1d3,dum1d4,dum1d5,dum1d6,dum1d7, &
1095 dum1d8,dum1d9,dum1d10,dum1d11,dum1d12,dum1d13, &
1096 dum1d14,wrk1, wrk2, wrk3, wrk4, cosl, dum2d)