[Dart-dev] DART/releases Revision: 12936

dart at ucar.edu dart at ucar.edu
Mon Nov 26 15:20:04 MST 2018


nancy at ucar.edu
2018-11-26 15:20:04 -0700 (Mon, 26 Nov 2018)
114
add the updated closest member tool code; may be useful as a
basis for a parallel version of udpate_bc for mpas.




Modified: DART/releases/Manhattan/assimilation_code/programs/closest_member_tool/closest_member_tool.f90
===================================================================
--- DART/releases/Manhattan/assimilation_code/programs/closest_member_tool/closest_member_tool.f90	2018-11-26 22:12:39 UTC (rev 12935)
+++ DART/releases/Manhattan/assimilation_code/programs/closest_member_tool/closest_member_tool.f90	2018-11-26 22:20:04 UTC (rev 12936)
@@ -4,28 +4,30 @@
 !
 ! $Id$
 
-!>@todo FIXME changed so it compiles, but this IS NOT WORKING CODE YET
-!> it needs to read in an ensemble (perhaps become an mpi program)
-!> and do all ensemble members at the same time - also handle the
-!> layout when only part of a state vector is on a single task.
-!> would have to do a reduce to add up the total differences.
+!> @mainpage
+!> @{
+!> @brief  this program selects the member closest to the ensemble mean.
+!>
+!>
+!>  this program has options to compute <em> distance </em> in several different ways
+!>  and returns the ensemble member which has the smallest total distance from
+!>  the ensemble mean.
+!> @}
+!>
+!>
 
-!>@todo FIXME the html needs to be made consistent with the namelist once the namelist
-!> is fleshed out.
-
 program closest_member_tool
 
-! Program to overwrite the time on each ensemble in a restart file.
-
 use types_mod,            only : r8, i8, obstypelength, MAX_NUM_DOMS, MAX_FILES
 
-use time_manager_mod,     only : time_type, set_time_missing, operator(/=), &
-                                 print_time
+use time_manager_mod,     only : time_type, set_time_missing,               &
+                                 operator(/=), print_time
  
 use utilities_mod,        only : register_module, find_namelist_in_file,        &
                                  error_handler, nmlfileunit, E_MSG, E_ERR,      &
                                  check_namelist_read, do_nml_file, do_nml_term, &
-                                 open_file, close_file, set_multiple_filename_lists
+                                 open_file, close_file, set_multiple_filename_lists, &
+                                 get_next_filename
 
 use  location_mod,        only : location_type
 
@@ -37,7 +39,7 @@
 use assim_model_mod,      only : static_init_assim_model, get_model_size, &
                                  get_state_meta_data
 
-use state_vector_io_mod,  only : read_state, write_state
+use state_vector_io_mod,  only : read_state
 
 use io_filenames_mod,     only : file_info_type, io_filenames_init,        &
                                  set_io_copy_flag, set_file_metadata,      &
@@ -49,7 +51,7 @@
 
 use mpi_utilities_mod,    only : initialize_mpi_utilities, task_count, &
                                  finalize_mpi_utilities, my_task_id,   &
-                                 send_sum_to
+                                 send_sum_to, sum_across_tasks
 
 use ensemble_manager_mod, only : ensemble_type, init_ensemble_manager, compute_copy_mean, &
                                  get_my_vars, get_my_num_vars, end_ensemble_manager
@@ -62,7 +64,7 @@
 character(len=32 ), parameter :: revision = "$Revision$"
 character(len=128), parameter :: revdate  = "$Date$"
 
-integer               :: iunit, io, ens, i, j, qtyindex
+integer               :: iunit, io, ens, i, j, total_j, qtyindex
 integer               :: num_qtys, stype
 integer(i8)           :: ii, model_size
 integer, allocatable  :: index_list(:)
@@ -160,7 +162,7 @@
 
 num_domains = get_num_domains()
 
-! Given either a vector of in/output_state_files or a text file containing
+! Given either a vector of input_state_files or a text file containing
 ! a list of files, return a vector of files containing the filenames.
 call set_multiple_filename_lists(input_restart_files(:), &
                                  input_restart_file_list(:), &
@@ -176,10 +178,11 @@
 file_array_input  = RESHAPE(input_restart_files,  (/ens_size,  num_domains/))
 
 ! read in the ensemble and the mean - always in a separate file
-call io_filenames_init(ens_file_info, ens_size, &
-                       cycling=single_restart_file_in, &
-                       single_file=single_restart_file_in, &
-                       restart_files=file_array_input)
+call io_filenames_init(ens_file_info, &
+                       ncopies       = ens_size, &
+                       cycling       = single_restart_file_in, &
+                       single_file   = single_restart_file_in, &
+                       restart_files = file_array_input)
 
 do imem = 1, ens_size
    write(my_base,'(A,I0.2)') 'inens_',                 imem
@@ -282,8 +285,9 @@


More information about the Dart-dev mailing list