Changeset 50 for trunk/src/get_oaflux.sh


Ignore:
Timestamp:
04/29/11 11:09:12 (13 years ago)
Author:
pinsard
Message:

replace TROPFLUX by PROJECT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_oaflux.sh

    r48 r50  
    2020# =========== 
    2121# 
    22 # Put in ${TROPFLUX_ID} OAFLUX reference file 
     22# Put in ${PROJECT_ID} OAFLUX reference file 
    2323# 
    2424# Once this tool executed :ref:`oaflux_mask_30N30S.pro` can be launched. 
    2525# 
    26 # Log file is written on :file:`${TROPFLUX_LOG}/get_oaflux.log.{YYYYMMDDTHHMMSSZ}` 
     26# Log file is written on :file:`${PROJECT_LOG}/get_oaflux.log.{YYYYMMDDTHHMMSSZ}` 
    2727# 
    2828# 
     
    3636#           oaflux_ref [shape=diamond,fontname=Courier,label="ftp://ftp.whoi.edu/pub/science/oaflux/data_v3/monthly/turbulence/lh_oaflux_2004.nc.gz"]; 
    3737# 
    38 #           file_oaflux [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/lh_oaflux_2004.nc"]; 
     38#           file_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lh_oaflux_2004.nc"]; 
    3939# 
    4040#           get_oaflux [shape=box, 
     
    4242#           color=blue, 
    4343#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_oaflux.sh" 
    44 #           label="${TROPFLUX}/src/get_oaflux.sh"]; 
     44#           label="${PROJECT}/src/get_oaflux.sh"]; 
    4545#           get_oaflux [shape=box, 
    4646#           fontname=Courier, 
    4747#           color=blue, 
    4848#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_oaflux.sh" 
    49 #           label="${TROPFLUX}/src/get_oaflux.sh"]; 
     49#           label="${PROJECT}/src/get_oaflux.sh"]; 
    5050# 
    5151#           {oaflux_ref} -> {get_oaflux} -> {file_oaflux} 
     
    6666#  $ tlogd.sh get_oaflux 
    6767# 
    68 # and of course on files in ${TROPFLUX_ID}. 
     68# and of course on files in ${PROJECT_ID}. 
    6969# 
    7070# TODO 
     
    7676# :ref:`guide data OAFLUX <data_in_oaflux>` 
    7777# 
    78 # :ref:`tropflux_profile.sh` 
     78# :ref:`project_profile.sh` 
    7979# 
    8080# :ref:`oaflux_mask_30N30S.pro` 
     
    141141unset tool 
    142142# 
    143 # check for ${TROPFLUX_LOG} definition 
    144 if [ "${TROPFLUX_LOG}" = "" ] 
    145 then 
    146    echo "${command} : eee : \${TROPFLUX_LOG} not defined" 
    147    exit 1 
    148 fi 
    149 # 
    150 # check for ${TROPFLUX_LOG} existence 
    151 if [ ! -d ${TROPFLUX_LOG} ] 
    152 then 
    153    echo "${command} : eee : ${TROPFLUX_LOG} not found" 
    154    exit 1 
    155 fi 
    156 # 
    157 # check for permission access on TROPFLUX_LOG 
    158 if [ ! -x ${TROPFLUX_LOG} ] 
    159 then 
    160    echo "${command} : eee : ${TROPFLUX_LOG} not reachable" 
    161    exit 1 
    162 fi 
    163 # 
    164 # check for write permission on TROPFLUX_LOG 
    165 if [ ! -w ${TROPFLUX_LOG} ] 
    166 then 
    167    echo "${command} : eee : ${TROPFLUX_LOG} not writable" 
    168    exit 1 
    169 fi 
    170 # 
    171 log=${TROPFLUX_LOG}/$(basename ${0} .sh).log.${log_date} 
     143# check for ${PROJECT_LOG} definition 
     144if [ "${PROJECT_LOG}" = "" ] 
     145then 
     146   echo "${command} : eee : \${PROJECT_LOG} not defined" 
     147   exit 1 
     148fi 
     149# 
     150# check for ${PROJECT_LOG} existence 
     151if [ ! -d ${PROJECT_LOG} ] 
     152then 
     153   echo "${command} : eee : ${PROJECT_LOG} not found" 
     154   exit 1 
     155fi 
     156# 
     157# check for permission access on PROJECT_LOG 
     158if [ ! -x ${PROJECT_LOG} ] 
     159then 
     160   echo "${command} : eee : ${PROJECT_LOG} not reachable" 
     161   exit 1 
     162fi 
     163# 
     164# check for write permission on PROJECT_LOG 
     165if [ ! -w ${PROJECT_LOG} ] 
     166then 
     167   echo "${command} : eee : ${PROJECT_LOG} not writable" 
     168   exit 1 
     169fi 
     170# 
     171log=${PROJECT_LOG}/$(basename ${0} .sh).log.${log_date} 
    172172echo "[Context]" 1>> ${log} 
    173173echo "command=$(basename ${0})" 1>>${log} 
     
    180180fileref_gz=${fileref}.gz 
    181181locref=ftp://ftp.whoi.edu/pub/science/oaflux/data_v3/monthly/turbulence/ 
    182 if  [ -f ${TROPFLUX_ID}/${fileref} ] 
    183 then 
    184    echo "${command} : iii : ${TROPFLUX_ID}/${fileref} exist" 1>> ${log} 
     182if  [ -f ${PROJECT_ID}/${fileref} ] 
     183then 
     184   echo "${command} : iii : ${PROJECT_ID}/${fileref} exist" 1>> ${log} 
    185185   echo "${command} : iii : nothing done" 1>> ${log} 
    186186else 
    187    wget --tries=1 --no-verbose -P ${TROPFLUX_ID} ${locref}/${fileref_gz} 1>> ${log} 2>&1 
     187   wget --tries=1 --no-verbose -P ${PROJECT_ID} ${locref}/${fileref_gz} 1>> ${log} 2>&1 
    188188   wget_status=${?} 
    189189   if [ ${wget_status} -ne 0 ] 
     
    197197   # 
    198198   # decompress 
    199    gunzip ${TROPFLUX_ID}${fileref_gz} 
     199   gunzip ${PROJECT_ID}${fileref_gz} 
    200200   gunzip_status=${?} 
    201201   if [ ${gunzip_status} -ne 0 ] 
Note: See TracChangeset for help on using the changeset viewer.