[Dart-dev] DART/branches Revision: 12755

dart at ucar.edu dart at ucar.edu
Tue Jul 24 15:55:47 MDT 2018


nancy at ucar.edu
2018-07-24 15:55:46 -0600 (Tue, 24 Jul 2018)
257
in the perturb routine, only perturb actual ensemble members
and avoid the mean,sd,inflation copies, etc.   

also a minor correction to the average wind computation - use
the entire wind field, not fewer and fewer values as you loop
over the wind points.




Modified: DART/branches/concentration_observations/models/simple_advection/model_mod.f90
===================================================================
--- DART/branches/concentration_observations/models/simple_advection/model_mod.f90	2018-07-24 17:05:42 UTC (rev 12754)
+++ DART/branches/concentration_observations/models/simple_advection/model_mod.f90	2018-07-24 21:55:46 UTC (rev 12755)
@@ -35,7 +35,8 @@
 
 use ensemble_manager_mod,  only : ensemble_type, get_allow_transpose, &
                                   all_vars_to_all_copies, all_copies_to_all_vars, &
-                                  init_ensemble_manager, end_ensemble_manager
+                                  init_ensemble_manager, end_ensemble_manager, &
+                                  copies_in_window
 
 use distributed_state_mod, only : get_state
 
@@ -634,7 +635,7 @@
 real(r8),  intent(in)  :: pert_amp
 logical,  intent(out) :: interf_provided
 
-integer :: i,j
+integer :: i,j,num_ens_copies
 real(r8) :: avg_wind
 
 interf_provided = .true.
@@ -644,10 +645,11 @@
         allocate(state_ens_handle%vars(state_ens_handle%num_vars, state_ens_handle%my_num_copies))
 call all_copies_to_all_vars(state_ens_handle)
 
+num_ens_copies = copies_in_window(state_ens_handle)
 do i=1,num_grid_points
 
    ! Perturb the tracer concentration
-   do j=1,state_ens_handle%my_num_copies
+   do j=1,num_ens_copies
       state_ens_handle%vars(i,j) = random_gaussian(random_seq, state_ens_handle%vars(i,j), state_ens_handle%vars(i,j))
    enddo
    where(state_ens_handle%vars(i,:) < 0.0_r8) state_ens_handle%vars(i,:) = 0.0_r8 
@@ -654,7 +656,7 @@
 
    ! Perturb the source
    ! Not perturbed for Elia's initial exploration
-   do j=1,state_ens_handle%my_num_copies
+   do j=1,num_ens_copies
       !!!state_ens_handle%vars(num_grid_points + i,j) = random_gaussian(random_seq, &
                                                      !!!state_ens_handle%vars(num_grid_points + i,j), &
                                                      !!!state_ens_handle%vars(num_grid_points + i,j))
@@ -662,10 +664,10 @@
    where(state_ens_handle%vars(num_grid_points + i,:) < 0.0_r8) state_ens_handle%vars(num_grid_points + i,:) = 0.0_r8 
 
    ! Perturb the u field
-   do j=1,state_ens_handle%my_num_copies
+   do j=1,num_ens_copies
 
       ! Find the average value of the wind field for the base
-      avg_wind = sum(state_ens_handle%vars(2*num_grid_points + i:3*num_grid_points,j)) / num_grid_points
+      avg_wind = sum(state_ens_handle%vars(2*num_grid_points:3*num_grid_points,j)) / num_grid_points
       ! Get a random draw to get 
       state_ens_handle%vars(2*num_grid_points + i,j) = random_gaussian(random_seq, 0.05_r8, avg_wind)
    enddo


More information about the Dart-dev mailing list