Skip to content

Commit

Permalink
Merge pull request #663 from piotrskowronski/master
Browse files Browse the repository at this point in the history
ptc_track: full functianality to find wavelength to subtract in TOTAL…  …PATH=true mode
  • Loading branch information
tpersson committed Aug 16, 2018
2 parents 2dbdf24 + fd10f5e commit 5faaf3e
Show file tree
Hide file tree
Showing 18 changed files with 3,191 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Makefile_test
Expand Up @@ -76,7 +76,7 @@ test-ptc-twiss-5D test-ptc-twiss-5Dt test-ptc-twiss-56D test-ptc-twiss-56Dt test
test-ptc-twiss-accel-56D test-ptc-twiss-56Dt-ini_map_man test-ptc-twiss-56Dt-ini_mtx_man test-ptc-twiss-56Dt-ini_mtx_tbl \
test-ptc-normal test-ptc-twiss-normal-genfu test-ptc-twiss-normal-5D test-ptc-twiss-normal-6D test-ptc-twiss-maptable \
test-ptc-track test-ptc-track-2 test-ptc-track-3 test-ptc-track-4 test-ptc-track-5 \
test-ptc-track-acd test-ptc-track-acd-2 \
test-ptc-track-acd test-ptc-track-acd-2 test-ptc-track-6Dtl-acd \
test-ptc-trackline test-ptc-trackline-2 test-ptc-trackline-3 \
test-ptc-align test-ptc-align-2 \
test-rfmultipole-ptc-1 \
Expand Down
10 changes: 9 additions & 1 deletion doc/latexuguide/ptc-track.tex
Expand Up @@ -176,7 +176,15 @@ \section{PTC\_TRACK}
total path length or time of flight and the PTC conversion is kept
for the output tables and files.
In particular, initial coordinates provided in \texttt{PTC\_START}
will appear with swapped sign.
will appear with swapped sign. \\
Please also remember that as the total time or path length becomes
larger as it becomes less precise and calculation gets more vulnerable
to numerical instabilities. \texttt{PTC\_TRACK} internally attempts to
periodically subtract from it a value corresponding to
common wavelenth of all oscillating elements, however, in cases when
ratios of all the frequency pairs are not rational numbers
than it can not be done.



\madbox{
Expand Down
13 changes: 10 additions & 3 deletions libs/ptc/src/c_dabnew.f90
Expand Up @@ -976,7 +976,10 @@ subroutine dadal(idal,l)
do i=l,1,-1
if(idal(i).le.nomax+2.or.idal(i).gt.nda_dab) then
write(line,'(a38,i8,1x,i8)') 'ERROR IN ROUTINE DADAL, IDAL(I),NDA = ',idal(i),nda_dab
ipause=mypauses(13,line)
!ipause=mypauses(13,line)
C_%STABLE_DA = .false.
l = 1
return
call dadeb !(31,'ERR DADAL ',1)
endif
if(idal(i).eq.nda_dab) then
Expand Down Expand Up @@ -1013,8 +1016,12 @@ subroutine dadal1(idal)
! return
! endif
if(idal.le.nomax+2.or.idal.gt.nda_dab) then
write(line,'(a35,i8,1x,i8)') 'ERROR IN ROUTINE DADAL, IDAL,NDA = ',idal,nda_dab
ipause=mypauses(14,line)
write(line,'(a35,i8,1x,i8)') 'ERROR IN ROUTINE DADAL1, IDAL,NDA = ',idal,nda_dab
!ipause=mypauses(14,line)
C_%STABLE_DA = .false.
idal = 0
return

call dadeb !(31,'ERR DADAL ',1)
endif
if(idal.eq.nda_dab) then
Expand Down
6 changes: 5 additions & 1 deletion libs/ptc/src/c_dabnew_berz.f90
Expand Up @@ -1023,7 +1023,11 @@ subroutine dadal_b(idal,l) !$$$$
do i=l,1,-1
if(idal(i).le.nomax+2.or.idal(i).gt.nda_dab) then
write(line,'(a38,i8,1x,i8)') 'ERROR IN ROUTINE DADAL, IDAL(I),NDA = ',idal(i),nda_dab
ipause=mypauses(13,line)
!ipause=mypauses(13,line)
C_%STABLE_DA = .false.
l = 1
return

call dadeb !(31,'ERR DADAL ',1)
endif
if(idal(i).eq.nda_dab) then
Expand Down
7 changes: 5 additions & 2 deletions libs/ptc/src/cc_dabnew.f90
Expand Up @@ -970,7 +970,10 @@ subroutine dadal(idal,l)
do i=l,1,-1
if(idal(i).le.c_nomax+2.or.idal(i).gt.c_nda_dab) then
write(line,'(a38,i8,1x,i8)') 'ERROR IN ROUTINE DADAL, IDAL(I),NDA = ',idal(i),c_nda_dab
ipause=mypauses(13,line)
!ipause=mypauses(13,line)
C_%STABLE_DA = .false.
l = 1
return
call dadeb !(31,'ERR DADAL ',1)
endif
if(idal(i).eq.c_nda_dab) then
Expand Down Expand Up @@ -1008,7 +1011,7 @@ subroutine c_dadal1(idal)
! return
! endif
if(idal.le.c_nomax+2.or.idal.gt.c_nda_dab) then
write(6,'(a35,i8,1x,i8)') 'ERROR IN ROUTINE DADAL, IDAL,NDA = ',idal,c_nda_dab
write(6,'(a35,i8,1x,i8)') 'ERROR IN ROUTINE DADAL1, IDAL,NDA = ',idal,c_nda_dab
call dadeb !(31,'ERR DADAL ',1)
endif
if(idal.eq.c_nda_dab) then
Expand Down

0 comments on commit 5faaf3e

Please sign in to comment.