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

Patch main pr net fw sign bug #5

Closed
wants to merge 77 commits into from
Closed

Patch main pr net fw sign bug #5

wants to merge 77 commits into from

Conversation

gustavo-marques
Copy link
Owner

Change default for USE_NET_FW_ADJUSTMENT_SIGN_BUG in drivers.

breichl and others added 30 commits April 14, 2020 07:41
- New MLD is computed as the depth a given energy would homogenize the water column
- Three values are coded for output, 25 J/m2, 2500 J/m2, and 250000 J/m2.
# Conflicts:
#	src/core/MOM_open_boundary.F90
# Conflicts:
#	src/core/MOM_open_boundary.F90
marshallward and others added 21 commits October 5, 2020 14:50
This patch fixes the dimensional scaling of three diagnostics:

- grid_Re_Ah
- grid_Re_Kh
- boundary_forcing_h_tendency

The fix to `grid_Re_Ah` and `grid_Re_Kh` removes the `Kh_min` and
`Ah_min` parameters, which could not be dimensionally scaled and
replaces them with variables in the control structure.

The minimum Laplacian and biharmonic viscosites are chosed to estimate
the smallest viscosity which is capable to altering the velocity.  We
use `spacing(1.) * L^2N / T` where `spacing()` is the smallest
difference in floating point.  We use the minimum harmonic grid spacing,
precomputed during initialization, rather than the local value, in order
to avoid additional computation and memory access during timestepping.

This will changes the value of grid_Re_[AK]h in certain isolated
examples of negligible viscosity, but will otherwise avoid the
possibility of divide-by-zero while also producing a realizable large
value at near-inviscid upper limit.

The second fix to `boundary_focing_h_tendency` had its T units set but
not its H units.  This patch fixes the dimensionality.

These are required to fix the dimensional verification errors in PR
1210.
The single-line if-block for reading the DT parameter did not contain
the Idt = 1. / dt update.

This patch amends this bug.
An additional `min_across_PEs` call is added to the min_grid_sp_h[24]
calculations, to accommodate for parallel builds and ensure consistency
across layouts.
  Added halo update for fluxes%p_surf_full when VERTEX_SHEAR=true.  This field
is not used directly with the vertex shear code, but its halo regions are used
in the frazil code when the diabatic solver is using slightly wider halos to
work with the VERTEX_SHEAR option for shear mixing.  Without this change, some
cases using VERTEX_SHEAR=True were not reproducing across PE layout, whereas now
they do.  There is no flag to recover the old answers because the old answers
were ill-defined.  All answers in the MOM6-examples test suite are bitwise
identical but there will be answer changes in some ice-ocean or coupled cases
with VERTEX_SHEAR=True; these cases should now reproduce across PE layouts.
+Add support for tidal variations in open boundary condition data
Changed the default for SPONGE_IDAMP_VAR from "IDAMP" to "Idamp" so that when this variable is used, as it would be with the proposed change, it does not break any existing experiments.  This could change some MOM_parameter_doc files, but will not change any solutions because the variable whose default is being set was not in use.
Diagnostics for depth-averaged acceleration from diapycnal mixing
(*)Add a halo update to fix VERTEX_SHEAR solutions
* Cleanup sponge initialization from file.

 - Deprecating NEW_SPONGES parameter with TIME_SPACE_REGRID_SPONGE
 - Fixes intialization of ALE sponges with this option set to False

* Change parameter name to INTERPOLATE_SPONGE_TIME_SPACE

* Punctuation.

* clean up sponge initialization

Co-authored-by: Robert Hallberg <[email protected]>
Co-authored-by: Marshall Ward <[email protected]>
…an#1223)

* set_viscous_BBL() expanded comments and small refactor

- Added lots of comments explaining method/equations
- Small refactor code to reduce duplicated code a smidge but really
  in preparation for a later solution changing fix
- Also removed unused diagnostic ids frin MOM_vert_friction.F90

* Added doxygen for viscous BBL

- Wrote out equations being solve with reference to model
  parameters. Includes references.

* Update to non-English spelling of bottom-most

- This must be a side effect of Brexit

* Corrects kv_BBL for some limits of BBL thickness

