#! /bin/sh
#+
#
# .. program:: get_tao_netcdf.sh
#
# .. _get_tao_netcdf.sh:
#
# ============================================
# get_tao_netcdf.sh -- get TAO reference files
# ============================================
#
#
# SYNOPSIS
# ========
#
# ::
#
#  $ get_tao_netcdf.sh
#
# DESCRIPTION
# ===========
#
# ``get_tao_netcdf.sh`` get TAO reference files
#
# SEE ALSO
# ========
#
# :ref:`guide data TAO <data_in_tao>`
#
# TODO
# ====
#
# trace
#
# hard coded directory - usage of ${TROPFLUX_ID}
#
# coding rules
#
# EVOLUTIONS
# ==========
#
# - fplod 20101213T161152Z aedon.locean-ipsl.upmc.fr (Darwin)
#
#   * minimal header
#
# - jv 2008
#
#   * creation
#
#-
dir=/Users/jv/data/TAO/data/

# bf  : buoyancy flux
# d   : sigma-theta
# dyn : dynamic height
# emp : e-p
# iso : 20C depth
# met : wind (u,v,speed,direction),  airT, hum rel, SST   (= w + airt + rh)
# pos : lon, lat
# rad : shortwave down
# rf  : rain heat flux
# w   : wind

varlist="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"
sitelist=                                       "2n137e 5n137e 8n137e"
sitelist="$sitelist                      0n147e 2n147e 5n147e"
sitelist="$sitelist        5s156e 2s156e 0n156e 2n156e 5n156e 8n156e"
sitelist="$sitelist 8s165e 5s165e 2s165e 0n165e 2n165e 5n165e 8n165e"
sitelist="$sitelist 8s180w 5s180w 2s180w 0n180w 2n180w 5n180w 8n180w"
sitelist="$sitelist 8s170w 5s170w 2s170w 0n170w 2n170w 5n170w 8n170w"
sitelist="$sitelist 8s155w 5s155w 2s155w 0n155w 2n155w 5n155w 8n155w"
sitelist="$sitelist        5s140w 2s140w 0n140w 2n140w 5n140w 9n140w"
sitelist="$sitelist 8s125w 5s125w 2s125w 0n125w 2n125w 5n125w 8n125w"
sitelist="$sitelist 8s110w 5s110w 2s110w 0n110w 2n110w 5n110w 8n110w"
sitelist="$sitelist 8s95w  5s95w  2s95w  0n95w  2n95w  5n95w  8n95w "

echo $sitelist

cd $dir
for site in $sitelist ; do
 for var in $varlist ; do
  wget --password=G10b@LCh@Ng3 ftp://taopmelftp@ftp.pmel.noaa.gov/cdf/sites/daily/${var}${site}_dy.cdf
 done
done

ls -l
