Conversation
Up to now, topography smoothing has been disabled in MPAS-Ocean init mode. This merge adds config options to control it (the number of iterations and the weight of a cell vs. its neighbors in each iteration). By default, topography smoothing is still off.
|
To determine the weight and number of iterations of smoothing, I used the following script: #!/usr/bin/env python3
import numpy as np
from matplotlib import pyplot as plt
def main():
res = 30.
x = res * np.arange(-40, 41)
f = np.where(x >= 0, 1., 0.)
gaussian_iter = 3
sigma = 100.
x_max = 200.
f_gaussian = f
for index in range(gaussian_iter):
f_gaussian = gaussian_smooth(x, f_gaussian, sigma, x_max)
mpas_init_iter = 65
weight = 0.6
f_mpas_init = f
for index in range(mpas_init_iter):
f_mpas_init = mpas_init_mode_smooth(f_mpas_init, weight)
plt.plot(x, f, 'b', label='original')
plt.plot(x, f_gaussian, 'r',
label=f'Mat\'s Gaussian (iter={gaussian_iter}, sigma={sigma})')
plt.plot(x, f_mpas_init, 'g',
label=f'MPAS-Ocean init (iter={mpas_init_iter}, weight={weight})')
plt.legend(loc='best')
plt.show()
def gaussian_smooth(x, f, sigma, x_max):
mask = np.logical_and(x >= -x_max, x <= x_max)
x_kernel = x[mask]
kernel = np.exp(-x_kernel**2/(2. * sigma**2))
kernel = kernel / np.sum(kernel)
f_gaussian = np.convolve(f, kernel, mode='same')
ones_gaussian = np.convolve(np.ones_like(f), kernel, mode='same')
mask = ones_gaussian > 0.
f_gaussian[mask] = f_gaussian[mask] / ones_gaussian[mask]
return f_gaussian
def mpas_init_mode_smooth(f, weight):
kernel = np.array([0.5*(1. - weight), weight, 0.5*(1. - weight)])
f_mpas_init = np.convolve(f, kernel, mode='same')
ones_mpas_init = np.convolve(np.ones_like(f), kernel, mode='same')
mask = ones_mpas_init > 0.
f_mpas_init[mask] = f_mpas_init[mask] / ones_mpas_init[mask]
return f_mpas_init
if __name__ == '__main__':
main()It shows nearly identical smoothing of a 1D step function using @maltrud's 3 iterations of a gaussian with sigma = 100 km and MPAS-Ocean's init mode approach with a central weight of 0.6 and 65 iterations: I used a characteristic resolution of 30 km. In both cases, the smoothed version of the step function has a value of 0.25 and 0.75 at about -90 km and 90 km, respectively. That is almost exactly 3 grid cells on either side, so 6 grid cells total. Whereas @maltrud's approach is independent of MPAS mesh resolution, the MPAS-Ocean init mode approach will scale with the size of grid cells, so the 2 will agree at 30-km resolution but the init mode approach will produce more smoothing at 60 km resolution. |
a81cb79 to
0d3c02c
Compare
1fb00d7 to
b78e01a
Compare
This mesh is the same as ECwISC30to60E3r2 but with topography smoothing over ~3 grid cells.
b78e01a to
d518de5
Compare
damped_adjustment_3 was blowing up at day 24 (due to large flow through the Strait of Gibraltar) with previous settings.
d518de5 to
68e41bd
Compare
|
@vanroekel, I think we agreed that we don't want to pursue this version of the mesh, so I will close this for now. |
|
Yes agreed. Thanks @xylar |



Long name: ECwISC30to60L64E3SMv3r4
As with previous versions of the mesh, this Eddy Closure (EC) mesh has:
This mesh differs from ECwISC30to60E3r2 (#689) only in having topography smoothing of approximately 6 grid cells (180-360 km), see comment below.
The
meshtest case is a symlink to that of theECwISC30to60E3r2to guarantee that they are identical.Initial condition, dynamic adjustment and files for E3SM will be on Chrysalis at:
Checklist
Testingin this PR) any testing that was used to verify the changes