-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f77760
commit 8d8350d
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#pragma once | ||
|
||
#include <algorithm> | ||
#include <iostream> | ||
#include <numeric> | ||
#include <string> | ||
#include <vector> | ||
|
||
#include "eckit/config/LocalConfiguration.h" | ||
|
||
#include "oops/base/FieldSet3D.h" | ||
#include "oops/base/GeometryData.h" | ||
#include "oops/base/StateEnsemble.h" | ||
#include "oops/mpi/mpi.h" | ||
#include "oops/runs/Application.h" | ||
#include "oops/util/DateTime.h" | ||
#include "oops/util/Duration.h" | ||
#include "oops/util/FieldSetHelpers.h" | ||
#include "oops/util/FieldSetOperations.h" | ||
#include "oops/util/Logger.h" | ||
|
||
#include "fv3jedi/Geometry/Geometry.h" | ||
#include "fv3jedi/Increment/Increment.h" | ||
#include "fv3jedi/State/State.h" | ||
|
||
|
||
namespace gdasapp { | ||
/** | ||
* FV3SnowEnsRecenter Class Implementation | ||
* | ||
* Generates an analysis increment for the ensemble forecast of snow | ||
* based off of the difference between the forecast ensemble mean and the | ||
* deterministic snow forecast plus the analysis increment. | ||
*/ | ||
|
||
class FV3SnowEnsRecenter : public oops::Application { | ||
public: | ||
explicit FV3SnowEnsRecenter(const eckit::mpi::Comm & comm = oops::mpi::world()) | ||
: Application(comm) {} | ||
static const std::string classname() {return "gdasapp::FV3SnowEnsRecenter";} | ||
|
||
int execute(const eckit::Configuration & fullConfig, bool /*validate*/) const { | ||
/// Setup the FV3 geometry, we are going to assume that things are on the same grid | ||
/// as we do not fully trust OOPS interpolation for land compared to other tools | ||
const eckit::LocalConfiguration geomConfig(fullConfig, "geometry"); | ||
const fv3jedi::Geometry geom(geomConfig, this->getComm()); | ||
|
||
/// Get the valid time | ||
std::string strdt; | ||
fullConfig.get("date", strdt); | ||
util::DateTime cycleDate = util::DateTime(strdt); | ||
|
||
/// Get the list of variables to read from the background | ||
oops::Variables varList(fullConfig, "variables.name"); | ||
|
||
/// Read the determinstic background | ||
fv3jedi::State detbkg(geom, varList, cycleDate); | ||
const eckit::LocalConfiguration bkgConfig(fullConfig, "deterministic background"); | ||
detbkg.read(bkgConfig); | ||
oops::Log::info() << "Determinstic background: " << std::endl << detbkg << std::endl; | ||
|
||
/// Read the ensemble and get the mean | ||
const eckit::LocalConfiguration ensBkgConfig(fullConfig, "ensemble background"); | ||
oops::StateEnsemble<fv3jedi::Traits> ensState(geom, ensBkgConfig); | ||
|
||
oops::Log::info() << "Ensemble mean background: " << std::endl << ensmean << std::endl; | ||
} |