- The BBL viscosity used to be simply bounded to be no less than a
  minimum, KV_BBL_MIN. In some limits where the BBL thickness was smaller
  than the bottom layer thickness, this viscosity led to too much drag on
  the bottom layer.
- If CORRECT_BBL_BOUNDS=True we now also adjust bbl_thick when bounding
  Kv_bbl so that the implied stress, viscosity and thickness are all
  consistent.
- By default, CORRECT_BBL_BOUNDS=False so that existing answers are
  unchanged.

Co-authored-by: Robert Hallberg <[email protected]>
- The default for USE_NET_FW_ADJUSTMENT_SIGN_BUG had been changed to
  False but during the merge of main onto dev/gfdl the default was
  inadvertently flipped. @gustavo-marques pointed this out when reviewing
  NOAA-GFDL/MOM6#1211.
- This affects EMC and NCAR versions of drivers and is not tested at GFDL.
@adcroft adcroft deleted the patch-main-pr-net-fw-sign-bug branch November 9, 2020 23:21
gustavo-marques pushed a commit that referenced this pull request Apr 21, 2021
gustavo-marques pushed a commit that referenced this pull request Apr 21, 2021
Explicit domain decomposition of horizontal axes
gustavo-marques pushed a commit that referenced this pull request Aug 7, 2021
Update MOM_oda_incupd.F90
gustavo-marques pushed a commit that referenced this pull request Feb 2, 2022
  Added a new variable, initialized, to the control structures of modules that
had been testing for an allocated control structure to verify that it had been
initialized before it was going to be used, and then duplicated the tests using
this new variable.  This was done to enable us to go ahead with MOM6 PR #5,
which eliminated many of these checks when converting the control structures
from pointers in the parent modules to elements that are always there, and then
passing them as simple types instead of as pointers.  If we decide that we do
not need these tests after all, we can easily delete them, but until this is
discussed, this commit avoids losing the messages, as it was easier to do it
this way instead of trying to recreate them after they had been removed.  All
answers and output are bitwise identical.
gustavo-marques pushed a commit that referenced this pull request Feb 2, 2022
Redefine ~500 pointers as local or stack variables
gustavo-marques pushed a commit that referenced this pull request May 6, 2022
*Added a clock for the Stanley parameterization

Co-authored-by: jkenigson <[email protected]>
gustavo-marques pushed a commit that referenced this pull request May 17, 2022
* initial hooks for stochastic EOS modifications

* remove debug statements

* add documentation

* Change ampltiude from 0.39 to sqrt(.39)

* remove global_indexing logic from stoch_eos_init

* switch to using MOM_random and add restart capability

* update random sequence to update each each time-step

* remove tseed0 from MOM_random (leftover from debugging)

* Added necessary submodules and S^2, T^2 diagnostics to MOM_diagnostics

* Added diagnostics for outputting variables related to the stochastic parameterization.

* Diagnostics in MOM_PressureForce_FV updated for stochastic (rather than deterministic) Stanley SGS T variance parameterization.

* Added parentheses for reproducibility.

* Changed diagnostics to account for possible absence of stoch_eos_pattern in MOM_PressureForce_FV,
when deterministic parameterization is on.

* remove mom6_da_hooks and geoKdTree from pkg

* add stochastic compoment to MOM_thickness_diffuse

* fix array size declaration and post_data

* Corrected indexing of loops in MOM_calc_varT

* Changed how parameterization of SGS T variance (deterministic and stochastic) is switched on in PGF and thickness diffusion codes

* Corrected a few typos

* Cleaned up indices, redundant diagnostic, printing

* Fixed diagnostic IDs

* Fixed diagnostics typo

* Corrected indices in calculation of tv%varT

* Minor index fix

* Corrected bug in pressure in Stanley diagnostics

* Fixed whitespace error

