Index: /trunk/SRC/Tests/tst_pltt_zero.pro
===================================================================
--- /trunk/SRC/Tests/tst_pltt_zero.pro	(revision 484)
+++ /trunk/SRC/Tests/tst_pltt_zero.pro	(revision 484)
@@ -0,0 +1,161 @@
+;+
+;
+; @file_comments
+;
+; @categories
+; test
+;
+; @keyword IMAGE
+;
+; @examples
+;
+; To run test with Levitus temperature on a regular 1x1 grid :
+;   IDL> @tst_initlev
+;   IDL> tst_pltt_zero
+;
+; @todo
+;
+;  use routine in the name of images instead of hardcoded names
+;
+; @history
+;
+;  - fplod 20130802T093208Z cratos.locean-ipsl.upmc.fr (Linux)
+;
+;    * creation from tst_pltt.pro
+;      to solve ::
+;
+;          % L.96 /Users/sflod/SAXO_DIR/SRC/ToBeReviewed/PLOTS/DIVERS/determineminmax.pro rev. 378:
+;          % Warning: constant filed, same value everywhere : 0.0000000!
+;          % READ: End of file encountered. Unit: 0, File: <stdin>
+;          % Execution halted at: REPORT            106 /Users/sflod/SAXO_DIR/SRC/Utilities/report.pro
+;          %                      DETERMINEMINMAX    96 /Users/sflod/SAXO_DIR/SRC/ToBeReviewed/PLOTS/DIVERS/determineminmax.pro
+;          %                      PLTT              359 /Users/sflod/SAXO_DIR/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro
+;          %                      STD_TS_T           71 /Users/sflod/DEVELOP_NEMO/IDL_scripts/std_ts_t.pro
+;          %                      STD_TS_ALL         54 /Users/sflod/DEVELOP_NEMO/IDL_scripts/std_ts_all.pro
+;          %                      $MAIN$
+;
+;      ask for batch session and use read statement when asking for next plot only in interactive mode
+;
+; @version
+; $Id$
+;
+;-
+PRO tst_pltt_zero, IMAGE=image
+;
+  compile_opt idl2, strictarrsubs
+;
+@cm_4mesh
+@cm_4cal
+@cm_general
+;
+; figure 2: regular grid
+;
+  CASE jpi*key_stride[0]+jpj*key_stride[1] OF
+    180+148:file = 'Levitus98_1m_01_12_Temperature_Pot_ORCA2.nc'
+    360+180:file = 'Levitus98_1m_01_12_Temperature_Pot_1x1.nc'
+    720+510:file = 'Levitus98_1m_01_12_Temperature_Pot_ORCA05.nc'
+  ENDCASE
+  file = isafile(file, title = 'Where is '+file+' ?', /lookalldir)
+  IF size(file, /type) NE 7 THEN stop
+;
+  dummy = ''
+  cnt = 1
+;
+; -1/1 xt plot
+;
+  IF key_onearth THEN domdef, 20, 380, -1, 1, 0, gdept[0] $
+  ELSE domdef, min(glamt), max(glamf), jpj/2-1, jpj/2+1, 0, gdept[0]
+;
+  temp = read_ncdf('votemper', 00101, 01231, file = file)
+  zero_data = temp
+  zero_data.arr = 0.
+
+  IF key_forgetold THEN help, temp.arr ELSE help, temp.tab
+  help, jpt, time
+  pltt, zero_data
+  if keyword_set(image) then begin
+      saveimage, 'tst_pltt_zero_'+image+'_'+string(cnt, format = '(i2.2)')+'.png', /png
+  ENDIF ELSE BEGIN
+      IF key_batch EQ 0 THEN BEGIN
+         read, dummy,  prompt = 'press stop for the next plot'
+      ENDIF
+  ENDELSE
+  cnt = cnt + 1
+;
+  pltt, zero_data, /nocontour
+  if keyword_set(image) then begin
+      saveimage, 'tst_pltt_zero_'+image+'_'+string(cnt, format = '(i2.2)')+'.png', /png
+  ENDIF ELSE BEGIN
+      IF key_batch EQ 0 THEN BEGIN
+         read, dummy,  prompt = 'press stop for the next plot'
+      ENDIF
+  ENDELSE
+  cnt = cnt + 1
+
+  pltt, zero_data, /color_c
+  if keyword_set(image) then begin
+      saveimage, 'tst_pltt_zero_'+image+'_'+string(cnt, format = '(i2.2)')+'.png', /png
+  ENDIF ELSE BEGIN
+      IF key_batch EQ 0 THEN BEGIN
+         read, dummy,  prompt = 'press stop for the next plot'
+      ENDIF
+  ENDELSE
+  cnt = cnt + 1
+;
+  pltt, zero_data, /nofill
+  if keyword_set(image) then begin
+      saveimage, 'tst_pltt_zero_'+image+'_'+string(cnt, format = '(i2.2)')+'.png', /png
+  ENDIF ELSE BEGIN
+      IF key_batch EQ 0 THEN BEGIN
+         read, dummy,  prompt = 'press stop for the next plot'
+      ENDIF
+  ENDELSE
+  cnt = cnt + 1
+;
+; equatorial plot
+;
+  IF key_onearth THEN BEGIN
+    a = abs(gphit[0, *])
+    yind = where(a EQ min(a))
+    domdef, 20, 380, yind[0], yind[n_elements(yind)-1] $
+      , gdept[10 < (jpk-1)], gdept[10 < (jpk-1)], gridtype = 'T', /yindex
+  ENDIF ELSE BEGIN
+    domdef, min(glamt), max(glamf), jpj/2, jpj/2 $
+      , gdept[10 < (jpk-1)], gdept[10 < (jpk-1)], gridtype = 'T', /yindex
+  ENDELSE
+  temp = read_ncdf('votemper', 00101, 01231, file = file)
+  zero_data = temp
+  zero_data.arr = 0.
+  IF key_forgetold THEN help, temp.arr ELSE help, temp.tab
+  pltt, zero_data
+  if keyword_set(image) then begin
+      saveimage, 'tst_pltt_zero_'+image+'_'+string(cnt, format = '(i2.2)')+'.png', /png
+  ENDIF ELSE BEGIN
+      IF key_batch EQ 0 THEN BEGIN
+         read, dummy,  prompt = 'press stop for the next plot'
+      ENDIF
+  ENDELSE
+  cnt = cnt + 1
+;
+; yt plot along the column that contain the largest latitude
+;
+  IF key_onearth THEN BEGIN
+    ind = where(gphit EQ max(gphit))
+    ind = ind[0] MOD jpi
+    domdef, ind, ind, -90, 90, gdept[0], gdept[0], gridtype = 'T', /xindex
+  ENDIF ELSE BEGIN
+    domdef, jpi/2, jpi/2, min(gphit), max(gphif), gdept[0], gdept[0], gridtype = 'T', /xindex
+  ENDELSE
+
+  temp = read_ncdf('votemper', 00101, 01231, file = file)
+  zero_data = temp
+  zero_data.arr = 0.
+  IF key_forgetold THEN help, temp.arr ELSE help, temp.tab
+  pltt, zero_data
+
+  if keyword_set(image) then begin
+      saveimage, 'tst_pltt_zero_'+image+'_'+string(cnt, format = '(i2.2)')+'.png', /png
+  ENDIF
+  cnt = cnt + 1
+
+end
Index: /trunk/SRC/Tests/tst_pltt_zero.sh
===================================================================
--- /trunk/SRC/Tests/tst_pltt_zero.sh	(revision 484)
+++ /trunk/SRC/Tests/tst_pltt_zero.sh	(revision 484)
@@ -0,0 +1,269 @@
+#! /bin/sh
+#+
+#
+# .. program:: tst_pltt_zero.sh
+#
+# .. _tst_pltt_zero.sh:
+#
+# ================
+# tst_pltt_zero.sh
+# ================
+#
+# SYNOPSIS
+# ========
+#
+# ::
+#
+#   tst_pltt_zero.sh --save_image y|n
+#
+# DESCRIPTION
+# ===========
+#
+# Run :ref:`tst_pltt_zero.pro`
+#
+# We suppose here that all inputs data are already available localy.
+#
+# .. option:: --save_image y|n
+#
+# Some IDL programs are launched here using ${IDL_CMD} command
+#
+# Log file is written on
+# :file:`${PROJECT_LOG}/tst_pltt_zero.log.{YYYYMMDDTHHMMSSZ}`
+#
+# .. only:: man
+#
+#    Figure is visible on PDF and HTML documents only.
+#
+# .. only:: html or latex
+#
+#     .. graphviz::
+#
+#        digraph tst_pltt_zero {
+#
+#           log [shape=ellipse,fontname=Courier,label="${PROJECT_LOG}/tst_pltt_zero.log{YYYYMMDDTHHMMSSZ}"];
+#
+#           tst_pltt_zero_sh [shape=box,
+#           fontname=Courier,
+#           color=blue,
+#           URL="http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/Test/tst_pltt_zero.sh",
+#           label="${PROJECT}/SRC/Tests/tst_pltt_zero.sh"];
+#
+#           tst_pltt_zero_pro [shape=box,
+#           fontname=Courier,
+#           color=blue,
+#           URL="http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/Test/tst_pltt_zero.pro",
+#           label="${PROJECT}/SRC/Tests/tst_pltt_zero.pro"];
+#
+#           {data_test} -> {tst_pltt_zero_sh tst_pltt_zero_pro} -> {log png}
+#
+#         }
+#
+# EXAMPLES
+# ========
+#
+# To test in foreground::
+#
+#   tst_pltt_zero.sh --save_image y
+#
+# To test in background::
+#
+#   tst_pltt_zero.sh --save_image y &
+#
+# And look at log file with::
+#
+#  $ tlogd.sh tst_pltt_zero
+#
+# and of course on image files in imagedir define in ${IDL_STARTUP}
+#
+# SEE ALSO
+# ========
+#
+# |idl|
+#
+# Use :
+# :ref:`tst_pltt_zero.pro`
+#
+# TODO
+# ====
+#
+# minimize dependencies on FPTOOLS (log, etc)
+#
+# PATH should contains $SAXO_DIR/SRC/Tests/
+#
+# improve graph
+#
+# EVOLUTIONS
+# ==========
+#
+# $Id: tst_pltt_zero.sh 288 2013-05-16 15:12:36Z pinsard $
+#
+# $URL$
+#
+# - fplod 20130802T101039Z cratos.locean-ipsl.upmc.fr (Linux)
+#
+#   * creation to check difference between behaviour of tst_pltt_zero.pro 
+#     in an IDL session, in a shell session foreground and background
+#
+#-
+system=$(uname)
+case "${system}" in
+   AIX|IRIX64)
+     echo "${command} : ${LINENO} : www : no specific posix checking"
+     date_cmd=date
+   ;;
+   Darwin)
+     set -o posix
+     date_cmd=gdate
+   ;;
+   Linux)
+     set -o posix
+     date_cmd=date
+   ;;
+   *)
+    set -o posix
+   ;;
+esac
+unset system
+#
+set -u
+#
+LANG=POSIX
+#
+command=$(basename ${0})
+log_date=$(date -u +"%Y%m%dT%H%M%SZ")
+#
+usage=" Usage : ${command} [-f] --save_image save_image"
+#
+hostname=$(hostname)
+#
+# default
+debug=0
+force=0
+save_image=0
+#
+minargcount=2
+if [ ${#} -lt ${minargcount} ]
+then
+   echo "${command} : ${LINENO} : eee : not enought arguments"
+   echo "${usage}"
+   exit 1
+fi
+unset minargcount
+#
+while [ ${#} -gt 0 ]
+do
+   case ${1} in
+     --save_image)
+        save_image=${2}
+        shift
+     ;;
+     -h)
+        echo "${usage}"
+        exit 0
+     ;;
+     *)
+        # other choice
+        echo "${command} : ${LINENO} : eee : unknown option ${1}"
+        echo "${usage}"
+        exit 1
+     ;;
+   esac
+   # next flag
+   shift
+done
+unset usage
+#
+# check parameters
+#++
+#
+tool=${IDL_CMD}
+type ${tool} 1> /dev/null 2>&1
+status=${?}
+if [ ${status} -ne 0 ]
+then
+   echo "${command} : ${LINENO} : eee : tool ${tool} not found"
+   echo "${command} : ${LINENO} : eee : check project_profile.sh sequence"
+   exit 1
+fi
+unset status
+unset tool
+#
+# check for write permission on PROJECT_LOG
+if [ ! -w ${PROJECT_LOG} ]
+then
+   echo "${command} : ${LINENO} : eee : ${PROJECT_LOG} not writable"
+   exit 1
+fi
+#
+log=${PROJECT_LOG}/$(basename ${0} .sh).log.${log_date}
+echo "[Context]" 1>> ${log}
+echo "PID=${$}" 1>>${log}
+echo "command=$(basename ${0})" 1>>${log}
+echo "hostname=${hostname}" 1>> ${log}
+echo "runtime=${log_date}" 1>> ${log}
+echo "log=${log}" 1>> ${log}
+echo "IDL_CMD=${IDL_CMD}" 1>> ${log}
+echo "SAXO_DIR=${SAXO_DIR}" 1>> ${log}
+echo "MY_IDL=${MY_IDL}" 1>> ${log}
+#++echo "IDL_STARTUP=${IDL_STARTUP}" 1>> ${log}
+unset log_date
+echo "" 1>> ${log}
+echo "[Parameters]" 1>> ${log}
+echo "save_image=${save_image}" 1>> ${log}
+echo "" 1>> ${log}
+#
+if [ "${save_image}" == "y" ]
+then
+  image_arg=", IMAGE=\"${command}\""
+else
+  image_arg=""
+fi
+# build IDL script
+cat >> ${MY_IDL}/tst_pltt_zero_${$}.pro << EOF
+pro tst_pltt_zero_${$}
+;
+compile_opt idl2, strictarrsubs, logical_predicate
+;
+@cm_general
+IF (key_gdl EQ 0) THEN BEGIN
+    s = size(SCOPE_TRACEBACK(/STRUCTURE), /DIMENSION)
+    routine = (SCOPE_TRACEBACK(/STRUCTURE))[s-1].Routine
+ENDIF ELSE BEGIN
+    routine = 'tst_pltt_zero_${$}'
+ENDELSE
+;
+@cm_project
+;
+save_image = '${save_image}'
+@tst_initlev
+tst_pltt_zero ${image_arg}
+print, routine, ' reach end'
+end
+EOF
+#
+# more ${MY_IDL}/tst_pltt_zero_${$}.pro
+#
+# run IDL or equivalent
+${IDL_CMD} << EOF >> ${log} 2>&1
+tst_pltt_zero_${$}
+EOF
+status=${?}
+if [ ${status} -ne 0 ]
+then
+   echo "${command} : ${LINENO} : eee: ${IDL_CMD} failed : ${status}" >> ${log} 2>&1
+   cat ${MY_IDL}/tst_pltt_zero_${$}.pro >> ${log} 2>&1
+   exit 1
+fi
+unset status
+#++rm ${MY_IDL}/tst_pltt_zero_${$}.pro
+#
+unset command
+unset log
+unset hostname
+unset usage
+#
+unset date_cmd
+#
+# end
+#++set
+exit
