interface getAxesFromIndices function getAxesFromIndicesDouble(indices, iLbound, iUbound, lEdge, uEdge) result(axes) real(double), intent(in) :: indices(:) integer, intent(in) :: iLbound(size(indices)), iUbound(size(indices)) real(double), intent(in) :: lEdge(size(indices)) real(double), intent(in), optional :: uEdge(size(indices)) real(double) :: axes(size(indices)) ! result end function getAxesFromIndicesDouble function getAxesFromIndicesSingle(indices, iLbound, iUbound, lEdge, uEdge) result(axes) real(single), intent(in) :: indices(:) integer, intent(in) :: iLbound(size(indices)), iUbound(size(indices)) real(single), intent(in) :: lEdge(size(indices)) real(single), intent(in), optional :: uEdge(size(indices)) real(single) :: axes(size(indices)) ! result end function getAxesFromIndicesSingle function getAxesFromIndicesEdgesDouble(indices, aryEdgesInfo) result(axes) real(double), intent(in) :: indices(:) type(AryEdgesInfoT), intent(in) :: aryEdgesInfo real(double) :: axes(size(indices)) ! result end function getAxesFromIndicesEdgesDouble function getAxesFromIndicesEdgesSingle(indices, aryEdgesInfo) result(axes) real(single), intent(in) :: indices(:) type(AryEdgesInfoT), intent(in) :: aryEdgesInfo real(single) :: axes(size(indices)) ! result end function getAxesFromIndicesEdgesSingle end interface
In the arguments, indices(:) are the coordinates in unit of the index of the array of interest. i(L|U)bound(:) are the array of (l|u)bound of the array of interest. (l|u)Edge(:) are the array of the lower/upper bounds in unit of physically meaningful values of the array of interest; e.g.,
lEdge=(0.5,0.5) uEdge=(256.5,256.5)etc.
If uEdge is not given, it is assumed that the width of axes is the same as the size of the array (= abs(iUbound-iLbound) for each axis).
The following is a few examples.