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

Update mpas-source for Langmuir ocean vertical mixing parameterization #2952

Merged
merged 6 commits into from
Oct 10, 2019

Conversation

mark-petersen
Copy link
Contributor

@mark-petersen mark-petersen commented May 29, 2019

This merge adds Langmuir mixing parameterization via CVMix

  1. Change the CVMix repository to use the 'theory-wave' approximation of Li et al., 2017 to estimate the Langmuir enhancement factor from 10-meter wind, surface friction velocity and boundary layer depth
  2. New entries in mpaso namelist allowing different options of Langmuir mixing parameterization

This PR is climate changing if new flags are used to turn on the new mixing.

[BFB]
[NML]
[FCC]

@mark-petersen mark-petersen added mpas-ocean non-BFB PR makes roundoff changes to answers. labels May 29, 2019
@mark-petersen
Copy link
Contributor Author

Please see discussion on testing at MPAS-Dev/MPAS-Model#134. This
PR also updates cvmix version for python 3, described at MPAS-Dev/MPAS-Model#251

Right now the 'Files changed' tab will include the changes in #2852. After that is merged, it will only show the changes for this PR.

The mpas-source submodule currently points to the branch e3sm/testing. After #2852 is successfully merged, then MPAS-Dev/MPAS-Model#134 and MPAS-Dev/MPAS-Model#251 can be merged into ocean/develop and e3sm/develop, and the changes here will only show the Langmuir updates in this PR.

@mark-petersen
Copy link
Contributor Author

@jonbob and @vanroekel this branch is ready for the namelist updates and testing.

@rljacob rljacob removed the request for review from jonbob May 30, 2019 17:17
@mark-petersen mark-petersen force-pushed the mark-petersen/ocean/langmuir_mixing branch from 01d94b0 to 1520c23 Compare May 30, 2019 18:18
@mark-petersen
Copy link
Contributor Author

All the threading code is now merged. This PR is ready to go. @vanroekel and @qingli411, please look at the 'Files changed' above to make sure you see what you expect. Then run a few tests on this branch to make sure it is the same as your long testing previously.

@qingli411
Copy link
Contributor

@mark-petersen Great. The 'Files changed' looks good to me. I will do some tests on this branch.

@mark-petersen
Copy link
Contributor Author

Passed my standard tests:

PASS SMS_D_Ln9.T62_oEC60to30v3wLI.GMPAS-DIB-IAF-ISMF.cori-knl_gnu RUN time=272
PASS SMS_D_Ln9.T62_oEC60to30v3wLI.GMPAS-DIB-IAF-ISMF.cori-knl_intel RUN time=1116
PASS PEM_Ln9.ne30_oECv3wLI.A_WCYCL1850-DIB-ISMF_CMIP6.cori-knl_gnu COMPARE_base_modpes
PASS PET_Ln3.T62_oEC60to30v3wLI.GMPAS-DIB-IAF-ISMF.cori-knl_gnu COMPARE_base_single_thread

Everything for the mpas-source is done. I won't be able to work further on this PR, but I think you all can finish it.

@jonbob, there are three new namelist flags:

config_cvmix_kpp_use_theory_wave
config_cvmix_kpp_langmuir_mixing_opt
config_cvmix_kpp_langmuir_entrainment_opt

@rljacob rljacob added this to the v2.0alpha milestone Jun 14, 2019
@vanroekel
Copy link
Contributor

@jonbob should we append the buildnml changes to activate langmuir mixing to this PR?

@qingli411
Copy link
Contributor

@jonbob @vanroekel These are the changes to buildnml for mpas-ocean I need to activate Langmuir mixing in E3SM:
qingli411@fa73b3a#diff-f27161481241c47c1d8caad816cf6a24

@jonbob
Copy link
Contributor

jonbob commented Jun 25, 2019

@qingli411 , @vanroekel - we have scripts that pick up changes in the Registry file and auto-generate something close to the right build-namelist files. So thanks for pointing me at the required changes, but that's not necessary. Are the defaults in Registry the ones you want in E3SM??

<config_cvmix_kpp_use_theory_wave>.false.</config_cvmix_kpp_use_theory_wave>
<config_cvmix_kpp_langmuir_mixing_opt>'NONE'</config_cvmix_kpp_langmuir_mixing_opt>
<config_cvmix_kpp_langmuir_entrainment_opt>'NONE'</config_cvmix_kpp_langmuir_entrainment_opt>

@vanroekel
Copy link
Contributor

@jonbob I think we want in order

config_cvmix_kpp_use_theory_wave = .true.
config_cvmix_kpp_langmuir_mixing_opt = 'LF16'
config_cvmix_kpp_langmuir_entrainment_opt = 'LF17'

Is that right @qingli411?

@qingli411
Copy link
Contributor

@vanroekel @jonbob If we want to have the Langmuir turbulence parameterization turned on by default, we need

