Skip to content

Commit

Permalink
Fix implementation of error handling in models that use MAPL
Browse files Browse the repository at this point in the history
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
  • Loading branch information
lizziel committed Jun 28, 2024
1 parent bce8992 commit bc0fa37
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Core/cldj_error_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ subroutine CLOUDJ_ERROR_STOP( errmsg, loc )
character(len=*), intent(in) :: loc

character(len=1023) :: msg
#if defined( MAPL_ESMF )
integer :: rc
#endif

! Define message
msg = 'CLOUDJ_ERROR_STOP: '//TRIM(errmsg)//' --> LOCATION: '//TRIM(loc)

! Stop run
#if defined( MAPL_ESMF )
__Iam__(msg)
RC = CLDJ_FAILURE
_ASSERT(RC==CLDJ_SUCCESS,TRIM(msg))
#elif defined( MODEL_CESM )
call endrun(msg)
#elif defined( MODEL_GCCLASSIC )
Expand All @@ -52,7 +56,7 @@ subroutine CLOUDJ_ERROR( errmsg, loc, rc )
#elif MAPL_ESMF
#include "MAPL_Generic.h"
USE ESMF
USE MAPL_Mod
USE MAPLBase_Mod
#endif

CHARACTER(LEN=*), INTENT(IN ) :: errmsg ! Message to display
Expand Down

0 comments on commit bc0fa37

Please sign in to comment.