The subroutine MAPL_CFIODestroy
destroys a MAPL CFIO object. It closes any file associated with
it and deallocates memory.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MAPL_CFIO), | intent(inout) | :: | MCFIO | |||
integer, | intent(out), | optional | :: | RC |
subroutine MAPL_CFIODestroy( MCFIO, RC ) ! type(MAPL_CFIO), intent(INOUT) :: MCFIO integer, optional, intent( OUT) :: RC ! integer :: status if(associated(MCFIO%Krank )) deallocate(MCFIO%Krank ) if(associated(MCFIO%reqs )) deallocate(MCFIO%reqs ) if(associated(MCFIO%varname )) deallocate(MCFIO%varname ) if(associated(MCFIO%vardims )) deallocate(MCFIO%vardims ) if(associated(MCFIO%Levs )) deallocate(MCFIO%Levs ) if(associated(MCFIO%vartype )) deallocate(MCFIO%vartype ) if(associated(MCFIO%needvar )) deallocate(MCFIO%needvar ) if(associated(MCFIO%pairList )) deallocate(MCFIO%pairList ) if(associated(MCFIO%buffer )) deallocate(MCFIO%buffer ) if(associated(MCFIO%varid )) deallocate(MCFIO%varid ) nullify(MCFIO%Krank ) nullify(MCFIO%reqs ) nullify(MCFIO%varname ) nullify(MCFIO%vardims ) nullify(MCFIO%Levs ) nullify(MCFIO%varid ) nullify(MCFIO%buffer ) if (MCFIO%Root > 0) then if (MCFIO%myPE == mCFIO%RootRank) then call ESMF_CFIOFileClose(MCFIO%CFIO,rc=status) _VERIFY(STATUS) end if end if call ESMF_CFIODestroy(MCFIO%CFIO,rc=status) _VERIFY(STATUS) MCFIO%created = .false. _RETURN(ESMF_SUCCESS) end subroutine MAPL_CFIODestroy