Skip to content

(New PR) Clean up diagnostic variables in WW3 for Langmuir turbulence parameterization#8

Closed
alperaltuntas wants to merge 15 commits into
OLD_dev/unifiedfrom
merge_pr4
Closed

(New PR) Clean up diagnostic variables in WW3 for Langmuir turbulence parameterization#8
alperaltuntas wants to merge 15 commits into
OLD_dev/unifiedfrom
merge_pr4

Conversation

@alperaltuntas
Copy link
Copy Markdown
Member

This the updated PR based on #4 by @qingli411
In addition to the changes by @qingli411 as summarized below, I have added mod_def namelist parameters to control the Langmuir parameterization and eliminated the CESMCOUPLED and SDTAIL ifdefs by replacing them with if statements (with flags from the newly added namelist) wherever applicable.

Pull Request Summary

This PR cleans up the calculation of Stokes drift and other diagnostics variables in WW3 for Langmuir turbulence parameterization in CESM.

Description

  • Clean up the calculations of the surface Stokes drift (USSX and USSY) and surface layer averaged Stokes drift (USSHX and USSHY). The calculation of surface layer averaged Stokes drift and the tail contributions to both versions of Stokes drift are activated when W3_CESMCOUPLED is defined.
  • Change the input field of mixed layer depth HML to a more general surface layer depth HSL. This depth is used to calculate the surface layer averaged Stokes drift. When used in CESM, the surface layer depth is defined as 1/5 of the mixed layer depth. Now this 1/5 factor is applied to the mixed layer depth when importing the fields in the cap.
  • Clean up the diagnostic variables for Langmuir turbulence parameterization. Some variables are intermediate quantities and are not used in the parameterization. These variables are now deleted. The key variable diagnosed in WW3 is the surface layer averaged Stokes drift (USSHX and USSHY). The Langmuir enhancement factor (LAMULT) and the surface layer averaged Langmuir number (LASL) are now calculated when they are exported in the cap. LASL is needed for the Langmuir induced entrainment parameterization in CVMix but was not there in the cap code. So it is now added following the way LAMULT is defined.
  • This PR only changes the diagnostic variables in WW3 and shouldn't change the answers of WW3. Ideally, this PR shouldn't change the diagnostic variables to be used in CESM (LAMULT, LASL) as well. But given that the calculation of these variables are moved to the cap, and the way division by zero and physically invalid values (both should be rare) are handled, small changes to these variables are expected.
  • Labels: enhancement?
  • Suggestions for a reviewers: @alperaltuntas @DeniseWorthen @mvertens

Issue(s) addressed

This PR partially addresses the following issues.

Commit Message

Clean up the calculation of Stokes drift and other diagnostic variables for Langmuir turbulence parameterization.

Check list

Testing

  • How were these changes tested?
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?)
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)?
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):
  • Please indicate the expected changes in the regression test output (Note the known list of non-identical tests).
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):

This PR has not been tested yet.

Todo

I think there are still a few things to do in this PR. But I'm not sure what's the best way to proceed so I listed them here for discussion. Any suggestions? @alperaltuntas @DeniseWorthen @mvertens

  • I didn’t include any new ifdefs to control whether or not to include the high frequency tail contributions to the Stokes drift or whether or not we should output the surface layer averaged Stokes drift. We may need some new ifdefs for better control of such features for non-CESM users as described in Add optional high frequency tail to USSX, USSY NOAA-EMC/WW3#669.
  • The output of the surface layer averaged Stokes drift (USSHX, USSHY) needs additional lines in w3iogomd.F90 that depend on the indices of the flag array FLOGRD. I’m not sure what’s the best way to combine the flags in FLOGRD and ifdefs so I didn’t add them. Right now USSHX and USSHY should be calculated and used in the cap when W3_CESMCOUPLED is defined but they are not in the WW3 output.
  • I think we also need corresponding lines for USSHX and USSHY in w3initmd.F90 and w3iorsmd.F90 for initialization and restart? Again they depend on the indices in the arrays of the flags.
  • In the calculations of LAMULT and LASL (now in wav_import_export.F90), we may need better ways to check division by zero. I also put some arbitrary limits to avoid unphysical behavior (e.g., LASL should default to a large number which corresponds to LAMULT=1 and USSX=USSY=0, and LASL should be greater than zero). I think we should make sure these are consistent with other part of the code.

