[Dart-dev] DART/branches Revision: 10828
dart at ucar.edu
dart at ucar.edu
Wed Dec 21 15:31:56 MST 2016
hendric at ucar.edu
2016-12-21 15:31:55 -0700 (Wed, 21 Dec 2016)
127
updating integrate model to work with new io structure.
expecting incoming file as temp_ic.nc and outgoing file
as temp_ud.nc
Modified: DART/branches/rma_fixed_filenames/integrate_model/integrate_model.f90
===================================================================
--- DART/branches/rma_fixed_filenames/integrate_model/integrate_model.f90 2016-12-21 21:52:43 UTC (rev 10827)
+++ DART/branches/rma_fixed_filenames/integrate_model/integrate_model.f90 2016-12-21 22:31:55 UTC (rev 10828)
@@ -32,7 +32,9 @@
use state_vector_io_mod, only : read_state, write_state
-use io_filenames_mod, only : file_info_type, io_filenames_init
+use io_filenames_mod, only : file_info_type, io_filenames_init, set_io_copy_flag, &
+ set_file_metadata, READ_COPY, WRITE_COPY, &
+ get_restart_filename
use types_mod, only : i8
@@ -73,11 +75,6 @@
logical :: trace_execution = .false.
character(len=128) :: errstring
-! for speed, accuracy - write model_advance files in binary
-! both ways. for debugging make this 'formatted' instead
-! of 'unformatted' and you can see what's in the ud file.
-character(len = 32) :: advance_restart_format = 'unformatted'
-
! Input and output filenames are hardcoded at this point.
character(len = 132) :: ic_file_name = "temp_ic", ud_file_name = "temp_ud"
@@ -86,7 +83,7 @@
! only read in if use_namelist is .true. -- ignored otherwise.
namelist /integrate_model_nml/ &
- ic_file_name, ud_file_name, advance_restart_format, &
+ ic_file_name, ud_file_name, &
trace_execution, is_model_advance_file, target_days, target_seconds
@@ -135,10 +132,13 @@
call prepare_to_write_to_vars(ens_handle)
!------------------- Read restart from file ----------------------
+
+ input_file_info = io_filenames_init(1, single_file=.false.)
+ call set_file_metadata(input_file_info, 1, 'temp', 'ic', 'initial condition')
+ call set_io_copy_flag( input_file_info, 1, READ_COPY)
+
+ ic_file_name = get_restart_filename(input_file_info%stage_metadata,1,1)
if (trace_execution) write(*,*) 'ready to open input restart file ', trim(ic_file_name)
-
- input_file_info = io_filenames_init(1, single_file=.false., root_name='input')
-
call read_state(ens_handle, input_file_info, .true., target_time)
if (trace_execution) write(*,*) 'time of data, advance-to are:'
@@ -151,16 +151,19 @@
! 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')
+ output_file_info = io_filenames_init(1, single_file=.false.)
+ call set_file_metadata(output_file_info, 1, 'temp', 'ud', 'advanced member')
+ call set_io_copy_flag( output_file_info, 1, WRITE_COPY)
if(ens_handle%time(1) < target_time) &
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
+ ud_file_name = get_restart_filename(output_file_info%stage_metadata,1,1)
if (trace_execution) write(*,*) 'ready to open output restart file ', trim(ud_file_name)
- call write_state(ens_handle, output_file_info, .true.)
+ call write_state(ens_handle, output_file_info)
if (trace_execution) write(*,*) 'end of integrate_model executable'
call finalize_mpi_utilities()
More information about the Dart-dev
mailing list