gs2crmod 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -46,6 +46,14 @@ file "lib/#{NAME}_ext.so" =>
46
46
  cp "ext/#{NAME}_ext.so", "lib/#{NAME}_ext.so"
47
47
  end
48
48
 
49
+
50
+ require 'rake/testtask'
51
+ Rake::TestTask.new(:sync_variables) do |test|
52
+ test.libs << 'lib' << 'sync_variables'
53
+ test.pattern = 'sync_variables/sync_variables.rb'
54
+ test.verbose = true
55
+ end
56
+
49
57
  # make the :test task depend on the shared
50
58
  # object, so it will be built automatically
51
59
  # before running the tests
@@ -58,7 +66,6 @@ CLEAN.include('ext/**/Makefile')
58
66
  CLOBBER.include('lib/**/*.so')
59
67
  CLOBBER.include('lib/*.so')
60
68
 
61
- require 'rake/testtask'
62
69
  Rake::TestTask.new(:test) do |test|
63
70
  test.libs << 'lib' << 'test' << 'ext'
64
71
  test.pattern = 'test/**/test_*.rb'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.1
1
+ 0.9.0
data/gs2crmod.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gs2crmod"
8
- s.version = "0.8.1"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edmund Highcock", "Ferdinand van Wyk"]
12
- s.date = "2013-07-17"
12
+ s.date = "2013-07-19"
13
13
  s.description = "GS2 is a gyrokinetic flux tube initial value turbulence code which can be used for fusion or astrophysical plasmas. CodeRunner is a framework for the automated running and analysis of large simulations. This module allows GS2 (and its sister code AstroGK) to harness the power of the CodeRunner framework."
14
14
  s.email = "edmundhighcock@sourceforge.net"
15
15
  s.extensions = ["ext/extconf.rb"]
@@ -64,6 +64,8 @@ Gem::Specification.new do |s|
64
64
  "lib/gs2crmod/spectrogk/namelists.rb",
65
65
  "lib/gs2crmod/test_gs2.rb",
66
66
  "lib/gs2crmod_extension.rb",
67
+ "sync_variables/helper.rb",
68
+ "sync_variables/sync_variables.rb",
67
69
  "test/agk_slab_itg_low_kperp.in",
68
70
  "test/agk_slab_itg_low_kperp.tgz",
69
71
  "test/cyclone_low_res.in",
@@ -1278,7 +1278,30 @@
1278
1278
  :autoscanned_defaults=>[],
1279
1279
  :type=>:Integer,
1280
1280
  :code_name=>:nterp,
1281
- :module=>:le_grids}},
1281
+ :module=>:le_grids},
1282
+ :genquad=>
1283
+ {:should_include=>"true",
1284
+ :description=>
1285
+ "If true use generalised quadrature scheme for velocity integrals.",
1286
+ :help=>
1287
+ "If true use generalised quadrature scheme for velocity integrals.",
1288
+ :code_name=>:genquad,
1289
+ :must_pass=>
1290
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
1291
+ :explanation=>
1292
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
1293
+ :type=>:Fortran_Bool},
1294
+ :ne_int_genquad=>
1295
+ {:should_include=>"true",
1296
+ :description=>
1297
+ "Velocity space res used for calculating quadrature scheme. Suggested value: large! (>200).",
1298
+ :help=>
1299
+ "Velocity space res used to calculate moments of the distribution prior to calculating general quadrature scheme. Suggested value: large! (>200).",
1300
+ :code_name=>:ne_int_genquad,
1301
+ :must_pass=>
1302
+ [{:test=>"kind_of? Integer",
1303
+ :explanation=>"This variable must be an integer."}],
1304
+ :type=>:Integer}},
1282
1305
  :help=>
1283
1306
  "A concise description of the original GS2 pitch angle and energy grid choices may be found in the article entitled \"Comparison of Initial Value and Eigenvalue Codes for Kinetic Toroidal Plasma Instabilities\" by M. Kotschenreuther, et al., in Computer Physics Communications, Vol. 88, page 128, 1995.\n\nSince then the energy grid has been updated to use the Candy/Waltz grid, but the pitch angle grid remains the same."},
1284
1307
  :dist_fn_knobs=>
@@ -1478,19 +1501,16 @@
1478
1501
  :module=>:dist_fn},
1479
1502
  :nonad_zero=>
