;+ ; NAME: ; rt_cgrid ; PURPOSE: (one line) ; interpolate a model atmosphere onto evenly spaced pressures ; DESCRIPTION: ; interpolate a model atmosphere onto evenly spaced pressures ; CATEGORY: ; RT ; CALLING SEQUENCE: ; rt_cgrid, dat, nz, atm ; INPUTS: ; dat : body-specific constants ; nz : number of new atmospheric pressure levels ; OPTIONAL INPUT PARAMETERS: ; KEYWORD INPUT PARAMETERS: ; none ; KEYWORD OUTPUT PARAMETERS: ; none ; OUTPUTS: ; none ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; Modifies atm ; PROCEDURE: ; ; ; MODIFICATION HISTORY: ; Written 2004 May 8, Leslie Young SwRI ; based on cgrid.f, written by Roger Yelle, 1990 ;- pro rt_cgrid, dat, nz, atm gm = dat.gm rplnt = dat.rplnt pmin = dat.pmin pmax = dat.pmax dlmin = alog10(pmin) dlmax = alog10(pmax) dlstep = (dlmax - dlmin) / float(nz - 1) ns = 5 z = dblarr(nz) p = dblarr(nz) t = dblarr(nz) n = dblarr(nz,ns) ncol = dblarr(nz,ns) logp = (dlmin + findgen(nz)*dlstep ) p = 10.d^logp oldlogp = alog10(atm.p) for iz = 0, nz-1 do begin if (p[iz] le atm.p[0] ) then begin t[iz] = atm.t[0] n[iz,*] = atm.n[0,*]*p[iz]/atm.p[0] ncol[iz,*] = atm.ncol[0,*]*p[iz]/atm.p[0] endif else begin t[iz] = rt_fintrp(atm.p,atm.t,p[iz]) for im = 0, 4 do begin n[iz,im] = rt_fintrp(atm.p,atm.n[*,im],p[iz]) ncol[iz,im] = rt_fintrp(atm.p,atm.ncol[*,im],p[iz]) endfor z[iz] = rt_fintrp(oldlogp,atm.z,logp[iz]) endelse endfor atm = $ { $, nz_name: 'number of altitudes', nz:nz, nz_unit: '', $ ns_name: 'number of species', ns:ns, ns_unit: '', $ z_name: 'altitudes', z:z, z_unit: 'cm [nz]', $ p_name: 'pressure', p:p, p_unit: 'microbar [nz]', $ t_name: 'temperature', t:t, t_unit: 'K [nz]', $ n_name: 'number density', n:n,$ n_unit: 'molecule cm^-3 [nz,ns]',$ ncol_name: 'column density', ncol:ncol,$ ncol_unit: 'molecule cm^-2 [nz,ns]' $ } end