CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
amplitudes.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine amplitudes (inpc, textpart, amname, amta, namta, nam, nam_, namtot_, irstrt, istep, istat, n, iline, ipol, inl, ipoinp, inp, ipoinpc)
 

Function/Subroutine Documentation

◆ amplitudes()

subroutine amplitudes ( character*1, dimension(*)  inpc,
character*132, dimension(16)  textpart,
character*80, dimension(*)  amname,
real*8, dimension(2,*)  amta,
integer, dimension(3,*)  namta,
integer  nam,
integer  nam_,
integer  namtot_,
integer  irstrt,
integer  istep,
integer  istat,
integer  n,
integer  iline,
integer  ipol,
integer  inl,
integer, dimension(2,*)  ipoinp,
integer, dimension(3,*)  inp,
integer, dimension(0:*)  ipoinpc 
)
22 !
23 ! reading the input deck: *AMPLITUDE
24 !
25  implicit none
26 !
27  logical user
28 !
29  character*1 inpc(*)
30  character*80 amname(*)
31  character*132 textpart(16)
32 !
33  integer namta(3,*),nam,nam_,istep,istat,n,key,i,namtot,
34  & namtot_,irstrt,iline,ipol,inl,ipoinp(2,*),inp(3,*),ipos,
35  & ipoinpc(0:*)
36 !
37  real*8 amta(2,*),x,y,shiftx,shifty
38 !
39  user=.false.
40 !
41  shiftx=0.d0
42  shifty=0.d0
43 !
44  if((istep.gt.0).and.(irstrt.ge.0)) then
45  write(*,*) '*ERROR reading *AMPLITUDE: *AMPLITUDE should be'
46  write(*,*) ' placed before all step definitions'
47  call exit(201)
48  endif
49 !
50  nam=nam+1
51  if(nam.gt.nam_) then
52  write(*,*) '*ERROR reading *AMPLITUDE: increase nam_'
53  call exit(201)
54  endif
55  namta(3,nam)=nam
56  amname(nam)='
57  & '
58 !
59  do i=2,n
60  if(textpart(i)(1:5).eq.'NAME=') then
61  amname(nam)=textpart(i)(6:85)
62  if(textpart(i)(86:86).ne.' ') then
63  write(*,*) '*ERROR reading *AMPLITUDE: amplitude'
64  write(*,*) ' name is too long'
65  write(*,*) ' (more than 80 characters)'
66  write(*,*) ' amplitude name:',textpart(i)(1:132)
67  call exit(201)
68  endif
69  elseif(textpart(i)(1:14).eq.'TIME=TOTALTIME') then
70  namta(3,nam)=-nam
71  elseif(textpart(i)(1:4).eq.'USER') then
72  namta(1,nam)=0
73  namta(2,nam)=0
74  user=.true.
75  elseif(textpart(i)(1:18).eq.'DEFINITION=TABULAR') then
76  cycle
77  elseif(textpart(i)(1:14).eq.'VALUE=RELATIVE') then
78  cycle
79  elseif(textpart(i)(1:6).eq.'SHIFTX') then
80  read(textpart(i)(8:27),'(f20.0)',iostat=istat) shiftx
81  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
82  &"*AMPLITUDE%")
83  elseif(textpart(i)(1:6).eq.'SHIFTY') then
84  read(textpart(i)(8:27),'(f20.0)',iostat=istat) shifty
85  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
86  &"*AMPLITUDE%")
87  else
88  write(*,*)
89  & '*WARNING reading *AMPLITUDE: parameter not recognized:'
90  write(*,*) ' ',
91  & textpart(i)(1:index(textpart(i),' ')-1)
92  call inputwarning(inpc,ipoinpc,iline,
93  &"*AMPLITUDE%")
94  endif
95  enddo
96 !
97  if(amname(nam).eq.'
98  & ') then
99  write(*,*) '*ERROR reading *AMPLITUDE: Amplitude has no name'
100  call inputerror(inpc,ipoinpc,iline,
101  &"*AMPLITUDE%")
102  endif
103 !
104  if(.not.user) then
105  if(nam.eq.1) then
106  namtot=0
107  else
108  namtot=namta(2,nam-1)
109  endif
110  namta(1,nam)=namtot+1
111  endif
112 !
113  do
114  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
115  & ipoinp,inp,ipoinpc)
116  if((istat.lt.0).or.(key.eq.1)) exit
117  do i=1,4
118  if(textpart(2*i-1)(1:1).ne.' ') then
119  namtot=namtot+1
120  if(namtot.gt.namtot_) then
121  write(*,*)
122  & '*ERROR reading *AMPLITUDE: increase namtot_'
123  call exit(201)
124  endif
125  read(textpart(2*i-1),'(f20.0)',iostat=istat) x
126  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
127  &"*AMPLITUDE%")
128  read(textpart(2*i),'(f20.0)',iostat=istat) y
129  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
130  &"*AMPLITUDE%")
131  amta(1,namtot)=x+shiftx
132  amta(2,namtot)=y+shifty
133  namta(2,nam)=namtot
134  else
135  exit
136  endif
137  enddo
138  enddo
139 !
140  if(namta(1,nam).gt.namta(2,nam)) then
141  ipos=index(amname(nam),' ')
142  write(*,*)
143  & '*WARNING reading *AMPLITUDE: *AMPLITUDE definition ',
144  & amname(nam)(1:ipos-1)
145  write(*,*) ' has no data points'
146  nam=nam-1
147  endif
148 !
149  return
subroutine inputwarning(inpc, ipoinpc, iline, text)
Definition: inputwarning.f:20
subroutine getnewline(inpc, textpart, istat, n, key, iline, ipol, inl, ipoinp, inp, ipoinpc)
Definition: getnewline.f:21
subroutine inputerror(inpc, ipoinpc, iline, text)
Definition: inputerror.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)