Commit ce4dd0b
authored
Add zero_gradient and linear_extrap boundary conditions (#1094)
PR checklist
Short (1 sentence) summary of your PR:
Add zero_gradient and linear_extrap boundary conditions
Developer(s):
apcraig
Suggest PR reviewers from list in the column to the right.
Please copy the PR test results link or provide a summary of testing completed below.
All tests pass and bit-for-bit as expected. https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#0e59535ce2009a3175e67156793b3ec83f2a3c69
How much do the PR code changes differ from the unmodified code?
bit for bit
different at roundoff level
more substantial
Does this PR create or have dependencies on Icepack or any other models?
Yes
No
Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
Yes
No
Does this PR add any new test cases?
Yes
No
Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
Yes
No, does the documentation need to be updated at a later time?
Yes
No
Please document the changes in detail, including why the changes are made. This will become part of the PR commit log.
Add zero_gradient and linear_extrap boundary conditions
This provides options to set the boundary conditions around the edge for a regional grid. Only halo values on the outside halo are affected. This is implemented largely in the HaloUpdates in ice_boundary.F90, both in the mpi and serial implementations. The boundary conditions are computed locally for each block and don't require any explicit communications. They are implemented consistent with mixing boundary conditions in the ew and ns directions. The zero_gradient boundary condition sets the halo equal to the values on the boundary of the domain, basically zero gradient into the halo. The linear_extrap boundary condition sets the halo values such that the gradient across the halo matches the gradient on the edge of the active domain, basically constant gradient.
The zero_gradient and linear_extrap boundary conditions have been implemented as an interim step toward a regional grid capability. Until restoring options are complete and the regional capability is fully tested, these boundary conditions may produce nonphysical values such as negative ice thickness.
- Added zero_gradient and linear_extrap code to HaloUpdate subroutines.
- Refactored the ice_boundary.F90 to leverage automated code generation and sync the mpi and serial versions of the code.
- Created a generate_haloUpdates.sh script to generate the various haloUpdate subroutines quickly and consistently. This script lives in cicecore/cicedyn/infrastructure/comm/mpi and has a README. This reduces effort and risk if the haloUpdate needs to be updated in the future.
- Synchronized the mpi and serial versions of ice_boundary.F90. Now the only difference in the files is a #define in the serial version to turn off the MPI code.
- Update the halochk subroutines to validate zero_gradient and linear_extrap boundary condition options.
- Updated some initialization to account for the new boundary condition options.
- Added explicit checks for valid boundary_type settings in ice_domain.F90. This means checks for invalid values later in the code can be removed.
- Add set_nml.boxgauss which is a box test with a gauss distibution of ice in the center. Added several tests leveraging this new configuration. Added bczerogradient and bclinearextrap set_nml options and tests.
- Update the set_nml filenames for boundary condition settings, add "bc" to start of string.
- Update the test suite to cover the new boundary conditions and improve halochk unit test coverage overall.
- Update the documentation.
Improved the plabeld argument type in debug_ice so the string length is more flexible. This issue was detected while testing.
Update initialization of uvmCD in ice_grid.F90 due to uninitialized values triggering and error in some compilers.1 parent 783a867 commit ce4dd0b
25 files changed
Lines changed: 9910 additions & 3681 deletions
File tree
- cicecore
- cicedyn
- analysis
- infrastructure
- comm
- mpi
- serial
- drivers/unittest/halochk
- configuration/scripts
- options
- tests
- doc/source/user_guide
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1722 | 1722 | | |
1723 | 1723 | | |
1724 | 1724 | | |
1725 | | - | |
| 1725 | + | |
1726 | 1726 | | |
1727 | 1727 | | |
1728 | 1728 | | |
| |||
1772 | 1772 | | |
1773 | 1773 | | |
1774 | 1774 | | |
1775 | | - | |
| 1775 | + | |
1776 | 1776 | | |
1777 | 1777 | | |
1778 | 1778 | | |
| |||
1791 | 1791 | | |
1792 | 1792 | | |
1793 | 1793 | | |
1794 | | - | |
| 1794 | + | |
1795 | 1795 | | |
1796 | 1796 | | |
1797 | 1797 | | |
| |||
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
0 commit comments