[Dart-dev] DART/branches Revision: 12443
dart at ucar.edu
dart at ucar.edu
Mon Mar 12 16:42:44 MDT 2018
nancy at ucar.edu
2018-03-12 16:42:44 -0600 (Mon, 12 Mar 2018)
223
remove the code that allows the perturb routine to
be bitwise with lanai. (it has to iterate through
the states in a bizarre order to match the old layout.)
we've agreed this code isn't needed and it's complex and
scary.
Modified: DART/branches/rma_netcdf_utils/models/POP/model_mod.f90
===================================================================
--- DART/branches/rma_netcdf_utils/models/POP/model_mod.f90 2018-03-12 22:41:15 UTC (rev 12442)
+++ DART/branches/rma_netcdf_utils/models/POP/model_mod.f90 2018-03-12 22:42:44 UTC (rev 12443)
@@ -1936,93 +1936,30 @@
! Storage for a random sequence for perturbing a single initial state
type(random_seq_type) :: random_seq
-logical :: lanai_bitwise
if ( .not. module_initialized ) call static_init_model
interf_provided = .true.
-lanai_bitwise = .true.
-if (lanai_bitwise) then
- call pert_model_copies_bitwise_lanai(state_ens_handle, ens_size)
-else
+! Initialize random number sequence
+call init_random_seq(random_seq, my_task_id())
- ! Initialize random number sequence
- call init_random_seq(random_seq, my_task_id())
+! only perturb the actual ocean cells; leave the land and
+! ocean floor values alone.
+do i=1,state_ens_handle%my_num_vars
+ dart_index = state_ens_handle%my_vars(i)
+ call get_state_kind_inc_dry(dart_index, var_type)
+ do j=1, ens_size
+ if (var_type /= QTY_DRY_LAND) then
+ state_ens_handle%copies(j,i) = random_gaussian(random_seq, &
+ state_ens_handle%copies(j,i), &
+ model_perturbation_amplitude)
- ! only perturb the actual ocean cells; leave the land and
- ! ocean floor values alone.
- do i=1,state_ens_handle%my_num_vars
- dart_index = state_ens_handle%my_vars(i)
- call get_state_kind_inc_dry(dart_index, var_type)
- do j=1, ens_size
- if (var_type /= QTY_DRY_LAND) then
- state_ens_handle%copies(j,i) = random_gaussian(random_seq, &
- state_ens_handle%copies(j,i), &
- model_perturbation_amplitude)
-
- endif
- enddo
- enddo
-
-endif
-
-
-end subroutine pert_model_copies
-
-
-!------------------------------------------------------------------
-!> Perturb the state such that the perturbation is bitwise with
-!> a perturbed Lanai.
-!> Note:
-!> * This is not bitwise with itself (like Lanai) if task_count < ens_size
-!> * This is very slow because you have a loop around the length of the
-!> state inside a loop around the ensemble.
-!> If a task has more than one copy then the random number
-!> sequence continues from the end of one copy to the start of the other.
-
-
-subroutine pert_model_copies_bitwise_lanai(ens_handle, ens_size)
-
-type(ensemble_type), intent(inout) :: ens_handle
-integer, intent(in) :: ens_size
-
-type(random_seq_type) :: r(ens_size)
-integer :: i ! loop variable
-integer(i8) :: j ! loop variable
-real(r8) :: random_number
-integer :: var_type
-integer :: sequence_to_use
-integer :: owner, owners_index
-integer :: copy_owner
-
-do i = 1, min(ens_size, task_count())
- call init_random_seq(r(i), map_pe_to_task(ens_handle,i-1)) ! my_task_id in Lanai
- sequence_to_use = i
-enddo
-
-
-do i = 1, ens_size
-
- call get_copy_owner_index(i, copy_owner, owners_index) ! owners index not used. Distribution type 1
- sequence_to_use = copy_owner + 1
- do j = 1, ens_handle%num_vars
-
- call get_state_kind_inc_dry(j, var_type)
-
- if(var_type /= QTY_DRY_LAND) then
- random_number = random_gaussian(r(sequence_to_use), 0.0_r8, model_perturbation_amplitude)
- call get_var_owner_index(j, owner, owners_index)
- if (ens_handle%my_pe==owner) then
- ens_handle%copies(i, owners_index) = ens_handle%copies(i, owners_index) + random_number
- endif
endif
More information about the Dart-dev
mailing list