Skip to content

NDSL Issue#64: Use from_yaml_dict instead of from_f90nml in GEOS wrapper#86

Closed
jjuyeonkim wants to merge 2 commits into
NOAA-GFDL:developfrom
jjuyeonkim:20250917_namelist_defaults_fv3_geos
Closed

NDSL Issue#64: Use from_yaml_dict instead of from_f90nml in GEOS wrapper#86
jjuyeonkim wants to merge 2 commits into
NOAA-GFDL:developfrom
jjuyeonkim:20250917_namelist_defaults_fv3_geos

Conversation

@jjuyeonkim

@jjuyeonkim jjuyeonkim commented Sep 19, 2025

Copy link
Copy Markdown
Collaborator

Description
This is part of the Namelist Refactor work, though a bit indirectly related.

Changes include the following:

  • Pulls out the bulk of the the DynamicalCoreConfig.from_yaml functionality into a new from_yaml_dict function.
  • Uses the newly created from_yaml_dict function in the GEOS wrapper instead of usingfrom_f90nml.

Why use from_yaml_dict?
The GEOS wrapper is the one case I found where the YAML structure is used to create a f90nml.Namelist, so I wanted to instead use the from_yaml code to process it instead of the from_f90nml.

The GEOS wrapper is tested in an existing Pace unit test (tests/main/fv3core/test_init_from_geos.py). The test uses a namelist_dict that follows the YAML configuration structure. This namelist_dict is then turned into a f90nml.Namelist and used to initialize a dycore config object.

If I can keep YAML and Namelist processing more distinct, I think this will help make the Namelist refactoring simpler. I can then expect all of the Namelist objects to use a typical Fortran Namelist group structure. I plan to eventually change the ndsl.Namelist to behave much more like the f90nml.Namelist and not have to worry about being able to handle Namelists with either YAML structure or input.nml structure.

Fixes: NOAA-GFDL/NDSL#64 (partially)

How Has This Been Tested?
PyFV3 and PySHiELD translate tests run as expected compared to the develop branch. Pace unit tests also pass as expected.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • Targeted model if this changed was triggered by a model need/shortcoming

@jjuyeonkim jjuyeonkim added bug Something isn't working and removed bug Something isn't working labels Sep 19, 2025
@jjuyeonkim jjuyeonkim marked this pull request as ready for review September 19, 2025 21:13
@jjuyeonkim

Copy link
Copy Markdown
Collaborator Author

We had a meeting, and I'm not sure if this is still relevant. Closing for now.

@jjuyeonkim jjuyeonkim closed this Sep 25, 2025
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

Successfully merging this pull request may close these issues.

NDSL should provide a framweork for physics namelists instead of specifying the namlist members and default values for specific physics models

2 participants