# This file contains methods which allow Trinity to use GS2 as # the flux solver #class NumRu::NetCDF #def _dump_data #Marshal.dump(nil) #end #end class CodeRunner class Trinity # This function creates a new Trinity defaults file, with Trinity parameters taken from # trinity_input_file, and GS2 parameters taken from gs2_input_file. The file is then moved # to the CodeRunner central defaults location, the current folder is configured to use # the defaults file. def self.use_new_defaults_file_with_gs2(name = ARGV[-3], trinity_input_file = ARGV[-2], gs2_input_file = ARGV[-1]) raise "Please specify a name, a trinity input file and a gs2 input file" if name == "use_new_gs2_defaults_file" defaults_filename = "#{name}_defaults.rb" tmp_filename = "#{name}_gs2tmp_defaults.rb" central_defaults_filename = rcp.user_defaults_location + "/" + defaults_filename FileUtils.rm(name + '_defaults.rb') if FileTest.exist?(name + '_defaults.rb') FileUtils.rm(central_defaults_filename) if FileTest.exist?(central_defaults_filename) FileUtils.rm(tmp_filename) if FileTest.exist?(tmp_filename) raise "Defaults file: #{central_defaults_filename} already exists" if FileTest.exist? central_defaults_filename make_new_defaults_file(name, trinity_input_file) CodeRunner::Gs2.make_new_defaults_file(name + '_gs2tmp', gs2_input_file) File.open(defaults_filename, 'a'){|file| file.puts <