Deallocate an allocatable array.
Contains fundamental routines to deallocate allocatable arrays of different types and shapes. Does not overload the intrinsic deallocate function.
This way, calling deallocate makes the user aware that checks are being made and errors are handled with a message.
Checks for an error during allocation, and will stop the code if there is one.
Example usage
use variableKind use m_allocate, only: allocate use m_deallocate, only: deallocate ! Could be other intrinsic types too, integer(i32), complex(r32), etc. real(r64),allocatable :: a1D(:), a2D(:,:), a3D(:,:,:) call allocate(a1D, 20) call allocate(a2D, [20,20]) call allocate(a3D, [20,20,20]) write(*,'(a)') 'Shape of a3D is [20,20,20]? '//all(shape(a3D) == [20,20,20]) call deallocate(a1D) call deallocate(a2D) call deallocate(a3D)
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r32), | intent(inout), | allocatable | :: | this(:) | 1D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r32), | intent(inout), | allocatable | :: | this(:,:) | 2D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r32), | intent(inout), | allocatable | :: | this(:,:,:) | 3D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(inout), | allocatable | :: | this(:) | 1D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(inout), | allocatable | :: | this(:,:) | 2D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(inout), | allocatable | :: | this(:,:,:) | 3D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i32), | intent(inout), | allocatable | :: | this(:) | 1D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i32), | intent(inout), | allocatable | :: | this(:,:) | 2D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i32), | intent(inout), | allocatable | :: | this(:,:,:) | 3D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i64), | intent(inout), | allocatable | :: | this(:) | 1D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i64), | intent(inout), | allocatable | :: | this(:,:) | 2D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i64), | intent(inout), | allocatable | :: | this(:,:,:) | 3D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=r32), | intent(inout), | allocatable | :: | this(:) | 1D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=r32), | intent(inout), | allocatable | :: | this(:,:) | 2D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=r32), | intent(inout), | allocatable | :: | this(:,:,:) | 3D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=r64), | intent(inout), | allocatable | :: | this(:) | 1D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=r64), | intent(inout), | allocatable | :: | this(:,:) | 2D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=r64), | intent(inout), | allocatable | :: | this(:,:,:) | 3D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(inout), | allocatable | :: | this(:) | 1D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(inout), | allocatable | :: | this(:,:) | 2D array |
Interfaced with deallocate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(inout), | allocatable | :: | this(:,:,:) | 3D array |