[Dart-dev] DART/branches Revision: 12528
dart at ucar.edu
dart at ucar.edu
Tue Apr 17 11:39:21 MDT 2018
hendric at ucar.edu
2018-04-17 11:39:21 -0600 (Tue, 17 Apr 2018)
92
adding different namelist variables to distinguish between
prior and posterior inflation.
Modified: DART/branches/rma_fill_inf/assimilation_code/programs/fill_inflation_restart/fill_inflation_restart.f90
===================================================================
--- DART/branches/rma_fill_inf/assimilation_code/programs/fill_inflation_restart/fill_inflation_restart.f90 2018-04-17 17:34:45 UTC (rev 12527)
+++ DART/branches/rma_fill_inf/assimilation_code/programs/fill_inflation_restart/fill_inflation_restart.f90 2018-04-17 17:39:21 UTC (rev 12528)
@@ -71,15 +71,17 @@
logical :: write_prior_inf, write_post_inf = .false.
logical :: verbose = .FALSE.
-real(r8) :: initial_inf
-real(r8) :: initial_sd
+real(r8) :: prior_inf_mean = MISSING_R8
+real(r8) :: prior_inf_sd = MISSING_R8
+real(r8) :: post_inf_mean = MISSING_R8
+real(r8) :: post_inf_sd = MISSING_R8
integer :: ss_inflate_index = 1
integer :: ss_inflate_sd_index = 2
-namelist /fill_inflation_restart_nml/ initial_inf, initial_sd, &
- single_file, input_state_files, output_state_files, &
- write_prior_inf, write_post_inf, verbose
-
+namelist /fill_inflation_restart_nml/ prior_inf_mean, prior_inf_sd, &
+ post_inf_mean, post_inf_sd, verbose, &
+ write_prior_inf, write_post_inf, &
+ input_state_files, output_state_files, single_file
! io variables
integer :: iunit, io
integer, allocatable :: ios_out(:)
@@ -200,11 +202,6 @@
call read_state(ens_handle, file_info_input, read_time_from_file, model_time)
-ens_handle%copies(ss_inflate_index , :) = initial_inf
-ens_handle%copies(ss_inflate_sd_index, :) = initial_sd
-
-print*, ens_handle%copies(ss_inflate_index, : )
-
! Test the write portion.
call io_filenames_init(file_info_output, &
ncopies = num_ens, &
@@ -212,7 +209,14 @@
single_file = single_file, &
restart_files = file_array_output)
-if (write_prior_inf) then
+if(write_prior_inf) then
+ if (prior_inf_mean /= MISSING_R8 .or. prior_inf_sd /= MISSING_R8) then
+ write(*,*) 'you must specify prior_inf_mean and prior_ins_sd values'
+ return
+ endif
+ ens_handle%copies(ss_inflate_index , :) = prior_inf_mean
+ ens_handle%copies(ss_inflate_sd_index, :) = prior_inf_sd
+
write(my_stage,'(A)') 'prior_inflation'
write(my_base, '(A)') 'mean'
write(my_desc, '(A)') 'prior inflation mean'
@@ -252,7 +256,12 @@
endif
! Write posterior inflation files
-if (write_post_inf) then
+if (write_post_inf) then
+ if (post_inf_mean /= MISSING_R8 .or. post_inf_sd /= MISSING_R8) then
+ write(*,*) 'you must specify post_inf_mean and post_ins_sd values'
+ return
+ endif
+
write(my_stage,'(A)') 'post_inflation'
write(my_base,'(A)') 'mean'
write(my_desc,'(A)') 'post inflation mean'
@@ -261,11 +270,11 @@
stage = my_stage, &
basename = my_base, &
desc = my_desc)
-
+
call set_io_copy_flag(file_info_output, &
cnum = 1, &
io_flag = WRITE_COPY)
-
+
write(my_base, '(A)') 'sd'
write(my_desc, '(A)') 'post inflation sd'
call set_file_metadata(file_info_output, &
@@ -273,11 +282,11 @@
stage = my_stage, &
basename = my_base, &
desc = my_desc)
-
+
call set_io_copy_flag(file_info_output, &
cnum = 2, &
io_flag = WRITE_COPY)
-
+
output_restart_files = get_stage_metadata(file_info_output)
do idom = 1, num_domains
@@ -291,7 +300,6 @@
endif
More information about the Dart-dev
mailing list