Open charleskawczynski opened 3 years ago
We'll definitely have data sets at some point, and I know @Yujie-W has been working on how to access/deal with them for other components of the land model. How does the canopy model access needed data sets? We can also discuss via slack or zoom!
Currently, there are tons of local data stored in the sttructure of Land model using ordinary arrays. So the implementation of the Land model we have now into ClimateMachine.jl can be tough. Yet, it is possible to store these data outside the land model into a mutable cache stucture (if GPU can visit and change this cache structure).
Description
Per a discussion with @kmdeck, we need a way to compute non-local information (e.g., data in
boundary_state!
) and make this information available influx_first_order!
,flux_second_order!
, andsource!
. For example, we would like to have something likeand update this value in, for example,
update_auxiliary_state!(::LandModel, ...)
. The main issue with this is that ordinary arrays cannot reside on the GPU. Using anMArray
will not work because it cannot persist beyond the kernel calls. One hack option would be to create an entirely new instance of the balance law insideupdate_auxiliary_state!(::LandModel, ...)
. Something likeThis assumes that the parent of
m
can mutatem
(which should be doable). The downside of this is frequent reallocation ofland::LandModel
, which could be problematic if we need to eventually store datasets inland::LandModel
.Setfield.jl might be useful here.