Skip to content

Commit 344464e

Browse files
committed
Fix issue with saltwater in remap_lake_landice_salt
1 parent d3cf586 commit 344464e

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

CHANGELOG.md

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

1818
### Deprecated
1919

20+
## [2.1.9] - 2025-06-13
21+
22+
### Fixed
23+
24+
- Fixed issue with saltwater splitting
25+
2026
## [2.1.8] - 2025-05-15
2127

2228
### Changed

pre/remap_restart/remap_lake_landice_saltwater.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
#
33
# remap_restarts package:
4-
# remap_lake_landice_saltwater.py remaps lake, landice, and (data) ocean restarts
4+
# remap_lake_landice_saltwater.py remaps lake, landice, and (data) ocean restarts
55
# using config inputs from `remap_params.yaml`
66
#
77
# to run, must first load modules (incl. python3) as follows:
@@ -40,7 +40,7 @@ def remap(self):
4040
print("\nRemapping land, landice, saltwater.....\n")
4141
config = self.config
4242
cwdir = os.getcwd()
43-
bindir = os.path.dirname(os.path.realpath(__file__))
43+
bindir = os.path.dirname(os.path.realpath(__file__))
4444

4545
in_bc_base = config['input']['shared']['bc_base']
4646
in_bc_version = config['input']['shared']['bc_version']
@@ -72,7 +72,7 @@ def remap(self):
7272
types = '.nc4'
7373
yyyymmddhh_ = str(config['input']['shared']['yyyymmddhh'])
7474

75-
label = get_label(config)
75+
label = get_label(config)
7676
suffix = yyyymmddhh_[0:8]+'_'+yyyymmddhh_[8:10] +'z' + types + label
7777

7878
out_dir = config['output']['shared']['out_dir']
@@ -142,11 +142,13 @@ def remap(self):
142142
if (saltwater_internal):
143143
cmd = exe + out_til + ' ' + in_til + ' InData/'+ saltwater_internal + ' 0 ' + str(zoom)
144144
self.run_and_log(cmd, log_name)
145-
146-
# split Saltwater
147-
if config['output']['surface']['split_saltwater']:
148-
print("\nSplitting Saltwater...\n")
149-
cmd = bindir+'/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater
145+
146+
# split Saltwater Internal
147+
# NOTE: split_saltwater==True means that the input restarts are already split.
148+
# So we do not split them again.
149+
if not config['output']['surface']['split_saltwater']:
150+
print("\nSplitting Saltwater Internal...\n")
151+
cmd = bindir+'/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater_internal
150152
# subprocess.call(shlex.split(cmd))
151153
openwater = ''
152154
seaice = ''
@@ -156,6 +158,17 @@ def remap(self):
156158
cmd = exe + out_til + ' ' + in_til + ' InData/'+ saltwater_import + ' 0 ' + str(zoom)
157159
self.run_and_log(cmd, log_name)
158160

161+
# split Saltwater Import
162+
# NOTE: split_saltwater==True means that the input restarts are already split.
163+
# So we do not split them again.
164+
if not config['output']['surface']['split_saltwater']:
165+
print("\nSplitting Saltwater Import...\n")
166+
cmd = bindir+'/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater_import
167+
# subprocess.call(shlex.split(cmd))
168+
openwater = ''
169+
seaice = ''
170+
self.run_and_log(cmd, log_name)
171+
159172
if (openwater):
160173
cmd = exe + out_til + ' ' + in_til + ' InData/' + openwater + ' 0 ' + str(zoom)
161174
self.run_and_log(cmd, log_name)

0 commit comments

Comments
 (0)