#PBS -N hwrf%STORMNUM%_init_gfs_%CYC%
#PBS -j oe
#PBS -S /bin/bash
#PBS -q %QUEUE%
#PBS -A %PROJ%-%PROJENVIR%
#PBS -l walltime=00:30:00
#PBS -l place=vscatter,select=1:ncpus=96:mpiprocs=96:mem=120G
#PBS -l debug=true

export NODES=1
export TOTAL_TASKS=96

model=hwrf
export cyc="%CYC%"
%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 gsl/${gsl_ver}
module load nco/${nco_ver}
module load python/${python_ver}
module load cfp/${cfp_ver}
module list

export INIT_MODEL=GFS INIT_FHR=0 INIT_PARTS=3DVAR
${HOMEhwrf}/jobs/JHWRF_INIT

%include <tail.h>

%manual

TASK init_gfs

NOTE: This task is critical; it is impossible to start the forecast
even in a degraded mode if this task fails.

PURPOSE: This job prepares input files for the HWRF relocation and
data assimilation jobs.  It reads the GFS analysis and 6hr forecast,
and moves it to the HWRF grid.  In addition, static terrain data and
other information is interpolated to the HWRF grid.  The grid location
itself is decided by the launch job based on the message files from
JTWC and NHC.

TROUBLESHOOTING:

PROBLEM: Cannot find GFS data?

There are two points in the job where it will wait for GFS 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 GFS data.

%end