[Dart-dev] [8957] DART/trunk/models/bgrid_solo/model_mod.f90: fix the bgrid perturb routine.

nancy at ucar.edu nancy at ucar.edu
Fri Oct 30 16:35:10 MDT 2015


Revision: 8957
Author:   nancy
Date:     2015-10-30 16:35:10 -0600 (Fri, 30 Oct 2015)
Log Message:
-----------
fix the bgrid perturb routine.  the default code was returning
'true' meaning yes, i already perturbed the state, but it wasn't
doing any perturbing.  now it says 'false' and returns, which is
correct.  if you do want the perturb routine to only perturb the
temperature, edit the code to comment out the early return and
it will perturb only the T field.

Modified Paths:
--------------
    DART/trunk/models/bgrid_solo/model_mod.f90

-------------- next part --------------
Modified: DART/trunk/models/bgrid_solo/model_mod.f90
===================================================================
--- DART/trunk/models/bgrid_solo/model_mod.f90	2015-10-30 22:17:56 UTC (rev 8956)
+++ DART/trunk/models/bgrid_solo/model_mod.f90	2015-10-30 22:35:10 UTC (rev 8957)
@@ -2059,14 +2059,19 @@
 logical, save :: first_call = .true.
 integer :: i, j, k
 
+! change the amount of perturbation here and recompile
+real(r8), parameter :: pert_stddev = 0.01_r8
+
 if ( .not. module_initialized ) call static_init_model
 
 ! option 1: let filter do the perturbs
 ! (comment this out to select other options below)
-interf_provided = .true.
+interf_provided = .false.
 return
  
 ! (debug) option 2: tell filter we are going to perturb, but don't.
+!  generally you do NOT want to do this - your ensemble will have
+!  no spread.
 ! interf_provided = .true.
 ! pert_state = state
 ! return
@@ -2082,11 +2087,10 @@
 
 call vector_to_prog_var(state, get_model_size(), global_Var)
 
-do k = 1, size(global_Var%t, 3)
-   do j = 1, size(global_Var%t, 2)
-      do i = 1, size(global_Var%t, 1)
-         global_Var%t(i, j, k) = global_Var%t(i, j, k) + &
-             random_gaussian(randtype, 0.0_r8, 0.01_r8)
+do k = lbound(global_Var%t, 3), ubound(global_Var%t, 3)
+   do j = lbound(global_Var%t, 2), ubound(global_Var%t, 2)
+      do i = lbound(global_Var%t, 1), ubound(global_Var%t, 1)
+         global_Var%t(i, j, k) = random_gaussian(randtype, global_Var%t(i,j,k), pert_stddev)
       end do
    end do
 end do


More information about the Dart-dev mailing list