1480
1503
  {:should_include=>"true",
1481
- :description=>"If true, new boundary conditions g_wesson = 0",
1504
+ :description=>
1505
+ "If true switches on new parallel boundary condition where h=0 at incoming boundary instead of g=0.",
1482
1506
  :help=>
1483
- "If true, new boundary conditions g_wesson=0. If false, g_gs2 = 0",
1484
- :tests=>["Tst::FORTRAN_BOOL"],
1485
- :gs2_name=>:nonad_zero,
1507
+ "If true switches on new parallel boundary condition where h=0 at incoming boundary instead of g=0.",
1508
+ :code_name=>:nonad_zero,
1486
1509
  :must_pass=>
1487
1510
  [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
1488
1511
  :explanation=>
1489
1512
  "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
1490
- :autoscanned_defaults=>[".false."],
1491
- :type=>:Fortran_Bool,
1492
- :code_name=>:nonad_zero,
1493
- :module=>:dist_fn},
1513
+ :type=>:Fortran_Bool},
1494
1514
  :mult_imp=>
1495
1515
  {:should_include=>"true",
1496
1516
  :description=>nil,
@@ -1572,18 +1592,6 @@
1572
1592
  "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
1573
1593
  :type=>:Float,
1574
1594
  :module=>:dist_fn},
1575
- :nonad_zero=>
1576
- {:should_include=>"true",
1577
- :description=>
1578
- "If true switches on new parallel boundary condition where h=0 at incoming boundary instead of g=0.",
1579
- :help=>
1580
- "If true switches on new parallel boundary condition where h=0 at incoming boundary instead of g=0.",
1581
- :code_name=>:nonad_zero,
1582
- :must_pass=>
1583
- [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
1584
- :explanation=>
1585
- "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
1586
- :type=>:Fortran_Bool},
1587
1595
  :g_exb_start_time=>
1588
1596
  {:should_include=>"true",
1589
1597
  :description=>"Flow shear switched on at this time.",
@@ -1613,7 +1621,27 @@
1613
1621
  [{:test=>"kind_of? Numeric",
1614
1622
  :explanation=>
1615
1623
  "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
1616
- :type=>:Float}}},
1624
+ :type=>:Float},
1625
+ :lf_default=>
1626
+ {:should_include=>"true",
1627
+ :description=>"",
1628
+ :help=>"",
1629
+ :code_name=>:lf_default,
1630
+ :must_pass=>
1631
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
1632
+ :explanation=>
1633
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
1634
+ :type=>:Fortran_Bool},
1635
+ :lf_decompose=>
1636
+ {:should_include=>"true",
1637
+ :description=>"",
1638
+ :help=>"",
1639
+ :code_name=>:lf_decompose,
1640
+ :must_pass=>
1641
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
1642
+ :explanation=>
1643
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
1644
+ :type=>:Fortran_Bool}}},
1617
1645
  :fields_knobs=>
