diff --git a/sat_vapor_pres/include/sat_vapor_pres.inc b/sat_vapor_pres/include/sat_vapor_pres.inc index 4412fe28b..8609391e8 100644 --- a/sat_vapor_pres/include/sat_vapor_pres.inc +++ b/sat_vapor_pres/include/sat_vapor_pres.inc @@ -1901,7 +1901,8 @@ subroutine SHOW_ALL_BAD_1D_ ( temp ) real(kind=FMS_SVP_KIND_) , intent(in) :: temp(:) !< temperature in degrees Kelvin (K) - integer :: i, ind, iunit + integer :: i, ind + character(len=256) :: output_msg !> DTINV, TMIN, TEPS are module level variables declared in r8_kind !! Thus they need to be converted to FMS_SVP_KIND_ real(FMS_SVP_KIND_) :: dtinvll !< local version of module variable dtinvl @@ -1912,11 +1913,11 @@ tminll=real(tmin,FMS_SVP_KIND_) tepsll=real(teps,FMS_SVP_KIND_) - iunit = stdoutunit do i=1,size(temp) ind = int( dtinvll*(temp(i)-tminll+tepsll) ) if (ind < 0 .or. ind > nlim) then - write(iunit,'(a,e10.3,a,i4,a,i6)') 'Bad temperature=',temp(i),' at i=',i,' pe=',mpp_pe() + write(output_msg,'(a,e10.3,a,i4)') 'Bad temperature=',temp(i),' at i=',i + call mpp_error(WARNING, output_msg) endif enddo diff --git a/sat_vapor_pres/sat_vapor_pres.F90 b/sat_vapor_pres/sat_vapor_pres.F90 index 727d2381b..93310f97c 100644 --- a/sat_vapor_pres/sat_vapor_pres.F90 +++ b/sat_vapor_pres/sat_vapor_pres.F90 @@ -180,7 +180,7 @@ module sat_vapor_pres_mod use constants_mod, only: TFREEZE, RDGAS, RVGAS, HLV, ES0 use fms_mod, only: write_version_number, stdout, stdlog, mpp_pe, mpp_root_pe, & - mpp_error, FATAL, fms_error_handler, & + mpp_error, FATAL, WARNING, fms_error_handler, & error_mesg, check_nml_error use mpp_mod, only: input_nml_file use sat_vapor_pres_k_mod, only: sat_vapor_pres_init_k, lookup_es_k, &