Ignore:
Timestamp:
07/05/11 13:58:48 (13 years ago)
Author:
pinsard
Message:

no more hard coded path in iterp_erai*.pro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/interp_erai_sst_1989_2009.pro

    r50 r66  
    33; .. _interp_erai_sst_1989_2009.pro: 
    44; 
    5 ; ============================= 
    6 ; interp_erai_sst_1989_2009.pro 
    7 ; ============================= 
     5; ============================================================================== 
     6; interp_erai_sst_1989_2009.pro - Interpolation of sst from ERA-I grid to OAFLUX 
     7; ============================================================================== 
     8; 
     9; Interpolation of sst from ERA-I grid to OAFLUX grid 
     10; 
     11; :file:`${PROJECT_ID}/20c3m_erai_sstk_TROP_1989_2009.nc` containing sst from ERA-I have been produced 
     12; by :ref:`compute_erai_daily_region_2d.sh`. 
     13; 
     14; :file:`${PROJECT_ID}/mask_oaflux_30N30S.nc` containing OAFLUX grid have been p roduced by :ref:`oaflux_mask_30N30S.pro`. 
     15; 
     16; Interpolated sst is written in 
     17; :file:`${PROJECT_OD}/erai_sst_19890101_20091231_oafluxgrid.nc` if this file not already exists. 
     18; 
     19; This output file :file:`${PROJECT_OD}/erai_sst_19890101_20091231_oafluxgrid.nc` must be processed after by :ref:`sst_correction_ncdf.pro`. 
     20; 
    821; 
    922;     .. graphviz:: 
     
    1326;           rankdir="LR", 
    1427;           ] 
    15 ;           file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_sstk_TROP_1989_2009.nc"]; 
     28;           file_in [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/20c3m_erai_sstk_TROP_1989_2009.nc"]; 
    1629; 
    1730;           mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; 
    1831; 
    19 ;           ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_sst_19890101_20091231_oafluxgrid.nc"]; 
     32;           ncfile [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_sst_19890101_20091231_oafluxgrid.nc"]; 
    2033; 
    2134;           interp_erai_sst_1989_2009 [shape=box, 
     
    4255; :func:`ncdf_quickwrite <saxo:ncdf_quickwrite>` 
    4356; 
     57; :ref:`sst_correction_ncdf` 
     58; 
    4459; EXAMPLES 
    4560; ======== 
     
    4762; :: 
    4863; 
     64;  IDL> .compile file_interp 
    4965;  IDL> interp_erai_sst_1989_2009 
    5066; 
     
    5268; ==== 
    5369; 
    54 ; hard coded directory - usage of ${PROJECT_ID} 
     70; make it work : pb on loholt1:: 
     71; 
     72;   Variable is undefined: OUTMASK_IND. 
    5573; 
    5674; coding rules 
     75; 
     76; use real output of :ref:`compute_erai_daily_region_2d.sh`. 
    5777; 
    5878; KNOWN ISSUES 
     
    6585; ========== 
    6686; 
     87; $Id$ 
     88; 
     89; $URL$ 
     90; 
     91; - pinsard 2011-07-04T15:45:35Z loholt1.ipsl.polytechnique.fr (Linux) 
     92; 
     93;   * usage of ${PROJECT_ID} and $PROJECT_OD 
     94; 
    6795; - fplod 20101217T140745Z aedon.locean-ipsl.upmc.fr (Darwin) 
    6896; 
     
    78106; 
    79107; - pbk 2008 
    80 ; 
    81108; 
    82109;   * creation 
     
    84111;- 
    85112pro interp_erai_sst_1989_2009 
    86 @common 
     113; 
     114@cm_4cal 
     115@cm_4data 
     116@cm_4mesh 
     117@cm_4data 
    87118@cm_project 
    88119; 
     
    121152   STOP 
    122153ENDIF 
    123  
    124 filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_sstk_TROP_1989_2009.nc' 
    125  
    126 initncdf, filein 
     154; 
     155; build data filename 
     156filename='20c3m_erai_sstk_TROP_1989_2009.nc' 
     157; 
     158; check if this file exists 
     159fullfilename = isafile(iodirin + filename, NEW=0, /MUST_EXIST) 
     160IF fullfilename_msk[0] EQ '' THEN BEGIN 
     161   msg = 'eee : the file ' + fullfilename_msk + ' was not found.' 
     162   ras = report(msg) 
     163   STOP 
     164ENDIF 
     165; 
     166; test if ${PROJECT_OD} defined 
     167CASE project_od_env OF 
     168  '' : BEGIN 
     169         msg = 'eee : ${PROJECT_OD} is not defined' 
     170         ras = report(msg) 
     171       STOP 
     172       END 
     173  ELSE: BEGIN 
     174          msg = 'iii : ${PROJECT_OD} is ' + project_od_env 
     175          ras = report(msg) 
     176        END 
     177 ENDCASE 
     178; 
     179; check if output data will be possible 
     180iodirout = isadirectory(project_od_env) 
     181; 
     182; existence and protection 
     183IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
     184    msg = 'eee : the directory' + iodirout  + ' was not found.' 
     185    ras = report(msg) 
     186    STOP 
     187ENDIF 
     188; 
     189; build output filename 
     190filename_out = 'erai_sst_19890101_20091231_oafluxgrid.nc' 
     191fullfilename_out = iodirout + filename_out 
     192; in order to avoid unexpected overwritten 
     193IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     194   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
     195   ras = report(msg) 
     196   STOP 
     197ENDIF 
     198; 
     199initncdf, fullfilename 
    127200domdef 
    128201latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) 
    129202print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) 
    130203print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) 
    131 sstkin=read_ncdf("sstk",19871201,20100930,file=filein,/nostr) 
     204sstkin=read_ncdf("sstk",19871201,20100930,file=fullfilename,/nostr) 
    132205 
    133206timein=time & jptin=jpt 
     
    166239lat=latout 
    167240lon=lonout 
    168 ncfile='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_sst_19890101_20091231_oafluxgrid.nc' 
     241ncfile='!' + fullfilename_out 
    169242lon_attr={units:'degrees_east',long_name:'Longitude'} 
    170243lat_attr={units:'degrees_north',long_name:'Latitude'} 
Note: See TracChangeset for help on using the changeset viewer.