;------------------------------------------------------------- ;+ ; NAME: ; GETSIGMA (function) ; ; PURPOSE: ; Defines the sigma levels for the various grids. ; GETSIGMA is called by function CTM_GRID. ; ; CATEGORY: ; CTM Tools ; ; CALLING SEQUENCE: ; GETSIGMA, MNAME, NLAYERS [,keywords] ; ; INPUTS: ; MNAME -> The name of the model for which sigma level ; information is desired (e.g. 'geos1', 'giss_ii', etc.) ; ; NLAYERS -> Specifies the number of sigma layers for the GISS ; family of models. Default is 9 layers. ; ; KEYWORD PARAMETERS: ; CENTER -> Returns to the calling program an array ; containing the sigma centers. ; ; EDGES -> Returns to the calling program an array ; containing the sigma edges. ; ; /HELP -> Prints a help screen and returns a value ; of -1 to the calling program. ; ; OUTPUTS: ; ; SUBROUTINES: ; ; REQUIREMENTS: ; ; NOTES: ; For the GISS family of models, only the 9-layer version ; is supported at this time. ; ; EXAMPLE: ; ESIG = GETSIGMA( 'GEOS1' /EDGES ); ; ; assigns GEOS-1 sigma edges to array ESIG ; ; CSIG = GETSIGMA( 'GISS_II', 9, /CENTERS ) ; ; assigns GISS-II sigma centers (9 layer model) to array CSIG ; ; MODIFICATION HISTORY: ; mgs, 02 Mar 1998: VERSION 1.00 ; bmy, 19 Jun 1998: - added dummy FSU sigma edges and centers ; - brought comments up to date ; bmy, 16 Oct 1998: - added 26 layer GEOS-STRAT sigma levels ; mgs, 25 Nov 1998: - improved defaulting of NLayers ; bmy, 24 Feb 1999: - updated FSU sigma centers & edges ; with values provided by Amanda Staudt ; ;- ; Copyright (C) 1998, Martin Schultz and Bob Yantosca, ; Harvard University ; This software is provided as is without any warranty ; whatsoever. It may be freely used, copied or distributed ; for non-commercial purposes. This copyright notice must be ; kept with any copy of this software. If this software shall ; be used commercially or sold as part of a larger package, ; please contact the author to arrange payment. ; Bugs and comments should be directed to mgs@io.harvard.edu ; or bmy@io.harvard.edu with subject "IDL routine getsigma" ;------------------------------------------------------------- pro use_getsigma print print,' GETSIGMA : return sigma levels (edges or centers) for various models' print print,' usage: sigma = GETSIGMA(MODEL_NAME [,NLAYERS] [,(/CENTER | /EDGES)] )' print print,' MODEL_TYPE (string) : one of the following' print,' GEOS1, GEOS_STRAT, GISS_II, GISS_II_PRIME' print,' (future versions may include GISS9, GISS18, GISS31 etc.)' print print,' NLAYERS : a named variable that will contain the number of sigma' print,' levels retrieved (NOTE: this is *always* the number of centers)' print print,' /CENTER : return sigma level centers (default)' print,' /EDGES : return sigma level edges' print return end function getsigma,mname,nlayers,CENTER=CENTER,EDGES=EDGES,HELP=HELP ; default NLAYERS if (n_elements(NLAYERS) ne 1) then NLAYERS = -1 if (keyword_set(HELP)) then begin use_getsigma return,-1 endif ; set sigma levels depending on model type if (strupcase(mname) eq 'GEOS1') then begin CSIG = [ .993936, .971301, .929925, .874137, .807833, $ .734480, .657114, .578390, .500500, .424750, $ .352000, .283750, .222750, .172150, .132200, $ .100050, .073000, .049750, .029000, .009500 ] ESIG = [ 1.000000, .987871, .954730, .905120, .843153, .772512, $ .696448, .617779, .539000, .462000, .387500, $ .316500, .251000, .194500, .149800, .114600, $ .085500, .060500, .039000, .019000, .000000 ] endif if (strupcase(mname) eq 'GEOS_STRAT') then begin if ( NLayers lt 0 ) then NLayers = 26 ; default to "chemistry" if ( NLayers eq 46 ) then begin CSIG = [ .993935, .971300, .929925, .875060, .812500, $ .745000, .674500, .604500, .536500, .471500, $ .410000, .352500, .301500, .257977, .220273, $ .187044, .157881, .132807, .111722, .094035, $ .079233, .066873, .056574, .048012, .040910, $ .034927, .029792, .025395, .021663, .018439, $ .015571, .013036, .010808, .008864, .007181, $ .005737, .004510, .003480, .002625, .001928, $ .001369, .000929, .000593, .000344, .000167, $ .000047 ] ESIG = [ 1.000000, .987871, .954730, .905120, .845000, .780000, $ .710000, .639000, .570000, .503000, .440000, $ .380000, .325000, .278000, .237954, .202593, $ .171495, .144267, .121347, .102098, .085972, $ .072493, .061252, .051896, .044128, .037692, $ .032162, .027422, .023367, .019958, .016919, $ .014223, .011848, .009767, .007960, .006402, $ .005072, .003948, .003011, .002240, .001616, $ .001121, .000737, .000449, .000239, .000094, $ .000000 ] endif else if ( Nlayers eq 26 ) then begin ESIG = [ 1.000000, .987871, .954730, .905120, .845000, .780000, $ .710000, .639000, .570000, .503000, .440000, $ .380000, .325000, .278000, .237954, .202593, $ .171495, .144267, .121347, .102098, .085972, $ .072493, .061252, .051896, .037692, .019958, $ 0.000000 ] CSIG = [ .993935, .971300, .929925, .875060, .812500, $ .745000, .674500, .604500, .536500, .471500, $ .410000, .352500, .301500, .257977, .220273, $ .187044, .157881, .132807, .111722, .094035, $ .079233, .066873, .056574, .044794, .028825, $ .009979 ] endif endif ; Also add the FSU (14-level) sigma edges (bmy, 6/19/98) if ( strupcase( MName ) eq 'FSU' ) then begin ; Sigma edges and centers from acs (bmy, 2/24/99) ESIG = [ 1.000000, 0.980100, 0.920824, 0.879647, 0.821353, $ 0.779202, 0.628848, 0.572475, 0.436700, 0.366384, $ 0.245644, 0.162837, 0.085000, 0.050000, 0.000000 ] CSIG = [ 0.99, 0.95, 0.90, 0.85, 0.80, 0.70, 0.60, 0.50, $ 0.40, 0.30, 0.20, 0.10, 0.07, 0.03 ] endif if (strupcase(mname) eq 'GISS_II' or $ strupcase(mname) eq 'GISS_II_PRIME') then begin ; check if NLAYERS was provided, if not return default of 9 layers if (NLAYERS lt 0) then nlayers = 9 case NLAYERS of 9 : begin CSIG = [ 0.974333, 0.907598, 0.797741, 0.641684, 0.472279, $ 0.320842, 0.197638, 0.102669, 0.030801 ] ESIG = [ 1.000000, 0.948665, 0.866530, 0.728953, 0.554415, $ 0.390144, 0.251540, 0.143737, 0.061602, 0.000000 ] end else : begin print,'GETSIGMA : ** invalid number of layers for GISS model ! **' end endcase endif ; GISS models ; get number of layers from sigma arrays ; i.e. overwrite previous default NLAYERS = n_elements(CSIG) ; safety first: take care of NLAYERS = 0 if (NLAYERS eq 0) then begin CSIG=-1 & ESIG=-1 endif ; decide what to return if (keyword_set(EDGES)) then return,ESIG $ else return,CSIG end