27 #include "sll_working_precision.h"
57 character(len=*),
intent(in) :: file_name
58 sll_int32,
intent(out) :: error
59 sll_int32,
intent(out) :: file_id
80 open(newunit=file_id,file=file_name,form=
'FORMATTED',iostat=error)
87 sll_int32,
intent(in) :: file_id
88 sll_int32,
intent(out) :: error
90 close (file_id, iostat=error)
96 sll_int32,
intent(in) :: file_id
97 sll_int32,
intent(out) :: error
98 sll_real64,
intent(in) :: array
99 write (file_id, *, iostat=error) array
104 sll_int32,
intent(in) :: file_id
105 sll_int32,
intent(out) :: error
106 sll_real64,
intent(in) :: array(:)
107 sll_int32,
intent(in),
optional :: num_points
108 sll_real64,
intent(in),
optional :: array2(:)
109 sll_real64,
intent(in),
optional :: array3(:)
111 character(len=30) :: rowfmt
113 if (.not.
present(num_points))
then
114 write (file_id, *, iostat=error) array
116 if (
size(array) < num_points)
then
117 print *,
'#bad size for array'
118 print *,
'#at line/file', __line__, __file__
121 if (
present(array2))
then
122 if (
size(array2) < num_points)
then
123 print *,
'#bad size for array2'
124 print *,
'#at line/file', __line__, __file__
127 if (
present(array3))
then
128 if (
size(array3) < num_points)
then
129 print *,
'#bad size for array3'
130 print *,
'#at line/file', __line__, __file__
134 write (file_id, *, iostat=error) array(i), array2(i), array3(i)
138 write (file_id, *, iostat=error) array(i), array2(i)
142 write (rowfmt,
'(a,i7,a)')
'(', num_points,
'(1x,g15.5))'
144 write (file_id, trim(rowfmt), iostat=error) array(i)
153 sll_int32,
intent(in) :: file_id
154 sll_int32,
intent(out) :: error
155 sll_real64,
intent(in) :: array(:, :)
156 write (file_id,
"(100(1x,g15.5))", iostat=error) array
161 sll_int32,
intent(in) :: file_id
162 sll_int32,
intent(out) :: error
163 sll_real64,
intent(in) :: array(:, :, :)
164 write (file_id, *, iostat=error) array
170 sll_int32 ,
intent(in) :: file_id
171 sll_real64,
intent(in) :: array(:)
172 sll_int32,
intent(in) :: num_points
176 write(file_id,
'(2g24.16)', advance=
'no') array(i)
178 write(file_id,
'(2g24.16)') array(num_points)
Write nD array in ascii file.
Module that contains routines to write data in ASCII format file.
subroutine, public sll_s_ascii_write_array_1d(file_id, array, error, num_points, array2, array3)
Write a 1d array ASCII format.
subroutine, public sll_s_ascii_file_close(file_id, error)
Close ASCII file.
subroutine, public sll_s_ascii_write_array_1d_as_row(file_id, array, num_points)
Write a 1d array ASCII format.
subroutine sll_ascii_write_array_3d(file_id, array, error)
Write a 3d array ASCII format.
subroutine, public sll_s_ascii_file_create(file_name, file_id, error)
Create ASCII file.
subroutine sll_ascii_write_array_0d(file_id, array, error)
Write a 1d array ASCII format.
subroutine, public sll_s_ascii_write_array_2d(file_id, array, error)
Write a 2d array ASCII format.