c subroutine getlatsli(fh,nlon,nzp,nlat,fslice,glat,ixhist,ip) c c Return fslice(nlon,nzp) at latitude glat, of field ip c (ixhist(ip) in fh). Get from fh if history field, c otherwise calculate derived field. c include "flxproc.h" real fh(nlon,nzp,nlat,nfhist),fslice(nlon,nzp), + fnzp0(nzp),fnzp1(nzp) integer ixhist(mxfproc) c c Get index to desired lat: c (glat may be changed to nearest grid point) c ixlat = ixfind(gcmlat,nlat,glat,dlat) if (ixlat.le.0) then write(6,"('>>> getlatsli bad glat=',f9.2)") glat fslice(:,:) = spval return endif glat = gcmlat(ixlat) c c Get from history field if not derived field: c if (ip.le.mxfhist) then ! not a derived field fslice(:,:) = fh(:,:,ixlat,ixhist(ip)) return endif c c Derived field: c c Total density rho = o2+o+n2 c if (ip.eq.ixrho) then fslice(:,:) = fh(:,:,ixlat,ixhist(ixo2)) + + fh(:,:,ixlat,ixhist(ixo1)) + + fh(:,:,ixlat,ixhist(ixn2)) 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: c if (ip.eq.ixfof2.or.ip.eq.ixhmf2) then do i=1,nlon fnzp0(:) = fh(i,:,ixlat,ixhist(ixne)) fnzp1(:) = fh(i,:,ixlat,ixhist(ixz)) call fof2int(fnzp0,fnzp1,nzp,hmf2,fof2,0,i,j) if (ip.eq.ixfof2) fslice(i,:) = fof2 if (ip.eq.ixhmf2) fslice(i,:) = hmf2 enddo return endif c c Unknown derived field: c write(6,"('>>> getlatsli WARNING: unknown ip=',i3)") ip return end c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c subroutine xferlatsli(pf3d,nlon,nzp,nlat,fslice,ixlat) pointer (pf3d,f3d(nlon,nzp,nlat)) real fslice(nlon,nzp) fslice(:,:) = f3d(:,:,ixlat) return end