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

Main candidate from NCAR (12/15/2020) #1275

Merged

Conversation

gustavo-marques
Copy link
Collaborator

Major changes

New diagnostics

This candidate does not changes answers for the MOM6 regression tests (Intel 19.0.5).

gustavo-marques and others added 30 commits March 2, 2020 12:34
* turned off pressure force
* hard-coded BLD
* turned off advect_tracer
* set NTR = 2
This commit adds a linear transition from full LBD at k=k_min
to zero LBD at k=k_max. This is applied to both methods currently
available in the LBD module. Another modification is the fact that
both methods no longer compute average values at k_min
(done previously via average_value_ppoly). Instead, the full layer
thicknesses are now used.
This patch adds the option to apply a linear decay of
the fluxes at the base of hbl. This had been already
implemented but since it breaks the unit tests, which
were designed to work without this option, adding this
option will avoid breaking the tests.
When using the option to apply neutral diffusion only below the
surface boundary layer we were using (1.-zeta). This is wrong.
It should be just (zeta).
Valid options are:
* PARAM       - use the vector-parameter LBD_DZ_TOP
* UNIFORM[:N] - uniformly distributed
* FILE:string - read from a file
For each tracer point:

* tracers at (I,j), (I+1,j), (i,J) and (i,J+1) are
remapped to a defined zgrid;
* Apply LBD, uflux and vflux are calculated using the zgrid
* Remap fluxes to native grid
* Apply tracer convergence in the native grid

TODO:

* cleanup
* create a zgrid for each pair of column taking into
consideration h_L, h_R, BLD_L and BLD_R.
* Add functions to merge thicknesses and BLDs
* z_top is now defined every time-step using this information
* added unit tests
* adding new functions to sort, swap, and remove duplications
in 1D arrays

* updating unit tests

* clean the module
@marshallward
Copy link
Collaborator

@gustavo-marques I am seeing a unit_tests fail in our GNU debug build:

 MOM_lateral_boundary_diffusion, UNIT TEST FAILED: Equal hbl and same layer thicknesses (gradient from right to left)
Layer=  1 F_calc=  0.0000000000000000 F_ans -2.0000000000000000                 
Layer=  2 F_calc=  0.0000000000000000 F_ans  0.0000000000000000                 FATAL: MOM_unit_tests: near_boundary_unit_tests FAILED

Do you want to look into this? Can you try to reproduce?

@adcroft
Copy link
Collaborator

adcroft commented Dec 16, 2020

@jiandewang, @kshedstrom, @abozec (or @awallcraft) can you review/test this PR per usual process? We're fairly happy with it other than the above unit test issue but continue to test.

@gustavo-marques
Copy link
Collaborator Author

@marshallward, it passed all unit tests with Intel 19.0.5. Let me try with GNU...

@marshallward
Copy link
Collaborator

