PLUTO
4.4-patch2
|
Write / Read orbital velocity to / from disk. More...
#include "pluto.h"
Functions | |
void | FARGO_Restart (const Data *d, char *dir, int nfile, int swap_endian, Grid *grid) |
The function FARGO_Write() is used to write the orbital velocity wA to disk whenever orbtial velocity is re-computed dynamically For restarting purposes, this 2D array is written with ghost zones included.
In parallel, this is achieved by looping the processor's rank over the transverse directions (e.g. x, z) of the Cartesian MPI topology. Only processors with Cartesian coordinate j = 0 write to disk. A new MPI_Datatype is redefined each time in order to account for the different array sizes. From the MPI cartesian topology
(0,npz-1) (1,npz-1) (2,npz-1) . . . (npx-1,npz-1) . . . . . . (0,2) . . (0,1) (1,1) (2,1) . . . (npx-1,1) (0,0) (1,0) (2,0) . . . (npx-1,0)
interior processor with coordinates (i,k) such that 0 < i < npx-1 and 0 < k < npz-1 do not include guard cells and have size (NX1*NX3).
If i = 0 and 0 < k < npz-1, the array has size (NX1+nghost)*NX3 and will start from the left boundary (start[0] = 0). If i = npx-1 and 0 < k < npz-1, the array has size (NX1+nghost)*NX3 and include ghost zones on the right (start[0] = nghost[]) A similar argument applies when k = 0 or k = npz-1 and 0 < i < npx-1. At corners [ (0,0), (npx1-1, 0), (0,npz-1), (npx-1, npz-1)] the array will have size (NX1+nghost)*(NX3+nghost). The start[] array is always = nghost, unless i or k are equal to 0.