[Dart-dev] DART/branches Revision: 10954

dart at ucar.edu dart at ucar.edu
Thu Jan 26 08:33:08 MST 2017


nancy at ucar.edu
2017-01-26 08:33:07 -0700 (Thu, 26 Jan 2017)
67
commit the rest of the updated code for the
upcoming code review.




Modified: DART/branches/rma_trunk/system_simulation/gen_sampling_err_table.f90
===================================================================
--- DART/branches/rma_trunk/system_simulation/gen_sampling_err_table.f90	2017-01-26 15:27:37 UTC (rev 10953)
+++ DART/branches/rma_trunk/system_simulation/gen_sampling_err_table.f90	2017-01-26 15:33:07 UTC (rev 10954)
@@ -9,15 +9,45 @@
 !>   in Ensemble Kalman Filter Data Assimilation. 
 !> Submitted for publication, Jan 2011.  Contact author.
 
-!> this version of the program creates entries for any ensemble size
-!> from 3 to 200 and outputs the values in netcdf file format.
-!> it has no namelist - the output file is named 'sampling_error_correction_table.nc'
+!> this version is a sparse array - the ens_index array lists the ensemble
+!> sizes that have been computed, using the unlimited dimension.  to generate
+!> a new ensemble size, it can be added at the end of the existing arrays.
 
+!> the initial table has the 40 sizes that the previous release of DART
+!> came with.  to generate other ensemble sizes, run this program with
+!> the desired ensemble sizes listed in the namelist.
+!> the output file is named 'sampling_error_correction_table.nc'
+!> and if one already exists, it will be appended to instead of
+!> created from scratch.
+
+!> this takes an excessive amount of time to compute for large numbers
+!> of ensemble members.  it needs a couple changes - first, it could
+!> be made an mpi program and compute different ensemble sizes in parallel
+!> or, we could create the output only if it doesn't already exist, and
+!> have it fill in specific ensemble sizes so we could generate the final
+!> output file with multiple runs of this executable.
+!>
+!> add a namelist for min, max, or explicit ensemble size lists
+!> for an 'insert a single size into an existing array' version
+!> might need additional namelist values for min/max overall if making
+!> the file for the first time, and setting the data for the array to
+!> undefined.
+!>
+!> nothing to prevent this from doing both - making it an mpi program
+!> and also insert into an existing table.
+!>
+!> code should look at nbins (which i think it already does) so that 200
+!> is never hardcoded.  the SEC table could then have more or fewer entries
+!> for each ensemble size.
+!>
+
 program gen_sampling_err_table
 
 use types_mod,      only : r8
-use utilities_mod,  only : error_handler, E_ERR, nc_check,      &
-                           initialize_utilities, finalize_utilities
+use utilities_mod,  only : error_handler, E_ERR, nc_check, file_exist,  &
+                           initialize_utilities, finalize_utilities, &
+                           find_namelist_in_file, check_namelist_read, &
+                           do_nml_file, do_nml_term, nmlfileunit
 use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian, &          
                            twod_gaussians, random_uniform
 
@@ -33,167 +63,227 @@
 
 
 integer, parameter :: num_times   = 1
-integer, parameter :: num_samples = 100000000
+! FIXME BEFORE COMMITTING, 1 of 2:
+integer, parameter :: num_samples = 100000  ! for developement/debugging
+!integer, parameter :: num_samples = 100000000   ! real value which should be used
 
-integer, parameter :: min_ens_size = 3
-integer, parameter :: max_ens_size = 128
-
+! FIXME BEFORE COMMITTING, 2 of 2:
+!character(len=128) :: output_filename = 'sampling_error_correction_table.nc'
+! for debugging, make this short:
+character(len=128) :: output_filename = 'sec.nc'
 integer, parameter :: nentries = 200
 
-character(len=128) :: output_filename = 'sampling_error_correction_table.nc'
+integer, parameter :: MAX_LIST_LEN = 500
+integer, parameter :: UNSET = -1
 
+
 type (random_seq_type) :: ran_id
-real(r8), allocatable  :: pairs(:,:), temp(:)
 
-real(r8) :: zero_2(2) = 0.0, cov(2, 2)
-real(r8) :: t_correl, correl_mean, sample_correl, alpha(nentries), beta
-real(r8) :: s_mean(2), s_var(2), reg_mean, reg_sd, t_sd1, t_sd2, true_correl_mean(nentries)
-real(r8) :: tcorrel_sum(nentries), reg_sum(nentries), reg_2_sum(nentries)
+real(r8) :: alpha(nentries), true_correl_mean(nentries)
+integer  :: bin_count(0:nentries+1)
 
-integer  :: i, j, k, bin_num, bin_count(0:nentries+1)
-integer  :: iunit, io, ncid, ens_size
-integer  :: count_id, corrmean_id, alpha_id
+integer, allocatable :: index_array(:)
 
-character(len=512) :: errstring, msgstring
+integer  :: ncid, num_ens, esize, next_slot
+integer  :: count_id, corrmean_id, alpha_id, index_id
+integer  :: iunit, io
 
-!
+character(len=512) :: msgstring
+


More information about the Dart-dev mailing list