[Dart-dev] DART/branches Revision: 10822

dart at ucar.edu dart at ucar.edu
Tue Dec 20 16:59:14 MST 2016


hendric at ucar.edu
2016-12-20 16:59:14 -0700 (Tue, 20 Dec 2016)
47
moving clamping option into the file handles.




Modified: DART/branches/rma_fixed_filenames/filter/filter_mod.f90
===================================================================
--- DART/branches/rma_fixed_filenames/filter/filter_mod.f90	2016-12-20 23:01:11 UTC (rev 10821)
+++ DART/branches/rma_fixed_filenames/filter/filter_mod.f90	2016-12-20 23:59:14 UTC (rev 10822)
@@ -67,8 +67,8 @@
 use io_filenames_mod,      only : io_filenames_init, file_info_type, file_info_dump, &
                                   combine_file_info, set_file_metadata,  &
                                   set_member_file_metadata, &
-                                  READ_COPY, WRITE_COPY, READ_WRITE_COPY, &
-                                  set_io_copy_flag, check_file_info_variable_shape
+                                  set_io_copy_flag, check_file_info_variable_shape, &
+                                  READ_COPY, WRITE_COPY, READ_WRITE_COPY
 
 use forward_operator_mod,  only : get_obs_ens_distrib_state
 use quality_control_mod,   only : initialize_qc
@@ -919,10 +919,9 @@
    file_info_all = combine_file_info( (/file_info_input, file_info_preassim, &
                                         file_info_postassim, file_info_output/) )
  
-   !>@todo need to set flag in file_info then eleminate do_clamping
-   call write_state(state_ens_handle, file_info_all, do_clamping=.true.)
+   call write_state(state_ens_handle, file_info_all)
 else
-   call write_state(state_ens_handle, file_info_output, do_clamping=.true.)
+   call write_state(state_ens_handle, file_info_output)
 endif
 
 if(ds) call smoother_write_restart(1, ens_size)
@@ -2166,7 +2165,7 @@
 !------------------------------------------------------------------
 
 subroutine set_output_file_info( file_info, num_ens, MEM_START, ENS_MEAN, ENS_SD, &
-                         PRIOR_INF_MEAN, PRIOR_INF_SD, POST_INF_MEAN, POST_INF_SD)
+                         PRIOR_INF_MEAN, PRIOR_INF_SD, POST_INF_MEAN, POST_INF_SD, do_clamping)
 type(file_info_type), intent(inout) :: file_info
 integer,              intent(in)    :: num_ens
 integer,              intent(in)    :: MEM_START
@@ -2176,15 +2175,27 @@
 integer,              intent(in)    :: PRIOR_INF_SD
 integer,              intent(in)    :: POST_INF_MEAN
 integer,              intent(in)    :: POST_INF_SD
+logical,              intent(in)    :: do_clamping
 
-if ( output_restarts )      call set_io_copy_flag(file_info, MEM_START, MEM_START+num_ens-1, WRITE_COPY)
-if ( output_mean )          call set_io_copy_flag(file_info, ENS_MEAN,       WRITE_COPY)
-if ( output_sd )            call set_io_copy_flag(file_info, ENS_SD,         WRITE_COPY, has_units=.false.)
-if ( do_prior_inflate )     call set_io_copy_flag(file_info, PRIOR_INF_MEAN, WRITE_COPY, has_units=.false.)
-if ( do_prior_inflate )     call set_io_copy_flag(file_info, PRIOR_INF_SD,   WRITE_COPY, has_units=.false.)
-if ( do_posterior_inflate ) call set_io_copy_flag(file_info, POST_INF_MEAN,  WRITE_COPY, has_units=.false.)
-if ( do_posterior_inflate ) call set_io_copy_flag(file_info, POST_INF_SD,    WRITE_COPY, has_units=.false.)
+integer :: MEM_END
 
+MEM_END = MEM_START+num_ens-1
+
+if ( output_restarts )      &
+   call set_io_copy_flag(file_info, MEM_START, MEM_END, WRITE_COPY, clamp_vars=do_clamping)
+if ( output_mean )          &
+   call set_io_copy_flag(file_info, ENS_MEAN,           WRITE_COPY, clamp_vars=do_clamping)
+if ( output_sd )            &
+   call set_io_copy_flag(file_info, ENS_SD,             WRITE_COPY, has_units=.false.)
+if ( do_prior_inflate )     &
+   call set_io_copy_flag(file_info, PRIOR_INF_MEAN,     WRITE_COPY, has_units=.false.)
+if ( do_prior_inflate )     &
+   call set_io_copy_flag(file_info, PRIOR_INF_SD,       WRITE_COPY, has_units=.false.)
+if ( do_posterior_inflate ) &
+   call set_io_copy_flag(file_info, POST_INF_MEAN,      WRITE_COPY, has_units=.false.)
+if ( do_posterior_inflate ) &
+   call set_io_copy_flag(file_info, POST_INF_SD,        WRITE_COPY, has_units=.false.)
+
 end subroutine set_output_file_info
 
 !-----------------------------------------------------------
@@ -2280,22 +2291,23 @@
                        POST_INF_COPY, POST_INF_SD_COPY)
 
 ! Set which copies should be read and written
-call set_input_file_info( file_info_input, ens_size, &
-                          ENS_MEM_START, INPUT_MEAN, INPUT_SD,      &
-                          PRIOR_INF_COPY, PRIOR_INF_SD_COPY, &
-                          POST_INF_COPY, POST_INF_SD_COPY)
+call set_input_file_info(  file_info_input, ens_size, &
+                           ENS_MEM_START, INPUT_MEAN, INPUT_SD,      &
+                           PRIOR_INF_COPY, PRIOR_INF_SD_COPY, &
+                           POST_INF_COPY, POST_INF_SD_COPY)
 call set_output_file_info( file_info_preassim, num_output_state_members, &
                            PREASSIM_MEM_START, PREASSIM_MEAN, PREASSIM_SD, &
                            PREASSIM_PRIORINF_MEAN, PREASSIM_PRIORINF_SD, &
-                           PREASSIM_POSTINF_MEAN,  PREASSIM_POSTINF_SD)
+                           PREASSIM_POSTINF_MEAN,  PREASSIM_POSTINF_SD, do_clamping=.false.)
 call set_output_file_info( file_info_postassim, num_output_state_members, &
                            POSTASSIM_MEM_START, POSTASSIM_MEAN, POSTASSIM_SD, &
                            POSTASSIM_PRIORINF_MEAN, POSTASSIM_PRIORINF_SD, &
-                           POSTASSIM_POSTINF_MEAN , POSTASSIM_POSTINF_SD)
+                           POSTASSIM_POSTINF_MEAN , POSTASSIM_POSTINF_SD, do_clamping=.false.)
 call set_output_file_info( file_info_output, ens_size, &
                            ENS_MEM_START, ENS_MEAN_COPY, ENS_SD_COPY, &
                            PRIOR_INF_COPY, PRIOR_INF_SD_COPY, &
-                           POST_INF_COPY, POST_INF_SD_COPY)
+                           POST_INF_COPY, POST_INF_SD_COPY, do_clamping=.true.)
+
 end subroutine initialize_file_information


More information about the Dart-dev mailing list