Skip to content

Commit

Permalink
Ensure that exact_model is set before zero_key is called
Browse files Browse the repository at this point in the history
zero_key(key) sets key%exact equal to the value of exact_model
In the previous code, zero_key was called before exact_model was set,
and so key%exact was set based on node_value("exact ") of the previous node.
So, move the code to set exact_model to before zero_key is called.
  • Loading branch information
J. Scott Berg committed May 23, 2022
1 parent 3ba7b98 commit a547097
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/madx_ptc_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,14 @@ subroutine ptc_input()

ord_max = -1

exact1=node_value("exact ")

if(exact1.eq.0.or.exact1.eq.1) then
EXACT_MODEL = exact1 .ne. 0
else
EXACT_MODEL = exact0
endif

call zero_key(key)

!j=j+1
Expand Down Expand Up @@ -617,14 +625,6 @@ subroutine ptc_input()
metd = method0
endif

exact1=node_value("exact ")

if(exact1.eq.0.or.exact1.eq.1) then
EXACT_MODEL = exact1 .ne. 0
else
EXACT_MODEL = exact0
endif

!special node keys
key%list%permfringe=node_value("fringe ") ! transfer(node_value("fringe ") .ne. zero, key%list%permfringe)
key%list%bend_fringe=node_value("bend_fringe ") .ne. zero
Expand Down

0 comments on commit a547097

Please sign in to comment.