12.07.2015 Views

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2 Intel <strong>Fortran</strong> <strong>Libraries</strong> <strong>Reference</strong>INTEGER(4) STRIDE !Stride for the dimensionEND TYPE FOR_DIMS_INFOThe FOR_DESCRIPTOR_ASSIGN routine is similar to a <strong>Fortran</strong> 95/90 pointer assignment, butgives you more control over the assignment, allowing, for example, assignment to any location inmemory.You can also use this routine to create an array that can be used from both <strong>Fortran</strong> or C.See Also: the POINTER Attribute and Statement in the Language <strong>Reference</strong>Exampleuse IFCOREcommon/c_array/ arrayreal(8) array(5,5)external init_arrayexternal c_print_arrayreal(8),pointer :: p_array(:,:)type(FOR_DIMS_INFO) dims_info(2)call init_array()do i=1,5do j=1,5print *,i,j, array(i,j)end doend dodims_info(1)%LOWERBOUND = 11dims_info(1)%UPPERBOUND = 15dims_info(1)%STRIDE = 1dims_info(2)%LOWERBOUND = -5dims_info(2)%UPPERBOUND = -1dims_info(2)%STRIDE = 1call FOR_DESCRIPTOR_ASSIGN(p_array, &LOC(array), &SIZEOF(array(1,1)), &FOR_DESCRIPTOR_ARRAY_DEFINED .or. &FOR_DESCRIPTOR_ARRAY_NODEALLOC .or. &FOR_DESCRIPTOR_ARRAY_CONTIGUOUS, &2, &2-84

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!