gs2crmod 0.11.35 → 0.11.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/VERSION +1 -1
- data/gs2crmod.gemspec +7 -5
- data/lib/gs2crmod/gs2.rb +5 -0
- data/lib/gs2crmod/read_netcdf.rb +96 -0
- metadata +57 -38
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f661dc2bf1a80c9e9f7b18ab69761e427ef70c5f
|
4
|
+
data.tar.gz: a6b052352a440b0b0618e409d9d7ad82a2b41dff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d81a214c19e7ffa023f532f6952e2dd3897922e65ddc83dcca56f0c7f6d3b4ec4a5e4c61d235faf19aed1e6d3d92cf5d305c3595cc27b3f0ef3e5a217e3cf63f
|
7
|
+
data.tar.gz: e8505a545ebb2080c7584444435669973d129a30bfb61a8c872c48fdf7d178ea917a1480a79872b4ddcaf96e0a2b755d17b05adf4eba42decb85c47c59fb6059
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.11.
|
1
|
+
0.11.36
|
data/gs2crmod.gemspec
CHANGED
@@ -2,14 +2,17 @@
|
|
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.11.36 ruby lib
|
6
|
+
# stub: ext/extconf.rb
|
5
7
|
|
6
8
|
Gem::Specification.new do |s|
|
7
9
|
s.name = "gs2crmod"
|
8
|
-
s.version = "0.11.
|
10
|
+
s.version = "0.11.36"
|
9
11
|
|
10
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
|
+
s.require_paths = ["lib"]
|
11
14
|
s.authors = ["Edmund Highcock", "Ferdinand van Wyk"]
|
12
|
-
s.date = "2014-03-
|
15
|
+
s.date = "2014-03-27"
|
13
16
|
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
17
|
s.email = "edmundhighcock@sourceforge.net"
|
15
18
|
s.extensions = ["ext/extconf.rb"]
|
@@ -82,13 +85,12 @@ Gem::Specification.new do |s|
|
|
82
85
|
]
|
83
86
|
s.homepage = "http://gs2crmod.sourceforge.net"
|
84
87
|
s.licenses = ["GSLv3"]
|
85
|
-
s.require_paths = ["lib"]
|
86
88
|
s.required_ruby_version = Gem::Requirement.new(">= 1.9.1")
|
87
|
-
s.rubygems_version = "
|
89
|
+
s.rubygems_version = "2.2.1"
|
88
90
|
s.summary = "Module to allow CodeRunner to run and analyse the GS2 and AstroGK codes."
|
89
91
|
|
90
92
|
if s.respond_to? :specification_version then
|
91
|
-
s.specification_version =
|
93
|
+
s.specification_version = 4
|
92
94
|
|
93
95
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
94
96
|
s.add_runtime_dependency(%q<coderunner>, [">= 0.14.10"])
|
data/lib/gs2crmod/gs2.rb
CHANGED
data/lib/gs2crmod/read_netcdf.rb
CHANGED
@@ -47,8 +47,21 @@ class NetcdfSmartReader
|
|
47
47
|
end
|
48
48
|
def read_variable(varname, options)
|
49
49
|
#start = get_start(dims, options)
|
50
|
+
if varname == 's' # dummy response for species index
|
51
|
+
return NArray.float(@nspec||1)
|
52
|
+
end
|
50
53
|
dims = dimensions(varname)
|
51
54
|
narray = @file.var(varname).get('start'=>starts(dims, options), 'end'=>ends(dims, options))
|
55
|
+
if options[:modify_variable]
|
56
|
+
dimhash = dims.inject({}){|hash, dim|
|
57
|
+
opts = options.dup
|
58
|
+
opts[:modify_variable] = nil
|
59
|
+
dimval = read_variable(dimension_variable_name(dim.name), opts)
|
60
|
+
hash[dim.name] = dimval
|
61
|
+
hash
|
62
|
+
}
|
63
|
+
narray = options[:modify_variable].call(varname, narray, hash)
|
64
|
+
end
|
52
65
|
shape = narray.shape
|
53
66
|
shape.delete_if{|i| i==1}
|
54
67
|
#p 'shape', shape; STDIN.gets
|
@@ -108,6 +121,8 @@ class NetcdfSmartReader
|
|
108
121
|
'hermite'
|
109
122
|
when 'p'
|
110
123
|
'hankel'
|
124
|
+
when 's'
|
125
|
+
's'
|
111
126
|
else
|
112
127
|
raise "Unknown dimension #{n}"
|
113
128
|
end
|
@@ -177,4 +192,85 @@ def old_smart_graphkit(options)
|
|
177
192
|
end
|
178
193
|
end
|
179
194
|
|
195
|
+
def hyperviscosity_graphkit(options)
|
196
|
+
raise "This only works for spectrogk" unless spectrogk?
|
197
|
+
options[:modify_variable] = Proc.new do |varname, narray, dimhash|
|
198
|
+
#dimnames = dimhash.keys
|
199
|
+
ky = gsl_vector('ky')
|
200
|
+
kx = gsl_vector('kx').to_box_order
|
201
|
+
shape = narray.shape
|
202
|
+
if varname == "gnew2_ta"
|
203
|
+
shape = narray.shape
|
204
|
+
for ig in 0...shape[0]
|
205
|
+
for ik in 0...shape[1]
|
206
|
+
for it in 0...shape[2]
|
207
|
+
for il in 0...shape[3]
|
208
|
+
for ie in 0...shape[4]
|
209
|
+
for is in 0...shape[5]
|
210
|
+
narray[ig,ik,it,il,ie,is]*=(ky(ik)**2.0 + kx(it)**2.0)*@d_hypervsic
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
narray
|
219
|
+
end
|
220
|
+
options[:graphkit_name] = 'cdf_gnew2_ta'
|
221
|
+
kit = smart_graphkit(options)
|
222
|
+
end
|
223
|
+
def hypercoll_graphkit(options)
|
224
|
+
raise "This only works for spectrogk" unless spectrogk?
|
225
|
+
options[:modify_variable] = Proc.new do |varname, narray, dimhash|
|
226
|
+
#dimnames = dimhash.keys
|
227
|
+
if varname == "gnew2_ta"
|
228
|
+
shape = narray.shape
|
229
|
+
p 'shape',shape
|
230
|
+
for ig in 0...shape[0]
|
231
|
+
for ik in 0...shape[1]
|
232
|
+
for it in 0...shape[2]
|
233
|
+
for il in 0...shape[3]
|
234
|
+
for ie in 0...shape[4]
|
235
|
+
for is in 0...shape[5]
|
236
|
+
narray[ig,ik,it,il,ie,is]*=send(:nu_h_ + (is+1).to_sym)*(il/(shape[3]-1))**send(:nexp_h_ + (is+1).to_sym)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
narray
|
245
|
+
end
|
246
|
+
options[:graphkit_name] = 'cdf_gnew2_ta'
|
247
|
+
kit = smart_graphkit(options)
|
248
|
+
end
|
249
|
+
def lenardbern_graphkit(options)
|
250
|
+
raise "This only works for spectrogk" unless spectrogk?
|
251
|
+
options[:modify_variable] = Proc.new do |varname, narray, dimhash|
|
252
|
+
#dimnames = dimhash.keys
|
253
|
+
if varname == "gnew2_ta"
|
254
|
+
shape = narray.shape
|
255
|
+
for ig in 0...shape[0]
|
256
|
+
for ik in 0...shape[1]
|
257
|
+
for it in 0...shape[2]
|
258
|
+
for il in 0...shape[3]
|
259
|
+
for ie in 0...shape[4]
|
260
|
+
for is in 0...shape[5]
|
261
|
+
narray[ik,it,il,ie,is]*=send(:nu_ + (is+1).to_sym)*il
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
narray
|
270
|
+
end
|
271
|
+
options[:graphkit_name] = 'cdf_gnew2_ta'
|
272
|
+
kit = smart_graphkit(options)
|
273
|
+
end
|
274
|
+
|
275
|
+
|
180
276
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gs2crmod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
5
|
-
prerelease:
|
4
|
+
version: 0.11.36
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Edmund Highcock
|
@@ -10,85 +9,106 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: coderunner
|
17
|
-
requirement:
|
18
|
-
none: false
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - ">="
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: 0.14.10
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
|
-
version_requirements:
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.14.10
|
26
28
|
- !ruby/object:Gem::Dependency
|
27
29
|
name: rubyhacks
|
28
|
-
requirement:
|
29
|
-
none: false
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
|
-
- -
|
32
|
+
- - ">="
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: 0.1.2
|
34
35
|
type: :runtime
|
35
36
|
prerelease: false
|
36
|
-
version_requirements:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.1.2
|
37
42
|
- !ruby/object:Gem::Dependency
|
38
43
|
name: ruby-netcdf-updated
|
39
|
-
requirement:
|
40
|
-
none: false
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
41
45
|
requirements:
|
42
|
-
- -
|
46
|
+
- - ">="
|
43
47
|
- !ruby/object:Gem::Version
|
44
48
|
version: 0.6.6.1
|
45
49
|
type: :runtime
|
46
50
|
prerelease: false
|
47
|
-
version_requirements:
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 0.6.6.1
|
48
56
|
- !ruby/object:Gem::Dependency
|
49
57
|
name: shoulda
|
50
|
-
requirement:
|
51
|
-
none: false
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
52
59
|
requirements:
|
53
|
-
- -
|
60
|
+
- - ">="
|
54
61
|
- !ruby/object:Gem::Version
|
55
62
|
version: '0'
|
56
63
|
type: :development
|
57
64
|
prerelease: false
|
58
|
-
version_requirements:
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
59
70
|
- !ruby/object:Gem::Dependency
|
60
71
|
name: rdoc
|
61
|
-
requirement:
|
62
|
-
none: false
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
63
73
|
requirements:
|
64
|
-
- - ~>
|
74
|
+
- - "~>"
|
65
75
|
- !ruby/object:Gem::Version
|
66
76
|
version: '3.12'
|
67
77
|
type: :development
|
68
78
|
prerelease: false
|
69
|
-
version_requirements:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '3.12'
|
70
84
|
- !ruby/object:Gem::Dependency
|
71
85
|
name: bundler
|
72
|
-
requirement:
|
73
|
-
none: false
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
74
87
|
requirements:
|
75
|
-
- -
|
88
|
+
- - ">"
|
76
89
|
- !ruby/object:Gem::Version
|
77
90
|
version: 1.0.0
|
78
91
|
type: :development
|
79
92
|
prerelease: false
|
80
|
-
version_requirements:
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.0.0
|
81
98
|
- !ruby/object:Gem::Dependency
|
82
99
|
name: jeweler
|
83
|
-
requirement:
|
84
|
-
none: false
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
85
101
|
requirements:
|
86
|
-
- -
|
102
|
+
- - ">="
|
87
103
|
- !ruby/object:Gem::Version
|
88
104
|
version: 1.8.4
|
89
105
|
type: :development
|
90
106
|
prerelease: false
|
91
|
-
version_requirements:
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 1.8.4
|
92
112
|
description: GS2 is a gyrokinetic flux tube initial value turbulence code which can
|
93
113
|
be used for fusion or astrophysical plasmas. CodeRunner is a framework for the automated
|
94
114
|
running and analysis of large simulations. This module allows GS2 (and its sister
|
@@ -102,7 +122,7 @@ extra_rdoc_files:
|
|
102
122
|
- README.md
|
103
123
|
- README.rdoc
|
104
124
|
files:
|
105
|
-
- .document
|
125
|
+
- ".document"
|
106
126
|
- Gemfile
|
107
127
|
- LICENSE.txt
|
108
128
|
- README.md
|
@@ -165,26 +185,25 @@ files:
|
|
165
185
|
homepage: http://gs2crmod.sourceforge.net
|
166
186
|
licenses:
|
167
187
|
- GSLv3
|
188
|
+
metadata: {}
|
168
189
|
post_install_message:
|
169
190
|
rdoc_options: []
|
170
191
|
require_paths:
|
171
192
|
- lib
|
172
193
|
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
-
none: false
|
174
194
|
requirements:
|
175
|
-
- -
|
195
|
+
- - ">="
|
176
196
|
- !ruby/object:Gem::Version
|
177
197
|
version: 1.9.1
|
178
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
-
none: false
|
180
199
|
requirements:
|
181
|
-
- -
|
200
|
+
- - ">="
|
182
201
|
- !ruby/object:Gem::Version
|
183
202
|
version: '0'
|
184
203
|
requirements: []
|
185
204
|
rubyforge_project:
|
186
|
-
rubygems_version:
|
205
|
+
rubygems_version: 2.2.1
|
187
206
|
signing_key:
|
188
|
-
specification_version:
|
207
|
+
specification_version: 4
|
189
208
|
summary: Module to allow CodeRunner to run and analyse the GS2 and AstroGK codes.
|
190
209
|
test_files: []
|