Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #293 NUOPC_CompAttributeIngest failure #316

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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