[Dart-dev] DART/branches Revision: 11068

dart at ucar.edu dart at ucar.edu
Wed Feb 8 17:48:17 MST 2017


nancy at ucar.edu
2017-02-08 17:48:17 -0700 (Wed, 08 Feb 2017)
767
add a routine to the ensemble manager to allocate the vars if
they aren't already allocated.  add an option on pmo to say
whether the state should be distributed or not (big models with
only a single pass thru pmo should use .true., small models
which are cycling should use .false.)

updated places that were allocating %vars to call the single
subroutine; removed the deallocate calls because once you
make the space you might as well keep it and reuse it.

removed restart_file_tool from L84, and fixed obs_seq_tool
path_names file.  

updated test_dart to build all the tutorial low order models
and try to run workshop_setup.csh if it exists.  it creates
.nc files from any .cdl files it finds first.

brought filter_mod.dopplerfold.f90 up to date with filter.




Modified: DART/branches/rma_single_file/ensemble_manager/ensemble_manager_mod.f90
===================================================================
--- DART/branches/rma_single_file/ensemble_manager/ensemble_manager_mod.f90	2017-02-09 00:08:44 UTC (rev 11067)
+++ DART/branches/rma_single_file/ensemble_manager/ensemble_manager_mod.f90	2017-02-09 00:48:17 UTC (rev 11068)
@@ -37,12 +37,12 @@
           get_my_num_copies,          get_my_copies,            get_my_num_vars,            &
           get_my_vars,                compute_copy_mean,        compute_copy_mean_sd,       &
           get_copy,                   put_copy,                 all_vars_to_all_copies,     &
-          all_copies_to_all_vars,      &
+          all_copies_to_all_vars,     allocate_vars,            deallocate_vars,            &
           compute_copy_mean_var,      get_copy_owner_index,     set_ensemble_time,          &
           broadcast_copy,             prepare_to_write_to_vars, prepare_to_write_to_copies, &
           prepare_to_read_from_vars,  prepare_to_read_from_copies, prepare_to_update_vars,  &
-          prepare_to_update_copies,   print_ens_handle,              &
-          map_task_to_pe,             map_pe_to_task,            &
+          prepare_to_update_copies,   print_ens_handle,                                     &
+          map_task_to_pe,             map_pe_to_task,                                       &
           allocate_single_copy,       put_single_copy,          get_single_copy,            &
           deallocate_single_copy
 
@@ -1765,6 +1765,43 @@
 end function map_task_to_pe
 
 !--------------------------------------------------------------------------------
+!> if allow_transpose is ok, allocate the vars if they aren't already allocated,
+!> error out if allow_transpose is false.
+subroutine allocate_vars(ens_handle)
+
+type(ensemble_type), intent(inout) :: ens_handle
+
+!>@todo FIXME: solution 1, don't check.  solution 2, don't override
+!>@ distributed_state if ntasks = 1 in filter.
+!if (.not. get_allow_transpose(ens_handle)) then
+!   call error_handler(E_ERR, 'allocate_vars', &
+!      'cannot allocate the vars array because "allow_transpose" is false', &
+!       source, revision, revdate)
+!endif
+
+if(.not. allocated(ens_handle%vars)) &
+   allocate(ens_handle%vars(ens_handle%num_vars, ens_handle%my_num_copies))
+
+end subroutine allocate_vars
+
+!--------------------------------------------------------------------------------
+!> not clear if we want to deallocate the vars array - if we needed it once
+!> we'll probably need it again.  but for completeness, make an explicit dealloc.
+subroutine deallocate_vars(ens_handle)
+
+type(ensemble_type), intent(inout) :: ens_handle
+
+!if (.not. get_allow_transpose(ens_handle)) then
+!   call error_handler(E_ERR, 'allocate_vars', &
+!      'cannot deallocate the vars array because "allow_transpose" is false', &
+!       source, revision, revdate)
+!endif
+
+if(allocated(ens_handle%vars)) deallocate(ens_handle%vars)
+
+end subroutine deallocate_vars
+
+!--------------------------------------------------------------------------------
 !> allocate enough space to an allocatable array to hold a single copy
 !> requires the ens_handle be copy-complete.  must know copy number to
 !> know how many items are on this task.  must be a collective call.

Modified: DART/branches/rma_single_file/filter/filter_mod.dopplerfold.f90
===================================================================
--- DART/branches/rma_single_file/filter/filter_mod.dopplerfold.f90	2017-02-09 00:08:44 UTC (rev 11067)
+++ DART/branches/rma_single_file/filter/filter_mod.dopplerfold.f90	2017-02-09 00:48:17 UTC (rev 11068)
@@ -44,7 +44,7 @@
                                   prepare_to_write_to_copies, get_ensemble_time,              &
                                   map_task_to_pe,  map_pe_to_task, prepare_to_update_copies,  &
                                   copies_in_window, set_num_extra_copies, get_allow_transpose, &
-                                  all_copies_to_all_vars, allocate_single_copy,               &
+                                  all_copies_to_all_vars, allocate_single_copy, allocate_vars, &
                                   get_single_copy, put_single_copy, deallocate_single_copy
 use adaptive_inflate_mod,  only : do_varying_ss_inflate,                &
                                   do_single_ss_inflate, inflate_ens, adaptive_inflate_init,   &
@@ -164,9 +164,15 @@
 logical  :: distributed_state = .true. ! Default to do state complete forward operators.
 
 ! IO options
+! Names of files given explicitly in namelist
+integer, parameter :: MAXFILES = 200
+!>@todo FIXME - how does this work for multiple domains?  ens1d1, ens2d1, ... ens1d2 or
+!> ens1d1 ens1d2, ens1d1 ens2d2, etc   i like the latter better.
+character(len=256) ::  input_state_files(MAXFILES) = 'null'  
+character(len=256) :: output_state_files(MAXFILES) = 'null'  
 ! Name of files containing a list of {input,output} restart files, 1 file per domain
-character(len=256) :: input_restart_file_list(MAX_NUM_DOMS)  = 'null'  
-character(len=256) :: output_restart_file_list(MAX_NUM_DOMS) = 'null'
+character(len=256) ::  input_state_file_list(MAX_NUM_DOMS) = 'null'  
+character(len=256) :: output_state_file_list(MAX_NUM_DOMS) = 'null'
 ! Read in a single file and perturb this to create an ensemble
 logical            :: perturb_from_single_instance = .false.
 real(r8)           :: perturbation_amplitude       = 0.2_r8
@@ -173,11 +179,12 @@
 ! File options.  Single vs. Multiple.
 logical            :: single_file_in               = .false. ! all copies read  from 1 file
 logical            :: single_file_out              = .false. ! all copies written to 1 file
+logical            :: has_cycling                  = .false. ! filter will advance the model


More information about the Dart-dev mailing list