Skip to content

Yaml Parser#858

Merged
rem1776 merged 17 commits into
NOAA-GFDL:mainfrom
uramirez8707:parser
Nov 12, 2021
Merged

Yaml Parser#858
rem1776 merged 17 commits into
NOAA-GFDL:mainfrom
uramirez8707:parser

Conversation

@uramirez8707
Copy link
Copy Markdown
Contributor

Description

  • Adds fortran wrappers to libyaml. All the code is hidden in a -Duse_yaml macro, so users that do not want to use the yaml parser won't have to have libyaml installed
  • Adds unit test to test if the parser is working/crashing as expected (the test script will need be updated to use Test script updates and input tests #800)
  • Adds an option, --with-yaml to autotools that checks that the environment is set up correctly and adds the -Duse_yaml macro to your compilation.
  • Implements the parser to read data_table.yaml and tests this using an ongrid data_override test

To do:

  • Modify the cmake build similarly to the autotools build
  • Add libyaml to github actions containers and add a test with --with-yaml

Fixes # (issue)

How Has This Been Tested?
intel21 and gnu 9.3 on skylake

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
  • make distcheck passes

Comment thread test_fms/parser/data_table.yaml Outdated
Comment on lines +8 to +10
- gridname : "WUT"
fieldname_code : "potato"
fieldname_file : "mullions"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lolz.

yaml_file_id2 = open_and_parse_file("data_table.yaml")
if (yaml_file_id2 .ne. 1) call mpp_error(FATAL, "The yaml_file_id for this file should be 1")

!< -----------------------------------
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the routine comments should be preceded by !> instead of !<

Comment thread parser/yaml_parser.F90 Outdated
Copy link
Copy Markdown
Contributor

@rem1776 rem1776 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, approved this then tried running the tests when I saw it could be merged. The parser test will need to either copy the test yamls or generate them into the build directory, since the test will fail if it's built anywhere but the source .

@rem1776 rem1776 merged commit 90583ae into NOAA-GFDL:main Nov 12, 2021
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.

3 participants