Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'debug'
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Sep 15, 2022
2 parents f7b03cb + 90ee74d commit 6a481c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def select_active_from_frame(ds, param, framenum=-1):

return frame

def swiftest_xr2infile(ds, param, framenum=-1):
def swiftest_xr2infile(ds, param, infile_name=None,framenum=-1):
"""
Writes a set of Swiftest input files from a single frame of a Swiftest xarray dataset
Expand All @@ -911,7 +911,7 @@ def swiftest_xr2infile(ds, param, framenum=-1):
# Note: xarray will call the character array dimension string32. The Fortran code
# will rename this after reading
frame = unclean_string_values(frame)
frame.to_netcdf(path=param['NC_IN'])
frame.to_netcdf(path=infile_name)
return frame

# All other file types need seperate files for each of the inputs
Expand Down
2 changes: 1 addition & 1 deletion python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def initial_conditions_from_bin(self, framenum=-1, new_param=None, new_param_fil
new_param.pop('TP_IN', None)
new_param.pop('CB_IN', None)
print(f"Extracting data from dataset at time frame number {framenum} and saving it to {new_param['NC_IN']}")
frame = io.swiftest_xr2infile(self.ds, new_param, framenum)
frame = io.swiftest_xr2infile(self.ds, self.param, infile_name=new_param['NC_IN'],framenum)
print(f"Saving parameter configuration file to {new_param_file}")
self.write_param(new_param_file, param=new_param)

Expand Down

0 comments on commit 6a481c6

Please sign in to comment.