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

Add time info to diag file obj #1002

Merged
merged 8 commits into from
Aug 8, 2022

Conversation

uramirez8707
Copy link
Contributor

Description
Adds the timing information to the diag file obj
Modifies the yaml to save the frequencies as an integer instead of strings to make it more efficient
Modifies tests for this change

Fixes # (issue)

How Has This Been Tested?
CI

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

character (len=:), private, allocatable :: file_unlimdim !< The name of the unlimited dimension
type(subRegion_type), private :: file_sub_region !< type containing info about the subregion, if any
integer, private :: file_new_file_freq !< Frequency for closing the existing file
character (len=:), private, allocatable :: file_new_file_freq_units !< Time units for creating a new file.
integer, private :: file_new_file_freq_units !< Time units for creating a new file.
Copy link
Member

Choose a reason for hiding this comment

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

I think I missed this: where does the units get converted to an integer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The units are read to a string buffer and the converter to a integer.

call get_value_from_key(diag_yaml_id, diag_file_id, "new_file_freq", fileobj%file_new_file_freq, is_optional=.true.)
call diag_get_value_from_key(diag_yaml_id, diag_file_id, "new_file_freq_units", buffer, &
is_optional=.true.)
call set_new_file_freq(fileobj, buffer)

fileobj%file_new_file_freq_units = set_valid_time_units(file_new_file_freq_units, &
"new_file_freq_units for file:"//trim(fileobj%file_fname))

@thomas-robinson thomas-robinson merged commit 3528354 into NOAA-GFDL:dmUpdate Aug 8, 2022
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
* adds the time info to the fileobj, modifies the yaml obj to store the time_units as integers instead of strings

* fix a line length issue and fix test, init the new optional integers

* initialize next_open

* return if the start_time is already the base_time

* refactors the code that sets and converts the time_units to integers

* refactors set_valid_time_units
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
* adds the time info to the fileobj, modifies the yaml obj to store the time_units as integers instead of strings

* fix a line length issue and fix test, init the new optional integers

* initialize next_open

* return if the start_time is already the base_time

* refactors the code that sets and converts the time_units to integers

* refactors set_valid_time_units
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 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