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
6 changes: 6 additions & 0 deletions src/vind/Fields.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "eckit/mpi/Comm.h"

#include "oops/util/ConfigFunctions.h"
#include "oops/util/ConfigHelpers.h"
#include "oops/util/FieldSetHelpers.h"
#include "oops/util/FieldSetOperations.h"
#include "oops/util/FloatCompare.h"
Expand Down Expand Up @@ -1063,6 +1064,11 @@ void Fields::write(const eckit::Configuration & config) const {
}
}

// Update member template
if (updatedConfig.has("member")) {
util::setMember(updatedConfig, updatedConfig.getInt("member"));
}

// Rename fields
for (auto & field : fset_) {
for (const auto & item : geom_.alias()) {
Expand Down
9 changes: 8 additions & 1 deletion src/vind/FieldsIO/FieldsIOBSC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,14 @@ void FieldsIOBSC::write(const eckit::Configuration & conf,
const size_t lmMax = geom.io().getUnsigned("total number of levels");

// Get write time
const util::DateTime validTime(conf.getString("date"));
util::DateTime validTime;
if (conf.has("date")) {
validTime = util::DateTime(conf.getString("date"));
} else if (conf.has("date pattern")) {
validTime = util::DateTime(conf.getString("date pattern"));
} else {
throw eckit::UserError("Missing date or date pattern", Here());
}

// Get timeseries mode
const bool singleDate = conf.getBool("single date", true);
Expand Down
1 change: 1 addition & 0 deletions test/monarch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ if ( ENABLE_SABER AND ENABLE_OBS )
create_test( monarch 3densvar_lt ${3DCORES} variational )
create_test( monarch 4densvar ${4DCORES} variational )
create_test( monarch 4densvar_lt ${4DCORES} variational )
create_test( monarch letkf_nonlinear_4d ${3DCORES} letkf )
endif()
319 changes: 319 additions & 0 deletions test/monarch/testinput/letkf_nonlinear_4d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
_variables: &vars
- ozone
- carbon_monoxide
- nitrogen_dioxide
- sulfur_dioxide
- pm10
- pm2p5
_chemVariables: &chemvars
- ozone
# - carbon_monoxide
# - nitrogen_dioxide
# - sulfur_dioxide
# - pm10
# - pm2p5
_incvariables: &incvars
- ozone
_levels:
profile: &levs [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
_scalingGas: &scalegas
scaling factor: 1.e-6
_o3_ObsErrFactor:
total coefficient: &o3_obserr_factor 0.2
_o3_BkgBheckQCFactor:
threshold: &o3_bkgcheckQC_factor 3.0
_o3_ObsErrMin:
error parameter: &o3_obserr_min 5.e-10
_o3_ObsErrCheckMax:
absolute threshold: &o3_obserr_checkmax 5.0e-6

# Mnemonics:
_memo:
- &state_ref
date: 2022-07-01T09:00:00Z
filepath: testdata/006/REDUCED_MONARCH_d01_2022063012.nc
format: bsc
state variables: *chemvars
- &member_ref
date: 2022-07-01T09:00:00Z
filepath: testdata/%mem%/REDUCED_MONARCH_d01_2022063012.nc
format: bsc
state variables: *chemvars
- &mean_ref
date: 2022-07-01T09:00:00Z
filepath: testdata/letkf_mean_prior_2022070110.nc
formats: [bsc]
state variables: *chemvars
- &out_ref
date: 2022-07-01T09:00:00Z
member pattern: %mem%
filepath: testdata/letkf_analysis_2022070110_%mem%.nc
formats: [bsc]
state variables: *chemvars
increment variables: *incvars
time window:
begin: 2022-07-01T09:00:00Z
length: PT6H
bound to include: end
geometry: &geom
iterator dimension: 3
#AP common vertical coordinate: levels
function space: StructuredColumns
grid:
type: structured
xspace:
type: linear
N : 351
start : -35.0
end : 35.0
yspace:
type: linear
N: 271
start: -27.0
end : 27.0
projection :
type: rotated_lonlat
north_pole: [190, 39]
y_numbering: -1
partitioner: checkerboard
halo: 1
levels are top down: true
levels count from: 0
groups:
- variables: *chemvars
levels: 24
vertical coordinate:
#AP name: levels
profile: *levs
alias:
- in code: ozone
in file: O3
<<: *scalegas
# - in code: carbon_monoxide
# in file: CO
# <<: *scalegas
# - in code: nitrogen_dioxide
# in file: NO2
# <<: *scalegas
# - in code: sulfur_dioxide
# in file: SO2
# <<: *scalegas
# - in code: pm10
# in file: dry_pm10_mass
# - in code: pm2p5
# in file: dry_pm2p5_mass
io:
total number of levels: 24
initial date: 2022-06-30T12:00:00Z
final date: 2022-07-02T00:00:00Z
control member:
states:
- <<: *state_ref
date: 2022-07-01T09:00:00Z
- <<: *state_ref
date: 2022-07-01T10:00:00Z
- <<: *state_ref
date: 2022-07-01T11:00:00Z
- <<: *state_ref
date: 2022-07-01T12:00:00Z
- <<: *state_ref
date: 2022-07-01T13:00:00Z
- <<: *state_ref
date: 2022-07-01T14:00:00Z
background:
members from template:
template:
states:
- <<: *member_ref
date: 2022-07-01T09:00:00Z
- <<: *member_ref
date: 2022-07-01T10:00:00Z
- <<: *member_ref
date: 2022-07-01T11:00:00Z
- <<: *member_ref
date: 2022-07-01T12:00:00Z
- <<: *member_ref
date: 2022-07-01T13:00:00Z
- <<: *member_ref
date: 2022-07-01T14:00:00Z
pattern: %mem%
zero padding: 3
start: 0
nmembers: 6
observations:
observers:
- obs space:
name: AIRBASE_O3
obsdatain:
engine:
type: H5File
obsfile: testdata/HDAT_AIRBASE_O3-2022070112.nc
obsdataout:
engine:
type: H5File
obsfile: testdata/HSTAT_4D_AIRBASE_O3-2022070112.nc
simulated variables: [ozoneSurface]
distribution:
name: Halo
halo size: 250.0e3
obs filters:
- filter: Variable Assignment
assignments:
- name: DerivedObsError/ozoneSurface
type: float
function:
name: ObsFunction/Arithmetic
options:
variables:
- name: ObsValue/ozoneSurface
absolute value: [true]
total coefficient: *o3_obserr_factor
- filter: Perform Action
filter variables:
- name: ozoneSurface
action:
name: assign error
error function:
name: ObsFunction/Arithmetic
options:
variables:
- name: DerivedObsError/ozoneSurface
where:
- variable:
name: DerivedObsError/ozoneSurface
minvalue: *o3_obserr_min
- filter: Perform Action
filter variables:
- name: ozoneSurface
action:
name: assign error
error parameter: *o3_obserr_min
where:
- variable:
name: DerivedObsError/ozoneSurface
maxvalue: *o3_obserr_min
- filter: Background Check
filter variables:
- name: ozoneSurface
threshold: *o3_bkgcheckQC_factor
absolute threshold: *o3_obserr_checkmax
obs operator:
name: VertInterp
constant vertical coordinate values: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
observation vertical coordinate: air_pressure
interpolation method: nearest-neighbor
observation alias file: testinput/ufo_variable_name_map.yaml
obs error:
covariance model: diagonal
get values:
time interpolation: nearest
obs localizations:
- localization method: Horizontal Gaspari-Cohn
lengthscale: 250e3
max nobs: 100
- localization method: Vertical localization
localization function: Gaspari Cohn
assign constant vertical coordinate to obs: true
constant vertical coordinate value: 23
vertical lengthscale: 8
driver:
use control member: false
save prior mean: true
save posterior mean: true
save posterior ensemble: false
save posterior mean increment: true
save posterior ensemble increments: false
save prior variance: true
save posterior variance: true
update obs config with geometry info: true
local ensemble DA:
solver: Deterministic LETKF
#inflation:
# rtps: 0.5
# rtpp: 0.5
# mult: 1.1
output:
states:
- <<: *out_ref
date: 2022-07-01T09:00:00Z
filepath: testdata/letkf_analysis_2022070109_%mem%.nc
- <<: *out_ref
date: 2022-07-01T10:00:00Z
filepath: testdata/letkf_analysis_2022070110_%mem%.nc
- <<: *out_ref
date: 2022-07-01T11:00:00Z
filepath: testdata/letkf_analysis_2022070111_%mem%.nc
- <<: *out_ref
date: 2022-07-01T12:00:00Z
filepath: testdata/letkf_analysis_2022070112_%mem%.nc
- <<: *out_ref
date: 2022-07-01T13:00:00Z
filepath: testdata/letkf_analysis_2022070113_%mem%.nc
- <<: *out_ref
date: 2022-07-01T14:00:00Z
filepath: testdata/letkf_analysis_2022070114_%mem%.nc
output increment:
filepath: testdata/letkf_increment__DATE_.nc
date pattern: _DATE_
formats: [bsc]
state variables: *chemvars
output ensemble increments:
member pattern: %mem%
filepath: testdata/letkf_ens_increments__DATE__%mem%.nc
date pattern: _DATE_
formats: [bsc]
# state variables: *chemvars
# states:
# - <<: *out_ref
# date: 2022-07-01T09:00:00Z
# filepath: testdata/letkf_ens_increments_2022070109_%mem%.nc
# - <<: *out_ref
# date: 2022-07-01T10:00:00Z
# filepath: testdata/letkf_ens_increments_2022070110_%mem%.nc
# - <<: *out_ref
# date: 2022-07-01T11:00:00Z
# filepath: testdata/letkf_ens_increments_2022070111_%mem%.nc
# - <<: *out_ref
# date: 2022-07-01T12:00:00Z
# filepath: testdata/letkf_ens_increments_2022070112_%mem%.nc
# - <<: *out_ref
# date: 2022-07-01T13:00:00Z
# filepath: testdata/letkf_ens_increments_2022070113_%mem%.nc
# - <<: *out_ref
# date: 2022-07-01T14:00:00Z
# filepath: testdata/letkf_ens_increments_2022070114_%mem%.nc
output mean prior:
states:
- <<: *mean_ref
date: 2022-07-01T09:00:00Z
filepath: testdata/letkf_mean_prior_2022070109.nc
- <<: *mean_ref
date: 2022-07-01T10:00:00Z
filepath: testdata/letkf_mean_prior_2022070110.nc
- <<: *mean_ref
date: 2022-07-01T11:00:00Z
filepath: testdata/letkf_mean_prior_2022070111.nc
- <<: *mean_ref
date: 2022-07-01T12:00:00Z
filepath: testdata/letkf_mean_prior_2022070112.nc
- <<: *mean_ref
date: 2022-07-01T13:00:00Z
filepath: testdata/letkf_mean_prior_2022070113.nc
- <<: *mean_ref
date: 2022-07-01T14:00:00Z
filepath: testdata/letkf_mean_prior_2022070114.nc
output variance prior:
filepath: testdata/letkf_var_prior__DATE_.nc
date pattern: _DATE_
formats: [bsc]
state variables: *chemvars
output variance posterior:
filepath: testdata/letkf_var_posterior__DATE_.nc
date pattern: _DATE_
formats: [bsc]
state variables: *chemvars
test:
reference filename: testref/letkf_nonlinear_4d.ref
test output filename: testdata/letkf_nonlinear_4d.log
float absolute tolerance: 1.e-15

Loading