Skip to content

Commit

Permalink
Merge PR #2353 (Cloud-J error handling)
Browse files Browse the repository at this point in the history
This merge brings PR #2353 (Cloud-J error handling, by @lizziel) into
the GEOS-Chem "no-diff-to-benchmark" development stream.

This PR implements robust error handling for Cloud-J (i.e. error code
passed all the way to the main program, for graceful shutdown).
NOTE: Relies on Cloud-J PR #19,

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
  • Loading branch information
yantosca committed Jul 9, 2024
2 parents f78052f + c831dbf commit 5b3987f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [14.4.1] - 2024-06-28
### Added
- Added initialization of PHOTDELTA in `ucx_h2so4phot` to avoid run-time error in CESM
- Added Cloud-J status output and error handling for it

### Changed
- Alphabetically sort Complex SOA species into `geoschem_config.yml` in run directory creation
Expand Down
15 changes: 13 additions & 2 deletions GeosCore/cldj_interface_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ SUBROUTINE INIT_CLOUDJ( Input_Opt, State_Grid, State_Diag, State_Chm, RC )
! FJX_j2j.dat (RD_JS_JX)
CALL Init_CldJ(Input_Opt%amIRoot, Input_Opt%CloudJ_Dir, &
State_Grid%NZ, Input_Opt%Nlevs_Phot_Cloud, &
TITLEJXX, JVN_, NJXX)
TITLEJXX, JVN_, NJXX, RC)
IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered in subroutine Init_Cldj within Cloud-J photolysis'
CALL GC_Error( ErrMsg, RC, ThisLoc )
RETURN
ENDIF

! Store # of photolysis reactions in State_Chm object
State_Chm%Phot%nPhotRxns = NRatJ
Expand Down Expand Up @@ -890,7 +895,7 @@ SUBROUTINE Run_CloudJ( Input_Opt, State_Chm, State_Diag, &
REFFL, REFFI, CLDF, CLDCOR, CLDIW, &
AERSP, NDXAER, L1_, AN_, JVN_, &
VALJXX, SKPERD, SWMSQ, OD18, IRAN, &
NICA, JCOUNT, LDARK, WTQCA )
NICA, JCOUNT, LDARK, WTQCA, RC )

!-----------------------------------------------------------------
! Fill GEOS-Chem array ZPJ with J-values
Expand Down Expand Up @@ -989,6 +994,12 @@ SUBROUTINE Run_CloudJ( Input_Opt, State_Chm, State_Diag, &
ENDDO
!$OMP END PARALLEL DO

IF ( RC /= GC_SUCCESS ) THEN
ErrMsg = 'Error encountered in subroutine Cloud_JX within Cloud-J photolysis'
CALL GC_Error( ErrMsg, RC, ThisLoc )
RETURN
ENDIF

! Reset first-time flag
FIRST=.FALSE.

Expand Down

0 comments on commit 5b3987f

Please sign in to comment.