!+ ! Subroutine bmad_create_init_global (n_lats, n_twiss_threads) ! ! First creation routine to call when constructing a lattice from ! the Doocs database. ! ! Input: ! n_lats -- Integer: Number of lattices to create. ! n_twiss_threads -- Integer: Maximum number of twiss & track threads to allow for. !- subroutine bmad_create_init_global (n_lats, n_twiss_threads) use bmad_common_mod implicit none integer n_lats, n_twiss_threads logical :: init_needed=.true. character(24), parameter :: r_name = 'bmad_create_init_global' ! General init if (.not. init_needed) then call out_io (s_error$, r_name, "Multiple global initializations attempted!") return end if init_needed = .false. call output_direct(-1, .true.) call out_io_print_and_capture_setup (.false., 'UNBUFFERED', capture_add_null = .true.) bmad_com%auto_bookkeeper = .false. bmad_com%absolute_time_tracking_default = .true. global_com%be_thread_safe = .true. global_com%exit_on_error = .false. allocate(bd_com(n_lats)) allocate(bd_twiss(0:n_twiss_threads)) end subroutine