Configuring “ww3_grid.inp” for curvilinear grids

Hello everyone.

I am having trouble configuring ww3_grid.inp in a wave-current interaction application. When I run the WW3 model without coupling, the grid is rectangular, and I can define the rest of the parameters (source terms, propagation schemes, and numerical values) in ww3_grid.inp without any problems. However, when I generate the ww3 grid from the Croco bathymetry using “create_oasis_restart_from_calm_conditions.sh,” this generates a curvilinear grid that gives me an error when I run “./ww3_grid” considering certain parameters such as those below, I must therefore leave them commented out or “turned off”… So, leaving the parameters commented out as shown below, I can run ww3_grid correctly.

$ &SIN4 BETAMAX = 1.7, ALPHA0 = 0.0095 /
$ SINTHP = 2.0, ZALP = 0.006, TAUWSHELTER = 0.3 /
$ SWELLF = 0.66, SWELLF2 = -0.018, SWELLF3 = 0.022 /
$ SWELLF4 = 1.5E+5, SWELLF5 = 1.2, SWELLF6 = 0.0 /
$ SWELLF7 = 3.6E+5, Z0RAT = 0.04, Z0MAX = 1.002 /
$ &MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 /
$ &FLX3 CDMAX = 3.5E-3 , CTYPE = 0 /
$ &OUTS E3D = 1, TH1MF = 1, STH1MF = 1, TH2MF = 1,
$ STH2MF = 1, USSP = 1, IUSSP = 5 /
$ %BT4 RIPFAC1 = 0.4, RIPFAC2 = -2.5, RIPFAC3 = 1.2 /
$ RIPFAC4 = 0.05, SIGDEPTH = 0.05, BOTROUGHMIN = 0.01 /
$ BOTROUGHFAC = 1.00 /
$ &FLX3 CDMAX = 3.5E-3 , CTYPE = 0 /
$ &SDB1 BJGAM = 1.26, BJFLAG = .FALSE. /

So, basically, I change this:

$ ‘RECT’ T ‘NONE’
$ 239 171
$ 1.76 1.76 60.
$ 268.0000 18.5000 1.00
$ -0.10 2.50 40 0.001000 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/PEN_3k.depth_ascii’
$
$ 50 0.010000 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/PEN_3k.obstr_lev1’
$
$ 60 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/PEN_3k.maskorig_ascii’

for this:
‘CURV’ T ‘NONE’
237 182
21 1 0 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/x_PENYUC-CPL.inp’
22 1 0 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/y_PENYUC-CPL.inp’
$
-15 5 23 1 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/bottom_PENYUC-CPL.inp’
$ 24 1 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/obst_PENYUC-CPL.inp’
25 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/mask_and_bdy_PENYUC-CPL.inp’
$ Close list by defining line with 0 points (mandatory)

$
0. 0. 0. 0. 0

I think it should be possible to configure these parameters in ww3_grid.inp for curvilinear meshes. If anyone can help me with this, I have attached some files that may be useful. Does anyone have a ww3_grid.inp file configured for curvilinear meshes that they can share with me so I can adapt it to my case?
grid_out.txt (10.1 KB)
ww3_grid.txt (3.1 KB)

I really appreciate your support.
Regards,
César.

Hi Cesar,
In SCRIPTS_COUPLING/WW3_IN you have ww3_grid.inp.base which is an example with curvilinear grid

Hi Swen, Thanks for your reply.

I’ve adapted ww3_grid.inp.base to a configuration without CPL to test it first, and it works for me, but if I add the lines below, it fails:

&MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 4 /
&FLX3 CDMAX = 2.5E-3 , CTYPE = 0 /
&PRO3 WDTHCG = 4.00, WDTHTH = 4.00 /
&SIN4 BETAMAX = 1.7 /
&SDS4 WHITECAPWIDTH = 0.3 /

