# AGRIF+Sediment

**URL:** <https://forum.croco-ocean.org/t/agrif-sediment/390>\
**Category:** sediment\
**Tags:** compilation-installation, sediment-waves, dynamics-numerics\
**Created:** [September 6, 2022, 7:33pm UTC](https://forum.croco-ocean.org/t/agrif-sediment/390 "2022-09-06T19:33:51Z")\
**Posts on this page:** 3\
**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:** [September 6, 2022, 7:33pm UTC](https://forum.croco-ocean.org/t/agrif-sediment/390/1 "2022-09-06T19:33:51Z")

</div>

Hi,

I am getting the following errors while compiling CROCO with AGRIF+Sediment module  
Is there a missing flag for the compilation?

OPENMP

> RIF\_MODELFILES/main.F \> main\_.f  
> gfortran -c -O3 -fdefault-real-8 -fdefault-double-8 -IAGRIF -fopenmp main\_.f -o main.o  
> main\_.f:1397:53:

```
   integer(4), parameter :: NST = NSAND+NMUD+NGRAV
                                                 1

```

Error: Symbol ‘ngrav’ at (1) has no IMPLICIT type  
main\_.f:1398:45:

```
   integer(4), parameter :: ntrc_sed = NST
                                         1

```

Error: Symbol ‘nst’ at (1) has no IMPLICIT type  
main\_.f:1404:12:

and with MPI

> RIF\_MODELFILES/main.F \> main\_.f  
> mpif90 -c -O3 -fdefault-real-8 -fdefault-double-8 -IAGRIF main\_.f -o main.o  
> main\_.f:1420:53:

```
   integer(4), parameter :: NST = NSAND+NMUD+NGRAV
                                                 1

```

Error: Symbol ‘ngrav’ at (1) has no IMPLICIT type  
main\_.f:1421:45:

```
   integer(4), parameter :: ntrc_sed = NST
                                         1

```

---

<div class="post-metadata">

**Author:** ![Rachid](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/rachid/32/296_2.png) [@Rachid](https://forum.croco-ocean.org/u/Rachid)\
**Post date:** [September 7, 2022, 8:37am UTC](https://forum.croco-ocean.org/t/agrif-sediment/390/2 "2022-09-07T08:37:47Z")

</div>

Hi Andres

I. Agrif seems to struggle with defining NST as the sum of others parameters at line

> ```
> parameter (NST=NSAND+NMUD+NGRAV)
> 
> ```

As a workaround you can force it with an explicit declaration of the number of sediment, for instance

> ```
> parameter (NST=2)
> 
> ```

if you have NSAND=2, NMUD=0 and NGRAV=0. I have no idea why there is such behavour

II. Then I found an other issue if BBL is not activated, Agrif\_lev\_sedim is not declared, in param.h again :

> ```
> #if defined BBL && defined AGRIF
> integer Agrif_lev_sedim 
> parameter (Agrif_lev_sedim=0) 
> #endif 
> 
> ```

You can just suppress the reference to BBL :

> ```
> #if defined AGRIF
> integer Agrif_lev_sedim
> parameter (Agrif_lev_sedim=0)
> #endif
> 
> ```

With these two changes, I’m able to compile BENGUELA with AGRIF and SEDIMENT activated. I haven’t try to run it though… Attached the modified param.h

regards

Rachid

[param.h](https://forum.croco-ocean.org/uploads/default/original/1X/7debc6c1308d9bf5ad7ef953be9c9f83dfd2888a.h)

---

<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:** [September 7, 2022, 7:56pm UTC](https://forum.croco-ocean.org/t/agrif-sediment/390/3 "2022-09-07T19:56:00Z")

</div>

Thanks, that works (compiles). I will test a run.
