[Dart-dev] DART/branches Revision: 11493
dart at ucar.edu
dart at ucar.edu
Fri Apr 14 10:46:59 MDT 2017
nancy at ucar.edu
2017-04-14 10:46:59 -0600 (Fri, 14 Apr 2017)
36
merge in latest rma_trunk changes.
Index: DART/branches/model_mod_changes
===================================================================
--- DART/branches/model_mod_changes 2017-04-14 16:46:34 UTC (rev 11492)
+++ DART/branches/model_mod_changes 2017-04-14 16:46:59 UTC (rev 11493)
Property changes on: DART/branches/model_mod_changes
___________________________________________________________________
Modified: svn:mergeinfo
## -28,7 +28,7 ##
/DART/branches/rma_sprint:8101-8172
/DART/branches/rma_state_structure_test_dir:9478-9682
/DART/branches/rma_state_structure_unit_test:9697-10274
-/DART/branches/rma_trunk:11409-11456
+/DART/branches/rma_trunk:11409-11491
/DART/branches/rma_trunk_clamping:8792-8807
/DART/branches/rma_trunk_filename:8017-8163
/DART/branches/rma_trunk_get_state_fun:8574-8602
Modified: DART/branches/model_mod_changes/assimilation_code/modules/assimilation/assim_tools_mod.f90
===================================================================
--- DART/branches/model_mod_changes/assimilation_code/modules/assimilation/assim_tools_mod.f90 2017-04-14 16:46:34 UTC (rev 11492)
+++ DART/branches/model_mod_changes/assimilation_code/modules/assimilation/assim_tools_mod.f90 2017-04-14 16:46:59 UTC (rev 11493)
@@ -35,6 +35,9 @@
use obs_impact_mod, only : allocate_impact_table, read_impact_table, free_impact_table
+use sampling_error_correction_mod, only : get_sampling_error_table_size, &
+ read_sampling_error_correction
+
use location_mod, only : location_type, get_close_type, query_location, &
operator(==), set_location_missing, write_location, &
LocationDims, is_vertical, vertical_localization_on, &
@@ -94,13 +97,11 @@
character(len = 255) :: msgstring, msgstring2, msgstring3
! Need to read in table for off-line based sampling correction and store it
-logical :: first_get_correction = .true.
-real(r8) :: exp_true_correl(200), alpha(200)
+integer :: sec_table_size
+real(r8), allocatable :: exp_true_correl(:), alpha(:)
! if adjust_obs_impact is true, read in triplets from the ascii file
-! and fill this 2d impact table. it should be allocated for both
-! kinds and types, 0-N for kinds, 1-N for types, with a type offset
-! computed somehow.
+! and fill this 2d impact table.
real(r8), allocatable :: obs_impact_table(:,:)
! version controlled file description for error handling, do not edit
@@ -185,7 +186,8 @@
output_localization_diagnostics, localization_diagnostics_file, &
special_localization_obs_types, special_localization_cutoffs, &
allow_missing_in_clm, distribute_mean, close_obs_caching, &
- allow_any_impact_values, lanai_bitwise
+ adjust_obs_impact, obs_impact_filename, &
+ allow_any_impact_values, lanai_bitwise ! don't document these last two for now
!============================================================================
@@ -277,6 +279,12 @@
close_obs_caching = .false.
endif
+if(sampling_error_correction) then
+ sec_table_size = get_sampling_error_table_size()
+ allocate(exp_true_correl(sec_table_size), alpha(sec_table_size))
+ ! we can't read the table here because we don't have access to the ens_size
+endif
+
! log what the user has selected via the namelist choices
! E_MSG only prints from PE0 by default, but go ahead and only
! construct the messages on PE0 as well.
@@ -1877,10 +1885,9 @@
if(present(correl_out)) correl_out = correl
-! BEGIN TEST OF CORRECTION FROM FILE +++++++++++++++++++++++++++++++++++++++++++++++++
! Get the expected actual correlation and the regression weight reduction factor
if(sampling_error_correction) then
- call get_correction_from_file(ens_size, correl, mean_factor, exp_true_correl)
+ call get_correction_from_table(correl, mean_factor, exp_true_correl, ens_size)
! Watch out for division by zero; if correl is really small regression is safely 0
if(abs(correl) > 0.001_r8) then
reg_coef = reg_coef * (exp_true_correl / correl) * mean_factor
@@ -1890,10 +1897,8 @@
correl = exp_true_correl
endif
-! END TEST OF CORRECTION FROM FILE +++++++++++++++++++++++++++++++++++++++++++++++++
-
! Then compute the increment as product of reg_coef and observation space increment
state_inc = reg_coef * obs_inc
@@ -1936,56 +1941,23 @@
!------------------------------------------------------------------------
-subroutine get_correction_from_file(ens_size, scorrel, mean_factor, expected_true_correl)
+subroutine get_correction_from_table(scorrel, mean_factor, expected_true_correl, ens_size)
More information about the Dart-dev
mailing list