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

Improve error handling #19

Merged
merged 11 commits into from
Jul 9, 2024
Merged

Improve error handling #19

merged 11 commits into from
Jul 9, 2024

Conversation

lizziel
Copy link
Contributor

@lizziel lizziel commented Jun 27, 2024

Name and Institution (Required)

Name: Lizzie Lundgren
Institution: Harvard University

Describe the update

This PR removes the legacy EXITC subroutine which stops the model upon error and replaces it with new subroutine CLOUDJ_ERROR which prints a message and returns RC flag equal to CLDJ_FAILURE. The RC flag is then passed up the calling stack to the parent model for model-specific error handling.

This PR also includes a few no diff structural improvements, including removing redundant instances of implicit none and using "(:)" when assigning all values of an array a constant value.

This update requires updates in all parent models, including GEOS-Chem.

Expected changes

This is a no diff update.

Reference(s)

None

Related Github Issues and PRs

geoschem/geos-chem#2353 (Merge required at the time as this PR)

@lizziel lizziel changed the base branch from main to dev/7.7.2 June 27, 2024 16:17
@lizziel lizziel self-assigned this Jun 27, 2024
@lizziel lizziel added the enhancement New feature or request label Jun 27, 2024
@lizziel lizziel added this to the 7.7.2 milestone Jun 27, 2024
@lizziel lizziel requested a review from yantosca June 27, 2024 17:01
@lizziel lizziel marked this pull request as ready for review June 27, 2024 17:01
Copy link
Contributor

@yantosca yantosca left a comment

Choose a reason for hiding this comment

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

Thanks @lizziel for this. I've noted that there are a lot of subroutine calls where we do not trap the RC error code. Otherwise the error won't get passed back to the calling routine and won't eventually reach the main program.

src/Core/cldj_fjx_sub_mod.F90 Show resolved Hide resolved
src/Core/cldj_fjx_sub_mod.F90 Show resolved Hide resolved
src/Core/cldj_fjx_sub_mod.F90 Show resolved Hide resolved
src/Core/cldj_init_mod.F90 Show resolved Hide resolved
src/Core/cldj_sub_mod.F90 Show resolved Hide resolved
src/Core/cldj_sub_mod.F90 Outdated Show resolved Hide resolved
src/Interfaces/Standalone/CJ77.F90 Outdated Show resolved Hide resolved
Copy link
Contributor

yantosca commented Jul 9, 2024

Thanks @lizziel!

lizziel added 10 commits July 9, 2024 14:42
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
RC is now passed back to parent model.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Copy link
Contributor

@yantosca yantosca left a comment

Choose a reason for hiding this comment

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

Thanks @lizziel, it's all good now. Feel free to merge into dev/7.7.2.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@lizziel lizziel merged commit 5eabcbe into dev/7.7.2 Jul 9, 2024
2 checks passed
@lizziel
Copy link
Contributor Author

lizziel commented Aug 8, 2024

This PR resulted in a significant slow-down in GEOS-Chem photolysis in 14.4.2. See #23 for the fix which will be included in GEOS-Chem 14.4.3, and released as Cloud-J 7.7.3.

@yantosca yantosca deleted the feature/error_handling branch August 29, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants