Skip to content

Commit 26e20fe

Browse files
authored
Merge pull request #137 from GEOS-ESM/feature/wjiang/filename
remap_restarts package: bug fix and minor change to accommodate GEOSldas requirements
2 parents 89fb4ee + 7c92d4e commit 26e20fe

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
- remap_restarts package: bug fix and minor change to accommodate GEOSldas requirements (#137)
15+
1416
### Fixed
1517

1618
### Removed

pre/remap_restart/remap_catchANDcn.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ def remap(self):
4141
in_rstfiles = glob.glob(rst_dir+'/*'+model+'_*'+time+'*')
4242
if len(in_rstfiles) == 0:
4343
print('\n try catch[cn] restart file without time stamp')
44-
in_rstfiles = glob.glob(rst_dir+'/*'+model+'_*')
44+
in_rstfiles = glob.glob(rst_dir+'/*'+model+'_internal_rst')
4545
if len(in_rstfiles) == 0:
46+
print("Can not find restart file in " + rst_dir)
47+
print("Please use the name format as *" + model+'_*'+time+'*')
48+
print(" Or *"+model+"_internal_rst")
4649
return
4750
in_rstfile = in_rstfiles[0]
4851

pre/remap_restart/remap_lake_landice_saltwater.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,19 @@ def remap(self):
5151
ogrid = config['input']['shared']['ogrid']
5252
omodel = config['input']['shared']['omodel']
5353
stretch = config['input']['shared']['stretch']
54-
in_geomdir = get_geomdir(in_bc_base, in_bc_version, agrid=agrid, ogrid=ogrid, omodel=omodel, stretch=stretch)
55-
in_tile_file = glob.glob(in_geomdir+ '/*-Pfafstetter.til')[0]
54+
in_tile_file = config['input']['surface']['catch_tilefile']
55+
if not in_tile_file :
56+
in_geomdir = get_geomdir(in_bc_base, in_bc_version, agrid=agrid, ogrid=ogrid, omodel=omodel, stretch=stretch)
57+
in_tile_file = glob.glob(in_geomdir+ '/*-Pfafstetter.til')[0]
5658

5759
agrid = config['output']['shared']['agrid']
5860
ogrid = config['output']['shared']['ogrid']
5961
omodel = config['output']['shared']['omodel']
6062
stretch = config['output']['shared']['stretch']
61-
out_geomdir = get_geomdir(out_bc_base, out_bc_version, agrid=agrid, ogrid=ogrid, omodel=omodel, stretch=stretch)
62-
out_tile_file = glob.glob(out_geomdir+ '/*-Pfafstetter.til')[0]
63+
out_tile_file = config['output']['surface']['catch_tilefile']
64+
if not out_tile_file :
65+
out_geomdir = get_geomdir(out_bc_base, out_bc_version, agrid=agrid, ogrid=ogrid, omodel=omodel, stretch=stretch)
66+
out_tile_file = glob.glob(out_geomdir+ '/*-Pfafstetter.til')[0]
6367

6468
types = '.bin'
6569
type_str = sp.check_output(['file','-b', os.path.realpath(restarts_in[0])])

0 commit comments

Comments
 (0)