Skip to content

Commit

Permalink
Fix issue #293 NUOPC_CompAttributeIngest failure
Browse files Browse the repository at this point in the history
  • Loading branch information
danrosen25 committed Oct 31, 2024
1 parent d3d6090 commit b5d39e4
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/addon/NUOPC/src/NUOPC_Comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1649,8 +1649,10 @@ subroutine NUOPC_GridCompAttributeIng(comp, freeFormat, addFlag, rc)
character(ESMF_MAXSTR) :: name
integer :: localrc
integer :: stat
integer :: i, lineCount, tokenCount
integer :: i, j
integer :: lineCount, tokenCount
character(len=NUOPC_FreeFormatLen), allocatable :: tokenList(:)
character(len=NUOPC_FreeFormatLen) :: value
logical :: addFlagOpt
logical :: isPresent

Expand Down Expand Up @@ -1687,7 +1689,7 @@ subroutine NUOPC_GridCompAttributeIng(comp, freeFormat, addFlag, rc)
return ! bail out

! process the configuration line
if (tokenCount == 3) then
if (tokenCount >= 3) then
if (trim(tokenList(2)) /= "=") then
call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
msg="Free format Attribute line incorrectly formatted.", &
Expand Down Expand Up @@ -1715,8 +1717,12 @@ subroutine NUOPC_GridCompAttributeIng(comp, freeFormat, addFlag, rc)
return ! bail out
endif
endif
value=tokenList(3)
do j=4, tokenCount
value=trim(value)//" "//tokenList(j)
enddo
call NUOPC_CompAttributeSet(comp, name=trim(tokenList(1)), &
value=trim(tokenList(3)), rc=localrc)
value=trim(value), rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//FILENAME, rcToReturn=rc)) &
return ! bail out
Expand Down Expand Up @@ -1800,8 +1806,10 @@ subroutine NUOPC_CplCompAttributeIng(comp, freeFormat, addFlag, rc)
character(ESMF_MAXSTR) :: name
integer :: localrc
integer :: stat
integer :: i, lineCount, tokenCount
integer :: i, j
integer :: lineCount, tokenCount
character(len=NUOPC_FreeFormatLen), allocatable :: tokenList(:)
character(len=NUOPC_FreeFormatLen) :: value
logical :: addFlagOpt
logical :: isPresent

Expand Down Expand Up @@ -1838,7 +1846,7 @@ subroutine NUOPC_CplCompAttributeIng(comp, freeFormat, addFlag, rc)
return ! bail out

! process the configuration line
if (tokenCount == 3) then
if (tokenCount >= 3) then
if (trim(tokenList(2)) /= "=") then
call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_BAD, &
msg="Free format Attribute line incorrectly formatted.", &
Expand Down Expand Up @@ -1866,8 +1874,12 @@ subroutine NUOPC_CplCompAttributeIng(comp, freeFormat, addFlag, rc)
return ! bail out
endif
endif
value=tokenList(3)
do j=4, tokenCount
value=trim(value)//" "//tokenList(j)
enddo
call NUOPC_CompAttributeSet(comp, name=trim(tokenList(1)), &
value=trim(tokenList(3)), rc=localrc)
value=trim(value), rc=localrc)
if (ESMF_LogFoundError(rcToCheck=localrc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//FILENAME, rcToReturn=rc)) &
return ! bail out
Expand Down

0 comments on commit b5d39e4

Please sign in to comment.