-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Advection data storage #787
base: develop
Are you sure you want to change the base?
Conversation
…simdg.git into issue782_datastorage
b37b5d0
to
2858950
Compare
@winzerle I've added you as a reviewer as this PR changes how the data is passed through the dynamics, and I would like a check that it doesn't break anything. The output of the tests and usual example runs looks fine, at least to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good although it's a bit difficult since many files are touched. But interface to transport seems ok.
It might be good to do a simple speed-check before and after applying such spaces to see, if there are any efficiency issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an in-depth review, but this looks good to me.
I suspect you forgot to update the VP and freedrift modules, and we need to do something about the advection of snow, temperature and damage.
Yes, I did!
Coming soon, as a separate issue and PR. |
It should be (slightly) faster, as there is no longer a copy in each direction when going to and from the dynamics. |
Advection data storage
Fixes #782
Change Description
Share data between the column physics and dynamics parts of the module without copying. Tidy up some related classes and code that are no longer used and became a problem as these changes were implemented.
ModelArray::Components
(all the DG components at a particular physical location) and aModelArray::Component
(a particular DG component, especially DG0, at all grid locations).Components
map to anEigen::Array::row
.Component
maps to a anEigen::Array::col
.Components
.Component
.ModelArray
to be cast to and fromModelArray::DataType
, that isEigen::Array
.ModelComponent
ocean mask into an array held in a static function.PrognosticData
.PrognosticData
to copy all components of oneModelArray
to the correct components of another.PrognosticData::updatePrognosticData
to work correctly with the new full DG arrays.PrognositcData
is now all DG components in all cases.ModelArray::Type::DG
maps toModelArray::Type::H
.const
pseudo-Type
that is the type that should be used for advected fields. Defined in the relevantModelArrayDetails.hpp
.using
typedef that defines anAdvectionField
, which is justModelArray
.ModelArrayRef::data()
. The underlying data array is no longer accessible (this way).ModelArrayRef
fordouble
andModelArray
arguments.ModelArrayRef
work only on the 0 component of the array it references.allComponents()
member function which returns a reference to the full array, with all components (also known as the secondEigen
dimension).TextTag
s for read-write access to the cell-averaged DG fields.core/src/modules/DynamicsModule/*.cpp
) to work with an external source of data for thickness and concentration.ModelArrayRef::data()
when passingModelArrayRef
s to the dynamics kernels'setData()
functions.DGVectorHolder
class which can point to a DGModelArray
(or at least its underlyingEigen::Array
) and can decay to aDGVector&
.DGVectorHolder
s for ice thickness and concentration in the dynamics.setData()
function is used to try to set thickness or concentration.DGVectorHolder
data.setVelocites
function toDGTransport
Module
registry inModelComponent
.advectionStore
inModelComponent
. The pre-existing store works just fine.hFields
(&c.) lists of field names fromModelComponent
and derived classes.cgParametricMomentum.hpp
cgParametricMomentum.cpp
BBM.hpp
MEB.hpp
mevp.hpp
Test Description
DGVectorHolder
class.ModelArrayRef
to only the 0 component.ModelArrayRef::allComponents
to all components.ModelArray
.ModelArray
to the underlying data type.ModelComponent
test since there is no longer aModule
registry.ModelArray::Type
with components to the testModelArrayDetails
.setVelocities
function ofDGTransport
.DGVector
directly fromEigen::Matrix
andEigen::Array
.ThermoIntegration
test now only checks the DG0 component of the read ice thickness.Documentation Impact
Added docs/data_storage.rst, which documents how data is shared (after applying this PR) between the column physics and dynamics parts of the model.