Changeset 462 for trunk


Ignore:
Timestamp:
04/15/11 19:49:48 (13 years ago)
Author:
smasson
Message:

get time axis even when using /timestep keyword in read_ncdfSRC/ToBeReviewed/LECTURE/read_ncdf.pro

Location:
trunk/SRC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Computation/bsf.pro

    r445 r462  
    2323; @keyword REFVALUE {type=scalar} {default=0.} 
    2424; the bsf value that we want to speficy at the position defined by refpoint 
     25; 
     26; @keyword TRANSPORT {type=scalar: 0 or 1} {default=0.} 
     27; activate to specify that z3d is not a zonal current but a zonal 
     28; transport (e2u*e3u*un) 
    2529; 
    2630; @returns {type=2D xy array} 
     
    5963;- 
    6064; 
    61 FUNCTION bsf, z3d, NOSTRUCTURE = nostructure, REFPOINT = refpoint, REFVALUE = refvalue 
     65FUNCTION bsf, z3d, NOSTRUCTURE = nostructure, REFPOINT = refpoint, REFVALUE = refvalue, TRANSPORT = transport 
    6266; 
    6367  compile_opt idl2, strictarrsubs 
     
    8185  un = fitintobox(temporary(un)) 
    8286; 
    83   e23 = e3u_3d(/e2) 
    84 ; 
    85 ; mask the array 
    86   un = temporary(umsk) * temporary(un) 
     87; current -> transport 
     88  IF NOT keyword_set(transport) THEN un = temporary(un) * e3u_3d(/e2) 
     89  utr = temporary(umsk) * temporary(un) 
    8790; compute the bsf 
    88   bsf = 1.e-6 * total(total(temporary(un) * temporary(e23), 3), 2, /cumulative) 
     91  bsf = 1.e-6 * total(total(temporary(utr), 3), 2, /cumulative) 
    8992; set bsf to 0 in the largest continent... no done... 
    9093  IF keyword_set(refpoint) THEN BEGIN 
  • trunk/SRC/Computation/msf.pro

    r445 r462  
    2828; Set this keyword to a named variable in which msf will return the 2d 
    2929; array (yz) should be used by pltz to do plot the land/sea mask(see example) 
     30; 
     31; @keyword TRANSPORT {type=scalar: 0 or 1} {default=0.} 
     32; activate to specify that z3d is not a zonal current but a zonal 
     33; transport (e1v*e3v*vn) 
    3034; 
    3135; @returns {type=2D yz array} 
     
    6569;- 
    6670; 
    67 FUNCTION msf, z3d, mask2d, INDEXBOXZOOM = indexboxzoom, MASKOUT = maskout, NOSTRUCTURE = nostructure 
     71FUNCTION msf, z3d, mask2d, INDEXBOXZOOM = indexboxzoom, MASKOUT = maskout, NOSTRUCTURE = nostructure, TRANSPORT = transport 
    6872; 
    6973  compile_opt idl2, strictarrsubs 
     
    9599  IF keyword_set(key_partialstep) AND total(msk[*, ny-1, *]) NE 0 THEN flagdata = 1 
    96100; 
    97   e13 = e3v_3d(/e1)  
     101; current -> transport 
     102  IF NOT keyword_set(transport) THEN vn = temporary(vn) * e3v_3d(/e1)  
     103  vtr = temporary(vn) * msk 
    98104; 
    99 ; mask the array 
    100   vn = temporary(vn) * msk 
    101105  IF arg_present(maskout) THEN BEGIN 
    102106    msk = total(temporary(msk), 1) 
     
    108112 
    109113; defaut computation: 
    110 ;  msf = 1.e-6 * total(total(temporary(e13) * temporary(vn), 1), 2, /cumulative) 
     114;  msf = 1.e-6 * total(total(temporary(vtr), 1), 2, /cumulative) 
    111115; but we force the computation from bottom to up. 
    112   msf = total(temporary(vn) * temporary(e13), 1) ; -> yz array 
     116  msf = total(temporary(vtr), 1) ; -> yz array 
    113117  msf = reverse(temporary(msf), 2) 
    114118  msf = 1.e-6 * total(temporary(msf), 2, /cumulative) 
  • trunk/SRC/ToBeReviewed/LECTURE/read_ncdf.pro

    r460 r462  
    189189      firsttps = long(beginning[0]) 
    190190      IF n_elements(ending) NE 0 THEN lasttps = long(ending[0]) ELSE lasttps = firsttps 
    191       jpt = lasttps-firsttps+1 
    192       IF NOT keyword_set(callitself) then time = julday(1, 1, 1) + lindgen(jpt) 
     191      IF NOT keyword_set(callitself) then BEGIN  
     192        time = ncdf_gettime(filename, cdfid, caller = 'read_ncdf', err = err, _extra = ex) 
     193        jpt = lasttps-firsttps+1 
     194        IF time[0] LT 0 then time = julday(1, 1, 1) + lindgen(jpt) $ 
     195        ELSE time = time[firsttps:lasttps] 
     196      ENDIF ELSE jpt = lasttps-firsttps+1 
    193197    END 
    194198    keyword_set(parent):BEGIN 
     
    204208      jpt = lasttps-firsttps+1 
    205209    END 
    206     keyword_set(allrecords):BEGIN 
     210    keyword_set(allrecords) OR n_elements(beginning) EQ 0:BEGIN 
    207211      time = ncdf_gettime(filename, cdfid, caller = 'read_ncdf', err = err, _extra = ex) 
    208212      IF time[0] LT 0 then BEGIN  
Note: See TracChangeset for help on using the changeset viewer.