[Dart-dev] DART/branches Revision: 10811

dart at ucar.edu dart at ucar.edu
Fri Dec 16 15:04:57 MST 2016


nancy at ucar.edu
2016-12-16 15:04:57 -0700 (Fri, 16 Dec 2016)
54
updated to compile - BUT DOES NOT RUN CORRECTLY yet.




Modified: DART/branches/rma_fixed_filenames/utilities/closest_member_tool.f90
===================================================================
--- DART/branches/rma_fixed_filenames/utilities/closest_member_tool.f90	2016-12-16 21:53:56 UTC (rev 10810)
+++ DART/branches/rma_fixed_filenames/utilities/closest_member_tool.f90	2016-12-16 22:04:57 UTC (rev 10811)
@@ -4,11 +4,18 @@
 !
 ! $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.
+
 program closest_member_tool
 
 ! Program to overwrite the time on each ensemble in a restart file.
 
-use types_mod,         only : r8, i8, obstypelength
+use types_mod,         only : r8, i8, obstypelength, MAX_NUM_DOMS
+
 use time_manager_mod,  only : time_type, set_time_missing,               &
                               operator(/=), print_time
  
@@ -27,8 +34,10 @@
 use assim_model_mod,   only : static_init_assim_model, get_model_size,   &
                               get_state_meta_data
 
-use state_vector_io_mod, only : aread_state_restart, open_restart_read, close_restart
+use state_vector_io_mod, only : read_state, write_state
 
+use io_filenames_mod,    only : file_info_type, io_filenames_init
+
 use mpi_utilities_mod, only : initialize_mpi_utilities, task_count,     &
                               finalize_mpi_utilities
 
@@ -53,7 +62,9 @@
 integer               :: num_kinds, stype
 type(time_type)       :: mean_time, member_time, mean_advance_time, advance_time
 integer, parameter    :: max_list_len = 500
+type(file_info_type)  :: ens_file_info, mean_file_info
 
+
 character(len=64)     :: method_name(4) = (/     &
    "Simple Difference    ", &
    "Normalized Difference", &
@@ -63,12 +74,13 @@
 !----------------------------------------------------------------
 ! These variables are namelist-controllable.
 !
-character(len = 128) :: input_file_name        = "filter_restart"
-character(len = 128) :: output_file_name       = "closest_restart"
 integer              :: ens_size               = 1
-logical              :: single_restart_file_in = .true.
 integer              :: difference_method      = 4
+logical              :: single_restart_file_in = .false.
 character(len = obstypelength) :: use_only_kinds(max_list_len) = ''
+character(len=256) :: input_restart_file_list(MAX_NUM_DOMS)  = 'null'
+character(len=256) :: mean_restart_file_list(MAX_NUM_DOMS)  = 'null'
+character(len=256) :: output_file_name
 
 !----------------------------------------------------------------
 ! different methods to compute 'distance' from mean:
@@ -81,7 +93,8 @@
 !----------------------------------------------------------------
 
 namelist /closest_member_tool_nml/  &
-   input_file_name,              &
+   input_restart_file_list,      &
+   mean_restart_file_list,       &
    output_file_name,             &
    ens_size,                     &
    single_restart_file_in,       &
@@ -89,14 +102,8 @@
    use_only_kinds         
 
 
-logical :: input_is_model_advance_file  = .false.
-! FIXME: could add this to namelist:
-!      input_is_model_advance_file 
-! right now we don't output model_advance means, so for now
-! it stays out.  but if you did have the mean, you could
-! use this tool on it.
+type(ensemble_type) :: ens_handle, mean_ens_handle
 
-type(ensemble_type) :: ens_handle ! dummy so you can call get_state_meta_data
 !> @todo seems like you are using get_state_meta_data just so you can get the kinds.
 !> WRF and MPAS will be doing the vertical conversion also.
 
@@ -135,6 +142,9 @@
 call error_handler(E_MSG,'',msgstring)
 
 ! make space for the mean and a single member, plus place to sort list for output
+call init_ensemble_manager(ens_handle, ens_size, model_size)
+call init_ensemble_manager(mean_ens_handle, 1, model_size)
+
 allocate(mean(model_size), member(model_size))
 allocate(index_list(ens_size), diffs(ens_size))
 
@@ -186,16 +196,13 @@
 mean_advance_time = set_time_missing()


More information about the Dart-dev mailing list