[Dart-dev] [5678] DART/branches/development/models/simple_advection/model_mod.f90: move where the random number generator is initialized up to the
nancy at ucar.edu
nancy at ucar.edu
Mon Apr 9 15:02:26 MDT 2012
Revision: 5678
Author: nancy
Date: 2012-04-09 15:02:26 -0600 (Mon, 09 Apr 2012)
Log Message:
-----------
move where the random number generator is initialized up to the
static init routine so it's guaranteed to be before the first use.
turns out the model advance routine (adv_1step) also uses some
random number calls and that is called before the pert routine (where
it used be initialized) if you are running perfect model.
Modified Paths:
--------------
DART/branches/development/models/simple_advection/model_mod.f90
-------------- next part --------------
Modified: DART/branches/development/models/simple_advection/model_mod.f90
===================================================================
--- DART/branches/development/models/simple_advection/model_mod.f90 2012-04-09 20:39:57 UTC (rev 5677)
+++ DART/branches/development/models/simple_advection/model_mod.f90 2012-04-09 21:02:26 UTC (rev 5678)
@@ -185,6 +185,13 @@
! Compute the width of the domain in meters
domain_width_meters = num_grid_points * grid_spacing_meters
+! For any routines that want to use the random number
+! generator later on, initialize it.
+if(.not. random_seq_init) then
+ call init_random_seq(random_seq, 1)
+ random_seq_init = .true.
+endif
+
end subroutine static_init_model
@@ -989,11 +996,6 @@
interf_provided = .true.
write(*, *) 'in pert_model_state'
-! Initialize my random number sequence
-if(.not. random_seq_init) then
- call init_random_seq(random_seq, 1)
- random_seq_init = .true.
-endif
! Need to make sure perturbed states are not centered on true value
! This model is too forgiving in such circumstances
More information about the Dart-dev
mailing list