# Error in coupling CROCO - WW3

**URL:** <https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753>\
**Category:** run / config issues\
**Tags:** coupling\
**Created:** [July 2, 2024, 6:27pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753 "2024-07-02T18:27:47Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesar90](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/c/898d66/32.png) [@cesar90](https://forum.croco-ocean.org/u/cesar90)\
**Post date:** [July 2, 2024, 6:27pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/1 "2024-07-02T18:27:48Z")

</div>

Dear friends,

I am working on the coupling of CROCO with WW3. To do so, I am first trying to run the Benguela coupled test case; I am following the methodology exposed in the last CROCO summer course \>\> [http://mosa.dgeo.udec.cl/CROCO2024/CursoAvanzado/Day3\_morning.pdf](http://mosa.dgeo.udec.cl/CROCO2024/CursoAvanzado/Day3_morning.pdf)

Each model I have run separately successfully. For the coupling, I have configured my switch considering:  
F90 NOGRB TRKNC NC4 DIST MPI PR3 UQ FLX0 LN1 ST4 STAB0 NL1 BT4 DB1 MLIM TR0 BS0 BS0 IC0 IS0 REF1 XX0 WNT0 WNX1 RWND CRT0 CRX1 COU OASIS OASOCM O0 O1 O2 O2 O2a O2b O2c O3 O4 O5 O6 O7; also in cppdefs I have defined OW\_COUPLING and MRL\_WCI.

I have checked the dates of the input files for both CROCO and WW3, although they have different formats (hours and days), and different start and end dates, they all cover the month of January 2005.  
When running the model in cluster, I am getting the following error:

 ![pastedImage](https://forum.croco-ocean.org/uploads/default/original/1X/c1074b5142d2042557cc7897064b2d4a010e03a9.png)

You can access the run files I am using at the link below. The error is save in the file “job\_1226.out”. Does anyone have any idea what the cause of the error is?

> **[1.87 GB folder on MEGA](https://mega.nz/folder/OdEEVBTD#-J8bcYrL_XrEJr9VnB5rzA)**
>
> 60 files

Please let me know if additional information is needed.

Thank you for your support and kind attention.

Regards,  
Cesar.

---

<div class="post-metadata">

**Author:** ![sjullien](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/sjullien/32/255_2.png) [@sjullien](https://forum.croco-ocean.org/u/sjullien)\
**Post date:** [July 3, 2024, 10:21am UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/2 "2024-07-03T10:21:38Z")

</div>

Hi Cesar, it seems from some log files that the coupling is not really activated in both models : e.g.

- in nout.000000 : I see only wwatch as coupled models at the end of the file : (oasis\_init\_comp) COUPLED models 1 wwatch T
- in log.ww : it seems that coupling is not activated, as I do not see any section about coupling fields after the section about output fields. Generally you have a section named " Coupling output fields :" after the section " Gridded output fields".

But it also seems that you have done different runs in this same directory (several job\_XXX.out), so maybe all logs are not consistent with each other, and it is difficult to really assess what is the problem. I suggest to create a new clean run directory and put there only your trial of coupled run. Please also add the cppdefs.h and param.h from croco compilation, as well as the switch file for WW3.

---

<div class="post-metadata">

**Author:** ![cesar90](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/c/898d66/32.png) [@cesar90](https://forum.croco-ocean.org/u/cesar90)\
**Post date:** [July 10, 2024, 2:57am UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/3 "2024-07-10T02:57:03Z")

</div>

Hi Swen. Thank you for your reply.

Finally, I was able to run the Benguela coupled case. Apparently I had a error in the WW3 auxiliary programs; by compiling WW3 again with OASIS, I generated the auxiliary programs and the WW3 input files with which I was able to run the case.

Regards,  
César.

---

<div class="post-metadata">

**Author:** ![cesar90](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/c/898d66/32.png) [@cesar90](https://forum.croco-ocean.org/u/cesar90)\
**Post date:** [July 12, 2024, 1:53am UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/4 "2024-07-12T01:53:05Z")

</div>

Hi Swen,

Now, I am trying to run the coupled models using CROCO TOOLBOXS. I have carefully checked the directories to each of the executable programs. In “rundir” I can see that the provided scripts compiled CROCO and fill the \*.base files of both CROCO and WW3, but do not run the WW3 auxiliary programs (e.g. ww3\_grid, ww3\_prnc…).

Checking “wav\_getrst.txt” I find the following error:

\*\*\*\*\*\*\*\*\*\*\*\*\* get WAVE RESTART files \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

WW3 pre-processing before run:  
mpirun -n 1 ww3\_grid &\> grid.out  
ERROR when running ww3\_grid, mod\_def.ww3 does not exist  
…  
…

I think that in “myjob.sh”, I am not defining correctly:

MPI\_LAUNCH\_CMD=$MPI\_LAUNCH (default)  
export SERIAL\_LAUNCH\_WAV="$MPI\_LAUNCH -n 1 "

My machine is Linux, so I have in the directory SCRIPTS\_TOOLBOX/MACHINE adapted “myenv.Linux” according to the compiler I use (ifort); consequently, I have tried with:

MPI\_LAUNCH\_CMD=$mpirun  
export SERIAL\_LAUNCH\_WAV="$mpirun -n 1 "

but when doing this, the program does not even start running, so after “./submitjob.sh” I get the message: “./mynamelist.tmp: line 357: mpirun: unbound variable”.

In my case, how should I define “MPI\_LAUNCH\_CMD” and “export SERIAL\_LAUNCH\_WAV” ??

Thank you very much for your attention and help.

Regards,  
César.

---

<div class="post-metadata">

**Author:** ![smaishal](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/smaishal/32/667_2.png) [@smaishal](https://forum.croco-ocean.org/u/smaishal)\
**Post date:** [July 12, 2024, 4:06pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/5 "2024-07-12T16:06:35Z")

</div>

[cesar90](https://forum.croco-ocean.org/u/cesar90)  
Hi,  
Is this problem solved? -n to -np ?  
let me know. I am free. I want to see it closely.  
We are together!

---

<div class="post-metadata">

**Author:** ![cesar90](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/c/898d66/32.png) [@cesar90](https://forum.croco-ocean.org/u/cesar90)\
**Post date:** [July 12, 2024, 4:13pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/6 "2024-07-12T16:13:15Z")

</div>

Hi Smaishal,

Thank you for your support.  
I have seen your suggestions that you sent me by mail.  
I already had an idea to change -n to -np in “launch\_Linux.sh”. I made those changes and ran the model from the run directory (rundir), but it didn’t work. I wanted to try again to run the model via “./submitjob.sh”, but as I mentioned before, the model does not start.  
In “myjob.sh” what should I define in ?  
MPI\_LAUNCH\_CMD=  
export SERIAL\_LAUNCH\_WAV

---

<div class="post-metadata">

**Author:** ![smaishal](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/smaishal/32/667_2.png) [@smaishal](https://forum.croco-ocean.org/u/smaishal)\
**Post date:** [July 12, 2024, 4:16pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/7 "2024-07-12T16:16:50Z")

</div>

can you send me your CPL problem in my mail :).

---

<div class="post-metadata">

**Author:** ![smaishal](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/smaishal/32/667_2.png) [@smaishal](https://forum.croco-ocean.org/u/smaishal)\
**Post date:** [July 12, 2024, 5:55pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/9 "2024-07-12T17:55:34Z")

</div>

send your CPL problem with some log. as I expected?  
do you want to, I need to reproduce your problem in my system?  
I really want that in the Virtual Box.  
Beautiful

---

<div class="post-metadata">

**Author:** ![smaishal](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/smaishal/32/667_2.png) [@smaishal](https://forum.croco-ocean.org/u/smaishal)\
**Post date:** [July 15, 2024, 6:34am UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/10 "2024-07-15T06:34:51Z")

</div>

> **[@cesar90](https://forum.croco-ocean.org/u/cesar90)**

Thank you for sending your files.  
your error is this write:  
\*\*\*\*\*\*\*\*\*\*\*\*\* get WAVE RESTART files \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

WW3 pre-processing before run:  
mpirun -np 1 ww3\_grid &\> grid.out  
ERROR when running ww3\_grid, mod\_def.ww3 does not exist

---

<div class="post-metadata">

**Author:** ![cesar90](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/c/898d66/32.png) [@cesar90](https://forum.croco-ocean.org/u/cesar90)\
**Post date:** [July 22, 2024, 12:23pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/11 "2024-07-22T12:23:58Z")

</div>

Hi,  
Thank you for your response.

I have followed your suggestion to make some small changes in “w3\_getrst.sh”.

In a previous answer you tell me that “before reading your massage just ./”, could you explain me in more detail where I should write only “./”?  
Based on what you suggest, I thought that in “w3\_getrst.sh” I should only write “./” before:  
**“${io\_getfile} ${WAV\_NAM\_DIR}/ww3\_prnc.inp.${forcww3[$k]} ./ww3\_prnc.inp”**

I don’t know if this is what you are trying to say.

Likewise, with this change now “mod\_def.ww3” and “ww3\_prnc.inp” is created correctly, but I still get an error when the code wants to run “ww3\_prnc”; about this I must say, based on what I commented above, that I have already run the coupled models with this data, and consequently, with these same executable programs (e.g. ww3\_grid, ww3\_prnc..). So I don’t know what causes this error. It looks like WW3 is not properly compiled, as if the programs in “exe\_ow” are wrong, but that should not be a problem because with those same programs I have run this coupling following the “at hand” methodology.

The error that I am getting in “prnc.wind.out”:

\*\*\* WAVEWATCH III Input pre-processing \*\*\*  
===============================================

Grid name : benguela\_CPL\_ow

Comment character is ‘$’

## Description of inputs

```
   Input type : winds
   Format type : long.-lat. grid
      Field conserves velocity.

       File name : wind.nc
       Dimension along x : longitude
       Dimension along y : latitude
       Field component 1 : u10
       Field component 2 : v10

```

\*\*\* WAVEWATCH III ERROR IN PRNC :  
NETCDF ERROR MESSAGE:  
NetCDF: HDF error

w3servmd MPI\_ABORT, IEXIT= 59  
w3servmd UNIT missing  
w3servmd MSG missing  
w3servmd FILE missing  
w3servmd LINE missing  
w3servmd COMM missing  
Abort(59) on node 0 (rank 0 in comm 0): application called MPI\_Abort(MPI\_COMM\_WORLD, 59) - process 0

Thanks for your attention and support,  
César.

---

<div class="post-metadata">

**Author:** ![smaishal](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/smaishal/32/667_2.png) [@smaishal](https://forum.croco-ocean.org/u/smaishal)\
**Post date:** [July 22, 2024, 1:17pm UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/12 "2024-07-22T13:17:47Z")

</div>

Hi,

> [@cesar90](#):
>
> ```auto
> change accordingly or you already changed? : 
> Dimension along x : longitude
> Dimension along y : latitude
> Field component 1 : u10
> Field component 2 : v10
> 
> ```

thanks.  
I am just referring your problem to respected [sjullien](https://forum.croco-ocean.org/u/sjullien) and [andres](https://forum.croco-ocean.org/u/andres).  
I hope they will help you better. thanks.

---

<div class="post-metadata">

**Author:** ![sjullien](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/sjullien/32/255_2.png) [@sjullien](https://forum.croco-ocean.org/u/sjullien)\
**Post date:** [August 21, 2024, 7:27am UTC](https://forum.croco-ocean.org/t/error-in-coupling-croco-ww3/753/13 "2024-08-21T07:27:28Z")

</div>

Hi Cesar,  
I haven’t follow all your exchanges before, but from what I read, the issue you are facing is that WW3 pre-processing step (e.g. ww3\_grid here) are not working. These steps have to be run in serial (not mpi), but depending on your environment and how you compiled WW3, you may have either to launch them like usual serial programs so with export SERIAL\_LAUNCH\_WAV=“./” or with mpi launch but on 1 CPU, e.g. if you are using mpirun : export SERIAL\_LAUNCH\_WAV="mpirun -np 1 ". Note that you also need to have your netcdf libraries correctly set up in your environment (the librairies that you used to compile WW3).
