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

Conditionally Couple Wave Fields based on COMPSET #6885

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions components/mpas-ocean/driver/mpaso_cpl_indices.F
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ module mpaso_cpl_indices

subroutine mpaso_cpl_indices_set( )

use seq_flds_mod, only : wav_ocn_coup
type(mct_aVect) :: o2x ! temporary
type(mct_aVect) :: x2o ! temporary

Expand Down Expand Up @@ -318,22 +319,23 @@ subroutine mpaso_cpl_indices_set( )
index_x2o_Sg_icemask = mct_avect_indexra(x2o,'Sg_icemask_grounded')
index_x2o_Sg_icemask = mct_avect_indexra(x2o,'Sg_icemask_floating')

index_x2o_Sw_ustokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_1')
index_x2o_Sw_vstokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_1')
index_x2o_Sw_ustokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_2')
index_x2o_Sw_vstokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_2')
index_x2o_Sw_ustokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_3')
index_x2o_Sw_vstokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_3')
index_x2o_Sw_ustokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_4')
index_x2o_Sw_vstokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_4')
index_x2o_Sw_ustokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_5')
index_x2o_Sw_vstokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_5')
index_x2o_Sw_ustokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_6')
index_x2o_Sw_vstokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_6')
index_x2o_Sw_Hs = mct_avect_indexra(x2o,'Sw_Hs')
index_x2o_Sw_Fp = mct_avect_indexra(x2o,'Sw_Fp')
index_x2o_Sw_Dp = mct_avect_indexra(x2o,'Sw_Dp')

if (wav_ocn_coup == 'twoway') then
index_x2o_Sw_ustokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_1')
index_x2o_Sw_vstokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_1')
index_x2o_Sw_ustokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_2')
index_x2o_Sw_vstokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_2')
index_x2o_Sw_ustokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_3')
index_x2o_Sw_vstokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_3')
index_x2o_Sw_ustokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_4')
index_x2o_Sw_vstokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_4')
index_x2o_Sw_ustokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_5')
index_x2o_Sw_vstokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_5')
index_x2o_Sw_ustokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_6')
index_x2o_Sw_vstokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_6')
index_x2o_Sw_Hs = mct_avect_indexra(x2o,'Sw_Hs')
index_x2o_Sw_Fp = mct_avect_indexra(x2o,'Sw_Fp')
index_x2o_Sw_Dp = mct_avect_indexra(x2o,'Sw_Dp')
endif
call mct_aVect_clean(x2o)
call mct_aVect_clean(o2x)

