FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Aether/include/inputs.h at refs/heads/develop · AetherModel/Aether · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
AetherModel
/
Aether
Public
Notifications
You must be signed in to change notification settings
Fork
31
Star
27
Code
Issues
21
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Aether
/
include
/
inputs.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
815 lines (655 loc) · 22.3 KB
Breadcrumbs
Aether
/
include
/
inputs.h
Copy path
File metadata and controls
815 lines (655 loc) · 22.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
//
Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
//
Full license can be found in License.md
#
ifndef
INCLUDE_INPUTS_H_
#
define
INCLUDE_INPUTS_H_
#
include
<
vector
>
#
include
<
string
>
/*
This is the input class for Aether. It handles all of the specification of
parameters and inputs into Aether. Some major features:
- Aether handles a lot of inputs and outputs in json and CSV files
- The settings variable is the main variable for controlling the settings
- The settings variable is a json (like a python dictionary)
- This class uses public "get" functions to access settings, which are private
- The get functions have a naming standard that depends on the structure of the json
*/
class
Inputs
{
public:
int
iVerbose;
int
iVerboseProc;
int
iTimingDepth;
//
------------------------------
//
Grid inputs:
struct
grid_input_struct
{
//
Set the grid size (per block)
//
nX is nLonsPerBlock or nXsPerBlock
//
nY is nLatsPerBlock or nYsPerBlock
//
nZ is nAlts or nZs
int64_t
nX, nY, nZ;
//
min and max latitude to simulate:
precision_t
lat_min, lat_max;
//
min and max longitude to simulate:
precision_t
lon_min, lon_max;
//
The shape of the grid can be specified:
//
- "sphere", sets grid.iGridShape_ = iSphere_
//
- "cubesphere", sets grid.iGridShape_ = iCubesphere_
//
- "dipole", sets grid.iGridShape_ = iDipole_
std::string shape;
//
Minimum altitude to simulate:
precision_t
alt_min;
//
Some grids allow the specification of the maximum altitude:
precision_t
alt_max;
//
Can specify the delta-altitude in either km or in scale-heights.
//
daltKm is used if there is a uniform grid
//
daltScale (0-1, typical) is used non-uniform
precision_t
daltKm, daltScale;
//
if IsUniformAlt is false, the code uses a temperature profile to
//
build an altitude profile of scale heights and uses these scale
//
heights to build the grid.
bool
IsUniformAlt;
//
Only needed for Mag Field grid:
//
min_apex (not used) and LatStretch is used
//
as lat = min_lat + dlat where dlat = acos(cos(lat^stretch))^(1/stretch)
precision_t
min_apex, LatStretch, FieldLineStretch, max_blat;
//
Some grid shapes allow specification of altitudes based on a file:
std::string alt_file;
};
grid_input_struct
get_grid_inputs
(std::string gridtype);
/*
*********************************************************************
\brief
\param
*
*/
Inputs
() {}
/*
*********************************************************************
\brief
\param
*
*/
Inputs
(Times &time);
/*
*********************************************************************
\brief
\param
*
*/
int
read
(Times &time);
/*
*********************************************************************
\brief
\param
*
*/
bool
read_inputs_json
(Times &time);
/*
*********************************************************************
\brief
\param
*
*/
bool
set_verbose
(json in);
//
--------------------------------------------------------------------
//
get functions:
//
- These functions offer access to specific parts of the settings json.
//
- They call the general functions that check whether the key(s) exists.
//
- If the key does not exist, an error flag (in report) is set.
//
-
//
--------------------------------------------------------------------
//
---------------------
//
Debugging information
//
---------------------
/*
*********************************************************************
\brief returns settings["Debug"]["iVerbose"]
\param none
*
*/
int
get_verbose
();
/*
*********************************************************************
\brief returns settings["Debug"]["iProc"]
\param none
*
*/
int
get_verbose_proc
();
/*
*********************************************************************
\brief returns settings["Debug"]["dt"]
\param none
*
*/
precision_t
get_dt_report
();
//
---------------------
//
Output information
//
---------------------
/*
*********************************************************************
\brief returns the size of settings["Outputs"]["type"]
\param none
*
*/
precision_t
get_n_outputs
();
/*
*********************************************************************
\brief returns settings["Outputs"]["dt"][iOutput]
\param iOutput int specifying which output file type to report on
*
*/
precision_t
get_dt_output
(
int
iOutput);
/*
*********************************************************************
\brief returns settings["Outputs"]["type"][iOutput]
\param iOutput int specifying which output file type to report on
*
*/
std::string
get_type_output
(
int
iOutput);
/*
*********************************************************************
\brief returns settings["Euv"]["dt"]
\param none
*
*/
precision_t
get_dt_euv
();
/*
*********************************************************************
\brief returns settings["Euv"]["IncludePhotoElectrons"]
\param none
*
*/
bool
get_include_photoelectrons
();
/*
*********************************************************************
\brief returns settings["Electrodynamics"]["DiffuseAurora"]
\param none
*
*/
std::string
get_diffuse_auroral_model
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_potential_model
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_electrodynamics_dir
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_electrodynamics_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_electrodynamics_north_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_electrodynamics_south_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
precision_t
get_euv_heating_eff_neutrals
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_euv_model
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_euv_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_euv_fismfile
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_euv_douse
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_aurora_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_chemistry_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_indices_lookup_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::vector<std::string>
get_omniweb_files
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
int
get_number_of_omniweb_files
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_f107_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_planet
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_planetary_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_planet_species_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_collision_file
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_do_calc_bulk_ion_temp
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
precision_t
get_eddy_coef
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
precision_t
get_eddy_bottom
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
precision_t
get_eddy_top
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_use_eddy_momentum
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_use_eddy_energy
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_bfield_type
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_do_restart
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_restartout_dir
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_restartin_dir
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
precision_t
get_dt_write_restarts
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
int
get_original_seed
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
int
get_updated_seed
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
void
set_seed
(
int
seed);
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
write_restart
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
json
get_perturb_values
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_do_lat_dependent_radius
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_do_J2
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_check_for_nans
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_nan_test
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_nan_test_variable
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_is_cubesphere
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_NO_cooling
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_O_cooling
();
/*
*********************************************************************
\brief returns settings["Sources"]["Ions"]["IncludePhotoElectronHeating"]
\param none
*
*/
bool
get_do_photoelectron_heating
();
/*
*********************************************************************
\brief returns settings["Sources"]["Ions"]["IncludeIonizationHeating"]
\param none
*
*/
bool
get_do_ionization_heating
();
/*
*********************************************************************
\brief returns settings["Sources"]["Ions"]["IncludeElectronIonCollisionalHeating"]
\param none
*
*/
bool
get_do_electron_ion_collisional_heating
();
/*
*********************************************************************
\brief returns settings["Sources"]["Ions"]["IncludeElectronNeutralElasticCollisionalHeating"]
\param none
*
*/
bool
get_do_electron_neutral_elastic_collisional_heating
();
/*
*********************************************************************
\brief returns settings["Sources"]["Ions"]["IncludeElectronNeutralInelasticCollisionalHeating"]
\param none
*
*/
bool
get_do_electron_neutral_inelastic_collisional_heating
();
/*
*********************************************************************
\brief returns settings["Sources"]["Ions"]["IncludeThermoelectricHeating"]
\param none
*
*/
bool
get_do_thermoelectric_heating
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_use_centripetal
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_use_coriolis
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_cent_acc
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_student_name
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_is_student
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
json
get_initial_condition_types
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
json
get_boundary_condition_types
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_advection_neutrals_vertical
();
std::string
get_advection_neutrals_horizontal
();
bool
get_advection_neutrals_bulkwinds
();
bool
get_advection_neutrals_implicitfriction
();
std::string
get_advection_ions_along
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
int
get_nLons
(std::string gridtype);
/*
*********************************************************************
\brief returns settings["
\param
*
*/
int
get_nLats
(std::string gridtype);
/*
*********************************************************************
\brief returns settings["
\param
*
*/
int
get_nAlts
(std::string gridtype);
/*
*********************************************************************
\brief returns settings[gridtype, "shape"]
\param
*
*/
std::string
get_grid_shape
(std::string gridtype);
/*
*********************************************************************
\brief returns settings["
\param
*
*/
int
get_nMembers
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_logfile
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::string
get_logfile
(
int64_t
iLog);
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::vector<std::string>
get_species_vector
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
bool
get_logfile_append
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
precision_t
get_logfile_dt
();
//
Satellites
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::vector<std::string>
get_satellite_files
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::vector<std::string>
get_satellite_names
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
std::vector<
precision_t
>
get_satellite_dts
();
/*
*********************************************************************
\brief returns settings["
\param
*
*/
json
get_tests
();
//
General get_setting functions with error checks:
/*
*********************************************************************
\brief
\param
*
*/
std::string
get_setting_str
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
std::string
get_setting_str
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
std::string
get_setting_str
(std::string key1,
std::string key2,
std::string key3);
/*
*********************************************************************
\brief
\param
*
*/
json
get_setting_json
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
json
get_setting_json
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
bool
get_setting_bool
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
bool
get_setting_bool
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
bool
get_setting_bool
(std::string key1, std::string key2, std::string key3);
/*
*********************************************************************
\brief
\param
*
*/
precision_t
get_setting_float
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
precision_t
get_setting_float
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
int64_t
get_setting_int
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
int64_t
get_setting_int
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
std::vector<
int
>
get_setting_intarr
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
std::vector<
int
>
get_setting_intarr
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
std::vector<
int
>
get_setting_timearr
(std::string key1);
//
Check settings functions:
/*
*********************************************************************
\brief
\param
*
*/
bool
check_settings
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
bool
check_settings
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
std::string
check_settings_str
(std::string key1);
/*
*********************************************************************
\brief
\param
*
*/
std::string
check_settings_str
(std::string key1, std::string key2);
/*
*********************************************************************
\brief
\param
*
*/
precision_t
check_settings_pt
(std::string key1, std::string key2);
/*
*********************************************************************
\brief Check to see if internal state of class is ok
*
*/
bool
is_ok
();
private:
//
This is the main variable that contains all of the settings in Aether:
json settings;
//
These are a bunch of misc strings that should go away:
std::string euv_file =
"
UA/inputs/euv.csv
"
;
std::string aurora_file =
"
UA/inputs/aurora_earth.csv
"
;
std::string chemistry_file =
"
UA/inputs/chemistry_earth.csv
"
;
std::string collision_file =
"
UA/inputs/ion_neutral_collision_frequencies.csv
"
;
std::string input_file =
"
aether.in
"
;
std::string euv_model =
"
euvac
"
;
std::string planetary_file =
"
UA/inputs/orbits.csv
"
;
std::vector<std::string> omniweb_files;
std::string planet =
"
earth
"
;
std::string f107_file =
"
"
;
std::string planet_species_file =
"
"
;
std::string electrodynamics_file =
"
"
;
std::string bfield =
"
none
"
;
grid_input_struct geo_grid_input;
precision_t
euv_heating_eff_neutrals;
precision_t
euv_heating_eff_electrons;
std::vector<
float
> dt_output;
std::vector<std::string> type_output;
std::string output_directory =
"
UA/output
"
;
std::string restart_out_directory =
"
UA/restartOut
"
;
std::string restart_in_directory =
"
UA/restartIn
"
;
bool
DoRestart;
precision_t
dt_euv;
precision_t
dt_report;
int
nLonsGeo;
int
nLatsGeo;
int
nAltsGeo;
int
updated_seed;
//
/ An internal variable to hold the state of the class
bool
isOk;
std::vector<std::string> missing_settings;
};
//
This makes the input variable a global variable, so it can be used
//
without passing it to every function. This is done because the
//
input class is needed by almost all functions within Aether
extern
Inputs input;
#
endif
//
INCLUDE_INPUTS_H_
Back
|
FazBrowse Home
|
New Git URL