gs2crmod 0.12.9 → 0.12.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +13 -1
- data/VERSION +1 -1
- data/gs2crmod.gemspec +5 -7
- data/lib/gs2crmod/calculations.rb +94 -131
- data/lib/gs2crmod/graphs.rb +2332 -2342
- data/lib/gs2crmod/gs2.rb +31 -40
- data/lib/gs2crmod/gsl_data.rb +320 -326
- metadata +40 -22
- checksums.yaml +0 -7
data/lib/gs2crmod/gs2.rb
CHANGED
@@ -100,51 +100,51 @@ eval(%[
|
|
100
100
|
@results = [
|
101
101
|
:converged,
|
102
102
|
:decaying,
|
103
|
+
:es_heat_flux_stav_error,
|
104
|
+
:es_heat_flux_stav_std_dev,
|
105
|
+
:es_mom_flux_stav_error,
|
106
|
+
:es_mom_flux_stav_std_dev,
|
107
|
+
:es_part_flux_stav_error,
|
108
|
+
:es_part_flux_stav_std_dev,
|
109
|
+
:es_heat_flux_stav,
|
110
|
+
:es_mom_flux_stav,
|
111
|
+
:es_part_flux_stav,
|
112
|
+
:frequency_at_ky_at_kx,
|
113
|
+
:fastest_growing_mode,
|
114
|
+
:freq_of_max_growth_rate,
|
115
|
+
:gamma_r,
|
116
|
+
:gamma_i,
|
103
117
|
:growth_rates,
|
104
|
-
:real_frequencies,
|
105
118
|
:growth_rates_by_ky, # deprecated
|
106
119
|
:growth_rates_by_kx, # deprecated
|
107
120
|
:growth_rate_at_ky,
|
108
121
|
:growth_rate_at_kx,
|
109
122
|
:growth_rate_at_ky_at_kx,
|
110
|
-
:frequency_at_ky_at_kx,
|
111
|
-
:real_frequencies_by_ky,
|
112
|
-
:max_growth_rate,
|
113
|
-
:fastest_growing_mode,
|
114
|
-
:freq_of_max_growth_rate,
|
115
|
-
:ky,
|
116
|
-
:gamma_r,
|
117
|
-
:gamma_i,
|
118
|
-
:run_time,
|
119
123
|
:hflux_tot_stav,
|
120
|
-
:phi2_tot_stav,
|
121
|
-
:saturation_time_index,
|
122
|
-
:es_heat_flux_stav,
|
123
|
-
:es_mom_flux_stav,
|
124
|
-
:es_part_flux_stav,
|
125
124
|
:hflux_tot_stav_error,
|
126
125
|
:hflux_tot_stav_std_dev,
|
127
|
-
:
|
128
|
-
:es_heat_flux_stav_std_dev,
|
129
|
-
:es_mom_flux_stav_error,
|
130
|
-
:es_mom_flux_stav_std_dev,
|
131
|
-
:es_part_flux_stav_error,
|
132
|
-
:es_part_flux_stav_std_dev,
|
133
|
-
:saturated,
|
134
|
-
:shot_time,
|
135
|
-
:spectrum_check,
|
126
|
+
:ky,
|
136
127
|
:ky_spectrum_peak_idx,
|
137
128
|
:ky_spectrum_peak_ky,
|
138
129
|
:ky_spectrum_peak_phi2,
|
139
130
|
:kx_spectrum_peak_kx,
|
140
131
|
:kx_spectrum_peak_phi2,
|
132
|
+
:max_growth_rate,
|
133
|
+
:max_transient_amplification_index_at_ky,
|
134
|
+
:phi2_tot_stav,
|
141
135
|
:par_mom_flux_stav,
|
142
136
|
:perp_mom_flux_stav,
|
143
137
|
:phi2_zonal,
|
138
|
+
:run_time,
|
139
|
+
:real_frequencies,
|
140
|
+
:real_frequencies_by_ky,
|
141
|
+
:saturation_time_index,
|
142
|
+
:saturated,
|
143
|
+
:shot_time,
|
144
|
+
:spectrum_check,
|
144
145
|
:transient_amplification_at_kx,
|
145
146
|
:transient_amplification_at_ky,
|
146
147
|
:transient_amplification_at_ky_at_kx,
|
147
|
-
:max_transient_amplification_index_at_ky,
|
148
148
|
:transient_es_heat_flux_amplification_at_species_at_kx,
|
149
149
|
:transient_es_heat_flux_amplification_at_species_at_ky,
|
150
150
|
:transient_es_heat_flux_amplification_at_species_at_ky_at_kx,
|
@@ -238,12 +238,9 @@ end
|
|
238
238
|
def calculate_results
|
239
239
|
return if ENV['CODE_RUNNER_NO_ANALYSIS'] =~ /true/
|
240
240
|
|
241
|
-
|
242
241
|
eputs "Analysing run"
|
243
242
|
|
244
243
|
if @nonlinear_mode == "off"
|
245
|
-
|
246
|
-
calculate_growth_rates_and_frequencies
|
247
244
|
calculate_transient_amplifications
|
248
245
|
elsif @nonlinear_mode == "on"
|
249
246
|
calculate_saturation_time_index
|
@@ -259,7 +256,6 @@ def calculate_results
|
|
259
256
|
@real_frequencies ||={}
|
260
257
|
end
|
261
258
|
|
262
|
-
|
263
259
|
# Try to read the runtime in minutes from the GS2 standard out.
|
264
260
|
|
265
261
|
def get_run_time
|
@@ -281,7 +277,6 @@ end
|
|
281
277
|
# ncdump([:hflux, :phi])
|
282
278
|
# ncdump([:hflux, :phi], :dims)
|
283
279
|
|
284
|
-
|
285
280
|
def ncdump(names=nil, values=nil, extension = '.out.nc')
|
286
281
|
names = [names] unless !names or names.class == Array
|
287
282
|
names.map!{|name| name.to_s} if names
|
@@ -1323,16 +1318,14 @@ class Hash
|
|
1323
1318
|
# puts self
|
1324
1319
|
|
1325
1320
|
def convert_to_index(run, *names)
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1321
|
+
if self[:strongest_non_zonal_mode]
|
1322
|
+
ky_element, kx_element = run.gsl_matrix('spectrum_over_ky_over_kx', no_zonal: true).max_index
|
1323
|
+
p self[:kx_index] = kx_element + 1
|
1324
|
+
p self[:ky_index] = ky_element + 1
|
1325
|
+
self[:strongest_non_zonal_mode] = false
|
1326
|
+
end
|
1332
1327
|
raise "No names specified" if names.size == 0
|
1333
1328
|
|
1334
|
-
|
1335
|
-
# ep run
|
1336
1329
|
names.each do |name|
|
1337
1330
|
if name == :kx
|
1338
1331
|
if lkx = self[:lagrangian_kx]
|
@@ -1343,10 +1336,8 @@ class Hash
|
|
1343
1336
|
end
|
1344
1337
|
end
|
1345
1338
|
|
1346
|
-
#ep 'name', name
|
1347
1339
|
self[:ky_index] = 1 if name == :ky and run.grid_option == "single"
|
1348
1340
|
self[:kx_index] = 1 if name == :kx and run.grid_option == "single"
|
1349
|
-
# ep run.list(name)
|
1350
1341
|
self[name + :_index] ||= run.list(name).key(self[name]) || (raise ("#{name} not specified"))
|
1351
1342
|
end
|
1352
1343
|
|