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

Dev master candidate from NCAR - 2019 06 11 #935

Merged

Conversation

gustavo-marques
Copy link
Collaborator

The main goal of this PR is to bring the latest changes in dev/ncar into dev/master. A summary of the main changes/capabilities contained in this PR is provided below.

GME and GEOMETRIC

  • Add GME backscatter (Bachman, 2019). MEKE must be enabled for this parameterization to be used, as it uses MEKE to limit the amount of energy it adds.
  • Add GEOMETRIC (Mak et al., 2017). This is an add-on to the MEKE package and is selected as a runtime parameter. Presently the only difference between GEOMETRIC and MEKE is in the expression for the thickness diffusivity.
  • Add biharmonic option for MEKE viscosity.
  • Add ability to count GME as an energy sink for MEKE. This is switched off by default.
  • Add ability to count a non-MEKE thickness diffusivity as an energy source for MEKE. Also added the ability to use this thickness diffusivity to diffuse MEKE (previously it could only be used with the diffusivity diagnosed within MEKE).
  • Add a proper expression for the Jansen et al. (2015) bottom drag into MEKE.
  • Add a sign-definite way of accounting for the GM source term in MEKE.
  • Add a sign-definite way of accounting for the frictional (viscous) source term in MEKE.

MCT and NUOPC caps

  • Change in latent heat flux calculation. The latent heat used to be provided via coupler and is now computed in the caps (MCT and NUOPC) via fprec, rofi_flux and q_flux.

  • Add missing fluxes. MOM6 (coupler) definition of these terms is seaice_melt (meltw) and seaice_melt_heat (melth).

  • Fix ocean coupling lag in the NUOPC cap.

All code has been properly documented (doxygenized).

This PR does not change answers for the GFDL tests based on 'dev-master-candidate-2019-04-26'. It also does not change answers for NCAR.

adcroft and others added 30 commits December 4, 2017 15:03
- In preparation for modularizing the Leith calculations so that
  we can add QG-Leith (Bachman et al., 2017), we have made the
  local scalar that held the vorticity magnitude a 2d array.
- Grouped all the Leith related calculations in preparations for
  turning them into a single subroutine call.
- Also duplicated the calculation of dvdx and dudy expecting that
  we might soon change the discretization for vorticity.
- Block of calculations for vorticity magnitude used in Leith are now
  in a subroutine in MOM_lateral_mixing_coeffs.F90
