#!/bin/ksh +x
#
if [ "${1}" = "-h" ]
then
  echo " "
  echo " Reads 5 Netcdf files: 1 - zonal wind ;  2 - meridional wind ; 3 - temperature ;"
  echo " 4 - specific humidity and 5 - geopotential height. Then generates a single"
  echo " binary file with these five variables for the SaoSebastiao case"
  echo " "
  echo " Usage:"
  echo " ./run_SaoSebastiao caso"
  echo " "
  echo " Default:"
  echo " caso = ERA_5"
  echo " "
  echo " caso : five letters case identifier"
  echo " "
  exit
fi
#
caso=${1}
if [ -z "${caso}" ]
then
  caso=CFSV2
fi
if [ ${caso} != "CFSV2" ]
then
  if [ ${caso} != "NCEPF" ]
  then
    if [ ${caso} != "ERA_5" ]
    then
      caso=ERA_5
    fi
  fi
fi
#ep=12
#while [ ep -le 20 ]
ep=5
#while [ ep -le 11 ]
while [ ep -le 20 ]
do
  echo "./Run_Netcdf ${caso} ${ep} SaoSebastiao no .TRUE."
  ./Run_Netcdf ${caso} ${ep} SaoSebastiao no .TRUE.
  let ep=ep+1
done
#
