-
Notifications
You must be signed in to change notification settings - Fork 14
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 errmsg to check_allocate abort message #311
Add errmsg to check_allocate abort message #311
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this feature @jimmielin! I did have one (optional) request, which is to change the beginning of the full check_allocate
error message from Allocate of <varname>
to Allocation of <varname>
, as I realized that is probably more grammatically correct. Of course don't feel like you have to if it will hold up this PR. Thanks again!
Thanks @nusbaume! Updated to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small thing but it doesn't hold up my approval! thanks @jimmielin
@@ -122,6 +122,7 @@ subroutine tropopause_climo_read_file() | |||
real(kind_phys), parameter :: d2r=pi/180._kind_phys, zero=0._kind_phys, twopi=pi*2._kind_phys | |||
character(len=shr_kind_cl) :: locfn | |||
character(len=shr_kind_cm) :: errmsg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to change this errmsg to "shr_kind_cl" as well to match the other error messages? It's probably unlikely to be too short, but would be consistent with the other usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated!
Regression tests passed subject to existing failures
|
Fixes #297
Following up from the
tropopause_find
PR I've updatedcheck_allocate
to take inerrmsg
and updated the tropopause_climo_read to use it and other places within SIMA. I did not update all instances of check_allocate, particularly those in dynamics and in cpl/nuopc as I was not sure if they were brought in externally or not.If the optional
errmsg
argument is present a linebreak is added to the end of the abort message using thenew_line
intrinsic (Fortran 2003). Sinceerrmsg
inallocate
is a F2003 feature I think this is safe to use? It can otherwise be removed, it's just used to make the output prettier.This is what it looks like:
or an actual example made possible by a duplicate allocation...