30 int states(
int nmin,
int nmax,
int flag,
double *pre_1D,
double *rho_1D,
31 double *dx,
double *Cdtdx,
double *fCdtdx,
double *plft,
32 double *pl,
double *dp,
double *p6,
double *ulft,
double *ul,
33 double *du,
double *u6,
double *rlft,
double *rl,
double *dr,
34 double *r6,
double *prgh,
double *urgh,
double *rrgh) {
43 for (i = nmin - 4; i <= nmax + 4; i++) {
44 Cdtdx[i] = sqrt(
Gamma1 * pre_1D[i] / rho_1D[i]) / (dx[i]);
46 Cdtdx[i] = Cdtdx[i] * hdt;
47 fCdtdx[i] = 1.0 - fourthd * Cdtdx[i];
50 for (i = nmin - 4; i <= nmax + 4; i++) {
52 plft[ii] = pl[i] + dp[i] - Cdtdx[i]*(dp[i] - fCdtdx[i] * p6[i]);
53 ulft[ii] = ul[i] + du[i] - Cdtdx[i]*(du[i] - fCdtdx[i] * u6[i]);
54 rlft[ii] = rl[i] + dr[i] - Cdtdx[i]*(dr[i] - fCdtdx[i] * r6[i]);
58 ulft[ii] = ulft[ii] + hdt *
grav_acc;
62 prgh[i] = pl[i] + Cdtdx[i]*(dp[i] + fCdtdx[i] * p6[i]);
63 urgh[i] = ul[i] + Cdtdx[i]*(du[i] + fCdtdx[i] * u6[i]);
64 rrgh[i] = rl[i] + Cdtdx[i]*(dr[i] + fCdtdx[i] * r6[i]);