Changeset 163 for trunk/src


Ignore:
Timestamp:
03/19/12 09:00:25 (12 years ago)
Author:
pinsard
Message:

implement overwrite mechanism

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cm_project.pro

    r97 r163  
    2424; $URL$ 
    2525; 
     26; - fplod 20120319 
     27; 
     28;   * add project_overwrite 
     29; 
    2630; - fplod 20110411T082258Z cratos.locean-ipsl.upmc.fr (Linux) 
    2731; 
     
    2933; 
    3034;- 
    31 COMMON project, project_env, project_id_env, project_od_env 
     35COMMON project, project_env, project_id_env, project_od_env, project_overwrite 
  • trunk/src/interp_erai_t2m.pro

    r156 r163  
    138138; see :func:`file_interp <saxo:file_interp>` 
    139139; 
    140 ; use as input a file produced by compute_erai_daily_region_2d.sh or  
     140; use as input a file produced by compute_erai_daily_region_2d.sh or 
    141141; get_erai.py + grib to netcdf conversion 
    142142; 
     
    165165; 
    166166; $URL: svn+ssh://pinsard@forge.ipsl.jussieu.fr/ipsl/forge/projets/tropflux/svn/trunk/src/interp_erai_t2m.pro $ 
     167; 
     168; - fplod 20120319 
     169; 
     170;   * taking project_overwite into account 
    167171; 
    168172; - fplod 20120306 
     
    335339fullfilename_out = iodirout + filename_out 
    336340; in order to avoid unexpected overwritten 
    337 IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     341IF ((FILE_TEST(fullfilename_out) EQ 1)  AND (project_overwrite EQ 0)) THEN BEGIN 
    338342   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
    339343   ras = report(msg) 
  • trunk/src/oaflux_mask_30n30s.pro

    r156 r163  
    3636;      } 
    3737; 
    38 ; :returns: 0 if ok,  -1 if error 
     38; :returns: 0 if ok, -1 if error 
    3939; :rtype: integer 
    4040; 
     
    8787; 
    8888; global attributes corrections : 
     89; 
    8990;  - written now : OAFLUX mask over the Indian Ocean: 40E-120E, 30S-30N 
    9091;  - while data latitude=[-29.5,+29.5] longitude=[30.5,379.5] 
     
    104105; 
    105106; $URL$ 
     107; 
     108; - fplod 20120319 
     109; 
     110;   * taking project_overwite into account 
    106111; 
    107112; - fplod 20120306 
     
    173178fullfilename_out=project_od_env+'mask_oaflux_30N30S.nc' 
    174179; in order to avoid unexpected overwritten 
    175 IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     180PRINT, 'project_overwrite : ',project_overwrite 
     181IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 
    176182   msg = 'eee : the file ' + fullfilename_out  + ' already exists.' 
    177183   ras = report(msg) 
  • trunk/src/project_init.pro

    • Property svn:keywords set to Id URL
    r99 r163  
    1010; =========== 
    1111; 
    12 ; This is the SAXO initialisation file. 
     12; This is the IDL/:ref:<saxo:saxo> initialisation file. 
     13; 
     14; .. note:: 
     15; 
     16;    **project_overwrite** is here set to ``0`` : Existing files won't be  
     17;    overwritten. It might be set  
     18;    to ``1`` when you want to overwrite existing files in IDL process. 
    1319; 
    1420; It ++:: 
     
    1723; 
    1824; or:: 
     25; 
    1926;   $ idl -IDL_STARTUP project_init.pro 
    2027; 
     
    4249; 
    4350; $URL$ 
     51; 
     52; - fplod 20120319  
     53; 
     54;   * define a overwrite status 
    4455; 
    4556; - fplod 20110429T081938Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    8596project_od_env=project_od_env_temp 
    8697; 
    87 ; compatibility with the old version 
     98; define overwrite status 
     99project_overwrite = 0 
     100; 
     101; compatibility with the old version of SAXO 
    88102; 
    89103keep_compatibility, 0 
  • trunk/src/tropflux.sh

    r155 r163  
    110110# 
    111111# $URL$ 
     112# 
     113# - pinsard 20120319 
     114# 
     115#   * add project_overwrite usage 
    112116# 
    113117# - pinsard 20120306 
     
    278282pro tropflux_${$} 
    279283compile_opt idl2, strictarrsubs, logical_predicate 
     284@cm_project 
     285; 
     286; define overwrite status 
     287; set to 1 to overwrite existing files 
     288project_overwrite = 0 
     289; 
    280290result = oaflux_mask_30n30s() 
    281291IF result < 0 THEN BEGIN 
     
    321331${IDL_CMD} << EOF >> ${log} 2>&1 
    322332.compile file_interp 
     333; 
    323334tropflux_${$} 
    324335EOF 
Note: See TracChangeset for help on using the changeset viewer.