!........................................................................ ! ! Subroutine : SET_NONLIN(NONLIN, disp_file) ! ! Description: Set initial energy and amplitude offsets for closed orbit ! calculation near closed orbit for delta E/E = 0. and for an ! ! Arguments : ! INPUT: NONLIN Nonlin_struct: Nonlin ! ! OUTPUT: NONLIN Nonlin_struct: nonlin.energy_offset and ! nonlin.x_amplitude, nonlin.y_amplitude ! nonlin.delta_orb ! ! Mod/Commons: ! ! Calls : ! ! Author : ! ! Modified : ! !........................................................................ ! ! ! $Log$ ! Revision 1.9 2007/01/30 16:15:14 dcs ! merged with branch_bmad_1. ! ! Revision 1.6 2004/11/08 19:16:29 dlr ! replace n_ele_maxx with n_ele_max ! ! Revision 1.5 2003/07/08 19:27:57 mjf7 ! ! ! Modified all subroutines to correctly use allocatable lat elements. n_ele_maxx is no longer global, but a member variable of the lat struct. -mjf ! ! Revision 1.4 2003/06/07 20:44:30 cesrulib ! conform to the lahey f95 standard ! ! Revision 1.2 2003/04/30 17:14:54 cesrulib ! dlr's changes since last import ! ! Revision 1.1.1.1 2002/12/13 19:23:30 cesrulib ! import bmadz ! ! !........................................................................ ! subroutine set_nonlin(nonlin, disp_file, n_ele_max) use bmad use nonlin_mod use constraints_mod implicit none type (nonlin_ele_struct) nonlin character*(*) disp_file integer n_ele_max character*72 string integer i nonlin%energies = 3 nonlin%energy_offset(1) = -0.006 nonlin%energy_offset(2) = 0.0 nonlin%energy_offset(3) = 0.006 nonlin%n_det_calc = 6 call allocate_nonlin_ele( nonlin, n_ele_max ) ! nonlin.delta_orb(i) are the offsets with respect to the closed orbit ! that are used to compute the jacobian. The i=1,10 sets of ! coordinates are for each of the n_det_calc iterations. ! If only i=1 is specified then the supsequent starting points ! are computed internally in subroutine nonlinear_closed_orbit. ! Note that the actual displacement is ! co.x.pos+sqrt(delta_orb().x.pos * betax) ! co.x.vel+sqrt(delta_orb().x.vel / betax) etc. forall (i = 1:10) nonlin%delta_orb(i)%vec = 0 nonlin%delta_orb(1)%vec(1:2) = 4.0e-8 nonlin%delta_orb(1)%vec(3:4) = 2.25e-6 nonlin%delta_orb(1)%vec(5:6) = 2.0e-4 nonlin%delta_orb(2)%vec(1:2) = 2.25e-4 nonlin%delta_orb(2)%vec(3:4) = 1.0e-8 nonlin%delta_orb(3)%vec(1:2) = 2.5e-5 nonlin%delta_orb(3)%vec(3:4) = 1.44e-6 nonlin%delta_orb(4)%vec(1:4) = 4.0e-8 nonlin%delta_orb(5)%vec(1:4) = 2.56e-6 nonlin%delta_orb(5)%vec(3:4) = 2.5e-10 nonlin%delta_orb(6)%vec(1:2) = 4.0e-10 nonlin%delta_orb(6)%vec(3:4) = 4.0e-9 if(disp_file /= 'DEFAULT')then open(unit=11, file=disp_file, status='OLD', action='read') do i=1, nonlin%n_det_calc read(11,'(a)')string read(string,*)nonlin%delta_orb(i)%vec(1),nonlin%delta_orb(i)%vec(2), & nonlin%delta_orb(i)%vec(3),nonlin%delta_orb(i)%vec(4) end do close(unit=11) endif return end