Skip to content

Commit

Permalink
update error messages to show line number for easier debugging
Browse files Browse the repository at this point in the history
following the updates from ww3_prnc
  • Loading branch information
JessicaMeixner-NOAA committed Apr 18, 2024
1 parent a8741f3 commit 2e7105f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions model/src/w3iopomd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
!>

#include "w3macros.h"
#define CHECK_ERR(I) CHECK_ERROR(I, __LINE__)
#define nf90_err(errcode) nf90_err(errcode, __LINE__)
#define nf90_err(ncerr) nf90_err_check(ncerr, __LINE__)
!/ ------------------------------------------------------------------- /
!>
!> @brief Process point output.
Expand Down Expand Up @@ -1125,21 +1124,21 @@ END SUBROUTINE W3IOPE
!>
!> @author Edward Hartnett @date 1-Nov-2023
!>
integer function nf90_err(errcode, ILINE)
integer function nf90_err_check(errcode, ILINE)
use netcdf
USE W3ODATMD, ONLY: NDSE
implicit none
integer, intent(in) :: errcode
integer, intent(in) :: errcode, ILINE

nf90_err = errcode
nf90_err_check = errcode
if(errcode /= nf90_noerr) then
WRITE(NDSE,*) ' *** WAVEWATCH III ERROR IN W3IOPO :'
WRITE(NDSE,*) ' LINE NUMBER ', ILINE
WRITE(NDSE,*) ' NETCDF ERROR MESSAGE: '
WRITE(NDSE,*) 'Error: ', trim(nf90_strerror(errcode))
return
endif
end function nf90_err
end function nf90_err_check


!> Read point output in netCDF format.
Expand Down

0 comments on commit 2e7105f

Please sign in to comment.