- Added beta from grid type to vorticity magnitude
- Now reading parameters for Leith in MOM_lateral_coeffs.F90 (in
  additional to MOM_hor_visc.F90 which we'll remove later).
- Removed parameters from dummy argument list.
- The subroutine that was calculating terms used in the Leith viscosities
  now returns the viscosities themselves.
- Removed allocatable arrays and a left over parameter.
- USE_BETA_IN_LEITH now controls the beta-term in the Leith viscosity.
- Nasty expressions for harmonic mean h's at u/v points for vertical
  derivatives of slopes... Eek!
Conflicts:
	src/parameterizations/lateral/MOM_hor_visc.F90
@gustavo-marques
Copy link
Collaborator Author

Answers for MOM6-examples do not reproduce with this PR without intervention.

The following experiments in MOM6-examples need USE_VISBECK=True:

  • coupled_AM2_LM3_SIS/CM2G63L
  • coupled_AM2_LM3_SIS2/AM2_SIS2_MOM6i_1deg
  • coupled_AM2_LM3_SIS2/Concurrent_ice_1deg
  • ice_ocean_SIS2/Baltic
  • ice_ocean_SIS2/SIS2
  • ice_ocean_SIS2/SIS2_bergs_cgrid
  • ice_ocean_SIS2/SIS2_cgrid
  • ocean_only/benchmark
  • ocean_only/nonBous_global

The default for AH_VEL_SCALE was made non-zero. This causes answers changes in addition to the above. The default for this should be 0.

Parameter MEKE_VISCOSITY_COEFF was renamed to MEKE_VISCOSITY_COEFF_KU and needs to be set in ice_ocean_SIS2/OM4_05 . We should obsolete the old name if we are to change parameter names.

Just to confirm, GFDL will set USE_VISBECK=True in the above experiments to avoid change in answers. Correct?

Delete hard-coded epsilon and added a new user parameter to specify
this constant.
@adcroft
Copy link
Collaborator

adcroft commented Jun 21, 2019

@gustavo-marques Correct. We'll add USE_VISBECK=True where necessary.

@gustavo-marques
Copy link
Collaborator Author

@septicscuzzy and I have fixed a few of the issues mentioned above. Here is a summary of the latest commits:

  • Obsoleted MEKE_VISCOSITY_COEFF;
  • Created a run-time parameter MEKE_GEOMETRIC_EPSILON and deleted hard-coded epsilon;
  • Moved OMP calls to after GME and before the k-loop in MOM_hor_visc;
  • Documented MEKE_VISCOSITY_COEFF_AU and MEKE_VISCOSITY_COEFF_KU in the MEKE module.

TO DO:

  1. We have not commented out the calls to the barotropic module since doing so will break GME for everybody. In the future, these calls will be replaced by a generic function that returns a barotropic velocity outside the barotropic control structure;
  2. Unit-scaling will be added in the future.

@kshedstrom
Copy link
Collaborator

Tidal_bay is changing in the horizontal viscosity. MOM_hor_visc.F90 has changed a great deal and totalview is showing me the wrong version in one of my dualling sessions, but I do know that diffu and diffv are different after the first call to horizontal_viscosity.

I don't remember why it is this way exactly, but the options in MOM_input are:

! === module MOM_hor_visc ===
LAPLACIAN = True                !   [Boolean] default = False
                                ! If true, use a Laplacian horizontal viscosity.
BIHARMONIC = True               !   [Boolean] default = True
                                ! If true, se a biharmonic horizontal viscosity.
                                ! BIHARMONIC may be used with LAPLACIAN.
KH = 0.0E+02                    !   [m2 s-1] default = 0.0
                                ! The background Laplacian horizontal viscosity.
KH_VEL_SCALE = 0.003            !   [m s-1] default = 0.0
                                ! The velocity scale which is multiplied by the grid
                                ! spacing to calculate the Laplacian viscosity.
                                ! The final viscosity is the largest of this scaled
                                ! viscosity, the Smagorinsky viscosity and KH.
SMAGORINSKY_KH = True           !   [Boolean] default = False
                                ! If true, use a Smagorinsky nonlinear eddy viscosity.
SMAG_LAP_CONST = 0.15           !   [nondim] default = 0.0
                                ! The nondimensional Laplacian Smagorinsky constant,
                                ! often 0.15.
SMAGORINSKY_AH = True
SMAG_BI_CONST = 0.6

@adcroft
Copy link
Collaborator

adcroft commented Jun 22, 2019 via email

@kshedstrom
Copy link
Collaborator

With AH_VEL_SCALE = 0, both executables give the same answer - and the same answer as I was getting from dev/esmg (dev/gfdl).

@Hallberg-NOAA
Copy link
Collaborator

I think that the default value for AH_VEL_SCALE should be set back to 0 in the MOM_hor_visc code. We have no particular reason to choose one dimensional value (0.10 m s-1) over any other. Where we set a default dimensional value, it is usually based on the well-defined properties of planet Earth (like its rotation rate, gravitational acceleration and radius) or something to do with the observable properties of sea-water (like its heat capacity).

@adcroft
Copy link
Collaborator

adcroft commented Jun 26, 2019

@gustavo-marques Can you please change the default for AH_VEL_SCALE back to 0. ?

@gustavo-marques
Copy link
Collaborator Author

@gustavo-marques Can you please change the default for AH_VEL_SCALE back to 0. ?

Done.

@kshedstrom
Copy link
Collaborator

I now approve this PR.

@jiandewang
Copy link
Collaborator

jiandewang commented Jun 27, 2019 via email

@Hallberg-NOAA
Copy link
Collaborator

I continue to have strong misgivings about the addition of the barotropic_CS and thickness_diffuse_CS as non-optional arguments to horizontal_viscosity. These additions required substantial changes in the arguments to the overlying code, and they will not work anyway unless the split time stepping scheme is used. However, I think that I have a workable solution to these two pieces that might help us get this code merged in a way that we will not regret later.

  1. The thickness_diffuse_CS is not actually being used in horizontal_viscosity, so please just remove it as an argument to horizontal_viscosity and the 3 stepMOM_dyn routines. We can collectively come back and put some effort into thinking about how to properly handle sharing information between the horizontal viscosity and GM diffusivity (misnamed thickness-diffuse), but for now there is no reason for this change.

  2. Make barotropic an optional argument to horizontal_viscosity that is only passed in with the SPLIT=True time stepping scheme, and then add an error message to trap the case if anyone tries to set USE_GME=True when this argument is missing. Currently, I am pretty sure that the barotropic_CS is not even being allocated when SPLIT=False, and trying to use USE_GME=True with SPLIT=False will lead to a segmentation fault without any useful error message. This approach will keep USE_GME working as it currently does in any case that works now, and it improves the error handling and will help lay the groundwork to come up with a different way to get at the barotropic velocities in the un-split cases. This solution will then allow us to remove the unallocated barotropic_CS argument from step_MOM_dyn_unsplit and step_MOM_dyn_unsplit_RK2, which would then be identical to before, while the solutions will be identical in all of your new cases that use GME.

@gustavo-marques and @septicscuzzy, please let me know if you think that this approach is reasonable. If so, I can help you with these changes as a correction to your PR.

@gustavo-marques
Copy link
Collaborator Author

@Hallberg-NOAA, thanks for proving a solution to these issues. @septicscuzzy and I like your idea. I will start working on it today and will let you know if I have questions.

@gustavo-marques
Copy link
Collaborator Author

This PR has been updated following @Hallberg-NOAA's idea for prohibiting USE_GME=True when SPLIT=False while keeping GME's functionality when SPLIT=True.

Unfortunately, we are unable to fully test these changes at NCAR -- Cheyenne has been down since last week and there was a problem rebooting the system this morning. Instead of waiting for Cheyenne to be fixed, I've decided to update this PR anyway so others can review and test these changes.

@jiandewang
Copy link
Collaborator

jiandewang commented Jul 2, 2019 via email

@adcroft
Copy link
Collaborator

adcroft commented Jul 3, 2019

I've just retested this PR again up to commit 5c42192 and we're good-to-go with the caveat that USE_VISBECK needs to be added to particular experiments. So we are waiting for NCAR (@gustavo-marques) to confirm their tests.

@gustavo-marques
Copy link
Collaborator Author

It passes our tests (b4b on C- and G-compsets using tx06).

@adcroft adcroft merged commit 5c42192 into mom-ocean:dev/master Jul 5, 2019
adcroft added a commit that referenced this pull request Jul 5, 2019
- This is a merge of dev/master after PR #935 from NCAR
@gustavo-marques gustavo-marques deleted the dev-master-candidate-2019-06-11 branch May 6, 2020 21:29
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.

7 participants