32 #include "sll_assert.h"
33 #include "sll_working_precision.h"
35 #ifdef __INTEL_COMPILER
71 array_name, iplot, error)
73 sll_real64,
dimension(:, :),
intent(in) :: array_x
74 sll_real64,
dimension(:, :),
intent(in) :: array_y
75 sll_real64,
dimension(:, :),
intent(in) :: array
76 character(len=*),
intent(in) :: array_name
77 sll_int32,
intent(in) :: iplot
78 sll_int32,
intent(out):: error
80 character(len=4) :: fin
81 sll_int32,
save :: gnu_id
84 character(len=4) :: cproc
85 sll_int32 :: iproc, nproc
87 logical,
save :: first_call = .true.
95 #ifdef __INTEL_COMPILER
96 if (makedirqq(cproc))
then
97 print *,
' Make directory '//cproc
100 inquire (file=cproc//
"/"".", exist=dir_e)
101 if (.not. dir_e)
then
102 call execute_command_line(
"mkdir -p "//cproc)
106 sll_assert_always(
size(array_x, 1) ==
size(array_y, 1))
107 sll_assert_always(
size(array_x, 2) ==
size(array_y, 2))
108 sll_assert_always(
size(array, 1) ==
size(array_x, 1))
109 sll_assert_always(
size(array, 2) ==
size(array_x, 2))
110 sll_assert_always(
size(array, 1) ==
size(array_y, 1))
111 sll_assert_always(
size(array, 2) ==
size(array_y, 2))
118 do i = 1,
size(array, 1)
119 do j = 1,
size(array, 2)
120 write (file_id, *) sngl(array_x(i, j)), sngl(array_y(i, j)), sngl(array(i, j))
126 if (iproc == mpi_master)
then
130 open (gnu_id, file=array_name//
".gnu")
134 open (gnu_id, file=array_name//
".gnu", position=
"append")
137 write (gnu_id, *)
"set title 'Time = ", iplot,
"'"
138 write (gnu_id,
"(a)", advance=
'no') &
139 "splot '"//
"0000/"//array_name//
'_'//fin//
".dat' w l"
140 do iproc = 1, nproc - 1
142 write (gnu_id,
"(a)", advance=
'no') &
143 ",'"//cproc//
"/"//array_name//
'_'//fin//
".dat' w l "
170 sll_real64,
intent(in) :: x_min
171 sll_real64,
intent(in) :: delta_x
172 sll_real64,
intent(in) :: y_min
173 sll_real64,
intent(in) :: delta_y
174 sll_int32,
intent(in) :: npts_x
175 sll_int32,
intent(in) :: npts_y
176 sll_real64,
intent(in) :: array(:, :)
177 character(len=*),
intent(in) :: array_name
178 sll_int32,
intent(in) :: iplot
179 sll_int32,
intent(out) :: error
181 character(len=4) :: fin
182 sll_int32,
save :: gnu_id
186 character(len=4) :: cproc
187 sll_int32 :: iproc, nproc
189 logical,
save :: first_call = .true.
197 #ifdef __INTEL_COMPILER
198 if (makedirqq(cproc))
then
199 print *,
' Make directory '//cproc
202 inquire (file=cproc//
"/"".", exist=dir_e)
203 if (.not. dir_e)
then
204 call execute_command_line(
"mkdir -p "//cproc)
211 y = y_min + real(j - 1, f64)*delta_y
213 x = x_min + real(i - 1, f64)*delta_x
214 write (file_id, *) sngl(x), sngl(y), sngl(array(i, j))
220 if (iproc == mpi_master)
then
224 open (gnu_id, file=array_name//
".gnu")
228 open (gnu_id, file=array_name//
".gnu", position=
"append")
231 write (gnu_id, *)
"set title 'Time = ", iplot,
"'"
232 write (gnu_id, *)
"set output '"//array_name//
'_'//fin//
".png'"
233 write (gnu_id,
"(a)", advance=
'no') &
234 "splot '"//
"0000/"//array_name//
'_'//fin//
".dat' w l"
235 do iproc = 1, nproc - 1
237 write (gnu_id,
"(a)", advance=
'no') &
238 ",'"//cproc//
"/"//array_name//
'_'//fin//
".dat' w l "
Create a gnuplot file for a 2d mesh (cartesian or curvilinear)
Module that contains routines to write data in ASCII format file.
subroutine, public sll_s_ascii_file_create(file_name, file_id, error)
Create ASCII file.
integer(kind=i32) function, public sll_f_get_collective_rank(col)
Determines the rank of the calling process in the communicator.
type(sll_t_collective_t), pointer, public sll_v_world_collective
Control of subset assignment. Processes with the same color are in the same new communicator.
integer(kind=i32) function, public sll_f_get_collective_size(col)
Determines the size of the group associated with a communicator.
parallel version of sll_m_gnuplot
subroutine, public sll_s_gnuplot_curv_2d_parallel(array_x, array_y, array, array_name, iplot, error)
write a data file plotable by gnuplot to visualize a 2d field
subroutine, public sll_s_gnuplot_rect_2d_parallel(x_min, delta_x, y_min, delta_y, npts_x, npts_y, array, array_name, iplot, error)
write a data file plotable by gnuplot to visualize a 2d field
Some common numerical utilities.
subroutine, public sll_s_int2string(istep, cstep)
Convert an integer < 9999 to a 4 characters string.
subroutine, public sll_s_new_file_id(file_id, error)
Get a file unit number free before creating a file.