I get a fail on Intel 18.0.6 (with slightly more info since it's a REPRO build):

 MOM_lateral_boundary_diffusion, UNIT TEST FAILED: 
 Equal hbl and same layer thicknesses (gradient from right to left)             
  
Layer=  1 F_calc=  0.0000000000000000 F_ans -2.0000000000000000
Layer=  2 F_calc=  0.0000000000000000 F_ans  0.0000000000000000
 MOM_lateral_boundary_diffusion, UNIT TEST FAILED: 
 Equal hbl and same layer thicknesses (gradient from left to right)             
  
Layer=  1 F_calc=  0.0000000000000000 F_ans  1.0000000000000000
Layer=  2 F_calc=  0.0000000000000000 F_ans  0.0000000000000000
Layer=  1 F_calc= -1.0000000000000000 F_ans -1.0000000000000000
 MOM_lateral_boundary_diffusion, UNIT TEST FAILED: 
 hbl < column thickness, hbl same, linear profile right, khtr=2                 
  
Layer=  2 F_calc=  0.0000000000000000 F_ans -4.0000000000000000
Layer=  1 F_calc=  0.0000000000000000 F_ans  0.0000000000000000
Layer=  2 F_calc=  0.0000000000000000 F_ans  0.0000000000000000
 MOM_lateral_boundary_diffusion, UNIT TEST FAILED: 
 Different hbl and different column thicknesses (gradient from left to right)   
  
Layer=  1 F_calc=  0.0000000000000000 F_ans 10.0000000000000000
Layer=  2 F_calc=  0.0000000000000000 F_ans  0.0000000000000000

FATAL: MOM_unit_tests: near_boundary_unit_tests FAILED

I'll try to repeat this with Intel 19.

@gustavo-marques
Copy link
Collaborator Author

Okay, I found the problem (I thought I had merged this NCAR#169, but apparently I did not). I will send a fix in a few.

@kshedstrom
Copy link
Collaborator

I approve this PR.

@marshallward
Copy link
Collaborator

I still seem to be getting a fail, although I am now getting different answers (-0.4 rather than 0.0):

 MOM_lateral_boundary_diffusion, UNIT TEST FAILED: Equal hbl and same layer thicknesses (gradient from right to left)              
Layer=  1 F_calc= -0.4000000000000000 F_ans -2.0000000000000000
Layer=  2 F_calc=  0.0000000000000000 F_ans  0.0000000000000000

FATAL: MOM_unit_tests: near_boundary_unit_tests FAILED

Could be something to do with the merge; I will pick this up tomorrow.

@marshallward
Copy link
Collaborator

marshallward commented Dec 17, 2020

I just tried an Intel "REPRO" build and it did pass, so there could still be an underlying problem here (e.g. assumed zero initialization?).

Edit: PGI also passes, so this problem seems restricted to GNU.

I don't know anything about this test, so I won't be able to sort this out quickly, but I'll start looking into it. In the meantime, can you re-try your test using GNU?

@gustavo-marques
Copy link
Collaborator Author

Thanks, @marshallward. I will try to reproduce the fail with GNU.

@awallcraft
Copy link
Collaborator

I approve this PR.

@gustavo-marques
Copy link
Collaborator Author

gustavo-marques commented Dec 18, 2020

@marshallward, I was able to reproduce the fail with GNU in debug mode. The test is failing because of an undefined logical (CS%limiter_remap) in the unit test function (near_boundary_unit_tests). For some reason, GNU/debug sets it to True by default. The fix coming in a few.

@jiandewang
Copy link
Collaborator

EMC wcoss machine is reserved for production test only at this moment, will test this MOM code once access to machine is back

@marshallward
Copy link
Collaborator

Thanks, @gustavo-marques , good to see it was nothing serious. This is now passing on our branch with no regressions (after resolving a minor git conflict).

Copy link
Collaborator

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

I have visually examined all of these code changes, and I approve of them. (I especially like the use of the deferred allocation character strings, which is a very elegant solution!) Also, I have been informed that this PR is now passing all of the testing from the GFDL side.

@Hallberg-NOAA
Copy link
Collaborator

The merge of this PR onto the main branch is now just waiting for the go-ahead from the EMC team via @jiandewang, having obtained approval from the other main forks.

@jiandewang
Copy link
Collaborator

I shall have access to machine this afternoon, will try to finish testing no later than today

@jiandewang
Copy link
Collaborator

works fine on EMC (PS: I started my testing 1 minute after machine is back, so my job got finished quickly as nodes are empty)

@marshallward
Copy link
Collaborator

Approvals:

  • NCAR (submitted)
  • FSU
  • GFDL
  • Rutgers
  • EMC

I am going to merge this now.

@marshallward marshallward merged commit 0f664aa into mom-ocean:main Dec 19, 2020
@gustavo-marques gustavo-marques deleted the main-candidate-ncar-2020-12-15 branch April 21, 2021 23:26
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