pgfortran and execute_command_line or equivalent

I use either the F2008 “execute_command_line” or intel fortran “system” subroutines in one of my modules depending on the compiler I use ( gfortran or ifort ) up to now. I intend to use PG Cuda Fortran, and I would like to know if there is an equivalent subroutine in PG Fortran ( I did not find ).
Alternatively is it possible to compile the only module where I need this subroutine with another compiler , compile the other modules and link with PG fortran ?
Marc

Hi Marc,

We include a “system” function as part of the 3f library, which is just a wrapper for the C system call. You just need to declare it before it can be used. i.e. “integer system”. See page 268 of the PGI Fortran Reference Guide.

Alternatively is it possible to compile the only module where I need this subroutine with another compiler , compile the other modules and link with PG fortran ?

If it were a stand-alone subroutine without any F90 structures (like allocatable arrays), then yes. However each compiler vendor has their own method to organize modules that are not compatible.

Hope this helps,
Mat

Thanks Mat,
it helps indeed. I used the 3f library system function and it works.
Just in case other people want to use this thread, the page 268 you mention might be in fact page 314 for the system function ( or 293 pour the chapter on 3f library).
Thanks again.
Marc