Skip to main content

Intvector example 1

Testing and showing usage of methods defined in [[IntVector_#Constructor-methods]]

Modules and classes

  • [[IntVector_]]

Usage

PROGRAM main
USE easifemBase
TYPE(IntVector_) :: obj

!!! note "" Initiate an instance of [[IntVector_]] by specifying size.

CALL ALLOCATE(obj=obj, dims=10)

!!! note "" Let us check if obj is initiated or not.

CALL OK(IsAllocated(obj), "IsAllocated(obj)")

Alternatively, we can use the method called isInitiated

CALL OK(IsInitiated(obj), "IsInitiated(obj)")

!!! note "" Size of the [[IntVector_]]

CALL OK( SIZE(obj) .EQ. 10, "SIZE(obj)")

!!! note "" Shape of the [[IntVector_]]

CALL OK( ALL(SHAPE(obj) .EQ. [10]), "SHAPE(obj)")

!!! note "" GetTotalDimension of the [[IntVector_]]

CALL OK( GetTotalDimension(obj) .EQ. 1, "GetTotalDimension(obj)")

!!! settings "" Cleanup.

CALL DEALLOCATE(obj)
END PROGRAM main