1618
1646
  {:description=>"ALGORITHMIC CHOICES",
1619
1647
  :should_include=>"true",
@@ -1947,7 +1975,61 @@
1947
1975
  [{:test=>"kind_of? String",
1948
1976
  :explanation=>"This variable must be a string."}],
1949
1977
  :type=>:String,
1950
- :module=>:gs2_layouts}}},
1978
+ :module=>:gs2_layouts},
1979
+ :unbalanced_xxf=>
1980
+ {:should_include=>"true",
1981
+ :description=>
1982
+ "An optimised layout made by Adrian Jackson..please add better help!",
1983
+ :help=>"",
1984
+ :code_name=>:unbalanced_xxf,
1985
+ :must_pass=>
1986
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
1987
+ :explanation=>
1988
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
1989
+ :type=>:Fortran_Bool},
1990
+ :max_unbalanced_xxf=>
1991
+ {:should_include=>"true",
1992
+ :description=>
1993
+ "An optimised layout made by Adrian Jackson..please add better help!",
1994
+ :help=>"",
1995
+ :code_name=>:max_unbalanced_xxf,
1996
+ :must_pass=>
1997
+ [{:test=>"kind_of? Numeric",
1998
+ :explanation=>
1999
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2000
+ :type=>:Float},
2001
+ :unbalanced_yxf=>
2002
+ {:should_include=>"true",
2003
+ :description=>
2004
+ "An optimised layout made by Adrian Jackson..please add better help!",
2005
+ :help=>"",
2006
+ :code_name=>:unbalanced_yxf,
2007
+ :must_pass=>
2008
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
2009
+ :explanation=>
2010
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
2011
+ :type=>:Fortran_Bool},
2012
+ :max_unbalanced_yxf=>
2013
+ {:should_include=>"true",
2014
+ :description=>
2015
+ "An optimised layout made by Adrian Jackson..please add better help!",
2016
+ :help=>"",
2017
+ :code_name=>:max_unbalanced_yxf,
2018
+ :must_pass=>
2019
+ [{:test=>"kind_of? Numeric",
2020
+ :explanation=>
2021
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2022
+ :type=>:Float},
2023
+ :opt_local_copy=>
2024
+ {:should_include=>"true",
2025
+ :description=>"A recent optimisation ..please add better help!",
2026
+ :help=>"",
2027
+ :code_name=>:opt_local_copy,
2028
+ :must_pass=>
2029
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
2030
+ :explanation=>
2031
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
2032
+ :type=>:Fortran_Bool}}},
1951
2033
  :collisions_knobs=>
1952
2034
  {:description=>"COLLISIONS",
1953
2035
  :should_include=>"true",
@@ -2734,7 +2816,53 @@
2734
2816
  "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2735
2817
  :type=>:Float,
2736
2818
  :code_name=>:tpar0,
2737
- :autoscanned_defaults=>[0.0]}}},
2819
+ :autoscanned_defaults=>[0.0]},
2820
+ :source=>
2821
+ {:should_include=>"true",
2822
+ :description=>
2823
+ "Normalised alpha source. If set -ve automatically adjusted to give specified alpha density.",
2824
+ :help=>
2825
+ "Sets the normalised source for alphas. If set negative will be automatically adjusted to give the specified alpha density.",
2826
+ :code_name=>:source,
2827
+ :must_pass=>
2828
+ [{:test=>"kind_of? Numeric",
2829
+ :explanation=>
2830
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2831
+ :type=>:Float},
2832
+ :sprim=>
2833
+ {:should_include=>"true",
2834
+ :description=>"Gradient of normalised source.",
2835
+ :help=>"Gradient of normalised source.",
2836
+ :code_name=>:sprim,
2837
+ :must_pass=>
2838
+ [{:test=>"kind_of? Numeric",
2839
+ :explanation=>
2840
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2841
+ :type=>:Float},
2842
+ :gamma_ai=>
2843
+ {:should_include=>"true",
2844
+ :description=>
2845
+ "Alpha ion collion rate. Should be roughly the same as nu_ii.",
2846
+ :help=>
2847
+ "Alpha ion collion rate. Normalisation chosen so that this parameter should be roughly the same as nu_ii.",
2848
+ :code_name=>:gamma_ai,
2849
+ :must_pass=>
2850
+ [{:test=>"kind_of? Numeric",
2851
+ :explanation=>
2852
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2853
+ :type=>:Float},
2854
+ :gamma_ae=>
2855
+ {:should_include=>"true",
2856
+ :description=>
2857
+ "Alpha electron collion rate. Should be roughly the same as nu_ee.",
2858
+ :help=>
2859
+ "Alpha electron collion rate. Normalisation chosen so that this parameter should be roughly the same as nu_ee.",
2860
+ :code_name=>:gamma_ae,
2861
+ :must_pass=>
2862
+ [{:test=>"kind_of? Numeric",
2863
+ :explanation=>
2864
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2865
+ :type=>:Float}}},
2738
2866
  :dist_fn_species_knobs=>
2739
2867
  {:description=>"",
2740
2868
  :should_include=>"true",
@@ -2886,7 +3014,8 @@
2886
3014
  "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
2887
3015
  :type=>:Float},
2888
3016
  :clean_init=>
2889
- {:help=>"Makes sure phi = 0 at either ends of paralle domain. Only works when chop_side is also true",
3017
+ {:help=>
3018
+ "Makes sure phi = 0 at either ends of paralle domain. Only works when chop_side is also true",
2890
3019
  :should_include=>"true",
2891
3020
  :description=>"phi = 0 at either end of domain.",
2892
3021
  :tests=>["Tst::STRING"],
@@ -2895,7 +3024,6 @@
2895
3024
  [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
2896
3025
  :explanation=>
2897
3026
  "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
2898
- :autoscanned_defaults=>[".true."],
2899
3027
  :type=>:Fortran_Bool},
2900
3028
  :chop_side=>
2901
3029
  {:help=>"Rarely needed. Forces asymmetry into initial condition.",
@@ -5166,4 +5294,82 @@
5166
5294
  :explanation=>
5167
5295
  "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
5168
5296
  :type=>:Float,
5169
- :module=>:parameter_scan}}}}
5297
+ :module=>:parameter_scan}}},
5298
+ :general_f0_parameters=>
5299
+ {:description=>"",
5300
+ :should_include=>"true",
5301
+ :variables=>
5302
+ {:alpha_f0=>
5303
+ {:should_include=>"true",
5304
+ :description=>
5305
+ "Form of the alpha equilibrium distribution function: \"maxwellian\", \"analytic\" or \"external\"",
5306
+ :help=>
5307
+ "The distribution function for alphas can be \"maxwellian\", or it can be \"analytic\" based on a formula generated for the Ti=Te case, or it can be \"external\", i.e. read from an external table.",
5308
+ :code_name=>:alpha_f0,
5309
+ :must_pass=>
5310
+ [{:test=>"kind_of? String",
5311
+ :explanation=>"This variable must be a string."}],
5312
+ :type=>:String},
5313
+ :beam_f0=>
5314
+ {:should_include=>"true",
5315
+ :description=>"",
5316
+ :help=>"See help for alpha_f0",
5317
+ :code_name=>:beam_f0,
5318
+ :must_pass=>
5319
+ [{:test=>"kind_of? String",
5320
+ :explanation=>"This variable must be a string."}],
5321
+ :type=>:String},
5322
+ :rescale_f0=>
5323
+ {:should_include=>"true",
5324
+ :description=>"Rescale external F0 to a specified density if true.",
5325
+ :help=>
5326
+ "When reading the distribution function from an external table, rescale to a specified density if true.",
5327
+ :code_name=>:rescale_f0,
5328
+ :must_pass=>
5329
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
5330
+ :explanation=>
5331
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
5332
+ :type=>:Fortran_Bool},
5333
+ :main_ion_species=>
5334
+ {:should_include=>"true",
5335
+ :description=>"Index of main ion species.",
5336
+ :help=>
5337
+ "Select the main ion species which will be used to generate the analytical F0.",
5338
+ :code_name=>:main_ion_species,
5339
+ :must_pass=>
5340
+ [{:test=>"kind_of? Integer",
5341
+ :explanation=>"This variable must be an integer."}],
5342
+ :type=>:Integer},
5343
+ :energy_min=>
5344
+ {:should_include=>"true",
5345
+ :description=>"",
5346
+ :help=>"Garbage!",
5347
+ :code_name=>:energy_min,
5348
+ :must_pass=>
5349
+ [{:test=>"kind_of? Numeric",
5350
+ :explanation=>
5351
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
5352
+ :type=>:Float},
5353
+ :energy_0=>
5354
+ {:should_include=>"true",
5355
+ :description=>"Lower limit of F_alpha for : F_alpha(energy_0)=0.",
5356
+ :help=>
5357
+ "Lower limit of the alpha distribution function for : F_alpha(energy_0)=0.",
5358
+ :code_name=>:energy_0,
5359
+ :must_pass=>
5360
+ [{:test=>"kind_of? Numeric",
5361
+ :explanation=>
5362
+ "This variable must be a floating point number (an integer is also acceptable: it will be converted into a floating point number)."}],
5363
+ :type=>:Float},
5364
+ :print_egrid=>
5365
+ {:should_include=>"true",
5366
+ :description=>
5367
+ "Diagnostic: when true print the energy grid and generalised temperature.",
5368
+ :help=>
5369
+ "Diagnostic: when true print the energy grid and generalised temperature.",
5370
+ :code_name=>:print_egrid,
5371
+ :must_pass=>
5372
+ [{:test=>"kind_of? String and FORTRAN_BOOLS.include? self",
5373
+ :explanation=>
5374
+ "This variable must be a fortran boolean. (In Ruby this is represented as a string: e.g. '.true.')"}],
5375
+ :type=>:Fortran_Bool}}}}
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'coderunner'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -0,0 +1,5 @@
1
+ require 'helper'
2
+ CodeRunner.setup_run_class('gs2')
3
+ #CodeRunner::Gs2.update_defaults_from_source_code(ENV['GS2_SOURCE'])
4
+ CodeRunner::Gs2.synchronise_variables(ENV['GS2_SOURCE'])
5
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gs2crmod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-17 00:00:00.000000000 Z
13
+ date: 2013-07-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coderunner
@@ -150,6 +150,8 @@ files:
150
150
  - lib/gs2crmod/spectrogk/namelists.rb
151
151
  - lib/gs2crmod/test_gs2.rb
152
152
  - lib/gs2crmod_extension.rb
153
+ - sync_variables/helper.rb
154
+ - sync_variables/sync_variables.rb
153
155
  - test/agk_slab_itg_low_kperp.in
154
156
  - test/agk_slab_itg_low_kperp.tgz
155
157
  - test/cyclone_low_res.in