Skip to content

Update to GFDL master#2

Merged
pjpegion merged 1108 commits into
pjpegion:dev/gfdlfrom
mom-ocean:dev/gfdl
Jul 30, 2020
Merged

Update to GFDL master#2
pjpegion merged 1108 commits into
pjpegion:dev/gfdlfrom
mom-ocean:dev/gfdl

Conversation

@pjpegion
Copy link
Copy Markdown
Owner

No description provided.

marshallward and others added 30 commits May 20, 2020 14:39
  Added the new optional argument just_read_params to entrain_diffusive_init,
which if present and true causes this routine to read the parameters used by the
entrain_diffusive module without logging them.  Also set this new parameter
based on whether ALE remapping is being used.  This prevents the diagnostics and
parameters from this module from being offered or logged when they are not
actually available, and it will prevent the parameter CORRECT_DENSITY from being
logged in ALE-configured runs.  All answers are bitwise identical, but there are
changes in some MOM_parameter_doc and available_diags files.
Travis: Arm64 tests; git depth restored; Makefile
This setting will prevent CodeCov from updating the repository until all
8 test suites are completed.

The number is fixed to 8 in the file, so we now need to keep these in
sync until this can be sorted out some other way.
- The compiler versions used in the gaea pipelines are encoded in
  the MRS package of scripts. This commit switches to the master
  branch which will now pull the latest version of MRS.
Codecov appears to have two schemes for setting a target reference for
coverage measurements: `pr` and `parent`.

The first seems to measure coverage relative to the point where the PR
was branched to branch against the current state of the PR.

The second measures coverage relative to the  current state of branch to
be merged against the merged PR conent

PR submissions default to the first, but we want to measure coverage
relative to the second.  This patch always uses the `parent` method.
Codecov: Set base as parent (target) branch
  Modified ePBL_column to calculate Te and Se when EPBL_ORIGINAL_PE_CALC is
False and there are no temperature change diagnostics being requested, and to
return dPEc_dKd from one of the calls to find_PE_chg.  This avoids the use of
uninitialized values in EPBL_ORIGINAL_PE_CALC is false, and some solutions
appear to be similar, but others give large qualitative changes, so there are
probably still problems with EPBL_ORIGINAL_PE_CALC = False.  When this was
originally developed, it was verified to be mathematically equivalent, but in
the years that this code was not tested, problems have crept it.  All answers
in the MOM6-examples test cases are bitwise identical.
  Added an explicit MOM6 interface for cpu_clock_id, rather than simply passing
the call through to mpp_clock_id, both to explicitly document the interface and
arguments and to use the FMS run-time defaults for clock synchronization.  This
will enable SIS2 to use the MOM_cpu_clock module with the same behavior.  All
answers and output are bitwise identical.
  Added code to handle discrepancies between compliers in how "\t" is handled in
strings, so that the MOM6 documentation files are identical across compilers.
All answers are bitwise identical.
  Added an H_subroundoff term to the denominator of an expression in
calculate_bkgnd_mixing for the inverse of the mixed layer thickness, so that
NaNs will not be created when taking this inverse if CS%HMix is set to 0.  All
answers are bitwise identical in the MOM6-examples test cases.
  Minor correction to avoid scanning past the end of a string.  With sensitive
settings, this bug was causing sensitive models to abort, but if the model ran
it was giving bitwise identical answers.
  Slight revision to writeMessageAndDesc to handle the case when a change in tab
spacing will cause a line to exactly the maximum line length.  All answers are
bitwise identical answers.
- Modules, routines and labels in code changed from Neverland to
  Neverworld.
- Add aliases for parameters so that existing configurations still
  work (given that Neverworld was published but the runs used
  Neverland).
- was operating on segments not on core, oh no.
(*)Improve ePBL when EPBL_ORIGINAL_PE_CALC=False
adcroft and others added 25 commits July 10, 2020 17:51
  Eliminated the unused variables CS%uhbt_IC and CS%vhbt_IC from the barotropic
control structure and from the MOM6 restart files.  Also placed a logical test
for CS%Gradual_BT_ICs around all references to CS%ubt_IC and CS%vbt_IC and
eliminated these variables from the restart files when they would not be used.
Additionally some unused arguments were removed from internal subroutines and
some spelling or index case errors were corrected.  All answers are bitwise
identical, but the MOM6 restart files have fewer variables and some unused
entries in the MOM_parameter_doc files have changed.
  Add the new runtime parameter INTEGRAL_BT_CONTINUITY which enables the use of
