[Dart-dev] DART/branches Revision: 11044
dart at ucar.edu
dart at ucar.edu
Wed Feb 8 14:26:30 MST 2017
nancy at ucar.edu
2017-02-08 14:26:30 -0700 (Wed, 08 Feb 2017)
59
changed the code to use the new agreed-on namelist names.
Modified: DART/branches/rma_single_file/perfect_model_obs/perfect_model_obs.f90
===================================================================
--- DART/branches/rma_single_file/perfect_model_obs/perfect_model_obs.f90 2017-02-08 21:11:03 UTC (rev 11043)
+++ DART/branches/rma_single_file/perfect_model_obs/perfect_model_obs.f90 2017-02-08 21:26:30 UTC (rev 11044)
@@ -79,8 +79,8 @@
!-----------------------------------------------------------------------------
! Namelist with default values
!
-logical :: start_from_restart = .false.
-logical :: output_restart = .false.
+logical :: read_input_state_from_file = .false.
+logical :: write_output_state_to_file = .false.
integer :: async = 0
logical :: trace_execution = .false.
logical :: output_timestamps = .false.
@@ -107,14 +107,14 @@
logical :: single_file_in = .false.
logical :: single_file_out = .false.
-character(len=256) :: restart_files_in(MAX_NUM_DOMS) = '', &
- restart_files_out(MAX_NUM_DOMS) = '', &
+character(len=256) :: input_state_files(MAX_NUM_DOMS) = '', &
+ output_state_files(MAX_NUM_DOMS) = '', &
obs_seq_in_file_name = 'obs_seq.in', &
obs_seq_out_file_name = 'obs_seq.out', &
adv_ens_command = './advance_model.csh'
-namelist /perfect_model_obs_nml/ start_from_restart, async, output_restart, &
- init_time_days, init_time_seconds, &
+namelist /perfect_model_obs_nml/ read_input_state_from_file, write_output_state_to_file, &
+ init_time_days, init_time_seconds, async, &
first_obs_days, first_obs_seconds, &
last_obs_days, last_obs_seconds, output_interval, &
obs_seq_in_file_name, obs_seq_out_file_name, &
@@ -122,7 +122,7 @@
obs_window_days, obs_window_seconds, silence, &
trace_execution, output_timestamps, &
print_every_nth_obs, output_forward_op_errors, &
- restart_files_in, restart_files_out, has_cycling, &
+ input_state_files, output_state_files, has_cycling, &
single_file_in, single_file_out
!------------------------------------------------------------------------------
@@ -175,7 +175,7 @@
type(file_info_type) :: file_info_input
type(file_info_type) :: file_info_output
-character(len=256), allocatable :: restart_in_files(:), restart_out_files(:)
+character(len=256), allocatable :: input_filelist(:), output_filelist(:)
integer :: nfilesin, nfilesout
! Initialize all modules used that require it
@@ -254,22 +254,25 @@
! Initialize file names:
-call parse_filenames(restart_files_in, restart_in_files, nfilesin)
-call parse_filenames(restart_files_out, restart_out_files, nfilesout)
+call parse_filenames(input_state_files, input_filelist, nfilesin)
+call parse_filenames(output_state_files, output_filelist, nfilesout)
+!> @todo FIXME if nfilesout == 0 and write_output_state_to_file is .false.
+!> that shouldn't be an error. if nfilesin == 0 and read_input_state_from_file
+!> is false, that also shouldn't be an error. (unless you're writing the mean
+!> and sd, and then maybe we should have a different name for output of input values.)
if (nfilesin == 0 .or. nfilesout == 0 ) then
- msgstring = 'nfiles == 0, must specify a restart_files_in and '//&
- 'restart_files_out'
+ msgstring = 'must specify both "input_state_files" and "output_state_files" in the namelist'
call error_handler(E_ERR,'perfect_main',msgstring,source,revision,revdate)
endif
call io_filenames_init(file_info_input, 1, cycling=has_cycling, single_file=single_file_in)
-call set_file_metadata(file_info_input, 1, restart_in_files, 'perfect_input', 'pmo initial condition')
+call set_file_metadata(file_info_input, 1, input_filelist, 'perfect_input', 'pmo initial condition')
call set_io_copy_flag( file_info_input, 1, READ_COPY)
! Perfect Restart
call io_filenames_init(file_info_output, 1, cycling=has_cycling, single_file=single_file_out)
-call set_file_metadata(file_info_output, 1, restart_out_files, 'perfect_restart', 'pmo restart')
+call set_file_metadata(file_info_output, 1, output_filelist, 'perfect_restart', 'pmo restart')
call set_io_copy_flag( file_info_output, 1, 1, WRITE_COPY, num_output_ens=1)
if (trace_execution) then
@@ -280,9 +283,9 @@
! Set a time type for initial time if namelist inputs are not negative
call filter_set_initial_time(init_time_days, init_time_seconds, time1, read_time_from_file)
-if (start_from_restart) then
+if (read_input_state_from_file) then
- print*, 'pmo : read state '
+ call error_handler(E_MSG,'perfect_read_restart:', 'reading input state from file')
call read_state(ens_handle, file_info_input, read_time_from_file, time1)
else ! model spin up
@@ -444,7 +447,7 @@
(time_step_number / output_interval * output_interval == time_step_number)) then
call trace_message('Before updating restart file')
- if(output_restart) then
More information about the Dart-dev
mailing list