!........................................................................ ! ! Subroutine : ! ! Description: ! ! Arguments : ! ! Mod/Commons: ! ! Calls : ! ! Author : ! ! Modified : ! !........................................................................ ! ! ! $Log$ ! Revision 1.10 2007/01/30 16:15:14 dcs ! merged with branch_bmad_1. ! ! Revision 1.6 2006/11/16 18:55:45 mjf7 ! Bmad change in ele_struct name length caused bugs. ! ! Revision 1.5 2006/09/26 16:05:01 mjf7 ! Adding sigma norming and fom_power back into main branch ! ! Revision 1.4.2.1 2006/09/26 15:00:00 mjf7 ! Fixed fom_power in top10 printout ! ! Revision 1.4 2006/01/20 23:37:07 mjf7 ! Formatting and linux compatibility changes ! ! Revision 1.3 2004/06/11 19:31:16 dlr ! having changed definition of con%c(i)%contribution need to compute contrib ! correctly. Replace set_on_off with lat_save=lat ! ! Revision 1.2 2003/04/30 17:14:55 cesrulib ! dlr's changes since last import ! ! Revision 1.1.1.1 2002/12/13 19:23:30 cesrulib ! import bmadz ! ! !........................................................................ ! ! subroutine showme_topten(CON, LAT, iunit) use nr use bmad use constraints_mod implicit none type (lat_struct) lat type (constraint_struct) con integer i,location, variable, plane integer j, iunit, nc real(rp) value, contrib real(rp) ra(n_con_maxx), rb(n_con_maxx) character fmt*80, loc_name*40 character date*10, time*10 ! do i = 1, con%n_constraint ra(i) = (con%c(i)%contribution * con%c(i)%weight)**2 rb(i) = i end do fmt = '(1x, i3, 1x, a20, 2x, a3,1x,a8, 2x, a7, 1pe12.3, e12.2, 2x, a10)' nc = con%n_constraint call sort2(ra(1:nc), rb(1:nc)) if (iunit <= 0) then print * print '(48x, a)', ' Value Merit Target/Max' else write (iunit, *) write (iunit, '(48x, a)') ' Value Merit Target/Max' endif do j = con%n_constraint, max(1, con%n_constraint-10), -1 i = rb(j) location = con%c(i)%location value = con%c(i)%actual_value variable = con%c(i)%variable plane = con%c(i)%plane contrib = (con%c(i)%contribution * con%c(i)%weight)**con%fom_power if (con%c(i)%set_target_to_initial_value) then write (loc_name, '(1x, 1pe9.2)') con%c(i)%target_value elseif (location >= 0) then loc_name = lat%ele(location)%name else loc_name = ' ' endif if (iunit <= 0) then print fmt, i, var_name(variable), plane_name(plane), con%c(i)%where1, & con%c(i)%where2, value, contrib, loc_name else write (iunit, fmt) i, var_name(variable), plane_name(plane), & con%c(i)%where1, con%c(i)%where2, value, contrib, loc_name endif end do call date_and_time(date, time) print * print '(1x, a, 1pe14.6,2x,a2,":",a2,":",a2)', 'figure of merit: ', con%figure_of_merit, time(1:2), time(3:4), time(5:6) return end subroutine showme_topten