Is there a way to retrieve the compilation options a given fortran code has been compiled with.
In particular, I'm interested in knowing if the code is being run in parallel using the "-coarray" option.
If so, some variables need to have the "codimension" attribute in their declaration.
For the time being, I added these lines in my Make.inc file which is included in my Makefile:
PARALLEL_FLAG= -coarray -coarray-num-images=2 -DPARALLEL
FFLAGS= ... (OTHER COMPILATION OPTIONS) ... $(PARALLEL_FLAG) -fpp
The source code is being preprocessed (option "-fpp") and the "PARALLEL" keyword is defined (option "-DPARALLEL")
Then, in my source code, I'm using the following preprocessing conditional structure:
#IFDEF PARALLEL class(Mesh_Type) ,codimension[*] ,intent(inout) :: This #ELSE class(Mesh_Type) ,intent(inout) :: This #ENDIF
Is there a better way to do it?