...
 
[command]
default = cd ${ROSE_DATAC}; set -eu; ulimit -s unlimited; module purge; module load netcdf/intelmpi-4.4.4;
wrf_to_fvcom_ceto -i raw_wrf_file.nc -o ${GRID_NAME}_wnd.nc -latitude 55.0;
rm raw_wrf_file.nc;
......@@ -27,7 +27,10 @@ native_coordinates = sys.argv[6]
fvcom_harmonics = sys.argv[7]
interval = 1/float(sys.argv[8])
adjust_tides = sys.argv[9].split(',')
try:
amm_7 = sys.argv[10]
except:
amm_7 = False
constituents = ['M2', 'S2']
output_file = 'boundary_nest.nc'.format(grid)
......@@ -43,7 +46,12 @@ aqua_prep.add_nests(4)
aqua_prep.add_nests_harmonics(fvcom_harmonics, harmonics_vars=['u', 'v', 'ua', 'va', 'zeta'], constituents=constituents, pool_size=20)
# Make the regular readers for the CMEMS data
fvcom_cmems_names = {'salinity':['SAL', 'so'], 'temp':['TEM', 'thetao'],
if amm_7:
fvcom_cmems_names = {'salinity':['SAL', 'vosaline'], 'temp':['TEM', 'votemper'],
'v':['CUR', 'vomecrty'], 'u':['CUR', 'vozocrtx'],
'zeta':['SSH', 'sossheig']}
else:
fvcom_cmems_names = {'salinity':['SAL', 'so'], 'temp':['TEM', 'thetao'],
'v':['CUR', 'vo'], 'u':['CUR', 'uo'],
'zeta':['SSH', 'zos']}
......
[command]
default = python3 make_nest_bound.py ${CMEMS_DATA_DIR} ${START_DAY} ${END_DAY} ${ROSE_DATAC}/${GRID_NAME}_grd.dat ${ROSE_DATAC}/sigma_gen.dat ${COORDINATES} ${HARMONICS_FILE_PATH} ${NEST_INTERVAL} ${ADJUST_TIDES}; mv boundary_nest.nc /${REMOTE_TRANSFER_DIR}/
default = python3 make_nest_bound.py ${CMEMS_DATA_DIR} ${START_DAY} ${END_DAY} ${ROSE_DATAC}/${GRID_NAME}_grd.dat ${ROSE_DATAC}/sigma_gen.dat ${COORDINATES} ${HARMONICS_FILE_PATH} ${NEST_INTERVAL} ${ADJUST_TIDES} ${AMM_7}; mv boundary_nest.nc /${REMOTE_TRANSFER_DIR}/
......@@ -13,6 +13,12 @@ start_date = dt.datetime.strptime(sys.argv[2], '%Y-%m-%d')
grid = sys.argv[3]
donor_filepath = sys.argv[4]
try:
amm_7 = sys.argv[5]
except:
amm_7 = False
"""
cmems_data_dir = '/data/sthenno1/scratch/modop/Data/CMEMS'
start_date = dt.datetime(2019,1,15)
......@@ -21,8 +27,12 @@ grid = 'tamar_v2'
cmems_time_res = 'hi'
fvcom_cmems_names = {'salinity':['SAL', 'so'], 'temp':['TEM', 'thetao'],
if amm_7:
fvcom_cmems_names = {'salinity':['SAL', 'vosaline'], 'temp':['TEM', 'votemper'],
'v':['CUR', 'vomecrty'], 'u':['CUR', 'vozocrtx'],
'zeta':['SSH', 'sossheig']}
else:
fvcom_cmems_names = {'salinity':['SAL', 'so'], 'temp':['TEM', 'thetao'],
'v':['CUR', 'vo'], 'u':['CUR', 'uo'],
'zeta':['SSH', 'zos']}
......
[command]
default = python3 make_restart.py ${CMEMS_DATA_DIR} ${START_DAY} ${GRID_NAME} ${DONOR_RESTART_FILE_PATH}; cp ${GRID_NAME}_restart_0001.nc /${REMOTE_TRANSFER_DIR}/
default = python3 make_restart.py ${CMEMS_DATA_DIR} ${START_DAY} ${GRID_NAME} ${DONOR_RESTART_FILE_PATH} ${AMM_7}; cp ${GRID_NAME}_restart_0001.nc /${REMOTE_TRANSFER_DIR}/
#!/bin/bash
START_DAY=$1
END_DAY=$2
WRF_ARCHIVE_DATEFMT=$3
WRF_ARCHIVE_DIR=$4
ROSE_DATAC=$5
echo 1
echo ${START_DAY}
echo 2
echo ${END_DAY}
echo 3
echo ${WRF_ARCHIVE_DATEFMT}
echo 4
echo ${WRF_ARCHIVE_DIR}
echo 5
echo ${ROSE_DATAC}
d_comp=0
n=0
until [ "$d_comp" = "$END_DAY" ]
do
((n++))
d=$(date -d "$START_DAY + $n days" +${WRF_ARCHIVE_DATEFMT})
d_comp=$(date -d "$START_DAY + $n days" +%Y-%m-%d)
cp /pml${WRF_ARCHIVE_DIR}/*${d}*/wrfout_d03_* raw_wrf_file_${n}.nc
done
#!/bin/bash
# Script to merge the individual runs into month long chunks ready for
# conversion with wrf_to_fvcom.
module purge
module load nco
set -eu
files=($(\ls raw_wrf_file*))
# Now convert to FVCOM forcing files. These files have all had their first
# time step removed as that's just the initial condition. So, you'd need to
# add a -dTime,1,, to the ncrcat command to drop the first time step if
# that's not been done. Once they're all converted, ncrcat them all
# together into a single file for this month.
n=0
for this_file in "${files[@]}"; do
((n++))
echo ${this_file}
./wrf_to_fvcom_ceto -i ${this_file} -o wnd_file_${n}.nc -latitude 55.0
ncrcat -O -h wnd_file_${n}.nc wnd_file_trim_${n}.nc
rm ${this_file}
rm wnd_file_${n}.nc
done
ncrcat -O -h $(\ls -1 wnd_file_trim*.nc | sort -u) wnd_file.nc
rm wnd_file_trim* || true
[command]
default = cp /pml${WRF_ARCHIVE_DIR}/*${WRF_ARCHIVE_DATESTR}*/wrfout_d03_* ${ROSE_DATAC}/raw_wrf_file.nc
default = bash ./get_wrf_files.sh ${START_DAY} ${END_DAY} ${WRF_ARCHIVE_DATEFMT} ${WRF_ARCHIVE_DIR} ${ROSE_DATAC}; bash ./merge_files.sh;
ln -sf wnd_file.nc ${ROSE_DATAC}/${GRID_NAME}_wnd.nc
[command]
default = echo "Run WRF convert"
......@@ -14,6 +14,9 @@ FINAL_CYCLE_POINT='NONE'
HINDCAST_DAYS=1
FORECAST_DAYS=2
ARCHIVE_DIR='data/sthenno1/scratch/modop/Model/FVCOM_rosa/output'
REMOTE_ARCHIVE_DIR='/gpfs1/users/modellers/modop/Output/FVCOM_rosa_rolling'
## Grid properties and files
GRID_NAME='aqua_v16'
COMMON_FILES_PATH='/users/modellers/modop/Models/FVCOM_rosa_common/'
......@@ -79,3 +82,4 @@ SALT_TEMP_OUT='T'
TURBULENCE_OUT='T'
WIND_OUT='F'
HEAT_RAIN_OUT='F'
......@@ -13,6 +13,7 @@ INITIAL_START_DATE='2019-08-18T00:00:00Z'
FINAL_CYCLE_POINT='NONE'
HINDCAST_DAYS=1
FORECAST_DAYS=2
CYCLE_FREQ=1
## Grid properties and files
GRID_NAME='tamar_v2'
......@@ -51,6 +52,7 @@ BOUNDARY_FORCING='CMEMS'
HARMONICS_FILE_PATH='/users/modellers/modop/Models/FVCOM_tamar_harmonics/tamar_2006_harmonics.nc'
## Required for CMEMS
CMEMS_DATA_DIR='/data/sthenno1/scratch/modop/Data/CMEMS'
AMM_7=False
## Required for CMEMS warm start
DONOR_RESTART_FILE_PATH='/users/modellers/modop/Models/FVCOM_tamar_restart/tamar_v2_donor_restart.nc'
## Required for NEST_FILE
......
......@@ -24,7 +24,7 @@
transfer_restart => run_fvcom
{% endif %}
"""
[[[P1D]]]
[[[P{{CYCLE_FREQ}}D]]]
graph = """
run_fvcom[-P1D] => start_cycle => softlink_forcing & softlink_forcing_remote => write_run_namelist
......@@ -38,7 +38,7 @@
{% elif WIND_ON == 'T' or HEATING_ON == 'T' or PRECIPITATION_ON == 'T' or AIR_PRESSURE_ON == 'T' %}
start_cycle => get_archive_wrf_file => convert_wrf_file => write_run_namelist
start_cycle => get_archive_wrf_file => write_run_namelist
{% endif %}
......@@ -82,12 +82,12 @@
"""
[[[+P1D/P1D]]]
[[[+P{{CYCLE_FREQ}}D/P{{CYCLE_FREQ}}D]]]
graph = """
run_fvcom[-P1D] => transfer_restart => run_fvcom
"""
[[[+P2D/P1D]]]
[[[+P{{CYCLE_FREQ}}D/P{{CYCLE_FREQ}}D]]]
graph = """
run_fvcom => housekeeping
"""
......@@ -123,6 +123,7 @@
HARMONICS_FILE_PATH={{HARMONICS_FILE_PATH}}
DONOR_RESTART_FILE_PATH={{DONOR_RESTART_FILE_PATH}}
CMEMS_DATA_DIR={{CMEMS_DATA_DIR}}
AMM_7={{AMM_7}}
NEST_RUN_SUITE={{NEST_RUN_SUITE}}
NEST_INTERVAL={{NEST_INTERVAL}}
ADJUST_TIDES={{ADJUST_TIDES}}
......@@ -272,8 +273,6 @@
execution retry delays = 3*PT15M
[[get_archive_wrf_file]]
inherit = remote_job
[[convert_wrf_file]]
inherit = slurm_job_1
[[adjust_namelist_met]]
inherit = remote_job
script = """
......