Skip to content

Commit

Permalink
Misc updates (#65)
Browse files Browse the repository at this point in the history
* convert corr length from gaussian to GC

* add "default" var change

* update reference answers
  • Loading branch information
travissluka authored Mar 20, 2021
1 parent e71cd3b commit 37f9c7c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/umdsst/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ add_subdirectory(Increment)
add_subdirectory(LinearVariableChange)
add_subdirectory(ModelAux)
add_subdirectory(State)
add_subdirectory(VariableChange)
3 changes: 3 additions & 0 deletions src/umdsst/Covariance/Covariance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ namespace umdsst {
conf.get("correlation lengths", corrConf);
if ( corrConf.has("fixed") ) {
// single global value for correlation length given
// note: BUMP expects the length as a Gaspari-Cohn cutoff length,
// but we probably think of it as a Gaussian 1 sigma, so convert.
double val;
corrConf.get("fixed", val);
val*=3.57; // gaussian to GC
param_view.assign(val);
} else {
util::abor1_cpp("Covariance::Covariance() no correlation length "
Expand Down
3 changes: 3 additions & 0 deletions src/umdsst/VariableChange/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
umdsst_target_sources(
VariableChange.cc
)
17 changes: 17 additions & 0 deletions src/umdsst/VariableChange/VariableChange.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* (C) Copyright 2021-2021 UCAR, University of Maryland
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*/

#include "oops/base/VariableChangeBase.h"
#include "oops/generic/IdVariableChange.h"
#include "umdsst/Traits.h"

namespace umdsst {

static oops::GenericVariableChangeMaker<Traits,
oops::IdVariableChange<Traits> > makerVariableChange_("default");

} // namespace umdsst
2 changes: 1 addition & 1 deletion test/testinput/staticbinit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ background error:
mpicom: 2
strategy: specific_univariate
correlation lengths:
fixed: 3.0e6
fixed: 840.0e3
2 changes: 1 addition & 1 deletion test/testref/dirac.ref
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Test : Input Dirac increment: min = 0, max = 1, mean = 0.000138889
Test : B * Increment: min = 0, max = 1, mean = 0.0698168
Test : B * Increment: min = -0, max = 1, mean = 0.0697115
12 changes: 6 additions & 6 deletions test/testref/var.ref
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Test : CostJb : Nonlinear Jb = 0
Test : CostJo : Nonlinear Jo(sea_surface_temperature) = 8450.12, nobs = 127, Jo/n = 66.5364, err = 0.369977
Test : CostFunction: Nonlinear J = 8450.12
Test : DRIPCGMinimizer: reduction in residual norm = 0.0443003
Test : CostFunction::addIncrement: Analysis: min = -1.82546, max = 31.8058, mean = 13.4629
Test : CostFunction: Nonlinear J = 8450.12
Test : DRIPCGMinimizer: reduction in residual norm = 0.0429602
Test : CostFunction::addIncrement: Analysis: min = -5.77236, max = 31.8058, mean = 13.4612
Test : umdsst::ModelAuxControl not implemented
Test : CostJb : Nonlinear Jb = 490.143
Test : CostJo : Nonlinear Jo(sea_surface_temperature) = 193.425, nobs = 127, Jo/n = 1.52303, err = 0.369977
Test : CostFunction: Nonlinear J = 683.568
Test : CostJb : Nonlinear Jb = 489.763
Test : CostJo : Nonlinear Jo(sea_surface_temperature) = 191.27, nobs = 127, Jo/n = 1.50606, err = 0.369977
Test : CostFunction: Nonlinear J = 681.033

0 comments on commit 37f9c7c

Please sign in to comment.