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

Go to the source code of this file.

Functions/Subroutines

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

Function/Subroutine Documentation

◆ timepointss()

subroutine timepointss ( 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  character*1 inpc(*)
28  character*80 amname(*)
29  character*132 textpart(16)
30 !
31  integer namta(3,*),nam,nam_,istep,istat,n,key,i,namtot,
32  & namtot_,irstrt,iline,ipol,inl,ipoinp(2,*),inp(3,*),ipos,
33  & ipoinpc(0:*),nttp
34 !
35  logical igen
36 !
37 !
38  real*8 amta(2,*),x,tpmin,tpmax,tpinc
39 !
40  igen=.false.
41 
42  if((istep.gt.0).and.(irstrt.ge.0)) then
43  write(*,*) '*ERROR in timepointss: *AMPLITUDE should be'
44  write(*,*) ' placed before all step definitions'
45  call exit(201)
46  endif
47 !
48  nam=nam+1
49  if(nam.gt.nam_) then
50  write(*,*) '*ERROR in timepointss: increase nam_'
51  call exit(201)
52  endif
53  namta(3,nam)=nam
54  amname(nam)='
55  & '
56 !
57  do i=2,n
58  if(textpart(i)(1:5).eq.'NAME=') then
59  amname(nam)=textpart(i)(6:85)
60  if(textpart(i)(86:86).ne.' ') then
61  write(*,*)
62  & '*ERROR in timepointss: amplitude name too long'
63  write(*,*) ' (more than 80 characters)'
64  write(*,*) ' amplitude name:',textpart(i)(1:132)
65  call exit(201)
66  endif
67  elseif(textpart(i)(1:14).eq.'TIME=TOTALTIME') then
68  namta(3,nam)=-nam
69  elseif(textpart(i)(1:8).eq.'GENERATE') then
70  igen=.true.
71  else
72  write(*,*)
73  & '*WARNING in timepointss: parameter not recognized:'
74  write(*,*) ' ',
75  & textpart(i)(1:index(textpart(i),' ')-1)
76  call inputwarning(inpc,ipoinpc,iline,
77  &"*TIME POINTS%")
78  endif
79  enddo
80 !
81  if(amname(nam).eq.'
82  & ') then
83  write(*,*) '*ERROR in timepointss: Amplitude has no name'
84  call inputerror(inpc,ipoinpc,iline,
85  &"*TIME POINTS%")
86  endif
87 !
88  if(nam.eq.1) then
89  namtot=0
90  else
91  namtot=namta(2,nam-1)
92  endif
93  namta(1,nam)=namtot+1
94 !
95  do
96  call getnewline(inpc,textpart,istat,n,key,iline,ipol,inl,
97  & ipoinp,inp,ipoinpc)
98  if((istat.lt.0).or.(key.eq.1)) exit
99  if(.not.igen)then
100  do i=1,8
101  if(textpart(i)(1:1).ne.' ') then
102  namtot=namtot+1
103  if(namtot.gt.namtot_) then
104  write(*,*)
105  & '*ERROR in timepointss: increase namtot_'
106  call exit(201)
107  endif
108  read(textpart(i),'(f20.0)',iostat=istat) x
109  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
110  &"*TIME POINTS%")
111  amta(1,namtot)=x
112  namta(2,nam)=namtot
113  else
114  exit
115  endif
116  enddo
117  else
118  read(textpart(1)(1:20),'(f20.0)',iostat=istat) tpmin
119  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
120  &"*TIME POINTS%")
121  read(textpart(2)(1:20),'(f20.0)',iostat=istat) tpmax
122  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
123  &"*TIME POINTS%")
124  read(textpart(3)(1:20),'(f20.0)',iostat=istat) tpinc
125  if(istat.gt.0) call inputerror(inpc,ipoinpc,iline,
126  &"*TIME POINTS%")
127 !
128  nttp=int((tpmax-tpmin)/tpinc)
129 !
130  if(namtot+2+nttp.gt.namtot_) then
131  write(*,*) '*ERROR in timepoints: increase namtot_'
132  call exit(201)
133  endif
134  amta(1,namtot+1)=tpmin
135  do i=1,nttp
136  amta(1,namtot+1+i)=tpmin+(i*tpinc)
137  enddo
138  namtot=namtot+2+nttp
139  amta(1,namtot)=tpmax
140  namta(2,nam)=namtot
141  endif
142  if(textpart(9)(1:1).ne.' ') then
143  write(*,*) '*WARNING reading *TIME POINTS:'
144  write(*,*) ' only 8 entries per line allowed'
145  write(*,*) ' 9th entry and above will be discarded'
146  call inputwarning(inpc,ipoinpc,iline,
147  &"*TIME POINTS%")
148  endif
149  enddo
150 !
151  if(namta(1,nam).gt.namta(2,nam)) then
152  ipos=index(amname(nam),' ')
153  write(*,*) '*WARNING in timepointss: *TIME POINTS definition ',
154  & amname(nam)(1:ipos-1)
155  write(*,*) ' has no data points'
156  nam=nam-1
157  endif
158 !
159  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)