Changeset 40 for trunk


Ignore:
Timestamp:
04/11/11 16:05:40 (13 years ago)
Author:
pinsard
Message:

improve IDL startup

Location:
trunk/src
Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/interp_erai_t2m_1989_2009.pro

    r33 r40  
    7171; :: 
    7272; 
     73;  IDL> @tropflux_init 
    7374;  IDL> .compile file_interp 
    7475;  IDL> interp_erai_t2m_1989_2009 
     
    161162pro interp_erai_t2m_1989_2009 
    162163; 
    163 @common 
     164@cm_4cal 
     165@cm_4data 
     166@cm_4mesh 
     167@cm_4data 
     168@cm_tropflux 
    164169; 
    165170; check for input directory 
    166171; 
    167172; test if ${TROPFLUX_ID} defined 
    168 tropflux_id_env=GETENV('TROPFLUX_ID') 
    169173CASE tropflux_id_env OF 
    170174    ''  :  BEGIN 
     
    211215; 
    212216; test if ${TROPFLUX_OD} defined 
    213 tropflux_od_env=GETENV('TROPFLUX_OD') 
    214217CASE tropflux_od_env OF 
    215218  '' : BEGIN 
  • trunk/src/oaflux_mask_30n30s.pro

    r33 r40  
    11;+ 
    22; 
    3 ; .. _oaflux_mask_30N30S.pro: 
     3; .. _oaflux_mask_30n30s.pro: 
    44; 
    55; ================================================================= 
    6 ; oaflux_mask_30N30S.pro -- OAFLUX mask over global tropical oceans 
     6; oaflux_mask_30n30s.pro -- OAFLUX mask over global tropical oceans 
    77; ================================================================= 
    88; 
     
    1818; .. graphviz:: 
    1919; 
    20 ;    digraph oaflux_mask_30N30S { 
     20;    digraph oaflux_mask_30n30s { 
    2121;       graph [ 
    2222;       rankdir="LR", 
     
    2525;       mask [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/mask_oaflux_30N30S.nc"]; 
    2626; 
    27 ;       oaflux_mask_30N30S [shape=box, 
     27;       oaflux_mask_30n30s [shape=box, 
    2828;       fontname=Courier, 
    2929;       color=blue, 
    30 ;       URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/oaflux_mask_30N30S.pro", 
    31 ;       label="${TROPFLUX}/src/oaflux_mask_30N30S.pro"]; 
     30;       URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/oaflux_mask_30n30s.pro", 
     31;       label="${TROPFLUX}/src/oaflux_mask_30n30s.pro"]; 
    3232; 
    33 ;       {file_oaflux} -> {oaflux_mask_30N30S} -> {mask} 
     33;       {file_oaflux} -> {oaflux_mask_30n30s} -> {mask} 
    3434; 
    3535;      } 
     
    4343; 
    4444; :ref:`tropflux_profile.sh` 
     45; :ref:`tropflux_init.pro` 
     46; :ref:`cm_tropflux.pro` 
    4547; 
    4648; :ref:`get_oaflux.sh` 
     
    6668; :: 
    6769; 
    68 ;  IDL> oaflux_mask_30N30S 
     70;  IDL> @tropflux_init 
     71;  IDL> oaflux_mask_30n30s 
    6972; 
    7073; TODO 
     
    9194; EVOLUTIONS 
    9295; ========== 
     96;  
     97; $ID$ 
    9398; 
     99; - fplod 20110411T140133Z aedon.locean-ipsl.upmc.fr (Darwin) 
     100; 
     101;   * usage of tropflux_init and cm_tropflux 
     102;   * replace 30N30S by 30n30s 
     103;  
    94104; - fplod 20101217T081915Z aedon.locean-ipsl.upmc.fr (Darwin) 
    95105; 
     
    107117;- 
    108118; 
    109 PRO oaflux_mask_30N30S 
     119PRO oaflux_mask_30n30s 
    110120; 
    111 @common 
    112 ; 
     121@cm_4cal 
     122@cm_4data 
     123@cm_4mesh 
     124@cm_4data 
     125@cm_tropflux 
     126 
    113127; check for input file 
    114 ; 
    115 ; test if ${TROPFLUX_ID} defined 
    116 tropflux_id_env=GETENV('TROPFLUX_ID') 
    117 CASE tropflux_id_env OF 
    118     ''  :  BEGIN 
    119      msg = 'eee : ${TROPFLUX_ID} is not defined' 
    120      ras = report(msg) 
    121      STOP 
    122            END 
    123  ELSE: BEGIN 
    124      msg = 'iii : ${TROPFLUX_ID} is ' + tropflux_id_env 
    125      ras = report(msg) 
    126        END 
    127 ENDCASE 
    128 ; 
    129 iodirin = isadirectory(tropflux_id_env) 
    130 ; 
    131 ; existence and protection of ${TROPFLUX_ID} 
    132 IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
    133    msg = 'eee : the directory' + iodirin  + ' is not accessible.' 
    134    ras = report(msg) 
    135    STOP 
    136 ENDIF 
    137 ; 
    138128; build input filename 
    139129yyyy=2004 
     
    142132; 
    143133; check if this file exists 
    144 fullfilename_in = isafile(iodirin + filename_in, NEW=0, /MUST_EXIST) 
     134fullfilename_in = isafile(tropflux_id_env + filename_in, NEW=0, /MUST_EXIST) 
    145135IF fullfilename_in[0] EQ '' THEN BEGIN 
    146136   msg = 'eee : the file ' + fullfilename_in + ' was not found.' 
     
    149139ENDIF 
    150140; 
    151 ; test if ${TROPFLUX_OD} defined 
    152 tropflux_od_env=GETENV('TROPFLUX_OD') 
    153 CASE tropflux_od_env OF 
    154   '' : BEGIN 
    155    msg = 'eee : ${TROPFLUX_OD} is not defined' 
    156    ras = report(msg) 
    157    STOP 
    158        END 
    159 ELSE: BEGIN 
    160    msg = 'iii : ${TROPFLUX_OD} is ' + tropflux_od_env 
    161    ras = report(msg) 
    162         END 
    163 ENDCASE 
    164141; 
    165 ; check if output data will be possible 
    166 iodirout = isadirectory(tropflux_od_env) 
    167 ; 
    168 ; existence and protection 
    169 IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
    170    msg = 'eee : the directory' + iodirout  + ' was not found.' 
    171    ras = report(msg) 
    172    STOP 
    173 ENDIF 
    174 ; 
    175 fullfilename_out=iodirout+'mask_oaflux_30N30S.nc' 
     142fullfilename_out=tropflux_od_env+'mask_oaflux_30N30S.nc' 
    176143; in order to avoid unexpected overwritten 
    177144IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 
     
    199166mask_out=mask_out([ind2,ind1],firstyt:lastyt)*1. 
    200167 
    201  
    202168ncfile='!'+fullfilename_out 
    203169lon_attr={units:'degrees_east',long_name:'Longitude'} 
  • trunk/src/tropflux_init.pro

    r39 r40  
    11;+ 
     2; 
     3; .. _tropflux_init.pro: 
    24; 
    35; ================= 
     
    1113; it defines the !path and the defaut values of some of the common variables 
    1214; 
    13 ;  
     15; 
    1416; It ++:: 
    1517; 
     18;   $ idl -startupfile tropflux_init.pro 
     19; 
     20; or:: 
    1621;   $ idl -IDL_STARTUP tropflux_init.pro 
    1722; 
     
    2227; 
    2328; 
     29; SEE ALSO 
     30; ======== 
     31; 
     32; :ref:`tropflux_profile.sh` 
     33; 
    2434; TODO 
    2535; ==== 
    2636; 
     37; learn to write IF .. ELSE in a @file 
     38; 
    2739; check idl -IDL_STARTUP tropflux_init.pro not ok now on cratos 
    28 ; 
    29 ; remove fplod/cratos dependencies. use $TROPFLUX* 
    30 ; 
    31 ; why cannot by recalled :: 
    32 ; 
    33 ;   IDL> @tropflux_init 
    34 ;   IDL> retall 
    35 ;   IDL> @tropflux_init 
    36 ;   Error opening file. File: oldcm_used 
    37 ;   Error opening file. File: oldcm_used 
    3840; 
    3941; EVOLUTIONS 
    4042; ========== 
     43; 
     44; - fplod 20110411T074056Z aedon.locean-ipsl.upmc.fr (Darwin) 
     45; 
     46;   * remove fplod/cratos dependencies use $TROPFLUX*; use SAXO_SRC; 
     47;     add cm_tropflux 
    4148; 
    4249; - fplod 20110408T131625Z cratos.locean-ipsl.upmc.fr (Linux) 
     
    4552; 
    4653;- 
    47 ; 
     54;  
     55; SAXO environment 
     56saxo_src_env=GETENV('SAXO_SRC') 
     57; tropflux environment 
     58@cm_tropflux 
     59tropflux_env=GETENV('TROPFLUX') 
     60tropflux_id_env=GETENV('TROPFLUX_ID') 
     61tropflux_od_env=GETENV('TROPFLUX_OD') 
     62 
    4863; path definition 
    4964; 
    50 !path = expand_path('+' + '/usr/home/fplod/incas/tropflux/tropflux_ws/src') $ 
    51       + path_sep(/search_path) + expand_path('+' + '/.autofs/home/smasson/SAXO_DIR/SRC') $ 
     65!path = expand_path('+' + tropflux_env + '/src') $ 
     66      + path_sep(/search_path) + expand_path('+' + saxo_src_env) $ 
    5267      + path_sep(/search_path) + expand_path('+' + !dir) 
    5368; 
     
    5873; define all the commons 
    5974; 
    60 @all_cm 
     75@cm_4cal 
     76@cm_4data 
     77@cm_4mesh 
     78@cm_4data 
    6179; 
    6280; define default directories 
    6381; 
    64 homedir = isadirectory('/usr/home/fplod/incas/tropflux/tropflux_ws/src/', title = 'Select the default HOME directory') 
    65 iodir = isadirectory('/usr/work/incas/fplod/tropflux_d/', title = 'Select the default IO directory') 
    66 psdir = isadirectory('/usr/work/incas/fplod/tropflux_d/', title = 'Select the default postscripts directory') 
    67 imagedir = isadirectory('/usr/work/incas/fplod/tropflux_d/', title = 'Select the default images directory') 
    68 animdir = isadirectory('/usr/work/incas/fplod/tropflux_d/', title = 'Select the default animations directory') 
     82homedir = isadirectory(tropflux_env + '/src/', title = 'Select the default HOME directory') 
     83iodir = isadirectory(tropflux_id_env, title = 'Select the default IO directory') 
     84psdir = isadirectory(tropflux_od_env, title = 'Select the default postscripts directory') 
     85imagedir = isadirectory(tropflux_od_env, title = 'Select the default images directory') 
     86animdir = isadirectory(tropflux_od_env, title = 'Select the default animations directory') 
    6987; 
    7088; define printer parameters 
  • trunk/src/tropflux_profile.sh

    r31 r40  
    1515# Online usage:: 
    1616# 
    17 #  $ . ./tropflux_profile.sh -d directory -i indir -o outdir -t tempdir 
     17#  $ . ./tropflux_profile.sh -d directory -i indir -o outdir -t tempdir -s saxo_src 
    1818# 
    1919# In ${HOME}/.profile, add the following line:: 
    2020# 
    21 #  . tropflux_profile.sh -d directory  -i indir -o outdir -t tempdir 
     21#  . tropflux_profile.sh -d directory  -i indir -o outdir -t tempdir -s saxo_src 
    2222# 
    2323# DESCRIPTION 
     
    2828# .. option:: -o  <outdir> 
    2929# .. option:: -t  <tempdir> 
     30# .. option:: -s  <saxo_src> 
    3031# 
    3132# define TROPFLUX environment 
     
    3839# 
    3940# ${TROPFLUX_OD} is the directory where output files will be written. 
     41# 
     42# ${SAXO_SRC} is the base directory of SAXO tools 
    4043# 
    4144# PATH is completed with ${TROPFLUX}. 
     
    4447# ======== 
    4548# 
     49# :ref:`troflux_init.pro` 
    4650# 
    4751# EXAMPLES 
     
    5559#    -i /usr/temp/${LOGNAME}/tropflux_d/ \ 
    5660#    -o /usr/temp/${LOGNAME}/tropflux_d/ \ 
    57 #    -t /usr/temp/${LOGNAME}/log/ 
    58 # 
    59 # For fplod on zeus.locean-ipsl.umpc.fr:: 
     61#    -t /usr/temp/${LOGNAME}/log/ \ 
     62#    -s /usr/home/fplod/SAXO_DIR/SRC/ 
     63# 
     64# For fplod on cratos.locean-ipsl.umpc.fr:: 
    6065# 
    6166#  $ cd ${HOME}/incas/tropflux/tropflux_ws/ 
     
    6469#    -i /usr/temp/${LOGNAME}/tropflux_d/ \ 
    6570#    -o /usr/temp/${LOGNAME}/tropflux_d/ \ 
    66 #    -t /usr/temp/${LOGNAME}/log/ 
     71#    -t /usr/temp/${LOGNAME}/log/ \ 
     72#    -s ${HOME}/SAXO_DIR/SRC/ 
    6773# 
    6874# For pinsard on camelot.ipsl.polytechnique.fr or merlin15-c.climserv:: 
     
    7480#   -o /homedata/${LOGNAME}/tropflux_d/ \ 
    7581#   -t /homedata/${LOGNAME}/log/ 
     82#   -s ${HOME}/SAXO_DIR/SRC/ 
    7683# 
    7784# TODO 
     
    112119command=tropflux_profile.sh 
    113120# 
    114 usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir" 
     121usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir -s saxo_src" 
    115122# 
    116123set +u 
     
    136143         # directory for temporary outputs choosen by user 
    137144         tempdir=${2} 
     145         shift 
     146      ;; 
     147      -s) 
     148         # directory for SAXO tools 
     149         saxo_src=${2} 
    138150         shift 
    139151      ;; 
     
    268280fi 
    269281# 
     282SAXO_SRC=${saxo_src} 
     283export SAXO_SRC 
     284unset saxo_src 
     285# 
    270286# end 
    271287unset command 
Note: See TracChangeset for help on using the changeset viewer.