Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate ice shelf forcing and initialization #712

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

Hallberg-NOAA
Copy link
Member

Added the ability to rotate the ice shelf forcing and initialization. The specific changes include correcting the grid passed to a call to initialize_ice_shelf() in initialize_MOM(), using a temporary mech_forcing type in add_shelf_forces() when the grid is rotated, uncommenting and correcting the draft rotate_index code in initialize_ice_shelf(), and correcting some error-checking and the grid passed to add_shelf_fluxes() in initialize_ice_shelf_forces(). In addition, unused hor_index_type elements were removed from the ice_shelf_CS, and some callTree calls were added to save_MOM_restart() and initialize_ice_shelf(). Without rotation, all answers are bitwise identical, but some cases that would have failed previously will now work.

  Added the ability to rotate the ice shelf forcing and initialization.  The
specific changes include correcting the grid passed to a call to
initialize_ice_shelf in initialize_MOM, using a temporary mech_forcing type in
add_shelf_forces when the grid is rotated, uncommenting and correcting the draft
rotate_index code in initialize_ice_shelf, and correcting some error-checking
and the grid passed to add_shelf_fluxes in initialize_ice_shelf_forces.  In
addition, unused hor_index_type elements were removed from the ice_shelf_CS, and
some callTree calls were added to save_MOM_restart and initialize_ice_shelf.
Without rotation, all answers are bitwise identical, but some cases that would
have failed previously will now work.
@marshallward
Copy link
Member

marshallward commented Aug 19, 2024

I've started looking at this, mostly it seems OK. Some of the checks happening in initialize_shelf_forces and add_shelf_forces seem unnecessary. The external_call argument seems to be used to detect rotation state, but this should already be defined in CS%Grid via Grid%HI%turns, if not CS%rotate_index. (external_call does not even seem to be used in the model. Maybe the thought was to support both rotated and unrotated fields? This seems very far from the current design of index rotation. Nevermind, I see that this is used in the solo drivers. Still unsure about this usage, but I will look into it more.)

Since rotation state is already established, the addition index matching checks in Ocn_grid%isc etc seem out of place (and would not even detect a 180-rotation).

I am also surprised that CS%Grid_in exists. Generally the CS should be oblivious to the input rotation state and focused on its own grid.

Some of this is just following the current code, so maybe these comments are a bit out of scope. I could also probably articulate these concerns a bit more, but I wanted to at least get them in before forgetting.

@marshallward
Copy link
Member

The independent ice shelf grid rotation makes more sense when run alongside the ocean model, rather than within it, so I think that I am OK with this.

The extra index checking should probably be removed, but I guess there's no harm for now.

@marshallward
Copy link
Member

@marshallward marshallward merged commit 5fc90eb into NOAA-GFDL:dev/gfdl Sep 12, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants