[Dart-dev] DART/branches Revision: 12228
dart at ucar.edu
dart at ucar.edu
Wed Dec 20 09:24:25 MST 2017
nancy at ucar.edu
2017-12-20 09:24:24 -0700 (Wed, 20 Dec 2017)
249
moha's inflation is an option on the existing variable
state space option; assim tools keys off this in a lot
of places. go back and make this internally a subtype of
type 2, and only look at the subtype when you're going
into bayes_cov_inflate().
Modified: DART/branches/enhanced_inflation/assimilation_code/modules/assimilation/adaptive_inflate_mod.f90
===================================================================
--- DART/branches/enhanced_inflation/assimilation_code/modules/assimilation/adaptive_inflate_mod.f90 2017-12-19 23:37:29 UTC (rev 12227)
+++ DART/branches/enhanced_inflation/assimilation_code/modules/assimilation/adaptive_inflate_mod.f90 2017-12-20 16:24:24 UTC (rev 12228)
@@ -26,7 +26,7 @@
implicit none
private
-public :: update_inflation, do_enhanced_ss_inflate, do_obs_inflate, &
+public :: update_inflation, do_obs_inflate, &
do_varying_ss_inflate, do_single_ss_inflate, inflate_ens, &
adaptive_inflate_init, adaptive_inflate_type, &
deterministic_inflate, solve_quadratic, &
@@ -56,8 +56,9 @@
private
! Flavor can be 0:none, 1:obs_inflate, 2:varying_ss_inflate, 3:single_ss_inflate
! Deprecating 1:obs_inflate, there is concerns how the observation space inflation
- ! is happening. JPH., 4 = RTPS, 5 = enhanced ss
+ ! is happening. JPH., 4 = RTPS, 5 = enhanced ss, modification of 2
integer :: inflation_flavor
+ integer :: inflation_sub_flavor
logical :: output_restart = .false.
logical :: deterministic
real(r8) :: inflate, sd, sd_lower_bound, inf_lower_bound, inf_upper_bound
@@ -176,7 +177,6 @@
if (do_single_ss_inflate(inflation) .or. &
do_varying_ss_inflate(inflation) .or. &
- do_enhanced_ss_inflate(inflation) .or. &
do_rtps_inflate(inflation)) then
do_ss_inflate = .true.
else
@@ -222,6 +222,7 @@
! Load up the structure first to keep track of all details of this inflation type
inflate_handle%inflation_flavor = inf_flavor
+inflate_handle%inflation_sub_flavor = inf_flavor ! see code below
inflate_handle%output_restart = output_inflation
inflate_handle%deterministic = deterministic
inflate_handle%inflate = inf_initial
@@ -237,6 +238,11 @@
if (trim(label)=='Prior') inflate_handle%prior = .true.
if (trim(label)=='Posterior') inflate_handle%posterior = .true.
+! inf type 5 is a subset of type 2. modify the type here.
+if (inf_flavor == 5) then
+ inflate_handle%inflation_flavor = 2
+endif
+
! Cannot support non-determistic inflation and an inf_lower_bound < 1
if(.not. deterministic .and. inf_lower_bound < 1.0_r8) then
write(msgstring, *) 'Cannot have non-deterministic inflation and inf_lower_bound < 1'
@@ -321,7 +327,9 @@
end function do_rtps_inflate
!------------------------------------------------------------------
-!> Returns true if this inflation type indicates enhanced state space inflation
+!> *private* accessor routine for the subtype
+!>
+!> Returns true if this inflation sub type indicates enhanced state space inflation
!> Moha Gharamti, 2017
function do_enhanced_ss_inflate(inflate_handle)
@@ -329,7 +337,8 @@
logical :: do_enhanced_ss_inflate
type(adaptive_inflate_type), intent(in) :: inflate_handle
-do_enhanced_ss_inflate = (inflate_handle%inflation_flavor == 5)
+do_enhanced_ss_inflate = ((inflate_handle%inflation_flavor == 2) .and. &
+ (inflate_handle%inflation_sub_flavor == 5))
end function do_enhanced_ss_inflate
@@ -448,9 +457,8 @@
integer :: i, ens_size
real(r8) :: rand_sd, var, sd_inflate
-! it's possible to have MISSING_R8s in the state
-! vector now. so we need to be able to avoid changing
-! MISSING_R8 values by inflation here.
+! it's possible to have MISSING_R8s in the state vector now.
+! so we need to be able to avoid changing MISSING_R8 values by inflation here.
if (inflate_handle%allow_missing_in_clm) then
if (any(ens == MISSING_R8)) return
endif
@@ -582,7 +590,6 @@
real(r8) :: b, c, d, Q, R, disc, alpha, beta, cube_root_alpha, cube_root_beta, x
real(r8) :: rrr, cube_root_rrr, angle, mx(3), sep(3), mlambda(3)
-
! If gamma is 0, nothing happens
if(gamma_corr <= 0.0_r8) then
new_cov_inflate = lambda_mean
@@ -650,6 +657,7 @@
! Put in code to approximate the mode (new_cov_inflate)
!write(*, *) 'old, orig mode is ', lambda_mean, new_cov_inflate
+ endif
else if (inf_type == AND2009) then
More information about the Dart-dev
mailing list