Skip to content

Commit

Permalink
fixup! Update to split_explicit_ab2 nearly everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Dec 4, 2023
1 parent 6372536 commit 6b37529
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compass/ocean/tests/global_ocean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _add_tests(self, mesh_names, high_res_topography=True,
""" Add test cases for the given mesh(es) """

default_ic = 'WOA23'
default_time_int = 'split_explicit'
default_time_int = 'split_explicit_ab2'

for mesh_name in mesh_names:
mesh_test = Mesh(test_group=self, mesh_name=mesh_name,
Expand Down
25 changes: 13 additions & 12 deletions compass/ocean/tests/global_ocean/mesh/wc14/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature

import matplotlib.pyplot as plt
import mpas_tools.mesh.creation.mesh_definition_tools as mdt
from mpas_tools.mesh.creation.signed_distance import \
signed_distance_from_geojson, mask_from_geojson
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 (
mask_from_geojson,
signed_distance_from_geojson,
)
from mpas_tools.viz.colormaps import register_sci_viz_colormaps

from compass.mesh import QuasiUniformSphericalMeshStep
Expand All @@ -25,7 +26,7 @@ def setup(self):
inputs = ['coastline_CUSP.geojson',
'land_mask_Kamchatka.geojson',
'land_mask_Mexico.geojson',
'namelist.split_explicit',
'namelist.split_explicit_ab2',
'region_Arctic_Ocean.geojson',
'region_Bering_Sea.geojson',
'region_Bering_Sea_reduced.geojson',
Expand Down Expand Up @@ -58,8 +59,8 @@ def build_cell_width_lat_lon(self):
dlon = 0.1
dlat = dlon
earth_radius = constants['SHR_CONST_REARTH']
print('\nCreating cellWidth on a lat-lon grid of: {0:.2f} x {0:.2f} '
'degrees'.format(dlon, dlat))
print(f'\nCreating cellWidth on a lat-lon grid of: '
f'{dlon:.2f} x {dlat:.2f} degrees')
print('This can be set higher for faster test generation\n')
nlon = int(360. / dlon) + 1
nlat = int(180. / dlat) + 1
Expand Down Expand Up @@ -144,16 +145,16 @@ def build_cell_width_lat_lon(self):
earth_radius,
max_length=0.25)
maskSmoothEast = 0.5 * (
1 + np.tanh((transitionOffset - signedDistance) /
(transitionWidth / 2.)))
1 + np.tanh((transitionOffset - signedDistance) /
(transitionWidth / 2.)))

fc = read_feature_collection('region_Bering_Sea_reduced.geojson')
signedDistance = signed_distance_from_geojson(fc, lon, lat,
earth_radius,
max_length=0.25)
maskSmoothWest = 0.5 * (
1 + np.tanh((transitionOffset - signedDistance) /
(transitionWidth / 2.)))
1 + np.tanh((transitionOffset - signedDistance) /
(transitionWidth / 2.)))

fc = read_feature_collection('land_mask_Kamchatka.geojson')
maskWest = mask_from_geojson(fc, lon, lat)
Expand Down

0 comments on commit 6b37529

Please sign in to comment.