#PBS -N hwrf%STORMNUM%_init_gdas_9_%CYC%
#PBS -j oe
#PBS -S /bin/bash
#PBS -q %QUEUE%
#PBS -A %PROJ%-%PROJENVIR%
#PBS -l walltime=00:25:00
#PBS -l select=1:ncpus=96:mpiprocs=96
#PBS -l debug=true

export NODES=1
export TOTAL_TASKS=96

model=hwrf
%include <head.h>
%include <envir-p1.h>

export cyc="%CYC%"
export storm_num="%STORMNUM%"

# versions file for hwrf sets $model_ver and $code_ver

module load envvar/${envvar_ver}
module load PrgEnv-intel/${PrgEnv_intel_ver}
module load craype/${craype_ver}
module load intel/${intel_ver}
module load cray-pals/${cray_pals_ver}
module load libjpeg/${libjpeg_ver}
module load grib_util/${grib_util_ver}
module load wgrib2/${wgrib2_ver}
module load bufr/${bufr_ver}
module load hdf5/${hdf5_ver}
module load netcdf/${netcdf_ver}
# module load pnetcdf/${pnetcdf_ver}
module load udunits/${udunits_ver}
module load nco/${nco_ver}
module load python/${python_ver}
module load cfp/${cfp_ver}
module list

export INIT_MODEL=GDAS1 INIT_FHR="9" INIT_PARTS=3DVAR
${HOMEhwrf}/jobs/JHWRF_INIT

%include <tail.h>

%manual

TASK init_gdas_9

PURPOSE: Reads GDAS 9 hour forecast files from the previous GDAS
cycle and prepares it for use by the HWRF relocate_gdas_9 job.
This job is only needed when GSI is enabled by the launch job.

PROBLEM: Cannot find GDAS data?

There are two points in the job where it will wait for GDAS data.  The
status bar will say one of these two things:

  [ungrib] process parent GRIB
  [prep] process parent spectral

Those messages are expected to stay up for ~2-4 minutes each while the
processing happens, but if they stay significantly longer than that,
then the job cannot see the GDAS data.

MANUAL BYPASS OPTION:

It is possible to manually bypass failures of this job by editing the
$COMOUT/storm$num.conf, and setting run_gsi=no.  Then clear the Gsi
event in the launch job.  The forecast should start without data
assimilation.
%end