Changeset 48 for trunk/src


Ignore:
Timestamp:
04/21/11 17:58:31 (13 years ago)
Author:
pinsard
Message:

consolidation of RAMA/TAO/PIRATA get tools and doc

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_oaflux.sh

    r33 r48  
    4646#           fontname=Courier, 
    4747#           color=blue, 
    48 #           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_oaflux.pro" 
    49 #           label="${TROPFLUX}/src/get_oaflux.pro"]; 
     48#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_oaflux.sh" 
     49#           label="${TROPFLUX}/src/get_oaflux.sh"]; 
    5050# 
    5151#           {oaflux_ref} -> {get_oaflux} -> {file_oaflux} 
     
    8282# EVOLUTIONS 
    8383# ========== 
     84# 
     85# - fplod 20110421T125407Z aedon.locean-ipsl.upmc.fr (Darwin) 
     86# 
     87#   * typo 
    8488# 
    8589# - fplod 20101216T152647Z aedon.locean-ipsl.upmc.fr (Darwin) 
  • trunk/src/get_pirata_netcdf.sh

    r4 r48  
    1010# ================================================== 
    1111# 
    12 #  
     12# 
    1313# SYNOPSIS 
    1414# ======== 
     
    2323# ``get_pirata_netcdf.sh`` get PIRATA reference files 
    2424# 
     25# bf 
     26#   buoyancy flux 
     27# d 
     28#   sigma-theta 
     29# dyn 
     30#   dynamic height 
     31# emp 
     32#   e-p 
     33# iso 
     34#   20C depth 
     35# met 
     36#   wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh) 
     37# pos 
     38#   lon, lat 
     39# rad 
     40#   shortwave down 
     41# rf 
     42#   rain heat flux 
     43# w 
     44#   wind 
     45# 
     46# Log file is written on :file:`${TROPFLUX_LOG}/get_pirata_netcdf.log.{YYYYMMDDTHHMMSSZ}` 
     47# 
     48#     .. graphviz:: 
     49# 
     50#        digraph get_pirata_netcdf { 
     51#           graph [ 
     52#           rankdir="TB", 
     53#           ] 
     54# 
     55#           pirata_ref [shape=diamond,fontname=Courier,label="ftp://ftp.pmel.noaa.gov/cdf/sites/daily/*_*_dy.cdf"]; 
     56# 
     57#           file_pirata  [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/*_*_dy.cdf"]; 
     58# 
     59#           get_pirata_netcdf [shape=box, 
     60#           fontname=Courier, 
     61#           color=blue, 
     62#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_pirata_netcdf.sh" 
     63#           label="${TROPFLUX}/src/get_pirata_netcdf.sh"]; 
     64# 
     65#           {pirata_ref} -> {get_pirata_netcdf} -> {file_pirata} 
     66# 
     67#          } 
     68# 
     69# EXAMPLES 
     70# ======== 
     71# 
     72# You don't have any PIRATA reference data, you just have to run this tool :: 
     73# 
     74#  $ get_pirata_netcdf.sh 
     75# 
     76# And look at log file with :: 
     77# 
     78#  $ tlogd.sh get_pirata_netcdf 
     79# 
     80# and of course on files in ${TROPFLUX_ID}. 
     81# 
    2582# SEE ALSO 
    2683# ======== 
     
    2885# :ref:`guide data PIRATA <data_in_pirata>` 
    2986# 
     87# :ref:`tropflux_profile.sh` 
     88# 
    3089# TODO 
    3190# ==== 
    3291# 
    33 # trace 
    34 # 
    35 # hard coded directory - usage of ${TROPFLUX_ID} 
    36 # 
    37 # coding rules 
     92# list of variables and sites in DESCRIPTION 
     93# 
     94# do we really need all these variables and sites 
     95# 
     96# study wget status (no exit now on non null wget status) 
    3897# 
    3998# EVOLUTIONS 
    4099# ========== 
    41100# 
     101# $Id$ 
     102# 
     103# - fplod 20110421T125622Z aedon.locean-ipsl.upmc.fr (Darwin) 
     104# 
     105#   * consolidation 
     106# 
    42107# - fplod 20101213T160729Z aedon.locean-ipsl.upmc.fr (Darwin) 
    43108# 
     
    49114# 
    50115#- 
    51 dir=/Users/jv/data/PIRATA/data/ 
    52  
    53 # bf  : buoyancy flux 
    54 # d   : sigma-theta 
    55 # dyn : dynamic height 
    56 # emp : e-p 
    57 # iso : 20C depth 
    58 # met : wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh) 
    59 # pos : lon, lat 
    60 # rad : shortwave down 
    61 # rf  : rain heat flux 
    62 # w   : wind 
    63  
     116system=$(uname) 
     117case "${system}" in 
     118   AIX|IRIX64) 
     119      echo "www : no specific posix checking" 
     120   ;; 
     121   *) 
     122     set -o posix 
     123   ;; 
     124esac 
     125unset system 
     126# 
     127LANG=POSIX 
     128# 
     129command=$(basename ${0}) 
     130log_date=$(date -u +"%Y%m%dT%H%M%SZ") 
     131# 
     132usage=" Usage : ${command}" 
     133# 
     134hostname=$(hostname) 
     135# 
     136# default 
     137# N.A. because no parameters 
     138# 
     139set -u 
     140# 
     141# test if wget available 
     142tool=wget 
     143type ${tool} 1> /dev/null 2>&1 
     144status=${?} 
     145if [ ${status} -ne 0 ] 
     146then 
     147   echo "${command} : eee : tool ${tool} not found" 
     148   exit 1 
     149fi 
     150unset status 
     151unset tool 
     152# 
     153# check for ${TROPFLUX_LOG} definition 
     154if [ "${TROPFLUX_LOG}" = "" ] 
     155then 
     156   echo "${command} : eee : \${TROPFLUX_LOG} not defined" 
     157   exit 1 
     158fi 
     159# 
     160# check for ${TROPFLUX_LOG} existence 
     161if [ ! -d ${TROPFLUX_LOG} ] 
     162then 
     163   echo "${command} : eee : ${TROPFLUX_LOG} not found" 
     164   exit 1 
     165fi 
     166# 
     167# check for permission access on TROPFLUX_LOG 
     168if [ ! -x ${TROPFLUX_LOG} ] 
     169then 
     170   echo "${command} : eee : ${TROPFLUX_LOG} not reachable" 
     171   exit 1 
     172fi 
     173# 
     174# check for write permission on TROPFLUX_LOG 
     175if [ ! -w ${TROPFLUX_LOG} ] 
     176then 
     177   echo "${command} : eee : ${TROPFLUX_LOG} not writable" 
     178   exit 1 
     179fi 
     180# 
     181log=${TROPFLUX_LOG}/$(basename ${0} .sh).log.${log_date} 
     182echo "[Context]" 1>> ${log} 
     183echo "command=$(basename ${0})" 1>>${log} 
     184echo "hostname=${hostname}" 1>> ${log} 
     185echo "runtime=${log_date}" 1>> ${log} 
     186unset log_date 
     187echo "" 1>> ${log} 
     188# 
    64189varlist="adcp airt bf bp cur d dyn emp evap heat iso lw lwnet met pos qlat qnet qsen rad rain rf rh s ssd sss sst swnet t tau w" 
    65190sitelist="          0n0e" 
    66 sitelist="$sitelist 10s10w 6s10w 0n10w" 
    67 sitelist="$sitelist 0n23w 4n23w 12n23w 21n23w" 
    68 sitelist="$sitelist 19s34w 14s32w 8s30w 0n35w" 
    69 sitelist="$sitelist 4n38w 8n38w 12n38w 15n38w 20n38w"  
    70  
    71 cd $dir 
    72 for site in $sitelist ; do 
    73  for var in $varlist ; do 
    74   wget --password=G10b@LCh@Ng3 ftp://taopmelftp@ftp.pmel.noaa.gov/cdf/sites/daily/${var}${site}_dy.cdf 
    75  done 
     191sitelist="${sitelist} 10s10w 6s10w 0n10w" 
     192sitelist="${sitelist} 0n23w 4n23w 12n23w 21n23w" 
     193sitelist="${sitelist} 19s34w 14s32w 8s30w 0n35w" 
     194sitelist="${sitelist} 4n38w 8n38w 12n38w 15n38w 20n38w" 
     195# 
     196locref="ftp://ftp.pmel.noaa.gov/cdf/sites/daily" 
     197# 
     198list_url="" 
     199# 
     200# build URL = f(site,var) 
     201for site in ${sitelist} 
     202do 
     203   for var in ${varlist} 
     204   do 
     205       list_url="${list_url} ${locref}/${var}${site}_dy.cdf" 
     206   done 
    76207done 
    77  
    78 ls -l 
     208unset site 
     209unset var 
     210unset varlist 
     211unset sitelist 
     212unset locref 
     213# 
     214# if file is not already in ${TROPFLUX_ID}, get it 
     215for url in ${list_url} 
     216do 
     217  file=${TROPFLUX_ID}/$(basename ${url}) 
     218  if [ ! -f ${file} ] 
     219  then 
     220     wget --tries=1 --no-verbose -P ${TROPFLUX_ID} \ 
     221        --user=taopmelftp \ 
     222        --password=G10b@LCh@Ng3 \ 
     223        ${url} >> ${log} 2>&1 
     224     wget_status=${?} 
     225     if [ ${wget_status} -ne 0 ] 
     226     then 
     227        echo "${command} : eee : ${url} not found" >> ${log} 2>&1 
     228        # ++ exit 1 
     229     else 
     230        echo "${command} : iii : ${url} found" >> ${log} 2>&1 
     231     fi 
     232     unset wget_status 
     233  else 
     234     echo "iii : ${file} exists" >> ${log} 
     235  fi 
     236done 
     237unset file 
     238unset url 
     239unset list_url 
     240# 
     241unset command 
     242unset log 
     243unset hostname 
     244unset usage 
     245# 
     246# end 
     247set 
     248exit 0 
  • trunk/src/get_rama_netcdf.sh

    r4 r48  
    1010# ============================================== 
    1111# 
    12 # 
    1312# SYNOPSIS 
    1413# ======== 
     
    2322# ``get_rama_netcdf.sh`` get RAMA reference files 
    2423# 
     24# bf 
     25#   buoyancy flux 
     26# d 
     27#   sigma-theta 
     28# dyn 
     29#   dynamic height 
     30# emp 
     31#   e-p 
     32# iso 
     33#   20C depth 
     34# met 
     35#   wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh) 
     36# pos 
     37#   lon, lat 
     38# rad 
     39#   shortwave down 
     40# rf 
     41#   rain heat flux 
     42# w 
     43#   wind 
     44# 
     45# Log file is written on :file:`${TROPFLUX_LOG}/get_rama_netcdf.log.{YYYYMMDDTHHMMSSZ}` 
     46# 
     47#     .. graphviz:: 
     48# 
     49#        digraph get_rama_netcdf { 
     50#           graph [ 
     51#           rankdir="TB", 
     52#           ] 
     53# 
     54#           rama_ref [shape=diamond,fontname=Courier,label="ftp://ftp.pmel.noaa.gov/cdf/sites/daily/*_*_dy.cdf"]; 
     55# 
     56#           file_rama  [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/*_*_dy.cdf"]; 
     57# 
     58#           get_rama_netcdf [shape=box, 
     59#           fontname=Courier, 
     60#           color=blue, 
     61#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_rama_netcdf.sh" 
     62#           label="${TROPFLUX}/src/get_rama_netcdf.sh"]; 
     63# 
     64#           {rama_ref} -> {get_rama_netcdf} -> {file_rama} 
     65# 
     66#          } 
     67# 
     68# EXAMPLES 
     69# ======== 
     70# 
     71# You don't have any RAMA reference data, you just have to run this tool :: 
     72# 
     73#  $ get_rama_netcdf.sh 
     74# 
     75# And look at log file with :: 
     76# 
     77#  $ tlogd.sh get_rama_netcdf 
     78# 
     79# and of course on files in ${TROPFLUX_ID}. 
     80# 
    2581# SEE ALSO 
    2682# ======== 
     
    2884# :ref:`guide data RAMA <data_in_rama>` 
    2985# 
     86# :ref:`tropflux_profile.sh` 
     87# 
    3088# TODO 
    3189# ==== 
    3290# 
    33 # trace 
    34 # 
    35 # hard coded directory - usage of ${TROPFLUX_ID} 
    36 # 
    37 # coding rules 
     91# list of variables and sites in DESCRIPTION 
     92# 
     93# do we really need all these variables and sites 
     94# 
     95# Liste complète de RAMA:: 
     96# 
     97#  sitelist="                   16s55e    12s55e    8s55e    4s55e    1.5s55e    0n55e    1.5n55e    4n55e" 
     98#  sitelist="${sitelist}                                                                               15n65e" 
     99#  sitelist="${sitelist}                    12s67e     8s67e    4s67e    1.5s67e    0n67e     1.5n67e    4n67e    8n67e" 
     100#  sitelist="${sitelist}  16s80.5e 12s80.5e 8s80.5e 4s80.5e 1.5s80.5e 0n80.5e 1.5n80.5e 4n80.5e" 
     101#  sitelist="${sitelist}               1.5s90e 0n90e 1.5n90e 4n90e 8n90e 12n90e 15n90e 
     102#  sitelist="${sitelist}  16s95e 12s95e 8s95e  5s95e" 
     103# 
     104# study wget status (no exit now on non null wget status) 
    38105# 
    39106# EVOLUTIONS 
    40107# ========== 
    41108# 
     109# $Id$ 
     110# 
     111# - fplod 20110421T133632Z aedon.locean-ipsl.upmc.fr (Darwin) 
     112# 
     113#   * consolidation 
     114# 
    42115# - fplod 20101213T160928Z aedon.locean-ipsl.upmc.fr (Darwin) 
    43116# 
     
    49122# 
    50123#- 
    51  
    52  
    53 dir=/Users/jv/data/RAMA/data/ 
    54  
    55 # bf  : buoyancy flux 
    56 # d   : sigma-theta 
    57 # dyn : dynamic height 
    58 # emp : e-p 
    59 # iso : 20C depth 
    60 # met : wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh) 
    61 # pos : lon, lat 
    62 # rad : shortwave down 
    63 # rf  : rain heat flux 
    64 # w   : wind 
    65  
     124system=$(uname) 
     125case "${system}" in 
     126   AIX|IRIX64) 
     127      echo "www : no specific posix checking" 
     128   ;; 
     129   *) 
     130     set -o posix 
     131   ;; 
     132esac 
     133unset system 
     134# 
     135LANG=POSIX 
     136# 
     137command=$(basename ${0}) 
     138log_date=$(date -u +"%Y%m%dT%H%M%SZ") 
     139# 
     140usage=" Usage : ${command}" 
     141# 
     142hostname=$(hostname) 
     143# 
     144# default 
     145# N.A. because no parameters 
     146# 
     147set -u 
     148# 
     149# test if wget available 
     150tool=wget 
     151type ${tool} 1> /dev/null 2>&1 
     152status=${?} 
     153if [ ${status} -ne 0 ] 
     154then 
     155   echo "${command} : eee : tool ${tool} not found" 
     156   exit 1 
     157fi 
     158unset status 
     159unset tool 
     160# 
     161# check for ${TROPFLUX_LOG} definition 
     162if [ "${TROPFLUX_LOG}" = "" ] 
     163then 
     164   echo "${command} : eee : \${TROPFLUX_LOG} not defined" 
     165   exit 1 
     166fi 
     167# 
     168# check for ${TROPFLUX_LOG} existence 
     169if [ ! -d ${TROPFLUX_LOG} ] 
     170then 
     171   echo "${command} : eee : ${TROPFLUX_LOG} not found" 
     172   exit 1 
     173fi 
     174# 
     175# check for permission access on TROPFLUX_LOG 
     176if [ ! -x ${TROPFLUX_LOG} ] 
     177then 
     178   echo "${command} : eee : ${TROPFLUX_LOG} not reachable" 
     179   exit 1 
     180fi 
     181# 
     182# check for write permission on TROPFLUX_LOG 
     183if [ ! -w ${TROPFLUX_LOG} ] 
     184then 
     185   echo "${command} : eee : ${TROPFLUX_LOG} not writable" 
     186   exit 1 
     187fi 
     188# 
     189log=${TROPFLUX_LOG}/$(basename ${0} .sh).log.${log_date} 
     190echo "[Context]" 1>> ${log} 
     191echo "command=$(basename ${0})" 1>>${log} 
     192echo "hostname=${hostname}" 1>> ${log} 
     193echo "runtime=${log_date}" 1>> ${log} 
     194unset log_date 
     195echo "" 1>> ${log} 
     196# 
    66197varlist="adcp airt bf bp cur d dyn emp evap heat iso lw lwnet met pos qlat qnet qsen rad rain rf rh s ssd sss sst swnet t tau w" 
     198# 
    67199sitelist="12s55e 8s55e 8s67e 8s80.5e 4s80.5e 1.5s80.5e 0n80.5e 1.5n80.5e 1.5s90e 0n90e 1.5n90e 4n90e 8n90e 12n90e 15n90e 5s95e" 
    68200 
    69 cd $dir 
    70 for site in $sitelist ; do 
    71  for var in $varlist ; do 
    72   wget --password=G10b@LCh@Ng3 ftp://taopmelftp@ftp.pmel.noaa.gov/cdf/sites/daily/${var}${site}_dy.cdf 
    73  done 
    74 done 
    75  
    76 ls -l 
    77  
    78201# 
    79202#Liste complète de RAMA: 
    80203#sitelist="                   16s55e    12s55e    8s55e    4s55e    1.5s55e    0n55e    1.5n55e    4n55e" 
    81 #siteliste="$sitelist                                                                               15n65e" 
    82 #siteliste="$sitelist                    12s67e     8s67e    4s67e    1.5s67e    0n67e     1.5n67e    4n67e    8n67e" 
    83 #siteliste="$sitelist  16s80.5e 12s80.5e 8s80.5e 4s80.5e 1.5s80.5e 0n80.5e 1.5n80.5e 4n80.5e" 
    84 #siteliste="$sitelist               1.5s90e 0n90e 1.5n90e 4n90e 8n90e 12n90e 15n90e 
    85 #siteliste="$sitelist  16s95e 12s95e 8s95e  5s95e" 
    86 # 
     204#sitelist="${sitelist}                                                                               15n65e" 
     205#sitelist="${sitelist}                    12s67e     8s67e    4s67e    1.5s67e    0n67e     1.5n67e    4n67e    8n67e" 
     206#sitelist="${sitelist}  16s80.5e 12s80.5e 8s80.5e 4s80.5e 1.5s80.5e 0n80.5e 1.5n80.5e 4n80.5e" 
     207#sitelist="${sitelist}               1.5s90e 0n90e 1.5n90e 4n90e 8n90e 12n90e 15n90e 
     208#sitelist="${sitelist}  16s95e 12s95e 8s95e  5s95e" 
     209# 
     210# 
     211locref="ftp://ftp.pmel.noaa.gov/cdf/sites/daily" 
     212# 
     213list_url="" 
     214# 
     215# build URL = f(site,var) 
     216for site in ${sitelist} 
     217do 
     218   for var in ${varlist} 
     219   do 
     220       list_url="${list_url} ${locref}/${var}${site}_dy.cdf" 
     221   done 
     222done 
     223unset site 
     224unset var 
     225unset varlist 
     226unset sitelist 
     227unset locref 
     228# 
     229# if file is not already in ${TROPFLUX_ID}, get it 
     230for url in ${list_url} 
     231do 
     232  file=${TROPFLUX_ID}/$(basename ${url}) 
     233  if [ ! -f ${file} ] 
     234  then 
     235     wget --tries=1 --no-verbose -P ${TROPFLUX_ID} \ 
     236        --user=taopmelftp \ 
     237        --password=G10b@LCh@Ng3 \ 
     238        ${url} >> ${log} 2>&1 
     239     wget_status=${?} 
     240     if [ ${wget_status} -ne 0 ] 
     241     then 
     242        echo "${command} : eee : ${url} not found" >> ${log} 2>&1 
     243        # ++ exit 1 
     244     else 
     245        echo "${command} : iii : ${url} found" >> ${log} 2>&1 
     246     fi 
     247     unset wget_status 
     248  else 
     249     echo "iii : ${file} exists" >> ${log} 
     250  fi 
     251done 
     252unset file 
     253unset url 
     254unset list_url 
     255# 
     256unset command 
     257unset log 
     258unset hostname 
     259unset usage 
     260# 
     261# end 
     262set 
     263exit 0 
  • trunk/src/get_tao_netcdf.sh

    r4 r48  
    1010# ============================================ 
    1111# 
    12 # 
    1312# SYNOPSIS 
    1413# ======== 
     
    2322# ``get_tao_netcdf.sh`` get TAO reference files 
    2423# 
     24# bf 
     25#   buoyancy flux 
     26# d 
     27#   sigma-theta 
     28# dyn 
     29#   dynamic height 
     30# emp 
     31#   e-p 
     32# iso 
     33#   20C depth 
     34# met 
     35#   wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh) 
     36# pos 
     37#   lon, lat 
     38# rad 
     39#   shortwave down 
     40# rf 
     41#   rain heat flux 
     42# w 
     43#   wind 
     44# 
     45# Log file is written on :file:`${TROPFLUX_LOG}/get_tao_netcdf.log.{YYYYMMDDTHHMMSSZ}` 
     46# 
     47#     .. graphviz:: 
     48# 
     49#        digraph get_tao_netcdf { 
     50#           graph [ 
     51#           rankdir="TB", 
     52#           ] 
     53# 
     54#           tao_ref [shape=diamond,fontname=Courier,label="ftp://ftp.pmel.noaa.gov/cdf/sites/daily/*_*_dy.cdf"]; 
     55# 
     56#           file_tao  [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/*_*_dy.cdf"]; 
     57# 
     58#           get_tao_netcdf [shape=box, 
     59#           fontname=Courier, 
     60#           color=blue, 
     61#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_tao_netcdf.sh" 
     62#           label="${TROPFLUX}/src/get_tao_netcdf.sh"]; 
     63# 
     64#           {tao_ref} -> {get_tao_netcdf} -> {file_tao} 
     65# 
     66#          } 
     67# 
     68# EXAMPLES 
     69# ======== 
     70# 
     71# You don't have any TAO reference data, you just have to run this tool :: 
     72# 
     73#  $ get_tao_netcdf.sh 
     74# 
     75# And look at log file with :: 
     76# 
     77#  $ tlogd.sh get_tao_netcdf 
     78# 
     79# and of course on files in ${TROPFLUX_ID}. 
     80# 
    2581# SEE ALSO 
    2682# ======== 
     
    2884# :ref:`guide data TAO <data_in_tao>` 
    2985# 
     86# :ref:`tropflux_profile.sh` 
     87# 
    3088# TODO 
    3189# ==== 
    3290# 
    33 # trace 
    34 # 
    35 # hard coded directory - usage of ${TROPFLUX_ID} 
    36 # 
    37 # coding rules 
     91# list of variables and sites in DESCRIPTION 
     92# 
     93# do we really need all these variables and sites 
     94# 
     95# study wget status (no exit now on non null wget status) 
    3896# 
    3997# EVOLUTIONS 
    4098# ========== 
    4199# 
     100# $Id$ 
     101# 
     102# - fplod 20110421T154046Z aedon.locean-ipsl.upmc.fr (Darwin) 
     103# 
     104#   * consolidation 
     105# 
    42106# - fplod 20101213T161152Z aedon.locean-ipsl.upmc.fr (Darwin) 
    43107# 
     
    49113# 
    50114#- 
    51 dir=/Users/jv/data/TAO/data/ 
    52  
    53 # bf  : buoyancy flux 
    54 # d   : sigma-theta 
    55 # dyn : dynamic height 
    56 # emp : e-p 
    57 # iso : 20C depth 
    58 # met : wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh) 
    59 # pos : lon, lat 
    60 # rad : shortwave down 
    61 # rf  : rain heat flux 
    62 # w   : wind 
    63  
     115system=$(uname) 
     116case "${system}" in 
     117   AIX|IRIX64) 
     118      echo "www : no specific posix checking" 
     119   ;; 
     120   *) 
     121     set -o posix 
     122   ;; 
     123esac 
     124unset system 
     125# 
     126LANG=POSIX 
     127# 
     128command=$(basename ${0}) 
     129log_date=$(date -u +"%Y%m%dT%H%M%SZ") 
     130# 
     131usage=" Usage : ${command}" 
     132# 
     133hostname=$(hostname) 
     134# 
     135# default 
     136# N.A. because no parameters 
     137# 
     138set -u 
     139# 
     140# test if wget available 
     141tool=wget 
     142type ${tool} 1> /dev/null 2>&1 
     143status=${?} 
     144if [ ${status} -ne 0 ] 
     145then 
     146   echo "${command} : eee : tool ${tool} not found" 
     147   exit 1 
     148fi 
     149unset status 
     150unset tool 
     151# 
     152# check for ${TROPFLUX_LOG} definition 
     153if [ "${TROPFLUX_LOG}" = "" ] 
     154then 
     155   echo "${command} : eee : \${TROPFLUX_LOG} not defined" 
     156   exit 1 
     157fi 
     158# 
     159# check for ${TROPFLUX_LOG} existence 
     160if [ ! -d ${TROPFLUX_LOG} ] 
     161then 
     162   echo "${command} : eee : ${TROPFLUX_LOG} not found" 
     163   exit 1 
     164fi 
     165# 
     166# check for permission access on TROPFLUX_LOG 
     167if [ ! -x ${TROPFLUX_LOG} ] 
     168then 
     169   echo "${command} : eee : ${TROPFLUX_LOG} not reachable" 
     170   exit 1 
     171fi 
     172# 
     173# check for write permission on TROPFLUX_LOG 
     174if [ ! -w ${TROPFLUX_LOG} ] 
     175then 
     176   echo "${command} : eee : ${TROPFLUX_LOG} not writable" 
     177   exit 1 
     178fi 
     179# 
     180log=${TROPFLUX_LOG}/$(basename ${0} .sh).log.${log_date} 
     181echo "[Context]" 1>> ${log} 
     182echo "command=$(basename ${0})" 1>>${log} 
     183echo "hostname=${hostname}" 1>> ${log} 
     184echo "runtime=${log_date}" 1>> ${log} 
     185unset log_date 
     186echo "" 1>> ${log} 
     187# 
    64188varlist="adcp airt bf bp cur d dyn emp evap heat iso lw lwnet met pos qlat qnet qsen rad rain rf rh s ssd sss sst swnet t tau w" 
    65 sitelist=                                       "2n137e 5n137e 8n137e" 
    66 sitelist="$sitelist                      0n147e 2n147e 5n147e" 
    67 sitelist="$sitelist        5s156e 2s156e 0n156e 2n156e 5n156e 8n156e" 
    68 sitelist="$sitelist 8s165e 5s165e 2s165e 0n165e 2n165e 5n165e 8n165e" 
    69 sitelist="$sitelist 8s180w 5s180w 2s180w 0n180w 2n180w 5n180w 8n180w" 
    70 sitelist="$sitelist 8s170w 5s170w 2s170w 0n170w 2n170w 5n170w 8n170w" 
    71 sitelist="$sitelist 8s155w 5s155w 2s155w 0n155w 2n155w 5n155w 8n155w" 
    72 sitelist="$sitelist        5s140w 2s140w 0n140w 2n140w 5n140w 9n140w" 
    73 sitelist="$sitelist 8s125w 5s125w 2s125w 0n125w 2n125w 5n125w 8n125w" 
    74 sitelist="$sitelist 8s110w 5s110w 2s110w 0n110w 2n110w 5n110w 8n110w" 
    75 sitelist="$sitelist 8s95w  5s95w  2s95w  0n95w  2n95w  5n95w  8n95w " 
    76  
    77 echo $sitelist 
    78  
    79 cd $dir 
    80 for site in $sitelist ; do 
    81  for var in $varlist ; do 
    82   wget --password=G10b@LCh@Ng3 ftp://taopmelftp@ftp.pmel.noaa.gov/cdf/sites/daily/${var}${site}_dy.cdf 
    83  done 
     189# 
     190sitelist="                                        2n137e 5n137e 8n137e" 
     191sitelist="${sitelist}                      0n147e 2n147e 5n147e" 
     192sitelist="${sitelist}        5s156e 2s156e 0n156e 2n156e 5n156e 8n156e" 
     193sitelist="${sitelist} 8s165e 5s165e 2s165e 0n165e 2n165e 5n165e 8n165e" 
     194sitelist="${sitelist} 8s180w 5s180w 2s180w 0n180w 2n180w 5n180w 8n180w" 
     195sitelist="${sitelist} 8s170w 5s170w 2s170w 0n170w 2n170w 5n170w 8n170w" 
     196sitelist="${sitelist} 8s155w 5s155w 2s155w 0n155w 2n155w 5n155w 8n155w" 
     197sitelist="${sitelist}        5s140w 2s140w 0n140w 2n140w 5n140w 9n140w" 
     198sitelist="${sitelist} 8s125w 5s125w 2s125w 0n125w 2n125w 5n125w 8n125w" 
     199sitelist="${sitelist} 8s110w 5s110w 2s110w 0n110w 2n110w 5n110w 8n110w" 
     200sitelist="${sitelist} 8s95w  5s95w  2s95w  0n95w  2n95w  5n95w  8n95w " 
     201# 
     202locref="ftp://ftp.pmel.noaa.gov/cdf/sites/daily" 
     203# 
     204list_url="" 
     205# 
     206# build URL = f(site,var) 
     207for site in ${sitelist} 
     208do 
     209   for var in ${varlist} 
     210   do 
     211       list_url="${list_url} ${locref}/${var}${site}_dy.cdf" 
     212   done 
    84213done 
    85  
    86 ls -l 
     214unset site 
     215unset var 
     216unset varlist 
     217unset sitelist 
     218unset locref 
     219# 
     220# if file is not already in ${TROPFLUX_ID}, get it 
     221for url in ${list_url} 
     222do 
     223  file=${TROPFLUX_ID}/$(basename ${url}) 
     224  if [ ! -f ${file} ] 
     225  then 
     226     wget --tries=1 --no-verbose -P ${TROPFLUX_ID} \ 
     227        --user=taopmelftp \ 
     228        --password=G10b@LCh@Ng3 \ 
     229        ${url} >> ${log} 2>&1 
     230     wget_status=${?} 
     231     if [ ${wget_status} -ne 0 ] 
     232     then 
     233        echo "${command} : eee : ${url} not found" >> ${log} 2>&1 
     234        # ++ exit 1 
     235     else 
     236        echo "${command} : iii : ${url} found" >> ${log} 2>&1 
     237     fi 
     238     unset wget_status 
     239  else 
     240     echo "iii : ${file} exists" >> ${log} 
     241  fi 
     242done 
     243unset file 
     244unset url 
     245unset list_url 
     246# 
     247unset command 
     248unset log 
     249unset hostname 
     250unset usage 
     251# 
     252# end 
     253set 
     254exit 0 
Note: See TracChangeset for help on using the changeset viewer.