Commit 4a4cf291 authored by Modellers Operational's avatar Modellers Operational

Merge branch 'master' of gitlab.ecosystem-modelling.pml.ac.uk:pml-modelling/rose_fvcom_setup

parents 7e5ce3d6 a04f1319
This diff is collapsed.
OBC Node Number = 45
1 1 1
2 2 1
3 3 1
4 4 1
5 5 1
6 6 1
7 7 1
8 8 1
9 9 1
10 10 1
11 11 1
12 12 1
13 13 1
14 14 1
15 15 1
16 16 1
17 17 1
18 18 1
19 19 1
20 20 1
21 21 1
22 22 1
23 23 1
24 24 1
25 25 1
26 26 1
27 27 1
28 28 1
29 29 1
30 30 1
31 31 1
32 32 1
33 33 1
34 34 1
35 35 1
36 36 1
37 37 1
38 38 1
39 39 1
40 40 1
41 41 1
42 42 1
43 43 1
44 44 1
45 45 1
......@@ -52,7 +52,7 @@ for this_river in river_list:
try:
this_river._expandDateSeries(start_date, end_date)
except:
pass
this_river.use_ltls_temp = False
# Get and write out the forecast predictions
grid = common_dir + '/' + grid_name + '_grd.dat'
......@@ -72,3 +72,5 @@ aqua_prep.add_rivers(positions, names, times, flux_array, temperature, salinity,
aqua_prep.check_rivers(max_discharge=400, min_depth=None, open_boundary_proximity=None, noisy=False)
aqua_prep.write_river_forcing(output_file, ersem=False)
aqua_prep.write_river_namelist(output_file_nml, output_file, vertical_distribution='uniform')
[command]
default = log_file=${ROSE_TASK_LOG_ROOT}; log_dir=${log_file::${#log_file}-4};
cd ${log_dir}; cd ../../run_fvcom/01/;
nanlines=$(grep -w "NaN" job.out| wc -l);
if [ ${nanlines} -gt 0 ]; then exit 1; fi;
import matplotlib as mpl
mpl.use('Agg')
import sys
import multiprocessing
import numpy as np
from cmocean import cm
import PyFVCOM as pf
import pmltools as pt
labels = {'q2': 'Turbulent kinetic energy $(m^{2}s^{-2})$',
'l': 'Turbulent macroscale $(m^{3}s^{-2})$',
'q2l': 'Turbulent kinetic\nenergy x turblent\nmacroscale ($cm^{3}s^{-2}$)',
'tke': 'Turbulent kinetic energy $(m^{2}s^{-2})$',
'viscofh': 'Horizontal Turbulent Eddy Viscosity $(m^{2}s^{-1})$',
'teps': 'Turbulent kinetic\nenergy x turblent\nmacroscale ($cm^{3}s^{-2}$)',
'tauc': 'Bed shear stress $(m^{2}s^{-2})$',
'temp': 'Temperature ($\degree C$)',
'salinity': 'Salinity (PSU)',
'zeta': 'Surface elevation (m)',
'uv': 'Speed $(ms^{-1})$',
'uava': 'Depth averaged speed $(ms^{-1})$',
'uvanomaly': 'Speed anomaly $(ms^{-1})$',
'direction': 'Direction $(\degree)$',
'O3_c': 'Carbonate total dissolved\ninorganic carbon $(mmol C/m^3)$',
'O3_pH': 'Carbonate pH',
'O3_TA': 'Total alkalinity $(umol/kg)$',
'O3_fair': 'Carbonate air-sea flux of $CO_{2} (mmol C/m^{2}/d)$',
'volume': 'Node-based control water column volume $(m^{3})$'}
def plot_var(idx):
plot = pf.plot.Plotter(fvcom, figsize=(23, 18), cmap=cmap, cb_label=label, extend=extension, res=None)
plot.plot_field(np.squeeze(getattr(fvcom.data, var))[idx, level, :])
plot.tripcolor_plot.set_clim(clim[0], clim[1])
plot.axes.set_title(fvcom.time.Times[idx][:-7].replace('T', ' '))
suffix = ''
plot.figure.savefig('{}_{:04d}.png'.format(var, idx + 1),
bbox_inches='tight',
pad_inches=0.2,
dpi=120)
plot.close()
fname = sys.argv[1]
var = sys.argv[2]
clim = [float(sys.argv[3]), float(sys.argv[4])]
print(fname)
cmap = pt.plotting.pmlcmaps(var)
pool_size = 4
fvcom = pf.read.FileReader(fname, [var])
label = labels[var]
extension = pt.plotting.colourbar_extension(*clim, getattr(fvcom.data, var).min(), getattr(fvcom.data, var).max())
level = 0
time_indices = range(fvcom.dims.time)
# Launch the parallel plotting and then close the pool ready for the
# next variable.
pool = multiprocessing.Pool(pool_size)
pool.map(plot_var, time_indices)
pool.close()
[command]
default = today_output=/${ARCHIVE_DIR}/${FORECAST_DAY}/${GRID_NAME}_0001.nc; echo ${today_output}
python3 plot_var.py ${today_output} temp 8 18; python3 plot_var.py ${today_output} salinity 31 36;
mkdir -p /${PLOT_DIR}/${FORECAST_DAY}/; mv *.png /${PLOT_DIR}/${FORECAST_DAY}/
[command]
default = dst=/pml${ARCHIVE_DIR}/${START_DAY}/;
default = dst=/pml${ARCHIVE_DIR}/${FORECAST_DAY}/;
src=${ROSE_DATAC}/output/${GRID_NAME}_0001.nc;
ssh ceto6 -t "rsync -aph --no-o --no-g $src $dst";
[command]
default = dst=/pml${ARCHIVE_DIR}today;
rm /pml${ARCHIVE_DIR}today/*;
default = src=${ROSE_DATAC}/output/${GRID_NAME}_0001.nc;
dst=/pml${ARCHIVE_DIR}/today/;
rm /pml${ARCHIVE_DIR}/today/*;
ssh ceto6 -t "rsync -aph --no-o --no-g $src $dst";
......@@ -21,8 +21,8 @@ start_date = end_date
for this_river in river_dict.values():
if hasattr(this_river, 'catchment_precipitation'):
this_river_update = np.max(this_river.catchment_precipitation[0])
if this_river_update < start_date:
start_date = this_river_update
if this_river_update < start_date:
start_date = this_river_update
if start_date == end_date:
......
......@@ -8,19 +8,23 @@ FORECAST=True
REMOTE_USER='modop'
MAIL_TO='mbe@pml.ac.uk'
INITIAL_START_DATE='2018-12-05T00:00:00Z'
INITIAL_START_DATE='2019-02-05T00:00:00Z'
FINAL_CYCLE_POINT='NONE'
RUNDAYS=1
ARCHIVE_DIR='/data/sthenno1/scratch/modop/Model/FVCOM_rosa/output'
ARCHIVE_DIR='data/sthenno1/scratch/modop/Model/FVCOM_rosa/output'
## Grid properties and files
GRID_NAME='aqua_v16'
COMMON_FILES_PATH='/users/modellers/modop/Models/FVCOM_rosa_common/'
ARCHIVE_DIR='data/sthenno1/scratch/modop/Model/FVCOM_rosa/'
PLOT_DIR='data/sthenno1/scratch/modop/Model/FVCOM_rosa/plots'
TEMP_ACTIVE='T'
SALT_ACTIVE='T'
TEMP_ACTIVE='T'
SALT_ACTIVE='T'
## Atmospheric setup
WIND_ON='T'
HEATING_ON='T'
......@@ -29,15 +33,14 @@ AIR_PRESSURE_ON='T'
## WRF suite settings if any of the above are on
WRF_RUN_SUITE='wrf'
WRF_FORECAST_FILE_DIR='/gpfs1/users/modellers/modop/Models/WRF_transfer_dir/'
WRF_ARCHIVE_DIR='data/sthenno1/backup/pica/models/WRF/wrf-preprocess-gfs/output'
WRF_ARCHIVE_DIR='/data/sthenno1/scratch/modop/Model/WRF/output'
WRF_ARCHIVE_DATEFMT='%Y%m%d'
## River setup
## Between 'NONE', 'NEURAL_NET', and 'CLIMATOLOGY'
RIVER_MODEL='NONE'
RIVER_MODEL='NEURAL_NET'
## Required if 'NEURAL_NET' or 'CLIMATOLOGY', the files expected depend on the RIVER_MODEL value
RIVER_MODEL_PATH='/data/sthenno1/backup/mbe/Code/fvcom-projects/mycoast/run/aqua_v16_river_mod'
RIVER_MODEL_PATH='/users/modellers/modop/Models/FVCOM_rosa_rivermod'
## Required if 'NEURAL_NET', must omit first slash to allow use on remote and local
REMOTE_TRANSFER_DIR='users/modellers/modop/Rose_suites/rosa_transfer_dir'
......@@ -48,10 +51,12 @@ BOUNDARY_FORCING='CMEMS'
HARMONICS_FILE_PATH='/users/modellers/modop/Models/FVCOM_rosa_harmonics/aqua_v16_0001_2006_harmonics.nc'
## Required for CMEMS
CMEMS_DATA_DIR='/data/sthenno1/scratch/modop/Data/CMEMS'
## Required for CMEMS warm start
DONOR_RESTART_FILE_PATH='/users/modellers/modop/Models/FVCOM_rosa_restart/aqua_v16_donor_restart.nc'
## Required for NEST_FILE
NEST_RUN_SUITE='rose-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='144'
NEST_INTERVAL='24'
## FVCOM namelist settings
EXT_TSTEP='.150'
......@@ -70,5 +75,5 @@ VELOCITY_OUT='T'
SALT_TEMP_OUT='T'
TURBULENCE_OUT='T'
WIND_OUT='F'
SURF_HEAT_RAIN_OUT='F'
HEAT_RAIN_OUT='F'
......@@ -7,15 +7,18 @@ FORECAST=True
NODES=10
REMOTE_USER='modop'
INITIAL_START_DATE='2018-11-28T00:00:00Z'
INITIAL_START_DATE='2019-02-05T00:00:00Z'
FINAL_CYCLE_POINT='NONE'
RUNDAYS=1
HINDCAST_DAYS=1
FORECAST_DAYS=2
MAIL_TO='mbe@pml.ac.uk'
## Grid properties and files
GRID_NAME='tamar_v2'
COMMON_FILES_PATH='/users/modellers/modop/Models/FVCOM_tamar_common/'
ARCHIVE_DIR='data/sthenno1/scratch/modop/Model/FVCOM_tamar/output'
PLOT_DIR='data/sthenno1/scratch/modop/Model/FVCOM_tamar/plots'
TEMP_ACTIVE='T'
SALT_ACTIVE='T'
......@@ -28,7 +31,7 @@ AIR_PRESSURE_ON='T'
## WRF suite settings if any of the above are on
WRF_RUN_SUITE='wrf'
WRF_FORECAST_FILE_DIR='/gpfs1/users/modellers/modop/Models/WRF_transfer_dir/'
WRF_ARCHIVE_DIR='data/sthenno1/backup/pica/models/WRF/wrf-preprocess-gfs/output'
WRF_ARCHIVE_DIR='/data/sthenno1/scratch/modop/Model/WRF/output'
WRF_ARCHIVE_DATEFMT='%Y%m%d'
......
......@@ -63,10 +63,12 @@
{% endif %}
{% if FORECAST %}
write_run_namelist => run_fvcom => transfer_data_today => transfer_data
write_run_namelist => run_fvcom => transfer_data => transfer_data_today
{% else %}
write_run_namelist => run_fvcom => transfer_data
{% endif %}
run_fvcom => nan_check
transfer_data => plot_surf_vars
"""
......@@ -86,17 +88,20 @@
mail to = {{MAIL_TO}}
submission timeout = P1D
[[[environment]]]
START_DATE=$(rose date --print-format='%Y-%m-%d %H:%M:%S' $CYLC_TASK_CYCLE_POINT)
END_DATE=$(rose date --offset=P1D --print-format='%Y-%m-%d %H:%M:%S' $CYLC_TASK_CYCLE_POINT)
START_DATE_STR=$(rose date --print-format='%Y-%m-%d_%H:%M:%S' $CYLC_TASK_CYCLE_POINT)
END_DATE_STR=$(rose date --offset=P1D --print-format='%Y-%m-%d_%H:%M:%S' $CYLC_TASK_CYCLE_POINT)
START_DAY=$(rose date --print-format='%Y-%m-%d' $CYLC_TASK_CYCLE_POINT)
END_DAY=$(rose date --offset=P1D --print-format='%Y-%m-%d' $CYLC_TASK_CYCLE_POINT)
START_DATE=$(rose date --offset=-P{{HINDCAST_DAYS|int}}D --print-format='%Y-%m-%d %H:%M:%S' $CYLC_TASK_CYCLE_POINT)
END_DATE=$(rose date --offset=P{{FORECAST_DAYS|int}}D --print-format='%Y-%m-%d %H:%M:%S' $CYLC_TASK_CYCLE_POINT)
START_DATE_STR=$(rose date --offset=-P{{HINDCAST_DAYS|int}}D --print-format='%Y-%m-%d_%H:%M:%S' $CYLC_TASK_CYCLE_POINT)
END_DATE_STR=$(rose date --offset=P{{FORECAST_DAYS|int}}D --print-format='%Y-%m-%d_%H:%M:%S' $CYLC_TASK_CYCLE_POINT)
START_DAY=$(rose date --offset=-P{{HINDCAST_DAYS|int}}D --print-format='%Y-%m-%d' $CYLC_TASK_CYCLE_POINT)
END_DAY=$(rose date --offset=P{{FORECAST_DAYS|int}}D --print-format='%Y-%m-%d' $CYLC_TASK_CYCLE_POINT)
FORECAST_DAY=$(rose date --print-format='%Y-%m-%d' $CYLC_TASK_CYCLE_POINT)
GRID_NAME={{GRID_NAME}}
RIVER_MODEL_PATH={{RIVER_MODEL_PATH}}
REMOTE_TRANSFER_DIR={{REMOTE_TRANSFER_DIR}}
ARCHIVE_DIR={{ARCHIVE_DIR}}
PLOT_DIR={{PLOT_DIR}}
HARMONICS_FILE_PATH={{HARMONICS_FILE_PATH}}
DONOR_RESTART_FILE_PATH={{DONOR_RESTART_FILE_PATH}}
......@@ -299,3 +304,6 @@
script = """
ln -s ${ROSE_DATACP1D}/output/${GRID_NAME}_restart_0001.nc ${ROSE_DATAC}/${GRID_NAME}_restart_0001.nc
"""
[[nan_check]]
inherit = remote_job
[[plot_surf_vars]]
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