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

Ice shelf travis upgrade #1249

Conversation

MJHarrison-GFDL
Copy link
Contributor

Ice shelf updates for Travis

  • Greater consistency with MOM6 coding standards
  • Improved modularity of ice shelf code
  • Updates for Travis testing

  - Greater consistency with MOM6 coding standards.
  - Improved modularity.
  - Code updates for future Travis test.
@codecov-io
Copy link

codecov-io commented Nov 11, 2020

Codecov Report

Merging #1249 (f9af211) into dev/gfdl (42a9eaf) will decrease coverage by 0.30%.
The diff coverage is 31.86%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
...g_src/external/GFDL_ocean_BGC/FMS_coupler_util.F90 0.00% <0.00%> (ø)
...fig_src/external/GFDL_ocean_BGC/generic_tracer.F90 0.00% <0.00%> (ø)
...c/external/GFDL_ocean_BGC/generic_tracer_utils.F90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/kdtree.f90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/ocean_da_core.F90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/ocean_da_types.F90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/write_ocean_obs.F90 0.00% <0.00%> (ø)
config_src/solo_driver/MESO_surface_forcing.F90 0.00% <0.00%> (ø)
config_src/solo_driver/user_surface_forcing.F90 0.00% <0.00%> (ø)
src/ALE/MOM_remapping.F90 70.27% <0.00%> (ø)
... and 236 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b41926...f9af211. Read the comment docs.

src/core/MOM.F90 Outdated Show resolved Hide resolved
!>@{ 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
Copy link
Collaborator

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.

@@ -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
Copy link
Collaborator

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.

Copy link
Contributor Author

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
Copy link
Collaborator

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?

Copy link
Collaborator

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/core/MOM.F90 Outdated Show resolved Hide resolved
Comment on lines 82 to 90
!! 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
Copy link
Collaborator

@marshallward marshallward Nov 13, 2020

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:

  1. Grid_in should not need to be a pointer. Grid is a pointer because it could either point to Grid_in or to its own (anonymous) rotated value, but Grid_in does not have that constraint.
  2. The ocean grid is named G in MOM, should we follow the same convention here?
  3. HI and HI_in are probably not needed, since they would generally be stored in Grid.
  4. Similarly, turns is stored in Grid%HI%turns so probably does not need to be added.

But if there's reasons for introducing these separately then disregard this comment.

!! 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
Copy link
Collaborator

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.

@marshallward
Copy link
Collaborator

marshallward commented Nov 13, 2020

This is a more general comment than the ones above, but adding arguments to initialize_ice_thickness in order to support rotation would be a different approach than the one taken in MOM.F90. The approach there would be to try and preserve initialize_ice_thickness in its original form, but also provide a rotate_ice_thickness function which transforms the fields (generated on the input index map) from G_in to G.

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
Copy link
Collaborator

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.

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
Copy link
Collaborator

@Hallberg-NOAA Hallberg-NOAA Nov 18, 2020

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.

@marshallward
Copy link
Collaborator

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.

@MJHarrison-GFDL
Copy link
Contributor Author

MJHarrison-GFDL commented Nov 19, 2020 via email

@marshallward
Copy link
Collaborator

Going to resubmit? I was just about to start testing it.

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.

4 participants