Skip to content

Commit

Permalink
Merge pull request #166 from esmf-org/fix/api-issues
Browse files Browse the repository at this point in the history
Fix a number of API issues noticed during API change table compilation.

Co-authored by: oehmke@ucar.edu
  • Loading branch information
theurich authored Jul 19, 2023
2 parents 6191be3 + 5f626ad commit 7e5eae3
Show file tree
Hide file tree
Showing 4 changed files with 1,910 additions and 1,921 deletions.
208 changes: 104 additions & 104 deletions src/Infrastructure/Config/src/ESMF_Config.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3024,6 +3024,110 @@ subroutine ESMF_ConfigLoadFile_1proc_( config, filename, rc )

end subroutine ESMF_ConfigLoadFile_1proc_

!------------------------------------------------------------------------------
#undef ESMF_METHOD
#define ESMF_METHOD "ESMF_ConfigLog"
!BOP
!
! !IROUTINE: ESMF_ConfigLog - Write content of Config object to log
!
! !INTERFACE:
subroutine ESMF_ConfigLog(config, keywordEnforcer, raw, prefix, logMsgFlag, &
log, rc)

! !ARGUMENTS:
type(ESMF_Config), intent(in) :: config
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
logical, intent(in), optional :: raw
character (len=*), intent(in), optional :: prefix
type(ESMF_LogMsg_Flag), intent(in), optional :: logMsgFlag
type(ESMF_Log), intent(inout), optional :: log
integer, intent(out), optional :: rc
!
!
! !DESCRIPTION:
! Write content of {\tt ESMF\_Config} object to ESMF log.
!
! The arguments are:
! \begin{description}
! \item[config]
! The {\tt ESMF\_Config} object to be logged.
! \item [{[raw]}]
! For {\tt .true.} output the internal buffer as is, for {\tt .false.}
! output in the interpreted format. The default is {\tt .false.}.
! \item [{[prefix]}]
! String to prefix the memory info message. Default is no prefix.
! \item [{[logMsgFlag]}]
! Type of log message generated. See section \ref{const:logmsgflag} for
! a list of valid message types. Default is {\tt ESMF\_LOGMSG\_INFO}.
! \item [{[log]}]
! {\tt ESMF\_Log} object that can be used instead of the default Log.
! Default is to use the default log.
! \item[{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP -------------------------------------------------------------------
integer :: localrc ! local return code
type(ESMF_LogMsg_Flag) :: logMsg
integer :: lbeg, lend
character(240) :: msgString
logical :: rawArg

! initialize return code; assume routine not implemented
localrc = ESMF_RC_NOT_IMPL
if (present(rc)) rc = ESMF_RC_NOT_IMPL

! deal with optionl logMsgFlag
logMsg = ESMF_LOGMSG_INFO ! default
if (present(logMsgFlag)) logMsg = logMsgFlag

write(msgString, "(a)") prefix//&
"--- ESMF_ConfigLog() start -------------------------------------"
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return

rawArg = .false. ! default
if (present(raw)) rawArg = raw

write(msgString, "(a,i8,a,l2,a)") prefix//" nbuf=", config%cptr%nbuf, &
" buffer(raw=", rawArg, "):"
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return

if (rawArg) then
call ESMF_LogWrite(config%cptr%buffer(1:config%cptr%nbuf), logMsg, &
log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
else
lbeg = 2
lend = index_( config % cptr % buffer(lbeg:config % cptr % nbuf), EOL )
do while (lend >= lbeg .and. lend < config % cptr % nbuf)
write(msgString, "(a)") prefix//trim(config % cptr % buffer(lbeg:lend))
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
lbeg = lend + 2
lend = lend + &
index_( config % cptr % buffer(lbeg:config % cptr % nbuf), EOL )
end do
endif

write(msgString, "(a)") prefix//&
"--- ESMF_ConfigLog() end ---------------------------------------"
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return

! return successfully
if (present(rc)) rc = ESMF_SUCCESS

end subroutine ESMF_ConfigLog
!------------------------------------------------------------------------------

!------------------------------------------------------------------------------
#undef ESMF_METHOD
#define ESMF_METHOD "ESMF_ConfigNextLine"
Expand Down Expand Up @@ -3220,110 +3324,6 @@ subroutine ESMF_ConfigParseAttributes( config, unique, rc )

end subroutine ESMF_ConfigParseAttributes

!------------------------------------------------------------------------------
#undef ESMF_METHOD
#define ESMF_METHOD "ESMF_ConfigLog"
!BOP
!
! !IROUTINE: ESMF_ConfigLog - Write content of Config object to log
!
! !INTERFACE:
subroutine ESMF_ConfigLog(config, keywordEnforcer, raw, prefix, logMsgFlag, &
log, rc)

! !ARGUMENTS:
type(ESMF_Config), intent(in) :: config
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
logical, intent(in), optional :: raw
character (len=*), intent(in), optional :: prefix
type(ESMF_LogMsg_Flag), intent(in), optional :: logMsgFlag
type(ESMF_Log), intent(inout), optional :: log
integer, intent(out), optional :: rc
!
!
! !DESCRIPTION:
! Write content of {\tt ESMF\_Config} object to ESMF log.
!
! The arguments are:
! \begin{description}
! \item[config]
! The {\tt ESMF\_Config} object to be logged.
! \item [{[raw]}]
! For {\tt .true.} output the internal buffer as is, for {\tt .false.}
! output in the interpreted format. The default is {\tt .false.}.
! \item [{[prefix]}]
! String to prefix the memory info message. Default is no prefix.
! \item [{[logMsgFlag]}]
! Type of log message generated. See section \ref{const:logmsgflag} for
! a list of valid message types. Default is {\tt ESMF\_LOGMSG\_INFO}.
! \item [{[log]}]
! {\tt ESMF\_Log} object that can be used instead of the default Log.
! Default is to use the default log.
! \item[{[rc]}]
! Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP -------------------------------------------------------------------
integer :: localrc ! local return code
type(ESMF_LogMsg_Flag) :: logMsg
integer :: lbeg, lend
character(240) :: msgString
logical :: rawArg

! initialize return code; assume routine not implemented
localrc = ESMF_RC_NOT_IMPL
if (present(rc)) rc = ESMF_RC_NOT_IMPL

! deal with optionl logMsgFlag
logMsg = ESMF_LOGMSG_INFO ! default
if (present(logMsgFlag)) logMsg = logMsgFlag

write(msgString, "(a)") prefix//&
"--- ESMF_ConfigLog() start -------------------------------------"
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return

rawArg = .false. ! default
if (present(raw)) rawArg = raw

write(msgString, "(a,i8,a,l2,a)") prefix//" nbuf=", config%cptr%nbuf, &
" buffer(raw=", rawArg, "):"
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return

if (rawArg) then
call ESMF_LogWrite(config%cptr%buffer(1:config%cptr%nbuf), logMsg, &
log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
else
lbeg = 2
lend = index_( config % cptr % buffer(lbeg:config % cptr % nbuf), EOL )
do while (lend >= lbeg .and. lend < config % cptr % nbuf)
write(msgString, "(a)") prefix//trim(config % cptr % buffer(lbeg:lend))
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return
lbeg = lend + 2
lend = lend + &
index_( config % cptr % buffer(lbeg:config % cptr % nbuf), EOL )
end do
endif

write(msgString, "(a)") prefix//&
"--- ESMF_ConfigLog() end ---------------------------------------"
call ESMF_LogWrite(msgString, logMsg, log=log, rc=localrc)
if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
ESMF_CONTEXT, rcToReturn=rc)) return

! return successfully
if (present(rc)) rc = ESMF_SUCCESS

end subroutine ESMF_ConfigLog
!------------------------------------------------------------------------------

!------------------------------------------------------------------------------
#undef ESMF_METHOD
#define ESMF_METHOD "ESMF_ConfigPrint"
Expand Down
14 changes: 2 additions & 12 deletions src/Infrastructure/Field/src/ESMF_FieldCreate.cppF90
Original file line number Diff line number Diff line change
Expand Up @@ -441,16 +441,6 @@ type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
character (len=*), intent(in), optional :: name
integer, intent(out), optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \item\apiStatusModifiedSinceVersion{5.2.0r}
! \begin{description}
! \item[8.1.0] Added argument {\tt pinflag} to provide access to DE sharing
! between PETs.
! \end{description}
! \end{itemize}
!
! !DESCRIPTION:
! Create an {\tt ESMF\_Field} and allocate space internally for an
! {\tt ESMF\_Array}. Return a new {\tt ESMF\_Field}. For an example and
Expand Down Expand Up @@ -1426,7 +1416,7 @@ end function ESMF_FieldCreateGBTKR
#define FieldCreateGBDataDoc() \
!---------------------------------------------------------------------------- @\
!BOP @\
! !IROUTINE: ESMF_FieldCreate - Create a Field from Fortran array @\
! !IROUTINE: ESMF_FieldCreate - Create a Field from Geom and Fortran array @\
! @\
! !INTERFACE: @\
! ! Private name; call using ESMF_FieldCreate() @\
Expand Down Expand Up @@ -1601,7 +1591,7 @@ TypeKindRankDeclarationMacro(FieldCreateGBData)
#define FieldCreateGBDataPtrDoc() \
!---------------------------------------------------------------------------- @\
!BOP @\
! !IROUTINE: ESMF_FieldCreate - Create a Field from Fortran array pointer @\
! !IROUTINE: ESMF_FieldCreate - Create a Field from Geom and Fortran array pointer @\
! @\
! !INTERFACE: @\
! ! Private name; call using ESMF_FieldCreate() @\
Expand Down
Loading

0 comments on commit 7e5eae3

Please sign in to comment.