aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/utilities.F9020
1 files changed, 20 insertions, 0 deletions
diff --git a/common/utilities.F90 b/common/utilities.F90
index dbd0423..61c5d93 100644
--- a/common/utilities.F90
+++ b/common/utilities.F90
@@ -98,6 +98,26 @@ contains
end subroutine combine_paths
+ subroutine path_from_file(file, path)
+ implicit none
+
+ character(*), intent(in)::file
+ character(*), intent(out)::path
+ integer::i
+
+ i = index(file, '/', back=.true.)
+ if(i <= 0) then
+ i = index(file, '\', back=.true.)
+ end if
+
+ if(i <= 0) then
+ path = '.'
+ else
+ path = file(1:i)
+ end if
+
+ end subroutine path_from_file
+
subroutine write_date_and_time(unit_number, values)
implicit none