NLSL
setnm.f90
Go to the documentation of this file.
1 c----------------------------------------------------------------------
2 c =====================
3 c subroutine SETFIL
4 c =====================
5 c
6 c Given a generic name in <fileid>, this subroutine removes any
7 c file extension from <fileid> and determines the names for the
8 c various possible output files associated with the NLSL slow-
9 c motional fitting calculations by appending a file extension
10 c in the form '.xxx'. The extensions are
11 c
12 c prname : <fileid>.PAR Parameter file (formatted)
13 c lgname : <fileid>.LOG Log file for fitting results
14 c trname : <fileid>.TRC Trace of NLS steps
15 c
16 c Includes
17 c nlsdim.inc
18 c nlsnam.inc Definition of names in common /nlsnam/
19 c
20 c----------------------------------------------------------------------
21  subroutine setfil( fileid )
22 c
23  use nlsdim
24  use nlsnam
25 c
26  implicit none
27  character*30 fileid
28 c
29  integer iend,iroot
30  character*1 chr
31  external iroot
32 c
33 c######################################################################
34 c
35  iend = iroot( fileid )
36  if (iend .lt. 1) then
37  fileid = 'noname'
38  iend = 6
39  endif
40 c
41  prname=fileid(:iend)//'.par'
42  lgname=fileid(:iend)//'.log'
43  trname=fileid(:iend)//'.trc'
44  lthfnm=iend+4
45  return
46  end
47 c----------------------------------------------------------------------
48 c =====================
49 c subroutine SETDAT
50 c =====================
51 c
52 c Given a generic name in <dataid>, this subroutine removes any
53 c file extension from <dataid> and determines the names for the
54 c various input and output files associated with the NLSL slow-
55 c motional fitting calculations by appending a file extension
56 c in the form '.xxx'. The extensions are
57 c
58 c dtname : <dataid>.DAT Datafile
59 c spname : <dataid>.SPC Calculated spectrum and fit
60 c
61 c Includes
62 c nlsdim.inc
63 c nlsnam.inc Definition of names in common /nlsnam/
64 c
65 c----------------------------------------------------------------------
66  subroutine setdat( dataid )
67 c
68  use nlsdim
69  use nlsnam
70 c
71  implicit none
72  character*30 dataid
73 c
74  integer iend,iroot
75  character*1 chr
76  external iroot
77 c
78 c######################################################################
79 c
80  iend = iroot( dataid )
81 c
82  if (iend .lt. 1) then
83  dataid = 'noname'
84  iend = 6
85  endif
86 c
87  dtname=dataid(:iend)//'.dat'
88  spname=dataid(:iend)//'.spc'
89  lthdnm=iend+4
90  return
91  end
92 
93 
94 c----------------------------------------------------------------------
95 c =========================
96 c function IROOT
97 c =========================
98 c Strips the dot and trailing file extension from a file name
99 c and returns the length of the root name
100 c----------------------------------------------------------------------
101  function iroot( fileid )
102 c
103  use nlsdim
104 c
105  implicit none
106  integer i,iroot
107  character fileid*30,chr*1
108 c
109  i=0
110  1 i=i+1
111  chr=fileid(i:i)
112  if(chr.ne.'.' .and. chr.ne.' '.and.i.lt.30) goto 1
113 c
114  fileid=fileid(:i-1)
115  iroot=i-1
116  return
117  end
integer, save lthfnm
Definition: nlsnam.f90:27
character *30, save prname
Definition: nlsnam.f90:28
character *30, save dtname
Definition: nlsnam.f90:28
integer, save lthdnm
Definition: nlsnam.f90:27
integer function iroot(fileid)
Definition: setnm.f90:102
character *30, save lgname
Definition: nlsnam.f90:28
subroutine setdat(dataid)
Definition: setnm.f90:67
character *30, save trname
Definition: nlsnam.f90:28
subroutine setfil(fileid)
Definition: setnm.f90:22
character *30, save spname
Definition: nlsnam.f90:28