I get a strange error when compiling.
Here is a reduced testcase with two source files. First one:
$ cat modA.F90
MODULE o_PARAM
integer, parameter :: WP=8 ! Working precision
integer, dimension(100) :: tracer_ID = RESHAPE((/0, 1/), (/100/), (/0/))
END MODULE o_PARAM
Second one:
$ cat modB.F90
MODULE i_ARRAYS
USE o_PARAM
implicit none
END MODULE i_ARRAYS
!=====================================================================
module i_therm_param
USE o_PARAM
implicit none
REAL(kind=WP) :: h0=1.0_WP ! Lead closing parameter [m] ! 0.5
!$acc declare copyin (h0)
end module i_therm_param
and then compiling together:
$ which pgfortran
/compilers/pgi/19.10/bin/pgfortran
$ pgfortran -acc modA.F90 modB.F90
modA.F90:
modB.F90:
nvvmCompileProgram error: 9.
Error: /tmp/pgaccwNibc1HHjFf1.gpu (16, 0): parse redefinition of global '@_o_param_21'
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (modB.F90: 1)
PGF90/x86-64 Linux 19.10-0: compilation aborted
If you remove one of the elements or concatenate the files, the compile error (‘parse redefinition of global’) disappears.
This looks like a compiler bug to me.
Cheers,
John