Skip to content

testing calc_rmax #48

@oceandie

Description

@oceandie

I found some inconsistencies in the way calc_rmax works. I've developed a quick python code for:

  1. read AMM7 bathymetry;
  2. create an envelope bathymetry and smooth it: it implements exactly NEMO Fortran90 code (very inefficient but at least we know what it does)
  3. compute the maximum rmax with three different codes: original numpy version of James; xarray version of James code; my old code (actually adapted from pyROMS, it very inefficient but I think it is clear what it does).

If we smooth the envelope with an rn_rmax threshold of 0.24, the following is the pring of the iterative smoothing:
python test_rmax_calc.py
Iter: 1 rmax: 1.0
Iter: 2 rmax: 0.9353992591835926
Iter: 3 rmax: 0.9187177073344386
Iter: 4 rmax: 0.8765126597150313
Iter: 5 rmax: 0.8185786808404448
Iter: 6 rmax: 0.7347370279088926
Iter: 7 rmax: 0.7347370279088925
Iter: 8 rmax: 0.6074021541852422
Iter: 9 rmax: 0.5717732932642535
Iter: 10 rmax: 0.4755012414806615
Iter: 11 rmax: 0.37086087298353765
Iter: 12 rmax: 0.24000000000000007

The rmax computed by the three codes are the following:

  1. calc_rmax_xr: 0.34985075453036585 (xarray code)
  2. calc_rmax_np: 0.34985075453036585 (numpy code)
  3. SlopeParam: 0.24000000000000005 (ROMS code)

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions