@@ -16,6 +16,7 @@ module MOM_wave_interface
16
16
use MOM_io, only : file_exists, get_var_sizes, read_variable
17
17
use MOM_io, only : vardesc, var_desc
18
18
use MOM_safe_alloc, only : safe_alloc_ptr
19
+ use MOM_spatial_means, only : global_area_mean
19
20
use MOM_time_manager, only : time_type, operator (+ ), operator (/ )
20
21
use MOM_unit_scaling, only : unit_scale_type
21
22
use MOM_variables, only : thermo_var_ptrs, surface
@@ -66,6 +67,7 @@ module MOM_wave_interface
66
67
logical , public :: Stokes_DDT = .false. ! < Developmental:
67
68
! ! True if Stokes d/dt is used
68
69
logical , public :: Passive_Stokes_DDT = .false. ! < Keeps Stokes_DDT on, but doesn't affect dynamics
70
+ logical :: Homogenize_Surfbands ! < True to homogenize surface band Stokes drift in the horizontal
69
71
70
72
real , allocatable , dimension (:,:,:), public :: &
71
73
Us_x ! < 3d zonal Stokes drift profile [L T-1 ~> m s-1]
@@ -441,6 +443,11 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag)
441
443
" A layer thickness below which the cell-center Stokes drift is used instead of " // &
442
444
" the cell average. This is only used if WAVE_INTERFACE_ANSWER_DATE < 20230101." , &
443
445
units= " m" , default= 0.1 , scale= US% m_to_Z, do_not_log= (CS% answer_date>= 20230101 ))
446
+ call get_param(param_file, mdl, " HOMOGENIZE_SURFBANDS" , CS% Homogenize_Surfbands, &
447
+ " A logical which causes the code to horizontally homogenize the surface band " // &
448
+ " Stokes drift, which is needed in column mode to avoid round-off differences. " // &
449
+ " At present it only works with DATAOVERRIDE, and is not coded for COUPLER." ,&
450
+ default= .false. )
444
451
call get_param(param_file, mdl, " SURFBAND_SOURCE" , TMPSTRING2, &
445
452
" Choice of SURFACE_BANDS data mode, valid options include: \n" // &
446
453
" DATAOVERRIDE - Read from NetCDF using FMS DataOverride. \n" // &
@@ -1071,6 +1078,7 @@ subroutine Surface_Bands_by_data_override(Time, G, GV, US, CS)
1071
1078
character (len= 48 ) :: dim_name(4 ) ! The names of the dimensions of the variable.
1072
1079
character (len= 20 ) :: varname ! The name of an input variable for data override.
1073
1080
real :: PI ! 3.1415926535... [nondim]
1081
+ real :: avgx, avgy
1074
1082
logical :: wavenumber_exists
1075
1083
integer :: ndims, b, i, j
1076
1084
@@ -1151,6 +1159,14 @@ subroutine Surface_Bands_by_data_override(Time, G, GV, US, CS)
1151
1159
endif
1152
1160
enddo
1153
1161
enddo
1162
+ if (CS% Homogenize_Surfbands) then
1163
+ avgx = global_area_mean(temp_x, G)
1164
+ avgy = global_area_mean(temp_y, G)
1165
+ do j = G% jsd,G% jed ; do i = G% Isd,G% Ied ; if (G% mask2dT(i,j) > 0.0 ) then
1166
+ temp_y(i,j) = avgy
1167
+ temp_x(i,j) = avgx
1168
+ endif ; enddo ; enddo
1169
+ endif
1154
1170
1155
1171
! Interpolate to u/v grids
1156
1172
do j = G% jsc,G% jec
0 commit comments