Skip to content

Commit

Permalink
Correctly handle and diagnose the case where ESMF_NOKIND is returned
Browse files Browse the repository at this point in the history
from ESMF_InfoGetTK().
  • Loading branch information
theurich committed Jul 6, 2023
1 parent 136ba02 commit c00c155
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/addon/NUOPC/src/NUOPC_Comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,11 @@ subroutine NUOPC_GridCompAttributeGet(comp, name, value, isPresent, isSet, rc)
rcToReturn=rc)) &
return ! bail out
write(value,*) valueR8
else if (tk==ESMF_NOKIND) then
call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
msg="Unable to retrieve value. Either invalid name or value not set.", &
line=__LINE__, file=FILENAME, rcToReturn=rc)
return
else
call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
msg="Unsupported typekind", &
Expand Down Expand Up @@ -842,6 +847,11 @@ subroutine NUOPC_CplCompAttributeGet(comp, name, value, isPresent, isSet, rc)
rcToReturn=rc)) &
return ! bail out
write(value,*) valueR8
else if (tk==ESMF_NOKIND) then
call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
msg="Unable to retrieve value. Either invalid name or value not set.", &
line=__LINE__, file=FILENAME, rcToReturn=rc)
return
else
call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
msg="Unsupported typekind", &
Expand Down

0 comments on commit c00c155

Please sign in to comment.