# CROCO w/ GPU compilation error

**URL:** <https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675>\
**Category:** compilation-installation\
**Tags:** compilation-installation\
**Created:** [July 9, 2026, 6:48pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675 "2026-07-09T18:48:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndresSepulveda](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/andressepulveda/32/262_2.png) [@AndresSepulveda](https://forum.croco-ocean.org/u/AndresSepulveda)\
**Post date:** [July 9, 2026, 6:48pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/1 "2026-07-09T18:48:49Z")

</div>

Hi, I wanto to compile croco-v2.1.3 so I’ve added #define openacc in cppdefs.h and selectec nvfortran as a compiler in jobcomp.

The following error appears. Any idea how to solve it?

nvfortran -c -g -fast -r8 -i4 -mcmodel=medium -Mbackslash -I/usr/include -acc -Minfo=accel get\_bulk\_.f -o get\_bulk.o  
set\_bulk\_tile:  
2056, Generating update device(wspd(:,:))  
2079, Generating update device(wspd(:,:),vwnd(:,:),uwnd(:,:),tair(:,:),rhum(:,:),radlw(:,:),prate(:,:),radsw(:,:),srflx(:,:))  
cpp -traditional -DLinux -DXLF -P -I/usr/include -ICROCOFILES/AGRIF\_INC bulk\_flux.F \> bulk\_flux\_.f1  
python3 ./change\_loops.py bulk\_flux\_.f1 bulk\_flux\_.tmp  
cat bulk\_flux\_.tmp | ./mpc \> bulk\_flux\_.f && \rm bulk\_flux\_.tmp  
FORTRAN STOP  
nvfortran -c -g -fast -r8 -i4 -mcmodel=medium -Mbackslash -I/usr/include -acc -Minfo=accel bulk\_flux\_.f -o bulk\_flux.o  
NVFORTRAN-S-0155-DO loop expected after ACC LOOP (bulk\_flux\_.f: 636)  
0 inform, 0 warnings, 1 severes, 0 fatal for bulk\_flux\_tile  
make: \*\*\* [Makedefs:15: bulk\_flux.o] Error 2

Regards,

Andrés

---

<div class="post-metadata">

**Author:** ![swapnil](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/swapnil/32/855_2.png) [@swapnil](https://forum.croco-ocean.org/u/swapnil)\
**Post date:** [July 10, 2026, 10:36am UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/2 "2026-07-10T10:36:05Z")

</div>

Hi @AndresSepulveda  
Remove this line: L-733 (!$acc loop seq ). It’s not needed here.

> **[OCEAN/bulk\_flux.F · master · croco-ocean / croco · GitLab](https://gitlab.inria.fr/croco-ocean/croco/-/blob/master/OCEAN/bulk_flux.F?ref_type=heads#L733)**
>
> Official repository for the CROCO model

Try again to compile. pls let me know.  
Thank you! best regards.

---

<div class="post-metadata">

**Author:** ![AndresSepulveda](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/andressepulveda/32/262_2.png) [@AndresSepulveda](https://forum.croco-ocean.org/u/AndresSepulveda)\
**Post date:** [July 10, 2026, 2:42pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/3 "2026-07-10T14:42:10Z")

</div>

I was able to compile thanks. Now I have a problem reading the .in file

```auto
  Boundary File: croco_bry.nc

```

Initial State File: croco\_ini.nc Record: 1  
Restart File: croco\_rst.nc nrst = 89280 rec/file: 0  
History File: croco\_his.nc Create new: T nwrt =\*\*\*\* rec/file = 0  
1 ntsavg Starting timestep for the accumulation of output  
time-averaged data.  
2880 navg Number of timesteps between writing of time-averaged  
data into averages file.  
Averages File: croco\_avg.nc rec/file = 0

READ\_INP ERROR while reading block with keyword ‘primary\_history\_fields’.

READ\_INP ERROR: A total of 1 configuration errors discovered.

which is wierd because it is pretty standard

primary\_history\_fields: zeta UBAR VBAR U V wrtT(1:NT)  
T T T T T 40_T  
auxiliary\_history\_fields: rho Omega W Akv Akt Aks Bvf Visc3d Diff3d HBL HBBL Bostr Bustr Bvstr Wstr Ustr Vstr Shfl Swfl rsw rlw lat sen HEL  
F F T F T F F F F T T T F F T T T T T 10_\*T

---

<div class="post-metadata">

**Author:** ![swapnil](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/swapnil/32/855_2.png) [@swapnil](https://forum.croco-ocean.org/u/swapnil)\
**Post date:** [July 10, 2026, 3:18pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/4 "2026-07-10T15:18:12Z")

</div>

Hi,

> [@AndresSepulveda](#):
>
> primary\_history\_fields: zeta UBAR VBAR U V wrtT(1:NT)  
> T T T T T 40_T_**(missing \* )** 😀

in or nml I don’t think it will change but read\_inp.F can.  
Thank you with best regards.

---

<div class="post-metadata">

**Author:** ![AndresSepulveda](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/andressepulveda/32/262_2.png) [@AndresSepulveda](https://forum.croco-ocean.org/u/AndresSepulveda)\
**Post date:** [July 10, 2026, 3:51pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/5 "2026-07-10T15:51:41Z")

</div>

The _is there. It got lost in the copy paste. Seems it doesn’t like them. I’ve added just two T’s_ (for temperature and salinity) and removed the othet 10\*T

Now it crashes with something related to the bulk\_flux.F (I am using ONLINE)

FATAL ERROR: data in PRESENT clause was not found on device 1: name=stau(imin:imax,jmin:jmax) host:0x117f581a0  
file:/home/andres/croco-v2.1.3/Tunisia\_GPU/Compile/bulk\_flux\_.f bulk\_flux\_tile line:546

my bulk\_flux.F file is from the latest oficial release

> **[OCEAN/bulk\_flux.F · v2.1.3 · croco-ocean / croco · GitLab](https://gitlab.inria.fr/croco-ocean/croco/-/blob/v2.1.3/OCEAN/bulk_flux.F?ref_type=tags)**
>
> Official repository for the CROCO model

---

<div class="post-metadata">

**Author:** ![swapnil](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/swapnil/32/855_2.png) [@swapnil](https://forum.croco-ocean.org/u/swapnil)\
**Post date:** [July 10, 2026, 4:36pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/6 "2026-07-10T16:36:10Z")

</div>

Hi,  
after closer look at it, I find it.  
add after this line (line 73) its only in v2.1.3 as well as the master branch. but master have few new var (aer, cer, etc).

```auto
# ifdef CFB_STRESS
!$acc& ,stau
# endif

```

Please check its working or not (as you mention some of the card).  
let me know.  
Thank you with best regards.

---

<div class="post-metadata">

**Author:** ![AndresSepulveda](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/andressepulveda/32/262_2.png) [@AndresSepulveda](https://forum.croco-ocean.org/u/AndresSepulveda)\
**Post date:** [July 10, 2026, 5:33pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/7 "2026-07-10T17:33:49Z")

</div>

No luck yet, this error shows

nvfortran -c -g -fast -r8 -i4 -mcmodel=medium -Mbackslash -I/usr/include -acc -Minfo=accel get\_bulk\_.f -o get\_bulk.o  
set\_bulk\_tile:  
2164, Generating update device(wspd(:,:))  
2187, Generating update device(wspd(:,:),vwnd(:,:),uwnd(:,:),tair(:,:),rhum(:,:),radlw(:,:),prate(:,:),radsw(:,:),srflx(:,:))  
cpp -traditional -DLinux -DXLF -P -I/usr/include -ICROCOFILES/AGRIF\_INC bulk\_flux.F \> bulk\_flux\_.f1  
python3 ./change\_loops.py bulk\_flux\_.f1 bulk\_flux\_.tmp  
cat bulk\_flux\_.tmp | ./mpc \> bulk\_flux\_.f && \rm bulk\_flux\_.tmp  
FORTRAN STOP  
nvfortran -c -g -fast -r8 -i4 -mcmodel=medium -Mbackslash -I/usr/include -acc -Minfo=accel bulk\_flux\_.f -o bulk\_flux.o  
NVFORTRAN-S-0038-Symbol, stau, has not been explicitly declared (bulk\_flux\_.f: 497)  
NVFORTRAN-S-0050-Assumed size array, stau, is not a dummy argument (bulk\_flux\_.f: 522)  
NVFORTRAN-W-0119-Redundant specification for stau (bulk\_flux\_.f: 522)  
0 inform, 1 warnings, 2 severes, 0 fatal for bulk\_flux\_tile  
make: \*\*\* [Makedefs:15: bulk\_flux.o] Error 2s

Here is the modification done

```auto
!$acc declare create( cff , cff2
!$acc& ,rho0i, cpi , RH , Hlv , wspd0
!$acc& ,TseaC, TseaK, Qsea , Tvstar
!$acc& ,TairC, TairK, Q , rhoAir , Bf
!$acc& ,delW , delT , delQ , ddelW , ddelT , ddelQ
!$acc& ,Cd , Ch , Ce , iexns , iexna
!$acc& ,Wstar, Tstar, Qstar, Wstar0 , Tstar0, Qstar0
!$acc& ,psi_u, ZoLu, psi_t, ZoLt , patm
!$acc& ,hfsen, hflat, hflw , upvel , evap
# ifdef CFB_STRESS
!$acc& ,stau
# endif
!$acc& )

```

---

<div class="post-metadata">

**Author:** ![swapnil](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/swapnil/32/855_2.png) [@swapnil](https://forum.croco-ocean.org/u/swapnil)\
**Post date:** [July 10, 2026, 6:47pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/8 "2026-07-10T18:47:54Z")

</div>

Hi,  
sorry. it’s my apology.  
you need to add it here in line - 122 after.

> **[OCEAN/bulk\_flux.F · v2.1.3 · croco-ocean / croco · GitLab](https://gitlab.inria.fr/croco-ocean/croco/-/blob/v2.1.3/OCEAN/bulk_flux.F?ref_type=tags#L122)**
>
> Official repository for the CROCO model

```auto
!$acc declare create( aer, cer
# ifdef CFB_STRESS
!$acc& ,stau
# endif
!$acc& )

```

And revert your earlier change to the line-73.  
ordering problem. because declared here.  
Thank you with best regards.

---

<div class="post-metadata">

**Author:** ![AndresSepulveda](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/andressepulveda/32/262_2.png) [@AndresSepulveda](https://forum.croco-ocean.org/u/AndresSepulveda)\
**Post date:** [July 10, 2026, 9:27pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/9 "2026-07-10T21:27:55Z")

</div>

Thanks for all the help, a problem persists.

allocated block device:0x7fbd1fe00000 size:2097152 thread:1  
deleted block device:0x7fbbfe000000 size:69069312 threadid=1  
FATAL ERROR: data in PRESENT clause was not found on device 1: name=stau(imin:imax,jmin:jmax) host:0x116f12f20  
file:/home/andres/croco-v2.1.3/Tunisia\_GPU/Compile/bulk\_flux\_.f bulk\_flux\_tile line:546

Fri 10 Jul 2026 09:20:53 PM UTC

Here are the files that I’ve modified

[bulk\_flux.f](https://forum.croco-ocean.org/uploads/short-url/d2IMt0dq1gvdBDprtITtL0DpomP.f) (35.2 KB)

[bulk\_flux\_.f](https://forum.croco-ocean.org/uploads/short-url/3jZGBeqYyNeNIixdPBsjkPsrXly.f) (40.2 KB)

---

<div class="post-metadata">

**Author:** ![AndresSepulveda](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/andressepulveda/32/262_2.png) [@AndresSepulveda](https://forum.croco-ocean.org/u/AndresSepulveda)\
**Post date:** [July 10, 2026, 10:09pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/10 "2026-07-10T22:09:19Z")

</div>

Now it runs!

Seems the IF has to be declared this way

!$acc declare create( aer, cer )

# ifdef CFB\_STRESS

!$acc declare create( stau )

# endif

(solution by Claude Code)

---

<div class="post-metadata">

**Author:** ![swapnil](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/swapnil/32/855_2.png) [@swapnil](https://forum.croco-ocean.org/u/swapnil)\
**Post date:** [July 10, 2026, 10:24pm UTC](https://forum.croco-ocean.org/t/croco-w-gpu-compilation-error/7675/11 "2026-07-10T22:24:01Z")

</div>

Ok. Thank you.  
It seems cpp -traditional pass through mpc.  
best regards.
