dmmgad, dmmgadf — Get DMM array offset of dataset
dmmgad
returns the start address of a
dataset in the Dynamic Memory buffer with respect to a given local
reference address ref
.
dmmgad
is particularly useful if, for some
reason, the global reference address (as specified by
dmmope
) is not available.
dmmgadf
returns the start address of an DMM
array with respect to a given local reference address, preferably a
MCFLOAT64
(i.e real*8
)
reference address.
subroutine dmmgad(ident, iref, ioff) integer*4 ident integer*4 iref MCPTR ioff subroutine dmmgadf(ident, ref, ioff) integer*4 ident real*8 ref MCPTR ioff
ident
Identifier of dataset (input).
iref
Local reference address, counted in number of 4 byte units, i.e integer*4/real*4 words (input).
ref
Local reference address (input).
ioff
Offset (counted in number of array elements) with
respect to iref
or ref
(output). ioff
is counted in number of 4
byte units, i.e integer*4/real*4 words for
dmmgad
and 8 byte units, i.e
integer*8/real*8 words for dmmgadf
. If
ioff
is 0 the dataset does not exist or
the offset cannot be computed.
Allocate an array of integer*4 elements and retrieve the local
offset with respect to a local reference array
iref
. Call a subroutine and fill array.
integer*4 iref(1),status integer*4 ident call dmmall(1000,ident,status) call dmmgad(ident,iref,ioff) if(ioff.eq.0) then print*,'***ERROR Cannot compute ref. address' else call fill(iref(ioff),1000) endif ... subroutine fill(array,n) integer*4 array(*) integer*4 n,i do i=1,n array(i)=i enddo end