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

Go to the source code of this file.

Functions/Subroutines

subroutine openfile (jobname, output)
 

Function/Subroutine Documentation

◆ openfile()

subroutine openfile ( character*132  jobname,
character*3  output 
)
20 !
21  implicit none
22 !
23  logical exi
24  character*3 output
25  character*132 jobname,fnin,fndat,fnfrd,fnsta,fncvg,fncel
26  integer i
27 !
28 ! opening the input and output file
29 !
30  do i=1,132
31  if(jobname(i:i).eq.' ') exit
32  enddo
33  i=i-1
34  if(i.gt.128) then
35  write(*,*) '*ERROR in openfile: input file name is too long:'
36  write(*,'(a132)') jobname(1:132)
37  write(*,*) ' exceeds 128 characters'
38  call exit(201)
39  endif
40 !
41 c fnin=jobname(1:i)//'.inp'
42 c inquire(file=fnin(1:i+4),exist=exi)
43 c if(exi) then
44 c open(1,file=fnin(1:i+4),status='old',err=1)
45 c else
46 c write(*,*) '*ERROR in openfile: input file ',fnin
47 c write(*,*) 'does not exist'
48 c call exit(201)
49 c endif
50 !
51  fndat=jobname(1:i)//'.dat'
52  open(5,file=fndat(1:i+4),status='unknown',err=51)
53  close(5,status='delete',err=52)
54  open(5,file=fndat(1:i+4),status='unknown',err=51)
55 !
56 ! delete the .frd file (it is reopened in frd.c)
57 !
58  fnfrd=jobname(1:i)//'.frd'
59  open(7,file=fnfrd(1:i+4),status='unknown',err=71)
60  close(7,status='delete',err=72)
61 !
62 ! delete the f.frd file (it is reopened in openfilefluid.f)
63 !
64  fnfrd=jobname(1:i)//'f.frd'
65  open(13,file=fnfrd(1:i+5),status='unknown',err=71)
66  close(13,status='delete',err=73)
67 !
68 ! delete the f.cvg file (it is reopened in compfluid.c)
69 !
70  fnfrd=jobname(1:i)//'f.cvg'
71  open(12,file=fnfrd(1:i+5),status='unknown',err=71)
72  close(12,status='delete',err=73)
73 !
74 ! .sta-file
75 !
76  fnsta=jobname(1:i)//'.sta'
77  open(8,file=fnsta(1:i+4),status='unknown',err=81)
78  close(8,status='delete',err=82)
79  open(8,file=fnsta(1:i+4),status='unknown',err=81)
80  write(8,100)
81  write(8,101)
82  100 format('SUMMARY OF JOB INFORMATION')
83  101 format(' STEP INC ATT ITRS TOT TIME STEP TIME
84  & INC TIME')
85 !
86 ! .cvg-file
87 !
88  fncvg=jobname(1:i)//'.cvg'
89  open(11,file=fncvg(1:i+4),status='unknown',err=91)
90  close(11,status='delete',err=92)
91  open(11,file=fncvg(1:i+4),status='unknown',err=91)
92  write(11,102)
93  write(11,103)
94  write(11,104)
95  write(11,105)
96  102 format('SUMMARY OF C0NVERGENCE INFORMATION')
97  103 format(' STEP INC ATT ITER CONT. RESID. CORR.
98  & RESID. CORR.' )
99  104 format(' EL. FORCE DISP
100  & FLUX TEMP.' )
101  105 format(' (#) (%) (%)
102  & (%) (%)')
103 !
104 ! contact elements
105 !
106  fncel=jobname(1:i)//'.cel'
107  open(27,file=fncel(1:i+4),status='unknown',err=93)
108  close(27,status='delete',err=94)
109 !
110  return
111 !
112  1 write(*,*) '*ERROR in openfile: could not open file ',fnin(1:i+4)
113  call exit(201)
114  51 write(*,*) '*ERROR in openfile: could not open file ',fndat(1:i+4)
115  call exit(201)
116  52 write(*,*) '*ERROR in openfile: could not delete file ',
117  & fndat(1:i+4)
118  call exit(201)
119  71 write(*,*) '*ERROR in openfile: could not open file ',fnfrd(1:i+4)
120  call exit(201)
121  72 write(*,*) '*ERROR in openfile: could not delete file ',
122  & fnfrd(1:i+4)
123  call exit(201)
124  73 write(*,*) '*ERROR in openfile: could not delete file ',
125  & fnfrd(1:i+5)
126  call exit(201)
127  81 write(*,*) '*ERROR in openfile: could not open file ',fnsta(1:i+4)
128  call exit(201)
129  82 write(*,*) '*ERROR in openfile: could not delete file ',
130  & fnsta(1:i+4)
131  91 write(*,*) '*ERROR in openfile: could not open file ',fncvg(1:i+4)
132  call exit(201)
133  92 write(*,*) '*ERROR in openfile: could not delete file ',
134  & fncvg(1:i+4)
135  93 write(*,*) '*ERROR in openfile: could not open file ',fncel(1:19)
136  call exit(201)
137  94 write(*,*) '*ERROR in openfile: could not delete file ',
138  & fncel(1:19)
139  call exit(201)
Hosted by OpenAircraft.com, (Michigan UAV, LLC)