Adding metric terms to account for non-rectangular shape of grid cells#1079
Merged
alex-huth merged 2 commits intoNOAA-GFDL:dev/gfdlfrom Apr 20, 2026
Merged
Adding metric terms to account for non-rectangular shape of grid cells#1079alex-huth merged 2 commits intoNOAA-GFDL:dev/gfdlfrom
alex-huth merged 2 commits intoNOAA-GFDL:dev/gfdlfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #1079 +/- ##
============================================
- Coverage 38.75% 38.74% -0.01%
============================================
Files 274 274
Lines 92262 92279 +17
Branches 17823 17829 +6
============================================
- Hits 35753 35751 -2
- Misses 49814 49832 +18
- Partials 6695 6696 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
alex-huth
requested changes
Apr 20, 2026
alex-huth
left a comment
There was a problem hiding this comment.
Looks good, other than the changes I have requested regarding where the weight is applied for the viscosity Newton corrections in the preconditioner
Author
|
Thank you for catching these error, @alex-huth. I agree that |
This PR corrects an implementation of a finite-element solver for ice-sheet/shelf velocity. It computes a Jacobian weight J_q in shape functions for quadrature points and applies it to integrals over cells. This correction is significant when the shape of the cell is not rectangular. The same corrections are applied for subgrid parameterizations. Additionally, it fixes missing deallocations of several arrays. Changes made: - nitialize_ice_shelf_dyn: allocates a new variable `Jac` - bilinear_shape_fn_grid: computes a Jacobian determinant (`Jac`) at each quadrature point - CG_action: uses `jac_wt= Jac * IareaT` for computing the ice deformation and basal traction terms - matrix_diagonal: uses `jac_wt= Jac * IareaT` for computing diagonal terms - CG_action_subgrid_basal: computes `jac_sub_wt` using new arguments `dxCv_S`, `dxCv_N`,`dyCv_E` and `dyCv_W` that determine cell-edge spacing - ice_shelf_dyn_end: deallocates `Jac`, `CS%sx_shelf`, `CS%sy_shelf`, `CS%u_flux_bndry_val`, `CS%v_flux_bndry_val`,`CS%calv_mask`, `CS%Phi`, `CS%Phisub`, `CS%PhiC`. Copilot (model Claude Sonet 4.6) assisted with this PR.
Author
|
The requested changes have been implemented. |
alex-huth
approved these changes
Apr 20, 2026
alex-huth
left a comment
There was a problem hiding this comment.
With these changes, the PR looks correct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR corrects an implementation of a finite-element solver for ice-sheet/shelf velocity. It computes a Jacobian weight J_q in shape functions for quadrature points and applies it to integrals over cells. This correction is significant when the shape of the cell is not rectangular. The same corrections are applied for subgrid parameterizations.
Additionally, it fixes missing deallocations of several arrays.
Changes made:
JacJac) at each quadrature pointjac_wt= Jac * IareaTfor computing the ice deformation and basal traction termsjac_wt= Jac * IareaTfor computing diagonal termsJac,CS%sx_shelf,CS%sy_shelf,CS%u_flux_bndry_val,CS%v_flux_bndry_val,CS%calv_mask,CS%Phi,CS%Phisub,CS%PhiC.Copilot (model Claude Sonet 4.6) was used for this PR.