Line data Source code
1 : ! ***********************************************************************
2 : !
3 : ! Copyright (C) 2010 The MESA Team
4 : !
5 : ! This program is free software: you can redistribute it and/or modify
6 : ! it under the terms of the GNU Lesser General Public License
7 : ! as published by the Free Software Foundation,
8 : ! either version 3 of the License, or (at your option) any later version.
9 : !
10 : ! This program is distributed in the hope that it will be useful,
11 : ! but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 : ! See the GNU Lesser General Public License for more details.
14 : !
15 : ! You should have received a copy of the GNU Lesser General Public License
16 : ! along with this program. If not, see <https://www.gnu.org/licenses/>.
17 : !
18 : ! ***********************************************************************
19 :
20 : module init
21 :
22 : use star_private_def
23 : use const_def, only: dp, msun, secyer
24 :
25 : implicit none
26 :
27 : private
28 : public :: alloc_star_data
29 : public :: set_starting_star_data
30 : public :: do_star_init
31 : public :: do_starlib_shutdown
32 : public :: set_kap_and_eos_handles
33 : public :: set_colors_handles
34 : public :: load_zams_model
35 : public :: create_pre_ms_model
36 : public :: create_initial_model
37 : public :: create_RSP_model
38 : public :: create_RSP2_model
39 : public :: doing_restart
40 : public :: load_restart_photo
41 : public :: load_saved_model
42 : public :: do_garbage_collection
43 :
44 : integer, parameter :: do_create_pre_ms_model = 0
45 : integer, parameter :: do_load_zams_model = 1
46 : integer, parameter :: do_load_saved_model = 2
47 : integer, parameter :: do_create_initial_model = 3
48 : integer, parameter :: do_create_RSP_model = 4
49 : integer, parameter :: do_create_RSP2_model = 5
50 :
51 : logical :: have_done_starlib_init = .false.
52 :
53 : contains
54 :
55 1 : subroutine set_kap_and_eos_handles(id, ierr)
56 : use kap_lib, only: alloc_kap_handle_using_inlist, kap_ptr
57 : use eos_lib, only: alloc_eos_handle_using_inlist, eos_ptr
58 : integer, intent(in) :: id
59 : integer, intent(out) :: ierr ! 0 means AOK.
60 : type (star_info), pointer :: s
61 1 : call get_star_ptr(id, s, ierr)
62 1 : if (ierr /= 0) then
63 0 : write(*,*) 'get_star_ptr failed in alloc_eos_handle'
64 0 : return
65 : end if
66 1 : if (s% eos_handle == 0) then
67 1 : s% eos_handle = alloc_eos_handle_using_inlist(s% inlist_fname, ierr)
68 1 : if (ierr /= 0) then
69 0 : write(*,*) 'set_kap_and_eos_handles failed in alloc_eos_handle_using_inlist'
70 0 : return
71 : end if
72 1 : call eos_ptr(s% eos_handle, s% eos_rq, ierr)
73 1 : if (ierr /= 0) then
74 0 : write(*,*) 'eos_ptr failed in alloc_eos_handle'
75 0 : return
76 : end if
77 : end if
78 1 : if (s% kap_handle == 0) then
79 1 : s% kap_handle = alloc_kap_handle_using_inlist(s% inlist_fname, ierr)
80 1 : if (ierr /= 0) then
81 0 : write(*,*) 'set_kap_and_eos_handles failed in alloc_kap_handle_using_inlist'
82 0 : return
83 : end if
84 1 : call kap_ptr(s% kap_handle,s% kap_rq,ierr)
85 1 : if (ierr /= 0) then
86 0 : write(*,*) 'kap_ptr failed in alloc_kap_handle'
87 0 : return
88 : end if
89 : end if
90 : end subroutine set_kap_and_eos_handles
91 :
92 :
93 1 : subroutine set_colors_handles(id, ierr)
94 : use colors_lib, only: alloc_colors_handle_using_inlist, colors_ptr
95 : use colors_def, only: Colors_General_Info
96 : integer, intent(in) :: id
97 : integer, intent(out) :: ierr ! 0 means AOK.
98 : type (star_info), pointer :: s
99 : type(Colors_General_Info), pointer :: colors_settings
100 1 : call get_star_ptr(id, s, ierr)
101 1 : if (ierr /= 0) then
102 0 : write(*,*) 'get_star_ptr failed in alloc_colors_handle'
103 0 : return
104 : end if
105 1 : if (s% colors_handle == 0) then
106 1 : s% colors_handle = alloc_colors_handle_using_inlist(s% inlist_fname, ierr)
107 1 : if (ierr /= 0) then
108 0 : write(*,*) 'set_colors_handles failed in alloc_colors_handle'
109 0 : return
110 : end if
111 1 : call colors_ptr(s% colors_handle, colors_settings, ierr)
112 1 : if (ierr /= 0) then
113 0 : write(*,*) 'colors_ptr failed in alloc_colors_handle'
114 0 : return
115 : end if
116 : end if
117 : end subroutine set_colors_handles
118 :
119 2 : subroutine do_star_init( &
120 : my_mesa_dir, chem_isotopes_filename, &
121 : net_reaction_filename, jina_reaclib_filename, &
122 : use_suzuki_weak_rates, &
123 : use_special_weak_rates, special_weak_states_file, special_weak_transitions_file, &
124 : reaclib_min_T9, &
125 : rate_tables_dir, rates_cache_suffix, &
126 : ionization_file_prefix, ionization_Z1_suffix, &
127 : eosDT_cache_dir, &
128 : ionization_cache_dir, kap_cache_dir, rates_cache_dir, &
129 : ierr)
130 : use paquette_coeffs, only: initialise_collision_integrals
131 : use alloc, only: init_alloc
132 : character (len=*), intent(in) :: &
133 : my_mesa_dir, chem_isotopes_filename, net_reaction_filename, &
134 : jina_reaclib_filename, rate_tables_dir, &
135 : special_weak_states_file, special_weak_transitions_file, &
136 : rates_cache_suffix, &
137 : ionization_file_prefix, ionization_Z1_suffix, &
138 : eosDT_cache_dir, &
139 : ionization_cache_dir, kap_cache_dir, rates_cache_dir
140 : logical, intent(in) :: use_suzuki_weak_rates, use_special_weak_rates
141 : real(dp), intent(in) :: reaclib_min_T9
142 : integer, intent(out) :: ierr
143 : include 'formats'
144 1 : ierr = 0
145 1 : if (have_done_starlib_init) return
146 1 : call initialise_collision_integrals
147 1 : call init_alloc
148 : call stardata_init( &
149 : my_mesa_dir, chem_isotopes_filename, &
150 : net_reaction_filename, jina_reaclib_filename, &
151 : use_suzuki_weak_rates, &
152 : use_special_weak_rates, special_weak_states_file, special_weak_transitions_file, &
153 : reaclib_min_T9, &
154 : rate_tables_dir, rates_cache_suffix, &
155 : ionization_file_prefix, ionization_Z1_suffix, &
156 : eosDT_cache_dir, &
157 : ionization_cache_dir, kap_cache_dir, rates_cache_dir, &
158 1 : ierr)
159 1 : if (ierr /= 0) then
160 0 : write(*,*) 'failed in stardata_init'
161 0 : return
162 : end if
163 :
164 1 : have_done_starlib_init = .true.
165 :
166 : end subroutine do_star_init
167 :
168 :
169 1 : subroutine do_starlib_shutdown
170 :
171 : use alloc, only: shutdown_alloc
172 : use micro, only: shutdown_microphys
173 : use atm_lib, only: atm_shutdown
174 : use colors_lib, only: colors_shutdown
175 : use chem_lib, only: chem_shutdown
176 : use rates_lib, only: rates_shutdown
177 : use star_profile_def, only: profile_column_names_shutdown
178 : use star_history_def, only: history_column_names_shutdown
179 : use paquette_coeffs, only: free_collision_integrals
180 :
181 1 : call rates_shutdown()
182 1 : call atm_shutdown()
183 1 : call shutdown_microphys()
184 1 : call colors_shutdown()
185 1 : call chem_shutdown()
186 1 : call profile_column_names_shutdown()
187 1 : call history_column_names_shutdown()
188 :
189 1 : call free_collision_integrals()
190 :
191 1 : call shutdown_alloc()
192 :
193 1 : have_done_starlib_init = .false.
194 :
195 1 : end subroutine do_starlib_shutdown
196 :
197 :
198 2 : subroutine alloc_star_data(id, ierr)
199 : use chem_def, only: num_categories
200 : use net, only: default_set_rate_factors, &
201 : default_set_op_mono_factors
202 :
203 :
204 : integer, intent(out) :: id, ierr
205 :
206 : type (star_info), pointer :: s
207 : integer, parameter :: init_alloc_nvar = 20
208 : character (len=32) :: extra_name
209 : integer :: i
210 :
211 : ierr = 0
212 :
213 2 : call alloc_star(id, ierr)
214 2 : if (ierr /= 0) then
215 0 : write(*,*) 'alloc_star_data failed in alloc_star'
216 0 : return
217 : end if
218 :
219 2 : call get_star_ptr(id, s, ierr)
220 2 : if (ierr /= 0) then
221 0 : write(*,*) 'alloc_star_data failed in get_star_ptr'
222 0 : return
223 : end if
224 :
225 2 : nullify(s% dq)
226 2 : nullify(s% xa)
227 2 : nullify(s% xh)
228 :
229 : nullify( &
230 2 : s% op_mono_umesh1, s% op_mono_semesh1, s% op_mono_ff1, &
231 2 : s% op_mono_rs1)
232 :
233 2 : nullify(s% atm_structure)
234 2 : s% atm_structure_num_pts = 0
235 :
236 2 : nullify(s% chem_id)
237 2 : nullify(s% xa_removed)
238 :
239 2 : nullify(s% rate_factors)
240 2 : s% set_rate_factors => default_set_rate_factors
241 :
242 2 : nullify(s% op_mono_factors)
243 2 : s% set_op_mono_factors => default_set_op_mono_factors
244 :
245 2 : allocate(s% nameofvar(init_alloc_nvar),stat=ierr)
246 2 : if (ierr /= 0) return
247 :
248 2 : allocate(s% nameofequ(init_alloc_nvar),stat=ierr)
249 2 : if (ierr /= 0) return
250 :
251 2 : nullify(s% history_values)
252 2 : nullify(s% history_value_is_integer)
253 2 : nullify(s% history_names)
254 2 : nullify(s% history_names_dict)
255 :
256 2 : nullify(s% prev_mesh_xh)
257 2 : nullify(s% prev_mesh_xa)
258 2 : nullify(s% prev_mesh_j_rot)
259 2 : nullify(s% prev_mesh_omega)
260 2 : nullify(s% prev_mesh_dq)
261 :
262 2 : nullify(s% D_ST_start)
263 2 : nullify(s% prev_mesh_D_ST_start)
264 :
265 2 : nullify(s% other_star_info)
266 :
267 2 : nullify(s% bcyclic_odd_storage)
268 2 : nullify(s% bcyclic_odd_storage_qp)
269 :
270 2 : nullify(s% solver_iwork)
271 2 : nullify(s% solver_work)
272 2 : nullify(s% AF1)
273 :
274 2 : s% net_name = ''
275 2 : s% species = 0
276 2 : s% num_reactions = 0
277 :
278 2 : s% M_center = 0
279 2 : s% R_center = 0
280 2 : s% v_center = 0
281 2 : s% L_center = 0
282 :
283 2 : nullify(s% profile_column_spec)
284 2 : nullify(s% history_column_spec)
285 :
286 2 : s% num_conv_boundaries = 0
287 2 : nullify(s% conv_bdy_q)
288 2 : nullify(s% conv_bdy_loc)
289 2 : nullify(s% top_conv_bdy)
290 :
291 2 : s% num_mix_boundaries = 0
292 2 : nullify(s% mix_bdy_q)
293 2 : nullify(s% mix_bdy_loc)
294 2 : nullify(s% top_mix_bdy)
295 :
296 2 : nullify(s% burn_h_conv_region)
297 2 : nullify(s% burn_he_conv_region)
298 2 : nullify(s% burn_z_conv_region)
299 :
300 2 : s% have_burner_storage = .false.
301 2 : s% burner_num_threads = 0
302 2 : nullify(s% burner_storage)
303 :
304 2 : s% doing_timing = .false.
305 2 : s% time_evolve_step = 0
306 2 : s% time_remesh = 0
307 2 : s% time_adjust_mass = 0
308 2 : s% time_conv_premix = 0
309 2 : s% time_element_diffusion = 0
310 2 : s% time_struct_burn_mix = 0
311 2 : s% time_solver_matrix = 0
312 2 : s% time_solve_mix = 0
313 2 : s% time_solve_burn = 0
314 2 : s% time_solve_omega_mix = 0
315 2 : s% time_eos = 0
316 2 : s% time_neu_kap = 0
317 2 : s% time_nonburn_net = 0
318 2 : s% time_mlt = 0
319 2 : s% time_set_hydro_vars = 0
320 2 : s% time_set_mixing_info = 0
321 2 : s% time_total = 0
322 :
323 2 : s% timing_num_get_eos_calls = 0
324 2 : s% timing_num_solve_eos_calls = 0
325 2 : s% timing_num_get_kap_calls = 0
326 :
327 2 : s% model_profile_filename = ''
328 2 : s% most_recent_profile_filename = ''
329 :
330 2 : s% model_controls_filename = ''
331 2 : s% most_recent_controls_filename = ''
332 :
333 2 : s% most_recent_photo_name = ''
334 :
335 2 : s% doing_flash_wind = .false.
336 2 : s% doing_rlo_wind = .false.
337 :
338 2 : s% phase_of_evolution = phase_starting
339 2 : s% recent_log_header = -1000
340 :
341 2 : s% tau_base = 2d0/3d0
342 2 : s% tau_factor = 1
343 :
344 2 : s% solver_iter = 0
345 :
346 2 : s% using_gold_tolerances = .false.
347 2 : s% using_velocity_time_centering = .false.
348 :
349 2 : s% using_revised_net_name = .false.
350 2 : s% revised_net_name = ''
351 :
352 2 : s% using_revised_max_yr_dt = .false.
353 2 : s% revised_max_yr_dt = 0
354 :
355 2 : s% astero_using_revised_max_yr_dt = .false.
356 2 : s% astero_revised_max_yr_dt = 0
357 :
358 2 : s% cumulative_energy_error = 0
359 2 : s% cumulative_extra_heating = 0
360 :
361 2 : s% have_initial_energy_integrals = .false.
362 :
363 2 : s% num_solver_iterations = 0
364 2 : s% mesh_call_number = 0
365 2 : s% solver_call_number = 0
366 2 : s% diffusion_call_number = 0
367 2 : s% model_number = 0
368 2 : s% RSP_have_set_velocities = .false.
369 2 : s% RSP_just_set_velocities = .false.
370 2 : s% rsp_period = 0d0
371 :
372 2 : s% dt = 0d0
373 2 : s% mstar_dot = 0d0
374 :
375 2 : s% power_nuc_burn = -1
376 2 : s% power_h_burn = -1
377 2 : s% power_he_burn = -1
378 2 : s% power_z_burn = -1
379 2 : s% power_photo = -1
380 :
381 2 : s% k_const_mass = 1
382 2 : s% k_below_just_added = 1
383 2 : s% k_below_const_q = 1
384 :
385 2 : s% why_Tlim = Tlim_struc
386 118 : s% dt_why_count(:) = 0
387 118 : s% dt_why_retry_count(:) = 0
388 :
389 2 : s% len_extra_iwork = 0
390 2 : s% len_extra_work = 0
391 :
392 2 : s% eos_handle = 0
393 2 : s% kap_handle = 0
394 2 : s% colors_handle = 0
395 :
396 202 : do i = 1, max_num_profile_extras
397 200 : if (i < 10) then
398 18 : write(extra_name,'(a,i1)') 'profile_extra_', i
399 182 : else if (i < 100) then
400 180 : write(extra_name,'(a,i2)') 'profile_extra_', i
401 : else
402 2 : write(extra_name,'(a,i3)') 'profile_extra_', i
403 : end if
404 202 : s% profile_extra_name(i) = trim(extra_name)
405 : end do
406 :
407 2 : call set_starting_star_data(s, ierr)
408 2 : if (ierr /= 0) then
409 0 : write(*,*) 'alloc_star_data failed in set_starting_star_data'
410 0 : return
411 : end if
412 :
413 6 : end subroutine alloc_star_data
414 :
415 :
416 11 : subroutine null_other_new_generation(id, ierr)
417 : integer, intent(in) :: id
418 : integer, intent(out) :: ierr
419 11 : ierr = 0
420 11 : end subroutine null_other_new_generation
421 :
422 :
423 11 : subroutine null_other_set_current_to_old(id)
424 : integer, intent(in) :: id
425 11 : end subroutine null_other_set_current_to_old
426 :
427 :
428 2 : subroutine set_starting_star_data(s, ierr)
429 : use other_wind, only: null_other_wind
430 : use other_accreting_state, only: null_other_accreting_state
431 : use other_adjust_mdot, only: null_other_adjust_mdot
432 : use other_j_for_adjust_J_lost, only: null_other_j_for_adjust_J_lost
433 : use other_eval_fp_ft, only: null_other_eval_fp_ft
434 : use other_eval_i_rot, only: null_other_eval_i_rot
435 : use other_torque, only: default_other_torque
436 : use other_torque_implicit, only: default_other_torque_implicit
437 : use other_remove_surface, only: default_other_remove_surface
438 : use other_momentum, only: default_other_momentum
439 : use other_momentum_implicit, only: default_other_momentum_implicit
440 : use other_pressure, only: default_other_pressure
441 : use other_energy, only: default_other_energy
442 : use other_energy_implicit, only: default_other_energy_implicit
443 : use other_D_mix, only: null_other_D_mix
444 : use other_am_mixing, only: null_other_am_mixing
445 : use other_brunt, only: default_other_brunt
446 : use other_brunt_smoothing, only: null_other_brunt_smoothing
447 : use other_adjust_mlt_gradT_fraction, only: &
448 : default_other_adjust_mlt_gradT_fraction
449 : use other_after_set_mixing_info, only: &
450 : default_other_after_set_mixing_info
451 : use other_after_solver_setmatrix, only: &
452 : default_other_after_solver_setmatrix
453 : use other_diffusion, only: null_other_diffusion
454 : use other_diffusion_factor, only: default_other_diffusion_factor
455 : use other_neu, only: null_other_neu
456 : use other_net_get, only: null_other_net_get
457 : use other_cgrav, only: default_other_cgrav
458 : use other_mesh_delta_coeff_factor, only: default_other_mesh_delta_coeff_factor
459 : use other_alpha_mlt, only: default_other_alpha_mlt
460 : use other_mlt_results, only: null_other_mlt_results
461 : use other_opacity_factor, only: default_other_opacity_factor
462 : use other_pgstar_plots, only: null_other_pgstar_plots_info
463 : use other_mesh_functions
464 : use other_eps_grav, only: null_other_eps_grav
465 : use other_rsp_build_model, only: null_other_rsp_build_model
466 : use other_rsp_linear_analysis, only: null_other_rsp_linear_analysis
467 : use other_gradr_factor, only: null_other_gradr_factor
468 : use other_surface_PT, only: null_other_surface_PT
469 : use other_timestep_limit, only: null_other_timestep_limit
470 : use other_overshooting_scheme, only: null_other_overshooting_scheme
471 : use other_photo_write, only: default_other_photo_write
472 : use other_photo_read, only: default_other_photo_read
473 : use other_set_pgstar_controls, only: default_other_set_pgstar_controls
474 : use other_kap
475 : use star_utils, only: init_random
476 :
477 : type (star_info), pointer :: s
478 : integer, intent(out) :: ierr
479 :
480 : ! note: keep the handles for eos, kap, and net
481 :
482 2 : ierr = 0
483 :
484 2 : s% model_number = 0
485 2 : s% time = 0
486 2 : s% dt = 0
487 :
488 2 : s% total_num_solver_iterations = 0
489 2 : s% total_num_solver_relax_iterations = 0
490 2 : s% total_num_solver_calls_made = 0
491 2 : s% total_num_solver_relax_calls_made = 0
492 2 : s% total_num_solver_calls_converged = 0
493 2 : s% total_num_solver_relax_calls_converged = 0
494 :
495 2 : s% num_solver_iterations = 0
496 2 : s% num_skipped_setvars = 0
497 2 : s% num_setvars = 0
498 2 : s% num_solver_setvars = 0
499 2 : s% num_retries = 0
500 2 : s% num_hydro_merges = 0
501 2 : s% num_hydro_splits = 0
502 2 : s% timestep_hold = -1
503 :
504 2 : s% mesh_call_number = 0
505 2 : s% solver_call_number = 0
506 2 : s% diffusion_call_number = 0
507 2 : s% model_number_for_last_retry = 0
508 2 : s% dt_limit_ratio = 0
509 2 : s% force_tau_factor = 0
510 2 : s% force_opacity_factor = 0
511 :
512 2 : s% generations = 0
513 :
514 2 : s% nvar_hydro = 0
515 2 : s% nvar_chem = 0
516 2 : s% nvar_total = 0
517 :
518 2 : s% nz = 0
519 2 : s% prev_mesh_nz = 0
520 2 : s% net_name = ''
521 2 : s% species = 0
522 2 : s% num_reactions = 0
523 :
524 2 : s% fix_Pgas = .false.
525 2 : s% v_flag = .false.
526 2 : s% u_flag = .false.
527 2 : s% rotation_flag = .false.
528 2 : s% RTI_flag = .false.
529 2 : s% w_div_wc_flag = .false.
530 2 : s% D_omega_flag = .false.
531 2 : s% am_nu_rot_flag = .false.
532 2 : s% RSP_flag = .false.
533 2 : s% RSP2_flag = .false.
534 :
535 2 : s% have_mixing_info = .false.
536 2 : s% doing_solver_iterations = .false.
537 2 : s% need_to_setvars = .true.
538 2 : s% okay_to_set_mixing_info = .true.
539 2 : s% okay_to_set_mlt_vc = .false. ! not until have set mlt_cv_old
540 2 : s% have_mlt_vc = .false.
541 :
542 2 : s% have_ST_start_info = .false.
543 2 : s% prev_mesh_have_ST_start_info = .false.
544 :
545 2 : s% just_wrote_terminal_header = .false.
546 2 : s% doing_relax = .false.
547 2 : s% mstar_dot = 0
548 2 : s% surf_lnS = 0
549 :
550 2 : s% termination_code = -1
551 :
552 2 : s% screening_mode_value = -1
553 :
554 2 : s% dt = -1
555 2 : s% dt_next = -1
556 2 : s% dt_next_unclipped = -1
557 :
558 2 : s% i_lnd = 0
559 2 : s% i_lnT = 0
560 2 : s% i_lnR = 0
561 2 : s% i_lum = 0
562 2 : s% i_v = 0
563 2 : s% i_u = 0
564 2 : s% i_alpha_RTI = 0
565 :
566 2 : s% i_dv_dt = 0
567 2 : s% i_du_dt = 0
568 2 : s% i_equL = 0
569 2 : s% i_dlnd_dt = 0
570 2 : s% i_dlnE_dt = 0
571 2 : s% i_dlnR_dt = 0
572 2 : s% i_dalpha_RTI_dt = 0
573 :
574 2 : s% op_mono_nptot = 0
575 2 : s% op_mono_ipe = 0
576 2 : s% op_mono_nrad = 0
577 2 : s% op_mono_n = 0
578 :
579 2 : s% number_of_history_columns = -1
580 2 : s% model_number_of_history_values = -1
581 2 : s% need_to_set_history_names_etc = .true.
582 2 : s% doing_finish_load_model = .false.
583 :
584 2 : nullify(s% finish_relax_step)
585 2 : nullify(s% finished_relax)
586 :
587 : s% how_many_extra_profile_header_items => &
588 2 : null_how_many_extra_header_items
589 : s% data_for_extra_profile_header_items => &
590 2 : null_data_for_extra_header_items
591 :
592 : s% how_many_extra_history_header_items => &
593 2 : null_how_many_extra_header_items
594 : s% data_for_extra_history_header_items => &
595 2 : null_data_for_extra_header_items
596 :
597 2 : s% other_wind => null_other_wind
598 2 : s% other_accreting_state => null_other_accreting_state
599 2 : s% other_adjust_mdot => null_other_adjust_mdot
600 2 : s% other_j_for_adjust_J_lost => null_other_j_for_adjust_J_lost
601 2 : s% other_D_mix => null_other_D_mix
602 2 : s% other_am_mixing => null_other_am_mixing
603 2 : s% other_eval_fp_ft => null_other_eval_fp_ft
604 2 : s% other_eval_i_rot => null_other_eval_i_rot
605 2 : s% other_torque => default_other_torque
606 2 : s% other_torque_implicit => default_other_torque_implicit
607 2 : s% other_remove_surface => default_other_remove_surface
608 2 : s% other_momentum => default_other_momentum
609 2 : s% other_momentum_implicit => default_other_momentum_implicit
610 2 : s% other_pressure => default_other_pressure
611 2 : s% other_energy => default_other_energy
612 2 : s% other_energy_implicit => default_other_energy_implicit
613 2 : s% other_cgrav => default_other_cgrav
614 2 : s% other_mesh_delta_coeff_factor => default_other_mesh_delta_coeff_factor
615 2 : s% other_alpha_mlt => default_other_alpha_mlt
616 2 : s% other_opacity_factor => default_other_opacity_factor
617 2 : s% other_brunt => default_other_brunt
618 2 : s% other_brunt_smoothing => null_other_brunt_smoothing
619 2 : s% other_adjust_mlt_gradT_fraction => default_other_adjust_mlt_gradT_fraction
620 2 : s% other_after_set_mixing_info => default_other_after_set_mixing_info
621 2 : s% other_after_solver_setmatrix => default_other_after_solver_setmatrix
622 2 : s% other_diffusion => null_other_diffusion
623 2 : s% other_diffusion_factor => default_other_diffusion_factor
624 2 : s% other_mlt_results => null_other_mlt_results
625 2 : s% other_neu => null_other_neu
626 2 : s% other_net_get => null_other_net_get
627 2 : s% other_eps_grav => null_other_eps_grav
628 2 : s% other_rsp_build_model => null_other_rsp_build_model
629 2 : s% other_rsp_linear_analysis => null_other_rsp_linear_analysis
630 2 : s% other_gradr_factor => null_other_gradr_factor
631 :
632 2 : s% other_kap_get => null_other_kap_get
633 2 : s% other_kap_get_op_mono => null_other_kap_get_op_mono
634 :
635 2 : s% other_surface_PT => null_other_surface_PT
636 :
637 2 : s% other_timestep_limit => null_other_timestep_limit
638 2 : s% other_overshooting_scheme => null_other_overshooting_scheme
639 :
640 2 : s% other_pgstar_plots_info => null_other_pgstar_plots_info
641 2 : s% how_many_other_mesh_fcns => null_how_many_other_mesh_fcns
642 2 : s% other_mesh_fcn_data => null_other_mesh_fcn_data
643 :
644 2 : s% other_photo_write => default_other_photo_write
645 2 : s% other_photo_read => default_other_photo_read
646 :
647 2 : s% other_set_pgstar_controls => default_other_set_pgstar_controls
648 :
649 2 : s% other_new_generation => null_other_new_generation
650 2 : s% other_set_current_to_old => null_other_set_current_to_old
651 :
652 2 : nullify(s% extra_profile_col_names)
653 2 : nullify(s% extra_profile_col_vals)
654 2 : s% num_extra_profile_cols = 0
655 :
656 2 : s% binary_id = 0
657 2 : s% include_binary_history_in_log_file = .false.
658 2 : s% how_many_binary_history_columns => null_how_many_binary_history_columns
659 2 : s% data_for_binary_history_columns => null_data_for_binary_history_columns
660 2 : s% how_many_extra_binary_history_columns => null_how_many_extra_binary_history_columns
661 2 : s% data_for_extra_binary_history_columns => null_data_for_extra_binary_history_columns
662 :
663 2 : s% generations = 0
664 :
665 2 : s% nz = 0
666 :
667 2 : s% nvar_hydro = 0
668 2 : s% nvar_chem = 0
669 2 : s% nvar_total = 0
670 :
671 2 : s% species = 0
672 2 : s% num_reactions = 0
673 :
674 2 : s% model_number = 0
675 2 : s% mstar = 0
676 2 : s% xmstar = 0
677 2 : s% M_center = 0
678 2 : s% v_center = 0
679 2 : s% R_center = 0
680 2 : s% L_center = 0
681 2 : s% time = 0
682 2 : s% total_angular_momentum = 0
683 :
684 2 : s% dt = 0
685 :
686 2 : s% have_previous_conv_vel = .false.
687 :
688 2 : s% net_name = ''
689 :
690 2 : s% mstar_dot = 0
691 2 : s% v_surf = 0
692 2 : s% L_nuc_burn_total = 0
693 50 : s% L_by_category = 0
694 2 : s% dt_limit_ratio = 0
695 2 : s% L_phot = 0
696 2 : s% T_surf = 0
697 2 : s% P_surf = 0
698 :
699 2 : s% gradT_excess_alpha = 0
700 2 : s% gradT_excess_alpha_old = 0
701 :
702 2 : s% h1_czb_mass = 0
703 :
704 2 : s% he_core_mass = 0
705 2 : s% co_core_mass = 0
706 2 : s% Teff = -1 ! need to calculate it
707 2 : s% center_eps_nuc = 0
708 2 : s% Lrad_div_Ledd_avg_surf = 0
709 2 : s% w_div_w_crit_avg_surf = 0
710 2 : s% total_internal_energy = 0d0
711 2 : s% total_gravitational_energy = 0d0
712 2 : s% total_radial_kinetic_energy = 0d0
713 2 : s% total_turbulent_energy = 0d0
714 2 : s% total_rotational_kinetic_energy = 0d0
715 2 : s% total_energy = 0d0
716 :
717 2 : s% n_conv_regions = 0
718 202 : s% cz_bot_mass(:) = 0
719 202 : s% cz_top_mass(:) = 0
720 2 : s% dt_next = 0
721 :
722 2 : s% model_profile_filename = ''
723 2 : s% model_controls_filename = ''
724 2 : s% model_data_filename = ''
725 :
726 2 : s% most_recent_profile_filename = ''
727 2 : s% most_recent_controls_filename = ''
728 :
729 2 : s% most_recent_model_data_filename = ''
730 :
731 2 : s% recent_log_header = -1000
732 2 : s% phase_of_evolution = 0
733 :
734 2 : s% num_solver_iterations = 0
735 2 : s% num_skipped_setvars = 0
736 2 : s% num_setvars = 0
737 2 : s% num_retries = 0
738 :
739 2 : s% num_hydro_merges = 0
740 2 : s% num_hydro_splits = 0
741 :
742 2 : s% timestep_hold = 0
743 2 : s% model_number_for_last_retry = 0
744 :
745 2 : s% mesh_call_number = 0
746 2 : s% solver_call_number = 0
747 2 : s% diffusion_call_number = 0
748 :
749 2 : s% num_rotation_solver_steps = 0
750 2 : s% num_diffusion_solver_steps = 0
751 2 : s% initial_timestep = 0
752 2 : s% why_Tlim = 0
753 2 : s% result_reason = 0
754 :
755 2 : s% have_new_generation = .false.
756 2 : s% have_new_cz_bdy_info = .false.
757 2 : s% need_to_update_history_now = .false.
758 2 : s% need_to_save_profiles_now = .false.
759 2 : s% save_profiles_model_priority = 0
760 :
761 2 : s% doing_flash_wind = .false.
762 2 : s% doing_rlo_wind = .false.
763 2 : s% most_recent_photo_name = ''
764 :
765 2 : s% len_extra_iwork = 0
766 2 : s% len_extra_work = 0
767 :
768 2 : s% crystal_core_boundary_mass = -1
769 2 : s% phase_sep_mixing_mass = -1
770 :
771 2 : call init_random(s)
772 :
773 2 : end subroutine set_starting_star_data
774 :
775 :
776 0 : subroutine create_pre_ms_model(id, ierr)
777 : integer, intent(in) :: id
778 : integer, intent(out) :: ierr
779 : character (len=0) :: model_dir
780 : call model_builder( &
781 : id, model_dir, do_create_pre_ms_model, &
782 0 : .false., 'restart_photo', ierr)
783 0 : end subroutine create_pre_ms_model
784 :
785 :
786 0 : subroutine create_initial_model(id, ierr)
787 : integer, intent(in) :: id
788 : integer, intent(out) :: ierr
789 : character (len=0) :: model_dir
790 : call model_builder( &
791 : id, model_dir, do_create_initial_model, &
792 0 : .false., 'restart_photo', ierr)
793 0 : end subroutine create_initial_model
794 :
795 :
796 0 : subroutine create_RSP_model(id, ierr)
797 : integer, intent(in) :: id
798 : integer, intent(out) :: ierr
799 : character (len=0) :: model_dir
800 : call model_builder( &
801 : id, model_dir, do_create_RSP_model, &
802 0 : .false., 'restart_photo', ierr)
803 0 : end subroutine create_RSP_model
804 :
805 :
806 0 : subroutine create_RSP2_model(id, ierr)
807 : integer, intent(in) :: id
808 : integer, intent(out) :: ierr
809 : character (len=0) :: model_dir
810 : call model_builder( &
811 : id, model_dir, do_create_RSP2_model, &
812 0 : .false., 'restart_photo', ierr)
813 0 : end subroutine create_RSP2_model
814 :
815 :
816 1 : subroutine load_zams_model(id, ierr)
817 : integer, intent(in) :: id
818 : integer, intent(out) :: ierr
819 : call model_builder( &
820 : id, '', do_load_zams_model, &
821 1 : .false., 'restart_photo', ierr)
822 1 : end subroutine load_zams_model
823 :
824 :
825 0 : subroutine load_saved_model(id, model_fname, ierr)
826 : integer, intent(in) :: id
827 : character (len=*), intent(in) :: model_fname
828 : integer, intent(out) :: ierr
829 : integer :: l
830 : l = len_trim(model_fname)
831 : call model_builder( &
832 : id, model_fname, do_load_saved_model, &
833 0 : .false., 'restart_photo', ierr)
834 0 : end subroutine load_saved_model
835 :
836 :
837 0 : subroutine load_restart_photo(id, restart_filename, ierr)
838 : integer, intent(in) :: id
839 : character (len=*), intent(in) :: restart_filename
840 : integer, intent(out) :: ierr
841 : call model_builder( &
842 0 : id, '', do_load_zams_model, .true., restart_filename, ierr)
843 0 : end subroutine load_restart_photo
844 :
845 :
846 : ! for both zams and pre-main-sequence
847 1 : subroutine model_builder( &
848 : id, model_info, do_which, restart, restart_filename, ierr)
849 : use net, only: set_net, do_micro_change_net
850 : use alloc, only: set_var_info
851 : use photo_in, only: read_star_photo
852 : use init_model, only: get_zams_model
853 : use star_utils, only: set_phase_of_evolution, yrs_for_init_timestep, &
854 : eval_deltaM_total_energy_integrals
855 : use adjust_xyz, only: set_z, set_y
856 : use pre_ms_model, only: build_pre_ms_model
857 : use create_initial_model, only: build_initial_model
858 : use rsp, only: build_rsp_model, rsp_total_energy_integrals
859 : use rsp_def, only: init_def
860 : use read_model, only: do_read_saved_model, &
861 : finish_load_model
862 : use relax, only: do_relax_to_limit, do_relax_mass, &
863 : do_relax_mass_scale, do_relax_num_steps, do_relax_to_radiative_core
864 : use auto_diff_support
865 : integer, intent(in) :: id, do_which
866 : character (len=*), intent(in) :: model_info, restart_filename
867 : logical, intent(in) :: restart
868 : integer, intent(out) :: ierr
869 :
870 : type (star_info), pointer :: s
871 : real(dp) :: initial_mass, initial_z
872 : real(dp), parameter :: lg_max_abs_mdot = -1000 ! use default
873 : real(dp), parameter :: change_mass_years_for_dt = 1
874 : real(dp), parameter :: min_mass_for_create_pre_ms = 0.03d0
875 : real(dp) :: total_radiation, warning_limit_for_max_residual
876 : integer :: k, num_trace_history_values
877 : real(dp) :: save_Pextra_factor
878 : character (len=256):: save_atm_option, &
879 : save_atm_T_tau_relation, save_atm_T_tau_opacity
880 1 : real(dp), allocatable, dimension(:) :: total_energy_profile
881 :
882 : include 'formats'
883 :
884 : ierr = 0
885 :
886 1 : call get_star_ptr(id, s, ierr)
887 1 : if (ierr /= 0) return
888 :
889 1 : initial_mass = s% initial_mass
890 1 : initial_z = s% initial_z
891 :
892 1 : if (s% initial_y < 0) s% initial_y = max(0d0, min(1d0, 0.24d0 + 2*initial_z))
893 :
894 1 : s% dt = 0
895 1 : s% termination_code = -1
896 :
897 1 : if (restart) then
898 0 : s% doing_first_model_of_run = .false.
899 0 : s% doing_first_model_after_restart = .true.
900 0 : call read_star_photo(s, restart_filename, ierr)
901 0 : if (ierr /= 0) return
902 0 : call check_initials
903 0 : call set_net(s, s% net_name, ierr)
904 0 : if (ierr /= 0) return
905 0 : if (s% rotation_flag) s% have_j_rot = .true.
906 0 : call init_def(s) ! RSP
907 0 : call finish_load_model(s, restart, ierr)
908 0 : if (s% max_years_for_timestep > 0) &
909 0 : s% dt_next = min(s% dt_next, secyer*s% max_years_for_timestep)
910 0 : return
911 : end if
912 :
913 1 : num_trace_history_values = s% num_trace_history_values
914 1 : s% num_trace_history_values = 0
915 :
916 1 : warning_limit_for_max_residual = s% warning_limit_for_max_residual
917 1 : s% warning_limit_for_max_residual = 1d0
918 :
919 1 : s% doing_first_model_of_run = .true.
920 1 : s% doing_first_model_after_restart = .false.
921 :
922 1 : if (do_which == do_load_saved_model) then
923 0 : s% dt_next = -1
924 0 : call do_read_saved_model(s, model_info, ierr)
925 0 : if (ierr /= 0) then
926 0 : write(*,*) 'load failed in do_read_saved_model'
927 0 : return
928 : end if
929 0 : call check_initials
930 0 : if (s% dt_next < 0) s% dt_next = yrs_for_init_timestep(s)*secyer
931 : else
932 1 : s% net_name = s% default_net_name
933 1 : s% species = 0
934 1 : s% v_flag = .false.
935 1 : s% u_flag = .false.
936 1 : s% rotation_flag = .false.
937 1 : s% D_omega_flag = .false.
938 1 : s% am_nu_rot_flag = .false.
939 1 : s% star_mass = s% initial_mass
940 1 : s% mstar = s% initial_mass*Msun
941 1 : s% M_center = s% mstar - s% xmstar
942 1 : call set_var_info(s, ierr)
943 1 : if (ierr /= 0) then
944 0 : write(*,*) 'failed in set_var_info'
945 0 : return
946 : end if
947 0 : select case (do_which)
948 : case (do_create_initial_model)
949 0 : if (s% initial_model_change_net) then
950 0 : call do_micro_change_net(s, s% initial_model_new_net_name, ierr)
951 : else
952 0 : call set_net(s, s% net_name, ierr)
953 : end if
954 0 : if (ierr /= 0) then
955 0 : write(*,*) 'failed in set_net'
956 0 : return
957 : end if
958 0 : call build_initial_model(s, ierr)
959 0 : if (ierr /= 0) then
960 0 : write(*,*) 'failed in build_initial_model'
961 0 : return
962 : end if
963 0 : s% generations = 1
964 0 : s% dt_next = 1d-5*secyer
965 : case (do_create_pre_ms_model)
966 0 : if (s% initial_mass < min_mass_for_create_pre_ms) then
967 0 : write(*,'(A)')
968 0 : write(*,'(A)')
969 0 : write(*,'(A)')
970 0 : write(*,'(a,1x,f5.2)') 'sorry: cannot create pre-ms smaller than', &
971 0 : min_mass_for_create_pre_ms
972 : write(*,'(a)') &
973 0 : 'please create pre-ms and then relax to lower mass as a separate operation'
974 0 : write(*,'(A)')
975 0 : write(*,'(a)') 'here is an example:'
976 0 : write(*,'(a)') 'in your inlist &controls section, set initial_mass = 0.03'
977 0 : write(*,'(a)') 'in the &star_job section, add something like these lines'
978 0 : write(*,'(a)') ' relax_mass_scale = .true.'
979 0 : write(*,'(a)') ' dlgm_per_step = 1d-3 ! log10(delta M/Msun/step)'
980 0 : write(*,'(a)') ' new_mass = 2.863362d-3 ! 3 Mjupiter in Msun units'
981 0 : write(*,'(a)') ' change_mass_years_for_dt = 1'
982 0 : write(*,'(A)')
983 0 : write(*,'(A)')
984 0 : write(*,'(A)')
985 0 : ierr = -1
986 0 : return
987 : end if
988 0 : if (s% pre_ms_change_net) then
989 0 : call do_micro_change_net(s, s% pre_ms_new_net_name, ierr)
990 : else
991 0 : call set_net(s, s% net_name, ierr)
992 : end if
993 0 : if (ierr /= 0) then
994 0 : write(*,*) 'failed in set_net'
995 0 : return
996 : end if
997 0 : write(*,2) 'species mass', s% species, s% mstar/Msun
998 :
999 0 : call build_pre_ms_model(id, s, s% nvar_hydro, s% species, ierr)
1000 0 : if (ierr /= 0) then
1001 0 : write(*,*) 'failed in build_pre_ms_model'
1002 0 : return
1003 : end if
1004 0 : s% generations = 1
1005 0 : s% dt_next = 1d-5*secyer
1006 : case (do_load_zams_model)
1007 1 : s% generations = 1
1008 1 : call get_zams_model(s, s% zams_filename, ierr)
1009 1 : if (ierr /= 0) then
1010 0 : write(*,*) 'failed in get_zams_model'
1011 0 : return
1012 : end if
1013 1 : if (s% dt_next <= 0d0) then
1014 1 : s% dt_next = yrs_for_init_timestep(s)*secyer
1015 : end if
1016 : case (do_create_RSP_model)
1017 0 : call build_rsp_model(s, ierr) ! like build_pre_ms_model
1018 0 : if (ierr /= 0) then
1019 0 : write(*,*) 'failed in build_rsp_model'
1020 0 : return
1021 : end if
1022 0 : s% generations = 1
1023 0 : s% dt_next = 1d-2*secyer
1024 : case (do_create_RSP2_model)
1025 : !call build_rsp2_model(s, ierr) ! like build_pre_ms_model
1026 0 : call mesa_error(__FILE__,__LINE__,'need to add build_rsp2_model')
1027 : if (ierr /= 0) then
1028 : write(*,*) 'failed in build_rsp2_model'
1029 : return
1030 : end if
1031 : s% generations = 1
1032 0 : s% dt_next = 1d-2*secyer
1033 : case default
1034 0 : write(*,*) 'bad value for do_which in build_model'
1035 0 : ierr = -1
1036 1 : return
1037 : end select
1038 : end if
1039 :
1040 2465 : do k=1,s% nz
1041 2465 : s% extra_heat(k) = 0
1042 : end do
1043 :
1044 1 : call finish_load_model(s, restart, ierr)
1045 1 : if (ierr /= 0) then
1046 0 : write(*,*) 'failed in finish_load_model'
1047 0 : return
1048 : end if
1049 :
1050 1 : if (s% max_years_for_timestep > 0) &
1051 0 : s% dt_next = min(s% dt_next, secyer*s% max_years_for_timestep)
1052 1 : call set_phase_of_evolution(s)
1053 :
1054 1 : if (s% RSP_flag) then
1055 : call rsp_total_energy_integrals(s, &
1056 : s% total_internal_energy, &
1057 : s% total_gravitational_energy, &
1058 : s% total_radial_kinetic_energy, &
1059 : s% total_rotational_kinetic_energy, &
1060 : s% total_turbulent_energy, &
1061 0 : s% total_energy, total_radiation)
1062 : else
1063 3 : allocate(total_energy_profile(1:s% nz))
1064 : call eval_deltaM_total_energy_integrals( &
1065 : s, 1, s% nz, s% mstar, .false., &
1066 : total_energy_profile, &
1067 : s% total_internal_energy, &
1068 : s% total_gravitational_energy, &
1069 : s% total_radial_kinetic_energy, &
1070 : s% total_rotational_kinetic_energy, &
1071 : s% total_turbulent_energy, &
1072 1 : s% total_energy)
1073 : end if
1074 :
1075 1 : if (do_which == do_create_pre_ms_model) then
1076 0 : call setup_for_relax_after_create_pre_ms_model
1077 0 : if (s% mstar > s% initial_mass*Msun) then ! need to reduce mass
1078 0 : write(*,1) 'reduce mass to', s% initial_mass
1079 0 : call do_relax_mass(s% id, s% initial_mass, lg_max_abs_mdot, ierr)
1080 0 : if (ierr /= 0) then
1081 0 : write(*,*) 'failed in do_relax_mass'
1082 0 : return
1083 : end if
1084 0 : else if (s% mstar < s% initial_mass*Msun) then ! need to increase mass
1085 0 : write(*,1) 'increase mass to', s% initial_mass
1086 : call do_relax_mass_scale( &
1087 0 : s% id, s% initial_mass, s% job% dlgm_per_step, s% job% change_mass_years_for_dt, ierr)
1088 0 : if (ierr /= 0) then
1089 0 : write(*,*) 'failed in do_relax_mass'
1090 0 : return
1091 : end if
1092 : end if
1093 : call do_relax_num_steps( &
1094 0 : s% id, s% pre_ms_relax_num_steps, s% dt_next, ierr)
1095 0 : if (ierr /= 0) then
1096 0 : write(*,*) 'failed in do_relax_num_steps'
1097 0 : return
1098 : end if
1099 :
1100 0 : if (s% job% pre_ms_relax_to_start_radiative_core) then
1101 0 : call do_relax_to_radiative_core(s% id, ierr)
1102 0 : if (ierr /= 0) then
1103 0 : write(*,*) 'failed in do_relax_to_radiative_core'
1104 0 : return
1105 : end if
1106 : end if
1107 0 : call done_relax_after_create_pre_ms_model
1108 1 : else if (do_which == do_create_initial_model .and. &
1109 : s% initial_model_relax_num_steps > 0) then
1110 : call do_relax_num_steps( &
1111 0 : s% id, s% initial_model_relax_num_steps, s% dt_next, ierr)
1112 0 : if (ierr /= 0) then
1113 0 : write(*,*) 'failed in do_relax_num_steps'
1114 0 : return
1115 : end if
1116 : end if
1117 :
1118 1 : s% doing_first_model_of_run = .true.
1119 1 : s% num_trace_history_values = num_trace_history_values
1120 1 : s% warning_limit_for_max_residual = warning_limit_for_max_residual
1121 :
1122 : contains
1123 :
1124 0 : subroutine setup_for_relax_after_create_pre_ms_model
1125 0 : save_atm_option = s% atm_option
1126 0 : save_atm_T_tau_relation = s% atm_T_tau_relation
1127 0 : save_atm_T_tau_opacity = s% atm_T_tau_opacity
1128 0 : save_Pextra_factor = s% Pextra_factor
1129 0 : s% atm_option = 'T_tau'
1130 0 : s% atm_T_tau_relation = 'Eddington'
1131 0 : s% atm_T_tau_opacity = 'fixed'
1132 0 : s% Pextra_factor = 2
1133 0 : end subroutine setup_for_relax_after_create_pre_ms_model
1134 :
1135 0 : subroutine done_relax_after_create_pre_ms_model
1136 0 : s% atm_option = save_atm_option
1137 0 : s% atm_T_tau_relation = save_atm_T_tau_relation
1138 0 : s% atm_T_tau_opacity = save_atm_T_tau_opacity
1139 0 : s% Pextra_factor = save_Pextra_factor
1140 0 : end subroutine done_relax_after_create_pre_ms_model
1141 :
1142 0 : subroutine check_initials
1143 : include 'formats'
1144 : if (abs(initial_mass - s% initial_mass) > &
1145 0 : 1d-3*initial_mass .and. initial_mass > 0) then
1146 0 : write(*,1) "WARNING -- inlist initial_mass ignored", initial_mass
1147 0 : write(*,1) "using saved initial_mass instead", s% initial_mass
1148 0 : write(*,'(A)')
1149 : end if
1150 : if (abs(initial_z - s% initial_z) > &
1151 0 : 1d-3*initial_z .and. initial_z > 0) then
1152 0 : write(*,1) "WARNING -- inlist initial_z ignored", initial_z
1153 0 : write(*,1) "using saved initial_z instead", s% initial_z
1154 0 : write(*,'(A)')
1155 : end if
1156 0 : end subroutine check_initials
1157 :
1158 : end subroutine model_builder
1159 :
1160 :
1161 1 : logical function doing_restart(restart_filename)
1162 : character (len=*) :: restart_filename
1163 1 : inquire(file=restart_filename, exist=doing_restart)
1164 1 : end function doing_restart
1165 :
1166 :
1167 0 : integer function null_how_many_extra_header_items(id)
1168 : integer, intent(in) :: id
1169 0 : null_how_many_extra_header_items = 0
1170 0 : end function null_how_many_extra_header_items
1171 :
1172 :
1173 0 : subroutine null_data_for_extra_header_items(id, n, names, vals, ierr)
1174 : integer, intent(in) :: id, n
1175 : character (len=80) :: names(n)
1176 : real(dp) :: vals(n)
1177 : integer, intent(out) :: ierr
1178 0 : ierr = 0
1179 0 : end subroutine null_data_for_extra_header_items
1180 :
1181 :
1182 0 : integer function null_how_many_binary_history_columns(binary_id)
1183 : integer, intent(in) :: binary_id
1184 0 : null_how_many_binary_history_columns = 0
1185 0 : end function null_how_many_binary_history_columns
1186 :
1187 :
1188 0 : subroutine null_data_for_binary_history_columns( &
1189 : binary_id, n, names, vals, ierr)
1190 : use const_def, only: dp
1191 : integer, intent(in) :: binary_id, n
1192 : character (len=80) :: names(n)
1193 : real(dp) :: vals(n)
1194 : integer, intent(out) :: ierr
1195 0 : ierr = 0
1196 0 : end subroutine null_data_for_binary_history_columns
1197 :
1198 :
1199 0 : integer function null_how_many_extra_binary_history_columns(binary_id)
1200 : integer, intent(in) :: binary_id
1201 0 : null_how_many_extra_binary_history_columns = 0
1202 0 : end function null_how_many_extra_binary_history_columns
1203 :
1204 :
1205 0 : subroutine null_data_for_extra_binary_history_columns( &
1206 : binary_id, n, names, vals, ierr)
1207 : use const_def, only: dp
1208 : integer, intent(in) :: binary_id, n
1209 : character (len=80) :: names(n)
1210 : real(dp) :: vals(n)
1211 : integer, intent(out) :: ierr
1212 0 : ierr = 0
1213 0 : end subroutine null_data_for_extra_binary_history_columns
1214 :
1215 :
1216 0 : subroutine do_garbage_collection(eosDT_cache_dir, ierr)
1217 : use eos_lib, only: eos_init, eos_shutdown
1218 : use eos_def, only: use_cache_for_eos
1219 : integer, intent(inout) :: ierr
1220 : character (len=*), intent(in) :: eosDT_cache_dir
1221 : ! Remove existing eos data
1222 0 : call eos_shutdown()
1223 : ! Re-initialize eos
1224 : call eos_init(eosDT_cache_dir,&
1225 : ! After first init this is set in eos_def
1226 : use_cache_for_eos,&
1227 0 : ierr)
1228 0 : end subroutine do_garbage_collection
1229 :
1230 : end module init
|