Expand Down
52 changes: 27 additions & 25 deletions components/mpas-ocean/driver/ocn_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -2389,31 +2389,33 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{
iceFraction(i) = x2o_o % rAttr(index_x2o_Si_ifrac, n)
end if

if ( stokesDriftZonalWavenumberField % isActive ) then
stokesDriftZonalWavenumber(1,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_1, n)
stokesDriftZonalWavenumber(2,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_2, n)
stokesDriftZonalWavenumber(3,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_3, n)
stokesDriftZonalWavenumber(4,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_4, n)
stokesDriftZonalWavenumber(5,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_5, n)
stokesDriftZonalWavenumber(6,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_6, n)
end if
if ( stokesDriftMeridionalWavenumberField % isActive ) then
stokesDriftMeridionalWavenumber(1,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_1, n)
stokesDriftMeridionalWavenumber(2,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_2, n)
stokesDriftMeridionalWavenumber(3,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_3, n)
stokesDriftMeridionalWavenumber(4,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_4, n)
stokesDriftMeridionalWavenumber(5,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_5, n)
stokesDriftMeridionalWavenumber(6,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_6, n)
end if
if ( significantWaveHeightField % isActive ) then
significantWaveHeight(i) = x2o_o % rAttr(index_x2o_Sw_Hs, n)
end if
if ( peakWaveFrequencyField % isActive ) then
peakWaveFrequency(i) = x2o_o % rAttr(index_x2o_Sw_Fp, n)
end if
if ( peakWaveDirectionField % isActive ) then
peakWaveDirection(i) = x2o_o % rAttr(index_x2o_Sw_Dp, n)
end if
if (wav_ocn_coup == 'twoway') then
if ( stokesDriftZonalWavenumberField % isActive ) then
stokesDriftZonalWavenumber(1,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_1, n)
stokesDriftZonalWavenumber(2,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_2, n)
stokesDriftZonalWavenumber(3,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_3, n)
stokesDriftZonalWavenumber(4,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_4, n)
stokesDriftZonalWavenumber(5,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_5, n)
stokesDriftZonalWavenumber(6,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_6, n)
end if
if ( stokesDriftMeridionalWavenumberField % isActive ) then
stokesDriftMeridionalWavenumber(1,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_1, n)
stokesDriftMeridionalWavenumber(2,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_2, n)
stokesDriftMeridionalWavenumber(3,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_3, n)
stokesDriftMeridionalWavenumber(4,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_4, n)
stokesDriftMeridionalWavenumber(5,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_5, n)
stokesDriftMeridionalWavenumber(6,i) = x2o_o % rAttr(index_x2o_Sw_vstokes_wavenumber_6, n)
end if
if ( significantWaveHeightField % isActive ) then
significantWaveHeight(i) = x2o_o % rAttr(index_x2o_Sw_Hs, n)
end if
if ( peakWaveFrequencyField % isActive ) then
peakWaveFrequency(i) = x2o_o % rAttr(index_x2o_Sw_Fp, n)
end if
if ( peakWaveDirectionField % isActive ) then
peakWaveDirection(i) = x2o_o % rAttr(index_x2o_Sw_Dp, n)
end if
endif

if (config_cvmix_kpp_use_theory_wave) then
if ( windSpeed10mField% isActive ) then
Expand Down
87 changes: 34 additions & 53 deletions components/ww3/src/cpl/wav_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -850,29 +850,6 @@ SUBROUTINE WAV_INIT_MCT( EClock, cdata, x2w_w, w2x_w, NLFilename )

! add call to gptl timer

! send initial state to driver
do jsea=1, nseal
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0
enddo

! end redirection of share output to wav log

if ( iaproc .eq. napout ) then
call shr_sys_flush(ndso)
endif
Expand Down Expand Up @@ -1200,50 +1177,54 @@ SUBROUTINE WAV_RUN_MCT(EClock, cdata_w, x2w_w, w2x_w)
IY = MAPSF(ISEA,2)
if (MAPSTA(IY,IX) .eq. 1) then

w2x_w%rattr(index_w2x_Sw_Hs,jsea) = HS(jsea)
w2x_w%rattr(index_w2x_Sw_Fp,jsea) = FP0(jsea)
w2x_w%rattr(index_w2x_Sw_Dp,jsea) = THP0(jsea)
if (wav_ocn_coup .eq. 'twoway') then
w2x_w%rattr(index_w2x_Sw_Hs,jsea) = HS(jsea)
w2x_w%rattr(index_w2x_Sw_Fp,jsea) = FP0(jsea)
w2x_w%rattr(index_w2x_Sw_Dp,jsea) = THP0(jsea)

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = USSP(jsea,1)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = USSP(jsea,nk+1)

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = USSP(jsea,1)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = USSP(jsea,nk+1)
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = USSP(jsea,2)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = USSP(jsea,nk+2)

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = USSP(jsea,2)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = USSP(jsea,nk+2)
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = USSP(jsea,3)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = USSP(jsea,nk+3)

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = USSP(jsea,3)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = USSP(jsea,nk+3)
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = USSP(jsea,4)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = USSP(jsea,nk+4)

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = USSP(jsea,4)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = USSP(jsea,nk+4)
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = USSP(jsea,5)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = USSP(jsea,nk+5)

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = USSP(jsea,5)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = USSP(jsea,nk+5)

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = USSP(jsea,6)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = USSP(jsea,nk+6)
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = USSP(jsea,6)
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = USSP(jsea,nk+6)
endif
else

w2x_w%rattr(index_w2x_Sw_Hs,jsea) = 0.0
if (wav_ocn_coup .eq. 'twoway') then
w2x_w%rattr(index_w2x_Sw_Hs,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_Fp,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_Dp,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0

w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0
w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0
endif
endif
enddo

!----------------------------------------------------------------------------
Expand Down
36 changes: 19 additions & 17 deletions components/ww3/src/cpl/ww3_cpl_indices.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module ww3_cpl_indices

subroutine ww3_cpl_indices_set( )

use seq_flds_mod, only : wav_ocn_coup
type(mct_aVect) :: w2x ! temporary
type(mct_aVect) :: x2w ! temporary

Expand All @@ -62,23 +63,24 @@ subroutine ww3_cpl_indices_set( )
index_x2w_So_bldepth = mct_avect_indexra(x2w,'So_bldepth') ! Boundary layer depth
index_x2w_So_ssh = mct_avect_indexra(x2w,'So_ssh') ! Sea surface height

index_w2x_Sw_Hs = mct_avect_indexra(w2x,'Sw_Hs') ! Significant wave height
index_w2x_Sw_Fp = mct_avect_indexra(w2x,'Sw_Fp') ! Peak wave freqency
index_w2x_Sw_Dp = mct_avect_indexra(w2x,'Sw_Dp') ! Peak wave direction

index_w2x_Sw_ustokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_1') ! partitioned Stokes drift u 1
index_w2x_Sw_vstokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_1') ! partitioned Stokes drift v 1
index_w2x_Sw_ustokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_2') ! partitioned Stokes drift u 2
index_w2x_Sw_vstokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_2') ! partitioned Stokes drift v 2
index_w2x_Sw_ustokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_3') ! partitioned Stokes drift u 3
index_w2x_Sw_vstokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_3') ! partitioned Stokes drift v 3
index_w2x_Sw_ustokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_4') ! partitioned Stokes drift u 4
index_w2x_Sw_vstokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_4') ! partitioned Stokes drift v 4
index_w2x_Sw_ustokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_5') ! partitioned Stokes drift u 5
index_w2x_Sw_vstokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_5') ! partitioned Stokes drift v 5
index_w2x_Sw_ustokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_6') ! partitioned Stokes drift u 6
index_w2x_Sw_vstokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_6') ! partitioned Stokes drift v 6

if (wav_ocn_coup .eq. 'twoway') then
index_w2x_Sw_Hs = mct_avect_indexra(w2x,'Sw_Hs') ! Significant wave height
index_w2x_Sw_Fp = mct_avect_indexra(w2x,'Sw_Fp') ! Peak wave freqency
index_w2x_Sw_Dp = mct_avect_indexra(w2x,'Sw_Dp') ! Peak wave direction

index_w2x_Sw_ustokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_1') ! partitioned Stokes drift u 1
index_w2x_Sw_vstokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_1') ! partitioned Stokes drift v 1
index_w2x_Sw_ustokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_2') ! partitioned Stokes drift u 2
index_w2x_Sw_vstokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_2') ! partitioned Stokes drift v 2
index_w2x_Sw_ustokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_3') ! partitioned Stokes drift u 3
index_w2x_Sw_vstokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_3') ! partitioned Stokes drift v 3
index_w2x_Sw_ustokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_4') ! partitioned Stokes drift u 4
index_w2x_Sw_vstokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_4') ! partitioned Stokes drift v 4
index_w2x_Sw_ustokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_5') ! partitioned Stokes drift u 5
index_w2x_Sw_vstokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_5') ! partitioned Stokes drift v 5
index_w2x_Sw_ustokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_6') ! partitioned Stokes drift u 6
index_w2x_Sw_vstokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_6') ! partitioned Stokes drift v 6
endif
call mct_aVect_clean(x2w)
call mct_aVect_clean(w2x)

Expand Down
14 changes: 14 additions & 0 deletions driver-mct/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files):
elif case.get_value('RUN_TYPE') == 'branch':
config['run_type'] = 'branch'

# ---------------------------------------------------
# set wave coupling settings based on compset:
# ---------------------------------------------------
if case.get_value('COMP_WAV') == 'ww3':
config['WAVSPEC'] = case.get_value('WAV_SPEC')
if case.get_value('COMP_OCN') == 'mpaso':
config['WAV_OCN_COUP'] = 'twoway'
elif case.get_value('COMP_OCN') == 'docn':
config['WAV_OCN_COUP'] = 'oneway'
elif case.get_value('COMP_WAV') == 'dwav':
config['WAVSPEC'] = 'sp36x36'
else:
config['WAVSPEC'] = 'none'

#----------------------------------------------------
# Initialize namelist defaults
#----------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions driver-mct/cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,17 @@
</values>
</entry>

<entry id="wav_ocn_coup">
<type>char</type>
<category>seq_flds</category>
<group>seq_cplflds_inparm</group>
<desc>One- or Two-way coupling between Wave and Ocn.</desc>
<values>
<value>none</value>
<value WAV_OCN_COUP="oneway">oneway</value>
<value WAV_OCN_COUP="twoway">twoway</value>
</values>
</entry>
<!-- =========================== -->
<!-- -group seq_cplflds_custom -->
<!-- =========================== -->
Expand Down
3 changes: 2 additions & 1 deletion driver-mct/main/prep_ocn_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ subroutine prep_ocn_merge( flux_epbalfact, a2x_o, i2x_o, r2x_o, w2x_o, g2x_o, xa
fractions_o, x2o_o )

use prep_glc_mod, only: prep_glc_calculate_subshelf_boundary_fluxes
use seq_flds_mod, only: wav_ocn_coup

!-----------------------------------------------------------------------
!
Expand Down Expand Up @@ -977,7 +978,7 @@ subroutine prep_ocn_merge( flux_epbalfact, a2x_o, i2x_o, r2x_o, w2x_o, g2x_o, xa
call mct_aVect_copy(aVin=a2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=a2x_SharedIndices)
call mct_aVect_copy(aVin=i2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=i2x_SharedIndices)
call mct_aVect_copy(aVin=r2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=r2x_SharedIndices)
call mct_aVect_copy(aVin=w2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=w2x_SharedIndices)
if(wav_ocn_coup == 'twoway') call mct_aVect_copy(aVin=w2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=w2x_SharedIndices)
call mct_aVect_copy(aVin=xao_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=xao_SharedIndices)
call mct_aVect_copy(aVin=g2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=g2x_SharedIndices)

Expand Down
Loading