Procedure for any type of array in Fortran

前端 未结 2 1983
孤街浪徒
孤街浪徒 2021-01-22 05:59

Basis: I want to write a procedure which make some operation for any input array type: integer, real(4), real(8), etc. The only idea i read on Stac

2条回答
  •  时光说笑
    2021-01-22 06:32

    To complement the last part of Vladimir's answer: The mpi_f08 module defines most routines with the following unportable part, which seems to suit most compilers (but most likely, not all):

    !DEC$ ATTRIBUTES NO_ARG_CHECK :: sendbuf, recvbuf
    !GCC$ ATTRIBUTES NO_ARG_CHECK :: sendbuf, recvbuf
    !$PRAGMA IGNORE_TKR sendbuf, recvbuf
    !DIR$ IGNORE_TKR sendbuf, recvbuf
    !IBM* IGNORE_TKR sendbuf, recvbuf
    

    (Adjust the variable names according to your needs.)

提交回复
热议问题