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

Charnock cap #1225

Merged
merged 9 commits into from
May 10, 2024
Merged

Conversation

ukmo-ccbunney
Copy link
Collaborator

@ukmo-ccbunney ukmo-ccbunney commented May 3, 2024

Pull Request Summary

Provides optional cap on charnock and sea surface drag parameters in ST4 physics.
The original code changes were made and tested by @ukmo-nievesvaliente.

Description

A new functional form for the sea surface drag following ecWAM example to mimic observations from Donelan (2018) is introduced in ST4 physics. This model change tries to be also consistent with the modified version of COARE 4.0 that is currently in Met Office Unified Model.

The functional form calculates the minimum Charnock coefficient and applies a reduction for winds above a specified threshold.

The functional form is activated by the CAPCHA namelist parameter in SIN4 and controlled by the following new parameters:

  • UCAP : Wind speed threshold (default = 30m/s)
  • SIGMAUCAP : Width of functional form (default = 10)
  • CHA0 : Initial Charnock coefficient (default = ALPHA0)
  • CHAMIN : Minimum Charnock value (default = 0.0001)

Note: The new functional form ('CAPCHA=1) is only available when explicit stress calculations are used in ST4 (not lookup tables); i.e. SINTABLE=0`

A new regression test has been added to ww3_ts1 to test this feature.

Issue(s) addressed

N/A

Commit Message

Functional form of Charnock calculation in ST4.
Authored by: @ukmo-nievesvaliente

Check list

Testing

Example single point growth experiment (from ww3_ts1) showing cap reducing the charnock parameter as wind speed approaches threshold of 28m/s:

image

  • How were these changes tested? Local testing with Met Office configurations, regression tests.
  • Are the changes covered by regression tests? (If not, why? Do new tests need to be added?) Yes, new one added.
  • Have the matrix regression tests been run (if yes, please note HPC and compiler)? Cray HPC; GNU Fortran
  • Please indicate the expected changes in the regression test output, (Note the list of known non-identical tests.) mod_def.ww3 changes for ST4 runs, but no changes to model outputs expected.
  • Please provide the summary output of matrix.comp (matrix.Diff.txt, matrixCompFull.txt and matrixCompSummary.txt):

[Regtest results to follow]

@JessicaMeixner-NOAA
Copy link
Collaborator

Thanks for these updates @ukmo-ccbunney I'll review and start regtests

@ukmo-ccbunney ukmo-ccbunney added the mod_def change the binary mod_def file changes with the PR label May 7, 2024
@ukmo-ccbunney
Copy link
Collaborator Author

Thanks for these updates @ukmo-ccbunney I'll review and start regtests

I forgot to mention that there will be changes to the mod_def.ww3 file for any regtests using ST4. Outputs are not expected to change though.

@ukmo-ccbunney
Copy link
Collaborator Author

Hold fire on the regression tests @JessicaMeixner-NOAA - I am seeing some inconsistencies with the minimum charnock value in some tests where it should not be altered.

@JessicaMeixner-NOAA
Copy link
Collaborator

@ukmo-ccbunney I have run the regtests already sorry I forgot to post the updates yesterday. Since I've already run them, in case this is helpful:
matrixCompFull.txt
matrixCompSummary.txt
matrixDiff.txt

I had seen lots of mod_def and grid.out diffs, but had not yet done the careful check to make sure it was just ST4. I was going to compare with the diffs you got. Let me know when you're ready for me to run again or look more closely, etc.

@ukmo-ccbunney
Copy link
Collaborator Author

@ukmo-ccbunney I have run the regtests already sorry I forgot to post the updates yesterday. Since I've already run them, in case this is helpful: matrixCompFull.txt matrixCompSummary.txt matrixDiff.txt

I had seen lots of mod_def and grid.out diffs, but had not yet done the careful check to make sure it was just ST4. I was going to compare with the diffs you got. Let me know when you're ready for me to run again or look more closely, etc.

So - mostly it is just expected mod_def differences (addition of extra CHACAP variables)
However, I am also seeing differences in the Charnock output for the coupled runs (ww3_tp2.14) and I can't see why at the moment! Do you see the same?

@JessicaMeixner-NOAA
Copy link
Collaborator

@ukmo-ccbunney yes, the tp2.14 has unexpected answer changes. The machine i ran the regtests is offline for maitence so I can't look at files beyond these logs, but I see a lot of 0 -> 0.0095 in the answer diffs.

@ukmo-ccbunney
Copy link
Collaborator Author

ukmo-ccbunney commented May 7, 2024

@ukmo-ccbunney yes, the tp2.14 has unexpected answer changes. The machine i ran the regtests is offline for maitence so I can't look at files beyond these logs, but I see a lot of 0 -> 0.0095 in the answer diffs.

Yes - similarly for me.

I can confirm that all differences are expected (just mod_def change), except for

  • ww3_tp2.14 (OASIS coulpler) : differences in Charnock output
  • ww3_tp2.21 : Small differences in all fields. I often have trouble with the regetsts and I think there is an unrelated bug somewhere else in the code that is sensitive to code changes.

I am investigating the ww3_tp2.14 differences!

@ukmo-nievesvaliente
Copy link
Collaborator

@ukmo-ccbunney it sounds to me that the changes in the regtests are related to the intitial charnock CHA0=AALPHA that I think is 0.0095 maybe related to L1945?

@ukmo-ccbunney
Copy link
Collaborator Author

@ukmo-ccbunney it sounds to me that the changes in the regtests are related to the intitial charnock CHA0=AALPHA that I think is 0.0095 maybe related to L1945?

CHA0 only gets used if CAPCHA=1, so I can't see how it is affecting the coupled tests.

@ukmo-ccbunney
Copy link
Collaborator Author

@ukmo-nievesvaliente I think I have found the issue.
CHATH is only defined if explicit stress calculations are used (SINTAILPAR(1) =1; no stress table), but it is used later in the routine when calculating the roughness length. When running with lookup tables, if USTAR < 0.001 then CHARN is being set to CHATH, which is undefined.
I've set it to default to AALPHA at the top of the routine.

The results now look ok for ww3_tp2.14/OASACM - I'll rerun for the rest of the tests now.

@ukmo-ccbunney
Copy link
Collaborator Author

ukmo-ccbunney commented May 8, 2024

All tests are now B4B (ignoring the mod_def changes), except the usual suspects and ww3_tp2.21.
@JessicaMeixner-NOAA - I would be interested to know if you also see difference sin ww3_tp2.21. I get these sometimes and they seem to be compiler dependent.

@JessicaMeixner-NOAA
Copy link
Collaborator

@ukmo-ccbunney I did not originally get any diffs beyond mod_defs on tp2.21. I'll do some additional tests with the updates and let you know!

@ukmo-ccbunney
Copy link
Collaborator Author

@ukmo-ccbunney I did not originally get any diffs beyond mod_defs on tp2.21. I'll do some additional tests with the updates and let you know!

For context, when I run using the GNU compiler I get differences in ww3_tp2.21.
When I run with the Intel compiler I don't get any differences...

@JessicaMeixner-NOAA
Copy link
Collaborator

I'll run both gnu and intel tests, including gnu on the machine where I tend to get more differences than most.

@JessicaMeixner-NOAA
Copy link
Collaborator

For intel the diffs are here:
matrixCompFull.txt
matrixCompSummary.txt
matrixDiff.txt
I looked through and I just see the normal diffs + mod_def grid.out changes for ST4:

**********************************************************************
********************* non-identical cases ****************************
**********************************************************************
mww3_test_03/./work_PR1_MPI_e                     (1 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UQ_MPI_e                     (1 files differ)
mww3_test_03/./work_PR2_UNO_MPI_d2                     (9 files differ)
mww3_test_03/./work_PR1_MPI_d2                     (8 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2_c                     (16 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2_c                     (16 files differ)
mww3_test_03/./work_PR3_UNO_MPI_d2                     (12 files differ)
mww3_test_03/./work_PR2_UQ_MPI_d2                     (16 files differ)
mww3_test_03/./work_PR3_UNO_MPI_e_c                     (1 files differ)
mww3_test_03/./work_PR3_UQ_MPI_d2                     (13 files differ)
mww3_test_05/./work_ST4_PR3_UQ_MPI_OMPH                     (10 files differ)
mww3_test_05/./work_ST4_PR3_UNO_MPI                     (10 files differ)
mww3_test_05/./work_ST4_PR3_UQ_MPI                     (10 files differ)
mww3_test_05/./work_ST4_PR2_UQ_MPI                     (10 files differ)
mww3_test_05/./work_ST4_PR2_UNO_OMP                     (10 files differ)
mww3_test_05/./work_ST4_PR3_UNO_OMP                     (10 files differ)
mww3_test_05/./work_ST4_PR3_UNO_MPI_OMPH                     (10 files differ)
mww3_test_05/./work_ST4_PR1_MPI                     (10 files differ)
mww3_test_05/./work_ST4_PR1_MPI_OMPH                     (10 files differ)
mww3_test_05/./work_ST4_PR1_OMP                     (10 files differ)
mww3_test_05/./work_ST4_PR3_UQ_OMP                     (10 files differ)
mww3_test_05/./work_ST4_PR2_UNO_MPI                     (10 files differ)
mww3_test_05/./work_ST4_PR2_UNO_MPI_OMPH                     (10 files differ)
mww3_test_05/./work_ST4_PR2_UQ_OMP                     (10 files differ)
mww3_test_05/./work_ST4_PR2_UQ_MPI_OMPH                     (10 files differ)
mww3_test_08/./work_ST4_PR3_UQ_MPI                     (4 files differ)
mww3_test_08/./work_lowres                     (2 files differ)
mww3_test_09/./work_MPI_ASCII                     (0 files differ)
ww3_ta1/./work_UPD0F_O                     (2 files differ)
ww3_ta1/./work_UPD0F_U                     (2 files differ)
ww3_ta1/./work_UPD2_U_cap                     (2 files differ)
ww3_ta1/./work_UPD3_U                     (2 files differ)
ww3_ta1/./work_UPD5_U_cap                     (2 files differ)
ww3_ta1/./work_UPD6_O                     (2 files differ)
ww3_ta1/./work_UPD2_U                     (2 files differ)
ww3_ta1/./work_UPD5_O                     (2 files differ)
ww3_ta1/./work_UPD5_U                     (2 files differ)
ww3_ta1/./work_UPD3_U_cap                     (2 files differ)
ww3_ta1/./work_UPD3_O                     (2 files differ)
ww3_ta1/./work_UPD6_U                     (2 files differ)
ww3_ta1/./work_UPD2_O                     (2 files differ)
ww3_ta1/./work_UPD6_U_cap                     (2 files differ)
ww3_tp1.8/./work_PR3_UQ                     (2 files differ)
ww3_tp2.10/./work_MPI                     (2 files differ)
ww3_tp2.10/./work_MPI_OMPH                     (8 files differ)
ww3_tp2.14/./work_OASACM6                     (2 files differ)
ww3_tp2.14/./work_OASACM3                     (2 files differ)
ww3_tp2.14/./work_OASACM5                     (2 files differ)
ww3_tp2.14/./work_OASACM4                     (2 files differ)
ww3_tp2.14/./work_OASACM                     (2 files differ)
ww3_tp2.14/./work_OASICM                     (2 files differ)
ww3_tp2.14/./work_OASACM2                     (2 files differ)
ww3_tp2.14/./work_OASOCM                     (2 files differ)
ww3_tp2.15/./work_PR3_UQ_RHO                     (2 files differ)
ww3_tp2.15/./work_5km                     (2 files differ)
ww3_tp2.15/./work_PR3_UQ_RHO_MPI                     (2 files differ)
ww3_tp2.15/./work_PR3_UQ                     (2 files differ)
ww3_tp2.15/./work_MPI_5km                     (2 files differ)
ww3_tp2.15/./work_PR3_UQ_MPI                     (2 files differ)
ww3_tp2.15/./work_ST4FLX5                     (2 files differ)
ww3_tp2.16/./work_MPI_OMPH                     (4 files differ)
ww3_tp2.17/./work_ma                     (2 files differ)
ww3_tp2.17/./work_a                     (2 files differ)
ww3_tp2.17/./work_mc1                     (2 files differ)
ww3_tp2.17/./work_mb                     (2 files differ)
ww3_tp2.17/./work_mc                     (2 files differ)
ww3_tp2.17/./work_ma1                     (2 files differ)
ww3_tp2.17/./work_c                     (2 files differ)
ww3_tp2.17/./work_b                     (2 files differ)
ww3_tp2.18/./work_TIDE_MPI                     (2 files differ)
ww3_tp2.18/./work_TIDE                     (2 files differ)
ww3_tp2.21/./work_ma                     (4 files differ)
ww3_tp2.21/./work_b_metis                     (2 files differ)
ww3_tp2.21/./work_a                     (2 files differ)
ww3_tp2.21/./work_mb                     (4 files differ)
ww3_tp2.21/./work_b                     (2 files differ)
ww3_tp2.6/./work_ST4                     (2 files differ)
ww3_tp2.6/./work_ST4_ASCII                     (3 files differ)
ww3_ts1/./work_Romero                     (2 files differ)
ww3_ts1/./work_ST4_CAP                     (directory not found)
ww3_ts1/./work_T701                     (2 files differ)
ww3_ts1/./work_ST4_WRT                     (2 files differ)
ww3_ts1/./work_ST4_GMD                     (2 files differ)
ww3_ts1/./work_ST4                     (2 files differ)
ww3_ts1/./work_ST4_TSA                     (2 files differ)
ww3_ts1/./work_ST4_T700                     (2 files differ)
ww3_ts1/./work_T702                     (2 files differ)
ww3_ts1/./work_ST4_T500                     (2 files differ)
ww3_ts1/./work_T707GQM                     (2 files differ)
ww3_ts1/./work_T713GQM                     (2 files differ)
ww3_ts2/./work_ST4_PR1                     (2 files differ)
ww3_ts2/./work_ST4_PR3_UNO                     (2 files differ)
ww3_ts2/./work_ST4_PR3_UQ                     (2 files differ)
ww3_ts2/./work_ST4_PR2_UQ                     (2 files differ)
ww3_ts2/./work_ST4_PR2_UNO                     (2 files differ)
ww3_ts3/./work_ST4_PR3_UQ_MPI_OMPH                     (2 files differ)
ww3_ts3/./work_ST4_PR3_UNO_MPI                     (2 files differ)
ww3_ts3/./work_ST4_PR3_UQ_MPI                     (2 files differ)
ww3_ts3/./work_ST4_FLD2_MPI                     (2 files differ)
ww3_ts3/./work_ST4_PR2_UQ_MPI                     (2 files differ)
ww3_ts3/./work_ST4_PR2_UNO_OMP                     (2 files differ)
ww3_ts3/./work_ST4_PR3_UNO_OMP                     (2 files differ)
ww3_ts3/./work_ST4_PR3_UNO_MPI_OMPH                     (2 files differ)
ww3_ts3/./work_ST4_PR1_MPI                     (2 files differ)
ww3_ts3/./work_ST4_PR1_MPI_OMPH                     (2 files differ)
ww3_ts3/./work_ST4_FLD1_MPI                     (2 files differ)
ww3_ts3/./work_ST4_PR1_OMP                     (2 files differ)
ww3_ts3/./work_ST4_PR3_UQ_OMP                     (2 files differ)
ww3_ts3/./work_ST4_PR2_UNO_MPI                     (2 files differ)
ww3_ts3/./work_ST4_PR2_UNO_MPI_OMPH                     (2 files differ)
ww3_ts3/./work_ST4_PR2_UQ_OMP                     (2 files differ)
ww3_ts3/./work_ST4_PR2_UQ_MPI_OMPH                     (2 files differ)
ww3_ufs1.1/./work_unstr_b                     (2 files differ)
ww3_ufs1.1/./work_c_npl                     (4 files differ)
ww3_ufs1.1/./work_unstr_a                     (2 files differ)
ww3_ufs1.1/./work_unstr_c                     (2 files differ)
ww3_ufs1.1/./work_d                     (4 files differ)
ww3_ufs1.1/./work_c_nth                     (4 files differ)
ww3_ufs1.1/./work_c                     (4 files differ)
ww3_ufs1.2/./work_a                     (12 files differ)
ww3_ufs1.2/./work_l                     (8 files differ)
ww3_ufs1.2/./work_c                     (14 files differ)
ww3_ufs1.2/./work_b                     (12 files differ)
ww3_ufs1.3/./work_a                     (13 files differ)

I ran gnu tests on hercules, which usually gives me the most diffs, and for the tp2.21 tests only the mod_defs and grid.out was different:

ww3_tp2.21/./work_mb                     (4 files differ)
ww3_tp2.21/./work_b                     (2 files differ)
ww3_tp2.21/./work_a                     (2 files differ)
ww3_tp2.21/./work_ma                     (4 files differ)
ww3_tp2.21/./work_b_metis                     (2 files differ)

I have one other machine I can run gnu on if you think that'd be helpful @ukmo-ccbunney

@ukmo-ccbunney
Copy link
Collaborator Author

I ran gnu tests on hercules, which usually gives me the most diffs, and for the tp2.21 tests only the mod_defs and grid.out was different:

ww3_tp2.21/./work_mb                     (4 files differ)
ww3_tp2.21/./work_b                     (2 files differ)
ww3_tp2.21/./work_a                     (2 files differ)
ww3_tp2.21/./work_ma                     (4 files differ)
ww3_tp2.21/./work_b_metis                     (2 files differ)

Greaty- thanks for that @JessicaMeixner-NOAA

I have one other machine I can run gnu on if you think that'd be helpful @ukmo-ccbunney

Only if you have time. Otherwise I am happy with the regtest results.

@JessicaMeixner-NOAA
Copy link
Collaborator

I'll run them as we give @ukmo-nievesvaliente and @mickaelaccensi a little more time to review, but I think this PR is good to go.

@ukmo-nievesvaliente
Copy link
Collaborator

Thanks for adding the functionality to the code @ukmo-ccbunney!

Copy link
Collaborator

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Choose a reason for hiding this comment

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

Only the expected changes for both intel and gnu on hera for us. Also did not get changes in 2.21 on hercules with gnu like @ukmo-ccbunney saw. I do know others have had some machine related issues so there's likely a lingering bug somewhere we need to find, but it is unrelated to this PR.

@mickaelaccensi I'm going ot be merging this PR, but if you review later and discover issues, please let us know and we'll address them.

@JessicaMeixner-NOAA JessicaMeixner-NOAA merged commit 14e6bed into NOAA-EMC:develop May 10, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mod_def change the binary mod_def file changes with the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants