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 ("\n Remapping 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,13 +142,11 @@ 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 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 ("\n Splitting Saltwater Internal...\n " )
151- cmd = bindir + '/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater_internal
145+
146+ # split Saltwater
147+ if config ['output' ]['surface' ]['split_saltwater' ]:
148+ print ("\n Splitting Saltwater...\n " )
149+ cmd = bindir + '/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater
152150# subprocess.call(shlex.split(cmd))
153151 openwater = ''
154152 seaice = ''
@@ -158,17 +156,6 @@ def remap(self):
158156 cmd = exe + out_til + ' ' + in_til + ' InData/' + saltwater_import + ' 0 ' + str (zoom )
159157 self .run_and_log (cmd , log_name )
160158
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 ("\n Splitting 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-
172159 if (openwater ):
173160 cmd = exe + out_til + ' ' + in_til + ' InData/' + openwater + ' 0 ' + str (zoom )
174161 self .run_and_log (cmd , log_name )
0 commit comments