#! /bin/sh
#+
#
# .. program:: get_pirata_netcdf.sh
#
# .. _get_pirata_netcdf.sh:
#
# ==================================================
# get_pirata_netcdf.sh -- get PIRATA reference files
# ==================================================
#
# 
# SYNOPSIS
# ========
#
# ::
#
#  $ get_pirata_netcdf.sh
#
# DESCRIPTION
# ===========
#
# ``get_pirata_netcdf.sh`` get PIRATA reference files
#
# SEE ALSO
# ========
#
# :ref:`guide data PIRATA <data_in_pirata>`
#
# TODO
# ====
#
# trace
#
# hard coded directory - usage of ${TROPFLUX_ID}
#
# coding rules
#
# EVOLUTIONS
# ==========
#
# - fplod 20101213T160729Z aedon.locean-ipsl.upmc.fr (Darwin)
#
#   * minimal header
#
# - jv 2008
#
#   * creation
#
#-
dir=/Users/jv/data/PIRATA/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="          0n0e"
sitelist="$sitelist 10s10w 6s10w 0n10w"
sitelist="$sitelist 0n23w 4n23w 12n23w 21n23w"
sitelist="$sitelist 19s34w 14s32w 8s30w 0n35w"
sitelist="$sitelist 4n38w 8n38w 12n38w 15n38w 20n38w" 

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
