[Dart-dev] DART/branches Revision: 13071
dart at ucar.edu
dart at ucar.edu
Mon Mar 25 15:50:59 MDT 2019
nancy at ucar.edu
2019-03-25 15:50:58 -0600 (Mon, 25 Mar 2019)
208
this program isn't finished - but i'd like a copy in the
repo so it doesn't get lost. i'll delete it in the next
few mins so it doesn't end up being merged onto the rma_trunk
but there will be a copy here.
Added: DART/branches/recam/assimilation_code/programs/obs_utils/obs_data_denial.f90
===================================================================
--- DART/branches/recam/assimilation_code/programs/obs_utils/obs_data_denial.f90 (rev 0)
+++ DART/branches/recam/assimilation_code/programs/obs_utils/obs_data_denial.f90 2019-03-25 21:50:58 UTC (rev 13071)
@@ -0,0 +1,597 @@
+! DART software - Copyright UCAR. This open source software is provided
+! by UCAR, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+!
+! $Id$
+
+
+!> open an obs_seq file and randomly change the error variance of N of
+!> each obs type to a huge value before copying obs over to the output file.
+!> the value of N is namelist-settable. this effectively removes the
+!> impact of those observations on the assimilation. it is intended to
+!> help implement a data-denial experiment where you assimilate all obs
+!> (the original obs_seq file) and then with some obs disabled
+!> (the output obs_seq from this program) and compare the results.
+!> the default is to remove N of each obs type but the types of obs
+!> is also namelist-settable.
+
+!> THIS IS NOT YET DONE! it was cloned from obs_keep_a_few
+!> and has not been implemented yet.
+
+program obs_data_denial
+
+use types_mod, only : r8, missing_r8, metadatalength
+use utilities_mod, only : register_module, initialize_utilities, &
+ find_namelist_in_file, check_namelist_read, &
+ error_handler, E_ERR, E_MSG, nmlfileunit, &
+ do_nml_file, do_nml_term, get_next_filename, &
+ open_file, close_file, finalize_utilities
+use location_mod, only : location_type, get_location, set_location, &
+ LocationName, read_location, operator(/=), &
+ write_location
+use obs_def_mod, only : obs_def_type, get_obs_def_time, get_obs_def_type_of_obs, &
+ get_obs_def_location, read_obs_def, &
+ set_obs_def_time
+use obs_kind_mod, only : max_defined_types_of_obs, get_name_for_type_of_obs, &
+ get_index_for_type_of_obs, read_type_of_obs_table, &
+ get_num_types_of_obs
+use time_manager_mod, only : time_type, operator(>), print_time, set_time, &
+ print_date, set_calendar_type, &
+ operator(/=), get_calendar_type, NO_CALENDAR, &
+ operator(-)
+use obs_sequence_mod, only : obs_sequence_type, obs_type, write_obs_seq, &
+ init_obs, assignment(=), get_obs_def, &
+ init_obs_sequence, static_init_obs_sequence, &
+ read_obs_seq_header, read_obs_seq, get_num_obs, &
+ get_first_obs, get_last_obs, get_next_obs, &
+ insert_obs_in_seq, get_num_copies, get_num_qc, &
+ get_copy_meta_data, get_qc_meta_data, &
+ set_copy_meta_data, set_qc_meta_data, &
+ destroy_obs, destroy_obs_sequence, &
+ delete_seq_head, delete_seq_tail, &
+ get_num_key_range, get_obs_key, get_qc, &
+ copy_partial_obs, get_next_obs_from_key, &
+ get_obs_def, set_obs_def
+
+implicit none
+
+! version controlled file description for error handling, do not edit
+character(len=256), parameter :: source = &
+ "$URL$"
+character(len=32 ), parameter :: revision = "$Revision$"
+character(len=128), parameter :: revdate = "$Date$"
+
+type(obs_sequence_type) :: seq_in, seq_out
+type(obs_type) :: obs_in, next_obs_in
+type(obs_type) :: obs_out, prev_obs_out
+logical :: is_this_last
+integer :: size_seq_in, size_seq_out
+integer :: num_copies_in, num_qc_in
+integer :: num_inserted, iunit, io, j
+integer :: max_num_obs, file_id
+integer :: num_rejected_badqc, num_rejected_diffqc
+integer :: num_rejected_other
+character(len=129) :: read_format
+logical :: pre_I_format, cal
+character(len=512) :: msgstring, msgstring1, msgstring2, msgstring3
+type(obs_def_type) :: this_obs_def
+
+integer, allocatable :: n_this_type(:)
+integer :: this_type
+
+character(len=metadatalength) :: meta_data
+
+! could go into namelist if you wanted more control
+integer, parameter :: print_every = 5000
+
+! lazy, pick big number. make it bigger if too small.
+integer, parameter :: max_obs_input_types = 500
+
+!----------------------------------------------------------------
+! Namelist input with default values
+
+
+character(len=256) :: filename_in = ''
+character(len=256) :: filename_out = ''
+
More information about the Dart-dev
mailing list