[Dart-dev] DART/branches Revision: 12689

dart at ucar.edu dart at ucar.edu
Wed Jun 27 16:20:16 MDT 2018


jla at ucar.edu
2018-06-27 16:20:16 -0600 (Wed, 27 Jun 2018)
63
Backing out testing changes that allowed huge gamma ensembles.



Modified: DART/branches/gigg/assimilation_code/modules/assimilation/filter_mod.f90
===================================================================
--- DART/branches/gigg/assimilation_code/modules/assimilation/filter_mod.f90	2018-06-27 22:11:54 UTC (rev 12688)
+++ DART/branches/gigg/assimilation_code/modules/assimilation/filter_mod.f90	2018-06-27 22:20:16 UTC (rev 12689)
@@ -70,8 +70,7 @@
                                   smoother_assim,                                             &
                                   smoother_ss_diagnostics, smoother_end, set_smoother_trace
 
-use random_seq_mod,        only : random_seq_type, init_random_seq, random_gaussian,          &
-                                  random_gamma, random_inverse_gamma
+use random_seq_mod,        only : random_seq_type, init_random_seq, random_gaussian
 
 use state_vector_io_mod,   only : state_vector_io_init, read_state, write_state, &
                                   set_stage_to_write, get_stage_to_write
@@ -1199,8 +1198,7 @@
 posterior_obs_spread_index = num_obs_copies
 
 ! Make sure there are not too many copies requested
-! JLA: Had to output more than 10000 obs for Craig's analytical test
-if(num_output_obs_members > 1000000) then
+if(num_output_obs_members > 10000) then
    write(msgstring, *)'output metadata in filter needs obs ensemble size < 10000, not ',&
                       num_output_obs_members
    call error_handler(E_ERR,'filter_generate_copy_meta_data',msgstring,source,revision,revdate)
@@ -1936,35 +1934,6 @@
 real(r8)              :: random_array(ens_size) ! array of random numbers
 integer               :: local_index
 
-real(r8)              :: shape, scale
-
-call init_random_seq(r(1), 14)
-
-write(*, *) 'THIS CODE IS A TESTING HARNESS AND SHOULD NOT BE USED: PERTURB_COPIES_TASK_BITWISE in FILTER_MOD'
-
-! First test for Craig, his case 2
-if(1 == 2) then
-   do i = 1, ens_size
-        ! For Craig single variable tests want to generate an initial ensemble with gamma distribution
-        shape = 1.0_r8
-        scale = 5.31_r8 / shape
-        ens_handle%copies(i, 7) = random_gamma(r(1), shape, scale)
-   end do
-else
-! Second test for Craig, his case 3
-   do i = 1, ens_size
-        ! For Craig single variable tests want to generate an initial ensemble with gamma distribution
-        shape = 4.0_r8
-        scale = 5.31_r8 * (shape - 1.0_r8)
-        ens_handle%copies(i, 7) = random_inverse_gamma(r(1), shape, scale)
-   end do
-  
-endif
-
-
-
-if(1 == 1) return
-
 ! Need ens_size random number sequences.
 do i = 1, ens_size
    call init_random_seq(r(i), i)
@@ -1978,28 +1947,11 @@
    do j = 1, ens_size
      ! Can use %copies here because the random number
      ! is only relevant to the task than owns element i.
-     !!!random_array(j)  =  random_gaussian(r(j), ens_handle%copies(j, local_index), perturbation_amplitude)
-
-     ! For Craig single variable tests want to generate an initial ensemble with gamma distribution
-     shape = 1.0_r8
-     scale = 1.0_r8 / shape
-     scale = abs(scale)
-     random_array(j) = random_gamma(r(j), shape, scale)
-     if(random_array(j) < 0.0_r8) then
-        write(*, *) 'negative random_gamma ', j, random_array(j)
-        stop
-     endif
-
-!!!write(*, *) 'random ', j, random_array(j)
-
+     random_array(j)  =  random_gaussian(r(j), ens_handle%copies(j, local_index), perturbation_amplitude)
    enddo
 
    if (ens_handle%my_vars(local_index) == i) then
       ens_handle%copies(1:ens_size, local_index) = random_array(:)
-if(minval(ens_handle%copies(1:ens_size, local_index)) < 0.0_r8) then
-   write(*, *) 'found NEG'
-   stop
-endif
       local_index = local_index + 1 ! task is ready for the next random number
       local_index = min(local_index, ens_handle%my_num_vars)
    endif


More information about the Dart-dev mailing list