NOAA-GFDL / pace

Re-write of FV3GFS weather/climate model in Python
Apache License 2.0
12 stars 11 forks source link

Grid Type should be an enum #29

Open oelbert opened 11 months ago

oelbert commented 11 months ago

The grid_type variable indicates what the model's grid geometry is, and is currently an int, in keeping with the Fortran code. The main distinction is if grid_type is 0, 1, or 2 that specifies a cubed-sphere geometry (only 0 is currently supported, the gnomonic equidistant cubed-sphere), and if grid_type is 3 or greater the model is run with an orthogonal doubly-periodic grid (typically set with grid_type=4). Pace doesn't need grid_type to be an integer, and for clarity we should switch to an enum that governs the grid type in the code first with gnomonic cubed sphere and orthogonal members.

FlorianDeconinck commented 11 months ago

Additionally, any functionality around the that grid_type (testing if it's <X or ==X) should be made into a well named method on the enum.

Bonus point for a good str, repr and docstring