ESMF_GridSetDestroyDistgrid Subroutine

private subroutine ESMF_GridSetDestroyDistgrid(grid, destroy, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Grid), intent(in) :: grid
logical, intent(in) :: destroy
integer, intent(out), optional :: rc

Source Code

  subroutine ESMF_GridSetDestroyDistgrid(grid,destroy, rc)
!
! !ARGUMENTS:
    type(ESMF_Grid), intent(in)              :: grid
    logical,         intent(in)              :: destroy
    integer,         intent(out),  optional  :: rc
!
!
! !DESCRIPTION:
!
!EOPI
!------------------------------------------------------------------------------
    integer                 :: localrc      ! local return code
    integer :: destroyInt

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

    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP(ESMF_GridGetInit, grid, rc)

    ! set int from logical
    if (destroy) then
       destroyInt=1
    else
       destroyInt=0
    endif

    ! Call into the C++ interface, which will sort out optional arguments.
    call c_esmc_gridsetdestroydistgrid(grid, destroyInt);

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

  end subroutine  ESMF_GridSetDestroyDistgrid