29 for (i = 0; i < n; i++) {
30 sprintf (name,
"%splanet%d.dat",
OUTPUTDIR, i);
31 output =
fopenp (name,
"w");
43 printf (
"Updating 'planet%d.dat'...", n);
45 sprintf (name,
"%splanet%d.dat",
OUTPUTDIR, n);
46 output =
fopenp (name,
"a");
47 fprintf (output,
"%d\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\n",\
60 for (i = 0; i < n; i++) {
78 sprintf (name,
"%sbigplanet%d.dat",
OUTPUTDIR, n);
79 output =
fopenp (name,
"a");
80 fprintf (output,
"%d\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\t%#.18g\n",\
91 for (i = 0; i < n; i++) {
110 sprintf (name,
"%splanet%d.dat",
OUTPUTDIR, n);
111 input = fopen (name,
"r");
113 mastererr (
"Can't read 'planet%d.dat' file. Aborting restart.\n",n);
117 mastererr (
"Invalid column number in 'planet%d.dat'. Aborting restart.\n",n);
121 pt = fgets (testline, 255, input);
122 sscanf (testline,
"%d", &time);
123 }
while ((time != TimeStep) && (pt != NULL));
125 mastererr (
"Can't read entry %d in 'planet%d.dat' file. Aborting restart.\n", TimeStep,n);
131 pt += strspn(pt,
"eE0123456789-.");
132 pt += strspn(pt,
"\t :=>_");
135 sscanf (pt,
"%lf", &value);
144 for (k = 0; k < sys->nb; k++) {
163 sprintf (name,
"%s%s%d.dat",
OUTPUTDIR, array->Name, number);
168 dump =
fopenp (name,
"w");
169 masterprint (
"Writing '%s%d.dat'...", array->Name, number);
183 fwrite (ptr,
sizeof(
real), Nr*Ns,dump);
195 sprintf (filename,
"%sdims.dat",
OUTPUTDIR);
196 dim =
fopenp (filename,
"w");
197 fprintf (dim,
"%d\t%d\t\t%d\t%d\t%f\t%d\t%d\t%d\n",\
204 PolarGrid *dens, *gasvr, *gasvt, *gasenerg, *label;
208 printf (
"\n*** OUTPUT %d ***\n", index);
249 for (i=0; i<nr; i++) {
250 for (j=0; j<ns; j++) {
252 qb[l] = qp[l] - qm[l];
265 printf (
"Dumping 'OmegaFrame' ... ");
267 sprintf (name,
"%somegaframe.dat",
OUTPUTDIR);
268 output =
fopenp (name,
"a");
269 fprintf (output,
"%d\t%#.18g\n",\
288 sprintf (name,
"%somegaframe.dat",
OUTPUTDIR);
289 input = fopen (name,
"r");
291 mastererr (
"Can't read 'omegaframe.dat' file. Aborting restart.\n");
295 pt = fgets (testline, 255, input);
296 sscanf (testline,
"%d", &time);
297 }
while ((time != TimeStep) && (pt != NULL));
299 mastererr (
"Can't read entry %d in 'omegaframe.dat' file. Aborting restart.\n", TimeStep);
304 pt += strspn(pt,
"eE0123456789-.");
305 pt += strspn(pt,
"\t :=>_");
306 sscanf (pt,
"%lf", &value);
double real
Definition of the type 'real' used throughout the code.
real * x
x-coordinate of the planets
void EmptyPlanetSystemFile(PlanetarySystem *sys)
real GetOmegaFrame(int TimeStep)
Finds the angular velocity of the coordinate system in 'omegaframe.dat' at a given TimeStep...
A structure used to store any scalar fied on the computational domain.
FILE * fopenp(char *string, char *mode)
int Nrad
Radial size of the grid, in number of zones.
Contains all the information about a planetary system at a given instant in time. ...
static real MplanetVirtual
void WritePlanetFile(int TimeStep, int n)
void WritePebbles(int index)
Outputs the pebble fluid arrays.
void WriteBigPlanetFile(int TimeStep, int n)
void SendOutput(int index, PolarGrid *dens, PolarGrid *gasvr, PolarGrid *gasvt, PolarGrid *gasenerg, PolarGrid *label)
void RestartPlanetarySystem(int timestep, PlanetarySystem *sys)
void mastererr(const char *template,...)
real GetfromPlanetFile(int TimeStep, int column, int n)
PolarGrid * DivergenceVelocity
Contains all the include directives requested by the code.
int Nsec
Azimuthal size of the grid, in number of zones.
boolean Write_Temperature
void WritePlanetSystemFile(PlanetarySystem *sys, int t)
void DumpOmegaFrame(int TimeStep)
Writes the angular velocity of the coordinate system.
void WriteBigPlanetSystemFile(PlanetarySystem *sys, int t)
void WriteDiskPolar(PolarGrid *array, int number)
void masterprint(const char *template,...)