-
Notifications
You must be signed in to change notification settings - Fork 11
convert_files.slurm
This requires the link_files.sh and the ecmwf_wps_templates.
#!/bin/bash --login#SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --threads-per-core=1 #SBATCH --job-name=convert_wrf #SBATCH --partition=all #SBATCH --time=12:00:00 ##SBATCH --mail-type=ALL #SBATCH --mail-user=pica
set -eu
module load intel || true module load intel-mpi || true module load hdf5-intelmpi || true module load netcdf-intelmpi || true
namelist=templates/namelist.wps Vtable=templates/Vtable.ERA-interim.ml ecmwf_coeffs=templates/ecmwf_coeffs
years=({2005..2015}) grids=(grids/geo_em.d??.nc) rawmet=$HOME/Data/ECMWF/ERA-Interim # where to find the ERA-Interim data.
for year in ${years[@]}; do if [ ! -d ./$year ]; then mkdir ./$year fi
(
cd $year
# Clear out existing outputs.
rm PFILE* FLX* SST* PRES* FILE* GRIBFILE.??? ecmwf_coeffs || true
# Link to the model grids.
for grid in ${grids[@]}; do
if [ ! -h $(basename $grid) ]; then
ln -s ../$grid
fi
done
# Put the forcing Vtable in the current directory.
if [ -h Vtable ]; then
rm -f Vtable
fi
if [ ! -f ./Vtable ]; then
ln -s ../$Vtable Vtable
else
echo "WARNING: Vtable found but not a symlink to the template one."
fi
# And the ECMWF coefficients.
if [ -h ecmwf_coeffs ]; then
rm -f ecmwf_coeffs
fi
if [ ! -f ./ecmwf_coeffs ]; then
ln -s ../$ecmwf_coeffs ecmwf_coeffs
else
echo "WARNING: ecmwf_coeffs found but not a symlink to the template one."
fi
# Do not clobber old namelists.
if [ -f namelist.wps ]; then
mv namelist.wps namelist.wps.$$.1
fi
cp ../$namelist namelist.wps
sed -i 's/2002-'/$year-'/g' namelist.wps
sed -i 's/2003-'/$(($year + 1))-'/g' namelist.wps
# Run the link script, ungrib and then finally metgrid.
../bin/link_grib.sh $rawmet/$year/*.grb
#srun -n 1 ../bin/ungrib.exe
../bin/ungrib.exe
mv ungrib.log ungrib_era-interim.log
# Apply the ECMWF coefficients. Whatever they do.
../bin/calc_ecmwf_p.exe
mv logfile.log logfile_calc_ecmwf_p.log
# Tidy up
rm Vtable namelist.wps GRIBFILE.???
for grid in ${grids[@]}; do
rm $(basename $grid)
done
)
done
#sbatch prep.slurm
For questions regarding FVCOM, to contribute to the wiki please subscribe to the mailing list uk-fvcom mailing list If you would like to cite FVCOM, please refer to its main publication and/or URLs.
Background
=== FVCOM Wiki ===
User guide
-
Additional information of less frequent usage in no particular order