12 fp = fopen(
"divb.dat",
"w");
14 fprintf (fp,
"# time tot(t) av_tot(t) max\n");
15 fprintf (fp,
"# ------------------------------------\n");
23 dB = fabs(divB[k][j][i]);
28 tot[n] /= (
double)grid[
IDIR].np_int_glob; ,
29 tot[
n] /= (double)grid[
JDIR].np_int_glob; ,
30 tot[
n] /= (double)grid[
KDIR].np_int_glob;
34 MPI_Allreduce (tot + n, >ot, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
35 MPI_Allreduce (&max, &gmax, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
43 for (i = 1; i <=
n; i++) atot += tot[i];
49 printf (
"> writing divB to disk (%d)\n",n);
50 fp = fopen(
"divb.dat",
"a");
51 fprintf (fp,
"%f %f %f %f\n",
g_time, tot[n], atot, max);
58 -----------------------------------------------------------
61 for xx in
"0.1" "0.2" "0.4" "0.8" "1.6" "3.2"
64 ./pluto -par $xx > out.log
65 /bin/cp divb.dat divb.$xx.dat
D_EXPAND(tot/[n]=(double) grid[IDIR].np_int_glob;, tot/[n]=(double) grid[JDIR].np_int_glob;, tot/[n]=(double) grid[KDIR].np_int_glob;)
double *** GLM_GetDivB(void)
double g_time
The current integration time.