Ignore:
Timestamp:
03/19/07 18:15:51 (17 years ago)
Author:
pinsard
Message:

improvements/corrections of some *.pro headers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/INIT/initncdf.pro

    r226 r231  
    1 ;------------------------------------------------------------ 
    2 ;------------------------------------------------------------ 
    3 ;------------------------------------------------------------ 
    41;+ 
    52; 
     
    107; @categories 
    118; Grid 
    12 ;  
     9; 
    1310; @param NCFILEIN {in}{required}{type=scalar string} 
    1411; A string giving the name of the NetCdf file 
     
    1815; 
    1916; @keyword MASKNAME {type=string} 
    20 ; A string giving the name of the variable in the file  
     17; A string giving the name of the variable in the file 
    2118; that contains the land/sea mask 
    2219; 
     
    3128; 
    3229; @keyword USEASMASK {type=scalar string} 
    33 ; A string giving the name of the variable in the file  
     30; A string giving the name of the variable in the file 
    3431; that will be used to build the land/sea mask. In this case the 
    3532; mask is based on the first record (if record dimension 
     
    4037; 
    4138; @keyword ZAXISNAME {default='z', 'level', 'lev', 'depth...'}{type=scalar string} 
    42 ; A string giving the name of the variable in the file  
    43 ; that contains the [xyz]axis.  
     39; A string giving the name of the variable in the file 
     40; that contains the [xyz]axis. 
    4441; 
    4542; @keyword XYINDEX {default=0}{type=scalar: 0 or 1} 
    4643; To define the x/y axis with index instead of using 
    47 ; the values contained in X/YAXISNAME.  
    48 ; x/yaxis = keyword_set(start1) + findgen(jpi/jpj)  
     44; the values contained in X/YAXISNAME. 
     45; x/yaxis = keyword_set(start1) + findgen(jpi/jpj) 
    4946; this forces key_onearth = 0 
    5047; 
    5148; @keyword ZINDEX {default=0}{type=scalar: 0 or 1} 
    5249; To define the z axis with index instead of using 
    53 ; the values contained in ZAXISNAME.  
    54 ; zaxis = keyword_set(start1) + findgen(jpk)  
    55 ;  
     50; the values contained in ZAXISNAME. 
     51; zaxis = keyword_set(start1) + findgen(jpk) 
     52; 
    5653; @keyword _EXTRA 
    57 ; Used to pass keywords to computegrid and ncdf_getaxis 
     54; Used to pass keywords to <pro>computegrid</pro> and <pro>ncdf_getaxis</pro> 
    5855; 
    5956; @uses 
     
    6158; 
    6259; @restrictions 
    63 ; Change the grid parameters (see computegrid) 
     60; Change the grid parameters (see <pro>computegrid</pro>) 
    6461; 
    6562; @restrictions 
     
    6764; 
    6865; @examples 
    69 ;  IDL> initncdf,'toto.nc',glam=[-180,180] 
     66; IDL> initncdf,'toto.nc',glam=[-180,180] 
    7067; 
    7168; @history 
     
    7774; 
    7875;- 
    79 ;------------------------------------------------------------ 
    80 ;------------------------------------------------------------ 
    81 ;------------------------------------------------------------ 
     76; 
    8277PRO initncdf, ncfilein $ 
    8378              , ZAXISNAME = zaxisname, MASKNAME = maskname $ 
     
    8681              , XYINDEX = xyindex, ZINDEX = zindex $ 
    8782              , _EXTRA = ex 
    88 ; 
    8983; 
    9084  compile_opt idl2, strictarrsubs 
     
    9993  endif 
    10094; if the file is stored on tape 
    101   if !version.os_family EQ 'unix' then spawn, 'file '+ncfile+' > /dev/null'  
     95  if !version.os_family EQ 'unix' then spawn, 'file '+ncfile+' > /dev/null' 
    10296;---------------------------------------------------------- 
    10397; open the file 
     
    109103  namedim = strarr(inside.ndims) 
    110104  for dimiq = 0, inside.ndims-1 do begin 
    111     ncdf_diminq, cdfid, dimiq, tmpname, value  
     105    ncdf_diminq, cdfid, dimiq, tmpname, value 
    112106    namedim[dimiq] = strlowcase(tmpname) 
    113107  ENDFOR 
     
    126120; find the zaxis 
    127121  IF keyword_set(romsgrid) THEN BEGIN 
    128     FOR i = 0, inside.ndims-1 DO BEGIN  
     122    FOR i = 0, inside.ndims-1 DO BEGIN 
    129123      ncdf_diminq, cdfid, i, name, size 
    130124      CASE strlowcase(name) OF 
     
    136130        ELSE: 
    137131      ENDCASE 
    138     ENDFOR  
     132    ENDFOR 
    139133    IF (where(namevar EQ 'h'))[0] NE -1 THEN BEGIN 
    140134      ncdf_varget, cdfid, 'h', romsh 
    141135    ENDIF ELSE romsh = -1 
    142   ENDIF ELSE BEGIN  
     136  ENDIF ELSE BEGIN 
    143137    if keyword_set(zaxisname) then zaxisname = strlowcase(zaxisname) ELSE zaxisname = 'z' 
    144138    zvarid = (where(namevar EQ 'nav_lev' or namevar EQ zaxisname OR namevar EQ 'level' OR namevar EQ 'lev' OR strmid(namevar, 0, 5) EQ 'depth'))[0] 
     
    149143; read the zaxis 
    150144    if zvarid NE -1 THEN ncdf_varget, cdfid, zvarid, zaxis 
    151   ENDELSE  
     145  ENDELSE 
    152146  IF keyword_set(zindex) AND keyword_set(zaxis) THEN $ 
    153147     zaxis = keyword_set(start1) + findgen(n_elements(zaxis)) 
     
    158152    keyword_set(maskname):BEGIN 
    159153      mskid = (where(namevar EQ strlowcase(maskname)))[0] 
    160       if mskid NE -1 THEN BEGIN  
     154      if mskid NE -1 THEN BEGIN 
    161155        mskinq = ncdf_varinq(cdfid, mskid) 
    162156; is the mask variable containing the record dimension? 
    163157        withrcd = (where(mskinq.dim EQ inside.recdim))[0] 
    164158        IF withrcd NE -1 THEN BEGIN 
    165 ; in order to read only the first record           
     159; in order to read only the first record 
    166160; we need to get the size of each dimension 
    167161          count = replicate(1L, mskinq.ndims) 
     
    172166            ENDIF 
    173167          ENDFOR 
    174 ; read the variable for the first record           
     168; read the variable for the first record 
    175169          ncdf_varget, cdfid, mskid, tmask, count = count 
    176170        ENDIF ELSE ncdf_varget, cdfid, mskid, tmask 
    177 ; check if we need to applay add_offset and scale factor          
     171; check if we need to applay add_offset and scale factor 
    178172        FOR a = 0, mskinq.natts-1 DO BEGIN 
    179           attname = ncdf_attname(cdfid, mskid, a)      
     173          attname = ncdf_attname(cdfid, mskid, a) 
    180174          CASE strlowcase(attname) OF 
    181175            'add_offset':ncdf_attget, cdfid, mskid, attname, add_offset 
     
    188182        if keyword_set(invmask) then tmask = 1-tmask 
    189183        tmask = byte(round(tmask)) 
    190       ENDIF ELSE tmask = -1        
     184      ENDIF ELSE tmask = -1 
    191185    END 
    192186;.................. 
    193187    keyword_set(useasmask):BEGIN 
    194188      mskid = (where(namevar EQ strlowcase(useasmask)))[0] 
    195       if mskid NE -1 THEN BEGIN  
     189      if mskid NE -1 THEN BEGIN 
    196190        mskinq = ncdf_varinq(cdfid, mskid) 
    197191; is the mask variable containing the record dimension? 
    198192        withrcd = (where(mskinq.dim EQ inside.recdim))[0] 
    199193        IF withrcd NE -1 THEN BEGIN 
    200 ; in order to read only the first record           
     194; in order to read only the first record 
    201195; we need to get the size of each dimension 
    202196          count = replicate(1L, mskinq.ndims) 
     
    207201            ENDIF 
    208202          ENDFOR 
    209 ; read the variable for the first record        
     203; read the variable for the first record 
    210204          ncdf_varget, cdfid, mskid, tmask, count = count 
    211205        ENDIF ELSE ncdf_varget, cdfid, mskid, tmask 
    212 ; check if we need to applay add_offset and scale factor        
     206; check if we need to applay add_offset and scale factor 
    213207        FOR a = 0, mskinq.natts-1 DO BEGIN 
    214           attname = ncdf_attname(cdfid, mskid, a)      
     208          attname = ncdf_attname(cdfid, mskid, a) 
    215209          CASE strlowcase(attname) OF 
    216210            'add_offset':ncdf_attget, cdfid, mskid, attname, add_offset 
     
    236230          IF min(tmask) EQ 1 THEN BEGIN 
    237231            print, 'missing or nan values not found...' 
    238             tmask = -1           
     232            tmask = -1 
    239233          ENDIF 
    240234        ENDELSE 
    241       ENDIF ELSE tmask = -1        
     235      ENDIF ELSE tmask = -1 
    242236    END 
    243237;.................. 
     
    248242; 
    249243; compute the grid 
    250   if NOT keyword_set(zaxis) then BEGIN  
     244  if NOT keyword_set(zaxis) then BEGIN 
    251245    computegrid, xaxis = xaxis, yaxis = yaxis $ 
    252                  , mask = tmask, onearth = 1b - keyword_set(xyindex), ROMSH = romsh, _EXTRA = ex  
    253   ENDIF ELSE BEGIN  
     246                 , mask = tmask, onearth = 1b - keyword_set(xyindex), ROMSH = romsh, _EXTRA = ex 
     247  ENDIF ELSE BEGIN 
    254248    computegrid, xaxis = xaxis, yaxis = yaxis, zaxis = zaxis $ 
    255249                 , mask = tmask, onearth = 1b - keyword_set(xyindex), ROMSH = romsh, _EXTRA = ex 
    256   ENDELSE  
     250  ENDELSE 
    257251  IF n_elements(time) EQ 0 THEN time = 0 
    258   jpt = n_elements(time)  
     252  jpt = n_elements(time) 
    259253;---------------------------------------------------------- 
    260254 
Note: See TracChangeset for help on using the changeset viewer.