diff --git a/components/omega/doc/devGuide/AuxiliaryVariables.md b/components/omega/doc/devGuide/AuxiliaryVariables.md index d75a8f2b3f84..b1ea78f0d701 100644 --- a/components/omega/doc/devGuide/AuxiliaryVariables.md +++ b/components/omega/doc/devGuide/AuxiliaryVariables.md @@ -89,7 +89,7 @@ The following auxiliary variable groups are currently implemented: | ----- | ------------------- | ------- | | KineticAuxVars | KineticEnergyCell || || VelocityDiv || -| LayerThicknessAuxVars | FluxLayerThickEdge | Center or Upwind| +| PseudoThicknessAuxVars | FluxLayerThickEdge | Center or Upwind| || MeanLayerThickEdge || | VorticityAuxVars | RelVortVertex || || NormRelVortVertex || diff --git a/components/omega/doc/devGuide/OceanState.md b/components/omega/doc/devGuide/OceanState.md index d817b520e148..7ac6148f44dd 100644 --- a/components/omega/doc/devGuide/OceanState.md +++ b/components/omega/doc/devGuide/OceanState.md @@ -20,7 +20,7 @@ OceanState::create(const std::string &Name, ///< [in] Name for mesh const int NTimeLevels_ ///< [in] Number of time levels ); ``` -allocates the `NormalVelocity` and `LayerThickness` arrays for a given number of time levels. +allocates the `NormalVelocity` and `PseudoThickness` arrays for a given number of time levels. The current time level is then registered with the IO infrastructure. After initialization, the default state object can be retrieved via: @@ -60,14 +60,14 @@ to the current time level. The arrays associated with a given time level can be accessed with the functions: ```c++ Array2DReal LayerThick; -Err = State->getLayerThickness(LayerThick, TimeLevel); +Err = State->getPseudoThickness(LayerThick, TimeLevel); Array2DReal NormVel; Err = State->getNormalVelocity(NormVel, TimeLevel); ``` for the device arrays and ```c++ HostArray2DReal LayerThickH; -Err = State->getLayerThicknessH(LayerThickH, TimeLevel); +Err = State->getPseudoThicknessH(LayerThickH, TimeLevel); HostArray2DReal NormVelH; Err = State->getNormalVelocityH(NormVelH, TimeLevel); ``` diff --git a/components/omega/doc/devGuide/QuickStart.md b/components/omega/doc/devGuide/QuickStart.md index b97c45bbb075..0ff8de390694 100644 --- a/components/omega/doc/devGuide/QuickStart.md +++ b/components/omega/doc/devGuide/QuickStart.md @@ -155,17 +155,14 @@ Some tests require a valid Omega mesh file. Different tests require different meshes. At the moment, mesh files need to be copied or linked to specifically named files under the `test` directory. Appropriate mesh files can be downloaded from: -- [Ocean Mesh](https://web.lcrc.anl.gov/public/e3sm/inputdata/ocn/mpas-o/oQU240/ocean.QU.240km.151209.nc) -- [Global Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/polaris_cache/global_convergence/icos/cosine_bell/Icos480/init/initial_state.230220.nc) -- [Planar Mesh](https://gist.github.com/mwarusz/f8caf260398dbe140d2102ec46a41268/raw/e3c29afbadc835797604369114321d93fd69886d/PlanarPeriodic48x48.nc) +- [Ocean Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/ocean.QU.240km.omega_vars.251219.nc) +- [Global Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/cosine_bell_icos480.omega_vars.250219.nc) +- [Planar Mesh](https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/PlanarPeriodic48x48.omega_vars.251219.nc) ```sh -wget -O ocean_test_mesh.nc https://web.lcrc.anl.gov/public/e3sm/inputdata/ocn/mpas-o/oQU240/ocean.QU.240km.151209.nc -wget -O global_test_mesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/polaris_cache/global_convergence/icos/cosine_bell/Icos480/init/initial_state.230220.nc -wget -O planar_test_mesh.nc https://gist.github.com/mwarusz/f8caf260398dbe140d2102ec46a41268/raw/e3c29afbadc835797604369114321d93fd69886d/PlanarPeriodic48x48.nc cd test -ln -sf ../ocean_test_mesh.nc OmegaMesh.nc -ln -sf ../global_test_mesh.nc OmegaSphereMesh.nc -ln -sf ../planar_test_mesh.nc OmegaPlanarMesh.nc +wget -O OmegaMesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/ocean.QU.240km.omega_vars.251219.nc +wget -O OmegaSphereMesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/cosine_bell_icos480.omega_vars.250219.nc +wget -O OmegaPlanarMesh.nc https://web.lcrc.anl.gov/public/e3sm/polaris/ocean/omega_ctest/PlanarPeriodic48x48.omega_vars.251219.nc cd .. ``` diff --git a/components/omega/doc/devGuide/Testing.md b/components/omega/doc/devGuide/Testing.md index caf80588b8f8..5646c4ba3d59 100644 --- a/components/omega/doc/devGuide/Testing.md +++ b/components/omega/doc/devGuide/Testing.md @@ -321,7 +321,7 @@ Omega: Filename: init.nc Contents: - NormalVelocity - - LayerThickness + - PseudoThickness RestartRead: {} History: Filename: output.nc @@ -333,7 +333,7 @@ Omega: FileFreqUnits: years Contents: - NormalVelocity - - LayerThickness + - PseudoThickness - SshCell ``` For more details on updating either the map or the YAML files for individual diff --git a/components/omega/doc/devGuide/VertCoord.md b/components/omega/doc/devGuide/VertCoord.md index e5a60115a0f0..8f8be19a36d7 100644 --- a/components/omega/doc/devGuide/VertCoord.md +++ b/components/omega/doc/devGuide/VertCoord.md @@ -55,7 +55,7 @@ A list of member variables along with their types and dimension sizes is below: | ZInterface | Real | NCellsSize, NVertLayersP1| | ZMid | Real | NCellsSize, NVertLayers | | GeopotentialMid | Real | NCellsSize, NVertLayers | -| LayerThicknessPStar | Real | NCellsSize, NVertLayers| +| PseudoThicknessPStar | Real | NCellsSize, NVertLayers| | MinLayerCell | Integer | NCellsSize | | MaxLayerCell | Integer | NCellsSize | | MinLayerEdgeTop | Integer| NEdgesSize | @@ -67,7 +67,7 @@ A list of member variables along with their types and dimension sizes is below: | MinLayerVertexBot | Integer | NVerticesSize | | MaxLayerVertexBot | Integer | NVerticesSize | | VertCoordMovementWeights | Real | NCellsSize, NVertLayers | -| RefLayerThickness | Real | NCellsSize, NVertLayers | +| RefPseudoThickness | Real | NCellsSize, NVertLayers | | BottomDepth | Real | NCellsSize | ### Removal @@ -113,7 +113,7 @@ Kokkos::parallel_reduce( Kokkos::TeamThreadRange(Member, KMin, KMax + 1), [=](const int K, Real &LocalWh) { LocalWh += VertCoordMovementWeights(ICell, K) * - RefLayerThickness(ICell, K); + RefPseudoThickness(ICell, K); }, SumWh); ``` diff --git a/components/omega/doc/userGuide/Config.md b/components/omega/doc/userGuide/Config.md index 8c542df8db5d..f0fdbf60f49c 100644 --- a/components/omega/doc/userGuide/Config.md +++ b/components/omega/doc/userGuide/Config.md @@ -62,7 +62,7 @@ omega: OutputInterval: 0001_00:00:00 Contents: - tracers - - layerThickness + - PseudoThickness - ssh - kineticEnergyCell - relativeVorticityCell diff --git a/components/omega/doc/userGuide/OceanState.md b/components/omega/doc/userGuide/OceanState.md index d0209f0f95fb..1ae18f11bae2 100644 --- a/components/omega/doc/userGuide/OceanState.md +++ b/components/omega/doc/userGuide/OceanState.md @@ -2,7 +2,7 @@ ## Ocean State -The `OceanState` class provides a container for the non-tracer prognostic variables in Omega, namely `normalVelocity` and `layerThickness`. +The `OceanState` class provides a container for the non-tracer prognostic variables in Omega, namely `normalVelocity` and `PseudoThickness`. Upon creation of a `OceanState` instance, these variables are allocated and registered with the IO infrastructure. The class contains a method to update the time levels for the state variables between timesteps. This involves a halo update, time level index update, and updating the `IOFields` data references. diff --git a/components/omega/doc/userGuide/VertCoord.md b/components/omega/doc/userGuide/VertCoord.md index a14bfa7c1790..0a89ed122d05 100644 --- a/components/omega/doc/userGuide/VertCoord.md +++ b/components/omega/doc/userGuide/VertCoord.md @@ -32,7 +32,7 @@ Multiple instances of the vertical coordinate class can be created and accessed | ZInterface | z height of layer interfaces | m | | ZMid | z height of layer midpoint | m | | GeopotentialMid | geopotential at layer mid points | m$^2$/s$^2$| -| LayerThicknessPStar | desired layer thickness based on total perturbation from the reference thickness | - | +| PseudoThicknessPStar | desired layer thickness based on total perturbation from the reference thickness | - | | MinLayerCell | first active layer for cell | - | | MaxLayerCell | last active layer for cell | - | | MinLayerEdgeTop | min of the first active layers for cells on edge | - | @@ -44,7 +44,7 @@ Multiple instances of the vertical coordinate class can be created and accessed | MinLayerVertexBot | max of the first active layer for cells on vertex | - | | MaxLayerVertexBot | max of the last active layer for cells on vertex | - | | VertCoordMovementWeights | weights to specify how total column thickness changes are distributed across layers | - | -| RefLayerThickness | reference layer thickness used to distribute total column thickness changes | m | +| RefPseudoThickness | reference layer thickness used to distribute total column thickness changes | m | | BottomDepth | positive down distance from the reference geoid to the bottom | m | ### Configuration options diff --git a/components/omega/src/ocn/AuxiliaryState.cpp b/components/omega/src/ocn/AuxiliaryState.cpp index 2164fad2d6a7..41562d42a3e9 100644 --- a/components/omega/src/ocn/AuxiliaryState.cpp +++ b/components/omega/src/ocn/AuxiliaryState.cpp @@ -22,7 +22,7 @@ AuxiliaryState::AuxiliaryState(const std::string &Name, const HorzMesh *Mesh, int NVertLayers, int NTracers) : Mesh(Mesh), VCoord(VCoord), MeshHalo(MeshHalo), Name(stripDefault(Name)), KineticAux(stripDefault(Name), Mesh, NVertLayers), - LayerThicknessAux(stripDefault(Name), Mesh, NVertLayers), + PseudoThicknessAux(stripDefault(Name), Mesh, NVertLayers), VorticityAux(stripDefault(Name), Mesh, NVertLayers), VelocityDel2Aux(stripDefault(Name), Mesh, VCoord, NVertLayers), WindForcingAux(stripDefault(Name), Mesh), @@ -37,7 +37,7 @@ AuxiliaryState::AuxiliaryState(const std::string &Name, const HorzMesh *Mesh, auto AuxGroup = FieldGroup::create(GroupName); KineticAux.registerFields(GroupName, AuxMeshName); - LayerThicknessAux.registerFields(GroupName, AuxMeshName); + PseudoThicknessAux.registerFields(GroupName, AuxMeshName); VorticityAux.registerFields(GroupName, AuxMeshName); VelocityDel2Aux.registerFields(GroupName, AuxMeshName); WindForcingAux.registerFields(GroupName, AuxMeshName); @@ -48,7 +48,7 @@ AuxiliaryState::AuxiliaryState(const std::string &Name, const HorzMesh *Mesh, // state field group. AuxiliaryState::~AuxiliaryState() { KineticAux.unregisterFields(); - LayerThicknessAux.unregisterFields(); + PseudoThicknessAux.unregisterFields(); VorticityAux.unregisterFields(); VelocityDel2Aux.unregisterFields(); WindForcingAux.unregisterFields(); @@ -62,14 +62,14 @@ void AuxiliaryState::computeMomAux(const OceanState *State, int ThickTimeLevel, int VelTimeLevel) const { Array2DReal LayerThickCell; Array2DReal NormalVelEdge; - State->getLayerThickness(LayerThickCell, ThickTimeLevel); + State->getPseudoThickness(LayerThickCell, ThickTimeLevel); State->getNormalVelocity(NormalVelEdge, VelTimeLevel); const int NVertLayers = LayerThickCell.extent_int(1); const int NChunks = NVertLayers / VecLength; OMEGA_SCOPE(LocKineticAux, KineticAux); - OMEGA_SCOPE(LocLayerThicknessAux, LayerThicknessAux); + OMEGA_SCOPE(LocPseudoThicknessAux, PseudoThicknessAux); OMEGA_SCOPE(LocVorticityAux, VorticityAux); OMEGA_SCOPE(LocVelocityDel2Aux, VelocityDel2Aux); OMEGA_SCOPE(LocWindForcingAux, WindForcingAux); @@ -108,8 +108,8 @@ void AuxiliaryState::computeMomAux(const OceanState *State, int ThickTimeLevel, "edgeAuxState2", {Mesh->NEdgesAll, NChunks}, KOKKOS_LAMBDA(int IEdge, int KChunk) { LocVorticityAux.computeVarsOnEdge(IEdge, KChunk); - LocLayerThicknessAux.computeVarsOnEdge(IEdge, KChunk, LayerThickCell, - NormalVelEdge); + LocPseudoThicknessAux.computeVarsOnEdge(IEdge, KChunk, LayerThickCell, + NormalVelEdge); LocVelocityDel2Aux.computeVarsOnEdge(IEdge, KChunk, VelocityDivCell, RelVortVertex); }); @@ -135,8 +135,8 @@ void AuxiliaryState::computeMomAux(const OceanState *State, int ThickTimeLevel, parallelFor( "cellAuxState3", {Mesh->NCellsAll, NChunks}, KOKKOS_LAMBDA(int ICell, int KChunk) { - LocLayerThicknessAux.computeVarsOnCells(ICell, KChunk, - LayerThickCell); + LocPseudoThicknessAux.computeVarsOnCells(ICell, KChunk, + LayerThickCell); }); Pacer::stop("AuxState:cellAuxState3", 2); @@ -149,7 +149,7 @@ void AuxiliaryState::computeAll(const OceanState *State, int ThickTimeLevel, int VelTimeLevel) const { Array2DReal LayerThickCell; Array2DReal NormalVelEdge; - State->getLayerThickness(LayerThickCell, ThickTimeLevel); + State->getPseudoThickness(LayerThickCell, ThickTimeLevel); State->getNormalVelocity(NormalVelEdge, VelTimeLevel); const int NVertLayers = LayerThickCell.extent_int(1); @@ -171,7 +171,7 @@ void AuxiliaryState::computeAll(const OceanState *State, }); Pacer::stop("AuxState:edgeAuxState4", 2); - const auto &MeanLayerThickEdge = LayerThicknessAux.MeanLayerThickEdge; + const auto &MeanLayerThickEdge = PseudoThicknessAux.MeanLayerThickEdge; Pacer::start("AuxState:cellAuxState4", 2); parallelFor( @@ -273,9 +273,11 @@ void AuxiliaryState::readConfigOptions(Config *OmegaConfig) { Err, "AuxiliaryState: FluxThicknessType not found in AdvectConfig"); if (FluxThickTypeStr == "Center") { - this->LayerThicknessAux.FluxThickEdgeChoice = FluxThickEdgeOption::Center; + this->PseudoThicknessAux.FluxThickEdgeChoice = + FluxThickEdgeOption::Center; } else if (FluxThickTypeStr == "Upwind") { - this->LayerThicknessAux.FluxThickEdgeChoice = FluxThickEdgeOption::Upwind; + this->PseudoThicknessAux.FluxThickEdgeChoice = + FluxThickEdgeOption::Upwind; } else { ABORT_ERROR("AuxiliaryState: Unknown FluxThicknessType requested"); } diff --git a/components/omega/src/ocn/AuxiliaryState.h b/components/omega/src/ocn/AuxiliaryState.h index 509aee6dcf22..971adb9e8de4 100644 --- a/components/omega/src/ocn/AuxiliaryState.h +++ b/components/omega/src/ocn/AuxiliaryState.h @@ -9,7 +9,7 @@ #include "Tracers.h" #include "VertCoord.h" #include "auxiliaryVars/KineticAuxVars.h" -#include "auxiliaryVars/LayerThicknessAuxVars.h" +#include "auxiliaryVars/PseudoThicknessAuxVars.h" #include "auxiliaryVars/TracerAuxVars.h" #include "auxiliaryVars/VelocityDel2AuxVars.h" #include "auxiliaryVars/VorticityAuxVars.h" @@ -35,7 +35,7 @@ class AuxiliaryState { // Auxiliary variables KineticAuxVars KineticAux; - LayerThicknessAuxVars LayerThicknessAux; + PseudoThicknessAuxVars PseudoThicknessAux; TracerAuxVars TracerAux; VorticityAuxVars VorticityAux; VelocityDel2AuxVars VelocityDel2Aux; diff --git a/components/omega/src/ocn/OceanState.cpp b/components/omega/src/ocn/OceanState.cpp index fea924e84ca4..76bc0739b063 100644 --- a/components/omega/src/ocn/OceanState.cpp +++ b/components/omega/src/ocn/OceanState.cpp @@ -89,26 +89,26 @@ OceanState::OceanState( CurTimeIndex = 0; // Allocate state host arrays - LayerThicknessH.resize(NTimeLevels); + PseudoThicknessH.resize(NTimeLevels); NormalVelocityH.resize(NTimeLevels); for (int I = 0; I < NTimeLevels; I++) { - LayerThicknessH[I] = HostArray2DReal("LayerThickness" + std::to_string(I), - NCellsSize, NVertLayers); + PseudoThicknessH[I] = HostArray2DReal( + "PseudoThickness" + std::to_string(I), NCellsSize, NVertLayers); NormalVelocityH[I] = HostArray2DReal("NormalVelocity" + std::to_string(I), NEdgesSize, NVertLayers); } // Allocate state device arrays - LayerThickness.resize(NTimeLevels); + PseudoThickness.resize(NTimeLevels); NormalVelocity.resize(NTimeLevels); // Create device arrays and copy host data for (int I = 0; I < NTimeLevels; I++) { - LayerThickness[I] = Array2DReal("LayerThickness" + std::to_string(I), - NCellsSize, NVertLayers); - NormalVelocity[I] = Array2DReal("NormalVelocity" + std::to_string(I), - NEdgesSize, NVertLayers); + PseudoThickness[I] = Array2DReal("PseudoThickness" + std::to_string(I), + NCellsSize, NVertLayers); + NormalVelocity[I] = Array2DReal("NormalVelocity" + std::to_string(I), + NEdgesSize, NVertLayers); } // Register fields and metadata for IO @@ -152,7 +152,7 @@ OceanState::~OceanState() { // Kokkos arrays removed when no longer in scope FieldGroup::destroy(StateGroupName); - Field::destroy(LayerThicknessFldName); + Field::destroy(PseudoThicknessFldName); Field::destroy(NormalVelocityFldName); } // end destructor @@ -179,10 +179,10 @@ void OceanState::clear() { // Define IO fields and metadata void OceanState::defineFields() { - LayerThicknessFldName = "LayerThickness"; - NormalVelocityFldName = "NormalVelocity"; + PseudoThicknessFldName = "PseudoThickness"; + NormalVelocityFldName = "NormalVelocity"; if (Name != "Default") { - LayerThicknessFldName.append(Name); + PseudoThicknessFldName.append(Name); NormalVelocityFldName.append(Name); } @@ -204,8 +204,8 @@ void OceanState::defineFields() { ); DimNames[0] = "NCells"; - auto LayerThicknessField = - Field::create(LayerThicknessFldName, // Field name + auto PseudoThicknessField = + Field::create(PseudoThicknessFldName, // Field name "Thickness of layer on cell center", /// long Name "m", // units "cell_thickness", // CF standard Name @@ -228,42 +228,42 @@ void OceanState::defineFields() { auto RestartGroup = FieldGroup::create("Restart"); StateGroup->addField(NormalVelocityFldName); - StateGroup->addField(LayerThicknessFldName); + StateGroup->addField(PseudoThicknessFldName); FieldGroup::addFieldToGroup(NormalVelocityFldName, "Restart"); - FieldGroup::addFieldToGroup(LayerThicknessFldName, "Restart"); + FieldGroup::addFieldToGroup(PseudoThicknessFldName, "Restart"); // Associate Field with data I4 TimeIndex; int Err = getTimeIndex(TimeIndex, 0); NormalVelocityField->attachData(NormalVelocity[TimeIndex]); - LayerThicknessField->attachData(LayerThickness[TimeIndex]); + PseudoThicknessField->attachData(PseudoThickness[TimeIndex]); } // end defineIOFields //------------------------------------------------------------------------------ // Get layer thickness device array -I4 OceanState::getLayerThickness(Array2DReal &LayerThick, - const I4 TimeLevel) const { +I4 OceanState::getPseudoThickness(Array2DReal &LayerThick, + const I4 TimeLevel) const { I4 Err = 0; I4 TimeIndex; Err = getTimeIndex(TimeIndex, TimeLevel); - LayerThick = LayerThickness[TimeIndex]; + LayerThick = PseudoThickness[TimeIndex]; return Err; } //------------------------------------------------------------------------------ // Get layer thickness host array -I4 OceanState::getLayerThicknessH(HostArray2DReal &LayerThickH, - const I4 TimeLevel) const { +I4 OceanState::getPseudoThicknessH(HostArray2DReal &LayerThickH, + const I4 TimeLevel) const { I4 Err = 0; I4 TimeIndex; Err = getTimeIndex(TimeIndex, TimeLevel); - LayerThickH = LayerThicknessH[TimeIndex]; + LayerThickH = PseudoThicknessH[TimeIndex]; return Err; } @@ -305,7 +305,7 @@ I4 OceanState::copyToDevice(const I4 TimeLevel) { Err = getTimeIndex(TimeIndex, TimeLevel); - deepCopy(LayerThickness[TimeIndex], LayerThicknessH[TimeIndex]); + deepCopy(PseudoThickness[TimeIndex], PseudoThicknessH[TimeIndex]); deepCopy(NormalVelocity[TimeIndex], NormalVelocityH[TimeIndex]); return Err; @@ -321,7 +321,7 @@ I4 OceanState::copyToHost(const I4 TimeLevel) { Err = getTimeIndex(TimeIndex, TimeLevel); - deepCopy(LayerThicknessH[TimeIndex], LayerThickness[TimeIndex]); + deepCopy(PseudoThicknessH[TimeIndex], PseudoThickness[TimeIndex]); deepCopy(NormalVelocityH[TimeIndex], NormalVelocity[TimeIndex]); return Err; @@ -336,7 +336,7 @@ I4 OceanState::exchangeHalo(const I4 TimeLevel) { I4 TimeIndex; Err = getTimeIndex(TimeIndex, TimeLevel); - MeshHalo->exchangeFullArrayHalo(LayerThickness[TimeIndex], OnCell); + MeshHalo->exchangeFullArrayHalo(PseudoThickness[TimeIndex], OnCell); MeshHalo->exchangeFullArrayHalo(NormalVelocity[TimeIndex], OnEdge); return Err; @@ -359,8 +359,8 @@ void OceanState::updateTimeLevels() { // Update IOField data associations Field::attachFieldData(NormalVelocityFldName, NormalVelocity[CurTimeIndex]); - Field::attachFieldData(LayerThicknessFldName, - LayerThickness[CurTimeIndex]); + Field::attachFieldData(PseudoThicknessFldName, + PseudoThickness[CurTimeIndex]); } // end updateTimeLevels diff --git a/components/omega/src/ocn/OceanState.h b/components/omega/src/ocn/OceanState.h index 27a398883667..e7eabbc0d047 100644 --- a/components/omega/src/ocn/OceanState.h +++ b/components/omega/src/ocn/OceanState.h @@ -82,16 +82,17 @@ class OceanState { // Prognostic variables - std::vector LayerThickness; ///< Device LayerThickness array - std::vector LayerThicknessH; ///< Host LayerThickness array + std::vector PseudoThickness; ///< Device PseudoThickness array + std::vector + PseudoThicknessH; ///< Host PseudoThickness array std::vector NormalVelocity; ///< Device NormalVelocity array std::vector NormalVelocityH; ///< Host NormalVelocity array // Field names // These are appended with the State name for non-Default state instances - std::string LayerThicknessFldName; ///< Field name for LayerThickness - std::string NormalVelocityFldName; ///< Field name for NormalVelocity + std::string PseudoThicknessFldName; ///< Field name for PseudoThickness + std::string NormalVelocityFldName; ///< Field name for NormalVelocity std::string StateGroupName; // Methods @@ -110,11 +111,11 @@ class OceanState { ); /// Get layer thickness device array at given time level - I4 getLayerThickness(Array2DReal &LayerThick, const I4 TimeLevel) const; + I4 getPseudoThickness(Array2DReal &LayerThick, const I4 TimeLevel) const; /// Get layer thickness host array at given time level - I4 getLayerThicknessH(HostArray2DReal &LayerThickH, - const I4 TimeLevel) const; + I4 getPseudoThicknessH(HostArray2DReal &LayerThickH, + const I4 TimeLevel) const; /// Get normal velocity device array at given time level I4 getNormalVelocity(Array2DReal &NormVel, const I4 TimeLevel) const; diff --git a/components/omega/src/ocn/Tendencies.cpp b/components/omega/src/ocn/Tendencies.cpp index d75500c187be..621c1362024d 100644 --- a/components/omega/src/ocn/Tendencies.cpp +++ b/components/omega/src/ocn/Tendencies.cpp @@ -227,8 +227,8 @@ Tendencies::Tendencies(const std::string &Name, ///< [in] Name for tendencies CustomVelocityTend(InCustomVelocityTend) { // Tendency arrays - LayerThicknessTend = - Array2DReal("LayerThicknessTend", Mesh->NCellsSize, VCoord->NVertLayers); + PseudoThicknessTend = Array2DReal("PseudoThicknessTend", Mesh->NCellsSize, + VCoord->NVertLayers); NormalVelocityTend = Array2DReal("NormalVelocityTend", Mesh->NEdgesSize, VCoord->NVertLayers); TracerTend = Array3DReal("TracerTend", NTracersIn, Mesh->NCellsSize, @@ -260,24 +260,24 @@ void Tendencies::computeThicknessTendenciesOnly( TimeInstant Time ///< [in] Time ) { - OMEGA_SCOPE(LocLayerThicknessTend, LayerThicknessTend); + OMEGA_SCOPE(LocPseudoThicknessTend, PseudoThicknessTend); OMEGA_SCOPE(LocThicknessFluxDiv, ThicknessFluxDiv); Array2DReal NormalVelEdge; State->getNormalVelocity(NormalVelEdge, VelTimeLevel); Pacer::start("Tend:computeThicknessTendenciesOnly", 1); - deepCopy(LocLayerThicknessTend, 0); + deepCopy(LocPseudoThicknessTend, 0); // Compute thickness flux divergence const Array2DReal &ThickFluxEdge = - AuxState->LayerThicknessAux.FluxLayerThickEdge; + AuxState->PseudoThicknessAux.FluxLayerThickEdge; if (LocThicknessFluxDiv.Enabled) { Pacer::start("Tend:thicknessFluxDiv", 2); parallelFor( {NCellsAll, NChunks}, KOKKOS_LAMBDA(int ICell, int KChunk) { - LocThicknessFluxDiv(LocLayerThicknessTend, ICell, KChunk, + LocThicknessFluxDiv(LocPseudoThicknessTend, ICell, KChunk, ThickFluxEdge, NormalVelEdge); }); Pacer::stop("Tend:thicknessFluxDiv", 2); @@ -285,7 +285,7 @@ void Tendencies::computeThicknessTendenciesOnly( if (CustomThicknessTend) { Pacer::start("Tend:customThicknessTend", 2); - CustomThicknessTend(LocLayerThicknessTend, State, AuxState, + CustomThicknessTend(LocPseudoThicknessTend, State, AuxState, ThickTimeLevel, VelTimeLevel, Time); Pacer::stop("Tend:customThicknessTend", 2); } @@ -321,7 +321,7 @@ void Tendencies::computeVelocityTendenciesOnly( // Compute potential vorticity horizontal advection const Array2DReal &FluxLayerThickEdge = - AuxState->LayerThicknessAux.FluxLayerThickEdge; + AuxState->PseudoThicknessAux.FluxLayerThickEdge; const Array2DReal &NormRVortEdge = AuxState->VorticityAux.NormRelVortEdge; const Array2DReal &NormFEdge = AuxState->VorticityAux.NormPlanetVortEdge; Array2DReal NormVelEdge; @@ -349,7 +349,7 @@ void Tendencies::computeVelocityTendenciesOnly( } // Compute sea surface height gradient - const Array2DReal &SSHCell = AuxState->LayerThicknessAux.SshCell; + const Array2DReal &SSHCell = AuxState->PseudoThicknessAux.SshCell; if (LocSSHGrad.Enabled) { Pacer::start("Tend:SSHGrad", 2); parallelFor( @@ -389,7 +389,7 @@ void Tendencies::computeVelocityTendenciesOnly( // Compute wind forcing const auto &NormalStressEdge = AuxState->WindForcingAux.NormalStressEdge; const auto &MeanLayerThickEdge = - AuxState->LayerThicknessAux.MeanLayerThickEdge; + AuxState->PseudoThicknessAux.MeanLayerThickEdge; if (LocWindForcing.Enabled) { Pacer::start("Tend:windForcing", 2); parallelFor( @@ -455,7 +455,7 @@ void Tendencies::computeTracerTendenciesOnly( // compute tracer diffusion const Array2DReal &MeanLayerThickEdge = - AuxState->LayerThicknessAux.MeanLayerThickEdge; + AuxState->PseudoThicknessAux.MeanLayerThickEdge; if (LocTracerDiffusion.Enabled) { Pacer::start("Tend:tracerDiffusion", 2); parallelFor( @@ -490,12 +490,12 @@ void Tendencies::computeThicknessTendencies( int VelTimeLevel, ///< [in] Time level TimeInstant Time ///< [in] Time ) { - // only need LayerThicknessAux on edge + // only need PseudoThicknessAux on edge Array2DReal LayerThick; Array2DReal NormVel; - State->getLayerThickness(LayerThick, ThickTimeLevel); + State->getPseudoThickness(LayerThick, ThickTimeLevel); State->getNormalVelocity(NormVel, VelTimeLevel); - OMEGA_SCOPE(LayerThicknessAux, AuxState->LayerThicknessAux); + OMEGA_SCOPE(PseudoThicknessAux, AuxState->PseudoThicknessAux); OMEGA_SCOPE(LayerThickCell, LayerThick); OMEGA_SCOPE(NormalVelEdge, NormVel); @@ -505,8 +505,8 @@ void Tendencies::computeThicknessTendencies( parallelFor( "computeLayerThickAux", {NEdgesAll, NChunks}, KOKKOS_LAMBDA(int IEdge, int KChunk) { - LayerThicknessAux.computeVarsOnEdge(IEdge, KChunk, LayerThickCell, - NormalVelEdge); + PseudoThicknessAux.computeVarsOnEdge(IEdge, KChunk, LayerThickCell, + NormalVelEdge); }); Pacer::stop("Tend:computeLayerThickAux", 2); @@ -541,7 +541,7 @@ void Tendencies::computeTracerTendencies( TimeInstant Time ///< [in] Time ) { OMEGA_SCOPE(TracerAux, AuxState->TracerAux); - OMEGA_SCOPE(LayerThickCell, State->LayerThickness[ThickTimeLevel]); + OMEGA_SCOPE(LayerThickCell, State->PseudoThickness[ThickTimeLevel]); OMEGA_SCOPE(NormalVelEdge, State->NormalVelocity[VelTimeLevel]); Pacer::start("Tend:computeTracerTendencies", 1); @@ -556,7 +556,7 @@ void Tendencies::computeTracerTendencies( Pacer::stop("Tend:computeTracerAuxEdge", 2); const auto &MeanLayerThickEdge = - AuxState->LayerThicknessAux.MeanLayerThickEdge; + AuxState->PseudoThicknessAux.MeanLayerThickEdge; Pacer::start("Tend:computeTracerAuxCell", 2); parallelFor( "computeTracerAuxCell", {NTracers, NCellsAll, NChunks}, diff --git a/components/omega/src/ocn/Tendencies.h b/components/omega/src/ocn/Tendencies.h index 2544f0b77116..122d061e1468 100644 --- a/components/omega/src/ocn/Tendencies.h +++ b/components/omega/src/ocn/Tendencies.h @@ -52,7 +52,7 @@ class Tendencies { std::function; // Arrays for accumulating tendencies - Array2DReal LayerThicknessTend; + Array2DReal PseudoThicknessTend; Array2DReal NormalVelocityTend; Array3DReal TracerTend; diff --git a/components/omega/src/ocn/VertCoord.cpp b/components/omega/src/ocn/VertCoord.cpp index a9fb93fbd708..cf94bd06c55c 100644 --- a/components/omega/src/ocn/VertCoord.cpp +++ b/components/omega/src/ocn/VertCoord.cpp @@ -164,19 +164,19 @@ VertCoord::VertCoord(const std::string &Name_, //< [in] Name for new VertCoord ZInterface = Array2DReal("ZInterface", NCellsSize, NVertLayersP1); ZMid = Array2DReal("ZMid", NCellsSize, NVertLayers); GeopotentialMid = Array2DReal("GeopotentialMid", NCellsSize, NVertLayers); - LayerThicknessTarget = - Array2DReal("LayerThicknessTarget", NCellsSize, NVertLayers); - RefLayerThickness = - Array2DReal("RefLayerThickness", NCellsSize, NVertLayers); + PseudoThicknessTarget = + Array2DReal("PseudoThicknessTarget", NCellsSize, NVertLayers); + RefPseudoThickness = + Array2DReal("RefPseudoThickness", NCellsSize, NVertLayers); // Make host copies for device arrays not being read from file - PressureInterfaceH = createHostMirrorCopy(PressureInterface); - PressureMidH = createHostMirrorCopy(PressureMid); - ZInterfaceH = createHostMirrorCopy(ZInterface); - ZMidH = createHostMirrorCopy(ZMid); - GeopotentialMidH = createHostMirrorCopy(GeopotentialMid); - LayerThicknessTargetH = createHostMirrorCopy(LayerThicknessTarget); - RefLayerThicknessH = createHostMirrorCopy(RefLayerThickness); + PressureInterfaceH = createHostMirrorCopy(PressureInterface); + PressureMidH = createHostMirrorCopy(PressureMid); + ZInterfaceH = createHostMirrorCopy(ZInterface); + ZMidH = createHostMirrorCopy(ZMid); + GeopotentialMidH = createHostMirrorCopy(GeopotentialMid); + PseudoThicknessTargetH = createHostMirrorCopy(PseudoThicknessTarget); + RefPseudoThicknessH = createHostMirrorCopy(RefPseudoThickness); // Define field metadata defineFields(); @@ -237,7 +237,7 @@ void VertCoord::defineFields() { ZInterfFldName = "ZInterface"; ZMidFldName = "ZMid"; GeopotFldName = "GeopotentialMid"; - LyrThickTargetFldName = "LayerThicknessTarget"; + LyrThickTargetFldName = "PseudoThicknessTarget"; if (Name != "Default") { MinLayerCellFldName.append(Name); @@ -312,15 +312,15 @@ void VertCoord::defineFields() { ); auto ZInterfaceField = Field::create( - ZInterfFldName, // field name - "Cartesian Z coordinate at layer interfaces", // long name or description - "m", // units - "height", // CF standard Name - std::numeric_limits::min(), // min valid value - std::numeric_limits::max(), // max valid value - FillValueReal, // scalar for undefined entries - NDims, // number of dimensions - DimNames // dimension names + ZInterfFldName, // field name + "Geometric height at layer interfaces", // long name or description + "m", // units + "height", // CF standard Name + std::numeric_limits::min(), // min valid value + std::numeric_limits::max(), // max valid value + FillValueReal, // scalar for undefined entries + NDims, // number of dimensions + DimNames // dimension names ); DimNames[1] = "NVertLayers"; @@ -338,15 +338,15 @@ void VertCoord::defineFields() { ); auto ZMidField = Field::create( - ZMidFldName, // field name - "Cartesian Z coordinate at layer midpoints", // long name or description - "m", // units - "height", // CF standard Name - std::numeric_limits::min(), // min valid value - std::numeric_limits::max(), // max valid value - FillValueReal, // scalar for undefined entries - NDims, // number of dimensions - DimNames // dimension names + ZMidFldName, // field name + "Geometric height at layer midpoints", // long name or description + "m", // units + "height", // CF standard Name + std::numeric_limits::min(), // min valid value + std::numeric_limits::max(), // max valid value + FillValueReal, // scalar for undefined entries + NDims, // number of dimensions + DimNames // dimension names ); auto GeopotentialMidField = Field::create( @@ -361,7 +361,7 @@ void VertCoord::defineFields() { DimNames // dimension names ); - auto LayerThicknessTargetField = + auto PseudoThicknessTargetField = Field::create(LyrThickTargetFldName, // field name "desired layer thickness based on total perturbation from " "the reference thickness", // long name or description @@ -409,7 +409,7 @@ void VertCoord::defineFields() { ZInterfaceField->attachData(ZInterface); ZMidField->attachData(ZMid); GeopotentialMidField->attachData(GeopotentialMid); - LayerThicknessTargetField->attachData(LayerThicknessTarget); + PseudoThicknessTargetField->attachData(PseudoThicknessTarget); } // end defineFields @@ -813,13 +813,13 @@ void VertCoord::initMovementWeights() { //------------------------------------------------------------------------------ // Compute the pressure at each layer interface and midpoint given the -// LayerThickness and SurfacePressure. Hierarchical parallelism is used with a +// PseudoThickness and SurfacePressure. Hierarchical parallelism is used with a // parallel_for loop over all cells and a parallel_scan performing a prefix sum // in each column to compute pressure from the top-most active layer to the // bottom-most active layer. void VertCoord::computePressure( - const Array2DReal &LayerThickness, // [in] pseudo thickness - const Array1DReal &SurfacePressure // [in] surface pressure + const Array2DReal &PseudoThickness, // [in] pseudo thickness + const Array1DReal &SurfacePressure // [in] surface pressure ) { OMEGA_SCOPE(LocRho0, Rho0); @@ -837,33 +837,33 @@ void VertCoord::computePressure( const I4 Range = KMax - KMin + 1; LocPressInterf(ICell, KMin) = SurfacePressure(ICell); - Kokkos::parallel_scan(TeamThreadRange(Member, Range), - [=](int K, Real &Accum, bool IsFinal) { - const I4 KLyr = K + KMin; - Real Increment = Gravity * LocRho0 * - LayerThickness(ICell, KLyr); - Accum += Increment; - - if (IsFinal) { - LocPressInterf(ICell, KLyr + 1) = - SurfacePressure(ICell) + Accum; - LocPressMid(ICell, KLyr) = - SurfacePressure(ICell) + Accum - - 0.5 * Increment; - } - }); + Kokkos::parallel_scan( + TeamThreadRange(Member, Range), + [=](int K, Real &Accum, bool IsFinal) { + const I4 KLyr = K + KMin; + Real Increment = + Gravity * LocRho0 * PseudoThickness(ICell, KLyr); + Accum += Increment; + + if (IsFinal) { + LocPressInterf(ICell, KLyr + 1) = + SurfacePressure(ICell) + Accum; + LocPressMid(ICell, KLyr) = + SurfacePressure(ICell) + Accum - 0.5 * Increment; + } + }); }); } // end computePressure //------------------------------------------------------------------------------ // Compute geometric height z at layer interfaces and midpoints given the -// LayerThickness, SpecVol, and BottomDepth. Hierarchical parallelism is used +// PseudoThickness, SpecVol, and BottomDepth. Hierarchical parallelism is used // with a parallel_for loop over cells and a parallel_scan performing a prefix // sum in each column to compute z from the bottom-most active layer to the // top-most active layer void VertCoord::computeZHeight( - const Array2DReal &LayerThickness, // [in] pseudo thickness - const Array2DReal &SpecVol // [in] specific volume + const Array2DReal &PseudoThickness, // [in] pseudo thickness + const Array2DReal &SpecVol // [in] specific volume ) { OMEGA_SCOPE(LocRho0, Rho0); @@ -887,7 +887,7 @@ void VertCoord::computeZHeight( [=](int K, Real &Accum, bool IsFinal) { const I4 KLyr = KMax - K; Real DZ = LocRho0 * SpecVol(ICell, KLyr) * - LayerThickness(ICell, KLyr); + PseudoThickness(ICell, KLyr); Accum += DZ; if (IsFinal) { LocZInterf(ICell, KLyr) = -LocBotDepth(ICell) + Accum; @@ -941,7 +941,7 @@ void VertCoord::computeGeopotential( //------------------------------------------------------------------------------ // Compute the desired target thickness, given PressureInterface, -// RefLayerThickness, and VertCoordMovementWeights. Hierarchical parallelsim is +// RefPseudoThickness, and VertCoordMovementWeights. Hierarchical parallelsim is // used with an outer parallel_for loop over cells, and 2 paralel_reduce // reductions and a parallel_for over the active layers within a column. void VertCoord::computeTargetThickness() { @@ -949,9 +949,9 @@ void VertCoord::computeTargetThickness() { OMEGA_SCOPE(LocRho0, Rho0); OMEGA_SCOPE(LocMinLayerCell, MinLayerCell); OMEGA_SCOPE(LocMaxLayerCell, MaxLayerCell); - OMEGA_SCOPE(LocLayerThickTarget, LayerThicknessTarget); + OMEGA_SCOPE(LocLayerThickTarget, PseudoThicknessTarget); OMEGA_SCOPE(LocPressInterf, PressureInterface); - OMEGA_SCOPE(LocRefLayerThick, RefLayerThickness); + OMEGA_SCOPE(LocRefLayerThick, RefPseudoThickness); OMEGA_SCOPE(LocVertCoordMvmtWgts, VertCoordMovementWeights); Kokkos::parallel_for( @@ -1006,8 +1006,8 @@ void VertCoord::copyToHost() { deepCopy(ZInterfaceH, ZInterface); deepCopy(ZMidH, ZMid); deepCopy(GeopotentialMidH, GeopotentialMid); - deepCopy(LayerThicknessTargetH, LayerThicknessTarget); - deepCopy(RefLayerThicknessH, RefLayerThickness); + deepCopy(PseudoThicknessTargetH, PseudoThicknessTarget); + deepCopy(RefPseudoThicknessH, RefPseudoThickness); } //------------------------------------------------------------------------------ @@ -1019,8 +1019,8 @@ void VertCoord::copyToDevice() { deepCopy(ZInterface, ZInterfaceH); deepCopy(ZMid, ZMidH); deepCopy(GeopotentialMid, GeopotentialMidH); - deepCopy(LayerThicknessTarget, LayerThicknessTargetH); - deepCopy(RefLayerThickness, RefLayerThicknessH); + deepCopy(PseudoThicknessTarget, PseudoThicknessTargetH); + deepCopy(RefPseudoThickness, RefPseudoThicknessH); } //------------------------------------------------------------------------------ diff --git a/components/omega/src/ocn/VertCoord.h b/components/omega/src/ocn/VertCoord.h index b503d1ab24fa..35c6107131ec 100644 --- a/components/omega/src/ocn/VertCoord.h +++ b/components/omega/src/ocn/VertCoord.h @@ -86,14 +86,14 @@ class VertCoord { Array2DReal ZInterface; Array2DReal ZMid; Array2DReal GeopotentialMid; - Array2DReal LayerThicknessTarget; + Array2DReal PseudoThicknessTarget; HostArray2DReal PressureInterfaceH; HostArray2DReal PressureMidH; HostArray2DReal ZInterfaceH; HostArray2DReal ZMidH; HostArray2DReal GeopotentialMidH; - HostArray2DReal LayerThicknessTargetH; + HostArray2DReal PseudoThicknessTargetH; // Vertical loop bounds Array1DI4 MinLayerCell; @@ -120,10 +120,10 @@ class VertCoord { // p star coordinate variables Array1DReal VertCoordMovementWeights; - Array2DReal RefLayerThickness; + Array2DReal RefPseudoThickness; HostArray1DReal VertCoordMovementWeightsH; - HostArray2DReal RefLayerThicknessH; + HostArray2DReal RefPseudoThicknessH; // Masks Array2DReal EdgeMask; ///< Mask to determine if computations should be @@ -210,16 +210,16 @@ class VertCoord { /// Sums the mass thickness times g from the top layer down, starting with /// the surface pressure - void - computePressure(const Array2DReal &LayerThickness, ///< [in] pseudo thickness - const Array1DReal &SurfacePressure ///< [in] surface pressure + void computePressure( + const Array2DReal &PseudoThickness, ///< [in] pseudo thickness + const Array1DReal &SurfacePressure ///< [in] surface pressure ); /// Sum the mass thickness times specific volume from the bottom layer up, /// starting with the bottom elevation void - computeZHeight(const Array2DReal &LayerThickness, ///< [in] pseudo thickness - const Array2DReal &SpecVol); ///< [in] specific volume + computeZHeight(const Array2DReal &PseudoThickness, ///< [in] pseudo thickness + const Array2DReal &SpecVol); ///< [in] specific volume /// Sum the z height times g, the tidal potential, and self attraction and /// loading diff --git a/components/omega/src/ocn/auxiliaryVars/LayerThicknessAuxVars.cpp b/components/omega/src/ocn/auxiliaryVars/PseudoThicknessAuxVars.cpp similarity index 88% rename from components/omega/src/ocn/auxiliaryVars/LayerThicknessAuxVars.cpp rename to components/omega/src/ocn/auxiliaryVars/PseudoThicknessAuxVars.cpp index 6ed575df788a..8b72732fd0e9 100644 --- a/components/omega/src/ocn/auxiliaryVars/LayerThicknessAuxVars.cpp +++ b/components/omega/src/ocn/auxiliaryVars/PseudoThicknessAuxVars.cpp @@ -1,13 +1,12 @@ -#include "LayerThicknessAuxVars.h" +#include "PseudoThicknessAuxVars.h" #include "Field.h" #include namespace OMEGA { -LayerThicknessAuxVars::LayerThicknessAuxVars(const std::string &AuxStateSuffix, - const HorzMesh *Mesh, - int NVertLayers) +PseudoThicknessAuxVars::PseudoThicknessAuxVars( + const std::string &AuxStateSuffix, const HorzMesh *Mesh, int NVertLayers) : FluxLayerThickEdge("FluxLayerThickEdge" + AuxStateSuffix, Mesh->NEdgesSize, NVertLayers), MeanLayerThickEdge("MeanLayerThickEdge" + AuxStateSuffix, @@ -15,8 +14,8 @@ LayerThicknessAuxVars::LayerThicknessAuxVars(const std::string &AuxStateSuffix, SshCell("SshCell" + AuxStateSuffix, Mesh->NCellsSize, NVertLayers), CellsOnEdge(Mesh->CellsOnEdge), BottomDepth(Mesh->BottomDepth) {} -void LayerThicknessAuxVars::registerFields(const std::string &AuxGroupName, - const std::string &MeshName) const { +void PseudoThicknessAuxVars::registerFields(const std::string &AuxGroupName, + const std::string &MeshName) const { // Create/define fields const Real FillValue = -9.99e30; @@ -85,7 +84,7 @@ void LayerThicknessAuxVars::registerFields(const std::string &AuxGroupName, SshCellField->attachData(SshCell); } -void LayerThicknessAuxVars::unregisterFields() const { +void PseudoThicknessAuxVars::unregisterFields() const { Field::destroy(FluxLayerThickEdge.label()); Field::destroy(MeanLayerThickEdge.label()); Field::destroy(SshCell.label()); diff --git a/components/omega/src/ocn/auxiliaryVars/LayerThicknessAuxVars.h b/components/omega/src/ocn/auxiliaryVars/PseudoThicknessAuxVars.h similarity index 94% rename from components/omega/src/ocn/auxiliaryVars/LayerThicknessAuxVars.h rename to components/omega/src/ocn/auxiliaryVars/PseudoThicknessAuxVars.h index 44562aa6cc5c..27ea7a975796 100644 --- a/components/omega/src/ocn/auxiliaryVars/LayerThicknessAuxVars.h +++ b/components/omega/src/ocn/auxiliaryVars/PseudoThicknessAuxVars.h @@ -11,7 +11,7 @@ namespace OMEGA { enum class FluxThickEdgeOption { Center, Upwind }; -class LayerThicknessAuxVars { +class PseudoThicknessAuxVars { public: Array2DReal FluxLayerThickEdge; Array2DReal MeanLayerThickEdge; @@ -19,8 +19,8 @@ class LayerThicknessAuxVars { FluxThickEdgeOption FluxThickEdgeChoice; - LayerThicknessAuxVars(const std::string &AuxStateSuffix, - const HorzMesh *Mesh, int NVertLayers); + PseudoThicknessAuxVars(const std::string &AuxStateSuffix, + const HorzMesh *Mesh, int NVertLayers); KOKKOS_FUNCTION void computeVarsOnEdge(int IEdge, int KChunk, const Array2DReal &LayerThickCell, diff --git a/components/omega/src/timeStepping/RungeKutta4Stepper.cpp b/components/omega/src/timeStepping/RungeKutta4Stepper.cpp index d9db7e9b8331..046d66c924e5 100644 --- a/components/omega/src/timeStepping/RungeKutta4Stepper.cpp +++ b/components/omega/src/timeStepping/RungeKutta4Stepper.cpp @@ -49,7 +49,7 @@ void RungeKutta4Stepper::finalizeInit() { if (!MeshHalo) LOG_CRITICAL("Invalid MeshHalo"); - int NVertLayers = Tend->LayerThicknessTend.extent_int(1); + int NVertLayers = Tend->PseudoThicknessTend.extent_int(1); int NTracers = Tracers::getNumTracers(); int NCellsSize = Mesh->NCellsSize; int NTimeLevels = 1; // for provisional tracer diff --git a/components/omega/src/timeStepping/TimeStepper.cpp b/components/omega/src/timeStepping/TimeStepper.cpp index 1d76fdd2cf89..f1f03e607311 100644 --- a/components/omega/src/timeStepping/TimeStepper.cpp +++ b/components/omega/src/timeStepping/TimeStepper.cpp @@ -373,8 +373,8 @@ Alarm *TimeStepper::getEndAlarm() { return EndAlarm.get(); } //------------------------------------------------------------------------------ // Updates layer thickness using tendency terms -// LayerThickness1(TimeLevel1) = LayerThickness2(TimeLevel2) + -// Coeff * LayerThicknessTend +// PseudoThickness1(TimeLevel1) = PseudoThickness2(TimeLevel2) + +// Coeff * PseudoThicknessTend void TimeStepper::updateThicknessByTend(OceanState *State1, int TimeLevel1, OceanState *State2, int TimeLevel2, TimeInterval Coeff) const { @@ -382,11 +382,11 @@ void TimeStepper::updateThicknessByTend(OceanState *State1, int TimeLevel1, Array2DReal LayerThick1; Array2DReal LayerThick2; I4 Err; - Err = State1->getLayerThickness(LayerThick1, TimeLevel1); - Err = State2->getLayerThickness(LayerThick2, TimeLevel2); + Err = State1->getPseudoThickness(LayerThick1, TimeLevel1); + Err = State2->getPseudoThickness(LayerThick2, TimeLevel2); if (Err != 0) ABORT_ERROR("TimeStepper updateThickness: error retrieving layer thick"); - const auto &LayerThickTend = Tend->LayerThicknessTend; + const auto &LayerThickTend = Tend->PseudoThicknessTend; const int NVertLayers = LayerThickTend.extent_int(1); R8 CoeffSeconds; @@ -441,16 +441,16 @@ void TimeStepper::updateStateByTend(OceanState *State1, int TimeLevel1, //------------------------------------------------------------------------------ // Updates tracers -// NextTracers = (CurTracers * LayerThickness2(TimeLevel2)) + -// Coeff * TracersTend) / LayerThickness1(TimeLevel1) +// NextTracers = (CurTracers * PseudoThickness2(TimeLevel2)) + +// Coeff * TracersTend) / PseudoThickness1(TimeLevel1) void TimeStepper::updateTracersByTend(const Array3DReal &NextTracers, const Array3DReal &CurTracers, OceanState *State1, int TimeLevel1, OceanState *State2, int TimeLevel2, TimeInterval Coeff) const { - const auto &LayerThick1 = State1->LayerThickness[TimeLevel1]; - const auto &LayerThick2 = State2->LayerThickness[TimeLevel2]; + const auto &LayerThick1 = State1->PseudoThickness[TimeLevel1]; + const auto &LayerThick2 = State2->PseudoThickness[TimeLevel2]; const auto &TracerTend = Tend->TracerTend; const int NTracers = TracerTend.extent(0); const int NVertLayers = TracerTend.extent(2); @@ -474,7 +474,7 @@ void TimeStepper::weightTracers(const Array3DReal &NextTracers, const Array3DReal &CurTracers, OceanState *CurState, int TimeLevel1) const { - const Array2DReal &CurThickness = CurState->LayerThickness[TimeLevel1]; + const Array2DReal &CurThickness = CurState->PseudoThickness[TimeLevel1]; const int NTracers = NextTracers.extent(0); const int NVertLayers = NextTracers.extent(2); @@ -512,7 +512,7 @@ void TimeStepper::finalizeTracersUpdate(const Array3DReal &NextTracers, OceanState *State, int TimeLevel) const { - const Array2DReal &NextThick = State->LayerThickness[TimeLevel]; + const Array2DReal &NextThick = State->PseudoThickness[TimeLevel]; const int NTracers = NextTracers.extent(0); const int NVertLayers = NextTracers.extent(2); diff --git a/components/omega/src/timeStepping/TimeStepper.h b/components/omega/src/timeStepping/TimeStepper.h index 0c5527a934d0..da7e173a54b3 100644 --- a/components/omega/src/timeStepping/TimeStepper.h +++ b/components/omega/src/timeStepping/TimeStepper.h @@ -180,8 +180,8 @@ class TimeStepper { ) const; /// Updates layer thickness using tendency terms - /// LayerThickness1(TimeLevel1) = LayerThickness2(TimeLevel2) + - /// Coeff * LayerThicknessTend + /// PseudoThickness1(TimeLevel1) = PseudoThickness2(TimeLevel2) + + /// Coeff * PseudoThicknessTend void updateThicknessByTend( OceanState *State1, ///< [out] updated layer thickness in state int TimeLevel1, ///< [in] time level index for new time @@ -202,8 +202,8 @@ class TimeStepper { ) const; /// Updates tracers - /// NextTracers = (CurTracers * LayerThickness2(TimeLevel2)) + - /// Coeff * TracersTend) / LayerThickness1(TimeLevel1) + /// NextTracers = (CurTracers * PseudoThickness2(TimeLevel2)) + + /// Coeff * TracersTend) / PseudoThickness1(TimeLevel1) void updateTracersByTend( const Array3DReal &NextTracers, ///< [out] updated tracers const Array3DReal &CurTracers, ///< [in] current tracers diff --git a/components/omega/test/ocn/AuxiliaryStateTest.cpp b/components/omega/test/ocn/AuxiliaryStateTest.cpp index 20b848f7d6e6..7b5a22551d0f 100644 --- a/components/omega/test/ocn/AuxiliaryStateTest.cpp +++ b/components/omega/test/ocn/AuxiliaryStateTest.cpp @@ -26,7 +26,7 @@ using namespace OMEGA; struct TestSetup { Real Radius = REarth; - KOKKOS_FUNCTION Real layerThickness(Real Lon, Real Lat) const { + KOKKOS_FUNCTION Real pseudoThickness(Real Lon, Real Lat) const { return (2 + std::cos(Lon) * std::pow(std::cos(Lat), 4)); } @@ -56,7 +56,7 @@ int initState() { Array2DReal LayerThickCell; Array2DReal NormalVelEdge; - Err = State->getLayerThickness(LayerThickCell, 0); + Err = State->getPseudoThickness(LayerThickCell, 0); Err += State->getNormalVelocity(NormalVelEdge, 0); Array3DReal TracerArray; Err += Tracers::getAll(TracerArray, 0); @@ -64,7 +64,7 @@ int initState() { int NTracers = Tracers::getNumTracers(); Err += setScalar( - KOKKOS_LAMBDA(Real X, Real Y) { return Setup.layerThickness(X, Y); }, + KOKKOS_LAMBDA(Real X, Real Y) { return Setup.pseudoThickness(X, Y); }, LayerThickCell, Geom, Mesh, OnCell); Err += setScalar( @@ -168,8 +168,8 @@ int testAuxState() { deepCopy(DefAuxState->KineticAux.KineticEnergyCell, NAN); deepCopy(DefAuxState->KineticAux.VelocityDivCell, NAN); - deepCopy(DefAuxState->LayerThicknessAux.FluxLayerThickEdge, NAN); - deepCopy(DefAuxState->LayerThicknessAux.MeanLayerThickEdge, NAN); + deepCopy(DefAuxState->PseudoThicknessAux.FluxLayerThickEdge, NAN); + deepCopy(DefAuxState->PseudoThicknessAux.MeanLayerThickEdge, NAN); deepCopy(DefAuxState->VorticityAux.RelVortVertex, NAN); deepCopy(DefAuxState->VorticityAux.NormRelVortVertex, NAN); @@ -211,14 +211,14 @@ int testAuxState() { } const Real FluxLayerThickSum = - sum(DefAuxState->LayerThicknessAux.FluxLayerThickEdge, NEdgesOwned); + sum(DefAuxState->PseudoThicknessAux.FluxLayerThickEdge, NEdgesOwned); if (!Kokkos::isfinite(FluxLayerThickSum)) { Err++; LOG_ERROR("AuxStateTest: FluxLayerThickEdge FAIL"); } const Real MeanLayerThickSum = - sum(DefAuxState->LayerThicknessAux.MeanLayerThickEdge, NEdgesOwned); + sum(DefAuxState->PseudoThicknessAux.MeanLayerThickEdge, NEdgesOwned); if (!Kokkos::isfinite(MeanLayerThickSum)) { Err++; LOG_ERROR("AuxStateTest: MeanLayerThickEdge FAIL"); diff --git a/components/omega/test/ocn/AuxiliaryVarsTest.cpp b/components/omega/test/ocn/AuxiliaryVarsTest.cpp index 45db07067130..a620e6ca36f3 100644 --- a/components/omega/test/ocn/AuxiliaryVarsTest.cpp +++ b/components/omega/test/ocn/AuxiliaryVarsTest.cpp @@ -14,7 +14,7 @@ #include "Pacer.h" #include "VertCoord.h" #include "auxiliaryVars/KineticAuxVars.h" -#include "auxiliaryVars/LayerThicknessAuxVars.h" +#include "auxiliaryVars/PseudoThicknessAuxVars.h" #include "auxiliaryVars/TracerAuxVars.h" #include "auxiliaryVars/VelocityDel2AuxVars.h" #include "auxiliaryVars/VorticityAuxVars.h" @@ -68,7 +68,7 @@ struct TestSetupPlane { ErrorMeasures ExpectedNormalStressErrors = {0.0033910709836867704, 0.0039954090464502795}; - KOKKOS_FUNCTION Real layerThickness(Real X, Real Y) const { + KOKKOS_FUNCTION Real pseudoThickness(Real X, Real Y) const { return 2 + std::cos(TwoPi * X / Lx) * std::cos(TwoPi * Y / Ly); } @@ -121,11 +121,11 @@ struct TestSetupPlane { } KOKKOS_FUNCTION Real normalizedRelativeVorticity(Real X, Real Y) const { - return relativeVorticity(X, Y) / layerThickness(X, Y); + return relativeVorticity(X, Y) / pseudoThickness(X, Y); } KOKKOS_FUNCTION Real normalizedPlanetaryVorticity(Real X, Real Y) const { - return planetaryVorticity(X, Y) / layerThickness(X, Y); + return planetaryVorticity(X, Y) / pseudoThickness(X, Y); } KOKKOS_FUNCTION Real kineticEnergy(Real X, Real Y) const { @@ -196,7 +196,7 @@ struct TestSetupSphere { ErrorMeasures ExpectedNormalStressErrors = {0.0038588958862868362, 0.003813760171030077}; - KOKKOS_FUNCTION Real layerThickness(Real Lon, Real Lat) const { + KOKKOS_FUNCTION Real pseudoThickness(Real Lon, Real Lat) const { return (2 + std::cos(Lon) * std::pow(std::cos(Lat), 4)); } @@ -270,11 +270,11 @@ struct TestSetupSphere { } KOKKOS_FUNCTION Real normalizedRelativeVorticity(Real Lon, Real Lat) const { - return relativeVorticity(Lon, Lat) / layerThickness(Lon, Lat); + return relativeVorticity(Lon, Lat) / pseudoThickness(Lon, Lat); } KOKKOS_FUNCTION Real normalizedPlanetaryVorticity(Real Lon, Real Lat) const { - return planetaryVorticity(Lon, Lat) / layerThickness(Lon, Lat); + return planetaryVorticity(Lon, Lat) / pseudoThickness(Lon, Lat); } KOKKOS_FUNCTION Real kineticEnergy(Real Lon, Real Lat) const { @@ -321,7 +321,7 @@ int initState(const Array2DReal &LayerThickCell, TestSetup Setup; Err += setScalar( - KOKKOS_LAMBDA(Real X, Real Y) { return Setup.layerThickness(X, Y); }, + KOKKOS_LAMBDA(Real X, Real Y) { return Setup.pseudoThickness(X, Y); }, LayerThickCell, Geom, Mesh, OnCell); Err += setVectorEdge( @@ -341,7 +341,7 @@ int initState(const Array2DReal &LayerThickCell, return Err; } -int testKineticAuxVars(const Array2DReal &LayerThicknessCell, +int testKineticAuxVars(const Array2DReal &PseudoThicknessCell, const Array2DReal &NormalVelocityEdge, Real RTol) { int Err = 0; TestSetup Setup; @@ -445,8 +445,8 @@ int testWindForcingAuxVars(Real RTol) { return Err; } -int testLayerThicknessAuxVars(const Array2DReal &LayerThickCell, - const Array2DReal &NormalVelEdge, Real RTol) { +int testPseudoThicknessAuxVars(const Array2DReal &LayerThickCell, + const Array2DReal &NormalVelEdge, Real RTol) { int Err = 0; TestSetup Setup; @@ -456,21 +456,21 @@ int testLayerThicknessAuxVars(const Array2DReal &LayerThickCell, Array2DReal ExactThickEdge("ExactThickEdge", Mesh->NEdgesOwned, NVertLayers); Err += setScalar( - KOKKOS_LAMBDA(Real X, Real Y) { return Setup.layerThickness(X, Y); }, + KOKKOS_LAMBDA(Real X, Real Y) { return Setup.pseudoThickness(X, Y); }, ExactThickEdge, Geom, Mesh, OnEdge, ExchangeHalos::No); // Compute numerical result - LayerThicknessAuxVars LayerThicknessAux("", Mesh, NVertLayers); - LayerThicknessAux.FluxThickEdgeChoice = FluxThickEdgeOption::Upwind; + PseudoThicknessAuxVars PseudoThicknessAux("", Mesh, NVertLayers); + PseudoThicknessAux.FluxThickEdgeChoice = FluxThickEdgeOption::Upwind; parallelFor( {Mesh->NEdgesOwned, NVertLayers}, KOKKOS_LAMBDA(int IEdge, int KLayer) { - LayerThicknessAux.computeVarsOnEdge(IEdge, KLayer, LayerThickCell, - NormalVelEdge); + PseudoThicknessAux.computeVarsOnEdge(IEdge, KLayer, LayerThickCell, + NormalVelEdge); }); - const auto &NumFluxLayerThickEdge = LayerThicknessAux.FluxLayerThickEdge; - const auto &NumMeanLayerThickEdge = LayerThicknessAux.MeanLayerThickEdge; + const auto &NumFluxLayerThickEdge = PseudoThicknessAux.FluxLayerThickEdge; + const auto &NumMeanLayerThickEdge = PseudoThicknessAux.MeanLayerThickEdge; // Compute error measures and check error values @@ -739,7 +739,7 @@ int testTracerAuxVars(const Array2DReal &LayerThickCell, Array2DReal LayerThickEdge("LayerThickEdge", Mesh->NEdgesSize, NVertLayers); Err += setScalar( - KOKKOS_LAMBDA(Real X, Real Y) { return Setup.layerThickness(X, Y); }, + KOKKOS_LAMBDA(Real X, Real Y) { return Setup.pseudoThickness(X, Y); }, LayerThickEdge, Geom, Mesh, OnEdge); // Compute exact HTracerEdge @@ -861,7 +861,7 @@ int auxVarsTest(const std::string &mesh = DefaultMeshFile) { Err += testKineticAuxVars(LayerThickCell, NormalVelEdge, RTol); - Err += testLayerThicknessAuxVars(LayerThickCell, NormalVelEdge, RTol); + Err += testPseudoThicknessAuxVars(LayerThickCell, NormalVelEdge, RTol); Err += testVorticityAuxVars(LayerThickCell, NormalVelEdge, RTol); diff --git a/components/omega/test/ocn/StateTest.cpp b/components/omega/test/ocn/StateTest.cpp index b83333785455..a668f07367e7 100644 --- a/components/omega/test/ocn/StateTest.cpp +++ b/components/omega/test/ocn/StateTest.cpp @@ -126,14 +126,14 @@ int checkHost(OceanState *RefState, OceanState *TstState, int RefTimeLevel, int TstTimeLevel) { int count = 0; - HostArray2DReal LayerThicknessHRef; - HostArray2DReal LayerThicknessHTst; - RefState->getLayerThicknessH(LayerThicknessHRef, RefTimeLevel); - TstState->getLayerThicknessH(LayerThicknessHTst, TstTimeLevel); + HostArray2DReal PseudoThicknessHRef; + HostArray2DReal PseudoThicknessHTst; + RefState->getPseudoThicknessH(PseudoThicknessHRef, RefTimeLevel); + TstState->getPseudoThicknessH(PseudoThicknessHTst, TstTimeLevel); for (int Cell = 0; Cell < RefState->NCellsAll; Cell++) { for (int Layer = 0; Layer < RefState->NVertLayers; Layer++) { - if (LayerThicknessHRef(Cell, Layer) != - LayerThicknessHTst(Cell, Layer)) { + if (PseudoThicknessHRef(Cell, Layer) != + PseudoThicknessHTst(Cell, Layer)) { count++; } } @@ -161,15 +161,15 @@ int checkDevice(OceanState *RefState, OceanState *TstState, int RefTimeLevel, int TstTimeLevel) { int count1; - Array2DReal LayerThicknessRef; - Array2DReal LayerThicknessTst; - RefState->getLayerThickness(LayerThicknessRef, RefTimeLevel); - TstState->getLayerThickness(LayerThicknessTst, TstTimeLevel); + Array2DReal PseudoThicknessRef; + Array2DReal PseudoThicknessTst; + RefState->getPseudoThickness(PseudoThicknessRef, RefTimeLevel); + TstState->getPseudoThickness(PseudoThicknessTst, TstTimeLevel); parallelReduce( "reduce", {RefState->NCellsAll, RefState->NVertLayers}, KOKKOS_LAMBDA(int Cell, int Layer, int &Accum) { - if (LayerThicknessRef(Cell, Layer) != - LayerThicknessTst(Cell, Layer)) { + if (PseudoThicknessRef(Cell, Layer) != + PseudoThicknessTst(Cell, Layer)) { Accum++; } }, @@ -238,8 +238,8 @@ int main(int argc, char *argv[]) { HostArray2DReal NormalVelocityHDef; Array2DReal LayerThickDef; Array2DReal NormalVelocityDef; - DefState->getLayerThicknessH(LayerThickHDef, CurTime); - DefState->getLayerThickness(LayerThickDef, CurTime); + DefState->getPseudoThicknessH(LayerThickHDef, CurTime); + DefState->getPseudoThickness(LayerThickDef, CurTime); DefState->getNormalVelocityH(NormalVelocityHDef, CurTime); DefState->getNormalVelocity(NormalVelocityDef, CurTime); @@ -289,8 +289,8 @@ int main(int argc, char *argv[]) { HostArray2DReal NormalVelocityHTst; // Fill reference and test states at current time with Default state - RefState->getLayerThicknessH(LayerThickHRef, CurTime); - TstState->getLayerThicknessH(LayerThickHTst, CurTime); + RefState->getPseudoThicknessH(LayerThickHRef, CurTime); + TstState->getPseudoThicknessH(LayerThickHTst, CurTime); RefState->getNormalVelocityH(NormalVelocityHRef, CurTime); TstState->getNormalVelocityH(NormalVelocityHTst, CurTime); for (int Cell = 0; Cell < NCellsAll; Cell++) { @@ -312,8 +312,8 @@ int main(int argc, char *argv[]) { // Fill reference and test states at next time levels with the // Default state + 1 - RefState->getLayerThicknessH(LayerThickHRef, NewTime); - TstState->getLayerThicknessH(LayerThickHTst, NewTime); + RefState->getPseudoThicknessH(LayerThickHRef, NewTime); + TstState->getPseudoThicknessH(LayerThickHTst, NewTime); RefState->getNormalVelocityH(NormalVelocityHRef, NewTime); TstState->getNormalVelocityH(NormalVelocityHTst, NewTime); for (int Cell = 0; Cell < NCellsAll; Cell++) { diff --git a/components/omega/test/ocn/TendenciesTest.cpp b/components/omega/test/ocn/TendenciesTest.cpp index 5f5412360af5..e1189f5f6920 100644 --- a/components/omega/test/ocn/TendenciesTest.cpp +++ b/components/omega/test/ocn/TendenciesTest.cpp @@ -27,7 +27,7 @@ using namespace OMEGA; struct TestSetup { Real Radius = REarth; - KOKKOS_FUNCTION Real layerThickness(Real Lon, Real Lat) const { + KOKKOS_FUNCTION Real pseudoThickness(Real Lon, Real Lat) const { return (2 + std::cos(Lon) * std::pow(std::cos(Lat), 4)); } @@ -57,7 +57,7 @@ int initState() { Array2DReal LayerThickCell; Array2DReal NormalVelEdge; - Err += State->getLayerThickness(LayerThickCell, 0); + Err += State->getPseudoThickness(LayerThickCell, 0); Err += State->getNormalVelocity(NormalVelEdge, 0); Array3DReal TracersArray; @@ -67,7 +67,7 @@ int initState() { int NTracers = Tracers::getNumTracers(); Err += setScalar( - KOKKOS_LAMBDA(Real X, Real Y) { return Setup.layerThickness(X, Y); }, + KOKKOS_LAMBDA(Real X, Real Y) { return Setup.pseudoThickness(X, Y); }, LayerThickCell, Geom, Mesh, OnCell); Err += setScalar( @@ -171,7 +171,7 @@ int testTendencies() { VCoord->NVertLayers = NVertLayers; // put NANs in every tendency variables - deepCopy(DefTendencies->LayerThicknessTend, NAN); + deepCopy(DefTendencies->PseudoThicknessTend, NAN); deepCopy(DefTendencies->NormalVelocityTend, NAN); deepCopy(DefTendencies->TracerTend, NAN); @@ -192,7 +192,7 @@ int testTendencies() { int NTracers = Tracers::getNumTracers(); const Real LayerThickTendSum = - sum(DefTendencies->LayerThicknessTend, NCellsOwned); + sum(DefTendencies->PseudoThicknessTend, NCellsOwned); if (!Kokkos::isfinite(LayerThickTendSum) || LayerThickTendSum == 0) { Err++; LOG_ERROR("TendenciesTest: LayerThickTend FAIL"); diff --git a/components/omega/test/ocn/VertCoordTest.cpp b/components/omega/test/ocn/VertCoordTest.cpp index 6c4648e7ac36..f203b04c9153 100644 --- a/components/omega/test/ocn/VertCoordTest.cpp +++ b/components/omega/test/ocn/VertCoordTest.cpp @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) { // Tests for computePressure - Array2DReal LayerThickness("LayerThickness", NCellsSize, NVertLayers); + Array2DReal PseudoThickness("PseudoThickness", NCellsSize, NVertLayers); Array1DReal SurfacePressure("SurfacePressure", NCellsSize); /// Initialize layer thickness and surface pressure so that resulting @@ -116,13 +116,13 @@ int main(int argc, char *argv[]) { {NCellsAll}, KOKKOS_LAMBDA(int ICell) { SurfacePressure(ICell) = 1.0_Real; for (int K = 0; K < NVertLayers; K++) { - LayerThickness(ICell, K) = 1.0_Real / (Gravity * Rho0); + PseudoThickness(ICell, K) = 1.0_Real / (Gravity * Rho0); } }); Kokkos::fence(); /// Call function and get host copies of outputs - DefVertCoord->computePressure(LayerThickness, SurfacePressure); + DefVertCoord->computePressure(PseudoThickness, SurfacePressure); auto PressInterfH = createHostMirrorCopy(DefVertCoord->PressureInterface); auto PressMidH = createHostMirrorCopy(DefVertCoord->PressureMid); @@ -148,12 +148,11 @@ int main(int argc, char *argv[]) { /// Determine test pass/fail if (Err == 0) { - LOG_INFO( - "VertCoordTest: computePressure with uniform LayerThickness PASS"); + LOG_INFO("VertCoordTest: computePressure with uniform PseudoThickness " + "PASS"); } else { - ErrAll += Error( - ErrorCode::Fail, - "VertCoordTest: computePressure with uniform LayerThickness FAIL"); + ErrAll += Error(ErrorCode::Fail, "VertCoordTest: computePressure with " + "uniform PseudoThickness FAIL"); } /// Initialize layer thickness and surface pressure so that the resulting @@ -162,13 +161,13 @@ int main(int argc, char *argv[]) { {NCellsAll}, KOKKOS_LAMBDA(int ICell) { SurfacePressure(ICell) = 1.0_Real * ICell; for (int K = 0; K < NVertLayers; K++) { - LayerThickness(ICell, K) = (K + 1.0_Real) / (Gravity * Rho0); + PseudoThickness(ICell, K) = (K + 1.0_Real) / (Gravity * Rho0); } }); Kokkos::fence(); /// Call functions and get host copy of output - DefVertCoord->computePressure(LayerThickness, SurfacePressure); + DefVertCoord->computePressure(PseudoThickness, SurfacePressure); auto PressInterfH2 = createHostMirrorCopy(DefVertCoord->PressureInterface); @@ -189,11 +188,11 @@ int main(int argc, char *argv[]) { /// Determine test pass/fail if (Err == 0) { LOG_INFO("VertCoordTest: computePressure with non-uniform " - "LayerThickness PASS"); + "PseudoThickness PASS"); } else { ErrAll += Error( ErrorCode::Fail, - "VertCoordTest: computePressure with non-uniform LayerThickness " + "VertCoordTest: computePressure with non-uniform PseudoThickness " "FAIL"); } @@ -212,14 +211,14 @@ int main(int argc, char *argv[]) { {NCellsAll}, KOKKOS_LAMBDA(int ICell) { BotDepth(ICell) = MaxLyrCellReal(ICell) + 1.0_Real; for (int K = 0; K < NVertLayers; K++) { - LayerThickness(ICell, K) = (ICell + 1.0_Real) / Rho0; - SpecVol(ICell, K) = 1.0_Real / (ICell + 1.0_Real); + PseudoThickness(ICell, K) = (ICell + 1.0_Real) / Rho0; + SpecVol(ICell, K) = 1.0_Real / (ICell + 1.0_Real); } }); Kokkos::fence(); /// Call functions and get host copy of output - DefVertCoord->computeZHeight(LayerThickness, SpecVol); + DefVertCoord->computeZHeight(PseudoThickness, SpecVol); auto ZInterfH = createHostMirrorCopy(DefVertCoord->ZInterface); auto ZMidH = createHostMirrorCopy(DefVertCoord->ZMid); @@ -246,11 +245,11 @@ int main(int argc, char *argv[]) { /// Determine test pass/fail if (Err == 0) { LOG_INFO( - "VertCoordTest: computeZHeight with uniform LayerThickness PASS"); + "VertCoordTest: computeZHeight with uniform PseudoThickness PASS"); } else { ErrAll += Error( ErrorCode::Fail, - "VertCoordTest: computeZHeight with uniform LayerThickness FAIL"); + "VertCoordTest: computeZHeight with uniform PseudoThickness FAIL"); } /// Initialize bottom depth, layer thickness and specific volume so that @@ -260,14 +259,14 @@ int main(int argc, char *argv[]) { BotDepth(ICell) = (MaxLyrCellReal(ICell) + 2) * (MaxLyrCellReal(ICell) + 1) / 2.0_Real; for (int K = 0; K < NVertLayers; K++) { - LayerThickness(ICell, K) = (K + 1) / Rho0; - SpecVol(ICell, K) = 1.0_Real; + PseudoThickness(ICell, K) = (K + 1) / Rho0; + SpecVol(ICell, K) = 1.0_Real; } }); Kokkos::fence(); /// Call functions and get host copy of output - DefVertCoord->computeZHeight(LayerThickness, SpecVol); + DefVertCoord->computeZHeight(PseudoThickness, SpecVol); auto ZInterfH2 = createHostMirrorCopy(DefVertCoord->ZInterface); /// Check results @@ -287,11 +286,11 @@ int main(int argc, char *argv[]) { /// Determine test pass/fail if (Err == 0) { LOG_INFO("VertCoordTest: computeZHeight with non-uniform " - "LayerThickness PASS"); + "PseudoThickness PASS"); } else { ErrAll += Error( ErrorCode::Fail, - "VertCoordTest: computeZHeight with non-uniform LayerThickness " + "VertCoordTest: computeZHeight with non-uniform PseudoThickness " "FAIL"); } @@ -341,7 +340,7 @@ int main(int argc, char *argv[]) { } // Tests for computeTargetThickness - auto &RefLayerThick = DefVertCoord->RefLayerThickness; + auto &RefLayerThick = DefVertCoord->RefPseudoThickness; /// Initialize surface pressure, vertical coord weights, ref layer /// thickness, and layer thickness so that the resulting target thickness @@ -350,17 +349,17 @@ int main(int argc, char *argv[]) { {NCellsAll}, KOKKOS_LAMBDA(int ICell) { SurfacePressure(ICell) = 0.0; for (int K = 0; K < NVertLayers; K++) { - RefLayerThick(ICell, K) = 1.0; - LayerThickness(ICell, K) = 2.0; + RefLayerThick(ICell, K) = 1.0; + PseudoThickness(ICell, K) = 2.0; } }); Kokkos::fence(); /// Call functions and get host copy of output - DefVertCoord->computePressure(LayerThickness, SurfacePressure); + DefVertCoord->computePressure(PseudoThickness, SurfacePressure); DefVertCoord->computeTargetThickness(); - auto LayerThicknessTargetH = - createHostMirrorCopy(DefVertCoord->LayerThicknessTarget); + auto PseudoThicknessTargetH = + createHostMirrorCopy(DefVertCoord->PseudoThicknessTarget); /// Check results Err = 0; @@ -369,7 +368,7 @@ int main(int argc, char *argv[]) { K < DefVertCoord->MaxLayerCellH(ICell) + 1; K++) { /// target thickness should be 2 Real Expected = 2.0; - Real Diff = std::abs(LayerThicknessTargetH(ICell, K) - Expected); + Real Diff = std::abs(PseudoThicknessTargetH(ICell, K) - Expected); if (Diff > 1e-10) { Err += 1; } @@ -395,8 +394,8 @@ int main(int argc, char *argv[]) { {NCellsAll}, KOKKOS_LAMBDA(int ICell) { SurfacePressure(ICell) = 0.0; for (int K = 0; K < NVertLayers; K++) { - RefLayerThick(ICell, K) = 1.0; - LayerThickness(ICell, K) = 2.0; + RefLayerThick(ICell, K) = 1.0; + PseudoThickness(ICell, K) = 2.0; } }); @@ -407,10 +406,10 @@ int main(int argc, char *argv[]) { Kokkos::fence(); /// Call functions and get host copy of output - DefVertCoord->computePressure(LayerThickness, SurfacePressure); + DefVertCoord->computePressure(PseudoThickness, SurfacePressure); DefVertCoord->computeTargetThickness(); - auto LayerThicknessTargetH2 = - createHostMirrorCopy(DefVertCoord->LayerThicknessTarget); + auto PseudoThicknessTargetH2 = + createHostMirrorCopy(DefVertCoord->PseudoThicknessTarget); Err = 0; /// Check results @@ -425,10 +424,10 @@ int main(int argc, char *argv[]) { /// target thickness is 1 in all other layer Expected = 1.0; } - Real Diff = std::abs(LayerThicknessTargetH2(ICell, K) - Expected); + Real Diff = std::abs(PseudoThicknessTargetH2(ICell, K) - Expected); if (Diff > 1e-10) { - LOG_INFO("LayerThicknessTargetH({},{}) = {}, {}", ICell, K, - LayerThicknessTargetH2(ICell, K), Expected); + LOG_INFO("PseudoThicknessTargetH({},{}) = {}, {}", ICell, K, + PseudoThicknessTargetH2(ICell, K), Expected); Err += 1; } } diff --git a/components/omega/test/timeStepping/TimeStepperTest.cpp b/components/omega/test/timeStepping/TimeStepperTest.cpp index 53b3dc1cb96c..0486e99f7532 100644 --- a/components/omega/test/timeStepping/TimeStepperTest.cpp +++ b/components/omega/test/timeStepping/TimeStepperTest.cpp @@ -80,7 +80,7 @@ int initState() { Array2DReal LayerThickCell; Array2DReal NormalVelEdge; - State->getLayerThickness(LayerThickCell, 0); + State->getPseudoThickness(LayerThickCell, 0); State->getNormalVelocity(NormalVelEdge, 0); // Initially set thickness and velocity and tracers to 1 @@ -104,7 +104,7 @@ int createExactSolution(Real TimeEnd) { Array2DReal LayerThickCell; Array2DReal NormalVelEdge; - ExactState->getLayerThickness(LayerThickCell, 0); + ExactState->getPseudoThickness(LayerThickCell, 0); ExactState->getNormalVelocity(NormalVelEdge, 0); // There are no thickness tendencies in this test, so exact thickness ==