Skip to content

Commit accc22f

Browse files
Enable diagnostics package, add surface field plotter and live dashboard
- Enable useDIAGNOSTICS=.TRUE. in data.pkg, diag_mnc=.TRUE. for NetCDF output - Configure daily snapshots of prognostic fields (THETA, SALT, UVEL, VVEL, ETAN, WVEL) via diagnostics package; disable dumpFreq to avoid MNC OOM - Add plot_surface_fields.py: watches MNC diagnostics output, stitches tiles, renders SST/SSS/SSH/KE surface plots to PNG - Add monitor_dashboard.py: live-updating dashboard with Chart.js, SLURM info, throughput estimate, CFL panels, and surface field viewer with variable selector, time slider (5 most recent), and archive page - Add plot_surface_fields.sh workflow to run plotter alongside simulation - Update run.sh for local disk staging and 3-day walltime - Set deltaT=360s after testing (600s blows up, 120s stable but slow) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5bbb937 commit accc22f

10 files changed

Lines changed: 957 additions & 28 deletions

File tree

simulations/glorysv12-curvilinear/code/EXF_OPTIONS.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ C read evaporation from file
4040

4141

4242
C ** Interpolation / Vector rotation behavior **
43-
#define USE_EXF_INTERPOLATION
44-
#define EXF_INTERP_USE_DYNALLOC
43+
#undef USE_EXF_INTERPOLATION
44+
#undef EXF_INTERP_USE_DYNALLOC
4545

4646
#endif

simulations/glorysv12-curvilinear/etc/config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ atmosphere:
3737
- era_name: "surface_thermal_radiation_downwards"
3838
mitgcm_name: "lwdown"
3939
scale_factor: 2.7778E-04
40-
- era_name: "mean_surface_downward_short_wave_radiation_flux"
41-
mitgcm_name: "mswdown"
42-
- era_name: "mean_surface_downward_long_wave_radiation_flux"
43-
mitgcm_name: "mlwdown"
40+
# - era_name: "mean_surface_downward_short_wave_radiation_flux"
41+
# mitgcm_name: "mswdown"
42+
# - era_name: "mean_surface_downward_long_wave_radiation_flux"
43+
# mitgcm_name: "mlwdown"
4444
- era_name: "mean_sea_level_pressure"
4545
mitgcm_name: "pressure"
4646
- era_name: "runoff"

simulations/glorysv12-curvilinear/input/data

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
&PARM03
4343
nIter0=0,
4444
baseTime=0.0,
45-
# End at end of day 365
45+
# 1-year run (365 days)
4646
endTime=31536000.0,
47-
deltaT=120.0,
47+
deltaT=360.0,
4848
abEps=0.01,
49-
pChkptFreq=31536000.0,
50-
chkptFreq=3153600.0,
51-
dumpFreq=120.0,
49+
pChkptFreq=15768000.0,
50+
chkptFreq=2592000.0,
51+
dumpFreq=0.0,
5252
monitorSelect=2,
5353
monitorFreq=3600.0,
5454
# Daily forced

simulations/glorysv12-curvilinear/input/data.diagnostics

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,29 @@
77
# frequency(n):< 0 : write snap-shot output every |frequency| seconds
88
# > 0 : write time-average output every frequency seconds
99
# timePhase(n) : write at time = timePhase + multiple of |frequency|
10-
# averagingFreq : frequency (in s) for periodic averaging interval
11-
# averagingPhase : phase (in s) for periodic averaging interval
12-
# repeatCycle : number of averaging intervals in 1 cycle
1310
# levels(:,n) : list of levels to write to file (Notes: declared as REAL)
1411
# when this entry is missing, select all common levels of this list
1512
# fields(:,n) : list of selected diagnostics fields (8.c) in outp.stream n
1613
# (see "available_diagnostics.log" file for the full list of diags)
17-
# missing_value(n) : missing value for real-type fields in output file "n"
18-
# fileFlags(n) : specific code (8c string) for output file "n"
1914
#--------------------
2015
&DIAGNOSTICS_LIST
21-
diag_mnc = .FALSE.,
22-
fields(1:2,1) ='CH_QNET','CH_EmP',
23-
fileName(1) = 'Cheapaml',
24-
frequency(1) = -43200.0,
25-
timePhase(1) = 0.0,
26-
fields(1:5,2) ='TFLUX','SFLUX','oceFWflx','oceSflux','oceQnet',
27-
fileName(2) = 'Thermo',
28-
frequency(2) = -43200.0,
29-
timePhase(2) = 0.0,
16+
diag_mnc = .TRUE.,
17+
18+
# Stream 1: Daily snapshots of prognostic variables (3D)
19+
fields(1:4,1) = 'THETA ','SALT ','UVEL ','VVEL ',
20+
fileName(1) = 'state3D',
21+
frequency(1) = -86400.0,
22+
23+
# Stream 2: Daily snapshots of 2D prognostic fields
24+
fields(1:2,2) = 'ETAN ','WVEL ',
25+
fileName(2) = 'state2D',
26+
frequency(2) = -86400.0,
27+
28+
# Stream 3: Daily snapshots of surface fluxes
29+
fields(1:5,3) = 'TFLUX ','SFLUX ','oceFWflx','oceSflux','oceQnet ',
30+
fileName(3) = 'Thermo',
31+
frequency(3) = -86400.0,
32+
3033
&end
3134
&DIAG_STATIS_PARMS
3235
&end