the time-integrated barotropic velocity to determine the cumulative transport
since the start of the barotropic stepping.  This new option works in all of the
MOM6-examples test cases with a SPLIT=True and USE_BT_CONT_TYPE=True.  By
default all answers are bitwise identical, but there are changes to the entries
in the MOM_parameter_doc files.
  Added the new subroutines find_duhbt_dubt_int and find_dvhbt_dvbt_int, and use
the time-integrated forms to set the inverse face area, the transport correction
for consistency between the transport from the initial barotropic velocity and
the summed layer transports, and the maximum corrective mass source when
INTEGRAL_BT_CONT=True.  Also only log BT_CONT_CORR_BOUNDS when BOUND_BT_CORR is
set to true.  By default, all answers are bitwise identical, but there are minor
changes to the entries in the MOM_parameter_doc files.
  Added code to implement new integral_BT_cont options within the barotropic
open boundary condition code.  A number of new arguments were added to
apply_velocity_OBCS.  In addition, the handling of updates to ubt_sum, uhbt_sum
and ubt_wtd with open boundary conditions were simplified.  There are minor
answer changes if INTEGRAL_BT_CONTINUITY=True, but all answers in the existing
MOM6-examples tess cases are bitwise identical.
  Revised the dimensions of the entries in the local_BT_Cont types when
INTEGRAL_BT_CONT=True for efficiency and to enable find_uhbt and other routines
to be used regardless of the value of INTEGRAL_BT_CONT.  Some arguments that are
no longer needed have been removed from some subroutines. All answers are
bitwise identical in the MOM6-examples test suite, but changes to the order of
arithmetic leads to changes from the previous version when
INTEGRAL_BT_CONT=True, and the rescaling is controlled via new optional
arguments to internal routines.
  Revised ice_shelf_driver.F90 so that it compiles successfully and is similar
to MOM_driver.F90 where possible.  In addition, deleted the files
MOM_surface_forcing.F90 and user_surface_forcing.F90 in the ice_solo_driver
directory, as these are unused and out-of-date versions of the equivalent files
in the solo_driver directory.  Some of the changes are not as streamlines as
they could be if the solo_ice_shelf code used its own version of diag_mediator,
or if the interface to diag_mediator were revised so that some of its
ocean-specific arguments are optional.  There is no test-case exercising this
code, but at least it now compiles, whereas it did not compile before.
- FMS tag 2019.01.03 fixes problems for EMC allowing the newer FV3 to
  work with MOM6 which is not yet compatible with FMS2020.
  Modified recent additions to avoid using uninitialized arrays.  This was not
detected in tests of the previous PR because the arrays that were created from
uninitialized arrays were themselves never used, so there are no answer changes
but there were errors with intolerant compiler settings.  Also corrected the
dOxygen syntax in a comment and corrected some openMP directives that had been
triggering warnings or errors.  All answers are bitwise identical.
+Adding a halo update for tracer reservoirs.
  Added some missing openMP directives that had been triggering warnings or
errors, and could have created problems with more extensive testing.  Also set
some unset array bounds in the ice_shelf_dynamics code.  All answers are bitwise
identical in all working test cases.
MOM6: +(*)Add option to use time-integrated barotropic continuity
MOM6: (*?)Revised ice_shelf_driver.F90 so it compiles
The "for" loop at L510 should be to nz instead of nz+1.  Due to array allocation sizes, this loop was extending beyond the shope of the argument arrays.
Squash merge of following commits:

* Testing: tc4 installs python-netCDF4 via venv

Currently, users are expected to have numpy and netcdf4 python modules
in order to generate the necessary netCDF input files.  This fails in
environments where these modules are unavailable.

This patch now installs the modules into a virtual environment which are
accessible when generating the tc4 inputs.

This solution is local to tc4 but could be extended to other tests as
needed.

* Testing: remove Python numpy and netCDF4 modules

The numpy and netCDF4 packages are no longer needed since tc4 now
installs these locally.

* Test: Install virtualenv for Python2

tc4 was using the venv module which appears to be python3-specific, and
Travis Ubuntu defaults to python2.  Also virtualenv was not installed in
either case.

This patch adds python-virtualenv to the install packages and uses the
virtualenv module.

* Test: Add python-dev for ARM64 numpy

Travis ARM nodes need to build numpy natively when installed by pip, and
thus require Python headers.  These are provided by the python-dev
package.

* Test: Revert to Py3 for tc4 generation scripts

Reverting the python 2 support (default for Travis) to use Python 3
syntax.

The main reason is that Python 3 includes venv (equivalent to
virtualenv) as its standard library, and is therefore guaranteed to
exist if Python 3 exists.

Python 3's virtualenv must be independently installed, which cannot be
confirmed.

This will cause problems for people without Python 3, but this is
probably the best solution, or at least the starting point for a more
general solution.

