In file model/hd/outputs/timeseries.c (1546) and model/hd-us/outputs/timeseries.c (1605) both sal and temp are not initialized before first use. They are both initialized later on in the function.
1546 int read_ts_data(master_t *master, ts_point_t *tslist, double t, int c)
...
1552 double temp, sal, p, dens;
...
1604 /* Compute glider density if not supplied in the file */
1605 if (densf) {
1606 p = master->glider[c] * 1e6;
1607 /* eos2 expects pressure as N/m2 and converts to bars */
1608 /* (divides by 1e5), so multiply p by 1e6 to retrieve */
1609 /* bars in eos2(). */
1610 eos2(sal, temp, p, &dens, &master->glider[c]);
1611 }
...
1640 if (densf) {
1641 p = master->glider[zm1] * 1e6;
1642 temp = average_glider_data(master, tslist, tzm1, zm1, tid, &cud, &cdd, &d1, &d2, &nvals);
1643 sal = average_glider_data(master, tslist, tzm1, zm1, sid, &cud, &cdd, &d1, &d2, &nvals);
1644 eos2(sal, temp, p, &dens, &master->glider[zm1]);
1645 }
I'll provide a PR that copies the initial code into the first stanza. Needs reviewed to make sure that's a valid initialization.
Update: sid and tid are also uninitialized before first use in lines 1642-3 (their initialization starts on line 1652). That invalidates my proposed fix.
In file
model/hd/outputs/timeseries.c
(1546) andmodel/hd-us/outputs/timeseries.c
(1605) bothsal
andtemp
are not initialized before first use. They are both initialized later on in the function.I'll provide a PR that copies the initial code into the first stanza. Needs reviewed to make sure that's a valid initialization.
Update:
sid
andtid
are also uninitialized before first use in lines 1642-3 (their initialization starts on line 1652). That invalidates my proposed fix.