Last change
on this file was
11,
checked in by aslmd, 15 years ago
|
spiga@svn-planeto:ajoute le modele meso-echelle martien
|
File size:
648 bytes
|
Line | |
---|
1 | module stringutil |
---|
2 | |
---|
3 | integer, parameter :: STRSIZE = 256 |
---|
4 | |
---|
5 | contains |
---|
6 | |
---|
7 | function get_path(s) |
---|
8 | |
---|
9 | implicit none |
---|
10 | |
---|
11 | ! Arguments |
---|
12 | character (len=*) :: s |
---|
13 | |
---|
14 | ! Return value |
---|
15 | character (len=STRSIZE) :: get_path |
---|
16 | |
---|
17 | ! Local variables |
---|
18 | integer :: n, i |
---|
19 | |
---|
20 | n = len(s) |
---|
21 | |
---|
22 | if (n > STRSIZE) then |
---|
23 | write(6,*) 'ERROR: Maximum string length exceeded in get_path()' |
---|
24 | stop |
---|
25 | end if |
---|
26 | |
---|
27 | write(get_path,'(a)') './' |
---|
28 | |
---|
29 | do i=n,1,-1 |
---|
30 | if (s(i:i) == '/') then |
---|
31 | write(get_path,'(a)') s(1:i) |
---|
32 | exit |
---|
33 | end if |
---|
34 | end do |
---|
35 | |
---|
36 | end function get_path |
---|
37 | |
---|
38 | end module stringutil |
---|
Note: See
TracBrowser
for help on using the repository browser.