Changelog#
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased#
Added#
SchismDischargeStage: new dedicated stage for river discharge generation, extracted fromPreSCHISMStage. Encapsulates CHRTOUT staging,nwmReaches.csvhandling,make_discharge,combine_sink_source, andmerge_source_sink. Skipped whendischarge_fileis not configured (matching the SFINCSSfincsDischargeStagepattern).discharge_fileconfig option: addeddischarge_file: Path | None(defaultNone) toSchismModelConfig. Points to anwmReaches.csvfile mapping NWM reach feature IDs to SCHISM source/sink elements. WhenNone, the discharge stage is skipped and no river forcing is generated.
Changed#
- Elevation correction is now explicit:
make_tpxo_boundaryandmake_stofs_boundaryaccept an optionalcorrection_fileparameter instead of implicitly checking forelevation_correction.csvin the work directory. Boundary stages resolve the correction file fromprebuilt_dir. Node-count validation is performed when applying the correction. PreSCHISMStageslimmed down: now only handles mesh partitioning andparam.nmlpatching. Discharge operations moved toSchismDischargeStage.merge_source_sinkaccepts element areas array: theroot_dir/element_area_dirparameter replaced withelement_areas: ndarray, computed at runtime from the mesh viaNWMSCHISMProject.element_areas. Eliminates dependency onelement_areas.txtfor the discharge pipeline.SchismObservationStageusesNWMSCHISMProject: replaced ~90 lines of standalone hgrid.gr3 parsing helpers (_read_hgrid_header,_read_node_coordinates,_read_open_boundary_nodes) with theNWMSCHISMProjectclass from the newschism/module.stage_chrtout_filessimplified: removedprebuilt_dirparameter andnwmReaches.csvcopy (now handled bySchismDischargeStage).update_paramsno longer symlinks discharge/correction files:element_areas.txtandelevation_correction.csvremoved from the symlink lists since they are now handled by their respective stages.nwmReaches.csvremoved from required validation: no longer checked inSchismModelConfig.validate(); thedischarge_fileconfig option replaces it.- Package reorganization: moved all model-specific code into dedicated packages:
- SCHISM workflow:
coastal_calibration.schism.{prep,sflux,stages,boundary,forcing} - SFINCS workflow:
coastal_calibration.sfincs.{stages,create,data_catalog,plotting,floodmap,_hydromt_compat} - Data acquisition:
coastal_calibration.data.{downloader,coops_api,download_stage, streamflow,copdem,esa_worldcover,gebco_wms,topobathy_noaa,topobathy_nws,transformation} WorkflowStagebase class moved tocoastal_calibration.basestages/directory dissolved;utils/retains only general utilities (logging, system, time, mpi, workflow)- HydroMT compatibility patch log messages downgraded from INFO to DEBUG.
- SCHISM workflow:
Added (continued)#
- MPI detection module (
utils/mpi.py): auto-detects the active MPI implementation (OpenMPI or MPICH/Cray MPICH) at runtime viampiexec --versionand sets the correct tuning environment variables and launcher flags for each. On AWS EFA instances, libfabric transport and buffer tuning are applied automatically; on plain NFS/Lustre clusters only general settings (shared-memory on/tmp, fork-warning suppression) are used. schism_execonfig option: addedschism_exe: Path | None(defaultNone) toSchismModelConfig, matching the existingsfincs_exepattern. When set, theschism_runstage uses the given executable and isolates the subprocess environment from conda libraries for system MPI compatibility.runtime_envconfig option: bothSchismModelConfigandSfincsModelConfigaccept aruntime_env: dict[str, str]for injecting extra environment variables into the model run subprocess. Applied last, so it can override auto-detected MPI tuning values.- Type stubs: added
types-geopandasandtypes-shapelyto the typecheck environment for better third-party type coverage.
Changed#
- Lazy imports: converted
__init__.pyfiles (package root,config/,utils/) andcli.pyto use deferred imports via__getattr__. The CLI (coastal-calibration --version) no longer pulls the full dependency tree at startup, reducing cold-start time from ~12 s to under 1 s on NFS. - System MPI isolation: when
schism_exeorsfincs_exeis set to a system-compiled binary, the run stage strips conda library paths from the subprocess environment so the binary finds system MPI/HDF5/NetCDF. A newruntime_envconfig option allows injecting extra env vars for the model run. Python MPI stages (ESMF regridding) continue using conda OpenMPI. - OpenMP tuning: moved common OpenMP variables (
OMP_NUM_THREADS,OMP_PLACES,OMP_PROC_BIND) from model-specificbuild_environment()methods to the sharedWorkflowStage.build_environment()instages/base.py. - SFINCS run stage:
SfincsRunStage.run()now usesself.build_environment()instead of constructing an inline env dict, ensuringHDF5_USE_FILE_LOCKINGand OpenMP pinning are applied consistently.
Fixed#
- Type checking: resolved all 895 pyright strict-mode errors across 35 source files. Real type issues (wrong argument types, unnecessary isinstance checks, missing annotations, None-safety) were fixed in code; remaining noise from third-party libraries without type stubs is suppressed via targeted pyright config rules.
- Script permissions: marked
scripts/find_compatible_sdk.sh,coastal_models/schism/build.sh, andcoastal_models/sfincs/build.shas executable to satisfy the pre-commit shebang check. - Cluster install verification: replaced
shutil.whichcheck withlsinCLUSTER_INSTALL.md— the old command returnedNonebecause running the Python binary directly bypasses the wrapper'sPATHsetup.
Changed#
- Build system: migrated SFINCS and SCHISM compilation from activation scripts
(
scripts/ensure-sfincs.sh,scripts/ensure-schism.sh) to pixi-build packages using therattler-buildbackend. Build recipes live incoastal_models/sfincs/andcoastal_models/schism/withrecipe.yaml+build.sh. Builds are cached as conda packages and only recompile when the submodule source or recipe changes. - Submodule layout: moved git submodules from
SFINCS/andschism/tocoastal_models/sfincs/repo/andcoastal_models/schism/repo/. The in-tree./reposource paths avoid a pixi-build cache invalidation bug with out-of-tree paths (prefix-dev/pixi#4837). - MPI variant consistency: both SFINCS and SCHISM recipes now pin
hdf5andlibnetcdf/netcdf-fortrantompi_openmpi_*build variants, matching ESMF/esmpy runtime expectations and avoiding library conflicts in shared environments. - macOS SDK probe: replaced hardcoded
MacOSX15*SDK fallback with a dynamic probe (scripts/find_compatible_sdk.sh) that tests each installed SDK against the active linker and picks the newest compatible one. - Cluster install: rewrote
CLUSTER_INSTALL.mdaround full-repo clone with pixi-build. The wrapper script (nwm-coastal) fully activates the environment so pixi is not needed at runtime on compute nodes. - mkdocs hooks:
docs/hooks.pynow strips ANSI escape codes and absolute repo paths from rendered notebook HTML at build time, complementing the existingscripts/clean_notebooks.pypre-commit task.
Removed#
scripts/ensure-sfincs.shandscripts/ensure-schism.sh(replaced by pixi-build recipes).- Build-tool dependencies (
c-compiler,fortran-compiler,cxx-compiler,cmake,make,autoconf,automake,libtool,m4) from pixi feature sections inpyproject.toml(now declared inrecipe.yamland resolved by the build backend).
Added#
coastal_calibration.plottingmodule with reusable visualization utilities:SfincsGridInfodataclass withfrom_model_root()factory for loading and summarizing SFINCS grid metadata (quadtree and regular grids).plot_mesh()for visualizing the SFINCS mesh colored by refinement level with optional satellite basemap viacontextily.plot_floodmap()for reading and plotting flood-depth Cloud Optimized GeoTIFFs with automatic overview-level selection and basemap overlay.plot_station_comparison()for generating 2×2 simulated vs observed water-level comparison plots, consolidated from the formersfincs_plotandschism_plotstage internals.plotable_stations()helper for filtering stations that have both simulated and observed data.
_KNOWN_INP_PARAMSallowlist onSfincsModelConfigthat validatesinp_overrideskeys against all ~170 recognizedsfincs.inpparameters, catching typos early (SFINCS silently ignores unknown parameters).SfincsDischargeStagenow assigns real NWMCHRTOUTdischarge timeseries to source points via_assign_discharge_timeseries, using the sharedread_streamflowutility (nwm_retroreads from S3 Zarr,nwm_anareads from local CHRTOUT vianetCDF4).tests/test_floodmap.pywith unit tests for_write_floodmap_cog,_ensure_overviews, and an integration test forcreate_flood_depth_map.- QGIS plugin: optional NWM Flowlines Override in the basemap dialog, allowing users to load flowpaths from a separate NWM GeoPackage with configurable layer name and stream order column.
- QGIS plugin: "Export Selected Flowpaths" toolbar button that saves the current selection on the flowpaths layer to a GeoJSON file.
- QGIS plugin: stream order validation against the actual min/max range in the data, with a clear error when the user-specified value is out of range.
- QGIS plugin: auto-enable labels for gages (
site_no) and CO-OPS (station_id) layers with font size 15 and text buffer. - Narragansett Bay, RI example notebook showing compound forcing (ocean + river discharge + meteo) with NWM streamflow.
- SCHISM de-containerization: all Singularity container invocations replaced with native
Python function calls, MPI module invocations (
mpiexec -m), and subprocess calls for Fortran binaries (pschism,combine_hotstart7,combine_sink_source,metis_prep,gpmetis). coastal_calibration.schism_prepmodule with 12 pure-Python functions replacing bash scripts:stage_ldasin_files,make_sflux,update_params,make_tpxo_boundary,make_stofs_boundary,correct_elevation,stage_chrtout_files,make_discharge,run_combine_sink_source,merge_source_sink,partition_mesh,combine_hotstart.coastal_calibration.sfluxmodule replacingmakeAtmo.pyfor sflux atmospheric forcing generation with inline sea-level pressure reduction.coastal_calibration.tidespackage replacingtpxo_to_open_bnds_hgrid/andmakeOceanTide.pywith TPXO boundary utilities and bundledpytidesharmonic library.coastal_calibration.regriddingpackage with ESMF-based regridding for STOFS boundary conditions (regrid_estofs) and NWM atmospheric forcing (regrid_forcings) with MPI-aware LocStream partitioning.coastal_calibration.utils.streamflowmodule supporting NWM retrospective (S3 Zarr) and analysis (local CHRTOUT) streamflow reads via unifiedread_streamflow()function.scripts/ensure-schism.shpixi activation script for native SCHISM binary compilation with SHA256-based rebuild detection.- ESMF/esmpy compatibility shim (
esmf_compat/ESMF.py) forimport ESMF→esmpytransition with auto-initializedManager. - Hawaii SCHISM example notebook demonstrating end-to-end workflow with 3-hour simulation on ~878K node mesh.
prepare-topobathyandupdate-dem-indexCLI commands for DEM management.docs/schism_compilation.md: comprehensive SCHISM de-containerization guide covering architecture, build system, stage inventory, and known issues.docs/stofs_tpxo_improvements.md: analysis of STOFS/TPXO boundary condition pipeline issues and improvement plan.- SCHISM compilation and unit tests in
tests/schism/and regridding tests intests/regridding/with synthetic grid generation.
Changed#
- Centralize station comparison plotting into
coastal_calibration.plotting.stations, removing duplicate_plotable_stationsand_plot_figurescode fromSfincsPlotStageandSchismPlotStage. - Refactor Lavaca and Narragansett example notebooks to use the new
plottingmodule (SfincsGridInfo,plot_mesh,plot_floodmap) instead of inline visualization code. - Breaking: Rename
nwm_dischargeconfig section toriver_dischargeand addmax_snap_distance_mfield (default 2000 m). Discharge points that must move farther than this threshold to reach an active grid cell are dropped with a warning. Previously these points could be silently written with out-of-bounds coordinates. - Breaking: Simplify
river_dischargeconfig from 5 fields (hydrofabric_gpkg,flowpaths_layer,flowpath_id_column,flowpath_ids,coastal_domain) to 2 fields (flowlines,nwm_id_column). Users now provide a GeoJSON file of selected flowpaths (e.g., exported from the QGIS plugin) instead of a full NWM hydrofabric GeoPackage with explicit IDs. - QGIS plugin: "Export Selected Flowpaths" now writes GeoJSON (
.geojson) instead of GeoPackage (.gpkg). - Rename example directory
texas-lavaca/tolavaca-tx/and update notebook paths accordingly. - Consolidate example notebooks: remove CLI variants and
_api/_clisuffixes, keeping one notebook per region (lavaca.ipynb,narragansett.ipynb). - Rewrite
create_flood_depth_mapto read the DEM and index COG at full resolution and write a flood-depth Cloud Optimized GeoTIFF block-by-block, bypassing an upstreamhydromt_sfincsbug wheredownscale_floodmapopened rasters withoverview_level=0and silently halved the output resolution. - Separate discharge concerns between
createandrunstages: the create stage now only writes the.srcfile with snapped locations, while the run stage (SfincsDischargeStage) adds points to the model and attaches real NWM streamflow data. - Consolidate stdout/logging suppression for
hydromt-sfincsinto a sharedsuppress_hydromt_output()context manager inutils.logging, replacing duplicated_suppress_stdouthelpers increator.pyandsfincs_create.py. SfincsGridInfo.from_model_root()no longer accepts abase_resolutionparameter; the coarsest cell size is now derived automatically from the quadtree grid data.- Bump
pyproject-fmtpre-commit hook from v2.16.2 to v2.18.1. sfincs_symlinksstage now reports when symlinks already exist instead of silently showing "Created 0 … symlinks".- Add
jupytextpre-commit hook (--sync) to keep.ipynband.pynotebook pairs in sync automatically. - Configure
tytype-checker to resolve third-party imports from the pixitypecheckenvironment viapythonpath instead ofextra-paths. - Exclude
docs/examples/downloads/,examples/hawaii/run/,examples/lavaca-tx/run/, and examplecache/directories from MkDocs static file copying to preventNo space left on deviceerrors from large simulation data files. - Update all documentation to reflect SCHISM de-containerization: new stage names
(
schism_forcing_prep,schism_sflux,schism_params,schism_boundary,schism_prep,schism_postprocess), removal ofsingularity_imageconfig field, addition ofprebuilt_dirandgeogrid_filefields, and removal of all Singularity/container references from user-facing docs. - Remove
sfincs_obsfrom the SFINCS stage pipeline documentation. - Add Hawaii SCHISM example card with correct thumbnail to the examples index page.
- Fix jupytext
formatsconfig inpyproject.toml(trailing slash in the prefix key caused a triple-slash path that resolved to the read-only root filesystem on macOS). - Scope the jupytext pre-commit hook to
docs/examples/notebooks/and exclude.ipynbfiles frompretty-format-jsonto prevent hook conflicts. - Improve writing quality and consistency across all documentation files.
- Discharge snapping now always snaps to the nearest active cell (previously kept points
as-is when they happened to land on an active cell) and converts KDTree distances
from CRS units to meters before comparing with
max_snap_distance_m. - Simplify
SfincsDischargeStagedischarge loading: remove the HydroMTget_geodatasetfallback chain and callread_streamflowdirectly. Resolves CHRTOUT files fromconfig.paths.streamflow_dirinstead of the HydroMT data catalog. - Breaking: All SCHISM stages now run natively without Singularity containers.
Stages call Python functions directly instead of shelling out to bash scripts inside
singularity exec. - Breaking: SCHISM stage names renamed to
schism_*prefix convention (matching SFINCSsfincs_*pattern):schism_forcing_prep,schism_forcing,schism_sflux,schism_params,schism_obs,schism_boundary,schism_prep,schism_run,schism_postprocess,schism_plot. - Breaking:
singularity_imageconfig field removed fromSchismModelConfig. - All environment-variable-based argument passing in SCHISM stages replaced with
explicit Python function parameters or CLI arguments (
--cycle-date,--cycle-time,--length-hrs,--job-index,--job-count). - ESMF regridding modules invoked via
mpiexec -m coastal_calibration.regridding.*with CLI arguments instead of environment variables. - Unified logging: all SCHISM modules use central
coastal_calibrationlogger with 4-space indent for function-level logs under 2-space stage-level logs. - Tests reorganized from flat
tests/directory intotests/common/,tests/schism/,tests/sfincs/,tests/regridding/subdirectories. - Pixi
netcdf4dependency pinned to MPI-aware conda-forge build variant (mpi_openmpi_*) for parallel HDF5 support across all environments.
Fixed#
- Clean all generated files (discharge, boundary, sflux, partitioning, outputs, status)
from the run directory at the start of a full workflow run via
clean_run_directory(). When resuming withstart_from, no wipe occurs so prerequisites and earlier outputs are preserved. Consolidates the per-stage cleanup previously inmake_sflux()andPreForcingStage. - Use
CONSERVEregrid method for Grid-to-Mesh(ELEMENT) regridding in_regrid_to_schism. ESMFBILINEARonly supportsMeshLoc.NODEdestinations; theBILINEAR+ELEMENTcombination was silently accepted by some ESMF builds (macOS) but correctly rejected withESMC_RC_ARG_VALUE(rc=509) on others (Ubuntu CI). _read_staoutnow returns empty arrays whenstaout_1has no data (e.g., station output not enabled), preventingIndexErroron 1-dimensional array indexing.PostSCHISMStagefilters known non-fatalQUICKSEARCHdry-node warnings fromfatal.errorinstead of treating all content as a hard failure.SchismPlotStageskips gracefully whenstaout_1is empty instead of crashing.- Skip ESMF regridding tests on platforms where
ESMF.Meshis unavailable orESMC_FieldRegridStorefails with rc=509. Enlarge synthetic ESMF grids to avoid BILINEAR regrid failures on small domains. - Exclude regridding tests from CI catch-all test environments that lack MPI/ESMF.
- Replace
assertstatements with proper exceptions (ValueError,RuntimeError,FileNotFoundError) throughoutsrc/modules. - Use
ty: ignore[rule-name]with specific rule names instead of blankettype: ignorecomments. - Add
*.ESMF_LogFileto.gitignore. - Configure
schismsubmodule to track only HEAD (no internal changes tracked), matching the SFINCS submodule pattern. - SFINCS activation script now detects stale
Makefileconfigured for a different environment prefix and reconfigures automatically, fixingsfincsbinary not found when switching between pixi environments. - Flood depth map generation for regular (non-quadtree) SFINCS grids: the
zsmaxindex lookup in_reduce_zsmaxused C-order (row-major) flattening butSfincsGrid.get_indices_at_pointsreturns Fortran-order (column-major) linearized indices. Changed to Fortran-order to match, fixing incorrect flood depth values on regular grids. sfincs_floodmapstage now readszsmaxviaSfincsModelwithapply_all_patches()instead ofxu.open_dataset, fixing a crash on quadtree models without refinement levels (where the output lacks UGRID topology).- STOFS data catalog entry previously used a recursive glob (
stofs/**/*.fields.cwl.nc) that matched all cached STOFS files. When the cache held files from different STOFS mesh versions with incompatible dimensions,xarrayconcatenation failed. A new_stofs_uri()helper now builds an exact file path for the simulation's date and cycle hour, avoiding multi-file collision. - Expand the STOFS
drop_variableslist to also dropnvell,ibtype,nbvv,max_nvell, anddepth, reducing memory for the ~12-million-node STOFS mesh. _downstream_endpointnow compares both endpoints of NWM hydrofabric flowpath linestrings and returns whichever is closest to the AOI boundary, fixing incorrect discharge point placement when flowpath direction is reversed.- Quadtree mesh plotting (
SfincsGridInfo) now masks fill values (-1) in face-node connectivity before computing cell widths, fixing bogus level counts and distorted mesh visualizations. - QGIS plugin: use
mActionVertexToolActiveLayer.svgicon for the Edit Polygon toolbar button (previously used the removedmActionNodeTool.svg). - NWM data catalog globs (
*.LDASIN_DOMAIN1.nc,*.CHRTOUT_DOMAIN1.nc) now include the simulation year-month prefix (e.g.,202506*.LDASIN_DOMAIN1.nc). Previously, stale files from other runs or domains in the shared download directory were loaded, causingxr.open_mfdatasetto fail with "non-monotonic global indexes along dimension x" when combining grids of different sizes (e.g., Hawaii 390×590 vs CONUS 3840×4608). clip_and_reprojectnow sorts spatial coordinates after thenearest_indexreproject step, preventing "non-monotonic global indexes" errors from floating-point drift in reprojected coordinates._read_from_chrtoutinutils/streamflow.pynow handles CHRTOUT files with 2Dstreamflow(time, feature_id)arrays by squeezing the time dimension, fixing compatibility with test fixtures that write multi-dimensional streamflow data.
Removed#
scripts_path.pymodule. All script paths now resolved via Python imports.src/coastal_calibration/scripts/directory. Legacy bash and Python scripts moved totests/legacy_scripts/as reference implementations for regression testing.run_singularity_command()and_get_default_bindings()fromstages/base.py. Singularity execution infrastructure fully removed.requires_containerclass attribute fromWorkflowStage. All stages now run natively.Dockerfile.ngencoastal. Container build file no longer needed.- All
run_sing_*.bashSingularity wrapper scripts. MPIConfigclass (fields absorbed intoSchismModelConfig).
3.1.1.0.0 - 2026-02-19#
Added#
- Initial release of NWM Coastal
- SCHISM coastal model workflow support
- YAML configuration with variable interpolation
- Configuration inheritance with
_basefield - CLI commands:
init,validate,submit,run,stages - Python API for programmatic workflow control
- Automatic data download from NWM and STOFS sources
- Support for TPXO and STOFS boundary conditions
- Support for four coastal domains: Hawaii, PRVI, Atlantic/Gulf, Pacific
- Interactive and non-interactive job submission modes
- Partial workflow execution with
--start-fromand--stop-after - Smart default paths with interpolation templates
- Comprehensive configuration validation
- MkDocs documentation with Material theme
- Per-stage completion tracking in the
submitpath's generated runner script: each container stage is recorded in.pipeline_status.jsonas it finishes, enabling mid-pipeline restarts after a SLURM job failure without re-running expensive stages (e.g.,predict_tide). On resubmit, completed stages are automatically skipped. meteo_resoption inSfincsModelConfigto control the output resolution (m) of gridded meteorological forcing (precipitation, wind, pressure). When not set, the resolution is derived from the SFINCS quadtree grid base cell size.- Meteo grid clipping (
_clip_meteo_to_domain) that trims reprojected meteo grids to the model domain extent, preventing the LCC → UTM reprojection from inflating grids to CONUS scale, reducing SFINCS runtime from 15 h+ to under 15 min. - Stale netCDF file cleanup in
SfincsInitStageto prevent HDF5 segfaults when re-running a pipeline over an existing model directory. GeoDataset-based water-level forcing with IDW interpolation to boundary points, replacing the built-inmodel.water_level.create(geodataset=...)which passed all source stations incompatibly with.bndfiles.- Active-cell filtering for discharge source points to prevent a SFINCS Fortran segfault when a source point falls on an inactive grid cell.
apply_all_patches()convenience function in_hydromt_compatthat applies allhydromt/hydromt-sfincscompatibility patches in one call, with logging.quietparameter onWorkflowMonitor.mark_stage_completed()to control whether a visible COMPLETED log line is emitted for externally-executed stages.- Unified
runandsubmitexecution pipelines. Both commands now execute the same stage pipeline.submitautomatically partitions stages into login-node (Python-only) and SLURM job (container) groups. --start-fromand--stop-afteroptions forsubmitcommand, matchingrunrequires_containerclass attribute onWorkflowStagefor automatic stage classification (Python-only vs container)schism_obsstage: automatic NOAA CO-OPS water level station discovery via concave hull of open boundary nodes, writingstation.inandstation_noaa_ids.txtschism_plotstage: post-run comparison plots of simulated vs NOAA-observed water levels with MLLW→MSL datum conversionCOOPSAPIClientfor querying the NOAA CO-OPS API (station metadata, water levels, datums) with local caching of station metadatainclude_noaa_gagesoption inSchismModelConfig(defaults tofalse) that enables theschism_obsandschism_plotstages- Automatic
param.nmlpatching (iout_sta = 1,nspool_sta = 18) whenstation.inexists, ensuringmod(nhot_write, nspool_sta) == 0across all domain templates forcing_to_mesh_offset_moption inSfincsModelConfigto apply a vertical offset to boundary-condition water levels before they enter SFINCS. For tidal-only sources like TPXO, this anchors the tidal signal to the correct geodetic height of MSL on the mesh.vdatum_mesh_to_msl_moption inSfincsModelConfigto convert SFINCS output from the mesh vertical datum to MSL for comparison with NOAA CO-OPS observations.- Sanity-check warning in
sfincs_forcingwhen adjusted boundary water levels fall outside the ±15 m range, indicating a possible sign or magnitude error inforcing_to_mesh_offset_m. sfincs_wind,sfincs_pressure, andsfincs_plotstages to SFINCS workflow- SFINCS coastal model workflow with full pipeline (download through
sfincs_run) - Polymorphic
ModelConfigABC withSchismModelConfigandSfincsModelConfigconcrete implementations MODEL_REGISTRYfor automatic model dispatch from YAMLmodel:key--modeloption forinitandstagesCLI commands- Model-specific compute parameters (SCHISM: multi-node MPI; SFINCS: single-node OpenMP)
${model}variable in default path templates for model-aware directory naming
Changed#
DownloadStage.descriptionis now a property that derives its text from the configured data sources (e.g. "Download input data (NWM, TPXO)") instead of a static string.hydromtcompatibility patches consolidated intoapply_all_patches()with per-patch logging; individual imports replaced by a single call.CoastalCalibConfignow takesmodel_config: ModelConfiginstead of separatemodel,mpi, andsfincsparametersSlurmConfignow contains only scheduling parameters (job_name,partition,time_limit,account,qos,user); compute resources (nodes,ntasks_per_node,exclusive) moved toSchismModelConfig- Default path templates use
${model}_prefix instead of hardcodedschism_ - Stage order and stage creation delegated to
ModelConfigsubclasses - SFINCS datum handling split into two separate offsets: the former single
navd88_to_msl_mfield is replaced byforcing_to_mesh_offset_m(applied to boundary forcing before simulation) andvdatum_mesh_to_msl_m(applied to model output for observation comparison). The two offsets serve fundamentally different purposes and may have different values depending on the boundary source. - SFINCS field renames:
model_dir->prebuilt_dir,obs_points->observation_points,obs_merge->merge_observations,src_locations->discharge_locations_file,src_merge->merge_discharge
Fixed#
- Call
expanduser()beforeresolve()on all path config fields so that paths containing~are correctly expanded to the user's home directory. - Call
monitor.end_workflow()before returning early in no-wait mode (submitwithwait=False), so that the workflow timing summary is always closed. - Set
HDF5_USE_FILE_LOCKING=FALSEin container environment to preventPermissionErroron NFS-mounted filesystems. - Add conda environment paths (
PATH,LD_LIBRARY_PATH) to therunpath'sbuild_environment()so thatmpiexecand MPI shared libraries from the conda environment are found, matching the environment set up by the generatedsubmitscripts. Without these paths, therunpath could not locatempiexec, causing MPI stages to hang or fail. - Add MPI/EFA fabric tuning variables (
MPICH_OFI_STARTUP_CONNECT,FI_OFI_RXM_SAR_LIMIT, etc.) to therunpath's SCHISM environment, matching thesubmitpath and preventing hangs on AWSc5nnodes. - Suppress ESMF diagnostic output from SLURM logs by redirecting stdout to
/dev/nullfor MPI stages and settingESMF.Manager(debug=False). - Redirect container stdout/stderr to temporary files instead of pipes to prevent
pipe-buffer deadlocks with MPI process trees (
mpiexec→singularity), where inherited pipe file-descriptors in child processes can fill the OS pipe buffer (64 KB on Linux) and deadlock the entire tree. - Use
$COASTAL_DOMAINinstead of hardcodedprviinmake_tpxo_ocean.bashso the correct open-boundary mesh is used for all domains. - Add missing
$in${PDY}variable expansion inpost_regrid_stofs.bashlog filename. - Correct malformed shebangs (
#/usr/bin/evn) inpre_nwm_forcing_coastal.bashandpost_nwm_forcing_coastal.bash. - Use integer division (
//) for the netCDF array index inWrfHydroFECPP/fecpp/app.pyto avoidfloatindex errors. - Use numeric comparison (
-gt) instead of string comparison (>) forLENGTH_HRSinupdate_param.bash. - Add missing sub-hourly
CHRTOUTsymlinks for Hawaii in the last-timestep block ofinitial_discharge.bash. - Read
NSCRIBESfrom the environment with a fallback default instead of hardcoding it inpre_schism.bashandrun_sing_coastal_workflow_post_schism.bash. - Compute
LENGTH_HRSinSTOFSBoundaryStagedirectly instead of parsing stdout from the pre-script, which was silently lost after thePopen.communicate()fix redirected stdout to/dev/null. - Remove duplicate domain-to-inland/geogrid mappings in
runner.pyand use the canonical properties fromSimulationConfigto prevent the two copies from drifting out of sync. - Correct shebangs (
#!/usr/bin/bash→#!/usr/bin/env bash) inpre_regrid_stofs.bashandpost_regrid_stofs.bashfor consistency and portability. - Source inner bash scripts from
$SCRIPTS_DIRinstead of./in all wrapper scripts, so that the bind-mounted (package) versions are used rather than the stale copies baked into the container image. - Export
COASTAL_SCRIPTS_DIR,WRF_HYDRO_DIR,TPXO_SCRIPTS_DIR, andFORCINGS_SCRIPTS_DIRin thesubmitpath's generated runner script. These variables were only set in therunpath, causing$COASTAL_SCRIPTS_DIR/makeAtmo.py(and similar) to resolve to just/makeAtmo.pyand fail silently. - Export date-component variables (
FORCING_START_YEAR,FORCING_START_MONTH,FORCING_START_DAY,FORCING_START_HOUR,PDY,cyc,FORCING_BEGIN_DATE,FORCING_END_DATE,END_DATETIME) in thesubmitpath header so thatmakeAtmo.py,makeDischarge.py, and other Python scripts inside the container have access to them across all stages. - Add
set -eto all inner bash scripts (post_nwm_forcing_coastal.bash,initial_discharge.bash,merge_source_sink.bash,combine_sink_source.bash,pre_nwm_forcing_coastal.bash,post_regrid_stofs.bash,pre_regrid_stofs.bash,make_tpxo_ocean.bash,pre_schism.bash,post_schism.bash,update_param.bash) so that command failures (e.g.,pythonfile-not-found or import errors) propagate instead of being silently swallowed. - Correct shebang in
make_tpxo_ocean.bashandpre_schism.bash(#!/usr/bin/bash→#!/usr/bin/env bash). - Copy
setup_tpxo.txtandModel_tpxo10_atlasfrom$SCRIPTS_DIRinstead of./inmake_tpxo_ocean.bash, so the bind-mounted (package) versions are used rather than stale copies baked into the container image. - Truncate discharge arrays in
merge_source_sink.pyto match the precipitation timestep count fromprecip_source.nc, preventing a shape-mismatchValueErrorwhen sub-hourlyCHRTOUTfiles (e.g., Hawaii) produce one extra trailing timestep. - Export
SCHISM_BEGIN_DATEandSCHISM_END_DATEin thesubmitpath header so thatupdate_param.bashcan patchparam.nmlwith the correct simulation start/end dates. Without these,param.nmlretains its template defaults (2000-01-01) and SCHISM aborts with a time mismatch againstsfluxforcing files. - Report accurately which container stages completed vs failed when a SLURM job ends with a non-zero exit status, instead of marking all container stages as failed.
Removed#
MPIConfigclass (fields absorbed intoSchismModelConfig)