Skip to content

Modern diag_manager: Add standard_name and coordinates attributes + minor bug fixes#1176

Merged
thomas-robinson merged 4 commits into
NOAA-GFDL:dmUpdatefrom
uramirez8707:more_updates
Apr 25, 2023
Merged

Modern diag_manager: Add standard_name and coordinates attributes + minor bug fixes#1176
thomas-robinson merged 4 commits into
NOAA-GFDL:dmUpdatefrom
uramirez8707:more_updates

Conversation

@uramirez8707
Copy link
Copy Markdown
Contributor

Description

  • Adds code to write the standard_name and coordinates (this is used for field in the unstructured grid) attributes for field
  • Makes the code that searches for a field in the diag_table.yaml case insensitive (to reproduce old behavior)
  • Fixes a issue with gnu where the character length of a string argument was set to 128 so there was extra junk added to the string causing weird crashes

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

@uramirez8707 uramirez8707 changed the title More updates Modern diag_manager: Add standard_name and coordinates attributes + minor bug fixes Apr 3, 2023
!> Save the file name in the file_list
file_list%file_name(file_count) = trim(diag_yaml%diag_files(file_count)%file_fname)//c_null_char
!! The diag_table is not case sensitive (so we are saving it as lowercase)
file_list%file_name(file_count) = lowercase(trim(diag_yaml%diag_files(file_count)%file_fname)//c_null_char)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why would we impose this? Why can't users have capital letters in the file names?

variable_list%var_name(var_count) = trim(diag_yaml%diag_fields(var_count)%var_varname)//&
":"//trim(diag_yaml%diag_fields(var_count)%var_module)//c_null_char
!! The diag_table is not case sensitive (so we are saving it as lowercase)
variable_list%var_name(var_count) = lowercase(variable_list%var_name(var_count))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why can't users have a capital letter for the var name? I always think of temperature as T and time as t

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They can have capital letters.

This is for when we are searching for the variable name in the diag_table.yaml. The old diag manager was not case sensitive. So in the register_diag_field call the variable name could be "Temperature", and in the diag_table.yaml "TEMPERATURE" or whatever. Without this the code won't be able to find the variable because "Temperature" != "TEMPERATURE"

The variable_list is the sorted list of variables, in the diag_yaml it saved at whatever is in the diag_table.yaml


indices = fms_find_my_string(variable_list%var_pointer, size(variable_list%var_pointer), &
& trim(diag_field_name)//":"//trim(module_name)//c_null_char)
& lowercase(trim(diag_field_name))//":"//lowercase(trim(module_name)//c_null_char))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one I actually agree with because the actual modules are all lower case (i think)

@thomas-robinson thomas-robinson merged commit 035fff2 into NOAA-GFDL:dmUpdate Apr 25, 2023
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
…inor bug fixes (NOAA-GFDL#1176)

* make diag_table search not case sensitive

* Fix possible string issue in get_time_string

* write the coordinate and standard name attribute to the field
rem1776 pushed a commit to rem1776/FMS that referenced this pull request May 1, 2024
…inor bug fixes (NOAA-GFDL#1176)

* make diag_table search not case sensitive

* Fix possible string issue in get_time_string

* write the coordinate and standard name attribute to the field
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