* Test: Adding python3-venv to Travis

Ubuntu apparently requires an explicit install of python3-venv despite
it being part of the standard library.  Go figure...

* Test: Arm64 tc4 Configuration support

Arm64 Ubuntu environments require explicit installations which are
otherwise provided on x86 Ubuntu:

* Python 3 Pip must be installed (python3-pip)
* Wheel installation must be explicitly installed
* Cython is required for numpy
* Numpy must be explicitly built before installing python-netCDF4

* Test: tc4 common Python local-env

Build times for setting up the virtual environments can be very
expensive on the Arm64 Ubuntu nodes, so we now create a shared directory
for launching the environments.

* Test: Use '.' in place of 'source' for Make

* Test: Test for required Python modules in tc4

We have reworked the Makefile to conditionally test for required Python
modules in tc4.  If unavailable, we install these in a virtual
environment.

This does not address many scenarios, such as if Python 3 is missing,
venv is missing (as in Ubuntu), or handle the situation if they do not
exist.  It assumes that either the modules exist, or that they can be
installed by venv.

This should be seen as an iterative step to get things working on Travis
x86 and Arm64, as well as GFDL's Gaea and most user Linux platforms.

* Test: Explicit python execs for tc4 input build

This resolves some issues with python2/3 resolution and limited support
of various platforms for module support.

Specifically, older platform with basic Python 3 support may not also
have numpy support.  In this case, we can defer back to Python 2 (or
whatever the system Python may be).

* Test: Setup Python venv at build time

This patch moves the Python virtual environment configuration to the
main Makefile, which is setup at build time, rather than in the model
configuration Makefile, which will typically not have internet access if
run on a compute node.

As before, the venv will only be setup when the numpy and netCDF4
modules are unavailable.  A minor bug in the logic of the check has
also been fixed.
Fixing loop bound error in MOM_PressureForce_Montgomery.F90
Squash merge:

* New diagnostics for barotropic momentum budget calculations are created. In these, different budget terms multiplied by fractional layer thicknesses are saved. Thus, these terms can be added over the whole to obtain the barotropic momentum budget. 'btstep' subroutine in MOM_barotropic module is modified to return fractional thicknesses. Pressure force acceleration multiplied by fractional thickness as diagnostics are added in this commit.

* More thickness weighted diagnostics

* Implemented Andrew Shao's suggestions

* More fractional thickness multiplied diagnostics

* Some barotropic diagnostics obtained from fractional thickness multiplied momentum budget terms

* Removed trailing spaces

* All fractional-thickness multiplied diagnostics implemented

* define diagnostic variables as pointers

* Shorter initialization of 2D arrays

* Modifications in vertical friction diagnostics

* Diagnostics initialization as pointers to save memory allocation

* Vertical friction module

* Removed commented lines and trailing spaces

* Diagnostic description change

* Fractional thickness-weighted diagnostics for acceleration due to relative vorticity and gradient of kinetic energy

* Modifications in vertical friction diagnostics (fractional thickness-weighted)

* Modifications in diag_hfrac_u and diag_hfrac_v calls

* Made allocation of hfrac at u/v points optional. These arrays are only allocated if any of the relevant diagnostics are called.

* Fractional-thickness weighted 3D diagnostics are now commented out as we do not the proper grid remapping option.

* Initialization of 2D diagnostic arrays changed from pointer type to allocatable array style.

* Trailing spaces removed and line lengths reduced to be under 120 characters

* Comment modified

Reviewed by Robert Hallberg <Robert.Hallberg@noaa.gov>
This patch fixes three dimensionality errors in the OBC segments.

- We add a missing GV%m_to_H conversion for time-dependent eta segments.

- The `adjustSegmentEtaToFitBathymetry` function depends on the
  `segment%Htot` field when computing the dz_src cell spacings.

  While the calculation primarily assumes that all quantities scale as
  Z, the segment%Htot field scales as H, which was causing
  dimensionality errors.

  We resolve this by converting Htot from Z to H whenever it is used in
  the calculation.

- Segment barotropic velocitys based on transports were limited to a
  hard-coded thickness of 1e-12, which was not scaled.  We have added
  H-dimensional scaling to these constants.
@pjpegion pjpegion merged commit b96be91 into pjpegion:dev/gfdl Jul 30, 2020
pjpegion pushed a commit that referenced this pull request Jul 30, 2020
pjpegion pushed a commit that referenced this pull request Feb 1, 2021
pjpegion pushed a commit that referenced this pull request Jun 11, 2021
Add stochastic component to MOM_thickness_diffuse
pjpegion pushed a commit that referenced this pull request Nov 5, 2021
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.

10 participants