;+ ; NAME: ; rt_szss96_CH4cool77 ; PURPOSE: (one line) ; calculate CH4 cooling at 7.7 micorn ; DESCRIPTION: ; calculate CH4 cooling at 7.7 micorn ; CATEGORY: ; RT ; CALLING SEQUENCE: ; q77 = rt_szss96_CH4cool77(t, p, n_ch4, gamn4=gamn4) ; INPUTS: ; t - temperature (K) ; p - pressure (microbar) ; n_ch4 - number density of CH4 (cm^-3) ; OPTIONAL INPUT PARAMETERS: ; KEYWORD INPUT PARAMETERS: ; codetype ; 'FORTRAN' - call routines from plutot.f ; 'FORTEST' - native IDL routines that reproduce the fortran ; 'IDL' - idl code, without the restriction of needing to reproduce fortran ; KEYWORD OUTPUT PARAMETERS: ; none ; OUTPUTS: ; returns cooling rate in erg/cm^3/s ; gamn4 : cool-to-space Gamma ; COMMON BLOCKS: ; SIDE EFFECTS: ; RESTRICTIONS: ; PROCEDURE: ; ; EXAMPLE: ; ; atm = rt_szss96_atmread('pluto.restart', 3.d) ; t = atm.t ; p = atm.p ; n_ch4 = atm.n[*,1] ; l77 = rt_szss96_CH4cool77(t, p, n_ch4) ; MODIFICATION HISTORY: ; 2008 Nov 9 - fixed documentation ;- function rt_szss96_CH4cool77, t, p, n_ch4, gamn4=gamn4 fcn = 'rt_szss96__CH4cool77' if not keyword_set(codetype) then codetype = 'FORTRAN' case codetype of 'FORTRAN': begin szss96_get_ch4all,GG,WW,TREF if tref[0] ne 40.d then begin szss96_input6 endif szss96_get_parair, R00,WTMOL if WTMOL lt 1. then begin R00 = 1150.0D3 WTMOL = 28.0D szss96_set_parair,R00, WTMOL endif szss96_get_panda, ZKVTOUT,XA2OUT,XA3OUT,XA4OUT,XP2OUT,XP3OUT,XP4OUT if XA2OUT lt 1.d then begin szss96_init_panda endif ; convert from standard atm structure to ; fortran's expected format TEM = double(t) PRE = double(p / 10.d) BC = 1.3804D-23 DN1 = n_ch4 * 1d6 DN = PRE/(BC * TEM) RHO = double( ( DN1/ DN ) * (16/28.) ) KM = n_elements(PRE) ICONT = 2L IYELLE = 2L szss96_qtch4z,TEM,PRE,RHO,QT,KM,ICONT,GAMN4,IYELLE ;convert from K/s to erg/cm^3/s RAIR=8314.0D0/WTMOL ; gas constant CP=RAIR*7.0D0/2.0D0 ; specific heat at the constant pressure RHO = PRE/(RAIR*TEM) ; kg m**(-3) FACTX1=CP*RHO*10.0D0 ; To convert K/sec to erg cm**(-3) s**(-1) QT1CGS = QT * FACTX1 qt = QT1CGS return, qt end 'FORTEST': begin print, fcn, ': code type ', codetype, ' not implemented' end else: begin print, fcn, ': code type ', codetype, ' not implemented' return, -1 end endcase end