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

read_attribute_str returns cleanly when found=F #1380

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

mnlevy1981
Copy link
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
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
Collaborator

marshallward commented Apr 23, 2021

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