Fix ENsetqualtype to set node initial values

When changing from CHEM to AGE or TRACE, nodes initial quality values
must be returned to their original ones. Reported by R.T., CSIRO AU -
thanks!
This commit is contained in:
Elad Salomons
2017-05-01 13:25:59 +03:00
parent 8ab0f06ccc
commit 3c788567a4

View File

@@ -2305,6 +2305,7 @@ int DLLEXPORT ENsetqualtype(int qualcode, char *chemname, char *chemunits, char
{
/*** Updated 3/1/01 ***/
double ccf = 1.0;
int i;
if (!Openflag) return(102);
if (qualcode < EN_NONE || qualcode > EN_TRACE) return(251);
@@ -2340,6 +2341,14 @@ int DLLEXPORT ENsetqualtype(int qualcode, char *chemname, char *chemunits, char
strcpy(Field[QUALITY].Units,u_HOURS);
}
if ((Qualflag == AGE || Qualflag == TRACE) & (Ucf[QUALITY] != 1))
{
for (i=1; i<=Nnodes; i++)
{
Node[i].C0 *= Ucf[QUALITY];
}
}
/*** Updated 3/1/01 ***/
Ucf[QUALITY] = ccf;
Ucf[LINKQUAL] = ccf;