Index: trunk/src/get_oaflux.sh
===================================================================
--- trunk/src/get_oaflux.sh	(revision 15)
+++ trunk/src/get_oaflux.sh	(revision 15)
@@ -0,0 +1,207 @@
+#! /bin/sh
+#+
+#
+# .. program:: get_oaflux.sh
+#
+# ==========================================
+# get_oaflux.sh -- Get OAFLUX reference file
+# ==========================================
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#  $ get_oaflux.sh
+#
+# DESCRIPTION
+# ===========
+#
+# Put in ${TROPFLUX_ID} OAFLUX reference file
+#
+# Once this tool executed :ref:`oaflux_mask_30N30S.pro` can be launched.
+#
+# Log file is written on :file:`${TROPFLUX_LOG}/get_oaflux.log.{YYYYMMDDTHHMMSSZ}`
+#
+#        digraph get_oaflux {
+#           graph [
+#           rankdir="TB",
+#           ]
+#
+#           oaflux_ref [shape=diamond,fontname=Courier,label="ftp://ftp.whoi.edu/pub/science/oaflux/data_v3/monthly/turbulence/lh_oaflux_2004.nc.gz"];
+#
+#           file_oaflux [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/lh_oaflux_2004.nc"];
+#
+#           get_oaflux [shape=box,
+#           fontname=Courier,
+#           color=blue,
+#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_oaflux.sh"
+#           label="${TROPFLUX}/src/get_oaflux.sh"];
+#           get_oaflux [shape=box,
+#           fontname=Courier,
+#           color=blue,
+#           URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/get_oaflux.pro"
+#           label="${TROPFLUX}/src/get_oaflux.pro"];
+#
+#           {oaflux_ref} -> {get_oaflux} -> {file_oaflux}
+#
+#          }
+#
+#
+# EXAMPLES
+# ========
+#
+# If you are working on LOCEAN machine and you don't have any reference data,
+# you just have to run this tool ::
+#
+#  $ get_oaflux.sh
+#
+# And look at log file with ::
+#
+#  $ tlogd.sh get_oaflux
+#
+# and of course on files in ${TROPFLUX_ID}.
+#
+# TODO
+# ====
+#
+# SEE ALSO
+# ========
+#
+# :ref:`guide data OAFLUX <data_in_oaflux>`
+#
+# :ref:`tropflux_profile.sh`
+#
+# EVOLUTIONS
+# ==========
+#
+# - fplod 20101216T152647Z aedon.locean-ipsl.upmc.fr (Darwin)
+#
+#   * creation
+#
+#-
+system=$(uname)
+case "${system}" in
+   AIX|IRIX64)
+      echo "www : no specific posix checking"
+   ;;
+   *)
+     set -o posix
+   ;;
+esac
+unset system
+#
+LANG=POSIX
+#
+command=$(basename ${0})
+log_date=$(date -u +"%Y%m%dT%H%M%SZ")
+#
+usage=" Usage : ${command}"
+#
+hostname=$(hostname)
+#
+# default
+# N.A. because no parameters
+#
+set -u
+#
+# test if wget available
+tool=wget
+type ${tool} 1> /dev/null 2>&1
+status=${?}
+if [ ${status} -ne 0 ]
+then
+   echo "${command} : eee : tool ${tool} not found"
+   exit 1
+fi
+unset status
+unset tool
+#
+# test if gunzip available
+tool=gunzip
+type ${tool} 1> /dev/null 2>&1
+status=${?}
+if [ ${status} -ne 0 ]
+then
+   echo "${command} : eee : tool ${tool} not found"
+   exit 1
+fi
+unset status
+unset tool
+#
+# check for ${TROPFLUX_LOG} definition
+if [ "${TROPFLUX_LOG}" = "" ]
+then
+   echo "${command} : eee : \${TROPFLUX_LOG} not defined"
+   exit 1
+fi
+#
+# check for ${TROPFLUX_LOG} existence
+if [ ! -d ${TROPFLUX_LOG} ]
+then
+   echo "${command} : eee : ${TROPFLUX_LOG} not found"
+   exit 1
+fi
+#
+# check for permission access on TROPFLUX_LOG
+if [ ! -x ${TROPFLUX_LOG} ]
+then
+   echo "${command} : eee : ${TROPFLUX_LOG} not reachable"
+   exit 1
+fi
+#
+# check for write permission on TROPFLUX_LOG
+if [ ! -w ${TROPFLUX_LOG} ]
+then
+   echo "${command} : eee : ${TROPFLUX_LOG} not writable"
+   exit 1
+fi
+#
+log=${TROPFLUX_LOG}/$(basename ${0} .sh).log.${log_date}
+echo "[Context]" 1>> ${log}
+echo "command=$(basename ${0})" 1>>${log}
+echo "hostname=${hostname}" 1>> ${log}
+echo "runtime=${log_date}" 1>> ${log}
+unset log_date
+echo "" 1>> ${log}
+#
+fileref=lh_oaflux_2004.nc
+fileref_gz=${fileref}.gz
+locref=ftp://ftp.whoi.edu/pub/science/oaflux/data_v3/monthly/turbulence/
+if  [ -f ${TROPFLUX_ID}/${fileref} ]
+then
+   echo "${command} : iii : ${TROPFLUX_ID}/${fileref} exist" 1>> ${log}
+   echo "${command} : iii : nothing done" 1>> ${log}
+else
+   wget --tries=1 --no-verbose -P ${TROPFLUX_ID} ${locref}/${fileref_gz} 1>> ${log} 2>&1
+   wget_status=${?}
+   if [ ${wget_status} -ne 0 ]
+   then
+      echo "${command} : eee : ${locref}/${fileref_gz} not found" >> ${log} 2>&1
+      # exit 1 #++
+   else
+      echo "${command} : iii : ${locref}/${fileref_gz} found" >> ${log} 2>&1
+   fi
+   unset wget_status
+   #
+   # decompress
+   gunzip ${TROPFLUX_ID}${fileref_gz}
+   gunzip_status=${?}
+   if [ ${gunzip_status} -ne 0 ]
+   then
+      echo "${command} : eee : ${locref}/${fileref_gz} not found" >> ${log} 2>&1
+      # exit 1 #++
+   else
+      echo "${command} : iii : ${locref}/${fileref_gz} found" >> ${log} 2>&1
+   fi
+fi
+unset fileref
+unset fileref_gz
+unset locref
+#
+unset command
+unset log
+unset hostname
+#
+# end
+exit 0
Index: trunk/src/oaflux_mask_30N30S.pro
===================================================================
--- trunk/src/oaflux_mask_30N30S.pro	(revision 14)
+++ trunk/src/oaflux_mask_30N30S.pro	(revision 15)
@@ -29,4 +29,5 @@
 ; ========
 ;
+; :ref:`guide data OAFLUX <data_in_oaflux>`
 ;
 ; EXAMPLES
