@@ -24,7 +24,6 @@ int main() {
24
24
try {
25
25
// Create inputs (reading the input file):
26
26
input = Inputs (time);
27
-
28
27
if (!input.is_ok ())
29
28
throw std::string (" input initialization failed!" );
30
29
@@ -37,57 +36,48 @@ int main() {
37
36
// cubesphere (6 root)
38
37
Quadtree quadtree (input.get_grid_shape (" neuGrid" ));
39
38
Quadtree quadtree_ion (input.get_grid_shape (" ionGrid" ));
40
-
41
39
if (!quadtree.is_ok ())
42
40
throw std::string (" quadtree initialization failed!" );
43
41
44
42
// Initialize MPI and parallel aspects of the code:
45
43
didWork = init_parallel (quadtree, quadtree_ion);
46
-
47
44
if (!didWork)
48
45
throw std::string (" init_parallel failed!" );
49
46
50
47
// Everything should be set for the inputs now, so write a restart file:
51
48
didWork = input.write_restart ();
52
-
53
49
if (!didWork)
54
50
throw std::string (" input.write_restart failed!" );
55
51
56
52
// Initialize the EUV system:
57
53
Euv euv;
58
-
59
54
if (!euv.is_ok ())
60
55
throw std::string (" EUV initialization failed!" );
61
56
62
57
// Initialize the planet:
63
58
Planets planet;
64
- MPI_Barrier (aether_comm);
65
-
66
59
if (!planet.is_ok ())
67
60
throw std::string (" planet initialization failed!" );
68
61
69
62
// Initialize the indices, read the files, and perturb:
70
63
Indices indices;
71
64
didWork = read_and_store_indices (indices);
72
- MPI_Barrier (aether_comm);
73
-
74
65
if (!didWork)
75
66
throw std::string (" read_and_store_indices failed!" );
76
67
77
68
// Perturb the inputs if user has asked for this
78
69
indices.perturb ();
79
- MPI_Barrier (aether_comm);
80
70
81
71
// Initialize Geographic grid:
82
72
Grid gGrid (" neuGrid" );
83
73
didWork = gGrid .init_geo_grid (quadtree, planet);
84
- MPI_Barrier (aether_comm);
85
-
86
74
if (!didWork)
87
75
throw std::string (" init_geo_grid failed!" );
88
76
89
77
// Find interpolation coefs for the ghostcells if cubesphere grid
90
- didWork = find_ghostcell_interpolation_coefs (gGrid );
78
+ // didWork = find_ghostcell_interpolation_coefs(gGrid);
79
+ // if (!didWork)
80
+ // throw std::string("find_ghostcell_interpolation_coefs failed!");
91
81
92
82
// Calculate centripetal acceleration, since this is a constant
93
83
// vector on the grid:
@@ -107,14 +97,13 @@ int main() {
107
97
didWork = mGrid .init_geo_grid (quadtree, planet);
108
98
mGrid .set_IsGeoGrid (false );
109
99
}
110
- // Initialize Neutrals on geographic grid:
100
+
101
+ // Initialize Neutrals on geographic and magnetic grids:
111
102
Neutrals neutrals (gGrid , planet, time, indices);
112
- // Initialize Neutrals on magnetic grid:
113
103
Neutrals neutralsMag (mGrid , planet, time, indices);
114
104
115
- // Initialize Ions on geographic grid :
105
+ // Initialize Ions on geographic and magnetic grids :
116
106
Ions ions (gGrid , planet);
117
- // Initialize Ions on magnetic grid:
118
107
Ions ionsMag (mGrid , planet);
119
108
120
109
// -----------------------------------------------------------------
@@ -151,9 +140,8 @@ int main() {
151
140
read_collision_file (neutrals, ions);
152
141
read_collision_file (neutralsMag, ionsMag);
153
142
154
- // Initialize ion temperatures from neutral temperature
143
+ // Initialize ion temperatures from neutral temperature (both grids)
155
144
ions.init_ion_temperature (neutrals, gGrid );
156
- // Initialize ion temperatures from neutral temperature (on Mag Grid)
157
145
ionsMag.init_ion_temperature (neutralsMag, mGrid );
158
146
159
147
// Initialize electrodynamics and check if electrodynamics times
@@ -239,12 +227,14 @@ int main() {
239
227
if (!time.check_time_gate (input.get_dt_write_restarts ())) {
240
228
report.print (3 , " Writing restart files" );
241
229
242
- didWork = neutrals.restart_file (input.get_restartout_dir (), DoWrite);
230
+ didWork = neutrals.restart_file (input.get_restartout_dir (), gGrid .get_gridtype (), DoWrite);
231
+ didWork = neutralsMag.restart_file (input.get_restartout_dir (), mGrid .get_gridtype (), DoWrite);
243
232
244
233
if (!didWork)
245
234
throw std::string (" Writing Restart for Neutrals Failed!!!\n " );
246
235
247
- didWork = ions.restart_file (input.get_restartout_dir (), DoWrite);
236
+ didWork = ions.restart_file (input.get_restartout_dir (), gGrid .get_gridtype (), DoWrite);
237
+ didWork = ionsMag.restart_file (input.get_restartout_dir (), mGrid .get_gridtype (), DoWrite);
248
238
249
239
if (!didWork)
250
240
throw std::string (" Writing Restart for Ions Failed!!!\n " );
0 commit comments