MODULE Vector_Operations USE Precision USE Error_Handling USE System_Monitors IMPLICIT NONE PUBLIC::VectorShift,VectorScale,VectorExponentiate,& VectorAddition,VectorSubtraction,VectorMultiplication,VectorDivision,& VectorCopy,VectorPermute,VectorPointerCopy,SubarrayPointer,& VectorAdditionCopy,VectorSubtractionCopy,VectorAXPBY,VectorAXMBY PRIVATE INTERFACE VectorPointerCopy MODULE PROCEDURE PointerCopy_r_sp_target_r_dp,PointerCopy_r_dp_target_r_sp MODULE PROCEDURE PointerAssign_r_sp,PointerAssign_r_dp MODULE PROCEDURE PointerCopy_i_sp_target_i_dp,PointerCopy_i_dp_target_i_sp MODULE PROCEDURE PointerAssign_i_sp,PointerAssign_i_dp END INTERFACE INTERFACE VectorPermute MODULE PROCEDURE VectorCopyPermute_r_sp_r_sp,VectorCopyPermute_r_dp_r_dp MODULE PROCEDURE VectorCopyPermute_r_sp_r_dp,VectorCopyPermute_r_dp_r_sp MODULE PROCEDURE VectorPermute_r_sp,VectorPermute_r_dp MODULE PROCEDURE VectorCopyPermute_i_sp_i_sp,VectorCopyPermute_i_dp_i_dp MODULE PROCEDURE VectorCopyPermute_i_sp_i_dp,VectorCopyPermute_i_dp_i_sp MODULE PROCEDURE VectorPermute_i_sp,VectorPermute_i_dp END INTERFACE INTERFACE SubarrayPointer MODULE PROCEDURE SubarrayPointer_i_sp,SubarrayPointer_i_dp MODULE PROCEDURE SubarrayPointer_r_sp,SubarrayPointer_r_dp MODULE PROCEDURE SubarrayPointer_l_word,SubarrayPointer_l_short MODULE PROCEDURE SubarrayPointer2D_i_sp,SubarrayPointer2D_i_dp MODULE PROCEDURE SubarrayPointer2D_r_sp,SubarrayPointer2D_r_dp MODULE PROCEDURE SubarrayPointer2D_l_word,SubarrayPointer2D_l_short END INTERFACE CONTAINS PURE SUBROUTINE VectorShift(vector,shift) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::vector REAL(KIND=r_wp),INTENT(IN)::shift vector=vector+shift END SUBROUTINE VectorShift PURE SUBROUTINE VectorScale(vector,factor) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::vector REAL(KIND=r_wp),INTENT(IN)::factor vector=factor*vector END SUBROUTINE VectorScale PURE SUBROUTINE VectorExponentiate(vector,exponent) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::vector REAL(KIND=r_wp),INTENT(IN),OPTIONAL::exponent IF(.NOT.PRESENT(exponent))THEN vector=1.0_r_wp/(vector+EPSILON(1.0_r_wp)) ELSE IF(exponent<0.0_r_wp)THEN vector=(vector+EPSILON(1.0_r_wp))**exponent ELSE vector=vector**exponent END IF END IF END SUBROUTINE VectorExponentiate PURE SUBROUTINE VectorAddition(first,second,sum) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::first REAL(KIND=r_wp),DIMENSION(:),INTENT(IN)::second REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::sum IF(PRESENT(sum))THEN sum=first+second ELSE first=first+second END IF END SUBROUTINE VectorAddition PURE SUBROUTINE VectorSubtraction(from,what,difference,reverse) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::from,what REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::difference LOGICAL,INTENT(IN),OPTIONAL::reverse LOGICAL::invert invert=.FALSE. IF(PRESENT(reverse))invert=reverse IF(PRESENT(difference))THEN difference=from-what ELSE IF(invert)THEN what=from-what ELSE from=from-what END IF END IF END SUBROUTINE VectorSubtraction PURE SUBROUTINE VectorAdditionCopy(first,second,sum) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::first,second REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::sum REAL(KIND=r_wp)::temp INTEGER(KIND=i_wp)::index IF(PRESENT(sum))THEN DO index=INT(LBOUND(first,DIM=1),KIND=i_wp),INT(UBOUND(first,DIM=1),KIND=i_wp) sum(index)=first(index)+second(index) second(index)=first(index) END DO ELSE DO index=INT(LBOUND(first,DIM=1),KIND=i_wp),INT(UBOUND(first,DIM=1),KIND=i_wp) temp=first(index) first(index)=first(index)+second(index) second(index)=temp END DO END IF END SUBROUTINE VectorAdditionCopy PURE SUBROUTINE VectorSubtractionCopy(from,what,difference,reverse) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::from,what REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::difference LOGICAL,INTENT(IN),OPTIONAL::reverse REAL(KIND=r_wp)::temp INTEGER(KIND=i_wp)::index LOGICAL::invert invert=.FALSE. IF(PRESENT(reverse))invert=reverse IF(PRESENT(difference))THEN IF(invert)THEN DO index=INT(LBOUND(from,DIM=1),KIND=i_wp),INT(UBOUND(from,DIM=1),KIND=i_wp) difference(index)=from(index)-what(index) from(index)=what(index) END DO ELSE DO index=INT(LBOUND(from,DIM=1),KIND=i_wp),INT(UBOUND(from,DIM=1),KIND=i_wp) difference(index)=from(index)-what(index) what(index)=from(index) END DO END IF ELSE IF(invert)THEN DO index=INT(LBOUND(from,DIM=1),KIND=i_wp),INT(UBOUND(from,DIM=1),KIND=i_wp) temp=what(index) what(index)=from(index)-what(index) from(index)=temp END DO ELSE DO index=INT(LBOUND(from,DIM=1),KIND=i_wp),INT(UBOUND(from,DIM=1),KIND=i_wp) temp=from(index) from(index)=from(index)-what(index) what(index)=temp END DO END IF END IF END SUBROUTINE VectorSubtractionCopy PURE SUBROUTINE VectorMultiplication(first,second,product) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::first REAL(KIND=r_wp),DIMENSION(:),INTENT(IN)::second REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::product IF(PRESENT(product))THEN product=first*second ELSE first=first*second END IF END SUBROUTINE VectorMultiplication PURE SUBROUTINE VectorDivision(numerator,denominator,ratio,reverse) REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::numerator,denominator REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::ratio LOGICAL,INTENT(IN),OPTIONAL::reverse LOGICAL::invert invert=.FALSE. IF(PRESENT(reverse))invert=reverse IF(PRESENT(ratio))THEN ratio=numerator/(denominator+EPSILON(1.0_r_wp)) ELSE IF(invert)THEN denominator=numerator/(denominator+EPSILON(1.0_r_wp)) ELSE numerator=numerator/(denominator+EPSILON(1.0_r_wp)) END IF END IF END SUBROUTINE VectorDivision PURE SUBROUTINE VectorAXPBY(alpha,beta,x,y,z) REAL(KIND=r_wp),INTENT(IN),OPTIONAL::alpha,beta REAL(KIND=r_wp),DIMENSION(:),INTENT(IN)::x REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::y REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::z IF(PRESENT(alpha).AND.PRESENT(beta))THEN IF(PRESENT(z))THEN z=alpha*x+beta*y ELSE y=alpha*x+beta*y END IF ELSE IF((.NOT.PRESENT(alpha)).AND.PRESENT(beta))THEN IF(PRESENT(z))THEN z=x+beta*y ELSE y=x+beta*y END IF ELSE IF(PRESENT(alpha).AND.(.NOT.PRESENT(beta)))THEN IF(PRESENT(z))THEN z=alpha*x+y ELSE y=alpha*x+y END IF ELSE IF(PRESENT(z))THEN z=x+y ELSE y=x+y END IF END IF END SUBROUTINE VectorAXPBY PURE SUBROUTINE VectorAXMBY(alpha,beta,x,y,z) REAL(KIND=r_wp),INTENT(IN),OPTIONAL::alpha,beta REAL(KIND=r_wp),DIMENSION(:),INTENT(IN)::x REAL(KIND=r_wp),DIMENSION(:),INTENT(INOUT)::y REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT),OPTIONAL::z IF(PRESENT(alpha).AND.PRESENT(beta))THEN IF(PRESENT(z))THEN z=alpha*x-beta*y ELSE y=alpha*x-beta*y END IF ELSE IF((.NOT.PRESENT(alpha)).AND.PRESENT(beta))THEN IF(PRESENT(z))THEN z=x-beta*y ELSE y=x-beta*y END IF ELSE IF(PRESENT(alpha).AND.(.NOT.PRESENT(beta)))THEN IF(PRESENT(z))THEN z=alpha*x-y ELSE y=alpha*x-y END IF ELSE IF(PRESENT(z))THEN z=x-y ELSE y=x-y END IF END IF END SUBROUTINE VectorAXMBY PURE SUBROUTINE VectorCopy(target,source) REAL(KIND=r_wp),DIMENSION(:),INTENT(IN)::source REAL(KIND=r_wp),DIMENSION(:),INTENT(OUT)::target target=source END SUBROUTINE VectorCopy SUBROUTINE PointerCopy_r_sp_target_r_dp(source,target) REAL(KIND=r_sp),DIMENSION(:),POINTER::source REAL(KIND=r_dp),DIMENSION(:),POINTER::target CALL MemoryCopy_r_sp_target_r_dp(target,source) END SUBROUTINE SUBROUTINE MemoryCopy_r_sp_target_r_dp(target,source) REAL(KIND=r_sp),DIMENSION(:),INTENT(IN)::source REAL(KIND=r_dp),DIMENSION(:),INTENT(OUT)::target target=source END SUBROUTINE SUBROUTINE PointerCopy_r_dp_target_r_sp(source,target) REAL(KIND=r_dp),DIMENSION(:),POINTER::source REAL(KIND=r_sp),DIMENSION(:),POINTER::target CALL MemoryCopy_r_dp_target_r_sp(target,source) END SUBROUTINE SUBROUTINE MemoryCopy_r_dp_target_r_sp(target,source) REAL(KIND=r_dp),DIMENSION(:),INTENT(IN)::source REAL(KIND=r_sp),DIMENSION(:),INTENT(OUT)::target target=source END SUBROUTINE SUBROUTINE PointerAssign_r_sp(source,target) REAL(KIND=r_sp),DIMENSION(:),POINTER::source,target target=>source END SUBROUTINE SUBROUTINE PointerAssign_r_dp(source,target) REAL(KIND=r_dp),DIMENSION(:),POINTER::source,target target=>source END SUBROUTINE SUBROUTINE PointerCopy_i_sp_target_i_dp(source,target) INTEGER(KIND=i_sp),DIMENSION(:),POINTER::source INTEGER(KIND=i_dp),DIMENSION(:),POINTER::target CALL MemoryCopy_i_sp_target_i_dp(target,source) END SUBROUTINE SUBROUTINE MemoryCopy_i_sp_target_i_dp(target,source) INTEGER(KIND=i_sp),DIMENSION(:),INTENT(IN)::source INTEGER(KIND=i_dp),DIMENSION(:),INTENT(OUT)::target target=source END SUBROUTINE SUBROUTINE PointerCopy_i_dp_target_i_sp(source,target) INTEGER(KIND=i_dp),DIMENSION(:),POINTER::source INTEGER(KIND=i_sp),DIMENSION(:),POINTER::target CALL MemoryCopy_i_dp_target_i_sp(target,source) END SUBROUTINE SUBROUTINE MemoryCopy_i_dp_target_i_sp(target,source) INTEGER(KIND=i_dp),DIMENSION(:),INTENT(IN)::source INTEGER(KIND=i_sp),DIMENSION(:),INTENT(OUT)::target target=source END SUBROUTINE SUBROUTINE PointerAssign_i_sp(source,target) INTEGER(KIND=i_sp),DIMENSION(:),POINTER::source,target target=>source END SUBROUTINE SUBROUTINE PointerAssign_i_dp(source,target) INTEGER(KIND=i_dp),DIMENSION(:),POINTER::source,target target=>source END SUBROUTINE SUBROUTINE VectorCopyPermute_r_sp_r_sp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset REAL(KIND=r_sp),DIMENSION(indexing_offset:),INTENT(IN)::source REAL(KIND=r_sp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorCopyPermute_r_dp_r_dp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset REAL(KIND=r_dp),DIMENSION(indexing_offset:),INTENT(IN)::source REAL(KIND=r_dp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorCopyPermute_r_sp_r_dp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset REAL(KIND=r_sp),DIMENSION(indexing_offset:),INTENT(IN)::source REAL(KIND=r_dp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorCopyPermute_r_dp_r_sp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset REAL(KIND=r_dp),DIMENSION(indexing_offset:),INTENT(IN)::source REAL(KIND=r_sp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorPermute_r_sp(indexing_offset,& vector,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset REAL(KIND=r_sp),DIMENSION(indexing_offset:)::vector INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))vector=vector(permutation) IF(PRESENT(inverse_permutation))vector(inverse_permutation)=vector END SUBROUTINE SUBROUTINE VectorPermute_r_dp(indexing_offset,& vector,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset REAL(KIND=r_dp),DIMENSION(indexing_offset:)::vector INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))vector=vector(permutation) IF(PRESENT(inverse_permutation))vector(inverse_permutation)=vector END SUBROUTINE SUBROUTINE VectorCopyPermute_i_sp_i_sp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset INTEGER(KIND=i_sp),DIMENSION(indexing_offset:),INTENT(IN)::source INTEGER(KIND=i_sp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorCopyPermute_i_dp_i_dp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset INTEGER(KIND=i_dp),DIMENSION(indexing_offset:),INTENT(IN)::source INTEGER(KIND=i_dp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorCopyPermute_i_sp_i_dp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset INTEGER(KIND=i_sp),DIMENSION(indexing_offset:),INTENT(IN)::source INTEGER(KIND=i_dp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorCopyPermute_i_dp_i_sp(indexing_offset,& source,target,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset INTEGER(KIND=i_dp),DIMENSION(indexing_offset:),INTENT(IN)::source INTEGER(KIND=i_sp),DIMENSION(indexing_offset:),INTENT(OUT)::target INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))target=source(permutation) IF(PRESENT(inverse_permutation))target(inverse_permutation)=source END SUBROUTINE SUBROUTINE VectorPermute_i_sp(indexing_offset,& vector,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset INTEGER(KIND=i_sp),DIMENSION(indexing_offset:)::vector INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))vector=vector(permutation) IF(PRESENT(inverse_permutation))vector(inverse_permutation)=vector END SUBROUTINE SUBROUTINE VectorPermute_i_dp(indexing_offset,& vector,permutation,inverse_permutation) INTEGER(KIND=i_wp),INTENT(IN)::indexing_offset INTEGER(KIND=i_dp),DIMENSION(indexing_offset:)::vector INTEGER(KIND=i_wp),DIMENSION(indexing_offset:),OPTIONAL::& permutation,inverse_permutation IF(PRESENT(permutation))vector=vector(permutation) IF(PRESENT(inverse_permutation))vector(inverse_permutation)=vector END SUBROUTINE FUNCTION SubarrayPointer_i_sp(offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::offset INTEGER(KIND=i_sp),DIMENSION(offset:),INTENT(IN),TARGET::array INTEGER(KIND=i_sp),DIMENSION(:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer2D_i_sp(row_offset,column_offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::row_offset,column_offset INTEGER(KIND=i_sp),DIMENSION(row_offset:,column_offset:),INTENT(IN),TARGET::array INTEGER(KIND=i_sp),DIMENSION(:,:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer_i_dp(offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::offset INTEGER(KIND=i_dp),DIMENSION(offset:),INTENT(IN),TARGET::array INTEGER(KIND=i_dp),DIMENSION(:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer2D_i_dp(row_offset,column_offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::row_offset,column_offset INTEGER(KIND=i_dp),DIMENSION(row_offset:,column_offset:),INTENT(IN),TARGET::array INTEGER(KIND=i_dp),DIMENSION(:,:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer_r_sp(offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::offset REAL(KIND=r_sp),DIMENSION(offset:),INTENT(IN),TARGET::array REAL(KIND=r_sp),DIMENSION(:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer2D_r_sp(row_offset,column_offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::row_offset,column_offset REAL(KIND=r_sp),DIMENSION(row_offset:,column_offset:),INTENT(IN),TARGET::array REAL(KIND=r_sp),DIMENSION(:,:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer_r_dp(offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::offset REAL(KIND=r_dp),DIMENSION(offset:),INTENT(IN),TARGET::array REAL(KIND=r_dp),DIMENSION(:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer2D_r_dp(row_offset,column_offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::row_offset,column_offset REAL(KIND=r_dp),DIMENSION(row_offset:,column_offset:),INTENT(IN),TARGET::array REAL(KIND=r_dp),DIMENSION(:,:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer_l_short(offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::offset LOGICAL(KIND=l_short),DIMENSION(offset:),INTENT(IN),TARGET::array LOGICAL(KIND=l_short),DIMENSION(:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer2D_l_short(row_offset,column_offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::row_offset,column_offset LOGICAL(KIND=l_short),DIMENSION(row_offset:,column_offset:),INTENT(IN),TARGET::array LOGICAL(KIND=l_short),DIMENSION(:,:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer_l_word(offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::offset LOGICAL(KIND=l_word),DIMENSION(offset:),INTENT(IN),TARGET::array LOGICAL(KIND=l_word),DIMENSION(:),POINTER::subarray subarray=>array END FUNCTION FUNCTION SubarrayPointer2D_l_word(row_offset,column_offset,array)RESULT(subarray) INTEGER(KIND=i_wp),INTENT(IN)::row_offset,column_offset LOGICAL(KIND=l_word),DIMENSION(row_offset:,column_offset:),INTENT(IN),TARGET::array LOGICAL(KIND=l_word),DIMENSION(:,:),POINTER::subarray subarray=>array END FUNCTION END MODULE Vector_Operations