Forum

The argument to C_LOC must be a variable with POINTER or TARGET attr

Ronald Van Nooyen, modified 2 Years ago.

The argument to C_LOC must be a variable with POINTER or TARGET attr

Youngling Posts: 4 Join Date: 11/17/22 Recent Posts
I am working on compilation of Delft3D-FM on OracelLInux 8.7 with the intel oneapi  2022.3 base and HPC tools.
The Intel compiler from oneapi 2022.3 gives the following error messages for the delft3dfm tag 142074 source code
```
src/engines_gpl/dflowfm/packages/dflowfm_lib/src/unstruc_dll_api.F90(104): error #9022: The argument to C_LOC must be a variable with the POINTER or TARGET attribute.   [NBNDZ]
      x = c_loc(nbndz)
----------------^
src/engines_gpl/dflowfm/packages/dflowfm_lib/src/unstruc_dll_api.F90(108): error #9022: The argument to C_LOC must be a variable with the POINTER or TARGET attribute.   [KBNDZ]
      x = c_loc(kbndz)
----------------^

```
A search on internet suggests this is new behavior in the intel 2022.3 version of the  compiler. Does anyone know a work-around for this?
Ronald Van Nooyen, modified 2 Years ago.

RE: The argument to C_LOC must be a variable with POINTER or TARGET attr

Youngling Posts: 4 Join Date: 11/17/22 Recent Posts
In principle adding target to the definitions on lines 109 and 116 of src/engines_gpl/dflowfm/packages/dflowfm_kernel/src/dflowfm_data/m_flowexternalforcings.f90 makes the error go away. Moreover, given that adding target only means the varieable might be a pointer target, this shuodl not cause other problems.