#!/bin/bash
#     keyword :: canesm_dumpdel_netcdf
# description :: Dump time series files.
set -a
. betapath2  # sets path for new package (required until old package is retired)

#  * ........................... Parmsub Parameters ............................

 runid="runid"; year="yyyy"; mon="mm";
 ncdf_uxxx="nc";
 canesm_dump_nc_short_term="off";

  # These variables are set when the job string is created
  #     Note: these seem to be altered/set by cccjob - ultimately, it would be better 
  #           if these variables were something about chunk beggining/end
  previous_year=NotSet
  previous_month=NotSet
  current_year=NotSet
  current_month=NotSet

  # dump/del settings
  with_dump_nc=1; with_del_nc=1; keep_vartab_pairs=""

 crawork="crawork";
 username="username"; user="USER"; nqsprfx=""; nqsext="_${runid}_${year}_m${mon}";
 lopgm="lopgm"; stime="10800"; memory1="4096mb";

#  * ............................ Condef Parameters ............................

 noprint=on
 nextjob=on
 debug=off
 hpcarchive_checksum=off

#  * ............................. Deck Definition .............................
jobname=dumpdel_${ncdf_uxxx}; time=$stime ; memory=$memory1
.   comjcl.cdk
cat > Execute_Script <<'end_of_script'
# Archive and/or delete netcdf data in yearly chunks
# Clint Seinen, January 2020

. ${CCRNSRC}/CanESM/CanDIAG/diag4/ncdumpdel.sh

end_of_script

. endjcl.cdk
#end_of_job
