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

Langmuir turbulence parameterization improvements #1034

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8101d60
Clean up diagnostic variables in WW3 for Langmuir turbulence paramete…
alperaltuntas Jun 26, 2023
1f1c05f
updates in laslpj and lamult computations to improve numerical stability
alperaltuntas Jul 5, 2023
7af1188
CMakeLists changes for CESM
alperaltuntas Jul 5, 2023
a4fbf16
Merge pull request #9 from ESCOMP/dev/unified_new_merge_pr4
alperaltuntas Jul 5, 2023
e980324
Revert "CMakeLists changes for CESM"
alperaltuntas Jul 6, 2023
e8f1d7e
add ww3_tp2.22 for testing Langmuir Mixing Parameterization
alperaltuntas Aug 18, 2023
a8ebf89
add documentation for LMPN namelist and ww3_tp2.22 test
alperaltuntas Aug 24, 2023
a70244d
ww3_grid.inp: update for Langmuir namelist (LMPN)
MatthewMasarik-NOAA Sep 13, 2023
695ef06
ww3_grid.inp: reference
MatthewMasarik-NOAA Sep 14, 2023
8237fd1
ww3_grid.inp, info: documentation updates
MatthewMasarik-NOAA Sep 14, 2023
9bc25b7
matrix.base, matrix_cmake_ncep: first attempt at setting up regtest call
MatthewMasarik-NOAA Sep 14, 2023
0903907
ww3_tp2.22/input: clean out any files not needed for this test. also,…
MatthewMasarik-NOAA Sep 14, 2023
3d39cf0
Merge pull request #11 from MatthewMasarik-NOAA/regtest/sync-dev/unified
alperaltuntas Sep 19, 2023
7f29db6
convert HSLMODE to an integer
alperaltuntas Sep 22, 2023
f79e156
ww3_tp2.22/info: update for Stokes drift output variables.
MatthewMasarik-NOAA Oct 20, 2023
5b1a73a
ww3_grid.inp: addresses clean up request for commented out code
MatthewMasarik-NOAA Oct 25, 2023
8e7d8b2
ww3_tp2.22: *.nml removed
MatthewMasarik-NOAA Oct 25, 2023
dd89cfe
ww3_tp2.22: removed ww3_multi.inp
MatthewMasarik-NOAA Oct 25, 2023
63ac370
ww3_tp2.22: removed - nocmpr.depth, points.list. dont believe they ar…
MatthewMasarik-NOAA Oct 25, 2023
0a9e547
ww3_tp2.22: removed - 2-D.depth. dont believe it is necessary.
MatthewMasarik-NOAA Oct 25, 2023
670d1f2
ww3_tp2.22: removed ww3_trck.inp, ww3_trnc.inp. dont believe they are…
MatthewMasarik-NOAA Oct 25, 2023
3f55d26
ww3_grid.inp: update desc string
MatthewMasarik-NOAA Oct 27, 2023
0bb8e11
ww3_shel.inp: add output request for USSX/Y
MatthewMasarik-NOAA Oct 27, 2023
86873ad
ww3_tp2.22: *.inp updates for USSX/Y
MatthewMasarik-NOAA Oct 27, 2023
500f6a4
ww3_tp2.22/*.inp: USSX/Y --> USS
MatthewMasarik-NOAA Oct 27, 2023
58fef56
ww3_tp2.22: info - typo for USSY
MatthewMasarik-NOAA Oct 27, 2023
743044c
ww3_tp2.22: remove gx_outf.inp, map2_2.gs. Looks like grads support i…
MatthewMasarik-NOAA Oct 27, 2023
a129698
ww3_tp2.22: *.inp - adjust sim times
MatthewMasarik-NOAA Oct 27, 2023
ac7ab56
ww3_tp2.22: info - updates for output variables
MatthewMasarik-NOAA Oct 27, 2023
94801a7
ww3_shel.inp: add USSH
MatthewMasarik-NOAA Nov 7, 2023
25750e2
w3ounfmetamd.F90: update for USSH
MatthewMasarik-NOAA Nov 7, 2023
1be8e33
w3ounfmetamd.F90: fix group number, 8 -> 6
MatthewMasarik-NOAA Nov 7, 2023
e789a21
ww3_ounf.F90: add USSHX/Y
MatthewMasarik-NOAA Nov 7, 2023
c1f4b84
ww3_outf.F90: add USSHX/Y
MatthewMasarik-NOAA Nov 7, 2023
f1d5b93
ww3_shel.inp: add USSHX/Y
MatthewMasarik-NOAA Nov 7, 2023
b1ddc7f
w3odatmd.F90: update for USSH
MatthewMasarik-NOAA Nov 7, 2023
d7ced8b
ww3_ounf.inp: update for USSH
MatthewMasarik-NOAA Nov 7, 2023
00ea016
ww3_outf.inp: update for USSH
MatthewMasarik-NOAA Nov 7, 2023
e3e950b
info: add USSH + polishing
MatthewMasarik-NOAA Nov 7, 2023
ecbce55
ww3_outf.F90: USE W3ADATMD.F90 ONLY USSHX,USSHY
MatthewMasarik-NOAA Nov 7, 2023
c9cfedd
ww3_tp2.22/ww3_grid*.inp: update for "sdtail" and "no tail"
MatthewMasarik-NOAA Nov 8, 2023
b865de1
matrix.base: add ww3_tp2.22 - "sdtail" and "no tail"
MatthewMasarik-NOAA Nov 8, 2023
7b013da
rename: switch_PR3_UQ_MPI --> switch
MatthewMasarik-NOAA Nov 16, 2023
3a5ea67
model/inp/ww3_grid.inp: document output parameters
MatthewMasarik-NOAA Nov 16, 2023
84ec561
info: updates for Test Cases, output parameters, general desc
MatthewMasarik-NOAA Nov 16, 2023
8250be0
model/inp/ww3_shel.inp: add TOC to group 6,13 to prep for USSH group …
MatthewMasarik-NOAA Nov 16, 2023
258a772
model/inp/ww3_shel.inp: add USSH group 6,14
MatthewMasarik-NOAA Nov 16, 2023
921f7a0
model/inp/ww3_ounf.inp: add USSH to listings
MatthewMasarik-NOAA Nov 16, 2023
4c0ee1c
matrix.base: update to remove PR3_UQ_MPI switch identifier
MatthewMasarik-NOAA Nov 16, 2023
90cd7c4
Merge pull request #15 from MatthewMasarik-NOAA/sync-dev-unified
alperaltuntas Dec 8, 2023
1effbd7
Merge remote-tracking branch 'upstream/dev/ufs-weather-model' into sy…
alperaltuntas Dec 14, 2023
fc6f815
ww3_ounf.inp: update output netcdf from 3 to 4
MatthewMasarik-NOAA Dec 14, 2023
53682b5
ww3_ounp.inp: update output netcdf from 3 to 4
MatthewMasarik-NOAA Dec 14, 2023
4db3dd8
ww3_ounf.inp: update output variables to match ww3_shel.inp
MatthewMasarik-NOAA Dec 14, 2023
c200ab0
ww3_outf.inp: update output variables to match ww3_shel.inp
MatthewMasarik-NOAA Dec 14, 2023
5197ac0
ww3_grid.inp: remove output parameters from LMPN namelist section
MatthewMasarik-NOAA Dec 14, 2023
308d7a7
matrix_cmake_[datarmor,milhydro,ukmo_cray]: add "lmp" export
MatthewMasarik-NOAA Dec 14, 2023
fe15c2a
Merge pull request #16 from MatthewMasarik-NOAA/comments/sync-dev/uni…
alperaltuntas Dec 14, 2023
75dc7da
ww3_shel.inp: remove output parameter "EF"
MatthewMasarik-NOAA Dec 19, 2023
ef8e038
ww3_outf.inp: remove output parameter "EF"
MatthewMasarik-NOAA Dec 19, 2023
586450e
ww3_ounf.inp: remove output parameter "EF"
MatthewMasarik-NOAA Dec 19, 2023
ea361a5
matrix_cmake_ncep: update modules for spack-stack
MatthewMasarik-NOAA Feb 22, 2024
0698bc1
Merge remote-tracking branch 'origin/mods/dev/ufs-weather-model' into…
MatthewMasarik-NOAA Feb 22, 2024
3caad4e
intel.yml: update cache key
MatthewMasarik-NOAA Feb 23, 2024
6e7b1ad
Updated intel workflow to install oneapi compilers from new location.…
edwardhartnett Dec 26, 2023
a10573c
Update Intel CI (relocate /usr/local; ensure intel-oneapi-mpi; use ub…
AlexanderRichert-NOAA Jan 11, 2024
3072952
intel.yml: update cache key
MatthewMasarik-NOAA Feb 23, 2024
6944915
matrix_cmake_ncep: remove temp module updates used for internal testing
MatthewMasarik-NOAA Feb 23, 2024
8c7ec7b
Merge pull request #19 from MatthewMasarik-NOAA/fix2-no-mods/sync-dev…
alperaltuntas Mar 4, 2024
749feab
w3iogomd.F90: fix IF-stmt indention
MatthewMasarik-NOAA Mar 19, 2024
32611c5
Merge pull request #20 from MatthewMasarik-NOAA/format/sync-dev/unified
alperaltuntas Mar 20, 2024
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
76 changes: 24 additions & 52 deletions model/src/w3adatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ MODULE W3ADATMD
! US3D R.A. Public 3D Stokes drift.
! USSP R.A. Public Partitioned Surface Stokes drift
!
! USSHX/Y R.A. Public Surface layer averaged Stokes drift.
!
! ABA R.A. Public Near-bottom rms wave ex. amplitude.
! ABD R.A. Public Corresponding direction.
! UBA R.A. Public Near-bottom rms wave velocity.
Expand Down Expand Up @@ -461,9 +463,7 @@ MODULE W3ADATMD
XPRMS(:), XTPMS(:), XPHICE(:), &
XTAUICE(:,:)
REAL, POINTER :: XP2SMS(:,:), XUS3D(:,:), XUSSP(:,:)
#ifdef W3_CESMCOUPLED
REAL, POINTER :: XLANGMT(:)
#endif
REAL, POINTER :: XUSSHX(:), XUSSHY(:)
!
! Output fields group 7)
!
Expand Down Expand Up @@ -492,12 +492,8 @@ MODULE W3ADATMD
!
REAL, POINTER :: USERO(:,:)
REAL, POINTER :: XUSERO(:,:)
#ifdef W3_CESMCOUPLED
! Output fileds for Langmuir mixing in group
REAL, POINTER :: LANGMT(:), LAPROJ(:), LASL(:), &
LASLPJ(:), LAMULT(:), ALPHAL(:), &
ALPHALS(:), USSXH(:), USSYH(:)
#endif
! Output fileds for Langmuir mixing parameterization
REAL, POINTER :: USSHX(:), USSHY(:)
!
! Spatial derivatives
!
Expand Down Expand Up @@ -578,11 +574,8 @@ MODULE W3ADATMD
!/
!/ Data aliases for structure WADAT(S)
!/
#ifdef W3_CESMCOUPLED
REAL, POINTER :: LANGMT(:), LAPROJ(:), ALPHAL(:), &
ALPHALS(:), LAMULT(:), LASL(:), &
LASLPJ(:), USSXH(:), USSYH(:)
#endif
REAL, POINTER :: USSHX(:), USSHY(:)
!
REAL, POINTER :: CG(:,:), WN(:,:)
REAL, POINTER :: IC3WN_R(:,:), IC3WN_I(:,:), IC3CG(:,:)
!
Expand Down Expand Up @@ -1064,19 +1057,6 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )

#ifdef W3_CESMCOUPLED
ALLOCATE ( WADATS(IMOD)%USSXH(NSEALM) , &
WADATS(IMOD)%USSYH(NSEALM) , &
WADATS(IMOD)%LANGMT(NSEALM) , &
WADATS(IMOD)%LAPROJ(NSEALM) , &
WADATS(IMOD)%LASL(NSEALM) , &
WADATS(IMOD)%LASLPJ(NSEALM) , &
WADATS(IMOD)%ALPHAL(NSEALM) , &
WADATS(IMOD)%ALPHALS(NSEALM) , &
WADATS(IMOD)%LAMULT(NSEALM) , &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
#endif
!
WADATS(IMOD)%HS = UNDEF
WADATS(IMOD)%WLM = UNDEF
Expand Down Expand Up @@ -1226,6 +1206,8 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
WADATS(IMOD)%TPMS (NSEALM) , &
WADATS(IMOD)%PHICE (NSEALM) , &
WADATS(IMOD)%TAUICE(NSEALM,2), &
WADATS(IMOD)%USSHX(NSEALM), &
WADATS(IMOD)%USSHY(NSEALM), &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
!
Expand Down Expand Up @@ -1262,9 +1244,8 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
WADATS(IMOD)%TPMS = UNDEF
WADATS(IMOD)%PHICE = UNDEF
WADATS(IMOD)%TAUICE = UNDEF
#ifdef W3_CESMCOUPLED
WADATS(IMOD)%LANGMT = UNDEF
#endif
WADATS(IMOD)%USSHX = UNDEF
WADATS(IMOD)%USSHY = UNDEF
IF ( P2MSF(1).GT.0 ) WADATS(IMOD)%P2SMS = UNDEF
IF ( US3DF(1).GT.0 ) WADATS(IMOD)%US3D = UNDEF
IF ( USSPF(1).GT.0 ) WADATS(IMOD)%USSP = UNDEF
Expand Down Expand Up @@ -2180,15 +2161,17 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS )
ALLOCATE ( WADATS(IMOD)%XTAUOCY(1), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
#ifdef W3_CESMCOUPLED
IF ( OUTFLAGS( 6, 14) ) THEN
JessicaMeixner-NOAA marked this conversation as resolved.
Show resolved Hide resolved
ALLOCATE ( WADATS(IMOD)%XLANGMT(NXXX), STAT=ISTAT )
ALLOCATE ( WADATS(IMOD)%XUSSHX(NXXX), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
ALLOCATE ( WADATS(IMOD)%XUSSHY(NXXX), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
ELSE
ALLOCATE ( WADATS(IMOD)%XLANGMT(1), STAT=ISTAT )
ALLOCATE ( WADATS(IMOD)%XUSSHX(1), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
ALLOCATE ( WADATS(IMOD)%XUSSHY(1), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
#endif
!
WADATS(IMOD)%XSXX = UNDEF
WADATS(IMOD)%XSYY = UNDEF
Expand All @@ -2210,9 +2193,8 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS )
WADATS(IMOD)%XUSSP = UNDEF
WADATS(IMOD)%XTAUOCX = UNDEF
WADATS(IMOD)%XTAUOCY = UNDEF
#ifdef W3_CESMCOUPLED
WADATS(IMOD)%XLANGMT = UNDEF
#endif
WADATS(IMOD)%XUSSHX = UNDEF
WADATS(IMOD)%XUSSHY = UNDEF
!
IF ( OUTFLAGS( 7, 1) ) THEN
ALLOCATE ( WADATS(IMOD)%XABA(NXXX), STAT=ISTAT )
Expand Down Expand Up @@ -2946,18 +2928,8 @@ SUBROUTINE W3SETA ( IMOD, NDSE, NDST )
USERO => WADATS(IMOD)%USERO
!
WN => WADATS(IMOD)%WN
#ifdef W3_CESMCOUPLED
! USSX and USSY are already set
LANGMT => WADATS(IMOD)%LANGMT
LAPROJ => WADATS(IMOD)%LAPROJ
LASL => WADATS(IMOD)%LASL
LASLPJ => WADATS(IMOD)%LASLPJ
ALPHAL => WADATS(IMOD)%ALPHAL
ALPHALS=> WADATS(IMOD)%ALPHALS
USSXH => WADATS(IMOD)%USSXH
USSYH => WADATS(IMOD)%USSYH
LAMULT => WADATS(IMOD)%LAMULT
#endif
USSHX => WADATS(IMOD)%USSHX
USSHY => WADATS(IMOD)%USSHY
#ifdef W3_IC3
IC3WN_R=> WADATS(IMOD)%IC3WN_R
IC3WN_I=> WADATS(IMOD)%IC3WN_I
Expand Down Expand Up @@ -3279,9 +3251,6 @@ SUBROUTINE W3XETA ( IMOD, NDSE, NDST )
BEDFORMS=> WADATS(IMOD)%XBEDFORMS
PHIBBL => WADATS(IMOD)%XPHIBBL
TAUBBL => WADATS(IMOD)%XTAUBBL
#ifdef W3_CESMCOUPLED
LANGMT => WADATS(IMOD)%XLANGMT
#endif
!
MSSX => WADATS(IMOD)%XMSSX
MSSY => WADATS(IMOD)%XMSSY
Expand All @@ -3298,6 +3267,9 @@ SUBROUTINE W3XETA ( IMOD, NDSE, NDST )
!
USERO => WADATS(IMOD)%XUSERO
!
USSHX => WADATS(IMOD)%XUSSHX
USSHY => WADATS(IMOD)%XUSSHY
!
END IF
!
RETURN
Expand Down
11 changes: 11 additions & 0 deletions model/src/w3gdatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,9 @@ MODULE W3GDATMD
#ifdef W3_IS2
REAL, POINTER :: IS2PARS(:)
#endif
LOGICAL :: LMPENABLED ! flag to enable Li et al. Langmuir parameterization
LOGICAL :: SDTAIL ! flag to enable high-freq tail in Li et al. Stokes Drift computations
REAL :: HSLMODE ! 0 for test (HSL=10m everywhere, 1 for coupler-based HSL)
!
! unstructured data
!
Expand Down Expand Up @@ -1084,6 +1087,10 @@ MODULE W3GDATMD
INTEGER, POINTER :: NBEDGE
INTEGER, POINTER :: EDGES(:,:), NEIGH(:,:)
!
LOGICAL, POINTER :: LMPENABLED
LOGICAL, POINTER :: SDTAIL
REAL, POINTER :: HSLMODE
!
! Variables for unstructured grids
!
INTEGER, POINTER :: NTRI,COUNTRI,COUNTOT,NNZ
Expand Down Expand Up @@ -2274,6 +2281,10 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST )
USSPF => GRIDS(IMOD)%USSPF
USSP_WN => GRIDS(IMOD)%USSP_WN
FFACBERG => GRIDS(IMOD)%FFACBERG
!
LMPENABLED => GRIDS(IMOD)%LMPENABLED
SDTAIL => GRIDS(IMOD)%SDTAIL
HSLMODE => GRIDS(IMOD)%HSLMODE
#ifdef W3_REF1
REFLC => GRIDS(IMOD)%REFLC
REFLD => GRIDS(IMOD)%REFLD
Expand Down
18 changes: 17 additions & 1 deletion model/src/w3gridmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ MODULE W3GRIDMD
STH1MF, I1STH1M, I2STH1M, &
TH2MF, I1TH2M, I2TH2M, &
STH2MF, I1STH2M, I2STH2M
NAMELIST /LMPN/ LMPENABLED, SDTAIL, HSLMODE
#ifdef W3_IS1
NAMELIST /SIS1/ ISC1, ISC2
#endif
Expand Down Expand Up @@ -2731,6 +2732,11 @@ SUBROUTINE W3GRID()
I2STH2M=NK
!
FACBERG=1.
!
LMPENABLED = .false.
SDTAIL = .false.
HSLMODE = 0 ! 0 for test (HSL=10m everywhere, 1 for coupler-based HSL)
!
#ifdef W3_IS0
WRITE (NDSO,944)
#endif
Expand Down Expand Up @@ -2882,6 +2888,10 @@ SUBROUTINE W3GRID()
IC5MAXKI, IC5MINHW, IC5MAXITER, IC5RKICK, &
IC5KFILTER, IC5MSTR(NINT(IC5VEMOD))
#endif
!
CALL READNL ( NDSS, 'LMPN', STATUS )
WRITE (NDSO,4960) STATUS
WRITE (NDSO,4961) LMPENABLED, SDTAIL, HSLMODE
!
CALL READNL ( NDSS, 'OUTS', STATUS )
WRITE (NDSO,4970) STATUS
Expand Down Expand Up @@ -6673,7 +6683,11 @@ SUBROUTINE W3GRID()
/' (0.0==> no reduction and 1.0==> no wind', &
/' input with 100% ice cover)')
!
!
!
4960 FORMAT (/' Langmuir Mixing Parameterization ',A/ &
' --------------------------------------------------')
4961 FORMAT (' &LMPN LMPENABLED = ',L, 'SDTAIL = ', L, ' HSLMODE = ', I2 '/' )
!
4970 FORMAT (/' Spectral output on full grid ',A/ &
' --------------------------------------------------')
4971 FORMAT ( ' Second order pressure at K=0:',3I4)
Expand Down Expand Up @@ -7344,6 +7358,8 @@ SUBROUTINE READNL ( NDS, NAME, STATUS )
READ (NDS,NML=UNST,END=801,ERR=802,IOSTAT=J)
CASE('OUTS')
READ (NDS,NML=OUTS,END=801,ERR=802,IOSTAT=J)
CASE('LMPN')
READ (NDS,NML=LMPN,END=801,ERR=802,IOSTAT=J)
CASE('MISC')
READ (NDS,NML=MISC,END=801,ERR=802,IOSTAT=J)
CASE DEFAULT
Expand Down
21 changes: 6 additions & 15 deletions model/src/w3idatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ MODULE W3IDATMD
! FLCUR Log. Public Flag for current input.
! FLWIND Log. Public Flag for wind input.
! FLICE Log. Public Flag for ice input.
#ifdef W3_CESMCOUPLED
! HML R.A. Public Mixed layer depth
#endif
! HSL R.A. Public Depth of a surface layer over which Stokes
! drift is averaged
! FLTAUA Log. Public Flag for atmospheric momentum input
! FLRHOA Log. Public Flag for air density input
! INFLAGS1 L.A. Public Array consolidating the above six
Expand Down Expand Up @@ -219,9 +218,7 @@ MODULE W3IDATMD
REAL, POINTER :: CYTIDE(:,:,:,:)
REAL, POINTER :: WLTIDE(:,:,:,:)
#endif
#ifdef W3_CESMCOUPLED
REAL, POINTER :: HML(:,:)
#endif
REAL, POINTER :: HSL(:,:)
LOGICAL :: IINIT
#ifdef W3_WRST
LOGICAL :: WRSTIINIT=.FALSE.
Expand Down Expand Up @@ -272,9 +269,7 @@ MODULE W3IDATMD
LOGICAL, POINTER :: FLLEVTIDE, FLCURTIDE, &
FLLEVRESI, FLCURRESI
#endif
#ifdef W3_CESMCOUPLED
REAL , POINTER :: HML(:,:)
#endif
REAL , POINTER :: HSL(:,:)
!/
CONTAINS
!/ ------------------------------------------------------------------- /
Expand Down Expand Up @@ -743,10 +738,8 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
!
#ifdef W3_CESMCOUPLED
ALLOCATE ( INPUTS(IMOD)%HML(NX,NY), STAT=ISTAT )
ALLOCATE ( INPUTS(IMOD)%HSL(NX,NY), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
#endif
!
INPUTS(IMOD)%IINIT = .TRUE.
!
Expand Down Expand Up @@ -1061,9 +1054,7 @@ SUBROUTINE W3SETI ( IMOD, NDSE, NDST )
ICEI => INPUTS(IMOD)%ICEI
BERGI => INPUTS(IMOD)%BERGI
END IF
#ifdef W3_CESMCOUPLED
HML => INPUTS(IMOD)%HML
#endif
HSL => INPUTS(IMOD)%HSL
!
IF ( FLTAUA ) THEN
UX0 => INPUTS(IMOD)%UX0
Expand Down
33 changes: 21 additions & 12 deletions model/src/w3initmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2152,10 +2152,7 @@ SUBROUTINE W3MPIO ( IMOD )
TAUOCX, TAUOCY, WNMEAN
#endif

#ifdef W3_CESMCOUPLED
USE W3ADATMD, ONLY: LANGMT, LAPROJ, ALPHAL, LASL, LASLPJ, &
ALPHALS, LAMULT
#endif
USE W3ADATMD, ONLY: USSHX, USSHY

#ifdef W3_MPI
USE W3GDATMD, ONLY: NK
Expand Down Expand Up @@ -2248,7 +2245,7 @@ SUBROUTINE W3MPIO ( IMOD )
0 + 0 + 0 + & ! group 3 (extra contributions below)
2+(NOGE(4)-2)*(NOSWLL+1) + 0 + 0 + & ! group 4
11 + 3 + 1 + & ! group 5
12 + 7 + 1 + & ! group 6 (extra contributions below)
10 + 7 + 1 + & ! group 6 (extra contributions below)
5 + 4 + 1 + & ! group 7
5 + 2 + 0 + & ! group 8
5 + 0 + 0 + & ! group 9
Expand All @@ -2262,6 +2259,7 @@ SUBROUTINE W3MPIO ( IMOD )
IF ( FLGRDALL( 6,9)) NRQMAX = NRQMAX + P2MSF(3) - P2MSF(2) + 1
IF ( FLGRDALL( 6, 8) ) NRQMAX = NRQMAX + 2*NK
IF ( FLGRDALL( 6,12) ) NRQMAX = NRQMAX + 2*NK
IF ( FLGRDALL( 6,14) ) NRQMAX = NRQMAX + 2
!
IF ( NRQMAX .GT. 0 ) THEN
ALLOCATE ( OUTPTS(IMOD)%OUT1%IRQGO(NRQMAX) )
Expand Down Expand Up @@ -3218,17 +3216,22 @@ SUBROUTINE W3MPIO ( IMOD )
#ifdef W3_MPI
END IF
!
#ifdef W3_CESMCOUPLED
IF ( FLGRDALL( 6, 14) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_SEND_INIT (LANGMT(1),NSEALM , MPI_REAL, IROOT, &
CALL MPI_SEND_INIT (USSHX (1),NSEALM , MPI_REAL, IROOT, &
IT, MPI_COMM_WAVE, IRQGO(IH), IERR)
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 6/14', IROOT, IT, IRQGO(IH), IERR
#endif
IH = IH + 1
IT = IT + 1
CALL MPI_SEND_INIT (USSHY (1),NSEALM , MPI_REAL, IROOT, &
IT, MPI_COMM_WAVE, IRQGO(IH), IERR)
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 6/14', IROOT, IT, IRQGO(IH), IERR
#endif
END IF
#endif !W3_CESMCOUPLED
IF ( FLGRDALL( 7, 1) ) THEN
IH = IH + 1
IT = IT + 1
Expand Down Expand Up @@ -4462,17 +4465,23 @@ SUBROUTINE W3MPIO ( IMOD )
#ifdef W3_MPI
END IF
!
#ifdef W3_CESMCOUPLED
IF ( FLGRDALL( 6, 14) ) THEN
IH = IH + 1
IT = IT + 1
CALL MPI_RECV_INIT (LANGMT(I0),1,WW3_FIELD_VEC, IFROM, IT, &
MPI_COMM_WAVE, IRQGO2(IH), IERR)
CALL MPI_RECV_INIT (USSHX (I0),1,WW3_FIELD_VEC, IFROM, IT, &
MPI_COMM_WAVE, IRQGO2(IH), IERR )
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 6/14', IFROM, IT, IRQGO2(IH), IERR
#endif
IH = IH + 1
IT = IT + 1
CALL MPI_RECV_INIT (USSHY (I0),1,WW3_FIELD_VEC, IFROM, IT, &
MPI_COMM_WAVE, IRQGO2(IH), IERR )
#ifdef W3_MPIT
WRITE (NDST,9011) IH, ' 6/14', IFROM, IT, IRQGO2(IH), IERR
#endif
END IF
#endif ! W3_CESMCOUPLED
!
IF ( FLGRDALL( 7, 1) ) THEN
IH = IH + 1
IT = IT + 1
Expand Down
Loading