Commit d87bd14d authored by Modellers Operational's avatar Modellers Operational

Merge conflict resolution

parents 32c68e5f 2a19fa72
[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,23 +27,35 @@ native_coordinates = sys.argv[6]
fvcom_harmonics = sys.argv[7]
interval = 1/float(sys.argv[8])
adjust_tides = sys.argv[9].split(',')
no_nests = int(sys.argv[10])
try:
amm_7 = sys.argv[11]
except:
amm_7 = False
constituents = ['M2', 'S2']
output_file = 'boundary_nest.nc'.format(grid)
cmems_time_res = 'hi'
if 'None' in adjust_tides:
adjust_tides = []
##############################################################################################
# Setup preproc Model object
aqua_prep = pf.preproc.Model(start_date, end_date, grid, native_coordinates, zone='30N', sampling=interval)
aqua_prep.add_sigma_coordinates(sigma_file)
# Make the nested boundary object
aqua_prep.add_nests(4)
aqua_prep.add_nests(no_nests)
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} ${NO_NESTS} ${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
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
((n++))
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
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
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
((n++))
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 ${PWD}/wnd_file.nc ${ROSE_DATAC}/${GRID_NAME}_wnd.nc
......@@ -22,6 +22,4 @@ for i, this_date in enumerate(date_list):
this_out_filestr = '{}_{}.nc'.format(fvcom_grid_name, this_date.strftime('%Y-%m-%d'))
with open('make_daily_nc.sh', 'a') as f:
f.write('ncks -d time,{},{} {} {} \n'.format(np.squeeze(time_ind[0]), np.squeeze(time_ind[1]), this_filestr, this_out_filestr))
f.write('ncks -d time,{},{} {} {} \n'.format(np.squeeze(time_ind[0]), np.squeeze(time_ind[1]), this_filestr, this_out_filestr))
[command]
default = echo "Run WRF convert"
[command]
default = dst=/pml${ARCHIVE_DIR}/${FORECAST_DAY}/;
mkdir -p ${dst}
src=${ROSE_DATAC}/output/${GRID_NAME}_0001.nc;
ssh ceto6 -t "rsync -aph --no-o --no-g $src $dst";
......@@ -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'
......@@ -7,13 +7,14 @@ USE_CETO=True
FORECAST=True
NODES=10
REMOTE_USER='modop'
MAIL_TO='mbe@pml.ac.uk'
EXECUTION_TIME_LIMIT=12
INITIAL_START_DATE='2019-08-18T00:00:00Z'
FINAL_CYCLE_POINT='NONE'
HINDCAST_DAYS=1
FORECAST_DAYS=2
MAIL_TO='mbe@pml.ac.uk'
CYCLE_FREQ=1
## Grid properties and files
GRID_NAME='tamar_v2'
......@@ -52,13 +53,15 @@ 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
NEST_RUN_SUITE='fvcom-rosa'
# The time resolution of the nest output, as divisions of 1 day (i.e. 24 would be hourly, 48 every half hour)
NEST_INTERVAL='24'
ADJUST_TIDES='zeta,u,v,ua,va'
ADJUST_TIDES='None'
NEST_DEPTH=1
# FVCOM namelist settings
EXT_TSTEP='.150'
......@@ -80,5 +83,3 @@ SALT_TEMP_OUT='T'
TURBULENCE_OUT='T'
WIND_OUT='F'
HEAT_RAIN_OUT='F'
......@@ -24,9 +24,9 @@
transfer_restart => run_fvcom
{% endif %}
"""
[[[P1D]]]
[[[P{{CYCLE_FREQ}}D]]]
graph = """
run_fvcom[-P1D] => start_cycle => softlink_forcing & softlink_forcing_remote => write_run_namelist
run_fvcom[-P{{CYCLE_FREQ}}D] => start_cycle => softlink_forcing & softlink_forcing_remote => write_run_namelist
{% if FORECAST and (WIND_ON == 'T' or HEATING_ON == 'T' or PRECIPITATION_ON == 'T' or AIR_PRESSURE_ON == 'T') %}
start_cycle => wrf_suite_trigger <wrf::transfer_for_fvcom>
......@@ -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
run_fvcom[-P{{CYCLE_FREQ}}D] => transfer_restart => run_fvcom
"""
[[[+P3D/P1D]]]
[[[+P{{CYCLE_FREQ}}D/P{{CYCLE_FREQ}}D]]]
graph = """
run_fvcom => housekeeping
"""
......@@ -95,10 +95,10 @@
[runtime]
[[root]]
env-script = eval $(rose task-env --cycle-offset=P1D)
env-script = eval $(rose task-env --cycle-offset=P{{CYCLE_FREQ}}D)
script = rose task-run --verbose
[[[job]]]
execution time limit = PT3H
execution time limit = PT{{EXECUTION_TIME_LIMIT}}H
[[[events]]]
mail events = submission timeout, execution timeout, failed
mail to = {{MAIL_TO}}
......@@ -125,9 +125,11 @@
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}}
NO_NESTS={{NEST_DEPTH}}
EXT_TSTEP={{EXT_TSTEP}}
ISPLIT={{ISPLIT}}
......@@ -176,12 +178,15 @@
{% endif %}
{% if BOUNDARY_FORCING in ['CMEMS', 'NEST_FILE'] %}
{% if BOUNDARY_FORCING in ['CMEMS', 'NEST_FILE'] and NEST_DEPTH == 1 %}
NEST_ON='T'
NEST_TYPE='3'
{% else %}
NEST_TYPE='1'
{% elif BOUNDARY_FORCING in ['CMEMS', 'NEST_FILE'] %}
NEST_ON='T'
NEST_TYPE='3'
NEST_TYPE='3'
{% else %}
NEST_ON='F'
NEST_TYPE='1'
{% endif %}
......@@ -319,7 +324,7 @@
[[mv_start_file]]
inherit = remote_job
[[transfer_data]]
inherit = slurm_job_1
inherit = remote_job
[[transfer_data_today]]
inherit = slurm_job_1
[[start_cycle]]
......@@ -329,9 +334,9 @@
[[transfer_restart]]
inherit = remote_job
script = """
ln -sf ${ROSE_DATACP1D}/output/${GRID_NAME}_restart_0001.nc ${ROSE_DATAC}/${GRID_NAME}_restart_0001.nc
ln -sf ${ROSE_DATACP{{CYCLE_FREQ}}D}/output/${GRID_NAME}_restart_0001.nc ${ROSE_DATAC}/${GRID_NAME}_restart_0001.nc
mkdir -p /pml${RESTART_ARCHIVE_DIR}/${FORECAST_DAY}
cp ${ROSE_DATACP1D}/output/${GRID_NAME}_restart_0001.nc /pml${RESTART_ARCHIVE_DIR}/${FORECAST_DAY}/
cp ${ROSE_DATACP{{CYCLE_FREQ}}D}/output/${GRID_NAME}_restart_0001.nc /pml${RESTART_ARCHIVE_DIR}/${FORECAST_DAY}/
"""
[[transfer_archive_restart]]
inherit = remote_job
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment