[Dart-dev] DART/branches Revision: 10923

dart at ucar.edu dart at ucar.edu
Thu Jan 19 16:12:40 MST 2017


hendric at ucar.edu
2017-01-19 16:12:40 -0700 (Thu, 19 Jan 2017)
144
single file output files working for multiple time
steps.  still need to verify and add functionality
for models that have multiple variables.




Modified: DART/branches/rma_single_file/filter/filter_mod.f90
===================================================================
--- DART/branches/rma_single_file/filter/filter_mod.f90	2017-01-19 22:09:16 UTC (rev 10922)
+++ DART/branches/rma_single_file/filter/filter_mod.f90	2017-01-19 23:12:40 UTC (rev 10923)
@@ -477,7 +477,7 @@
 call timestamp_message('Before initializing output files')
 
 ! Initialize the output sequences and state files and set their meta data
-call filter_generate_copy_meta_data(seq, prior_inflate, &
+call filter_generate_copy_meta_data(seq, prior_inflate, post_inflate, &
       in_obs_copy, output_state_mean_index, &
       output_state_spread_index, prior_obs_mean_index, posterior_obs_mean_index, &
       prior_obs_spread_index, posterior_obs_spread_index)
@@ -693,20 +693,23 @@
    if ((output_interval > 0) .and. &
        (time_step_number / output_interval * output_interval == time_step_number)) then
 
+
       if (get_stage_to_write('preassim')) then
-         if (write_all_stages_at_end) then
-            ! If needed, store copies(mean, sd, inf_mean, inf_sd) that would have
-            ! gone in Prior_Diag.nc and write them at the end.
-            call store_preassim(state_ens_handle)
-         else
-            call write_state(state_ens_handle, file_info_preassim)
-
+         if (single_file_out) then
             call filter_state_space_diagnostics(file_info_preassim, curr_ens_time, &
                   PreAssimStateUnit,  state_ens_handle, &
                   model_size, num_output_state_members, output_state_mean_index, &
                   output_state_spread_index, output_inflation, &
                   ENS_MEAN_COPY, ENS_SD_COPY, &
-                  post_inflate, POST_INF_COPY, POST_INF_SD_COPY)
+                  prior_inflate, PRIOR_INF_COPY, PRIOR_INF_SD_COPY)
+         else
+            if (write_all_stages_at_end) then
+               ! If needed, store copies(mean, sd, inf_mean, inf_sd) that would have
+               ! gone in Prior_Diag.nc and write them at the end.
+               call store_preassim(state_ens_handle)
+            else
+               call write_state(state_ens_handle, file_info_preassim)
+            endif
          endif
       endif
    endif
@@ -833,13 +836,7 @@
    if ((output_interval > 0) .and. &
        (time_step_number / output_interval * output_interval == time_step_number)) then
       if (get_stage_to_write('postassim')) then
-         if (write_all_stages_at_end) then
-            ! If needed store the copies (inf_mean, inf_sd) that would have
-            ! gone in Posterior_Diag.nc and write them at the end
-            call store_postassim(state_ens_handle)
-         else
-            call write_state(state_ens_handle, file_info_postassim)
-
+         if (single_file_out) then
             call filter_state_space_diagnostics(file_info_postassim, curr_ens_time, &
                   PostAssimStateUnit, state_ens_handle, &
                   model_size, num_output_state_members, output_state_mean_index, &
@@ -846,6 +843,14 @@
                   output_state_spread_index, output_inflation, &
                   ENS_MEAN_COPY, ENS_SD_COPY, &
                   post_inflate, POST_INF_COPY, POST_INF_SD_COPY)
+         else
+            if (write_all_stages_at_end) then
+               ! If needed store the copies (inf_mean, inf_sd) that would have
+               ! gone in Posterior_Diag.nc and write them at the end
+               call store_postassim(state_ens_handle)
+            else
+                  call write_state(state_ens_handle, file_info_postassim)
+            endif
          endif
       endif
       !> @todo What to do here?
@@ -913,6 +918,14 @@
    call end_ensemble_manager(qc_ens_handle)
 
    call trace_message('Bottom of main advance time loop')
+   if (single_file_out) then
+      call filter_state_space_diagnostics(file_info_output, curr_ens_time, &
+            OutputStateUnit, state_ens_handle, &
+            model_size, num_output_state_members, output_state_mean_index, &
+            output_state_spread_index, output_inflation, &
+            ENS_MEAN_COPY, ENS_SD_COPY, &
+            post_inflate, POST_INF_COPY, POST_INF_SD_COPY)
+   endif
 end do AdvanceTime
 
 !call test_state_copies(state_ens_handle, 'last')
@@ -930,20 +943,16 @@
 call trace_message('Before writing state restart files if requested')
 call timestamp_message('Before writing state restart files if requested')
 
-if (write_all_stages_at_end) then
-   file_info_all = combine_file_info( (/file_info_input, file_info_preassim, &
-                                        file_info_postassim, file_info_output/) )
- 
-   call write_state(state_ens_handle, file_info_all)
-else
-   call write_state(state_ens_handle, file_info_output)


More information about the Dart-dev mailing list