From 1ed573a7d8c2881e86cb52251f4c093987814161 Mon Sep 17 00:00:00 2001 From: bmooremaley Date: Sun, 6 Oct 2024 14:36:28 -0500 Subject: [PATCH] Added scripfile output and updated docs for combine_topo/cubed_sphere --- .../tests/utility/combine_topo/__init__.py | 16 ++++++++++------ .../tests/utility/combine_topo/combine_topo.cfg | 2 +- .../ocean/test_groups/utility.rst | 13 +++++++++---- docs/users_guide/ocean/test_groups/utility.rst | 17 +++++++++++++---- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/compass/ocean/tests/utility/combine_topo/__init__.py b/compass/ocean/tests/utility/combine_topo/__init__.py index 903983c221..227ac12ae8 100644 --- a/compass/ocean/tests/utility/combine_topo/__init__.py +++ b/compass/ocean/tests/utility/combine_topo/__init__.py @@ -90,10 +90,13 @@ def setup(self): self.resolution = section.getfloat('resolution_latlon') self.resolution_name = f'{self.resolution:.4f}_degree' - # Build combined filename + # Build output filenames + datestamp = datetime.now().strftime('%Y%m%d') + scrip_filename = f'{self.resolution_name}_{datestamp}.scrip.nc' combined_filename = '_'.join([ - antarctic_filename.strip('.nc'), global_filename.strip('.nc'), - self.resolution_name, datetime.now().strftime('%Y%m%d.nc'), + antarctic_filename.strip('.nc'), + global_filename.strip('.nc'), + self.resolution_name, f'{datestamp}.nc', ]) # Add bathymetry data input files @@ -107,6 +110,7 @@ def setup(self): target=global_filename, database='bathymetry_database', ) + self.add_output_file(filename=scrip_filename) self.add_output_file(filename=combined_filename) # Get ntasks and min_tasks @@ -306,7 +310,7 @@ def _create_target_scrip_file(self): logger = self.logger logger.info(f'Create SCRIP file for {self.resolution_name} mesh') - out_filename = f'{self.resolution_name}.scrip.nc' + out_filename = self.outputs[0] # Build cubed sphere SCRIP file using tempestremap if self.target_grid == 'cubed_sphere': @@ -352,7 +356,7 @@ def _create_weights(self, in_filename, out_filename): args = [ 'ESMF_RegridWeightGen', '--source', in_filename, - '--destination', f'{self.resolution_name}.scrip.nc', + '--destination', self.outputs[0], '--weight', out_filename, '--method', method, '--netcdf4', @@ -567,7 +571,7 @@ def _combine(self): combined[field] = combined[field].where(valid, fill_val) # Save combined bathy to NetCDF - combined.to_netcdf(self.outputs[0]) + combined.to_netcdf(self.outputs[1]) logger.info(' Done.') diff --git a/compass/ocean/tests/utility/combine_topo/combine_topo.cfg b/compass/ocean/tests/utility/combine_topo/combine_topo.cfg index d9ec03d2d4..6bcbad53c3 100644 --- a/compass/ocean/tests/utility/combine_topo/combine_topo.cfg +++ b/compass/ocean/tests/utility/combine_topo/combine_topo.cfg @@ -15,7 +15,7 @@ renorm_thresh = 1e-3 # the target and minimum number of MPI tasks to use in remapping ntasks = 1280 -min_tasks = 1024 +min_tasks = 512 # latitudes between which the topography datasets get blended latmin = -62. diff --git a/docs/developers_guide/ocean/test_groups/utility.rst b/docs/developers_guide/ocean/test_groups/utility.rst index f1157ecbbd..8c331f6b64 100644 --- a/docs/developers_guide/ocean/test_groups/utility.rst +++ b/docs/developers_guide/ocean/test_groups/utility.rst @@ -19,10 +19,15 @@ dataset. combine ~~~~~~~ The class :py:class:`compass.ocean.tests.utility.combine_topo.Combine` -defines a step for combining the datasets above. The GEBCO data is downsampled -to a 1/80 degree latitude-longitude grid to make later remapping to MPAS meshes -more manageable. The BedMachine data is remapped to this same mesh and the -two datasets are blended between 60 and 62 degrees south latitude. +defines a step for combining the datasets above. The GEBCO and BedMachine data +are remapped to a common global grid to make later remapping to MPAS meshes +more manageable, and the two datasets are blended between 60 and 62 degrees +south latitude. The GEBCO global dataset is divided into regional tiles prior +to remapping to improve performance. Two common global target grid options are +provided: a 1/80 degree latitude-longitude grid and an ne3000 cubed sphere +grid. These target grid options are selectable via the ``target_grid`` argument +in the :py:class:`compass.ocean.tests.utility.combine_topo.CombineTopo` test +case class. cull_restarts ------------- diff --git a/docs/users_guide/ocean/test_groups/utility.rst b/docs/users_guide/ocean/test_groups/utility.rst index a3cc2c0279..9abfd128b2 100644 --- a/docs/users_guide/ocean/test_groups/utility.rst +++ b/docs/users_guide/ocean/test_groups/utility.rst @@ -8,13 +8,22 @@ may create datasets for other test groups to use. It is partly designed to provide provenance for data processing that may be more complex than a single, short script. -combine_topo ------------- -The ``ocean/utility/combine_topo`` test case is used to combine the +combine_topo/lat_lon +-------------------- +The ``ocean/utility/combine_topo/lat_lon`` test case is used to combine the `BedMachine Antarctica v3 `_ dataset with the `GEBCO 2023 `_ dataset. The result is on a 1/80 degree latitude-longitude grid. This utility -is intended for provenance. It is intended to doucment the process for +is intended for provenance. It is intended to document the process for +producing the topography dataset used for E3SM ocean meshes. + +combine_topo/cubed_sphere +------------------------- +The ``ocean/utility/combine_topo/cubed_sphere`` test case is used to combine the +`BedMachine Antarctica v3 `_ +dataset with the `GEBCO 2023 `_ +dataset. The result is on an ne3000 cubed sphere grid. This utility +is intended for provenance. It is intended to document the process for producing the topography dataset used for E3SM ocean meshes. cull_restarts