Hi Folks,
I want to use ana_grid to setup an nonuniform horizontal grid with finer resolution close to the boundary. I think it should be easy but I did not find any example or discussion. Thanks in advance for the help!
Jinbo Wang
How to use ana_grid to setup nonuniform horizontal grid?
Gosh, I've never done it in ana_grid, but I used to make analytical functions externally with a lot of ugly fussing and math. Remember, ROMS wants it's pm and pn fields to be as smoothly varying as the bathymetry. John Wilkin's thesis had a grid in which there was a slight jump in the grid spacing and you could see it in the results (it was small and outside the area of main interest). As usual, there's more than one way to do it:
* How are you with splines, tanh or polynomials? Set up a smooth function through a field of pm, then sum them to get the x values. Tweak to get the final domain size you were after. In the day, I'd work backwards from a desired domain size and some polynomials to match the slopes at the subdomain boundaries - say uniform in the middle, getting finer towards the coast and coarser at the open off-shore boundary.
* Do it outside ROMS - it's not hard to set up a box grid file. You could then use Seagrid or xpots to smoothly vary the gridpoints for you.
Also note, your smallest gridsize will be setting the timestep, all else being equal.
* How are you with splines, tanh or polynomials? Set up a smooth function through a field of pm, then sum them to get the x values. Tweak to get the final domain size you were after. In the day, I'd work backwards from a desired domain size and some polynomials to match the slopes at the subdomain boundaries - say uniform in the middle, getting finer towards the coast and coarser at the open off-shore boundary.
* Do it outside ROMS - it's not hard to set up a box grid file. You could then use Seagrid or xpots to smoothly vary the gridpoints for you.
Also note, your smallest gridsize will be setting the timestep, all else being equal.