@@ -41,30 +41,32 @@ contains
4141
4242 #:for k1, t1 in KINDS_TYPES
4343 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
5050 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
5252 ${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+ !!
6870 integer :: s
6971 integer :: nrow, ncol, i
7072
@@ -88,19 +90,22 @@ contains
8890
8991 #:for k1, t1 in KINDS_TYPES
9092 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+ !!
9698 character(len=*), intent(in) :: filename ! File to save the array to
9799 ${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+ !!
104109
105110 integer :: s, i
106111 s = open(filename, "w")
@@ -113,7 +118,7 @@ contains
113118
114119
115120 integer function number_of_columns(s)
116- ! determine number of columns
121+ !! determine number of columns
117122 integer,intent(in) :: s
118123
119124 integer :: ios
@@ -135,7 +140,7 @@ contains
135140
136141
137142 integer function number_of_rows_numeric(s) result(nrows)
138- ! determine number or rows
143+ !! determine number or rows
139144 integer,intent(in)::s
140145 integer :: ios
141146
0 commit comments