Skip to content

Commit b0bbf47

Browse files
authored
Merge pull request #881 from xylar/update-to-1.7.0-alpha.2
Update to 1.7.0 alpha.2
2 parents 2476e8b + 044ace2 commit b0bbf47

File tree

45 files changed

+264
-218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+264
-218
lines changed

.github/workflows/gis_coarse_meshgen.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
- compass/landice/tests/greenland/mesh.py
99

1010
jobs:
11-
setup_and_run_job:
12-
name: setup_and_run_job
11+
gis-coarse-meshgen:
12+
name: GIS Coarse Mesh Generation
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
@@ -23,10 +23,10 @@ jobs:
2323
pushd compass
2424
2525
# create the compass environment
26-
./conda/configure_compass_env.py --conda $root/mambaForge --mpi mpich
26+
./conda/configure_compass_env.py --conda $root/mambaForge --env_name compass_test --mpi mpich
2727
2828
# enable the compass environment
29-
source load_dev_compass_1.7.0-alpha.1_mpich.sh
29+
source load_compass_test_mpich.sh
3030
3131
popd
3232

compass/landice/mesh.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -688,22 +688,22 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
688688
logger.info('writing grid_converted.nc')
689689
write_netcdf(dsMesh, 'grid_converted.nc')
690690
levels = section.get('levels')
691-
args = ['create_landice_grid_from_generic_MPAS_grid.py',
691+
args = ['create_landice_grid_from_generic_mpas_grid',
692692
'-i', 'grid_converted.nc',
693693
'-o', 'grid_preCull.nc',
694694
'-l', levels, '-v', 'glimmer']
695695

696696
check_call(args, logger=logger)
697697

698-
args = ['interpolate_to_mpasli_grid.py', '-s',
698+
args = ['interpolate_to_mpasli_grid', '-s',
699699
gridded_dataset, '-d',
700700
'grid_preCull.nc', '-m', 'b', '-t']
701701

702702
check_call(args, logger=logger)
703703

704704
cullDistance = section.get('cull_distance')
705705
if float(cullDistance) > 0.:
706-
args = ['define_cullMask.py', '-f',
706+
args = ['define_landice_cull_mask', '-f',
707707
'grid_preCull.nc', '-m',
708708
'distance', '-d', cullDistance]
709709

@@ -715,7 +715,7 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
715715
if geojson_file is not None:
716716
# This step is only necessary because the GeoJSON region
717717
# is defined by lat-lon.
718-
args = ['set_lat_lon_fields_in_planar_grid.py', '-f',
718+
args = ['set_lat_lon_fields_in_planar_grid', '-f',
719719
'grid_preCull.nc', '-p', projection]
720720

721721
check_call(args, logger=logger)
@@ -742,7 +742,7 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
742742
write_netcdf(dsMesh, 'culled.nc')
743743

744744
logger.info('Marking horns for culling')
745-
args = ['mark_horns_for_culling.py', '-f', 'culled.nc']
745+
args = ['mark_horns_for_culling', '-f', 'culled.nc']
746746

747747
check_call(args, logger=logger)
748748

@@ -753,24 +753,24 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
753753
dsMesh = sort_mesh(dsMesh)
754754
write_netcdf(dsMesh, 'dehorned.nc')
755755

756-
args = ['create_landice_grid_from_generic_MPAS_grid.py', '-i',
756+
args = ['create_landice_grid_from_generic_mpas_grid', '-i',
757757
'dehorned.nc', '-o',
758758
mesh_name, '-l', levels, '-v', 'glimmer',
759759
'--beta', '--thermal', '--obs', '--diri']
760760

761761
check_call(args, logger=logger)
762762

763-
args = ['interpolate_to_mpasli_grid.py', '-s',
763+
args = ['interpolate_to_mpasli_grid', '-s',
764764
gridded_dataset, '-d', mesh_name, '-m', 'b']
765765

766766
check_call(args, logger=logger)
767767

768768
logger.info('Marking domain boundaries dirichlet')
769-
args = ['mark_domain_boundaries_dirichlet.py',
769+
args = ['mark_domain_boundaries_dirichlet',
770770
'-f', mesh_name]
771771
check_call(args, logger=logger)
772772

773-
args = ['set_lat_lon_fields_in_planar_grid.py', '-f',
773+
args = ['set_lat_lon_fields_in_planar_grid', '-f',
774774
mesh_name, '-p', projection]
775775
check_call(args, logger=logger)
776776

@@ -1064,7 +1064,7 @@ def __guess_scrip_name(filename):
10641064

10651065
logger.info('creating scrip file for source dataset')
10661066
# Note: writing scrip file to workdir
1067-
args = ['create_SCRIP_file_from_planar_rectangular_grid.py',
1067+
args = ['create_scrip_file_from_planar_rectangular_grid',
10681068
'-i', source_file,
10691069
'-s', source_scrip,
10701070
'-p', proj,
@@ -1083,8 +1083,8 @@ def __guess_scrip_name(filename):
10831083
check_call(args, logger=logger)
10841084

10851085
# Perform actual interpolation using the weights
1086-
logger.info('calling interpolate_to_mpasli_grid.py')
1087-
args = ['interpolate_to_mpasli_grid.py',
1086+
logger.info('calling interpolate_to_mpasli_grid')
1087+
args = ['interpolate_to_mpasli_grid',
10881088
'-s', source_file,
10891089
'-d', dest_file,
10901090
'-m', 'e',

compass/landice/tests/antarctica/mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def run(self):
121121
# Also, it should be assessed if bilinear or
122122
# barycentric used here is preferred for this application.
123123
# Current thinking is they are both equally appropriate.
124-
logger.info('calling interpolate_to_mpasli_grid.py')
125-
args = ['interpolate_to_mpasli_grid.py', '-s',
124+
logger.info('calling interpolate_to_mpasli_grid')
125+
args = ['interpolate_to_mpasli_grid', '-s',
126126
preprocessed_gridded_dataset,
127127
'-d',
128128
self.mesh_filename,

compass/landice/tests/antarctica/mesh_gen/mesh_gen.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bedmachine_filename = BedMachineAntarctica_2020-07-15_v02_edits_floodFill_extrap
6161
measures_filename = antarctica_ice_velocity_450m_v2_edits_extrap.nc
6262

6363
# projection of the source datasets, according to the dictionary keys
64-
# create_SCRIP_file_from_planar_rectangular_grid.py from MPAS_Tools
64+
# create_scrip_file_from_planar_rectangular_grid from MPAS_Tools
6565
src_proj = ais-bedmap2
6666

6767
# number of processors to use for ESMF_RegridWeightGen

compass/landice/tests/circular_shelf/setup_mesh.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import numpy
2-
from netCDF4 import Dataset as NetCDFFile
3-
4-
from mpas_tools.planar_hex import make_planar_hex_mesh
52
from mpas_tools.io import write_netcdf
6-
from mpas_tools.mesh.conversion import convert, cull
73
from mpas_tools.logging import check_call
4+
from mpas_tools.mesh.conversion import convert, cull
5+
from mpas_tools.planar_hex import make_planar_hex_mesh
6+
from netCDF4 import Dataset as NetCDFFile
87

98
from compass.model import make_graph_file
109
from compass.step import Step
@@ -60,7 +59,7 @@ def run(self):
6059
write_netcdf(dsMesh, 'mpas_grid.nc')
6160

6261
levels = section.get('levels')
63-
args = ['create_landice_grid_from_generic_MPAS_grid.py',
62+
args = ['create_landice_grid_from_generic_mpas_grid',
6463
'-i', 'mpas_grid.nc',
6564
'-o', 'landice_grid.nc',
6665
'-l', levels,

compass/landice/tests/dome/setup_mesh.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import numpy
2-
from netCDF4 import Dataset as NetCDFFile
3-
4-
from mpas_tools.planar_hex import make_planar_hex_mesh
52
from mpas_tools.io import write_netcdf
6-
from mpas_tools.mesh.conversion import convert, cull
73
from mpas_tools.logging import check_call
4+
from mpas_tools.mesh.conversion import convert, cull
5+
from mpas_tools.planar_hex import make_planar_hex_mesh
6+
from netCDF4 import Dataset as NetCDFFile
87

98
from compass.model import make_graph_file
109
from compass.step import Step
@@ -71,7 +70,7 @@ def run(self):
7170
write_netcdf(dsMesh, 'mpas_grid.nc')
7271

7372
levels = section.get('levels')
74-
args = ['create_landice_grid_from_generic_MPAS_grid.py',
73+
args = ['create_landice_grid_from_generic_mpas_grid',
7574
'-i', 'mpas_grid.nc',
7675
'-o', 'landice_grid.nc',
7776
'-l', levels]
@@ -158,7 +157,7 @@ def _setup_dome_initial_conditions(config, logger, filename):
158157
thickness_field[r < r0] = h0 * (1.0 - (r[r < r0] / r0) ** 2) ** 0.5
159158
elif dome_type == 'halfar':
160159
thickness_field[r < r0] = h0 * (
161-
1.0 - (r[r < r0] / r0) ** (4.0 / 3.0)) ** (3.0 / 7.0)
160+
1.0 - (r[r < r0] / r0) ** (4.0 / 3.0)) ** (3.0 / 7.0)
162161
else:
163162
raise ValueError('Unexpected dome_type: {}'.format(dome_type))
164163
thickness[0, :] = thickness_field

compass/landice/tests/eismint2/setup_mesh.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import xarray
2-
3-
from mpas_tools.planar_hex import make_planar_hex_mesh
42
from mpas_tools.io import write_netcdf
5-
from mpas_tools.mesh.conversion import convert, cull
63
from mpas_tools.logging import check_call
4+
from mpas_tools.mesh.conversion import convert, cull
5+
from mpas_tools.planar_hex import make_planar_hex_mesh
76

87
from compass.model import make_graph_file
98
from compass.step import Step
@@ -48,7 +47,7 @@ def run(self):
4847
dsMesh.close()
4948

5049
radius = section.get('radius')
51-
args = ['define_cullMask.py',
50+
args = ['define_landice_cull_mask',
5251
'-f', 'mpas_grid.nc',
5352
'-m', 'radius',
5453
'-d', radius]
@@ -61,7 +60,7 @@ def run(self):
6160
write_netcdf(dsMesh, 'mpas_grid2.nc')
6261

6362
levels = section.get('levels')
64-
args = ['create_landice_grid_from_generic_MPAS_grid.py',
63+
args = ['create_landice_grid_from_generic_mpas_grid',
6564
'-i', 'mpas_grid2.nc',
6665
'-o', 'landice_grid.nc',
6766
'-l', levels,

compass/landice/tests/enthalpy_benchmark/setup_mesh.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from netCDF4 import Dataset as NetCDFFile
2-
3-
from mpas_tools.planar_hex import make_planar_hex_mesh
41
from mpas_tools.io import write_netcdf
5-
from mpas_tools.mesh.conversion import convert, cull
62
from mpas_tools.logging import check_call
3+
from mpas_tools.mesh.conversion import convert, cull
4+
from mpas_tools.planar_hex import make_planar_hex_mesh
5+
from netCDF4 import Dataset as NetCDFFile
76

87
from compass.model import make_graph_file
98
from compass.step import Step
@@ -49,7 +48,7 @@ def run(self):
4948
dsMesh = convert(dsMesh, logger=logger)
5049
write_netcdf(dsMesh, 'mpas_grid.nc')
5150

52-
args = ['create_landice_grid_from_generic_MPAS_grid.py',
51+
args = ['create_landice_grid_from_generic_mpas_grid',
5352
'-i', 'mpas_grid.nc',
5453
'-o', 'landice_grid.nc',
5554
'-l', levels,

compass/landice/tests/greenland/mesh_gen/mesh_gen.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bedmachine_filename = BedMachineGreenland-v5_edits_floodFill_extrap.nc
6262
measures_filename = greenland_vel_mosaic500_extrap.nc
6363

6464
# projection of the source datasets, according to the dictionary keys
65-
# create_SCRIP_file_from_planar_rectangular_grid.py from MPAS_Tools
65+
# create_scrip_file_from_planar_rectangular_grid from MPAS_Tools
6666
src_proj = gis-gimp
6767

6868
# number of processors to use for ESMF_RegridWeightGen

compass/landice/tests/hydro_radial/setup_mesh.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import numpy as np
2-
from netCDF4 import Dataset as NetCDFFile
3-
4-
from mpas_tools.planar_hex import make_planar_hex_mesh
52
from mpas_tools.io import write_netcdf
6-
from mpas_tools.mesh.conversion import convert, cull
73
from mpas_tools.logging import check_call
4+
from mpas_tools.mesh.conversion import convert, cull
5+
from mpas_tools.planar_hex import make_planar_hex_mesh
6+
from netCDF4 import Dataset as NetCDFFile
87

98
from compass.model import make_graph_file
109
from compass.step import Step
@@ -72,7 +71,7 @@ def run(self):
7271
write_netcdf(dsMesh, 'mpas_grid.nc')
7372

7473
levels = section.get('levels')
75-
args = ['create_landice_grid_from_generic_MPAS_grid.py',
74+
args = ['create_landice_grid_from_generic_mpas_grid',
7675
'-i', 'mpas_grid.nc',
7776
'-o', 'landice_grid.nc',
7877
'-l', levels,

0 commit comments

Comments
 (0)