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 ncar main candidate 2021 08 31 #1491

Merged

Conversation

gustavo-marques
Copy link
Collaborator

@gustavo-marques gustavo-marques commented Aug 31, 2021

Incorporates the developments done in dev/ncar since Apr 21, 2021. The main contributions are summarized below.

This PR does not change the MOM6-examples answers (ocean.stats.nc) w.r.t. branch main e794c41 when using Cheyenne with the intel/19.0.5 compiler. However, because of a bug fix (misplaced parentheses), this PR will change answers for tracers updated using either tracer_vertdiff_Eulerian or tracer_vertdiff when the optional argument, sfc_flux, is passed.


Features


Bugfixes


Improvements

/glade/scratch/gmarques/bmom.e22.f09_t061_hycom1_N75.mct.surface_fluxes_check.007


External


Review

alperaltuntas and others added 30 commits April 21, 2021 18:03
…ncar-2021-04-21

Merging the main candidate from GFDL 2021-03-26
…nthreads_nuopc

Add isPresent and isSet when retrieving nthreads
These arrays were not being deallocated which was causing a
memory leak problem.
This commit fixes misplaced parentheses in the tridiagonal solvers used in
subroutines tracer_vertdiff_Eulerian and tracer_vertdiff. This bug has been
reported in https://github.com/NOAA-GFDL/MOM6/issues/1415

This commit also changes the mask condition used in these subroutines.
This commit adds a new module (MOM_CFC_cap) that can used to
simulate chlorofluorocarbons (CFCs) tracers. It also includes
the modifications needed to 1) allocate arrays in the fluxes and
surface types, and 2) activate the MOM_CFC_cap module via NUOPC cap.
…mentation

* Implements a module to simulate CFCs via NUOPC cap
Fix NUOPC import of fields required for the new CFC module
The export of ice fraction was previously added for the
newly added CFC module.
In a previous commit, the expression

tr(i,j,1) = (b1(i)*h_tr)*tr(i,j,1) + sfc_src(i,j)

was change to

tr(i,j,1) = b1(i)*(h_tr*tr(i,j,1) + sfc_src(i,j))

in 4 lines. This changed the order in which b1(i)*h_tr*tr(i,j,1) is evaluated,
even if sfc_src(i,j) is 0.0. Because the CESM configurations use the
passive tracer tridiagonal solver for T and S, the modification above changed
answers in these configurations. To recover previous answers the expression must
be

tr(i,j,1) = (b1(i)*h_tr)*tr(i,j,1) + b1(i)*sfc_src(i,j)
…change_in_CFC_PR

* Recover answer change from CFC PR
…uted and applied: (1) When available, pass the enhancement factor received from WW3. Otherwise, let CVmix compute the enhancement factor. (2) Instead of explicitly multiplying diffusivities and viscosities with the enhancement factor, let CVMix handle enhancement internally.
correct scale argument in get_param and chksum calls

add dimension scaling terms to some expressions

add some chksum calls
@jiandewang
Copy link
Collaborator

jiandewang commented Aug 31, 2021 via email

@kshedstrom
Copy link
Collaborator

I approve this PR.

@marshallward
Copy link
Collaborator

The tc1 tests - and possibly others - are detecting regressions in the diagnostics, e.g.

< h-point: mean=  -5.7496361301369858E-01 min=  -1.0000000000000000E+00 max=   1.1415525114155251E-04 ocean_model-age
make: *** [Makefile:473: tc1.a.regression.diag] Error 1
< h-point: c=     10412 ocean_model-age
---
> h-point: mean=  -5.7496361301369858E-01 min=  -1.0000000000000002E+00 max=   1.1415525114155251E-04 ocean_model-age
> h-point: c=     15150 ocean_model-age
2945,2946c2945,2946
< h-point: mean=  -1.5971211472602740E-04 min=  -2.7777777777777778E-04 max=   3.1709791983764586E-08 ocean_model-age_tendency
< h-point: c=     19164 ocean_model-age_tendency
---
> h-point: mean=  -1.5971211472602740E-04 min=  -2.7777777777777783E-04 max=   3.1709791983764586E-08 ocean_model-age_tendency
> h-point: c=     18888 ocean_model-age_tendency
2954c2954
< h-point: c=     18833 ocean_model-ageh_tendency

(Not a complete list, just the header of the diff)

It looks to be a last-bit difference in the min value, though the checksum different is also evident.

If this is intentional then we can override it, but if not then it should be investigated.

@gustavo-marques
Copy link
Collaborator Author

The tc1 tests - and possibly others - are detecting regressions in the diagnostics, e.g.

< h-point: mean=  -5.7496361301369858E-01 min=  -1.0000000000000000E+00 max=   1.1415525114155251E-04 ocean_model-age
make: *** [Makefile:473: tc1.a.regression.diag] Error 1
< h-point: c=     10412 ocean_model-age
---
> h-point: mean=  -5.7496361301369858E-01 min=  -1.0000000000000002E+00 max=   1.1415525114155251E-04 ocean_model-age
> h-point: c=     15150 ocean_model-age
2945,2946c2945,2946
< h-point: mean=  -1.5971211472602740E-04 min=  -2.7777777777777778E-04 max=   3.1709791983764586E-08 ocean_model-age_tendency
< h-point: c=     19164 ocean_model-age_tendency
---
> h-point: mean=  -1.5971211472602740E-04 min=  -2.7777777777777783E-04 max=   3.1709791983764586E-08 ocean_model-age_tendency
> h-point: c=     18888 ocean_model-age_tendency
2954c2954
< h-point: c=     18833 ocean_model-ageh_tendency

(Not a complete list, just the header of the diff)

It looks to be a last-bit difference in the min value, though the checksum different is also evident.

If this is intentional then we can override it, but if not then it should be investigated.

The PR description has been updated. I now mention that this PR will change answers for tracers that use either tracer_vertdiff_Eulerian or tracer_vertdiff, which is the case for ideal age in the tc1 regression test.

Copy link
Collaborator

@sanAkel sanAkel left a comment

Choose a reason for hiding this comment

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

👍 Thanks for those comments.

@jiandewang
Copy link
Collaborator

@gustavo-marques: I just returned back from vacation, will test it and get back to you in 1-2 days.

@jiandewang
Copy link
Collaborator

works fine in UFS.

@abozec
Copy link
Collaborator

abozec commented Sep 10, 2021

I approve this PR also

@Hallberg-NOAA
Copy link
Collaborator

I have run the MOM6-examples pipeline tests manually with this PR, and the answers are all unchanged.

I approve this PR, although there are two issues that it raises that I think warrant further discussion:

  1. We now have 3 distinct implementations of CFC being used by MOM6 (via the generic tracers, the new MOM_CFC_cap.F90 and MOM_OCMIP2_CFC.F90) , I think that a careful comparison and reconciliation of these various codes could be an instructive exercise for setting a template for other tracer packages.
  2. Tests related to the new fluxes%lamult array have resulted in duplicated KPP calls in MOM_diabatic_driver.F90. Perhaps we could explore whether a slightly different code construct could give the same algorithmic flexibility with less duplication.

@marshallward
Copy link
Collaborator

I verified that this passed our regression test after fixing some conflicts (due to changes after the PR was submitted).

There is a new (expected) parameter as well:

  • USE_CFC_CAP

So I will go ahead and merge this to main.

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.

9 participants