NLSL: setnm.f90 Source File

NLSL

- Main Page
- Modules
- Data Types List
- Files

- File List
- File Members

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
nlsnam::lthfnm
integer, save lthfnm
Definition: nlsnam.f90:27
nlsnam::prname
character *30, save prname
Definition: nlsnam.f90:28
nlsnam::dtname
character *30, save dtname
Definition: nlsnam.f90:28
nlsnam::lthdnm
integer, save lthdnm
Definition: nlsnam.f90:27
nlsnam
Definition: nlsnam.f90:21
iroot
integer function iroot(fileid)
Definition: setnm.f90:102
nlsnam::lgname
character *30, save lgname
Definition: nlsnam.f90:28
setdat
subroutine setdat(dataid)
Definition: setnm.f90:67
nlsnam::trname
character *30, save trname
Definition: nlsnam.f90:28
nlsdim
Definition: nlsdim.f90:36
setfil
subroutine setfil(fileid)
Definition: setnm.f90:22
nlsnam::spname
character *30, save spname
Definition: nlsnam.f90:28