ESMF_LogFoundAllocError Function

public function ESMF_LogFoundAllocError(statusToCheck, keywordEnforcer, msg, line, file, method, rcToReturn, log)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: statusToCheck
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
character(len=*), intent(in), optional :: msg
integer, intent(in), optional :: line
character(len=*), intent(in), optional :: file
character(len=*), intent(in), optional :: method
integer, intent(inout), optional :: rcToReturn
type(ESMF_Log), intent(inout), optional :: log

Return Value logical


Calls

proc~~esmf_logfoundallocerror~~CallsGraph proc~esmf_logfoundallocerror ESMF_LogFoundAllocError esmf_breakpoint esmf_breakpoint proc~esmf_logfoundallocerror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfoundallocerror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfoundallocerror->proc~esmf_logwrite c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array proc~esmf_logclose->proc~esmf_logflush proc~esmf_logflush->proc~esmf_utiliounitflush proc~esmf_utilarray2string ESMF_UtilArray2String proc~esmf_logflush->proc~esmf_utilarray2string proc~esmf_logopenfile->proc~esmf_utiliounitflush proc~esmf_utiliounitget ESMF_UtilIOUnitGet proc~esmf_logopenfile->proc~esmf_utiliounitget

Called by

BuildUpdatePacketswESMF_LogFoundAllocError
w
compare_redist_arrayw
w
create_arrayw
w
create_distributionw
w
ESMF_ArrayCreateFromGridw
w
ESMF_CompConstructw
w
ESMF_CompGetw
w
ESMF_ConfigCreateDefaultw
w
ESMF_ContainerGarbageGetFLw
w
ESMF_ContainerGarbageGetSILw
w
ESMF_ContainerGetFieldListw
w
ESMF_ContainerGetFieldListAllw
w
ESMF_ContainerGetSILw
w
ESMF_ContainerGetSILAllw
w
ESMF_CplCompCreatew
w
ESMF_FeatureAllocArgw
w
ESMF_FeatureAllocArgStrw
w
ESMF_FieldDeserializew
w
ESMF_GeomCreateGridw
w
ESMF_GeomCreateLocStreamw
w
ESMF_GeomCreateMeshw
w
ESMF_GeomCreateXGridw
w
ESMF_GeomDeserializew
w
ESMF_GridCompCreatew
w
ESMF_GridConvertIndexw
w
ESMF_GridCreate1PeriDimAw
w
ESMF_GridCreate1PeriDimIw
w
ESMF_GridCreate1PeriDimRw
w
ESMF_GridCreate2PeriDimAw
w
ESMF_GridCreate2PeriDimIw
w
ESMF_GridCreate2PeriDimRw
w
ESMF_GridCreateCopyFromNewDGw
w
ESMF_GridCreateCopyFromRegw
w
ESMF_GridCreateDistgridArbw
w
ESMF_GridCreateDistgridIrregw
w
ESMF_GridCreateDistgridRegw
w
ESMF_GridCreateEdgeConnAw
w
ESMF_GridCreateEdgeConnIw
w
ESMF_GridCreateEdgeConnRw
w
ESMF_GridCreateFrmGridw
w
ESMF_GridCreateNoPeriDimAw
w
ESMF_GridCreateNoPeriDimIw
w
ESMF_GridCreateNoPeriDimRw
w
ESMF_GridCreateShapeTileArbw
w
ESMF_GridCreateShapeTileIrregw
w
ESMF_GridCreateShapeTileRegw
w
ESMF_GridEmptyCompleteEConnAw
w
ESMF_GridEmptyCompleteEConnIw
w
ESMF_GridEmptyCompleteEConnRw
w
ESMF_GridGetArrayInfow
w
ESMF_GridSetCmmitShapeTileArbw
w
ESMF_GridSetCmmitShapeTileIrregw
w
ESMF_GridSetCmmitShapeTileRegw
w
ESMF_InterArrayCreateDGConnw
w
ESMF_IO_YAMLContentGetw
w
ESMF_LocStreamAddKeyArrayw
w
ESMF_LocStreamCreateByBkgMeshw
w
ESMF_LocStreamCreateFromDGw
w
ESMF_LocStreamCreateFromLocalw
w
ESMF_LocStreamCreateIrregw
w
ESMF_LocStreamCreatePetListw
w
ESMF_LocStreamDeserializew
w
ESMF_LogErrExw
w
ESMF_LogGetw
w
ESMF_MeshMatchw
w
ESMF_OutputWeightFilew
w
ESMF_PointListCreateFrmLocStreamw
w
ESMF_ReconcileBruteForcew
w
ESMF_ReconcileCompareNeedsw
w
ESMF_ReconcileDeserializew
w
ESMF_ReconcileExchgAttributesw
w
ESMF_ReconcileExchgIDInfow
w
ESMF_ReconcileExchgItemsw
w
ESMF_ReconcileExchgNeedsw
w
ESMF_ReconcileGetStateIDInfow
w
ESMF_ReconcileInitializew
w
ESMF_ReconcileSerializew
w
ESMF_ReconcileSerializeAllw
w
ESMF_SciCompCreatew
w
ESMF_SparseMatcaw
w
ESMF_StateItemConstructw
w
ESMF_XGridConstructw
w
ESMF_XGridConstructBaseObjw
w
ESMF_XGridCreatew
w
ESMF_XGridCreateFromSparseMatw
w
ESMF_XGridDeserializew
w
ESMF_XGridDGw
w
ESMF_XGridDGOverlayw
w
ESMF_XGridDistGridsw
w
ESMF_XGridGeomBaseCreateGridw
w
ESMF_XGridGeomBaseCreateMeshw
w
ESMF_XGridGeomBaseDeserializew
w
ESMFIO_Createw
w
ESMFIO_FieldAccessw
w
f_esmf_xgridgeombasecolgarbagew
w
FieldBundleCplStorew
w
GetIndexSpaceArbw
w
GetIndexSpaceIrregw
w
GetIndexSpaceRegw
w
getUniqueListw
w
IInitCheckw
w
IInitModifyCplListsw
w
InitializeIPDv02p1w
w
InitializeIPDv05p3w
w
InitializeIPDv05p4w
w
InitializeIPDv05p5w
w
InitializeIPDv05p6bw
w
interpret_descriptor_stringw
w
IORead2Dw
w
IOWrite2Dw
w
memory_separatew
w
NUOPC_ConnectorGetw
w
NUOPC_CplCompAttributeEgew
w
NUOPC_CplCompFilterPhaseMapw
w
NUOPC_CplCompSearchPhaseMapw
w
NUOPC_CplCompSearchPhaseMapByIndexw
w
NUOPC_CplCompSetEntryPointw
w
NUOPC_DriverAddCplCompw
w
NUOPC_DriverAddGridCompw
w
NUOPC_DriverAddGridCompSOw
w
NUOPC_DriverGetAllCplCompw
w
NUOPC_DriverGetAllGridCompw
w
NUOPC_FieldDictionaryAddEntryIw
w
NUOPC_FieldDictionaryIngestIw
w
NUOPC_FieldDictionarySetSynoIw
w
NUOPC_FreeFormatAddw
w
NUOPC_FreeFormatCreateDefaultw
w
NUOPC_FreeFormatCreateFDReadYAMLw
w
NUOPC_FreeFormatCreateReadw
w
NUOPC_GetStateMemberListsw
w
NUOPC_GridCompAttributeEgew
w
NUOPC_GridCompFilterPhaseMapw
w
NUOPC_GridCompSearchPhaseMapw
w
NUOPC_GridCompSearchPhaseMapByIndexw
w
NUOPC_GridCompSetEntryPointw
w
NUOPC_GridCompSetIntEntryPointw
w
NUOPC_RealizeTransferw
w
NUOPC_RunElementAddw
w
NUOPC_RunSequenceAddw
w
parse_descriptor_stringw
w
pattern_matchw
w
populate_array_valuew
w
populate_redist_arrayw
w
read_descriptor_filesw
w
read_dist_specificationw
w
read_redistribution_gridw
w
read_regridding_gridw
w
Read_TestHarness_Configw
w
Read_TestHarness_Specifierw
w
SetServicesw
w
SetServicesw
w
SetServicesw
w
Setup1PeriodicConnw
w
Setup2PeriodicConnw
w
SetupTileConnw
w
ShareFieldWithGridw
w
ShareFieldWithMeshw
w
x_comp_read_fieldsw
w
x_comp_realize_fieldw
w

