@@ -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]
@@ -444,6 +446,11 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag)
444
446
" A layer thickness below which the cell-center Stokes drift is used instead of " // &
445
447
" the cell average. This is only used if WAVE_INTERFACE_ANSWER_DATE < 20230101." , &
446
448
units= " m" , default= 0.1 , scale= US% m_to_Z, do_not_log= (CS% answer_date>= 20230101 ))
449
+ call get_param(param_file, mdl, " HOMOGENIZE_SURFBANDS" , CS% Homogenize_Surfbands, &
450
+ " A logical which causes the code to horizontally homogenize the surface band " // &
451
+ " Stokes drift, which is needed in column mode to avoid round-off differences. " // &
452
+ " At present it only works with DATAOVERRIDE, and is not coded for COUPLER." ,&
453
+ default= .false. )
447
454
call get_param(param_file, mdl, " SURFBAND_SOURCE" , TMPSTRING2, &
448
455
" Choice of SURFACE_BANDS data mode, valid options include: \n" // &
449
456
" DATAOVERRIDE - Read from NetCDF using FMS DataOverride. \n" // &
@@ -1076,6 +1083,7 @@ subroutine Surface_Bands_by_data_override(Time, G, GV, US, CS)
1076
1083
character (len= 48 ) :: dim_name(4 ) ! The names of the dimensions of the variable.
1077
1084
character (len= 20 ) :: varname ! The name of an input variable for data override.
1078
1085
real :: PI ! 3.1415926535... [nondim]
1086
+ real :: avgx, avgy
1079
1087
logical :: wavenumber_exists
1080
1088
integer :: ndims, b, i, j
1081
1089
@@ -1156,6 +1164,14 @@ subroutine Surface_Bands_by_data_override(Time, G, GV, US, CS)
1156
1164
endif
1157
1165
enddo
1158
1166
enddo
1167
+ if (CS% Homogenize_Surfbands) then
1168
+ avgx = global_area_mean(temp_x, G)
1169
+ avgy = global_area_mean(temp_y, G)
1170
+ do j = G% jsd,G% jed ; do i = G% Isd,G% Ied ; if (G% mask2dT(i,j) > 0.0 ) then
1171
+ temp_y(i,j) = avgy
1172
+ temp_x(i,j) = avgx
1173
+ endif ; enddo ; enddo
1174
+ endif
1159
1175
1160
1176
! Interpolate to u/v grids
1161
1177
do j = G% jsc,G% jec
0 commit comments