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

MOM6: +Corrected the use of array syntax calculations #1108

Merged
merged 7 commits into from
May 12, 2020

Conversation

Hallberg-NOAA
Copy link
Collaborator

Corrected the use (or misuse) of array syntax in assignments and arithmetic,
and added new grid arguments to update_ALE_sponge_field so that the correct
array indexing will be used in the sponges if global indexing is used. All
answers are bitwise identical in the MOM6-examples test suite, and there are no
changes to any output files. This PR enforces some MOM6 coding conventions
regarding the use of array syntax and prepares to try global indexing. The
commits in this PR include:

  Replaced array syntax arithmetic with explicit loops in shelf_calc_flux, so
that uninitialized values in halo points could not trigger model failures.  All
answers are bitwise identical.
  Replaced array syntax sums in MOM_internal_tides with explicit loops. Also
documented internal variable units in MOM_internal_tides, and noted an incorrect
expression in PPM_angular_advect with a comment (with '###') and a suggested
correction.  All answers are bitwise identical because the bug was noted but not
corrected.
  Added array-syntax notation for full-array copies in offline_diabatic_ale.
All answers are bitwise identical.
  Removed duplicated dimension declarations for two ppoly variables in
bulk_average in MOM_lateral_boundary_diffusion.  When I first saw these
declarations, they were confusing to me, as I was unsure at first whether they
are actually declaring 4-d arrays or 2-d arrays (it is the latter).  Also
removed unneeded full array syntax in 2 subroutine calls, and merged a pair of
do-loop statements with common loop contents.  All answers are bitwise
identical.
  Combined scaling factors when reading internal tide TKE input from a file for
use with the Nikurashin mixing scheme, while also eliminating an array-syntax
multiplication.  All answers are bitwise identical.
  Added grid type arguments to calls to update_ALE_sponge_field so that the
internal array pointers set by this routine will use the same indexing
conventions as the rest of the MOM6 code.  Also added comments describing some
arguments and other variables and got rid of some unneeded line continuations in
MOM.F90.  All answers are bitwise identical, but there are two new arguments to
update_ALE_sponge_field.
  Added array-syntax notation for a full-array copy in ISOMIP_Tracer.F90. All
answers are bitwise identical.
@codecov-io
Copy link

codecov-io commented May 11, 2020

Codecov Report

Merging #1108 into dev/gfdl will decrease coverage by 0.28%.
The diff coverage is 1.61%.

Impacted file tree graph

@@             Coverage Diff              @@
##           dev/gfdl    #1108      +/-   ##
============================================
- Coverage     46.06%   45.78%   -0.29%     
============================================
  Files           214      214              
  Lines         69361    69352       -9     
============================================
- Hits          31954    31751     -203     
- Misses        37407    37601     +194     
Impacted Files Coverage Δ
src/core/MOM.F90 65.49% <0.00%> (-0.29%) ⬇️
src/ice_shelf/MOM_ice_shelf.F90 0.00% <0.00%> (ø)
...c/parameterizations/lateral/MOM_internal_tides.F90 0.00% <0.00%> (ø)
...rc/parameterizations/vertical/MOM_tidal_mixing.F90 10.51% <0.00%> (+0.01%) ⬆️
src/tracer/ISOMIP_tracer.F90 0.00% <0.00%> (ø)
src/tracer/MOM_lateral_boundary_diffusion.F90 69.30% <0.00%> (+0.01%) ⬆️
src/tracer/MOM_offline_main.F90 0.00% <0.00%> (ø)
src/parameterizations/vertical/MOM_ALE_sponge.F90 26.60% <8.00%> (+0.31%) ⬆️
src/core/MOM_dynamics_unsplit_RK2.F90 0.00% <0.00%> (-92.62%) ⬇️
src/framework/MOM_file_parser.F90 68.13% <0.00%> (-0.49%) ⬇️
... and 5 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 70cfd64...b2453e4. Read the comment docs.

@marshallward
Copy link
Collaborator

Gaea regression test: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/pipelines/10368

Test has passed.

@marshallward marshallward merged commit 3e7766a into mom-ocean:dev/gfdl May 12, 2020
@Hallberg-NOAA Hallberg-NOAA deleted the array_syntax_cleanup branch July 30, 2021 18:47
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.

3 participants