File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -695,9 +695,9 @@ def __init__(
695695 comments = []
696696 if inline_comment is not None :
697697 parent_section .inline_comments [sectionname ] = inline_comment
698- parent_section ._comment_whitespace [
699- sectionname
700- ] = comment_whitespace
698+ parent_section ._comment_whitespace [sectionname ] = (
699+ comment_whitespace
700+ )
701701 else :
702702 # A key=value pair
703703
Original file line number Diff line number Diff line change 11"""Flux surface generator for tokamak grid files
22
33"""
4+
45from __future__ import print_function
56
67import numpy as np
Original file line number Diff line number Diff line change @@ -527,6 +527,14 @@ def create(
527527 # This attribute results in the correct (x,y,z) dimension labels
528528 data_slice .attributes ["bout_type" ] = "Field3D"
529529
530+ # The presence of `time_dimension` triggers BOUT++ to
531+ # save field with a time dimension, which breaks
532+ # subsequent restart files. `current_time_index` just
533+ # doesn't make sense for restart files
534+ for bad_attr in ["current_time_index" , "time_dimension" ]:
535+ if bad_attr in data .attributes :
536+ data_slice .attributes .pop (bad_attr )
537+
530538 outfile .write (var , data_slice )
531539
532540 infile .close ()
You can’t perform that action at this time.
0 commit comments