subroutine cgrid(gm,rplnt,pmin,pmax,ntau,zalt,temp & ,pres,dens,col,natm,z,tmp,prs,den,clm) implicit double precision (a-h,o-z) include "parameters.dat" dimension zalt(nd3),temp(nd3),pres(nd3),dens(nd3,0:4) & ,col(nd3,0:4),z(nd1),tmp(nd1),prs(nd1),den(nd1,0:4) & ,clm(nd1,0:4) dlmin = dlog10(pmin) dlmax = dlog10(pmax) dlstep = (dlmax - dlmin) / float(ntau - 1) do nt = 1, ntau dum1 = dlmin + (float(nt - 1) * dlstep) prs(nt) = 10.d0 ** dum1 if (prs(nt) .le. pres(1)) then tmp(nt) = temp(1) do im = 0, 4 den(nt,im) = dens(1,im)*prs(nt)/pres(1) clm(nt,im) = col(1,im)*prs(nt)/pres(1) end do else tmp(nt) = fintrp(pres,temp,natm,prs(nt)) do im = 0, 4 den(nt,im) = fintrp(pres,dens(1,im),natm,prs(nt)) clm(nt,im) = fintrp(pres,col(1,im),natm,prs(nt)) end do i1 = locate(pres,natm,prs(nt)) i2 = i1 + 1 pl1 = dlog(pres(i1)) pl2 = dlog(pres(i2)) pl = dlog(prs(nt)) z(nt) = zalt(i1)+(pl-pl1)*(zalt(i2)-zalt(i1)) & /(pl2-pl1) end if end do return end