ESMF_CFIODestroy
– destructor for a CFIO object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_CFIO), | intent(inout) | :: | cfio | |||
integer, | intent(out), | optional | :: | rc |
subroutine ESMF_CFIODestroy (cfio, rc) ! ! !INPUT PARAMETERS: ! integer, intent(out), OPTIONAL :: rc ! Error return code: ! 0 all is well ! ! !INPUT/OUTPUT PARAMETERS: ! type(ESMF_CFIO), intent(inout) :: cfio ! CFIO object ! !------------------------------------------------------------------------------ integer :: rtcode integer :: i if ( cfio%isOpen ) call CFIO_Close(cfio%fid, rtcode) if ( associated(cfio%varObjs) ) then do i = 1, size(cfio%varObjs) call ESMF_CFIOVarInfoDestroy (cfio%varObjs(i), rtcode) end do deallocate(cfio%varObjs, stat=rtcode) end if if ( associated(cfio%grids) ) then if (cfio%isGridSet) then do i = 1, size(cfio%grids) call ESMF_CFIOGridDestroy (cfio%grids(i), rtcode) end do end if deallocate(cfio%grids, stat=rtcode) end if if (associated(cfio%attCharCnts)) deallocate(cfio%attCharCnts, & stat=rtcode) if (associated(cfio%attRealCnts)) deallocate(cfio%attRealCnts, & stat=rtcode) if (associated(cfio%attIntCnts)) deallocate(cfio%attIntCnts, & stat=rtcode) if (associated(cfio%attCharNames)) deallocate(cfio%attCharNames, & stat=rtcode) if (associated(cfio%attRealNames)) deallocate(cfio%attRealNames, & stat=rtcode) if (associated(cfio%attIntNames)) deallocate(cfio%attIntNames, & stat=rtcode) if (associated(cfio%attChars)) deallocate(cfio%attChars, stat=rtcode) if (associated(cfio%attReals)) deallocate(cfio%attReals, stat=rtcode) if (associated(cfio%attInts)) deallocate(cfio%attInts, stat=rtcode) if (associated(cfio%iList)) deallocate(cfio%iList, stat=rtcode) if (associated(cfio%rList)) deallocate(cfio%rList, stat=rtcode) if (associated(cfio%cList)) deallocate(cfio%cList, stat=rtcode) rtcode = 0 if ( present(rc) ) rc = rtcode end subroutine ESMF_CFIODestroy