c subroutine getcol(fh,nlon,nzp,nlat,nflds,fcol,glat,glon, + ixhist,ip) c c Return fcol(nzp) from fh(nlon,nzp,nlat,nflds) at glat,glon, and field ip: c include "flxproc.h" real fh(nlon,nzp,nlat,nflds),fcol(nzp) integer ixhist(nflds) real fnzp0(nzp),fnzp1(nzp) c c Get index to desired lat,lon: c ixlat = ixfind(gcmlat,nlat,glat,dlat) if (ixlat.le.0) then write(6,"('>>> getcol bad glat=',f9.2)") glat fcol(:) = spval return endif glat = gcmlat(ixlat) ixlon = ixfind(gcmlon,nlon,glon,dlon) if (ixlon.le.0) then write(6,"('>>> getcol bad glon=',f9.2)") glon fcol(:) = spval return endif glon = gcmlon(ixlon) c c Get from history field if not derived field: c if (ip.le.mxfhist) then ! not a derived field fcol(:) = fh(ixlon,:,ixlat,ixhist(ip)) return endif c c Derived field: c c Total density = o2+o+n2 c if (ip.eq.ixrho) then fcol(:) = fh(ixlon,:,ixlat,ixhist(ixo2)) + + fh(ixlon,:,ixlat,ixhist(ixo1)) + + fh(ixlon,:,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 These are ht-independent fields -- allow redundance in fcol(:) c if (ip.eq.ixfof2.or.ip.eq.ixhmf2) then fnzp0(:) = fh(ixlon,:,ixlat,ixhist(ixne)) fnzp1(:) = fh(ixlon,:,ixlat,ixhist(ixz)) call fof2int(fnzp0,fnzp1,nzp,hmf2,fof2,0,i,j) if (ip.eq.ixfof2) fcol(:) = fof2 if (ip.eq.ixhmf2) fcol(:) = hmf2 return endif c c Unknown derived field: c write(6,"('>>> getcol WARNING: unknown ip=',i3)") ip return end c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c subroutine xfercol(ptr,nlon,nzp,nlat,fcol,i,j) pointer(ptr,f(nlon,nzp,nlat)) real fcol(nzp) fcol(:) = f(i,:,j) return end