Closed tbohn closed 6 years ago
I'm preparing an implementation of solution 2 above (eliminating MAX_VEG
and MAX_BAND
from the model entirely). I'm not going to eliminate the other constants (e.g., MAX_LAYERS
) because changes to those seem to be very rare.
Closed by PR #723
This isn't exactly a bug - perhaps a request for enhancement.
MAX_VEG
is set to 12 (a little larger than the number of classes in the NLDAS classification). This requires users to recompile the model with a higher value if they choose to use a land cover classification with more classes. On the other hand,MAX_BAND
is set to 10, despite the most commonly-used snow band dataset having only 5 bands. If minimizing memory usage is a concern, thenMAX_BAND
should be reduced. If flexibility is a concern and justifies the large value forMAX_BAND
, thenMAX_VEG
should be similarly increased to, e.g., 20 (to accommodate classification schemes such as the IGBP scheme used in the MODIS PFT product, or the National Land Cover Database scheme). The variables that use these constants appear to be limited in scope (e.g.moist
incompute_derived_state_variables()
), thus unlikely to impact overall memory usage substantially.MAX_VEG
to 20 invic_def.h
; 2. replace the statically-declared arrays that use these constants (e.g.moist
incompute_derived_state_variables()
) with dynamically-allocated arrays.