Skip to content

Commit

Permalink
Merge pull request #425 from wknoben/hotfix-error-print-read_force
Browse files Browse the repository at this point in the history
Updated read_force.f90 to correctly report netcdf reading error
  • Loading branch information
bartnijssen authored Sep 16, 2020
2 parents ce0cfa9 + 8bcf369 commit cf6177f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/source/engine/read_force.f90
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ subroutine readForcingData(currentJulday,ncId,iFile,iRead,nHRUlocal,time_data,fo
! get index in forcing structure
iVar = forcFileInfo(iFile)%var_ix(iNC)
checkForce(iVar) = .true.

! get variable name for error reporting
err=nf90_inquire_variable(ncid,iNC,name=varName)
if(err/=nf90_noerr)then; message=trim(message)//'problem reading forcing variable name from netCDF: '//trim(nf90_strerror(err)); return; endif

! read forcing data for all HRUs
if(simultaneousRead)then
Expand Down

0 comments on commit cf6177f

Please sign in to comment.