Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ufo/operators/sfccorrected/ObsSfcCorrected.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ObsSfcCorrected : public ObsOperatorBase,
// Other
const oops::Variables & requiredVars() const override {return varin_;}

oops::Variables simulatedVars() const override {return operatorVars_;}
oops::ObsVariables simulatedVars() const override {return operatorVars_;}

int & toFortran() {return keyOper_;}
const int & toFortran() const {return keyOper_;}
Expand All @@ -58,7 +58,7 @@ class ObsSfcCorrected : public ObsOperatorBase,
F90hop keyOper_;
const ioda::ObsSpace& odb_;
oops::Variables varin_;
oops::Variables operatorVars_;
oops::ObsVariables operatorVars_;
};

// -----------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion src/ufo/operators/sfccorrected/ObsSfcCorrected.interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ subroutine ufo_sfccorrected_setup_c(c_key_self, c_conf, c_obsvars, c_obsvarindic
c_geovars) bind(c,name='ufo_sfccorrected_setup_f90')
use fckit_configuration_module, only: fckit_configuration
use oops_variables_mod
use obs_variables_mod
implicit none
integer(c_int), intent(inout) :: c_key_self
type(c_ptr), value, intent(in) :: c_conf
Expand All @@ -50,7 +51,7 @@ subroutine ufo_sfccorrected_setup_c(c_key_self, c_conf, c_obsvars, c_obsvarindic
call ufo_sfccorrected_registry%setup(c_key_self, self)
f_conf = fckit_configuration(c_conf)

self%obsvars = oops_variables(c_obsvars)
self%obsvars = obs_variables(c_obsvars)
allocate(self%obsvarindices(self%obsvars%nvars()))
self%obsvarindices(:) = c_obsvarindices(:) + 1 ! Convert from C to Fortran indexing
self%geovars = oops_variables(c_geovars)
Expand Down
2 changes: 1 addition & 1 deletion src/ufo/operators/sfccorrected/ObsSfcCorrected.interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
// -----------------------------------------------------------------------------

void ufo_sfccorrected_setup_f90(F90hop &, const eckit::Configuration &,
const oops::Variables&operatorVars,
const oops::ObsVariables&operatorVars,
const int *operatorVarIndices, const int numOperatorVarIndices,
oops::Variables &requiredVars);
void ufo_sfccorrected_delete_f90(F90hop &);
Expand Down
53 changes: 48 additions & 5 deletions src/ufo/operators/sfccorrected/ObsSfcCorrectedParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ namespace ufo {

/// enum type for surface correction type, and ParameterTraitsHelper for it
enum class SfcCorrectionType {
UKMO, WRFDA, RRFS_GSL
UKMO, WRFDA, GSL
};
struct SfcCorrectionTypeParameterTraitsHelper {
typedef SfcCorrectionType EnumType;
static constexpr char enumTypeName[] = "SfcCorrectionType";
static constexpr util::NamedEnumerator<SfcCorrectionType> namedValues[] = {
{ SfcCorrectionType::UKMO, "UKMO" },
{ SfcCorrectionType::WRFDA, "WRFDA" },
{ SfcCorrectionType::RRFS_GSL, "RRFS_GSL" }
{ SfcCorrectionType::GSL, "GSL" }
};
};

Expand Down Expand Up @@ -64,23 +64,66 @@ class ObsSfcCorrectedParameters : public ObsOperatorParametersBase {
this};

oops::Parameter<SfcCorrectionType> correctionType{"da_sfc_scheme",
"Scheme used for surface temperature correction (UKMO or WRFDA)",
"Scheme used for surface temperature correction (UKMO, WRFDA or GSL)",
SfcCorrectionType::UKMO, this};

/// Note: "height" default value has to be consistent with var_geomz defined
/// in ufo_variables_mod.F90
oops::Parameter<std::string> geovarGeomZ{"geovar_geomz",
"Model variable for height of vertical levels",
"height", this};
"height_above_mean_sea_level", this};

/// Note: "surface_altitude" default value has to be consistent with var_sfc_geomz
/// in ufo_variables_mod.F90
oops::Parameter<std::string> geovarSfcGeomZ{"geovar_sfc_geomz",
"Model variable for surface height",
"surface_altitude", this};
"height_above_mean_sea_level_at_surface", this};

/// Note: "station_altitude" default value is "stationElevation"
oops::Parameter<std::string> ObsHeightName{"station_altitude", "stationElevation", this};

/// Note: Only relevant if \c SfcCorrectionType is set to GSL, "lapse_rate_option" default value is "Local"
oops::Parameter<std::string> LapseRateOption{"lapse_rate_option", "Lapse rate option for surface temperature correction (Constant, Local or NoAdjustment)", "Local", this};

/// Note: Only relevant if \c SfcCorrectionType is set to GSL and \c LapseRateOption is set to "Constant", "lapse_rate" default value is adiabatic lapse rate 9.8 K/km
oops::Parameter<float> LapseRateValue
{"lapse_rate",
"The lapse rate (K/km) used to adjust the observed surface temperature to "
"the model's surface level. Used if lapse rate option is set to constant, "
"otherwise ignored.",
9.8,
this};

/// Note: Only relevant if \c SfcCorrectionType is set to GSL and \c LapseRateOption is set to "Local"
oops::Parameter<int> LocalLapseRateLevel
{"local_lapse_rate_level",
"The highest model level used to calculate the local lapse rate, "
"which adjusts the observed surface temperature to the model's surface level. "
"Used if lapse rate option is set to local, otherwise ignored.",
5,
this};

/// Should the local lapse rate be restricted to a specific range
/// Note: Only relevant if \c SfcCorrectionType is set to GSL and \c LapseRateOption is set to "Local"
oops::Parameter<bool> Threshold{"threshold", true, this};

/// Note: Only relevant if \c SfcCorrectionType is set to GSL, \c LapseRateOption is set to "Local", and \c Threshold is set to true
oops::Parameter<float> MinThreshold
{"min_threshold",
"The minimum lapse rate (K/km) can be applied to adjust the "
"observed surface temperature to the model's surface level. "
"Used if lapse rate option is set to local, otherwise ignored.",
0.5,
this};

/// Note: Only relevant if \c SfcCorrectionType is set to GSL, \c LapseRateOption is set to "Local", and \c Threshold is set to true
oops::Parameter<float> MaxThreshold
{"max_threshold",
"The maximum lapse rate (K/km) can be applied to adjust the "
"observed surface temperature to the model's surface level. "
"Used if lapse rate option is set to local, otherwise ignored.",
10.0,
this};
};

// -----------------------------------------------------------------------------
Expand Down
Loading