simulations/glorysv12-curvilinear/input/data.pkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
useKPP=.TRUE.,
55
useCHEAPAML=.FALSE.,
66
useMNC=.TRUE.,
7-
useDIAGNOSTICS=.FALSE.,
7+
useDIAGNOSTICS=.TRUE.,
88
useCAL=.TRUE.,
99
useEXF=.TRUE,
1010
&end

simulations/glorysv12-curvilinear/workflows/env.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
# Path where downloaded data is stored
44
export HOST_DATADIR=/mnt/beegfs/spectre-150-ensembles/simulations/glorysv12-curvilinear/downloads
5+
export SIMULATION_INPUT_DIR=/mnt/raid/joe/glorys12-curvilinear/input
56
export SPECTRE_UTILS_IMG="docker://ghcr.io#ocean-spectre/spectre-ensembles/spectre-utils:main"
67
export MITGCM_BASE_IMG="docker://ghcr.io#fluidnumerics/mitgcm-containers/gcc-openmpi:latest"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#SBATCH -n1
3+
#SBATCH -c4
4+
#SBATCH --time=3-00:00:00
5+
#SBATCH --job-name=spectre_plot
6+
#SBATCH --output=./spectre_plot.out
7+
#SBATCH --error=./spectre_plot.out
8+
9+
if [ -n "${SLURM_JOB_ID:-}" ]; then
10+
SCRIPT_PATH=$(scontrol show job "$SLURM_JOB_ID" --json | jq -r '.jobs[0].command' )
11+
SCRIPT_DIR=$(dirname "$(readlink -f "$SCRIPT_PATH")")
12+
SIMULATION_DIR=$(dirname $SCRIPT_DIR)
13+
else
14+
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
15+
fi
16+
17+
source $SCRIPT_DIR/env.sh
18+
19+
RUN_DIR="${RUN_DIR:-test-run-03252026/}"
20+
21+
srun --container-image=$SPECTRE_UTILS_IMG \
22+
--container-mounts=${HOME}:${HOME},${SCRIPT_DIR}/../:/workspace,${HOST_DATADIR}:/data \
23+
python /opt/spectre_utils/plot_surface_fields.py \
24+
/workspace/${RUN_DIR} \
25+
--plots-dir /workspace/${RUN_DIR}/plots \
26+
--poll 120 \
27+
--start-date 2002-07-01 \
28+
--dt 360.0

simulations/glorysv12-curvilinear/workflows/run.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/bash
22
#SBATCH -n64
33
#SBATCH -c1
4+
#SBATCH --time=3-00:00:00
45
#SBATCH --job-name=spectre_glorysv12_run
56
#SBATCH --output=%x-%A.out
67
#SBATCH --error=%x-%A.out
78

8-
export RUN_DIR="new/"
9+
export RUN_DIR="test-run-03252026/"
910

1011
if [ -n "${SLURM_JOB_ID:-}" ]; then
1112
SCRIPT_PATH=$(scontrol show job "$SLURM_JOB_ID" --json | jq -r '.jobs[0].command' )
@@ -36,7 +37,7 @@ if [[ ! -d "$RUN_DIR" ]]; then
3637
srun --ntasks=1 \
3738
--mpi=pmix \
3839
--container-image=$MITGCM_BASE_IMG \
39-
--container-mounts=$SIMULATION_DIR:/workspace:rw \
40+
--container-mounts=$SIMULATION_INPUT_DIR:/input:ro,$SIMULATION_DIR:/workspace:rw \
4041
--container-env=RUN_DIR \
4142
/bin/bash -c /workspace/workflows/run_setup.sh
4243
echo ""

0 commit comments

Comments
 (0)