ESMG / gridtools

A collection of grid generation tools.
Other
17 stars 15 forks source link

[Bug]: angle_dx field in the Arctic domain is wrong #19

Open kshedstrom opened 2 years ago

kshedstrom commented 2 years ago

Contact Details

No response

What happened?

It ranges from zero to pi: angle !

How to replicate?

View angle_dx. I did a grep for 'angle_dx' and can't find that it is used anywhere. Is it?

Relevant log or error output

No response

global attributes

No response

jr3cermak commented 2 years ago

This was apparently fixed by uncommenting a section of code shown below.

If converting a ROMS grid to a MOM6 grid:

https://github.com/ESMG/gridtools/blob/6764e65407cd78fb439abb717e56f67d038a9f62/gridtools/grids/mom6.py#L749-L758

Uncomment lines 751-753, regenerate the MOM6 grid and check the angles again. A future release will document an additional keyword argument to pass to trigger the alternate calculation of the angle. It is not clearly understood the conditions that require the alternate calculation of the angle. By default, the gridtools library will maintain its current behavior.

If creating a MOM6 grid for the first time, this code needs to be altered:

https://github.com/ESMG/gridtools/blob/6764e65407cd78fb439abb717e56f67d038a9f62/gridtools/gridutils.py#L568-L582

Uncomment lines 573-575.

This only applies to spherical grids.