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

Commit

Permalink
More change to clean up Swifter file saving
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed May 15, 2023
1 parent 36edbd3 commit fed8c21
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,13 +1441,19 @@ def ascii_file_input_error_msg(codename):
if "IN_FORM" in self.param:
init_cond_format = self.param['IN_FORM']
else:
init_cond_format = "EL"
if self.codename.title() == "Swiftest":
init_cond_format = "EL"
else:
init_cond_format = "XV"

if init_cond_file_type is None:
if "IN_TYPE" in self.param:
init_cond_file_type = self.param['IN_TYPE']
else:
init_cond_file_type = "NETCDF_DOUBLE"
if self.codename.title() == "Swiftest":
init_cond_file_type = "NETCDF_DOUBLE"
else:
init_cond_file_type = "ASCII"

if self.codename.title() == "Swiftest":
init_cond_keys = ["CB", "PL", "TP"]
Expand Down Expand Up @@ -1664,10 +1670,11 @@ def set_output_files(self,
else:
self.param['BIN_OUT'] = output_file_name

if output_format != "XV" and self.codename != "Swiftest":
warnings.warn(f"{output_format} is not compatible with {self.codename}. Setting to XV",stacklevel=2)
output_format = "XV"
self.param["OUT_FORM"] = output_format
if output_format is not None:
if output_format != "XV" and self.codename != "Swiftest":
warnings.warn(f"{output_format} is not compatible with {self.codename}. Setting to XV",stacklevel=2)
output_format = "XV"
self.param["OUT_FORM"] = output_format

if self.restart:
self.param["OUT_STAT"] = "APPEND"
Expand Down

0 comments on commit fed8c21

Please sign in to comment.