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

Add two-way ocean-wave coupling feature to the HAFS applications #2584

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

binli2337
Copy link
Contributor

@binli2337 binli2337 commented Jan 30, 2025

Commit Queue Requirements:

  • Fill out all sections of this template.
  • All sub component pull requests have been reviewed by their code managers.
  • Run the full Intel+GNU RT suite (compared to current baselines) on either Hera/Derecho/Hercules
  • Commit 'test_changes.list' from previous step

Description:

The ufs-weather-model will be updated to include two-way ocean-wave coupling capability for HAFS applications.

Commit Message:

  * CMEPS - CMEPS is updated to transfer ocean-current fields from MOM6 to WW3 and to transfer the Stokes drift components from WW3 to MOM6 for the HAFS applications.
  * MOM6 - MOM6 cap is updated to convert a missing value to zero for the imported Stokes drift components for the ufs.hafs applications.
  * WW3 - WW3 cap is updated to convert a missing value to zero for the imported ocean-current fields for the ufs.hafs applications.
 

Priority:

  • Normal

Git Tracking

UFSWM:

Sub component Pull Requests:

UFSWM Blocking Dependencies:

  • Blocked by #
  • None

Changes

Regression Test Changes (Please commit test_changes.list):

  • PR Updates/Changes Baselines.

Input data Changes:

  • Updated input data is located at /scratch1/NCEPDEV/hwrf/save/Bin.Li/UFS-WM_RT/NEMSfv3gfs/input-data-20240501/WW3_input_data_20250114/mod_def.natl_6m.

Library Changes/Upgrades:

  • No Updates

Testing Log:

  • RDHPCS
    • Hera
    • Orion
    • Hercules
    • Jet
    • GaeaC5
    • GaeaC6
    • Derecho
  • WCOSS2
    • Dogwood/Cactus
    • Acorn
  • CI
  • opnReqTest (complete task if unnecessary)

@DeniseWorthen
Copy link
Collaborator

@binli2337 Don't you know the value which will be sent from non-overlapped regions (ie, the fillvalue). Why is it necessary to check for the difference between the field and the fillvalue ... for example in MOM6 : abs(stkx(i,j,ib)-fillValue) <= 0.01 ?

@binli2337
Copy link
Contributor Author

@DeniseWorthen When comparing floating point numbers, it is generally recommended to check if the absolute difference between the two numbers is less than a tiny value. In this specific case, since stkx and fillvalue are constant, it is probably not necessary to check the absolute difference. Thanks for reviewing the code.

@DeniseWorthen
Copy link
Collaborator

@binli2337 If your argument about 'checking small differences' pertains, then shouldn't you make sure both components are tested?

if( (trim(casename) == "ufs.hafs") .and. (abs(stkx(i,j,ib)-fillValue) <= 0.01) ) then
              ice_ocean_boundary%ustkb(i,j,ib) = 0.0
              ice_ocean_boundary%vstkb(i,j,ib) = 0.0
            else

@binli2337
Copy link
Contributor Author

@DeniseWorthen In the related CMEPS PR, the Stokes drift components for the x direction and the y direction are filled with the fill value in the same non-overlapped areas (from line 603 to line 610 in the esmFldsExchange_hafs_mod.F90 file). So in the MOM6 PR, when stkx has the fill value, the stky will always has the same fill value. Checking whether abs(stky(i,j,ib)-fillValue) is less than a small number is not needed.

@DeniseWorthen
Copy link
Collaborator

@binli2337 I'm confused how you are using waves in MOM6 w/o updating your MOM_input. When I look at the file
ufs.hafs.cpl.hi.2020-08-25-54000.nc in the hafs_regional_storm_following_1nest_atm_ocn_wav_mom6_intel test, there are no stokes fields exported to OCN. There are only stokes fields imported from WAV.

@DeniseWorthen
Copy link
Collaborator

See this code from the MOM cap

  call query_ocean_state(ocean_state, use_waves=use_waves, wave_method=wave_method)
  if (use_waves) then
    if (wave_method == "EFACTOR") then
      allocate( Ice_ocean_boundary%lamult(isc:iec,jsc:jec) )
      Ice_ocean_boundary%lamult          = 0.0
    else if (wave_method == "SURFACE_BANDS") then
      call query_ocean_state(ocean_state, NumWaveBands=Ice_ocean_boundary%num_stk_bands)
      allocate(Ice_ocean_boundary%ustkb(isc:iec,jsc:jec,Ice_ocean_boundary%num_stk_bands), source=0.0)
      allocate(Ice_ocean_boundary%vstkb(isc:iec,jsc:jec,Ice_ocean_boundary%num_stk_bands), source=0.0)
      allocate(Ice_ocean_boundary%stk_wavenumbers(Ice_ocean_boundary%num_stk_bands), source=0.0)
      call query_ocean_state(ocean_state, WaveNumbers=Ice_ocean_boundary%stk_wavenumbers, unscale=.true.)
    else
      call MOM_error(FATAL, "Unsupported WAVE_METHOD encountered in NUOPC cap.")
    endif
  endif

How is MOM6 importing and using waves when the use_waves parameter is not present in the MOM_input_hafs?

@@ -972,5 +997,3 @@ USE_NET_FW_ADJUSTMENT_SIGN_BUG = False ! [Boolean] default = True
! === module MOM_restart ===

! === module MOM_file_parser ===

USE_HUYNH_STENCIL_BUG = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

this parameter needs to be here (false is its default), other wise it will break mpi test (answer change with different PE #) on wcoss2. There is a FMA bug in the code but GFDL haven't figured it out yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jiandewang The file "MOM_input_hafs" has been updated. Thanks!

@binli2337
Copy link
Contributor Author

@DeniseWorthen The file "MOM_input_hafs" has been updated for the 2-way ocean wave coupling test. The test name is hafs_regional_storm_following_1nest_atm_ocn_wav_mom6. Thanks!

@DeniseWorthen
Copy link
Collaborator

DeniseWorthen commented Feb 18, 2025

@binli2337 Are you using a new or updated WW3 mod_def for this test? If not, I believe you are exporting all 0s from WW3 for the stokes components. See this line

https://github.com/NOAA-EMC/WW3/blob/8e676278822292a97b2b69da336444ec7d04c06b/model/src/wav_import_export.F90#L808

You need to have the following line in your inp file for WW3 in order to calculate the stokes for export:

&OUTS USSP = 1, IUSSP = 3, STK_WN = 0.04, 0.110, 0.3305 /

How are you testing this? Have you verified non-zero stokes fields sent to OCN?

@DeniseWorthen DeniseWorthen added the input data change Input data change label Feb 18, 2025
@binli2337
Copy link
Contributor Author

@DeniseWorthen Yes, the model definition file has been updated with the stokes drift components. The updated file is from my input directory on Hera. You can verify the stokes drift fields from the mediator history file.

@DeniseWorthen
Copy link
Collaborator

DeniseWorthen commented Feb 19, 2025

@binli2337 Thanks, I found the mod_def (we need to be careful and commit the updated inp file too). But I still don't understand why the changes are necessary in WW3 or MOM6. I ran the mom6 RT w/ only your changes to CMEPS (to add the field exchanges). All the stokes drifts components are already 0.0 in the areas where there is no overlap.

@binli2337
Copy link
Contributor Author

@DeniseWorthen Thank you for identifying some interpolation issues. The issues have been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input data change Input data change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update HAFS applications to include 2-way ocean-wave coupling capability
3 participants