Skip to content

Commit

Permalink
roll back changes committed to the manhattan release that were
Browse files Browse the repository at this point in the history
supposed to go on a branch.  sorry.



git-svn-id: https://svn-dares-dart.cgd.ucar.edu/DART/releases/Manhattan@12939 dfa8782c-da17-4c45-ba5c-5625b50a00d6

Former-commit-id: 3402e37975e4854e1f06b5e6eae7df12e3532c12
  • Loading branch information
nancycollins committed Nov 27, 2018
1 parent 3a175aa commit c50bc48
Show file tree
Hide file tree
Showing 43 changed files with 2,559 additions and 3,885 deletions.
621 changes: 222 additions & 399 deletions assimilation_code/location/threed_cartesian/xyz_location_mod.f90

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions assimilation_code/modules/assimilation/adaptive_inflate_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -669,45 +669,45 @@ subroutine bayes_cov_inflate(ens_size, inf_type, x_p, sigma_p_2, y_o, sigma_o_2,
call linear_bayes(dist_2, sigma_p_2, sigma_o_2, lambda_mean, lambda_sd_2, gamma_corr, &
new_cov_inflate)

! Bail out to save cost when lower bound is reached on lambda standard deviation
if(lambda_sd <= sd_lower_bound_in) then
new_cov_inflate_sd = lambda_sd
else
! Compute by forcing a Gaussian fit at one positive SD
! First compute the new_max value for normalization purposes
new_max = compute_new_density(dist_2, sigma_p_2, sigma_o_2, lambda_mean, lambda_sd, &
gamma_corr, new_cov_inflate)
! Find value at a point one OLD sd above new mean value
! Bail out to save cost when lower bound is reached on lambda standard deviation
if(lambda_sd <= sd_lower_bound_in) then
new_cov_inflate_sd = lambda_sd
else
! Compute by forcing a Gaussian fit at one positive SD
! First compute the new_max value for normalization purposes
new_max = compute_new_density(dist_2, sigma_p_2, sigma_o_2, lambda_mean, lambda_sd, &
gamma_corr, new_cov_inflate)

! Find value at a point one OLD sd above new mean value
new_1_sd = compute_new_density(dist_2, sigma_p_2, sigma_o_2, lambda_mean, lambda_sd, gamma_corr, &
new_cov_inflate + lambda_sd)

! If either the numerator or denominator of the following computation
! of 'ratio' is going to be zero (or almost so), return the original incoming
! inflation value. The computation would have resulted in either Inf or NaN.
if (abs(new_max) <= TINY(0.0_r8) .or. abs(new_1_sd) <= TINY(0.0_r8)) then
new_cov_inflate_sd = lambda_sd
return
endif

ratio = new_1_sd / new_max

! Another error for numerical issues; if ratio is larger than 0.99, bail out
if(ratio > 0.99) then
new_cov_inflate_sd = lambda_sd
return
endif

! Can now compute the standard deviation consistent with this as
! sigma = sqrt(-x^2 / (2 ln(r)) where r is ratio and x is lambda_sd (distance from mean)
new_cov_inflate_sd = sqrt( -1.0_r8 * lambda_sd_2 / (2.0_r8 * log(ratio)))

! Prevent an increase in the sd of lambda???
! For now, this is mostly countering numerical errors in this computation
if(new_cov_inflate_sd > lambda_sd) new_cov_inflate_sd = lambda_sd


! If either the numerator or denominator of the following computation
! of 'ratio' is going to be zero (or almost so), return the original incoming
! inflation value. The computation would have resulted in either Inf or NaN.
if (abs(new_max) <= TINY(0.0_r8) .or. abs(new_1_sd) <= TINY(0.0_r8)) then
new_cov_inflate_sd = lambda_sd
return
endif

ratio = new_1_sd / new_max

! Another error for numerical issues; if ratio is larger than 0.99, bail out
if(ratio > 0.99) then
new_cov_inflate_sd = lambda_sd
return
endif

! Can now compute the standard deviation consistent with this as
! sigma = sqrt(-x^2 / (2 ln(r)) where r is ratio and x is lambda_sd (distance from mean)
new_cov_inflate_sd = sqrt( -1.0_r8 * lambda_sd_2 / (2.0_r8 * log(ratio)))

! Prevent an increase in the sd of lambda???
! For now, this is mostly countering numerical errors in this computation
if(new_cov_inflate_sd > lambda_sd) new_cov_inflate_sd = lambda_sd

endif

else if (inf_type == GHA2017) then

! Transform Gaussian prior to Inverse Gamma
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@ module obs_kind_mod
QTY_FPAR = 129, &
QTY_TOTAL_WATER_STORAGE = 130

! apparently we never had a surface vapor pressure quantity?
integer, parameter, public :: &
QTY_2M_VAPOR_MIXING_RATIO = 131

! kinds for NOAH (Tim Hoar)
integer, parameter, public :: &
QTY_NEUTRON_INTENSITY = 140, &
Expand Down Expand Up @@ -721,8 +717,6 @@ subroutine initialize_module
obs_kind_names(129) = obs_kind_type(QTY_FPAR ,'QTY_FPAR')
obs_kind_names(130) = obs_kind_type(QTY_TOTAL_WATER_STORAGE ,'QTY_TOTAL_WATER_STORAGE')

obs_kind_names(131) = obs_kind_type(QTY_2M_VAPOR_MIXING_RATIO,'QTY_2M_VAPOR_MIXING_RATIO')

obs_kind_names(140) = obs_kind_type(QTY_NEUTRON_INTENSITY ,'QTY_NEUTRON_INTENSITY')
obs_kind_names(141) = obs_kind_type(QTY_CANOPY_WATER ,'QTY_CANOPY_WATER')
obs_kind_names(142) = obs_kind_type(QTY_GROUND_HEAT_FLUX ,'QTY_GROUND_HEAT_FLUX')
Expand Down
Loading

0 comments on commit c50bc48

Please sign in to comment.