Changeset 183 for trunk


Ignore:
Timestamp:
03/29/12 13:59:31 (12 years ago)
Author:
pinsard
Message:

tropflux_wind_stress is now a function

Location:
trunk/src
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/tropflux.sh

    r179 r183  
    9696# :func:`t2m_correction_ncdf`, :func:`ws_correction_ncdf`, 
    9797# :func:`tropflux_swr_dt`, :func:`tropflux_swr_nrt`, :func:`tropflux_swr_blnd`, 
    98 # :func:`tropflux_nrt_cdf`, 
     98# :func:`tropflux_nrt_cdf`,:func:`tropflux_wind_stress` 
    9999# etc. 
    100100# 
     
    108108# make it work 
    109109# 
     110# if yyyymmdd < 20071231, is it meaningfull to call all the fucntions ? 
     111# 
    110112# idl status = 0 even if not ok 
    111113# 
     
    118120# 
    119121# $URL$ 
     122# 
     123# - pinsard 20120329 
     124# 
     125#   * add tropflux_wind_stress (to be consolidated) 
    120126# 
    121127# - pinsard 20120326 
     
    452458   exit 
    453459ENDIF 
     460result = tropflux_wind_stress(${yyyymmddb}, ${yyyymmdde}) 
     461IF result < 0 THEN BEGIN 
     462   msg = 'eee : pb after tropflux_wind_stress' + string(result) 
     463   err = report(msg) 
     464   exit 
     465ENDIF 
    454466end 
    455467EOF 
  • trunk/src/tropflux_wind_stress.pro

    r182 r183  
    11;+ 
    22; 
    3 ; .. _TropFlux_wind_stress_19890101_20101231.pro: 
     3; .. _tropflux_wind_stress.pro: 
    44; 
    5 ; ========================================== 
    6 ; TropFlux_wind_stress_19890101_20101231.pro 
    7 ; ========================================== 
     5; ======================== 
     6; tropflux_wind_stress.pro 
     7; ======================== 
    88; 
    99; DESCRIPTION 
    1010; =========== 
    11  
     11; 
     12; SEE ALSO 
     13; ======== 
     14; 
    1215; TODO 
    1316; ==== 
    1417; 
    1518; integration to the whole process 
     19; 
     20; check existence protection 
     21; 
     22; complete header, complete data_contents.rst 
     23; 
     24; graphviz 
    1625; 
    1726; EVOLUTIONS 
     
    2130; 
    2231; $URL$ 
     32; 
     33; - fplod 20120329 
     34; 
     35;   * pro -> func 
     36;   * rename with lower case TropFlux_wind_stress_19890101_20101231.pro become 
     37;     tropflux_wind_stress.pro 
     38;   * hard coded st and en replaced by yyyymmddb and yyyymmdde parameters 
     39;   * add compile_opt  
     40;   * get rid of hard coded path 
    2341; 
    2442; - fplod 20110830T153220Z cratos (Linux) 
     
    3149; 
    3250;- 
    33 pro TropFlux_wind_stress_19890101_20101231 
    34 @common 
    35 ;------------------------------------------------------------ 
    36 st=19880101 
    37 en=20101231 
    38 st=19880101 
    39 en=20101231 
     51function tropflux_wind_stress $ 
     52         , yyyymmddb $ 
     53         , yyyymmdde 
    4054; 
    41 file="/Volumes/PAYASAM/TropFlux/ERA_C_1989_2010/TropFlux_19890101_20101231.nc" 
     55compile_opt idl2, strictarrsubs, logical_predicate 
     56; 
     57@cm_4cal 
     58@cm_4data 
     59@cm_4mesh 
     60@cm_4data 
     61@cm_project 
     62; 
     63; 
     64; Return to caller if errors 
     65ON_ERROR, 2 
     66; 
     67result = -1 
     68; 
     69usage = 'result = tropflux_swr_dt(yyyymmddb, yyyymmdde)' 
     70nparam = N_PARAMS() 
     71IF (nparam NE 2) THEN BEGIN 
     72    ras = report(['Incorrect number of arguments.' $ 
     73          + '!C' $ 
     74          + 'Usage : ' + usage]) 
     75    return, result 
     76ENDIF 
     77 
     78dir=project_od_env 
     79file=dir + 'TropFlux_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    4280initncdf, file 
    43 tau=read_ncdf("tau", st, en, file=file,/nostr) 
     81tau=read_ncdf("tau", yyyymmddb-.5d,yyyymmdde, file=file,/nostr) 
    4482tau=reform(tau) 
    4583help, tau 
    4684; 
    47 stop 
    48 dir='/Volumes/PAYASAM/TropFlux/ERA_C_1989_2010/' 
    49 file_wind=dir+'TropFlux_ws_19890101_20101231.nc' 
    50 file_wg=dir+'gustiness_19890101_20101231.nc' 
     85file_wind=dir+'TropFlux_ws_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
     86file_wg=dir+'gustiness_' +  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    5187initncdf, file_wind 
    5288; 
    53 ws=read_ncdf('ws',st,en,file=file_wind,/nostr) 
    54 wg=read_ncdf('wg',st,en,file=file_wg,/nostr) 
     89ws=read_ncdf('ws',yyyymmddb-.5d,yyyymmdde,file=file_wind,/nostr) 
     90wg=read_ncdf('wg',yyyymmddb-.5d,yyyymmdde,file=file_wg,/nostr) 
    5591s=sqrt((ws*ws)+(wg*wg)) 
    5692s=reform(s) 
    5793help, s 
    5894; 
    59 file="/Volumes/Iomega_HDD/TropFlux/input_uncor/erai_ws_19890101_20101231.nc" 
     95file=dir+'erai_ws_+  string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '.nc' 
    6096initncdf, file 
    61 u=read_ncdf('u10',st,en,file=file,/nostr) 
    62 v=read_ncdf('v10',st,en,file=file,/nostr) 
     97u=read_ncdf('u10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr) 
     98v=read_ncdf('v10',yyyymmddb-.5d,yyyymmdde,file=file,/nostr) 
    6399; 
    64100u=reform(u) 
     
    101137@ncdf_quickwrite 
    102138; 
     139result = 0 
     140return, result 
     141; 
    103142end 
Note: See TracChangeset for help on using the changeset viewer.