Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify Wiki Documentation on Standalone Setup for Forcings File from AWS AORC Data #18

Open
robertbartel opened this issue Oct 10, 2024 · 3 comments

Comments

@robertbartel
Copy link

robertbartel commented Oct 10, 2024

Confirm the steps outlined on this wiki page are correct and complete. In trying to build a containerized version of this, I ran into trouble at a few places.

First, for the ESMF_Mesh_Domain_Configuration_Production/NextGen_hyfab_to_ESMF_Mesh.py file, it looks like dest="hyfab_parquet" needs to be set when adding the -parquet CLI argument. Beyond that, I was able to follow the steps and get the hydrofabric-ESMF-mesh translation steps to work.

I was not able to follow the listed steps and get things to run successfully for running the standalone engine. It's been a week or two, but I believe I first ran into issues with dependencies with Esmpy, ESMF, and/or wgrib2 when trying to use the Conda environment setup as described. In order to attempt to proceed, I had to manually handle building and installing dependencies. I have made process but still not completed this successfully, and regardless, this is likely beyond what at least some of the target audience for the aforementioned wiki page will be comfortable with.

(Note: previous error related to ./GFS_Data path did turn out to be user error on my end; see comment below.)

@jduckerOWP
Copy link
Contributor

@robertbartel

in the wiki pages, were you able to reproduce the following steps?

  1. Copy over the ngen-forcing/NextGen_Forcings_Engine_BMI/BMI_NextGen_Configs/CONUS/AORC/hydrofabric/config.yml file to the ngen-forcing/NextGen_Forcings_Engine_BMI base directory.

  2. Go into the ngen-forcing/NextGen_Forcings_Engine_BMI/config.yml file and edit the following options below:

InputForcingDirectories: ["”]
ScratchDir: “/pathway/to/some/scratch/directory”
Output: 1
RefcstBDateProc: “Start_Date in YYYYMMDDHHMM”
GeogridIn: “/pathway/to/ESMF_Mesh_Hyfab.nc”

Step # 12 speciifcally pointed to a particular AORC config.yml file setup for a NextGen hydrofabric configuration. It sounded like you were just trying to use the default "config.yml" file that was already stored in the ngen-forcing/NextGen_Forcings_Engine_BMI subdirectory which would not be the right config.yml setup for the AORC AWS specs. Can you try to reproduce those two steps and see if this gets you around the issue stated here?

@robertbartel
Copy link
Author

@jduckerOWP, well, turns out the issue with the ./GFS_Data path was indeed user error on my end. config.yaml was in the right directory and had its contents modified as needed, but unfortunately config.yaml is not the same as config.yml. I've modified the issue description to take out that stuff for clarity.

With that fixed, now I see this error, so I'm back to a problem with building/installing dependencies. To be safe, I'll sanity check my assertion that the Conda environment doesn't work, though that part seems harder to have messed without it being obvious.

/usr/local/lib/python3.9/site-packages/esmpy/api/mesh.py:159: UserWarning: coord_sys is only used for meshes created in memory, this argument will be ignored.
  warnings.warn("coord_sys is only used for meshes created in memory, this argument will be ignored.")
Traceback (most recent call last):
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/geoMod.py", line 1048, in initialize_destination_geo_hydrofabric
    self.esmf_grid = ESMF.Mesh(filename=ConfigOptions.geogrid,filetype=ESMF.FileFormat.ESMFMESH,coord_sys=ESMF.CoordSys.SPH_DEG)
  File "/usr/local/lib/python3.9/site-packages/esmpy/util/decorators.py", line 59, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/esmpy/api/mesh.py", line 198, in __init__
    self._struct = ESMP_MeshCreateFromFile(filename, filetype,
  File "/usr/local/lib/python3.9/site-packages/esmpy/util/decorators.py", line 88, in new_func
    raise PIOMissing("This function requires ESMF to have been built with PIO.")
esmpy.util.exceptions.PIOMissing: This function requires ESMF to have been built with PIO.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/run_bmi_model.py", line 176, in <module>
    execute()
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/run_bmi_model.py", line 30, in execute
    model.initialize(bmi_cfg_file_name=str(current_dir.joinpath('config.yml')))
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/bmi_model.py", line 160, in initialize
    raise e
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/bmi_model.py", line 158, in initialize
    self._WrfHydroGeoMeta.initialize_destination_geo_hydrofabric(self._job_meta, self._mpi_meta)
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/geoMod.py", line 1052, in initialize_destination_geo_hydrofabric
    raise Exception
Exception

@robertbartel
Copy link
Author

Confirmed that if I run the conda setup, I get this error (i.e., so I switched to a fully manually build):

Traceback (most recent call last):
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/run_bmi_model.py", line 9, in <module>
    from NextGen_Forcings_Engine.bmi_model import NWMv3_Forcing_Engine_BMI_model
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/__init__.py", line 3, in <module>
    from .bmi_model import NWMv3_Forcing_Engine_BMI_model
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/bmi_model.py", line 30, in <module>
    from .core import config
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/config.py", line 8, in <module>
    from . import time_handling
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/time_handling.py", line 11, in <module>
    from .forcingInputMod import input_forcings
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/forcingInputMod.py", line 10, in <module>
    from . import regrid
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/regrid.py", line 24, in <module>
    from . import ioMod
  File "/ngen-forcing/NextGen_Forcings_Engine_BMI/NextGen_Forcings_Engine/core/ioMod.py", line 21, in <module>
    import pywgrib2_s
ModuleNotFoundError: No module named 'pywgrib2_s'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants