Skip to content

read_attribute_str returns cleanly when found=F#1380

Merged
marshallward merged 2 commits into
mom-ocean:dev/gfdlfrom
mnlevy1981:update_read_attribute
Apr 23, 2021
Merged

read_attribute_str returns cleanly when found=F#1380
marshallward merged 2 commits into
mom-ocean:dev/gfdlfrom
mnlevy1981:update_read_attribute

Conversation

@mnlevy1981
Copy link
Copy Markdown
Contributor

Updates read_attribute_str() so that if the optional argument found is provided
and the attribute is not defined, then the function returns with found=.false.
instead of calling MOM_error(FATAL).

I did a little bit of testing, and it looks like read_attribute_real and
read_attribute_int (not sure if the default is int32 or int64) already behave
correctly when found is present so they do not need a similar update

Fixes #1375

Updates read_attribute_str() so that if the optional argument found is provided
and the attribute is not defined, then the function returns with found=.false.
instead of calling MOM_error(FATAL).

I did a little bit of testing, and it looks like read_attribute_real and
read_attribute_int (not sure if the default is int32 or int64) already behave
correctly when found is present so they do not need a similar update
Copy link
Copy Markdown
Collaborator

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

I have reviewed the logic here, and I am convinced that this is correct and that is should neatly correct the problem noted in issue #1375.

@marshallward
Copy link
Copy Markdown
Collaborator

marshallward commented Apr 23, 2021

@marshallward marshallward merged commit 40f3807 into mom-ocean:dev/gfdl Apr 23, 2021
@mnlevy1981 mnlevy1981 deleted the update_read_attribute branch January 8, 2025 21:03
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.

read_attribute() doesn't behave quite the same as code it replaced in MOM_tracer_Z_init

3 participants