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 WW3 cap for 2-way ocean-wave coupling #1348

Open
wants to merge 9 commits into
base: dev/ufs-weather-model
Choose a base branch
from
13 changes: 13 additions & 0 deletions model/src/wav_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ subroutine import_fields( gcomp, time0, timen, rc )
use wmupdtmd , only: wmupd2
use wmmdatmd , only: wmsetm
use wmmdatmd , only: mdse, mdst, nrgrd, inpmap
use wav_shr_mod , only : casename
#ifdef W3_MPI
use wmmdatmd , only: mpi_comm_grd
#endif
Expand All @@ -293,6 +294,8 @@ subroutine import_fields( gcomp, time0, timen, rc )
character(len=10) :: vwnd
integer :: imod, j, jmod
integer :: mpi_comm_null = -1
integer :: isea
real(r4), parameter :: fillv = 9.99e20
real(r4), allocatable :: wxdata(:) ! only needed if merge_import
real(r4), allocatable :: wydata(:) ! only needed if merge_import
character(len=CL) :: msgString
Expand Down Expand Up @@ -357,6 +360,11 @@ subroutine import_fields( gcomp, time0, timen, rc )
if (state_fldchk(importState, 'So_u')) then
call SetGlobalInput(importState, 'So_u', vm, global_data, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
do isea = 1,nsea
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be isolated so as to not to affect other users of the WW3 mesh cap.

if(casename == "ufs.hafs" .and. abs(global_data(isea)-fillv).lt.0.01) then
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about:

if(casename == "ufs.hafs") then 
  do isea = 1,nsea
      if abs(global_data(isea)-fillv).lt.0.01) then 
          global_data(isea)=0.0


That way for non-hafs applications you are not going through this loop.

Copy link
Author

Choose a reason for hiding this comment

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

@JessicaMeixner-NOAA I will revise the wav_import_export.F90 file.
The changes in WW3 alone will not change any baselines in the UFS regression tests since ocean-current fields are not transferred to WW3 using the emc/develop branch of CMEPS. A related CMEPS PR will transfer the fields.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the explanation @binli2337 !

Copy link
Contributor

@DeniseWorthen DeniseWorthen Jan 29, 2025

Choose a reason for hiding this comment

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

@binli2337 In the global model, we do export So_u and So_v to WAV.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good point @DeniseWorthen

@binli2337 can you share the ufs-waether-model PR ?

Copy link
Author

Choose a reason for hiding this comment

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

@JessicaMeixner-NOAA The ufs-weather-model branch is at
https://github.com/binli2337/ufs-weather-model/tree/202501b/ocean_wave_update. A PR will be submitted soon.

global_data(isea)=0.0
end if
end do
call FillGlobalInput(global_data, CX0)
call FillGlobalInput(global_data, CXN)
end if
Expand All @@ -366,6 +374,11 @@ subroutine import_fields( gcomp, time0, timen, rc )
if (state_fldchk(importState, 'So_v')) then
call SetGlobalInput(importState, 'So_v', vm, global_data, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
do isea = 1,nsea
if(casename == "ufs.hafs" .and. abs(global_data(isea)-fillv).lt.0.01) then
global_data(isea)=0.0
end if
end do
call FillGlobalInput(global_data, CY0)
call FillGlobalInput(global_data, CYN)
end if
Expand Down
Loading