!------------------------------------------------------------------------ !------------------------------------------------------------------------ !------------------------------------------------------------------------ subroutine load_sex (u, frac) use cesrv_struct use cesrv_interface use super_universe_com implicit none type (universe_struct), target :: u type (universe_struct), pointer :: uu real(rp) frac, merit integer i, j, ix1 character(80) string logical zero_all ! if (.not. logic%gui) then call get_input_string (& 'Load Sextupole Corrections. Are you sure? :', string) call str_upcase (string, string) call string_trim(string, string, ix1) if (string(1:1) /= 'Y') then print *, 'NOTHING LOADED' return endif endif zero_all = .true. do i = lbound(u%sex_k2%v, 1), ubound(u%sex_k2%v, 1) if (u%sex_k2%v(i)%good_var .and. u%sex_k2%v(i)%model /= 0) then zero_all = .false. exit endif enddo if (zero_all .and. logic%use_old_in_loading) then print *, 'Note: Looks like you are doing a second load...' print *, ' Reinstating model' call do_var_transfer (u%sex_k2, 1.0_rp, 'OLD', u, .true.) endif u%sex_k2%v(:)%cu_target = u%sex_k2%v(:)%cu_saved call cu_target_calc (u%sex_k2%v, u, frac) do j = 1, size(super%u_) uu => super%u_(j) do i = lbound(uu%sex_k2%v, 1), ubound(uu%sex_k2%v, 1) if (uu%sex_k2%v(i)%good_var) then uu%sex_k2%v(i)%old = uu%sex_k2%v(i)%model uu%sex_k2%v(i)%model = uu%sex_k2%v(i)%design call var_bookkeeper(uu%sex_k2%v(i), uu%ring, uu%orb) endif enddo enddo if (logic%debug) then print *, "Fake Loading: 'CSR SEXT CUR'" else call vxputn ('CSR SEXT CUR', 1, 98, u%sex_k2%v(1:98)%cu_target) print *, 'SEXTUPOLES LOADED WITH FRACTION:', frac endif call merit_calc(merit) logic%use_old_in_loading = .true. end subroutine