* Stoch eos clock (#5)

*Added a clock for the Stanley parameterization

Co-authored-by: jkenigson <[email protected]>

* add halo update to random pattern

* Update MOM_stoch_eos.F90

Fix bug for looping over compute domain (is -> isc etc.)

* Avoid unnessary computations on halo (MOM_stoch_eos) and code clean-up (MOM_thickness_diffuse)

* Removed halo updates before determ param calc

* Update MOM_stoch_eos.F90

Removed unnecessary code

* Bug - indices are transposed

* Changed Stanley stochastic coefficient from exp(X) to exp(aX) (#9)

* Changed Stanley stochastic coefficient from exp(X) to exp(aX)

* Extra spaces removed

* Stoch eos init fix (mom-ocean#10)

* Don't bother calculating tv%varT if stanley_coeff<0

* Missing then added

* Merge Ian Grooms Tvar Discretization (mom-ocean#11)

* Update MOM_stoch_eos.F90

In progress updating stencil for$ | dx \times \nabla T|^2$ calculation

* New discretization of |dx\circ\nablaT|^2

Co-authored-by: Ian Grooms <[email protected]>

* Multiplied tvar%SGS by grid cell thickness ratio

* Added limiter for tv%varT

* Stoch eos ncar linear disc (mom-ocean#12)

* Update MOM_stoch_eos.F90

In progress updating stencil for$ | dx \times \nabla T|^2$ calculation

* New discretization of |dx\circ\nablaT|^2

* AR1 timescale land mask

Adds land mask to the computation of the AR1 decorrelation time

* Update dt in call to MOM_stoch_eos_run

The call to `MOM_stoch_eos_run` (which time steps the noise) is from within `step_MOM_dynamics`. `step_MOM_dynamics` advances on time step `dt` (per line 957), but the noise is updated using `dt_thermo`. It seems more appropriate to update the noise using `dt`, since it gets called from within `step_MOM_dynamics`.

* Fixed the units for r_sm_H

* Remove vestigial declarations

The variables `hl`, `Tl`, `mn_T`, `mn_T2`, and `r_sm_H` are no longer used, so I removed their declarations and an OMP private clause

Co-authored-by: Ian Grooms <[email protected]>

* Update MOM_thickness_diffuse.F90

Changed index for soft convention

* Update CVMix-src

* Ensure use_varT, etc., initialized

* Don't register stanley diagnostics if scheme is off

* Stanley density second derivs at h pts (mom-ocean#15)

* Change discretization of Stanley correction (drho_dT_dT at h points)

* Limit Stanley noise, shrink limiting value

* Revert t variance discretization

* Reverted variable declarations

* Stanley scheme in mixed_layer_restrat, vert_fill in stoch_eos, code cleanup (mom-ocean#19)

* Test Stanley EOS param in mixed_layer_restrat

* Fix size of TS cov, S var in Stanley calculate_density calls

* Test move stanley scheme initialization

* Added missing openMP directives

* Revert Stanley tvar discretization (mom-ocean#18)

* Perform vertical filling in calculation of T variance

* Variable declaration syntax error, remove scaling from get_param

* Fix call to vert_fill_TS

* Code cleanup, whitespace cleanup

Co-authored-by: Jessica Kenigson <[email protected]>

* Use Stanley (2020) variance; scheme off at coast

* Comment clean-up

* Remove factor of 0.5 in Tvar

* Don't calculate Stanley diagnostics on halo

* Change start indices in stanley_density_1d

* Stanley param in MOM_isopycnal_slopes (mom-ocean#22)

Stanley param in MOM_isopycnal_slopes and thickness diffuse index fix

* Set eady flag to true if use_stored_slopes is true

* Cleanup, docs, whitespace

* Docs and whitespace

* Docs and whitespace

* Docs and whitespace

* Whitespace cleanup

* Whitespace cleanup

* Clean up whitespace

* Docs cleanup

* use_stanley

* Update MOM_lateral_mixing_coeffs.F90

* Adds link to another TEOS10 module

* Set Stanley off for testing

* Line continuation

Co-authored-by: Phil Pegion <[email protected]>
Co-authored-by: Philip Pegion <[email protected]>
Co-authored-by: Jessica Kenigson <[email protected]>
Co-authored-by: Jessica Kenigson <[email protected]>
Co-authored-by: jkenigson <[email protected]>
Co-authored-by: jskenigson <[email protected]>
Co-authored-by: Jessica Kenigson <[email protected]>
Co-authored-by: Jessica Kenigson <[email protected]>
Co-authored-by: Philip Pegion <[email protected]>
Co-authored-by: Jessica Kenigson <[email protected]>
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.

8 participants