c subroutine getglb(fh,nlon,nzp,nlat,nflds,fglb,zp,zpht,ixhist,ip) c include "flxproc.h" real fh(nlon,nzp,nlat,nflds),fglb(nlon,nlat) real fnzp0(nzp),fnzp1(nzp),zp(nzp) integer ixhist(mxfproc) pointer(pfglb3,fglb3(nlon,nlat,3)) c c zpht may be either pressure or height: c If pressure, then find ixzp index, otherwise set ixzp=0 and interpolate c below: c if (zpht.le.zp(nzp)) then ixzp = ixfind(zp,nzp,zpht,dzp) if (ixzp.le.0) then write(6,"('>>> getglb bad zp=',f9.2,' zp=',/(10f6.1))") + zpht,zp fglb(:,:) = spval return endif else ! zpht is height -- interpolate ixzp = 0 endif c c Get from history field if not derived field: c if (ip.le.mxfhist) then ! not a derived field if (ixzp.gt.0) then fglb(:,:) = fh(:,ixzp,:,ixhist(ip)) else call glbhtint(fh(1,1,1,ixhist(ip)),fh(1,1,1,ixhist(ixz)), + nlon,nzp,nlat,fglb,zpht,1,logplt(ip),spval,ier,0) endif return endif c c Derived field: c c Total density = o2+o+n2 c if (ip.eq.ixrho) then if (ixzp.gt.0) then fglb(:,:) = fh(:,ixzp,:,ixhist(ixo2)) + + fh(:,ixzp,:,ixhist(ixo1)) + + fh(:,ixzp,:,ixhist(ixn2)) else call alloc(pfglb3,nlon*nlat*3) call glbhtint(fh(1,1,1,ixhist(ixo2)),fh(1,1,1,ixhist(ixz)), + nlon,nzp,nlat,fglb3,zpht,1,logplt(ixo2),spval,ier,0) call glbhtint(fh(1,1,1,ixhist(ixo1)),fh(1,1,1,ixhist(ixz)), + nlon,nzp,nlat,fglb3(1,1,2),zpht,1,logplt(ixo1),spval, + ier,0) call glbhtint(fh(1,1,1,ixhist(ixn2)),fh(1,1,1,ixhist(ixz)), + nlon,nzp,nlat,fglb3(1,1,2),zpht,1,logplt(ixn2),spval, + ier,0) fglb(:,:) = fglb3(:,:,1) + fglb3(:,:,2) + fglb3(:,:,3) call hpdeallc(pfglb3,ier,1) endif return endif c c No action necessary for unvn and uivi: c if (ip.eq.ixunvn.or.ip.eq.ixuivi) return c c fof2, hmf2 (ht-independent): c if (ip.eq.ixfof2.or.ip.eq.ixhmf2) then do j=1,nlat do i=1,nlon fnzp0(:) = fh(i,:,j,ixhist(ixne)) fnzp1(:) = fh(i,:,j,ixhist(ixz)) call fof2int(fnzp0,fnzp1,nzp,hmf2,fof2,0,i,j) if (ip.eq.ixfof2) fglb(i,j) = fof2 if (ip.eq.ixhmf2) fglb(i,j) = hmf2 enddo enddo return endif c c Unknown derived field: c write(6,"('>>> getglb WARNING: unknown ip=',i3)") ip return end c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c subroutine glbxfer(pf3d,nlon,nzp,nlat,fglb,k) pointer (pf3d,f3d(nlon,nzp,nlat)) real fglb(nlon,nlat) fglb(:,:) = f3d(:,k,:) return end