subroutine destroy_radfunc(rp) type(radfunc_t) :: rp call delete(rp%grid) if (associated(rp%data)) then deallocate(rp%data) rp%data => null() endif end subroutine destroy_radfunc