@@ -41,30 +41,32 @@ contains
41
41
42
42
#:for k1, t1 in KINDS_TYPES
43
43
subroutine loadtxt_${t1[0]}$${k1}$(filename, d)
44
- ! Loads a 2D array from a text file.
45
- !
46
- ! Arguments
47
- ! ---------
48
- !
49
- ! Filename to load the array from
44
+ !! Loads a 2D array from a text file.
45
+ !!
46
+ !! Arguments
47
+ !! ---------
48
+ !!
49
+ !! Filename to load the array from
50
50
character(len=*), intent(in) :: filename
51
- ! The array 'd' will be automatically allocated with the correct dimensions
51
+ !! The array 'd' will be automatically allocated with the correct dimensions
52
52
${t1}$, allocatable, intent(out) :: d(:,:)
53
- !
54
- ! Example
55
- ! -------
56
- !
57
- ! ${t1}$, allocatable :: data(:, :)
58
- ! call loadtxt("log.txt", data) ! 'data' will be automatically allocated
59
- !
60
- ! Where 'log.txt' contains for example::
61
- !
62
- ! 1 2 3
63
- ! 2 4 6
64
- ! 8 9 10
65
- ! 11 12 13
66
- ! ...
67
- !
53
+ !!
54
+ !! Example
55
+ !! -------
56
+ !!
57
+ !!```fortran
58
+ !! ${t1}$, allocatable :: data(:, :)
59
+ !! call loadtxt("log.txt", data) ! 'data' will be automatically allocated
60
+ !!```
61
+ !!
62
+ !! Where 'log.txt' contains for example::
63
+ !!
64
+ !! 1 2 3
65
+ !! 2 4 6
66
+ !! 8 9 10
67
+ !! 11 12 13
68
+ !! ...
69
+ !!
68
70
integer :: s
69
71
integer :: nrow, ncol, i
70
72
@@ -88,19 +90,22 @@ contains
88
90
89
91
#:for k1, t1 in KINDS_TYPES
90
92
subroutine savetxt_${t1[0]}$${k1}$(filename, d)
91
- ! Saves a 2D array into a text file.
92
- !
93
- ! Arguments
94
- ! ---------
95
- !
93
+ !! Saves a 2D array into a text file.
94
+ !!
95
+ !! Arguments
96
+ !! ---------
97
+ !!
96
98
character(len=*), intent(in) :: filename ! File to save the array to
97
99
${t1}$, intent(in) :: d(:,:) ! The 2D array to save
98
- !
99
- ! Example
100
- ! -------
101
- !
102
- ! ${t1}$ :: data(3, 2)
103
- ! call savetxt("log.txt", data)
100
+ !!
101
+ !! Example
102
+ !! -------
103
+ !!
104
+ !!```fortran
105
+ !! ${t1}$ :: data(3, 2)
106
+ !! call savetxt("log.txt", data)
107
+ !!```
108
+ !!
104
109
105
110
integer :: s, i
106
111
s = open(filename, "w")
@@ -113,7 +118,7 @@ contains
113
118
114
119
115
120
integer function number_of_columns(s)
116
- ! determine number of columns
121
+ !! determine number of columns
117
122
integer,intent(in) :: s
118
123
119
124
integer :: ios
@@ -135,7 +140,7 @@ contains
135
140
136
141
137
142
integer function number_of_rows_numeric(s) result(nrows)
138
- ! determine number or rows
143
+ !! determine number or rows
139
144
integer,intent(in)::s
140
145
integer :: ios
141
146
0 commit comments