Skip to content

Commit

Permalink
change sat_vapor_pres warning output to use mpp_error
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored and rem1776 committed Dec 2, 2024
1 parent 95cd7b0 commit a9225ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions sat_vapor_pres/include/sat_vapor_pres.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sat_vapor_pres/sat_vapor_pres.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, &
Expand Down

0 comments on commit a9225ae

Please sign in to comment.