Skip to content

Commit

Permalink
add esmf_logmsg to shr_abort
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jan 23, 2025
1 parent c5e7603 commit 7b94cbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/shr_abort_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ module shr_abort_mod
contains

!===============================================================================
subroutine shr_abort_abort(string,rc)
subroutine shr_abort_abort(string,rc, line, file)
use esmf, only : ESMF_LOGWRITE, ESMF_LOGMSG_ERROR
! Consistent stopping mechanism

!----- arguments -----
character(len=*) , intent(in), optional :: string ! error message string
integer(shr_kind_in), intent(in), optional :: rc ! error code
integer(shr_kind_in), intent(in), optional :: line
character(len=*), intent(in), optional :: file

!----- local -----
logical :: flag
Expand All @@ -58,6 +61,8 @@ subroutine shr_abort_abort(string,rc)

call print_error_to_logs("ERROR", local_string)

call ESMF_LogWrite(local_string, ESMF_LOGMSG_ERROR, line=line, file=file)

call shr_abort_backtrace()

call shr_mpi_initialized(flag)
Expand Down

0 comments on commit 7b94cbc

Please sign in to comment.