diff --git a/assimilation_code/modules/assimilation/probit_transform_mod.f90 b/assimilation_code/modules/assimilation/probit_transform_mod.f90 index 984ca8bf2..2b66b84fe 100644 --- a/assimilation_code/modules/assimilation/probit_transform_mod.f90 +++ b/assimilation_code/modules/assimilation/probit_transform_mod.f90 @@ -91,7 +91,12 @@ subroutine transform_all_to_probit(ens_size, num_vars, state_ens, distribution_t do i = 1, num_vars call transform_to_probit(ens_size, state_ens(1:ens_size, i), distribution_type(i), & p(i), temp_ens, use_input_p, bounded_below, bounded_above, lower_bound, upper_bound, ierr(i)) - if(ierr(i) == 0) probit_ens(1:ens_size, i) = temp_ens + if(ierr(i) == 0) + probit_ens(1:ens_size, i) = temp_ens + else + ! If transform failed, return the input state + probit_ens(1:ens_size, i) = state_ens(1:ens_size, i) + endif end do end subroutine transform_all_to_probit @@ -366,7 +371,7 @@ subroutine to_probit_bounded_normal_rh(ens_size, state_ens, p, probit_ens, & ierr = 0 if(use_input_p) then - ! Need tthis to fail if p isn't available. Is that possible? + ! Need this to fail if p isn't available. Is that possible? ! Get the quantiles for each of the ensemble members in a BNRH distribution call bnrh_cdf_initialized_vector(state_ens, ens_size, p, quantile) else