44 va_start (ap,
template);
45 vfprintf (stdout,
template, ap);
53 va_start (ap,
template);
54 vfprintf (stderr,
template, ap);
62 fprintf(stderr,
"%s\n",
string);
69 fprintf (stdout,
"%s", msg);
84 prs_error(
"Insufficient memory for PolarGrid creation");
85 field = (
real *) malloc(
sizeof(
real) * (Nr + 3) * (Ns + 1) + 5);
87 prs_error(
"Insufficient memory for PolarGrid creation");
88 string = (
char *) malloc(
sizeof(
char) * 80);
90 prs_error(
"Insufficient memory for PolarGrid creation");
91 sprintf(
string,
"gas%s", name);
96 for (i = 0; i <= Nr; i++) {
97 for (j = 0; j < Ns; j++) {
116 fieldsrc = arraysrc->Field;
117 #pragma omp parallel for
118 for (i = 0; i < (nr+1)*ns; i++) {
119 fieldsrc[i] *= constant;
127 char CommandLine[1024];
132 sprintf (filecom,
"%srun.commandline",
OUTPUTDIR);
133 COM =
fopenp (filecom,
"w");
134 for (i = 0; i < argc; i++) {
135 fprintf (COM,
"%s ",argv[i]);
138 sprintf (CommandLine,
"cp .source.tar.bz2 %ssrc.tar.bz2",
OUTPUTDIR);
139 system (CommandLine);
151 dir = opendir (
string);
155 fprintf (stdout,
"Process %d creates the directory %s\n",
CPU_Rank,
string);
156 sprintf (command,
"mkdir -p %s",
string);
167 f = fopen (
string, mode);
171 printf (
"Process %d could not open %s\n",
CPU_Rank,
string);
172 printf (
"Trying to create %s\n",
OUTPUTDIR);
174 f = fopen (
string,
"w");
176 fprintf (stdout,
"I still cannot open %s.\n",
string);
177 fprintf (stdout,
"You should check that the permissions are correctly set.\n");
178 fprintf (stdout,
"Run aborted\n");
double real
Definition of the type 'real' used throughout the code.
void MultiplyPolarGridbyConstant(PolarGrid *arraysrc, real constant)
char * Name
Pointer to the array of Nrad*Nsec reals (e.g., density, etc.)
PolarGrid * CreatePolarGrid(int Nr, int Ns, char *name)
A structure used to store any scalar fied on the computational domain.
void prs_error(char *string)
FILE * fopenp(char *string, char *mode)
void DumpSources(int argc, argv)
int Nrad
Radial size of the grid, in number of zones.
void MakeDir(char *string)
void mastererr(const char *template,...)
Contains all the include directives requested by the code.
int Nsec
Azimuthal size of the grid, in number of zones.
real GetGlobalIFrac(real r)
void masterprint(const char *template,...)