[Dart-dev] DART/branches Revision: 11501
dart at ucar.edu
dart at ucar.edu
Mon Apr 17 16:53:14 MDT 2017
hendric at ucar.edu
2017-04-17 16:53:12 -0600 (Mon, 17 Apr 2017)
36
keeping in sync with the rma trunk
Index: DART/branches/rma_output_files
===================================================================
--- DART/branches/rma_output_files 2017-04-17 17:44:41 UTC (rev 11500)
+++ DART/branches/rma_output_files 2017-04-17 22:53:12 UTC (rev 11501)
Property changes on: DART/branches/rma_output_files
___________________________________________________________________
Modified: svn:mergeinfo
## -28,6 +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:11447-11500
/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/rma_output_files/assimilation_code/modules/assimilation/assim_tools_mod.f90
===================================================================
--- DART/branches/rma_output_files/assimilation_code/modules/assimilation/assim_tools_mod.f90 2017-04-17 17:44:41 UTC (rev 11500)
+++ DART/branches/rma_output_files/assimilation_code/modules/assimilation/assim_tools_mod.f90 2017-04-17 22:53:12 UTC (rev 11501)
@@ -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, get_close_obs_destroy, &
operator(==), set_location_missing, write_location, &
LocationDims, vert_is_surface, has_vertical_localization,&
@@ -96,13 +99,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
@@ -187,7 +188,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
!============================================================================
@@ -279,6 +281,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.
@@ -1855,10 +1863,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
@@ -1868,10 +1875,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
@@ -1914,56 +1919,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)
-integer, intent(in) :: ens_size
More information about the Dart-dev
mailing list