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

+Refactor nominal depth in ALE code #381

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

Hallberg-NOAA
Copy link
Member

Refactored 6 files in the ALE directory to calculate the nominal depth in thickness units in a single place (it is done in regridding_main now) and pass it to the various places where it is used, in a preparatory step to modify how this calculation is done in non-Boussinesq mode. There are new arguments to several publicly visible routines, including:

  • Add non_depth_H arguments to hybgen_regrid, build_zstar_grid, build_sigma_grid, build_rho_grid, build_grid_HyCOM1, build_grid_adaptive, build_adapt_column and build_grid_arbitrary

  • Add optional zScale arguments to build_zstar_grid and build_grid_HyCOM1

  • Add unit_scale_type arguments to regridding_main, ALE_regrid_accelerated and ALE_offline_inputs

Also eliminated an incorrect rescaling GV%Z_to_H facto when calculating the total column thickness from the layer thicknesses when an ice shelf is used with a Hycom grid. This would have caused dimensional consistency testing to fail.

Added the new runtime parameters HYBGEN_H_THIN, HYBGEN_FAR_FROM_SURFACE, HYBGEN_FAR_FROM_BOTTOM, and HYBGEN_DENSITY_EPSILON to set previously hard-coded dimensional parameters used in the Hybgen regridding code and store these values in new variables in hybgen_regrid_CS. Two of these are no longer passed to hybgen_column_regrid as separate parameters. By default these new runtime parameters recover the previous hard-coded values.

Also eliminated an unused block of code in build_rho_column. Several comments documenting variables or their units were also added.

All answers are bitwise identical, but there are 4 new runtime parameters that would appear in some MOM_parameter_doc files and there are changes to the arguments to 11 routines.

  Refactored 6 files in the ALE directory to calculate the nominal depth in
thickness units in a single place (it is done in regridding_main now) and pass
it to the various places where it is used, in a preparatory step to modify how
this calculation is done in non-Boussinesq mode.  There are new arguments to
several publicly visible routines, including:

- Add non_depth_H arguments to hybgen_regrid, build_zstar_grid,
  build_sigma_grid, build_rho_grid, build_grid_HyCOM1, build_grid_adaptive,
  build_adapt_column and build_grid_arbitrary

- Add optional zScale arguments to build_zstar_grid and build_grid_HyCOM1

- Add unit_scale_type arguments to regridding_main, ALE_regrid_accelerated and
  ALE_offline_inputs

  Also eliminated an incorrect rescaling GV%Z_to_H facto when calculating the
total column thickness from the layer thicknesses when an ice shelf is used
with a Hycom grid.  This would have caused dimensional consistency testing to
fail.

  Added the new runtime parameters HYBGEN_H_THIN, HYBGEN_FAR_FROM_SURFACE
HYBGEN_FAR_FROM_BOTTOM, and HYBGEN_DENSITY_EPSILON to set previously hard-coded
dimensional parameters used in the Hybgen regridding code and store these
values in new variables in hybgen_regrid_CS.  Two of these are no longer passed
to hybgen_column_regrid as separate parameters.  By default these new runtime
parameters recover the previous hard-coded values.

  Also eliminated an unused block of code in build_rho_column.  Several
comments documenting variables or their units were also added.

  All answers are bitwise identical, but there are 4 new runtime parameters
that would appear in some MOM_parameter_doc files and there are changes to the
arguments to 11 routines.
@Hallberg-NOAA Hallberg-NOAA added refactor Code cleanup with no changes in functionality or results Parameter change Input parameter changes (addition, removal, or description) labels Jun 18, 2023
@codecov
Copy link

codecov bot commented Jun 18, 2023

Codecov Report

Merging #381 (a98c44b) into dev/gfdl (620d933) will increase coverage by 0.00%.
The diff coverage is 20.00%.

❗ Current head a98c44b differs from pull request most recent head 2d56084. Consider uploading reports for the commit 2d56084 to get more accurate results

@@            Coverage Diff            @@
##           dev/gfdl     #381   +/-   ##
=========================================
  Coverage     38.21%   38.22%           
=========================================
  Files           269      269           
  Lines         76413    76413           
  Branches      14033    14031    -2     
=========================================
+ Hits          29204    29207    +3     
+ Misses        41967    41963    -4     
- Partials       5242     5243    +1     
Impacted Files Coverage Δ
src/ALE/MOM_ALE.F90 44.81% <0.00%> (ø)
src/ALE/MOM_hybgen_regrid.F90 0.00% <0.00%> (ø)
src/ALE/coord_adapt.F90 0.00% <0.00%> (ø)
src/ALE/coord_hycom.F90 0.00% <ø> (ø)
src/ALE/coord_rho.F90 13.33% <ø> (+0.59%) ⬆️
src/initialization/MOM_state_initialization.F90 23.32% <ø> (ø)
src/tracer/MOM_offline_main.F90 0.00% <ø> (ø)
src/ALE/MOM_regridding.F90 28.92% <37.50%> (+0.28%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@adcroft adcroft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adcroft adcroft merged commit 77b5881 into NOAA-GFDL:dev/gfdl Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Parameter change Input parameter changes (addition, removal, or description) refactor Code cleanup with no changes in functionality or results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants