[Dart-dev] DART/branches Revision: 10995
dart at ucar.edu
dart at ucar.edu
Fri Feb 3 11:31:16 MST 2017
hendric at ucar.edu
2017-02-03 11:31:16 -0700 (Fri, 03 Feb 2017)
113
write_state is expecting a copy complete vector. Need to convert to
variable complete before writting output.
Modified: DART/branches/rma_single_file/io/state_space_diag_mod.f90
===================================================================
--- DART/branches/rma_single_file/io/state_space_diag_mod.f90 2017-02-03 18:27:40 UTC (rev 10994)
+++ DART/branches/rma_single_file/io/state_space_diag_mod.f90 2017-02-03 18:31:16 UTC (rev 10995)
@@ -58,9 +58,9 @@
operator(-), operator(/), operator(*), &
operator(==), operator(/=)
use ensemble_manager_mod, only : ensemble_type, map_task_to_pe, get_copy, &
- all_copies_to_all_vars, get_allow_transpose
+ all_copies_to_all_vars, all_vars_to_all_copies, &
+ get_allow_transpose
use assim_model_mod, only : assim_model_type, get_model_size
-!#! use model_mod, only : nc_write_model_vars, nc_write_model_atts
use mpi_utilities_mod, only : my_task_id, broadcast_flag
use utilities_mod, only : error_handler, E_MSG, E_ERR, E_DBG, E_WARN, &
file_to_text, find_textfile_dims, nc_check, &
@@ -389,7 +389,6 @@
integer, dimension(NF90_MAX_VAR_DIMS) :: start_point
! check whether file_info handle is initialized
-!#! call assert_file_info_initialized(file_info, 'read_restart_direct')
if (.not. get_allow_transpose(state_ens_handle)) then
allocate(state_ens_handle%vars(state_ens_handle%num_vars, state_ens_handle%my_num_copies))
@@ -456,7 +455,6 @@
dim_lengths(ncount + 2) = 1 ! time
iend = istart + var_size - 1
- !#! print*, 'istart, iend = ' , istart , iend
do icopy = 1, num_output_ens
start_point(1:ncount) = 1
start_point(ncount + 1) = icopy ! member
@@ -538,13 +536,9 @@
type(netcdf_file_type) :: ncFileID
real(r8), allocatable :: temp_ens(:)
-!#! if (.not. module_initialized) call init_singlefile_output(ens_handle, file_info)
-
! assumes that mean and spread have already been computed
-if (.not. get_allow_transpose(ens_handle)) then
- allocate(ens_handle%vars(ens_handle%num_vars, ens_handle%my_num_copies))
-endif
-
+if(.not. allocated(ens_handle%vars)) &
+ allocate(ens_handle%vars(ens_handle%num_vars, ens_handle%my_num_copies))
call all_copies_to_all_vars(ens_handle)
model_size = get_model_size()
@@ -585,8 +579,11 @@
call set_netcdf_file_type(file_info, ncFileID)
deallocate(temp_ens)
-if (.not. get_allow_transpose(ens_handle)) deallocate(ens_handle%vars)
+call all_vars_to_all_copies(ens_handle)
+! deallocate whole state storage
+if(.not. get_allow_transpose(ens_handle)) deallocate(ens_handle%vars)
+
end subroutine write_singlefile
More information about the Dart-dev
mailing list