config_cvmix_kpp_use_theory_wave = .true.
config_cvmix_kpp_langmuir_mixing_opt = 'LF16'
config_cvmix_kpp_langmuir_entrainment_opt = 'LF17'

There is another modification that we need. To use the 'theory wave' option we need 10-meter wind speed being passed from coupler to mpas-ocean in components/mpas-ocean/driver/ocn_comp_mct.F.

@mark-petersen
Copy link
Contributor Author

@qingli411 for second, you mean

config_cvmix_kpp_langmuir_mixing_opt = 'LWF16'

right?

I'm changing MPAS-Ocean to run stand-alone tests with these defaults as well. Mainly that just exercises the code in our tests.

@qingli411
Copy link
Contributor

@mark-petersen Yes, it's LWF16. Sorry.

@jonbob
Copy link
Contributor

jonbob commented Jun 25, 2019

@qingli411 - do you need just the magnitude of the 10-m winds? And put into what mpas-ocean field? windSpeed10m?

@mark-petersen
Copy link
Contributor Author

@vanroekel and @qingli411: When I run the MPAS-Ocean stand alone nightly test suite with these flags:

config_cvmix_kpp_use_theory_wave = .true.
config_cvmix_kpp_langmuir_mixing_opt = 'LWF16'
config_cvmix_kpp_langmuir_entrainment_opt = 'LF17'

I get a divide by zero. Adding 1e-15 to the denominator fixes it:

+++ b/src/core_ocean/shared/mpas_ocn_vmix_cvmix.F
@@ -469,10 +469,10 @@ contains
               ! compute Langmuir number and Langmuir enhancement factor
               ! TODO: theory-wave is the only option to get Langmuir number and enhancement factor for now <06-09-18, Qing Li> !
               if (config_cvmix_kpp_use_theory_wave .and. iceFraction(iCell) .lt. 0.05_RKIND) then
