35 fprintf(stderr,
"Error in Numa2DInitialize(): nvars has to be %d.\n",
_MODEL_NVARS_);
39 fprintf(stderr,
"Error in Numa2DInitialize(): ndims has to be %d.\n",
_MODEL_NDIMS_);
49 physics->
Pref = 101327.0;
50 physics->
Tref = 288.15;
60 if (!count) printf(
"Reading physical model inputs from file \"physics.inp\".\n");
61 in = fopen(
"physics.inp",
"r");
62 if (!in) printf(
"Warning: File \"physics.inp\" not found. Using default values.\n");
65 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
66 if (!strcmp(word,
"begin")){
67 while (strcmp(word,
"end")){
68 ferr = fscanf(in,
"%s",word);
if (ferr != 1)
return(1);
69 if (!strcmp(word,
"gamma")) {
70 ferr = fscanf(in,
"%lf",&physics->
gamma);
if (ferr != 1)
return(1);
71 }
else if (!strcmp(word,
"R")) {
72 ferr = fscanf(in,
"%lf",&physics->
R);
if (ferr != 1)
return(1);
73 }
else if (!strcmp(word,
"g")) {
74 ferr = fscanf(in,
"%lf",&physics->
g);
if (ferr != 1)
return(1);
75 }
else if (!strcmp(word,
"mu")) {
76 ferr = fscanf(in,
"%lf",&physics->
mu);
if (ferr != 1)
return(1);
77 }
else if (!strcmp(word,
"Pref")) {
78 ferr = fscanf(in,
"%lf",&physics->
Pref);
if (ferr != 1)
return(1);
79 }
else if (!strcmp(word,
"Tref")) {
80 ferr = fscanf(in,
"%lf",&physics->
Tref);
if (ferr != 1)
return(1);
81 }
else if (!strcmp(word,
"init_atmos")) {
82 ferr = fscanf(in,
"%d",&physics->
init_atmos);
if (ferr != 1)
return(1);
83 }
else if (!strcmp(word,
"upwinding")) {
84 ferr = fscanf(in,
"%s",physics->
upwind);
if (ferr != 1)
return(1);
85 }
else if (strcmp(word,
"end")) {
87 ferr = fscanf(in,
"%s",useless);
if (ferr != 1)
return(ferr);
88 printf(
"Warning: keyword %s in file \"physics.inp\" with value %s not ",word,useless);
89 printf(
"recognized or extraneous. Ignoring.\n");
93 fprintf(stderr,
"Error: Illegal format in file \"physics.inp\".\n");
118 fprintf(stderr,
"Error in Numa2DInitialize(): invalid choice of initial atmosphere (init_atmos).\n");
137 if (!mpi->
rank) fprintf(stderr,
"Error in Numa2DInitialize(): Invalid choice of upwinding scheme.\n");
154 fprintf(stderr,
"Error in Numa2DInitialize(): Parabolic term spatial discretization must be \"%s\"\n",
_NC_2STAGE_);
void(* StandardAtmosphere)(void *, double, double *, double *, double *, double *)
int Numa2DCalculateStandardAtmosphere_1(void *p, double z, double *ExnerP, double *P, double *rho, double *T)
int(* dFFunction)(double *, double *, int, void *, double)
double(* ComputeCFL)(void *, void *, double, double)
int MPIBroadcast_double(double *, int, int, void *)
int Numa2DStiffFlux(double *f, double *u, int dir, void *s, double t)
char spatial_type_par[_MAX_STRING_SIZE_]
double Numa2DComputeCFL(void *s, void *m, double dt, double t)
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
int Numa2DSource(double *, double *, void *, void *, double)
int(* UpwinddF)(double *, double *, double *, double *, double *, double *, int, void *, double)
int(* FFunction)(double *, double *, int, void *, double)
int(* ParabolicFunction)(double *, double *, void *, void *, double)
char upwind[_MAX_STRING_SIZE_]
#define _MAX_STRING_SIZE_
int Numa2DCalculateStandardAtmosphere_2(void *p, double z, double *ExnerP, double *P, double *rho, double *T)
Structure containing the variables and function pointers defining a boundary.
int Numa2DRusanovLinearFlux(double *, double *, double *, double *, double *, double *, int, void *, double)
int(* SFunction)(double *, double *, void *, void *, double)
int Numa2DRusanovFlux(double *, double *, double *, double *, double *, double *, int, void *, double)
int MPIBroadcast_character(char *, int, int, void *)
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
int Numa2DParabolicFunction(double *, double *, void *, void *, double)
Structure of MPI-related variables.
int Numa2DFlux(double *f, double *u, int dir, void *s, double t)
Structure containing all solver-specific variables and functions.
#define _RUSANOV_UPWINDING_
int MPIBroadcast_integer(int *, int, int, void *)