forked from kandread/TauDEM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UpdateNotes.txt
58 lines (47 loc) · 2.91 KB
/
UpdateNotes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
5/27/18 Decided to tackle the issue in https://github.com/dtarb/TauDEM/issues/154#issuecomment-392370212 that while a warning on a PC is an error for some and seems to be a structural problem best addressed.
Web search for "invalid use of incomplete type" leads to https://stackoverflow.com/questions/20013901/im-getting-an-error-invalid-use-of-incomplete-type-class-map which explains forward declaration concepts.
In TauDEM the cause seems to be tiffio.cpp includes tiffio.h
tiffio.h includes commonlib.h
commonlib.h includes linearpart.h
linearpart.h includes partition.h
partition.h has a function savedxdyc that uses a reference to tiffIO, but because the #include to commonlib.h is in tiffIO.h before tiffIO class is defined there is the invalid use of type error/warning.
Strategy for solution.
Rather than linearpart.h be included as part of commonlib.h, include linearpart.h independently and after tiffio.h. Order includes commonlib.h, tiffio.h, linearpart.h. That way tiffio is defined when linearpart.h is parsed. However this requires that commonlib.h not include linearpart.h. The only function in commonlib that uses linearpart is pointsToMe. PointsToMe is only used in DropAnalysis and streamnet, so decided to copy code out of commonlib and put at the top of each of these functions.
11/10/17
Identified a problem with flow direction conditioning not working due to no data values not being robustly handled.
NoData and Type Fixes
11/18/17
A problem occurred in flowdircond due to incorrect recognition of grid no data values.
Implemented the following strategy
- Store nodata as a double when associated with files and TiffIO because that is how it comes from GDAL
- Store nodata as partition type when associated with a partition, one of int16_t (short) int32_t (long), float
- Change short grid storage to int16_t storage because that is how it comes from GDAL (short implementations may be machine dependent)
- In check for nodata use (double) typecast because nodata is double
With new approach all files need to have no data type properly set in CreateNewPartition
e.g. CreateNewPartition(SHORT_TYPE, totalx, totaly, dxA, dyA, (int16_t)0);
Significant changes
File related
- tiffIO.cpp
o nodata to double
o short’s to int16_t
o nodata no longer pointer
- tiffio.h
o tiffIO copy class nd from void* to double*
o getNodata function to double*
o *nodata from void to double
o nodata from void to double
Partition related
- createpart.h
o Set nodata to type and made first function a template class to take multiple nodata pointer types as input
o Changed short’s to int16_t
o Changed MPI_SHORT to MPI_INT16_T
- commonlib.h
o removed unused type enumerations
o set MISSINGSHORT as int16_t
o set MISSINGLONG as int32_t
- linearpart.h (does the work of the init function)
o no changes
- partition.h
o changed short’s to int16_t
- flowdircond.cpp
o change fNodata to MISSINGFLOAT