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

Go to the source code of this file.

Functions/Subroutines

subroutine includefilename (text, includefn, lincludefn)
 

Function/Subroutine Documentation

◆ includefilename()

subroutine includefilename ( character*1320  text,
character*132  includefn,
integer  lincludefn 
)
20 !
21 ! determines the name of an include file
22 !
23  implicit none
24 !
25  character*132 includefn
26  character*1320 text
27 !
28  integer nstart,nend,ii,jj,kk,lincludefn
29 !
30  nstart=0
31  nend=0
32 !
33  loop: do ii=1,lincludefn
34  if(text(ii:ii).eq.'=') then
35  jj=ii+1
36  if(text(jj:jj).eq.'"') then
37  nstart=jj+1
38  do kk=jj+1,lincludefn
39  if(text(kk:kk).eq.'"') then
40  nend=kk-1
41  exit loop
42  endif
43  enddo
44  write(*,*)'*ERROR in includefilename: ',
45  & 'finishing quotes are lacking'
46  write(*,*) '*ERROR in the input deck. Card image:'
47  write(*,'(132a1)')
48  & (text(kk:kk),kk=1,lincludefn)
49  call exit(201)
50  else
51  nstart=jj
52  nend=lincludefn
53  exit
54  endif
55  endif
56  enddo loop
57  if(ii.eq.lincludefn+1) then
58  write(*,*) '*ERROR in includefilename: syntax error'
59  write(*,*) '*ERROR in the input deck. Card image:'
60  write(*,'(132a1)')
61  & (text(kk:kk),kk=1,lincludefn)
62  call exit(201)
63  endif
64 !
65  if(nend.ge.nstart) then
66  if(nend-nstart+1.le.132) then
67  includefn(1:nend-nstart+1)=text(nstart:nend)
68  lincludefn=nend-nstart+1
69  else
70  write(*,*) '*ERROR in includefilename: file name too long'
71  write(*,*) '*ERROR in the input deck. Card image:'
72  write(*,'(132a1)')
73  & (text(kk:kk),kk=1,lincludefn)
74  call exit(201)
75  endif
76  else
77  write(*,*) '*ERROR in includefilename: file name is lacking'
78  write(*,*) '*ERROR in the input deck. Card image:'
79  write(*,'(132a1)')
80  & (text(kk:kk),kk=1,lincludefn)
81  call exit(201)
82  endif
83 !
84  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)