[Dart-dev] DART/branches Revision: 12904
dart at ucar.edu
dart at ucar.edu
Fri Oct 12 15:41:03 MDT 2018
goldy at ucar.edu
2018-10-12 15:41:03 -0600 (Fri, 12 Oct 2018)
79
Separate out namelist reading to a separate routine that can return some values
Modified: DART/branches/cesm_dart_esp/assimilation_code/modules/assimilation/filter_mod.f90
===================================================================
--- DART/branches/cesm_dart_esp/assimilation_code/modules/assimilation/filter_mod.f90 2018-10-12 17:08:15 UTC (rev 12903)
+++ DART/branches/cesm_dart_esp/assimilation_code/modules/assimilation/filter_mod.f90 2018-10-12 21:41:03 UTC (rev 12904)
@@ -21,7 +21,7 @@
delete_obs_from_seq, delete_seq_head, &
delete_seq_tail, replace_obs_values, replace_qc, &
destroy_obs_sequence, get_qc_meta_data, add_qc
-
+
use obs_def_mod, only : obs_def_type, get_obs_def_error_variance, get_obs_def_time, &
get_obs_def_type_of_obs
@@ -98,7 +98,8 @@
public :: filter_sync_keys_time, &
filter_set_initial_time, &
- filter_main
+ filter_main, &
+ filter_read_namelist
! version controlled file description for error handling, do not edit
character(len=256), parameter :: source = &
@@ -192,10 +193,10 @@
! IO options
!>@todo FIXME - how does this work for multiple domains? ens1d1, ens2d1, ... ens1d2 or
!> ens1d1 ens1d2, ens1d1 ens2d2, etc i like the latter better.
-character(len=256) :: input_state_files(MAX_FILES) = ''
-character(len=256) :: output_state_files(MAX_FILES) = ''
+character(len=256) :: input_state_files(MAX_FILES) = ''
+character(len=256) :: output_state_files(MAX_FILES) = ''
! Name of files containing a list of {input,output} restart files, 1 file per domain
-character(len=256) :: input_state_file_list(MAX_NUM_DOMS) = ''
+character(len=256) :: input_state_file_list(MAX_NUM_DOMS) = ''
character(len=256) :: output_state_file_list(MAX_NUM_DOMS) = ''
! Read in a single file and perturb this to create an ensemble
logical :: perturb_from_single_instance = .false.
@@ -275,7 +276,7 @@
inf_flavor, &
inf_initial_from_restart, &
inf_sd_initial_from_restart, &
- inf_sd_max_change, &
+ inf_sd_max_change, &
inf_deterministic, &
inf_damping, &
inf_initial, &
@@ -297,7 +298,7 @@
output_mean, &
output_sd, &
write_all_stages_at_end, &
- write_obs_every_cycle, &
+ write_obs_every_cycle, &
allow_missing_clm
@@ -305,6 +306,21 @@
contains
+subroutine filter_read_namelist(ens_size_out)
+integer, optional, intent(out) :: ens_size_out
+
+integer :: iunit, io
+
+! Read the namelist entry
+call find_namelist_in_file("input.nml", "filter_nml", iunit)
+read(iunit, nml = filter_nml, iostat = io)
+call check_namelist_read(iunit, io, "filter_nml")
+
+if (present(ens_size_out)) then
+ ens_size_out = ens_size
+end if
+end subroutine filter_read_namelist
+
!----------------------------------------------------------------
!> The code does not use %vars arrays except:
!> * Task 0 still writes the obs_sequence file, so there is a transpose (copies to vars) and
@@ -321,7 +337,7 @@
integer, allocatable :: keys(:)
integer(i8) :: model_size
-integer :: i, iunit, io, time_step_number, num_obs_in_set, ntimes
+integer :: i, time_step_number, num_obs_in_set, ntimes
integer :: last_key_used, key_bounds(2)
integer :: in_obs_copy, obs_val_index
integer :: prior_obs_mean_index, posterior_obs_mean_index
@@ -353,11 +369,6 @@
call filter_initialize_modules_used() ! static_init_model called in here
-! Read the namelist entry
-call find_namelist_in_file("input.nml", "filter_nml", iunit)
-read(iunit, nml = filter_nml, iostat = io)
-call check_namelist_read(iunit, io, "filter_nml")
-
! Record the namelist values used for the run ...
if (do_nml_file()) write(nmlfileunit, nml=filter_nml)
if (do_nml_term()) write( * , nml=filter_nml)
@@ -804,7 +815,7 @@
call timestamp_message('After computing prior observation values')
call trace_message('After computing prior observation values')
More information about the Dart-dev
mailing list