portedportable, not yet portedexecuted, not portableexecutable, not hit by this run
| 1 | ! This file is part of MOM6, the Modular Ocean Model version 6. | |
| 2 | ! See the LICENSE file for licensing information. | |
| 3 | ! SPDX-License-Identifier: Apache-2.0 | |
| 4 | ||
| 5 | !> Routines for error handling and I/O management | |
| 6 | module MOM_error_infra | |
| 7 | ||
| 8 | use mpp_mod, only : mpp_error, mpp_pe, mpp_root_pe, mpp_stdlog=>stdlog, mpp_stdout=>stdout | |
| 9 | use mpp_mod, only : NOTE, WARNING, FATAL | |
| 10 | ||
| 11 | implicit none ; private | |
| 12 | ||
| 13 | public :: MOM_err, is_root_pe, stdlog, stdout | |
| 14 | !> Integer parameters encoding the severity of an error message | |
| 15 | public :: NOTE, WARNING, FATAL | |
| 16 | ||
| 17 | contains | |
| 18 | ||
| 19 | !> MOM_err writes an error message, and may cause the run to stop depending on the | |
| 20 | !! severity of the error. | |
| 21 | 6 | subroutine MOM_err(severity, message) |
| 22 | integer, intent(in) :: severity !< The severity level of this error | |
| 23 | character(len=*), intent(in) :: message !< A message to write out | |
| 24 | ||
| 25 | 6 | call mpp_error(severity, message) |
| 26 | 6 | end subroutine MOM_err |
| 27 | ||
| 28 | !> stdout returns the standard Fortran unit number for output | |
| 29 | 2 | integer function stdout() |
| 30 | 2 | stdout = mpp_stdout() |
| 31 | 2 | end function stdout |
| 32 | ||
| 33 | !> stdlog returns the standard Fortran unit number to use to log messages | |
| 34 | 6 | integer function stdlog() |
| 35 | 6 | stdlog = mpp_stdlog() |
| 36 | 6 | end function stdlog |
| 37 | ||
| 38 | !> is_root_pe returns .true. if the current PE is the root PE. | |
| 39 | 8725 | logical function is_root_pe() |
| 40 | 8725 | is_root_pe = .false. |
| 41 | 8725 | if (mpp_pe() == mpp_root_pe()) is_root_pe = .true. |
| 42 | 8725 | end function is_root_pe |
| 43 | ||
| 44 | end module MOM_error_infra |