Changeset 276


Ignore:
Timestamp:
09/04/07 11:55:29 (17 years ago)
Author:
smasson
Message:

add direc keyword to read_ncdf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/LECTURE/read_ncdf.pro

    r275 r276  
    4141; For ROMS outputs. Use by read_ncdf itself to access auxilliary data (h and zeta). 
    4242; 
     43; @keyword DIREC 
     44; a string used to specify the direction along which we want to make 
     45; spatial and/or temporal mean. It could be: 'x' 'y' 'z' 't' 'xy' 'xz' 
     46; 'yz' 'xyz' 'xt' 'yt' 'zt' 'xyt' 'xzt' 'yzt' or 'xyzt'  
     47; 
    4348; @keyword FILENAME {required}{type=string} 
    4449; It contains he file's name. 
     
    96101                    , PARENTIN = parentin, TIMESTEP = timestep, ADDSCL_BEFORE = addscl_before $ 
    97102                    , TOUT = tout, NOSTRUCT = nostruct, CONT_NOFILL = CONT_NOFILL, INIT = init $ 
    98                     , GRID = grid, CALLITSELF = callitself $ 
     103                    , GRID = grid, CALLITSELF = callitself, DIREC = direc $ 
    99104                    , ZETAFILENAME = zetafilename, ZETAZERO = zetazero $ 
    100105                    , _EXTRA = ex 
     
    386391  ENDIF 
    387392;--------------------------------------------------------------------- 
     393  IF keyword_set(direc) THEN BEGIN 
     394    IF jpt EQ 1 THEN res = moyenne(temporary(res), direc) $ 
     395    ELSE BEGIN 
     396      res = grossemoyenne(temporary(res), direc) 
     397      IF ( strpos(strlowcase(direc), 't') ge 0 ) THEN BEGIN 
     398        vardate = strtrim(jul2date(time[0]), 1)+' - '+strtrim(jul2date(time[jpt-1]), 1) 
     399        time = total(time)/float(jpt) 
     400        jpt = 1 
     401      ENDIF 
     402    ENDELSE  
     403  ENDIF 
     404;--------------------------------------------------------------------- 
    388405  ncdf_close, cdfid 
    389406 
Note: See TracChangeset for help on using the changeset viewer.