; szss96_gamm12mat.pro -- translated by f2idl ; using argument information from gamm12mat.f and gamm12mat_f.c ; and documentation information from gamm12mat.f ;+ ; NAME: ; szss96_gamm12mat ; ; PURPOSE: ; To calculate the escape function according to Zhu (1992, Eq. (13)). ; CALLING SEQUENCE: ; szss96_gamm12mat,PRE,RHO1,KM,XKZ,GAM1,GAMN4 ; ; INPUTS: ; ; pre - pressure (Pascal) [KM] ; rho1 - mass mixing ratio of CH4 (unitless) [KM] ; KM - number of atmospheric layers ; ww - weights for k-coefficents ; jm - number of k-coefficients ; OUTPUTS: ; ; gam1 - flux escape function between two levels? [KM,KM] ; gamn4 - escape to space? (unitless) [KM] ; ENDDOC GET_CH4ALL ; ------------------- ; SUBROUTINE GAMM12MAT(PRE,RHO1,KM,XKZ,GAM1,GAMN4) ; IMPLICIT DOUBLE PRECISION (A-H,O-Z) ; PARAMETER(KMX=106,JM=30,LM=4) ; COMMON /CH4V4/ SIG4A(JM,LM),SIG4B(JM,LM) ; COMMON /CH4ALL/ GG(JM),WW(JM),TREF(LM) ; DIMENSION PRE(KM),RHO1(KM),GAMN4(KM) ; DIMENSION XKZ(KMX,JM),GAM1(KMX,KMX) ; ; DO 30 K=1,KM ; DO 29 J=1,KM ; GAM1(J,K)=GAMM12(J,K,PRE,RHO1,KM,XKZ,WW,JM) ; CONTINUE ; CONTINUE ; DO 31 K=1,KM ; GAMN4(K)=GAM1(K,KM) ! escape to space probability used in nu3 heating rate calculation. ; CONTINUE ; ; ; END ; ; MODIFICATION HISTORY: ; Written 2007 Sep 1, LAY ; : ; ;- PRO szss96_gamm12mat,PRE,RHO1,KM,XKZ,GAM1,GAMN4 ; -------------------- This function name fcn = 'szss96_gamm12mat' ; -------------------- assign parameters (including dimensions) KMX = 106 JM = 30 LM = 4 ;------------------------- ; setup the output variables that will be passed to the fortran ; routine GAM1 = make_array(KMX,KMX,type= 5) GAMN4 = make_array(KM,type= 5) ;------------------------- ; check all variables if n_params() ne 6 then begin print,'szss96_gamm12mat: wrong number of arguments' return endif if size(PRE,/type) ne 5 then begin print,'szss96_gamm12mat: PRE of wrong data type' return endif if size(PRE,/n_dim) ne 1 then begin print,'szss96_gamm12mat: PRE of wrong n_dim' return endif if not array_equal(size(PRE,/dim), [KM] ) then begin print,'szss96_gamm12mat: PRE of wrong dim' return endif if size(RHO1,/type) ne 5 then begin print,'szss96_gamm12mat: RHO1 of wrong data type' return endif if size(RHO1,/n_dim) ne 1 then begin print,'szss96_gamm12mat: RHO1 of wrong n_dim' return endif if not array_equal(size(RHO1,/dim), [KM] ) then begin print,'szss96_gamm12mat: RHO1 of wrong dim' return endif if size(KM,/type) ne 3 then begin print,'szss96_gamm12mat: KM of wrong data type' return endif if size(KM,/n_dim) ne 0 then begin print,'szss96_gamm12mat: KM of wrong n_dim' return endif if size(XKZ,/type) ne 5 then begin print,'szss96_gamm12mat: XKZ of wrong data type' return endif if size(XKZ,/n_dim) ne 2 then begin print,'szss96_gamm12mat: XKZ of wrong n_dim' return endif if not array_equal(size(XKZ,/dim), [KMX,JM] ) then begin print,'szss96_gamm12mat: XKZ of wrong dim' return endif if size(GAM1,/type) ne 5 then begin print,'szss96_gamm12mat: GAM1 of wrong data type' return endif if size(GAM1,/n_dim) ne 2 then begin print,'szss96_gamm12mat: GAM1 of wrong n_dim' return endif if not array_equal(size(GAM1,/dim), [KMX,KMX] ) then begin print,'szss96_gamm12mat: GAM1 of wrong dim' return endif if size(GAMN4,/type) ne 5 then begin print,'szss96_gamm12mat: GAMN4 of wrong data type' return endif if size(GAMN4,/n_dim) ne 1 then begin print,'szss96_gamm12mat: GAMN4 of wrong n_dim' return endif if not array_equal(size(GAMN4,/dim), [KM] ) then begin print,'szss96_gamm12mat: GAMN4 of wrong dim' return endif ;------------------------- ; Find root directory for library tname findpro, fcn, dirlist=dirlist, /noprint if dirlist[0] eq '' then root = '.' else root = dirlist[0] ;------------------------- ; CALL lib_name = root + '/szss96.so' entry_name = 'idl_ce_call_gamm12mat_' RESULT = CALL_EXTERNAL( lib_name, ENTRY_NAME, $ PRE,RHO1,KM,XKZ,GAM1,GAMN4, $ /verbose ) end