Skip to content

Corrected the units of 124 variables#2

Merged
marshallward merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:fix_units_in_comments
Nov 19, 2021
Merged

Corrected the units of 124 variables#2
marshallward merged 2 commits into
NOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA:fix_units_in_comments

Conversation

@Hallberg-NOAA
Copy link
Copy Markdown
Member

Corrected the units in comments describing 124 variables in 39 files. In
addition three unused variables were eliminated. All answers and output are
bitwise identical.

  Corrected the units in comments describing 124 variables in 39 files.  In
addition three unused variables were eliminated.  All answers and output are
bitwise identical.
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 13, 2021

Codecov Report

Merging #2 (5c74aee) into dev/gfdl (d7b2e32) will decrease coverage by 0.00%.
The diff coverage is 28.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##           dev/gfdl       #2      +/-   ##
============================================
- Coverage     29.15%   29.15%   -0.01%     
============================================
  Files           239      239              
  Lines         71462    71463       +1     
============================================
  Hits          20833    20833              
- Misses        50629    50630       +1     
Impacted Files Coverage Δ
src/ALE/MOM_ALE.F90 34.68% <0.00%> (ø)
src/core/MOM.F90 58.89% <ø> (ø)
src/core/MOM_PressureForce_FV.F90 32.81% <0.00%> (ø)
src/core/MOM_density_integrals.F90 9.39% <ø> (ø)
src/core/MOM_dynamics_split_RK2.F90 61.08% <ø> (ø)
src/core/MOM_forcing_type.F90 47.43% <0.00%> (ø)
src/core/MOM_verticalGrid.F90 70.21% <ø> (ø)
src/diagnostics/MOM_diagnostics.F90 76.40% <ø> (ø)
src/diagnostics/MOM_sum_output.F90 62.75% <ø> (ø)
src/diagnostics/MOM_wave_structure.F90 0.00% <0.00%> (ø)
... and 29 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 d7b2e32...5c74aee. Read the comment docs.

@marshallward
Copy link
Copy Markdown
Member

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/14113 ✔️

@marshallward marshallward merged commit e2e5787 into NOAA-GFDL:dev/gfdl Nov 19, 2021
@Hallberg-NOAA Hallberg-NOAA deleted the fix_units_in_comments branch November 27, 2021 11:20
@Hallberg-NOAA Hallberg-NOAA added the documentation Improvements or additions to documentation label Feb 1, 2022
kshedstrom added a commit to ESMG/MOM6 that referenced this pull request Apr 12, 2024
- otherwise it doesn't compile without linking to COBALT due to
   COBALT interface updates.
Pperezhogin added a commit to Pperezhogin/MOM6 that referenced this pull request May 9, 2025
Blank commit after squash/rebase was handled on command line
Hallberg-NOAA pushed a commit that referenced this pull request Sep 19, 2025
* Add MOM_ANN module

* Mesoscale momentum parameterization with ANN

- Computes subgrid stress using ANN in MOM_Zanna_Bolton
- Uses MOM_ANN module for ANN inference

Equivalent MOM_override for defaults
```
USE_ZB2020 = True
ZB2020_USE_ANN = True
USE_CIRCULATION_IN_HORVISC = True
ZB2020_ANN_FILE_TALL = /path/to/ocean3d/subfilter/FGR3/EXP1/model/Tall.nc
```

* Mesoscale momentum parameterization with ANN (#2)

Blank commit after squash/rebase was handled on command line

* Moved MOM_ANN.F90 to src/framework/

* Minor refactor of MOM_ANN

- Removed unused modules
- Removed unused MOM_memory.h
- Added input and output means which default to 0 and
  do not need to be present in the weights file
- Gave defaults to means, norms, tests so that they do
  no need to be present in file
- Added missing array notation "(:)"
- Minor formatting

* Adds unit tests and timing test to MOM_ANN

- Added ANN_allocate, set_layer, set_input_normalization, and
  set_output_normalization methods to allow reconfiguration during
  unit tests
- Added ANN_unit_tests with some simple constructed-by-code
  networks with known solutions
- Added config_src/drivers/unit_tests/test_MOM_ANN.F90 to drive
  unit tests
- Added  config_src/drivers/timing_tests/time_MOM_ANN.F90 as
  rudimentary for timing inference

* Adding multiple forms of inference

- Adds inference operating on array (instead of single vector of
  features)
- Implements several different versions of inference with various
  loop orders
  - Involves storing the transpose of A in the type
  - Tested by checking inference on same inputs is identical between
    variants
    - Added randomizers to assist in unit testing
- Adds timing of variants to config_src/drivers/timing/time_MOM_ANN.F90
- Adds an interface (MOM_apply) to select preferred version of
  inference subroutine
- Added command line args to time_MOM_ANN.F90 to allow more rapid
  evaluation of performance

Variants explored, timed with gfortran (13.2) -O3 on Xeon:
- vector_v1:
  - original inference from Pavel
- vector_v2:
  - allocate work arrays just once, using widest layer
  - loop over layers in 2's to avoid pointer calculations and copies
  - speed up, x0.8 relative to v1
- vector_v3:
  - transpose loops
  - slow down, x1.54 relative to v1
- vector_v4:
  - transpose weights with same loop order as v1
  - slow down, x1.03 relative to v1
- array_v1:
  - same structure as v2, working on x(space,feature) input/outputs
  - speed up, x0.41 relative to v1
- array_v2:
  - as for array_v1 but with transposed loop order
  - apply activation function on vector of first index while in cache
  - speed up, x0.35 relative to v1
- array_v3:
  - same structure as v2, working on x(feature,space) input/outputs
  - speed up, x0.58 relative to v1

* Renamed ANN variants and added some module documentation

- Added module dox
- Renamed _v1, _v2 etc to labels
- Added ANN_apply_array_sio to ANN_apply interface
- Replaced "flops" with "MBps" in timing output

* Removed alternative variants of ANN in favor of optimized

- Deleted variants of ANN that did not perform as well as the two
  versions that remain.

* Apply array_sio function in ANN inference for momentum fluxes (#5)

* Apply array_sio ANN inference for computation of momentum fluxes

* remove trailing space

* Initial commit

* address Robert Hallberg code review

* Restore deafult value of ZB_SCALING coefficient

---------

Co-authored-by: Alistair Adcroft <Alistair.Adcroft@noaa.gov>
Co-authored-by: Alistair Adcroft <adcroft@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants