-
Notifications
You must be signed in to change notification settings - Fork 232
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
Ice shelf travis upgrade #1249
Ice shelf travis upgrade #1249
Conversation
- Greater consistency with MOM6 coding standards. - Improved modularity. - Code updates for future Travis test.
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #1249 +/- ##
============================================
- Coverage 46.08% 45.77% -0.31%
============================================
Files 214 225 +11
Lines 69399 71456 +2057
============================================
+ Hits 31984 32711 +727
- Misses 37415 38745 +1330
Continue to review full report at Codecov.
|
!>@{ The following are 3D and 2D axis groups defined for output. The names indicate | ||
!! the horizontal locations (B, T, Cu, or Cv), vertical locations (L, i, or 1) and | ||
!! thickness categories (c, c0, or 1). | ||
type(axesType) :: axesBL, axesTL, axesCuL, axesCvL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the axesType variables on lines 79-82 are defined or used with the ice shelves. They should be deleted, at least for now. If we add a 3-d structure to the ice shelves, new types can be added when they are being properly defined.
src/ice_shelf/MOM_ice_shelf.F90
Outdated
@@ -181,28 +194,28 @@ module MOM_ice_shelf | |||
|
|||
logical :: debug !< If true, write verbose checksums for debugging purposes | |||
!! and use reproducible sums | |||
integer :: id_clock_shelf=-1 !< CPU Clock for the ice shelf code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPU clocks are typically treated as module variables, because they are not instance specific, but instead track the time in code, and should be summed across all ensemble members. These CPU clocks are among the very few MOM6 prohibitions against the use of module variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
||
if (CS%rotate_index) then | ||
allocate(tmp2d(CS%Grid_in%isc:CS%Grid_in%iec,CS%Grid_in%jsc:CS%Grid_in%jec));tmp2d(:,:)=0.0 | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should end with ; tmp2(:,:) = 0.0
like the line above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allocation, call to time_interp_external
, and rotation could be replaced with rotated_time_interp_external
, see MOM_horizontal_regridding.F90
.
src/ice_shelf/MOM_ice_shelf.F90
Outdated
!! structure for the ice shelves | ||
type(ocean_grid_type), pointer :: Grid_in => NULL() !< un-rotated input grid metric | ||
type(hor_index_type), pointer :: HI_in => NULL() !< Pointer to a horizontal indexing structure for | ||
!! incoming data which has not been rotated. | ||
type(hor_index_type), pointer :: HI => NULL() !< Pointer to a horizontal indexing structure for | ||
!! incoming data which has not been rotated. | ||
logical :: rotate_index = .false. !< True if index map is rotated | ||
integer :: turns !< The number of quarter turns for rotation testing. | ||
type(ocean_grid_type), pointer :: Grid => NULL() !< Grid for the ice-shelf model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the MOM_CS
implementation, I have the following comments:
Grid_in
should not need to be a pointer.Grid
is a pointer because it could either point toGrid_in
or to its own (anonymous) rotated value, butGrid_in
does not have that constraint.- The ocean grid is named
G
in MOM, should we follow the same convention here? HI
andHI_in
are probably not needed, since they would generally be stored inGrid
.- Similarly,
turns
is stored inGrid%HI%turns
so probably does not need to be added.
But if there's reasons for introducing these separately then disregard this comment.
src/ice_shelf/MOM_ice_shelf.F90
Outdated
!! describe the surface state of the ocean. The | ||
!! intent is only inout to allow for halo updates. | ||
type(forcing), intent(inout) :: fluxes !< structure containing pointers to any possible | ||
type(forcing), pointer :: fluxes_in !< structure containing pointers to any possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and other *_in
) forcing inputs should probably be declared as target
rather than pointer
.
This is a more general comment than the ones above, but adding arguments to IMO this would be the better approach; I can try to implement this if you want. |
if (rotate) then | ||
allocate(tmp1_2d(G_in%isd:G_in%ied,G_in%jsd:G_in%jed));tmp1_2d(:,:)=0.0 | ||
allocate(tmp2_2d(G_in%isd:G_in%ied,G_in%jsd:G_in%jed));tmp2_2d(:,:)=0.0 | ||
allocate(tmp3_2d(G_in%isd:G_in%ied,G_in%jsd:G_in%jed));tmp3_2d(:,:)=0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allocate_rotated_array
may be useful here.
Also, as mentioned in the generic comment, we may want to spin off the rotation of the ice thickness parameters into a separate rotate_ice_thickness
function.
src/ice_shelf/MOM_ice_shelf.F90
Outdated
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type | ||
type(ice_shelf_CS), pointer :: CS !< This module's control structure. | ||
type(mech_forcing), intent(inout) :: forces !< A structure with the driving mechanical forces | ||
type(mech_forcing), target :: forces_in !< A structure with the driving mechanical forces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be an intent declaration for the forces_in structure, and similarly for the fluxes_in structure above at line 213, as well as the types passed in at lines 1159 and 1160.
I am working on cleaning up the rotation code. Will try to wrap it up quickly... @MJHarrison-GFDL I am testing my changes against your tc4 in the old PR #1210. |
Yes . #1249 does not have an active ice shelf. We were going to change
answers and turn on the shelf after #1249
…On Wed, Nov 18, 2020 at 5:36 PM Marshall Ward ***@***.***> wrote:
I am working on cleaning up the rotation code. Will try to wrap it up
quickly...
@MJHarrison-GFDL <https://github.com/MJHarrison-GFDL> I am testing my
changes against your tc4 in the old PR #1210
<https://github.com/NOAA-GFDL/MOM6/pull/1210>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/NOAA-GFDL/MOM6/pull/1249#issuecomment-730000861>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSPZ4GP4X324GULC44QZT3SQRD6HANCNFSM4TSERO5Q>
.
--
Matthew Harrison (he/him)
USDOC/NOAA/GFDL/Oceans&Cryosphere
|
…/MOM6 into ice_shelf_travis_upgrade
Going to resubmit? I was just about to start testing it. |
Ice shelf updates for Travis