-                 langmuirNumber =  sqrt(surfaceFrictionVelocity(iCell) / &
+                 langmuirNumber =  sqrt(surfaceFrictionVelocity(iCell) / ( &
                          cvmix_kpp_ustokes_SL_model(windSpeed10m(iCell), &
                                                     boundaryLayerDepth(iCell), &
-                                                    cvmix_global_params))
+                                                    cvmix_global_params)+1e-15_RKIND) )
                  langmuirEnhancementFactor =  &
                          cvmix_kpp_EFactor_model(windSpeed10m(iCell), &
                                                  surfaceFrictionVelocity(iCell), &

I’m sure it’s because the 10-meter wind field comes in as zero, so you get a divide by zero. Still, we don’t want a potential divide by zero in the code. Should I add that 1e-15 into MPAS? Or would it mess something else up? It's possible that you could have an exact zero in E3SM somewhere.

@qingli411
Copy link
Contributor

@jonbob Yes, I only need the magnitude of the 10-meter wind speed and I was using 'windSpeed10m'

@qingli411
Copy link
Contributor

@mark-petersen I don't see a problem adding 1e-15 to the denominator as you did. Thanks for catching that.

@qingli411
Copy link
Contributor

Here is the new feature description page for Langmuir turbulence parameterization on Confluence:
W4_MPAS-Ocean_Langmuir_turbulence

I have run a 4-year B-case simulation of this PR and compared it with the first 4 years of a previous simulation I did for the MPAS-Ocean PR #134. The results are qualitatively similar. Here are the link to MPAS-Analysis:

B-case with this PR (year 1-4):
20190619.Langmuir-LF17.A_WCYCL1850S.ne30_oECv3_ICG.anvil1-4

First 4 year of the B-case run 20181129.Langmuir-LF17.A_WCYCL1850S.ne30_oECv3_ICG.anvil:
20181129.Langmuir-LF17.A_WCYCL1850S.ne30_oECv3_ICG.anvil_years1-4

@vanroekel
Copy link
Contributor

agreed, adding 1E-15 seems like a very good idea. Thanks for catching this @mark-petersen

@jonbob
Copy link
Contributor

jonbob commented Jul 1, 2019

Passes SMS.ne30_oECv3_ICG.A_WCYCL1850S_CMIP6.anvil_intel

@mark-petersen mark-petersen force-pushed the mark-petersen/ocean/langmuir_mixing branch from e84b461 to 6b288f8 Compare October 2, 2019 12:07
@mark-petersen
Copy link
Contributor Author

I just rebased on today's master. @jonbob could you run a few standard tests on this branch now?

@vanroekel and @qingli411 we need to fill out the rest of this page:
https://acme-climate.atlassian.net/wiki/spaces/ED/pages/988840065/W4+MPAS-Ocean+Langmuir+turbulence
Please add what you can based on the documents you have, and the tests you've already run. We will try to merge this in this week.

@mark-petersen
Copy link
Contributor Author

@vanroekel I think you've checked this over before. Please approve this PR when you are ready.

Copy link
Contributor

@vanroekel vanroekel left a comment

Choose a reason for hiding this comment

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

changes and flags look good. Just need @jonbob to regenerate the buildnml bits with the auto generation scripts.

@@ -238,6 +238,9 @@
<config_cvmix_kpp_stop_OBL_search>100.0</config_cvmix_kpp_stop_OBL_search>
<config_cvmix_kpp_use_enhanced_diff>.true.</config_cvmix_kpp_use_enhanced_diff>
<config_cvmix_kpp_nonlocal_with_implicit_mix>.false.</config_cvmix_kpp_nonlocal_with_implicit_mix>
<config_cvmix_kpp_use_theory_wave>.true.</config_cvmix_kpp_use_theory_wave>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change to false for this PR.

@@ -238,6 +238,9 @@
<config_cvmix_kpp_stop_OBL_search>100.0</config_cvmix_kpp_stop_OBL_search>
<config_cvmix_kpp_use_enhanced_diff>.true.</config_cvmix_kpp_use_enhanced_diff>
<config_cvmix_kpp_nonlocal_with_implicit_mix>.false.</config_cvmix_kpp_nonlocal_with_implicit_mix>
<config_cvmix_kpp_use_theory_wave>.true.</config_cvmix_kpp_use_theory_wave>
<config_cvmix_kpp_langmuir_mixing_opt>'LWF16'</config_cvmix_kpp_langmuir_mixing_opt>
<config_cvmix_kpp_langmuir_entrainment_opt>'LF17'</config_cvmix_kpp_langmuir_entrainment_opt>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change to 'none' for this PR, for both of previous two.

@mark-petersen mark-petersen added BFB PR leaves answers BFB and removed CC PR is climate changing non-BFB PR makes roundoff changes to answers. labels Oct 8, 2019
@mark-petersen
Copy link
Contributor Author

After speaking with @vanroekel, we realized that this PR will add the relevant flags and be BFB. A later PR will be climate changing and change these three flags back:

config_cvmix_kpp_use_theory_wave = .true.
config_cvmix_kpp_langmuir_mixing_opt = 'LWF16'
config_cvmix_kpp_langmuir_entrainment_opt = 'LF17'

@mark-petersen mark-petersen force-pushed the mark-petersen/ocean/langmuir_mixing branch from 6b288f8 to 4255941 Compare October 8, 2019 15:39
@mark-petersen
Copy link
Contributor Author

@jonbob This is rebased and ready to merge. Please give it a quick test.

jonbob added a commit that referenced this pull request Oct 9, 2019
Update mpas-source for Langmuir ocean vertical mixing parameterization

This PR adds Langmuir mixing parameterization (via CVMix) support in
mpas-ocean:
* adds the option in the CVMix repository to use the 'theory-wave' approximation
  of Li et al., 2017 to estimate the Langmuir enhancement factor from 10-meter
  wind, surface friction velocity and boundary layer depth; and
* adds new entries in mpaso namelist allowing different options of Langmuir
  mixing parameterization.
The ocean source code has previously been available, but this PR adds the script
and coupling changes required to use it. By default, these changes are off but
this PR will be climate changing when the new flags are used to turn on the new
mixing.

[BFB]
[NML]
[FCC]
@jonbob
Copy link
Contributor

jonbob commented Oct 9, 2019

merged to next

@jonbob
Copy link
Contributor

jonbob commented Oct 9, 2019

@mark-petersen - testing shows that 'none' in your last commit needs to be 'NONE' -- apparently it is case-sensitive. Can you add this change please?

@jonbob
Copy link
Contributor

jonbob commented Oct 9, 2019

@mark-petersen - never mind, I'll just do it so we can be sure if works for testing tonight

jonbob added a commit that referenced this pull request Oct 9, 2019
@jonbob
Copy link
Contributor

jonbob commented Oct 9, 2019

re-merged to next. Now passes:

  • SMS.T62_oQU240.CMPASO-NYF.anvil_intel

jonbob added a commit that referenced this pull request Oct 10, 2019
Update mpas-source for Langmuir ocean vertical mixing parameterization

This PR adds Langmuir mixing parameterization (via CVMix) support in mpas-ocean:
* adds the option in the CVMix repository to use the 'theory-wave' approximation
  of Li et al., 2017 to estimate the Langmuir enhancement factor from 10-meter
  wind, surface friction velocity and boundary layer depth; and
* adds new entries in mpaso namelist allowing different options of Langmuir
  mixing parameterization.
The ocean source code has previously been available, but this PR adds the script
and coupling changes required to use it. By default, these changes are off but
this PR will be climate changing when the new flags are used to turn on the new
mixing.

[BFB]
[NML]
[FCC]
@jonbob jonbob merged commit ce76f08 into master Oct 10, 2019
@jonbob
Copy link
Contributor

jonbob commented Oct 10, 2019

merged to master and expected NML DIFF's blessed (but note we will expect more on cori once it's back up)

@jonbob jonbob deleted the mark-petersen/ocean/langmuir_mixing branch October 10, 2019 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB mpas-ocean NML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants