subroutine take_tbt (n_turn, data_or_ref, u, graph, err_flag) use cesrv_struct use cesrv_interface implicit none #include "cbpm_cesr_interface.inc" type (universe_struct), target :: u type (graph_struct) graph integer data_or_ref, species, n_turn Integer action, mode, num_bunches, num_samples, num_turns, num_shots, turn_select Integer species_list(CBPM_MX_BUNCH_LIST) Integer train_list(CBPM_MX_BUNCH_LIST) Integer bunch_list(CBPM_MX_BUNCH_LIST) Integer status logical err_flag Integer send_cbpm_request3 External send_cbpm_request3 ! Take shaker data for T1B1 call set_species (species, err_flag) if (err_flag) return if (species == positron$) then species_list(1) = CESR_POSITRON else species_list(1) = CESR_ELECTRON endif action = CBPM_SHAKER_DATA_FLAG mode = CBPM_PROCESS_WAIT num_bunches = 1 train_list(1) = 1 bunch_list(1) = 1 num_samples = 1 num_turns = n_turn num_shots = 1 turn_select = 0 call save_this_set ('CONDX', err_flag) if (err_flag) return status = send_cbpm_request3(action, mode, num_bunches, species_list, & train_list, bunch_list, num_samples, num_turns, num_shots, turn_select) err_flag = .not. (status == CBPM_REQUEST_SUCCESS) if (err_flag) return call read_tbt (data_or_ref, 0, u, graph, err_flag) end subroutine