gs2crmod 0.12.15 → 0.12.16
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gs2crmod.gemspec +5 -7
- data/lib/gs2crmod/calculations.rb +24 -23
- data/lib/gs2crmod/gs2.rb +3 -1
- metadata +40 -22
- checksums.yaml +0 -7
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.16
|
data/gs2crmod.gemspec
CHANGED
@@ -2,17 +2,14 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: gs2crmod 0.12.15 ruby lib
|
6
|
-
# stub: ext/extconf.rb
|
7
5
|
|
8
6
|
Gem::Specification.new do |s|
|
9
7
|
s.name = "gs2crmod"
|
10
|
-
s.version = "0.12.
|
8
|
+
s.version = "0.12.16"
|
11
9
|
|
12
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
|
-
s.require_paths = ["lib"]
|
14
11
|
s.authors = ["Edmund Highcock", "Ferdinand van Wyk"]
|
15
|
-
s.date = "2015-
|
12
|
+
s.date = "2015-12-07"
|
16
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."
|
17
14
|
s.email = "edmundhighcock@sourceforge.net"
|
18
15
|
s.extensions = ["ext/extconf.rb"]
|
@@ -79,12 +76,13 @@ Gem::Specification.new do |s|
|
|
79
76
|
]
|
80
77
|
s.homepage = "http://gs2crmod.sourceforge.net"
|
81
78
|
s.licenses = ["GSLv3"]
|
79
|
+
s.require_paths = ["lib"]
|
82
80
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
|
83
|
-
s.rubygems_version = "
|
81
|
+
s.rubygems_version = "1.8.23"
|
84
82
|
s.summary = "Module to allow CodeRunner to run and analyse the GS2 and AstroGK codes."
|
85
83
|
|
86
84
|
if s.respond_to? :specification_version then
|
87
|
-
s.specification_version =
|
85
|
+
s.specification_version = 3
|
88
86
|
|
89
87
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
90
88
|
s.add_runtime_dependency(%q<coderunner>, [">= 0.15.5"])
|
@@ -240,9 +240,6 @@ def calculate_saturation_time_index(show_graph = false)
|
|
240
240
|
#
|
241
241
|
# exit
|
242
242
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
243
|
return
|
247
244
|
|
248
245
|
# Calculate a series of time averaged segments
|
@@ -272,6 +269,7 @@ alias :csti :calculate_saturation_time_index
|
|
272
269
|
|
273
270
|
def calculate_frequencies
|
274
271
|
@real_frequencies = FloatHash.new
|
272
|
+
@frequency_at_ky_at_kx ||= FloatHash.new
|
275
273
|
omega_avg_narray = netcdf_file.var("omega_average").get('start' => [0, 0, 0, -1],
|
276
274
|
'end' => [0, -1, -1, -1])
|
277
275
|
omega_avg_narray.reshape!(*omega_avg_narray.shape.slice(1..2))
|
@@ -282,7 +280,7 @@ def calculate_frequencies
|
|
282
280
|
list(:ky).values.sort.each_with_index do |kyv, i|
|
283
281
|
@frequency_at_ky_at_kx[kyv] = FloatHash.new
|
284
282
|
list(:kx).values.sort.each_with_index do |kxv, j|
|
285
|
-
@frequency_at_ky_at_kx[kyv][kxv] = omega_avg_narray[
|
283
|
+
@frequency_at_ky_at_kx[kyv][kxv] = omega_avg_narray[j, i]
|
286
284
|
end
|
287
285
|
write_results
|
288
286
|
end
|
@@ -371,24 +369,23 @@ end
|
|
371
369
|
alias :cgrf :calculate_growth_rates_and_frequencies
|
372
370
|
|
373
371
|
def calculate_growth_rate(vector, options={})
|
374
|
-
|
375
|
-
|
376
|
-
|
372
|
+
raise "This vector should be positive definite" if vector.min < 0.0
|
373
|
+
offset = 0
|
374
|
+
length = vector.length
|
377
375
|
while vector[offset] == 0.0
|
378
376
|
offset+=1
|
379
377
|
return 0.0 if offset == vector.length
|
380
378
|
end
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
growth_rate
|
379
|
+
growth_rate = GSL::Fit::linear(gsl_vector(:t).subvector(offset, length-offset), 0.5*GSL::Sf::log(vector.subvector(offset, length - offset)))[1]
|
380
|
+
divisor = 1
|
381
|
+
while (growth_rate.to_s == "NaN")
|
382
|
+
#This corrects the growth rate if phi has grown all the way to NaN during the simulation
|
383
|
+
divisor *= 2
|
384
|
+
length = (vector.size.to_f / divisor.to_f).floor
|
385
|
+
return "NaN" if length <= offset + 1
|
386
|
+
growth_rate = GSL::Fit::linear(gsl_vector(:t).subvector(offset, length-offset), 0.5*GSL::Sf::log(vector.subvector(offset, length-offset)))[1]
|
387
|
+
end
|
388
|
+
growth_rate
|
392
389
|
end
|
393
390
|
|
394
391
|
# Not needed for GS2 built after 16/06/2010
|
@@ -683,7 +680,7 @@ end
|
|
683
680
|
|
684
681
|
def max_trans_phi
|
685
682
|
phivec = gsl_vector('phi2tot_over_time')
|
686
|
-
offset = 30
|
683
|
+
#offset = 30
|
687
684
|
phivec.subvector(20, phivec.size - 20).max
|
688
685
|
end
|
689
686
|
|
@@ -692,7 +689,7 @@ def max_es_heat_amp(species_index)
|
|
692
689
|
end
|
693
690
|
|
694
691
|
def calculate_spectral_checks
|
695
|
-
kx = gsl_vector('kx')
|
692
|
+
#kx = gsl_vector('kx')
|
696
693
|
ky = gsl_vector('ky')
|
697
694
|
ky_spec = gsl_vector('spectrum_over_ky')
|
698
695
|
kx_spec = gsl_vector('spectrum_over_kx')
|
@@ -752,6 +749,13 @@ end
|
|
752
749
|
alias :csc :calculate_spectral_checks
|
753
750
|
|
754
751
|
def calculate_prandtl_number
|
752
|
+
|
753
|
+
@prandtl_number = {}
|
754
|
+
@nspec.times do |i|
|
755
|
+
@prandtl_number[i+1] = nil
|
756
|
+
end
|
757
|
+
write_results
|
758
|
+
|
755
759
|
if @g_exb == 0
|
756
760
|
eputs 'g_exb = 0 therefore Prandtl number is undefined.'
|
757
761
|
return nil
|
@@ -763,8 +767,6 @@ def calculate_prandtl_number
|
|
763
767
|
return nil
|
764
768
|
end
|
765
769
|
|
766
|
-
@prandtl_number = {}
|
767
|
-
|
768
770
|
@nspec.times do |i|
|
769
771
|
species_index = i + 1
|
770
772
|
@prandtl_number[species_index] = - (@rhoc/@qinp/@rmaj**2) *
|
@@ -777,4 +779,3 @@ end
|
|
777
779
|
|
778
780
|
end
|
779
781
|
end
|
780
|
-
|
data/lib/gs2crmod/gs2.rb
CHANGED
@@ -1281,7 +1281,9 @@ folder = File.dirname(File.expand_path(__FILE__)) # i.e. the directory this file
|
|
1281
1281
|
|
1282
1282
|
# Rename variables which go in info and results file
|
1283
1283
|
@run_name.sub! "id_#{@id}", "id_#{new_id}"
|
1284
|
-
@restart_file
|
1284
|
+
if @restart_file
|
1285
|
+
@restart_file.sub! "id_#{@id}", "id_#{new_id}"
|
1286
|
+
end
|
1285
1287
|
@output_file.sub! "gs2.#{@id}", "gs2.#{new_id}"
|
1286
1288
|
@error_file.sub! "gs2.#{@id}", "gs2.#{new_id}"
|
1287
1289
|
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gs2crmod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.16
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Edmund Highcock
|
@@ -9,53 +10,60 @@ authors:
|
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2015-
|
13
|
+
date: 2015-12-07 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: coderunner
|
16
17
|
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
17
19
|
requirements:
|
18
|
-
- -
|
20
|
+
- - ! '>='
|
19
21
|
- !ruby/object:Gem::Version
|
20
22
|
version: 0.15.5
|
21
23
|
type: :runtime
|
22
24
|
prerelease: false
|
23
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
|
-
- -
|
28
|
+
- - ! '>='
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: 0.15.5
|
28
31
|
- !ruby/object:Gem::Dependency
|
29
32
|
name: rubyhacks
|
30
33
|
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
31
35
|
requirements:
|
32
|
-
- -
|
36
|
+
- - ! '>='
|
33
37
|
- !ruby/object:Gem::Version
|
34
38
|
version: 0.1.2
|
35
39
|
type: :runtime
|
36
40
|
prerelease: false
|
37
41
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
38
43
|
requirements:
|
39
|
-
- -
|
44
|
+
- - ! '>='
|
40
45
|
- !ruby/object:Gem::Version
|
41
46
|
version: 0.1.2
|
42
47
|
- !ruby/object:Gem::Dependency
|
43
48
|
name: ruby-netcdf
|
44
49
|
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
45
51
|
requirements:
|
46
|
-
- -
|
52
|
+
- - ! '>='
|
47
53
|
- !ruby/object:Gem::Version
|
48
54
|
version: 0.7.1
|
49
55
|
type: :runtime
|
50
56
|
prerelease: false
|
51
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
52
59
|
requirements:
|
53
|
-
- -
|
60
|
+
- - ! '>='
|
54
61
|
- !ruby/object:Gem::Version
|
55
62
|
version: 0.7.1
|
56
63
|
- !ruby/object:Gem::Dependency
|
57
64
|
name: shoulda
|
58
65
|
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
59
67
|
requirements:
|
60
68
|
- - '='
|
61
69
|
- !ruby/object:Gem::Version
|
@@ -63,6 +71,7 @@ dependencies:
|
|
63
71
|
type: :development
|
64
72
|
prerelease: false
|
65
73
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
66
75
|
requirements:
|
67
76
|
- - '='
|
68
77
|
- !ruby/object:Gem::Version
|
@@ -70,57 +79,65 @@ dependencies:
|
|
70
79
|
- !ruby/object:Gem::Dependency
|
71
80
|
name: rdoc
|
72
81
|
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
73
83
|
requirements:
|
74
|
-
- -
|
84
|
+
- - ~>
|
75
85
|
- !ruby/object:Gem::Version
|
76
86
|
version: '3.12'
|
77
87
|
type: :development
|
78
88
|
prerelease: false
|
79
89
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
80
91
|
requirements:
|
81
|
-
- -
|
92
|
+
- - ~>
|
82
93
|
- !ruby/object:Gem::Version
|
83
94
|
version: '3.12'
|
84
95
|
- !ruby/object:Gem::Dependency
|
85
96
|
name: bundler
|
86
97
|
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
87
99
|
requirements:
|
88
|
-
- -
|
100
|
+
- - ! '>'
|
89
101
|
- !ruby/object:Gem::Version
|
90
102
|
version: 1.0.0
|
91
103
|
type: :development
|
92
104
|
prerelease: false
|
93
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
94
107
|
requirements:
|
95
|
-
- -
|
108
|
+
- - ! '>'
|
96
109
|
- !ruby/object:Gem::Version
|
97
110
|
version: 1.0.0
|
98
111
|
- !ruby/object:Gem::Dependency
|
99
112
|
name: jeweler
|
100
113
|
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
101
115
|
requirements:
|
102
|
-
- -
|
116
|
+
- - ! '>='
|
103
117
|
- !ruby/object:Gem::Version
|
104
118
|
version: 1.8.4
|
105
119
|
type: :development
|
106
120
|
prerelease: false
|
107
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
108
123
|
requirements:
|
109
|
-
- -
|
124
|
+
- - ! '>='
|
110
125
|
- !ruby/object:Gem::Version
|
111
126
|
version: 1.8.4
|
112
127
|
- !ruby/object:Gem::Dependency
|
113
128
|
name: minitest
|
114
129
|
requirement: !ruby/object:Gem::Requirement
|
130
|
+
none: false
|
115
131
|
requirements:
|
116
|
-
- -
|
132
|
+
- - ~>
|
117
133
|
- !ruby/object:Gem::Version
|
118
134
|
version: '4'
|
119
135
|
type: :development
|
120
136
|
prerelease: false
|
121
137
|
version_requirements: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
122
139
|
requirements:
|
123
|
-
- -
|
140
|
+
- - ~>
|
124
141
|
- !ruby/object:Gem::Version
|
125
142
|
version: '4'
|
126
143
|
description: GS2 is a gyrokinetic flux tube initial value turbulence code which can
|
@@ -136,7 +153,7 @@ extra_rdoc_files:
|
|
136
153
|
- README.md
|
137
154
|
- README.rdoc
|
138
155
|
files:
|
139
|
-
-
|
156
|
+
- .document
|
140
157
|
- Gemfile
|
141
158
|
- LICENSE.txt
|
142
159
|
- README.md
|
@@ -193,25 +210,26 @@ files:
|
|
193
210
|
homepage: http://gs2crmod.sourceforge.net
|
194
211
|
licenses:
|
195
212
|
- GSLv3
|
196
|
-
metadata: {}
|
197
213
|
post_install_message:
|
198
214
|
rdoc_options: []
|
199
215
|
require_paths:
|
200
216
|
- lib
|
201
217
|
required_ruby_version: !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
202
219
|
requirements:
|
203
|
-
- -
|
220
|
+
- - ! '>='
|
204
221
|
- !ruby/object:Gem::Version
|
205
222
|
version: 1.9.1
|
206
223
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
|
+
none: false
|
207
225
|
requirements:
|
208
|
-
- -
|
226
|
+
- - ! '>='
|
209
227
|
- !ruby/object:Gem::Version
|
210
228
|
version: '0'
|
211
229
|
requirements: []
|
212
230
|
rubyforge_project:
|
213
|
-
rubygems_version:
|
231
|
+
rubygems_version: 1.8.23
|
214
232
|
signing_key:
|
215
|
-
specification_version:
|
233
|
+
specification_version: 3
|
216
234
|
summary: Module to allow CodeRunner to run and analyse the GS2 and AstroGK codes.
|
217
235
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: b70ef9ab394cfad42374899d407d83a153239997
|
4
|
-
data.tar.gz: 95f5519f6fc8fb0c3bf5f350e6a1c12016aca77f
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 6cc09080222a98a8a837b82c342d120dc55bab677a529fde8bc9d8aaaa2d987a339bfa7e6c6da140a9381eb133c7a914788eccb6cea1ed357365c4007ed76f59
|
7
|
-
data.tar.gz: 6add4ec894749da4aecbb262d2666b9886acca0478c6f395ff7eefb21e956ab6ebf9cd6d124b537f8d08a2490f4ea7a3172e09a368fe6cd86a7b2d2250b76dfe
|