Source Code

      function ESMF_LogFoundAllocError(statusToCheck, keywordEnforcer,  &
                                       msg,line,file, &
                                       method,rcToReturn,log)
!
! !RETURN VALUE:
      logical                                    :: ESMF_LogFoundAllocError
!
! !ARGUMENTS:
!
      integer,          intent(in)              :: statusToCheck
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
      character(len=*), intent(in),    optional :: msg
      integer,          intent(in),    optional :: line
      character(len=*), intent(in),    optional :: file
      character(len=*), intent(in),    optional :: method
      integer,          intent(inout), optional :: rcToReturn
      type(ESMF_Log),   intent(inout), optional :: log

!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
!      This function returns {\tt .true.} when {\tt statusToCheck} indicates
!      an allocation error, otherwise it returns {\tt .false.}.  The status
!      value is typically returned from a Fortran ALLOCATE statement.
!      If an error is indicated, a ESMF memory allocation error message
!      will be written to the {\tt ESMF\_Log} along with a user added {\tt msg},
!      {\tt line}, {\tt file} and {\tt method}.
!
!      The arguments are:
!      \begin{description}
!
!      \item [statusToCheck]
!            Fortran allocation status to check.  Fortran specifies
!            that a status of 0 (zero) indicates success.
!      \item [{[msg]}]
!            User-provided message string.
!      \item [{[line]}]
!            Integer source line number.  Expected to be set by
!            using the preprocessor {\tt \_\_LINE\_\_} macro.
!      \item [{[file]}]
!            User-provided source file name.
!      \item [{[method]}]
!            User-provided method string.
!      \item [{[rcToReturn]}]
!            If specified, when the allocation status indicates an error,
!            set the {\tt rcToReturn} value to {\tt ESMF\_RC\_MEM}.  Otherwise,
!            {\tt rcToReturn} is not modified.
!      \item [{[log]}]
!            An optional {\tt ESMF\_Log} object that can be used instead
!            of the default Log.
!
!      \end{description}
!
!EOP
    character(len=ESMF_MAXSTR)::allocmsg
    integer::msglen
    type(ESMF_LogPrivate), pointer  :: alog

    ESMF_INIT_CHECK_SET_SHALLOW(ESMF_LogGetInit,ESMF_LogInit,log)
    ESMF_LogFoundAllocError=.FALSE.

    nullify(alog) ! ensure that the association status is well defined

    if (present(log)) then
      if (log%logTableIndex > 0) then
         alog => ESMF_LogTable(log%logTableIndex)
      endif
    else
      if (ESMF_LogDefault%logTableIndex > 0) then
        alog => ESMF_LogTable(ESMF_LogDefault%logTableIndex)
      end if
    endif

    if (alog%traceFlag) then
      call ESMF_LogWrite ('called: ' // ESMF_METHOD, ESMF_LOGMSG_TRACE,  &
        line=line, file=file, method=method, log=log)
    end if

!   The Fortran Standard requires that a successful allocate return a stat value
!   of 0.  Any other value indicates a processor-defined error.
    if (statusToCheck .NE. 0) then
        call ESMF_Breakpoint()  ! no-op to assist debugging
        call ESMF_LogRc2Msg (ESMF_RC_MEM_ALLOCATE, allocmsg, msglen)
        if (present(rcToReturn)) then
            rcToReturn=ESMF_RC_MEM_ALLOCATE
        endif
        if (present(msg)) then
          allocmsg = allocmsg(:msglen) // " - " // msg // ' (status = '
          write (allocmsg,'(a,i5,a)') trim (allocmsg), statusToCheck, ')'
          msglen = len_trim (allocmsg)
        end if
        call ESMF_LogWrite(allocmsg(:msglen), ESMF_LOGMSG_ERROR,  &
            line=line, file=file, method=method, log=log)
        ESMF_LogFoundAllocError=.TRUE.
    endif

end function ESMF_LogFoundAllocError