Skip to content

Commit

Permalink
Merge pull request #43 from GEOS-ESM/feature/wjiang/add_ease_grid
Browse files Browse the repository at this point in the history
Assorted enhancements of remap_restarts.py package (EASE, SLES15, NAS, lake/landice log)
  • Loading branch information
sdrabenh authored Jan 24, 2024
2 parents 51fa7d5 + 8757894 commit 61009d5
Show file tree
Hide file tree
Showing 18 changed files with 573 additions and 336 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added EASE grid option for remapping of land restarts in remap_restarts.py package (facilitates use of package in GEOSldas setup script)
- Added support for SLES15, NAS site and log for remap_lake_landice_saltwater in remap_restarts.py package
- Added "land_only" option for remapping of restarts

### Changed

### Fixed
Expand Down
13 changes: 10 additions & 3 deletions pre/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ add_subdirectory(NSIDC-OSTIA_SST-ICE_blend)
add_subdirectory(prepare_ocnExtData)

file(GLOB pythonscripts CONFIGURE_DEPENDS ./remap_restart/remap* ./remap_restart/bin2nc_merra2* ./remap_restart/tests/*.*)
install(
PROGRAMS ${pythonscripts}
DESTINATION bin)

list(FILTER pythonscripts EXCLUDE REGEX "remap_utils.py")

foreach (file ${pythonscripts})
install(PROGRAMS ${file} DESTINATION bin)
endforeach()

set(file ./remap_restart/remap_utils.py)
configure_file(${file} ${file} @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin)

install(
PROGRAMS regrid.pl
Expand Down
7 changes: 2 additions & 5 deletions pre/remap_restart/remap_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
import ruamel.yaml
import shutil
import subprocess
from remap_utils import *

class remap_base(object):
def __init__(self, **configs):
for key, value in configs.items():
if (key == 'params_file'):
print( "use Config yaml file: " + value)
yaml = ruamel.yaml.YAML()
stream =''
with open(value, 'r') as f:
stream = f.read()
self.config = yaml.load(stream)
self.config = get_config_from_file(value)
out_dir = self.config['output']['shared']['out_dir']
if not os.path.exists(out_dir) : os.makedirs(out_dir)
f = os.path.basename(value)
Expand Down
Loading

0 comments on commit 61009d5

Please sign in to comment.