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

Modern diag manager: check if field is registered #1151

Merged
merged 6 commits into from
Mar 29, 2023

Conversation

uramirez8707
Copy link
Contributor

Description
Adds a function to the file_object to check if a field in the file object was registered
Updates send_diag_complete to skip fields that were not registered

This was causing out of bounds issues when a variable was not registered since file_field_ids(ifield) will be -1 so
it will try to do

 diag_field => this%FMS_diag_fields(-1)

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

@@ -255,6 +256,15 @@ logical function fms_diag_files_object_init (files_array)
endif
end function fms_diag_files_object_init

!< @brief Determine if the field corresponding to the field_id was registered to the file
!! @return .True. if the field was registed to the file
logical function is_field_registered(this, field_id)
Copy link
Member

Choose a reason for hiding this comment

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

Make this pure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thomas-robinson thomas-robinson merged commit cd26058 into NOAA-GFDL:dmUpdate Mar 29, 2023
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
* add a subroutine to check if a field in the file object was registered and uses it to skip fields that were not registered
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
* add a subroutine to check if a field in the file object was registered and uses it to skip fields that were not registered
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