Skip to content

ESMF_Mesh_Domain_Configuration_Production

Jason Ducker edited this page Sep 9, 2024 · 1 revision

ESMF Mesh Domain Configuration Production Demo

Overview of ESMF Mesh Domain Configuration Production Repo

  • This subdirectory with the NextGen Forcings Github repository contains Python scripts that are only focused on converting model domain file formats into a ESMF mesh compliant netcdf file that can be directly utilized by the NextGen Forcings Engine BMI. So far, this repository contains scripts to convert a NextGen hydrofabric geopackage or coastal model mesh file inputs (D-FlowFM, SCHISM) into ESMF mesh compliant netcdf files. Future updates to this repository will reflect more NextGen model formulations as they become available

Creating Python environment to execute scripts using Anaconda

  • Inside the ESMF Mesh Domain Configuration Production repo, you should find a environment.yml file that lists out the Python dependencies to execute the Python scripts
  • conda env create --name ngen_esmf_mesh_prod --file=environment.yml
  • conda activate ngen_esmf_mesh_prod

Example executing NextGen_hyfab_to_ESMF_Mesh.py Script

  • Execute the following command: python NextGen_hyfab_to_ESMF_Mesh.py ./NextGen_v2_VPU01.gpkg ./NextGen_v2_VPU01_ESMF_Mesh.nc -parquet ./VPU01.parquet

NextGen_hyfab_to_ESMF_Mesh.py script arguments overview

  1. hyfab_gpkg - The pathway to the NextGen hydrofabric geopackage file that must contain the nexus "divides" layer for constructing an ESMF mesh to process in the NextGen Forcings Engine
  2. esmf_mesh_output - The pathway to the NextGen ESMF Mesh compliant netcdf output file name that the user specifies for the given input NextGen hydrofabric geopackage file
  3. -parquet: The pathway to the model attributes parquet file containing the slope, slope aspect, and elevation data for the given divide features within the NextGen hydrofabric geopackage file the user has specified. This is only an optional argument here, but the user needs this metadata if they choose to implement NCAR downscaling methods within the NextGen Forcings Engine BMI

Example executing dflowfm_2_esmf.py Script

  • Execute the following command: python dflowfm_2_esmf.py ./Gulf_Atlantic_Continental_Mesh_net.nc ./DFlowFM_Gulf_Atlantic_ESMF_Mesh.nc

dflowfm_2_esmf.py script arguments overview

  1. dflowfm_netcdf_mesh_input - The pathway to the DFlowFM mesh "net" netcdf file that is used as the domain mesh input for the DFlowFM .mdu master file
  2. esmf_output - The pathway to the NextGen ESMF Mesh compliant netcdf output file name that the user specifies for the given input DFlowFM "net" mesh netcdf file

Example executing schism_2_esmf.py Script

  • Execute the following command: python schism_2_esmf.py ./hgrid.gr3 ./SCHISM_Gulf_Atlantic_ESMF_Mesh.nc --filter_open_bnds False

schism_2_esmf.py script arguments overview

  1. gr3_input - The pathway to the SCHISM hgrid.gr3 file that is used to describe the mesh domain and is the param.nml master file domain mesh file input for the given SCHISM model setup
  2. esmf_output - The pathway to the NextGen ESMF Mesh compliant netcdf output file name that the user specifies for the given input SCHISM hgrid.gr3 file describing a given domain mesh
  3. --filter_open_bnds: Also filters the open water level boundaries in the SCHISM hgrid.gr3 file and adds them as an ESMF mesh netcdf ouput field for a user to utilize the data wihin a netcdf file configuration