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

update yaml parser to read in arrays and output them #1576

Closed
wants to merge 4 commits into from

Conversation

rem1776
Copy link
Contributor

@rem1776 rem1776 commented Aug 20, 2024

Description
Updates the yaml parser to be able to read in arrays as the base date for the new diag yaml format. It just converts any yaml format arrays to a space-separated string at the read in time, so the old format will still work as well.

Also makes updates to be able to output them when writing the output yaml file. Right now it only checks if the second value in a yaml block is an array (since thats where the base date will be) but if preferable I can add the check for every value written.

How Has This Been Tested?
gcc and oneapi on the amd box

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

@rem1776 rem1776 marked this pull request as ready for review August 20, 2024 16:50
Copy link
Contributor

@bensonr bensonr left a comment

Choose a reason for hiding this comment

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

These may all be meaningless as I didn't take the time to understand the existing and new parsing of the basedate.

@@ -43,14 +43,14 @@ diag_files:
### 2.1 Global Section
The diag_yaml requires “title” and the “baseDate”.
- The **title** is a string that labels the diag yaml. The equivalent in the legacy diag_table would be the experiment. It is recommended that each diag_yaml have a separate title label that is descriptive of the experiment that is using it.
- The **basedate** is an array of 6 integers indicating the base_date in the format [year month day hour minute second].
- The **basedate** is an array of 6 integers indicating the base_date in the format [year, month, day, hour, minute, second].
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to make it clear that it is a comma-separated array to help contrast from the original space-separated format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes good idea, added that with c496f38, along with a note that spacing is not significant.

That commit also updates the rest of the test scripts to use the new base date format since they were missed originally.

diag_manager/fms_diag_yaml.F90 Show resolved Hide resolved
@rem1776
Copy link
Contributor Author

rem1776 commented Aug 22, 2024

closing, yaml schema changes were reverted. We're just going to go with the old format for base_date

@rem1776 rem1776 closed this Aug 22, 2024
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.

2 participants