At the moment, we assume the input and output vectors are aligned with the native coordinate system, i.e. spherical coordinates with a displaced pole over Greenland. What we should expect is:
- Input vectors are aligned with the input grid
- Output vectors are aligned with the output grid, or north and east
The rotation should be performed by the input or output routines to ensure maximum flexibility in their design and to ensure that, inside the model, all vectors are always oriented along the model coordinate system, i.e., the displaced pole over Greenland.
As an example, the current ParaGridIO based implementation of TOPAZOcean::update contains the follwoing
// Read TOPAZ forcings at midnight
if (std::fmod((tst.start - TimePoint()).seconds(), 86400.) == 0.) {
forcingState = ParaGridIO::readForcingTimeStatic(forcings, tst.start, filePath);
}
sstExtAccessor.getHostRW() = forcingState.data.at(sstName);
sssExtAccessor.getHostRW() = forcingState.data.at(sssName);
mldAccessor.getHostRW() = forcingState.data.at(mldName);
uAccessor.getHostRW() = forcingState.data.at(uName);
vAccessor.getHostRW() = forcingState.data.at(vName);
Once updated, that code would look something like
// Read TOPAZ forcings at midnight
if (std::fmod((tst.start - TimePoint()).seconds(), 86400.) == 0.) {
forcingState = ParaGridIO::readForcingTimeStatic(forcings, grid, tst.start, filePath);
}
sstExtAccessor.getHostRW() = forcingState.data.at(sstName);
sssExtAccessor.getHostRW() = forcingState.data.at(sssName);
mldAccessor.getHostRW() = forcingState.data.at(mldName);
{uAccessor.getHostRW(), vAccessor.getHostRW()} = forcingState.getVectorFields(uName, vName);
This would require sending grid information to ParaGridIO::readFocingTimeStatic and implementing a new function getVectorFields in ParagridIO. Importantly, we would want getVectorFields to belong to a separate (base) class, so that it can be used in the XIOS implementation as well.
At the moment, we assume the input and output vectors are aligned with the native coordinate system, i.e. spherical coordinates with a displaced pole over Greenland. What we should expect is:
The rotation should be performed by the input or output routines to ensure maximum flexibility in their design and to ensure that, inside the model, all vectors are always oriented along the model coordinate system, i.e., the displaced pole over Greenland.
As an example, the current
ParaGridIObased implementation ofTOPAZOcean::updatecontains the follwoingOnce updated, that code would look something like
This would require sending grid information to
ParaGridIO::readFocingTimeStaticand implementing a new functiongetVectorFieldsinParagridIO. Importantly, we would wantgetVectorFieldsto belong to a separate (base) class, so that it can be used in the XIOS implementation as well.