t works if I only activate “&SIN4 BETAMAX = 1.7 /”
The error I get is the following:

The spatial grid:

   Grid type                   : curvilinear
   Coordinate system           : spherical
   Index closure type          : none
   Dimensions                  :    237     182

   X-coordinate unit           :    21
   Scale factor                :    1.0000
   Add offset                  :  0.0000E+00
   Layout indicator            :     1
   Format indicator            :     1
   File name                   : /WW3_FILES/x_PENYUC-CPL.inp

   Y-coordinate unit           :    22
   Scale factor                :    1.0000
   Add offset                  :  0.0000E+00
   Layout indicator            :     1
   Format indicator            :     1
   File name                   : /WW3_FILES/y_PENYUC-CPL.inp

   Bottom level unit           :    23
   Limiting depth          (m) :  -15.00
   Minimum depth           (m) :    5.00
   Scale factor                :    1.00
   Layout indicator            :     1
   Format indicator            :     1
   File name                   : /WW3_FILES/bottom_PENYUC-CPL.inp

   Sub-grid information        : At grid points.

*** WAVEWATCH III ERROR IN W3GRID :
ERROR IN READING FROM INPUT FILE
IOSTAT = 0

probably comes from the activation of FLAGTR in the MISC namelist that requires to define subgrid scale information with the line :
24 1 1 1 ‘(…)’ ‘NAME’ ‘obst.inp’
=> Check WW3 manual for more details !

Thank you very much for the guide. Yes, it worked!

But now something else is happening. I generated the WW3 inputs from the Croco bathymetry. My file “mask_and_bdy_PENYUC-CPL.inp” defines the mask and borders as open (see attached screenshot). This is useful for me because I have information for the open boundaries generated from a larger model. However, when I run “./ww3_grid,” the program closes the northern and eastern boundaries.

On the other hand, if I define the boundaries as open in the “Input boundary points” section, then the program does not identify the excluded points and everything becomes “sea.” I tried to find answers in the manual, but I don’t know why this happens.

Screenshot of mask_and_bdy_PENYUC-CPL.inp:

This is how I have defined these sections in ww3_grid.inp:

&MISC CICE0 = 0.25, CICEN = 0.75, FLAGTR = 0 /
&FLX3 CDMAX = 2.5E-3 , CTYPE = 0 /
&PRO3 WDTHCG = 4.00, WDTHTH = 4.00 /
&SIN4 BETAMAX = 1.7 /
&SDS4 WHITECAPWIDTH = 0.3 /
‘CURV’ T ‘NONE’
237 182
21 1 0 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/x_PENYUC-CPL.inp’
22 1 0 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/y_PENYUC-CPL.inp’
$
-15 4 23 1 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/bottom_PENYUC-CPL.inp’
$ 24 1 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/obst_PENYUC-CPL.inp’
25 1 1 ‘(…)’ ‘NAME’ ‘/WW3_FILES/mask_and_bdy_PENYUC-CPL.inp’
$ 25 1 1 ‘(…)’ ‘PART’ ‘/WW3_FILES/mask_PENYUC-CPL.inp’

Thank you very much for your support,
César.

Are you sure? if the mask you give as input is good, ww3_grid should gives you the good MAPSTA

Hi Swen,
Well, what can I say? :sweat_smile:
This is unusual because it has not happened to me before when using the traditional way to create WW3 entries (GRIDGEN)… I am trying to run WW3 with the bathymetry created from Croco’s bathymetry to avoid certain errors that may be related to the difference in the dimensions of both bathymetries. In my previous message, I showed a figure from my file “mask_and_bdy_PENYUC-CPL.inp”, which shows that the boundaries are open. But, when I run ww3_grid, I notice in my output file and in mapsta.ww3 that the north and east edges are closed (the image is rotated, an apology).
In the screenshot below , you can see that the northern and eastern borders are gray, meaning they are closed.

grid_out.txt (109.0 KB)