Error making initial conditions with d_initial.m

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
LuishBordin
Posts: 2
Joined: Sat Nov 25, 2023 2:34 am
Location: NGI & AOML - NOAA

Error making initial conditions with d_initial.m

#1 Unread post by LuishBordin »

Hi all, I hope you are doing well!

Please, could someone help me with an issue? I'm a new user of ROMS, working with an existent, published model, but planning to make some modifications.
One of the first steps is being to generate initial conditions. I'm using the matlab Arango's pre-processing tools, in this case, d_initials.m script. However, I'm getting the error:

"The number of elements implied by the count argument (37516) does not equal the number of data elements (36736)".

The grid has 224 RHO-points on the Lm direction, and 164 on the Mn, totaling 36736 elements. The error occurs because the script adds 2 elements on both, Lm and Mn, that is, 226*166 = 37516 elements, creating such incompatibility. I'm trying to learn about the grid properties to figure out what I'm doing wrong, since I assume the Arango's script is correct. Should I fill in the Lm and Mn with minus 2 elements? If I do this, I have that issue solved, but I got another error message:

"Error using nc_read (line 82) NC_READ: cannot find NetCDF variable: zout".

What property is zout??? It should be contained in the OAname nc file, what I assume to be the source of the data I want to use as initial conditions, and that I downloaded from the Glorys global model. Am I correct about my assumptions? I could not find anywhere about instructions to the Arango's toolbox, nor about these issues and parameter.
Please, could someone clarify it to me?
Thank you very much in advance!

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Error making initial conditions with d_initial.m

#2 Unread post by wilkin »

There is a diagram of the ROMS computational grid here:
https://www.myroms.org/wiki/Numerical_S ... _Technique

The rho cells number from 0 to L (in green), so there are L+1 values. This is the netcdf file dimension xi_rho.

In roms.in you indicate parameter Lm, which stands for L minus 1. So, xi_rho = Lm + 2. This is why you have an apparent mismatch in dimensions.

Lm is the number of points (in the diagram) in the physical domain space (i = 1 to L-1). The rho points outside this space (i=0, and i=L) are there for completing the numerical stencil for advection and diffusion, etc., and their values are set by the open boundary condition scheme.

I suppose we could have had Lp,Mp in roms.in, but it has always been Lm (and Mm) because back in ancient history the netcdf dimensions changed when periodic boundary conditions were applied ... not anymore so don't worry about that.

If you are running in parallel with multiple tiles (NtileI or NtileJ not equal to 1) then if you have small prime factors of Lm,Mm you will get equal sized tiles, e.g. Lm = 128 and NtileI = 4 gives 4 tiles all with 32 cells in the i-direction. If you make xi_rho = 128, so Lm is 126, you'll have uneven tiles. This is why we persist with defining the grid with Lm,Mm. Also, if you want to set an analytical grid of length X meters, then delta-x will be X/Lm.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply