10.07.2015 Views

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Interoperability with CExampleprogram mainuse iso_c_bindingimplicit noneinterfacesubroutine my_routine(p) bind(c,name='myC_func')import :: c_ptrtype(c_ptr), intent(out) :: pend subroutineend interfacetype(c_ptr) :: cptrreal,pointer :: a(:)call my_routine(cptr)call c_f_pointer(cptr, a, [12])end program main10.2.3. c_associatedA subroutine that determines the status of a C_PTR, or determines if one C_PTR is associatedwith a target C_PTR.F2003Syntaxc_associated (cptr1[, cptr2] )TypesubroutineDescriptionc_associated determines the status of a C_PTR,cptr1, or determines if cptr1 is associatedwith a target cptr2.‣ cptr1 is a scalar of the type C_PTR.‣ cptr2 is an optional scalar or the same type as cptr1.Return ValueA logical value:‣ .false. if either cptr1 is a C NULL pointer or if cptr1 and cptr2 point to differentaddresses.‣ .true. if cptr1 is a not a C NULL pointer or if cptr1 and cptr2 point to the sameaddress.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 219

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

Saved successfully!

Ooh no, something went wrong!