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

Modify quadrature used for ice shelf viscosity #468

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

alex-huth
Copy link

Previously, when ice_viscosity_compute == MODEL, ice shelf viscosity was calculated using 1 quadrature point per cell; however, this quadrature point was not centered in the cell.
-Added a routine bilinear_shape_fn_grid_1qp, which is used to instead calculate viscosity for a single, cell-centered quadrature point
-Also added an option to define parameter ice_viscosity_compute = MODEL_QUADRATURE, where viscosity is instead calculated at the same four quadrature points used during the SSA solution (the typical approach in finite element codes, which should be more accurate).

The effective stress, Ee, varies between each quadrature point. If using one quad point, Ee is incorporated directly into ice_visc(:,:), but if using 4 quad points, it is saved in a separate array CS%Ee(:,:,:). In the latter case, ice viscosity is then incorporated into the SSA for a cell with indices i,j as ice_visc(i,j) * Ee(i,j,k) (where k the current quad point). The post_data call for ice_visc when using 4 quad points is then ice_visc(i,j)*Ee_av(i,j), where Ee_av(i,j) is the average Ee in the cell.

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #468 (fb9131b) into dev/gfdl (23345f0) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head fb9131b differs from pull request most recent head 395fdb6. Consider uploading reports for the commit 395fdb6 to get more accurate results

@@             Coverage Diff              @@
##           dev/gfdl     #468      +/-   ##
============================================
- Coverage     37.83%   37.81%   -0.02%     
============================================
  Files           270      270              
  Lines         78340    78381      +41     
  Branches      14503    14515      +12     
============================================
+ Hits          29639    29640       +1     
- Misses        43297    43338      +41     
+ Partials       5404     5403       -1     
Files Coverage Δ
src/ice_shelf/MOM_ice_shelf_dynamics.F90 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Previously, when ice_viscosity_compute == MODEL, ice shelf viscosity was calculated using 1 quadrature point per cell; however, this quadrature point was not centered in the cell.
-Added a routine bilinear_shape_fn_grid_1qp, which is used to instead calculate viscosity for a single cell-centered quadrature point
-Added an option to define parameter ice_viscosity_compute = MODEL_QUADRATURE, where viscosity is calculated at the same four quadrature points used during the SSA solution (the typical approach in finite element codes).

Note that when using one quadrature point (ice_viscosity_compute == MODEL), array ice_visc(:,:) is the cell-centered ice viscosity. When using four quadrature points (ice_viscosity_compute == MODEL_QUADRATURE), ice_visc(:,:) is the cell-centered ice viscosity divided by the effective stress, Ee, which varies between each quadrature point and is saved in a separate array CS%Ee(:,:,:). In the SSA, ice viscosity is calculated for a cell with indices i,j as ice_visc(i,j) * Ee, where Ee=1 if using one quadrature point for viscosity and Ee=CS%Ee(i,j,k) if using four quad points (where k the current quad point). Also note the post_data call for ice_visc when using four quad points, where Ice_visc is outputted for visualization from a cell as ice_visc(i,j)*Ee_av(i,j), where Ee_av(i,j) is the average Ee in the cell.
@alex-huth alex-huth force-pushed the IS_viscosity_quad_edits branch from c95b33f to 395fdb6 Compare October 10, 2023 16:39
Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall these changes seem sensible to me.

I do have one coding-style suggestion to make, however, @alex-huth. This new code repeatedly compares a string with a specified value within the time stepping of the model. This can be inefficient. Rather than repeatedly comparing the string CS%ice_viscosity_compute with "MODEL_QUADRATURE" or "MODEL", etc., it would be better to follow the practice elsewhere in the MOM6 code and doing this string comparison once when the string is first read in, and then using it to set one or more logical variables in the control structure. These logical variables can then be used in place of all the other string comparisons. This is not urgent, so I am approving the code as written, but it would be I good idea to make this change at some point.

@Hallberg-NOAA
Copy link
Member

This has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/20896.

@Hallberg-NOAA Hallberg-NOAA merged commit 41609c2 into NOAA-GFDL:dev/gfdl Oct 10, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants