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

New Mesh: ECwISC30to60E3r4 #715

Closed
wants to merge 4 commits into from
Closed

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Oct 8, 2023

Long name: ECwISC30to60L64E3SMv3r4

As with previous versions of the mesh, this Eddy Closure (EC) mesh has:

  • 30 km resolution at the equator
  • 60 km resolution at mid latitudes
  • 35 km resolution near the poles

This mesh differs from ECwISC30to60E3r2 (#689) only in having topography smoothing of approximately 6 grid cells (180-360 km), see comment below.

The mesh test case is a symlink to that of the ECwISC30to60E3r2 to guarantee that they are identical.

Initial condition, dynamic adjustment and files for E3SM will be on Chrysalis at:

/lcrc/group/e3sm/ac.xylar/compass_1.2/chrysalis/e3smv3-meshes/ecwisc30to60e3r4

Checklist

  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes

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.
@xylar xylar added new mesh An E3SM mesh for special review ocean sea ice labels Oct 8, 2023
@xylar xylar requested review from maltrud and vanroekel October 8, 2023 10:22
@xylar xylar self-assigned this Oct 8, 2023
@xylar
Copy link
Collaborator Author

xylar commented Oct 8, 2023

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:

smoothing

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.

@xylar xylar force-pushed the create-ecwisc30to60e3r4 branch from a81cb79 to 0d3c02c Compare October 8, 2023 11:05
@xylar
Copy link
Collaborator Author

xylar commented Oct 8, 2023

Bathymetry

ECwISC30to60E3r2

bottom_depth

ECwISC30to60E3r4

bottom_depth

@xylar xylar force-pushed the create-ecwisc30to60e3r4 branch 2 times, most recently from 1fb00d7 to b78e01a Compare October 9, 2023 06:55
xylar added 2 commits October 9, 2023 10:19
This mesh is the same as ECwISC30to60E3r2 but with topography
smoothing over ~3 grid cells.
@xylar xylar force-pushed the create-ecwisc30to60e3r4 branch from b78e01a to d518de5 Compare October 9, 2023 08:19
damped_adjustment_3 was blowing up at day 24 (due to large flow through
the Strait of Gibraltar) with previous settings.
@xylar xylar force-pushed the create-ecwisc30to60e3r4 branch from d518de5 to 68e41bd Compare October 9, 2023 10:36
@xylar
Copy link
Collaborator Author

xylar commented Oct 18, 2023

@vanroekel, I think we agreed that we don't want to pursue this version of the mesh, so I will close this for now.

@xylar xylar closed this Oct 18, 2023
@vanroekel
Copy link
Collaborator

Yes agreed. Thanks @xylar

@xylar xylar mentioned this pull request Nov 11, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new mesh An E3SM mesh for special review ocean sea ice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants