source: PSPA/parmelaPSPA/trunk/change.f @ 405

Last change on this file since 405 was 12, checked in by lemeur, 12 years ago

parmela pspa initial

File size: 1.3 KB
Line 
1      subroutine change
2c---change card parameters are np, ne, value, where value is the
3c---new value assigned to parameter number np for element number ne.
4c-------------------------------------------------------------------
5      save
6c
7      include 'param_sz.h'
8      include 'constcom.h'
9      include 'misccom.h'
10      include 'syscom.h'
11      include 'var_char.h'
12      include 'ucom.h'
13c
14c--------------------------------------------------------------------------
15c*
16      np=vv(1)
17      ne=vv(2)
18      if(np.eq.1)then
19      write(ndiag,*)' the length of and element can not be changed'
20      call appendparm
21      stop ' Abnormal stop change '
22      endif
23      el(np,ne)=vv(3)
24      if(ntype(ne).eq.7.and.np.eq.4)then
25c--this is a cell so change el parm 9 and 10
26      phi=el(4,ne)*radian
27      el(9,ne)=sin(phi)
28      el(10,ne)=cos(phi)
29      endif
30      if(ntype(ne).eq.4)then
31c--This is a bend so convert degress to radians
32           if(np.ge.5.and.np.le.9)el(np,ne)=el(np,ne)*radian
33           if(np.eq.4)then
34               gr=el(4,ne)/erest
35               bg=sqrt(gr*(2.+gr))
36               el(10,ne)=bg
37               el(4,ne)=el(1,ne)/el(5,ne)
38           endif
39           if(np.eq.5)el(4,ne)=el(1,ne)/el(5,ne)
40      endif
41      return
42      end
43c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.