ESMF_UtilIOGetCWD Subroutine

public subroutine ESMF_UtilIOGetCWD(pathName, keywordEnforcer, rc)

Arguments

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

Source Code

  subroutine ESMF_UtilIOGetCWD (pathName, keywordEnforcer, rc)
!
! !PARAMETERS:
    character(*), intent(out)           :: pathName
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    integer,      intent(out), optional :: rc
!
! !DESCRIPTION:
!   Call the system-dependent routine to get the current directory from the file
!   system.
!
!     The arguments are:
!     \begin{description}
!     \item[pathName]
!       Name of the current working directory.
!     \item[{[rc]}]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!EOP

    integer :: localrc

    if (present(rc)) rc = ESMF_FAILURE

    call c_esmc_getcwd (pathname, localrc)
    if (ESMF_LogFoundError (localrc, ESMF_ERR_PASSTHRU,  &
        ESMF_CONTEXT, rcToReturn=rc))  &
      return

    if (present (rc)) then
      rc = localrc
    end if

  end subroutine ESMF_UtilIOGetCWD