qingli411 and others added 15 commits May 7, 2022 08:58
1. Remove redundant temporary variables (ETUSSX, ETUSSY, ETUSSXH, ETUSSYH)
   and lines for calculating the surface Stokes drift and surface layer
   averaged Stokes drift.
2. Calculation of surface layer averaged Stokes drift and the tail
   contribution to both surface and surface layer averaged Stokes drift
   are activated when W3_CESMCOUPLED is defined.
Replace the mixed layer depth by a surface layer depth for the depth
averaged Stokes drift and define it to be 1/5 of the mixed layer depth
when importing the field.
1. Remove unnecessary diagnostic variables for Langmuir turbulence
   parameterization in CESM.
2. Move the calculations of Langmuir enhancement factor (lamult) and
   surface layer averaged Langmuir number (lasl) to the cap-code.
3. Add a new variable (lasl) to be exported for Langmuir turbulence
   parameterization in CESM.
@alperaltuntas
Copy link
Copy Markdown
Member Author

I am mentioning @MatthewMasarik-NOAA.

@mvertens
Copy link
Copy Markdown

mvertens commented May 5, 2023

@alperaltuntas - for NorESM I have migrated directly to the head of the WW3/EMC branch that Denise is working on since they are interested in using the unstructured mesh implementation. There is huge differences with the head of where the NCAR branch is right now due to formatting changes. I am wondering when CESM wants to update to use those formatting changes in order to make collaboration with EMC easier. Also - I have improved the build process so that it leverages more of the CMake functionality that was introduced by EMC in WW3. You can see these changes in https://github.com/NorESMhub/WW3 and https://github.com/NorESMhub/WW3_interface. It would be useful for us to talk I think.

@alperaltuntas
Copy link
Copy Markdown
Member Author

Hi @mvertens. It would be great if we updated to the EMC branch and/or incorporate Denise's and your changes as soon as possible. I am away next week but happy to talk the following week.

@DeniseWorthen
Copy link
Copy Markdown

@alperaltuntas Is the Sw_lasl variable the same as the La_Sl variable that appears to be removed in the latest MOM6 PR NOAA-GFDL/MOM6@5a5fff3c4 ?

@alperaltuntas
Copy link
Copy Markdown
Member Author

@alperaltuntas Is the Sw_lasl variable the same as the La_Sl variable that appears to be removed in the latest MOM6 PR NOAA-GFDL/MOM6@5a5fff3c4 ?

I believe so. Though Sw_lasl is not received and used in MOM6 yet. (There is an alternative computation of La_sl in MOM_CVMix_KPP but NCAR configuration doesn't make use of that.)

@mvertens
Copy link
Copy Markdown

@alperaltuntas @DeniseWorthen - sorry for not being able to set up a meeting last week.
Would it work to meet on Friday? I'm on vacation until then, but Friday I'll be working and would be happy to meet in the late afternoon (4pm for me is 8am for you Alper). Let me know and I'll set up a call.

@DeniseWorthen
Copy link
Copy Markdown

@mvertens Friday works fine for me, except for 11:30-1:00 ET.

@alperaltuntas
Copy link
Copy Markdown
Member Author

Any time Friday works for me.

francescococetta pushed a commit to francescococetta/WW3 that referenced this pull request Sep 26, 2023
…_coupling

fixes for issues encountered with wave/ice coupling
@alperaltuntas alperaltuntas deleted the merge_pr4 branch October 18, 2023 19:58
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.

4 participants