source: (OptionalArray.module.f90) [ c_92_rp1 release ]
This module provides the Optional Array type and the functions to create and destroy them
With Fortran-95 we initialize all optional array pointers to NULL(), so the %allocated property is no longer necessary.
CREATE_OPTIONAL_ARRAY is overloaded with the 1,2 and 3-d versions.
CREATE_OPTIONAL_ARRAY allocates an array of the requested size, initializes that array to IEEE NaN, and sets the allocated property to true. If the wanted argument is passed the wanted property of the object will be set to reflect this.
Although CREATE_OPTIONAL_ARRAY is overloaded, we make the individual components public as well, because it is probably more obvious what we are doing if we use an explicitly numbered interface:
seems clearer than
call CREATE_OPTIONAL_ARRAY3( im,jm,km, g, A ) call CREATE_OPTIONAL_ARRAY2( im,jm, g, A )
but this is a matter of taste.
call CREATE_OPTIONAL_ARRAY( im,jm,km, g, A ) call CREATE_OPTIONAL_ARRAY( im,jm, g, A )
DESTROY_OPTIONAL_ARRAY is probably more useful as overloaded.