ESMF_RouteHandleCreateFile Function

private function ESMF_RouteHandleCreateFile(fileName, keywordEnforcer, rc)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: fileName
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(out), optional :: rc

Return Value type(ESMF_RouteHandle)


Source Code

  function ESMF_RouteHandleCreateFile(fileName, keywordEnforcer, rc)
!
! !RETURN VALUE:
    type(ESMF_RouteHandle) :: ESMF_RouteHandleCreateFile
!
! !ARGUMENTS:
    character(*),           intent(in)            :: fileName
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    integer,                intent(out), optional :: rc
!
! !DESCRIPTION:
!   Create a new {\tt ESMF\_RouteHandle} object from a file. This method must
!   be called from a VM context that holds exactly as many PETs as were used
!   when generating the file.
!
!   The arguments are:
!   \begin{description}
!   \item[fileName]
!     The name of the RouteHandle file to be read in.
!   \item[{[rc]}]
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer                 :: localrc      ! local return code
    type(ESMF_RouteHandle)  :: rhandle

    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    rhandle%this = ESMF_NULL_POINTER
    ESMF_RouteHandleCreateFile = rhandle

    ! Call C++ create code
    call c_ESMC_RouteHandleCreateFile(rhandle, fileName, localrc)
    if (ESMF_LogFoundError(localrc, &
      ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! Set return values
    ESMF_RouteHandleCreateFile = rhandle

    ! Set init code
    ESMF_INIT_SET_CREATED(ESMF_RouteHandleCreateFile)

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

  end function ESMF_RouteHandleCreateFile