-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #807 from xylar/create-sowisc12to30e3r3
New Mesh: SOwISC12to30E3r3
- Loading branch information
Showing
23 changed files
with
218 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ocean/global_ocean/SO12to30/mesh | ||
ocean/global_ocean/SO12to30/WOA23/init | ||
ocean/global_ocean/SO12to30/WOA23/performance_test | ||
ocean/global_ocean/SO12to30/WOA23/dynamic_adjustment | ||
ocean/global_ocean/SO12to30/WOA23/files_for_e3sm |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ocean/global_ocean/SOwISC12to30/mesh | ||
ocean/global_ocean/SOwISC12to30/WOA23/init | ||
ocean/global_ocean/SOwISC12to30/WOA23/performance_test | ||
ocean/global_ocean/SOwISC12to30/WOA23/dynamic_adjustment | ||
ocean/global_ocean/SOwISC12to30/WOA23/files_for_e3sm |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
compass/ocean/tests/global_ocean/mesh/so12to30/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import numpy as np | ||
from geometric_features import read_feature_collection | ||
from mpas_tools.cime.constants import constants | ||
from mpas_tools.mesh.creation.signed_distance import ( | ||
signed_distance_from_geojson, | ||
) | ||
|
||
from compass.mesh import QuasiUniformSphericalMeshStep | ||
|
||
|
||
class SO12to30BaseMesh(QuasiUniformSphericalMeshStep): | ||
""" | ||
A step for creating SO12to30 meshes | ||
""" | ||
def setup(self): | ||
""" | ||
Add some input files | ||
""" | ||
|
||
self.add_input_file(filename='high_res_region.geojson', | ||
package=self.__module__) | ||
|
||
super().setup() | ||
|
||
def build_cell_width_lat_lon(self): | ||
""" | ||
Create cell width array for this mesh on a regular latitude-longitude | ||
grid | ||
Returns | ||
------- | ||
cellWidth : numpy.array | ||
m x n array of cell width in km | ||
lon : numpy.array | ||
longitude in degrees (length n and between -180 and 180) | ||
lat : numpy.array | ||
longitude in degrees (length m and between -90 and 90) | ||
""" | ||
|
||
dlon = 0.1 | ||
dlat = dlon | ||
earth_radius = constants['SHR_CONST_REARTH'] | ||
nlon = int(360. / dlon) + 1 | ||
nlat = int(180. / dlat) + 1 | ||
lon = np.linspace(-180., 180., nlon) | ||
lat = np.linspace(-90., 90., nlat) | ||
|
||
# start with a uniform 30 km background resolution | ||
dx_max = 30. | ||
cell_width = dx_max * np.ones((nlat, nlon)) | ||
|
||
fc = read_feature_collection('high_res_region.geojson') | ||
|
||
so_signed_distance = signed_distance_from_geojson(fc, lon, lat, | ||
earth_radius, | ||
max_length=0.25) | ||
|
||
# Equivalent to 20 degrees latitude | ||
trans_width = 1600e3 | ||
trans_start = 500e3 | ||
dx_min = 12. | ||
|
||
weights = 0.5 * (1 + np.tanh((so_signed_distance - trans_start) / | ||
trans_width)) | ||
|
||
cell_width = dx_min * (1 - weights) + cell_width * weights | ||
|
||
return cell_width, lon, lat |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
config_rx1_inner_iter_count = 20 | ||
config_rx1_horiz_smooth_weight = 1.0 | ||
config_rx1_vert_smooth_weight = 1.0 | ||
config_rx1_slope_weight = 1e-2 | ||
config_rx1_zstar_weight = 1.0 | ||
config_rx1_min_levels = 5 | ||
config_rx1_min_layer_thickness = 2.0 | ||
config_global_ocean_minimum_depth = 10.0 |
File renamed without changes.
Oops, something went wrong.