[Dart-dev] DART/branches Revision: 10796
dart at ucar.edu
dart at ucar.edu
Thu Dec 15 15:31:45 MST 2016
nancy at ucar.edu
2016-12-15 15:31:44 -0700 (Thu, 15 Dec 2016)
31
undebugged, but compiles now.
Modified: DART/branches/rma_fixed_filenames/integrate_model/integrate_model.f90
===================================================================
--- DART/branches/rma_fixed_filenames/integrate_model/integrate_model.f90 2016-12-15 22:20:28 UTC (rev 10795)
+++ DART/branches/rma_fixed_filenames/integrate_model/integrate_model.f90 2016-12-15 22:31:44 UTC (rev 10796)
@@ -30,9 +30,10 @@
use mpi_utilities_mod, only : initialize_mpi_utilities, finalize_mpi_utilities, &
task_count, iam_task0
-use state_vector_io_mod, only : open_restart_read, open_restart_write, close_restart, &
- awrite_state_restart, aread_state_restart
+use state_vector_io_mod, only : read_state, write_state
+use io_filenames_mod, only : file_info_type, io_filenames_init
+
use types_mod, only : i8
implicit none
@@ -48,6 +49,8 @@
integer :: iunit, rc
integer(i8) :: model_size
+type(file_info_type) :: input_file_info, output_file_info
+
! to overwrite the target time, set these to something >= 0
integer :: target_days = -1, target_seconds = -1
@@ -131,48 +134,34 @@
call init_ensemble_manager(ens_handle, num_copies=1, num_vars=model_size, transpose_type_in = 2)
call prepare_to_write_to_vars(ens_handle)
-if (iam_task0()) then
!------------------- Read restart from file ----------------------
if (trace_execution) write(*,*) 'ready to open input restart file ', trim(ic_file_name)
- iunit = open_restart_read(ic_file_name)
+ input_file_info = io_filenames_init(1, single_file=.false., root_name='input')
- if (trace_execution) write(*,*) 'opened, iunit = ', iunit
+ call read_state(ens_handle, input_file_info, .true., target_time)
- ! Read in the target time - could make a namelist item that overrides this.
- call aread_state_restart(ens_handle%time(1), ens_handle%vars(:, 1), iunit, target_time)
-
if (trace_execution) write(*,*) 'time of data, advance-to are:'
if (trace_execution) call print_time(ens_handle%time(1))
if (trace_execution) call print_time(target_time)
- call close_restart(iunit)
!----------------- Restart read in --------------------------------
! Advance this state to the target time
! If the model time is past the obs set time, just need to skip
if (trace_execution) write(*,*) 'calling advance_state if needed'
+ output_file_info = io_filenames_init(1, single_file=.false., root_name='ouput')
+
if(ens_handle%time(1) < target_time) &
- call advance_state(ens_handle, ens_size=1, target_time=target_time, &
- async=0, adv_ens_command='', tasks_per_model_advance=1)
+ call advance_state(ens_handle, 1, target_time, 0, '', 1, input_file_info, output_file_info)
! Output the restart file if requested; Force to binary for bitwise reproducing
! use in filter and perfect_model obs with shell advance options
if (trace_execution) write(*,*) 'ready to open output restart file ', trim(ud_file_name)
- iunit = open_restart_write(ud_file_name, advance_restart_format)
+ call write_state(ens_handle, output_file_info, .true.)
- if (trace_execution) write(*,*) 'opened, iunit = ', iunit
-
- call awrite_state_restart(ens_handle%time(1), ens_handle%vars(:, 1), iunit)
-
- if (trace_execution) write(*,*) 'time of data after advance:'
- if (trace_execution) call print_time(ens_handle%time(1))
-
- call close_restart(iunit)
-endif
-
if (trace_execution) write(*,*) 'end of integrate_model executable'
call finalize_mpi_utilities()
More information about the Dart-dev
mailing list