destroy_splpak Subroutine

private subroutine destroy_splpak(me, ndim)

Destroy the internal class variables.

Type Bound

splpak_type

Arguments

Type IntentOptional Attributes Name
class(splpak_type), intent(inout) :: me
integer, intent(in), optional :: ndim

Called by

proc~~destroy_splpak~~CalledByGraph proc~destroy_splpak splpak_module::splpak_type%destroy_splpak proc~splcw splpak_module::splpak_type%splcw proc~splcw->proc~destroy_splpak proc~splcc splpak_module::splpak_type%splcc proc~splcc->proc~splcw

Source Code

    subroutine destroy_splpak(me,ndim)

        class(splpak_type),intent(inout) :: me
        integer,intent(in),optional :: ndim

        if (allocated(me%dx))   deallocate(me%dx)
        if (allocated(me%dxin)) deallocate(me%dxin)
        if (allocated(me%ib))   deallocate(me%ib)
        if (allocated(me%ibmn)) deallocate(me%ibmn)
        if (allocated(me%ibmx)) deallocate(me%ibmx)
        if (present(ndim)) then
            allocate(me%dx  (ndim)); me%dx   = 0.0_wp
            allocate(me%dxin(ndim)); me%dxin = 0.0_wp
            allocate(me%ib  (ndim)); me%ib   = 0
            allocate(me%ibmn(ndim)); me%ibmn = 0
            allocate(me%ibmx(ndim)); me%ibmx = 0
        end if

        me%mdim   = 0
        me%ilast  = 0
        me%isav   = 0
        me%iold   = 0
        me%np1    = 0
        me%l      = 0
        me%il1    = 0
        me%k      = 0
        me%k1     = 0
        me%errsum = 0.0_wp

    end subroutine destroy_splpak