OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
getfn.f
Go to the documentation of this file.
1  subroutine getfn(filespec,lspec,name,lname)
2 c
3 c *** subroutine to return a filename given a full file specification
4 c
5 c By Jim Firestone, GSC/SAIC, 5/11/94
6 c
7  implicit none
8  integer lspec, index, lnstrg, lname, slash, dot, i
9  character filespec*(*), name*80
10 
11  do i = 1,80
12  name(i:i) = ' '
13  end do
14 
15  if (lspec .lt. 1) lspec = lnstrg(filespec)
16  dot = index(filespec(1:lspec),'.')
17 c
18 c *** step backwards to preceding slash - everything between that slash and
19 c '.' is part of the file name
20 c
21  slash = 0
22  do i = dot, 1, -1
23  if (filespec(i:i) .eq. '/') then
24  slash = i
25  goto 10
26  end if
27  end do
28 
29 10 continue
30  name = filespec(slash+1:dot-1)
31  lname = lnstrg(name)
32 
33  return
34  end
subroutine getfn(filespec, lspec, name, lname)
Definition: getfn.f:2