MAPL_DestroyFile Subroutine

public subroutine MAPL_DestroyFile(unit, RC)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
integer, intent(out), optional :: RC

Calls

proc~~mapl_destroyfile~~CallsGraph proc~mapl_destroyfile MAPL_DestroyFile proc~dealloc_ dealloc_ proc~mapl_destroyfile->proc~dealloc_ interface~mapl_assert MAPL_Assert proc~dealloc_->interface~mapl_assert proc~mapl_return MAPL_Return proc~dealloc_->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Called by

proc~~mapl_destroyfile~~CalledByGraph proc~mapl_destroyfile MAPL_DestroyFile proc~mapl_destroystatesave MAPL_DestroyStateSave proc~mapl_destroystatesave->proc~mapl_destroyfile proc~mapl_destroystatesave->proc~mapl_destroystatesave proc~mapl_genericrefresh MAPL_GenericRefresh proc~mapl_genericrefresh->proc~mapl_destroyfile proc~mapl_genericrefresh->proc~mapl_genericrefresh

Source Code

  subroutine MAPL_DestroyFile(unit,  RC )
    IMPLICIT NONE
    integer         , intent(in   )           :: unit
    integer         , intent(  out), OPTIONAL :: RC

    integer :: i,k

!ALT: Currently, this is NOP except for RAM files
    if (unit < 0) then
       ! this is RAM "file", do it!
       i = -unit
       if (associated(mem_units(i)%records)) then
          do k=1,size(mem_units(i)%records)
             call dealloc_(mem_units(i)%records(k))
          end do
          deallocate(mem_units(i)%records)
          nullify(mem_units(i)%records)
       end if
       mtaken(i)  = .false.
       mname(i) = ''
    end if

    if(present(rc)) rc = 0
    return
  end subroutine MAPL_DestroyFile