-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add errmsg to check_allocate abort message (#311)
Fixes #297 Following up from the `tropopause_find` PR I've updated `check_allocate` to take in `errmsg` 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 the `new_line` intrinsic ([Fortran 2003](https://gcc.gnu.org/onlinedocs/gfortran/intrinsic-procedures/newline.html)). Since `errmsg` in `allocate` 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: ``` ERROR: cam_thermo_init: Allocate of 'test(test)' failed with code 1. Memory highwater is 641.32 mb, current memory usage is 42.41 mb Allocation failed with: Hello world this is not really a failure but just a test at /somewhere/CAM-SIMA/src/data/cam_thermo.F90:203 ``` or an actual example made possible by a duplicate allocation... ``` ERROR: cam_thermo_init: Allocate of 'kmcnd(pcols,pverp)--2test' failed with code 5014. Memory highwater is 641.35 mb, current memory usage is 43.08 mb Allocation failed with: Attempt to allocate an allocated object at /somewhere/CAM-SIMA/src/data/cam_thermo.F90:207 ```
- Loading branch information
Showing
5 changed files
with
59 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters