[Dart-dev] DART/branches Revision: 11917
dart at ucar.edu
dart at ucar.edu
Tue Aug 29 09:44:57 MDT 2017
nancy at ucar.edu
2017-08-29 09:44:56 -0600 (Tue, 29 Aug 2017)
99
fix the obs rwtest that's already fixed on the trunk.
when you merge this should avoid conflicts.
Added: DART/branches/rma_fix_clm_restarts/developer_tests/obs_sequence/obs_rwtest.f90
===================================================================
--- DART/branches/rma_fix_clm_restarts/developer_tests/obs_sequence/obs_rwtest.f90 (rev 0)
+++ DART/branches/rma_fix_clm_restarts/developer_tests/obs_sequence/obs_rwtest.f90 2017-08-29 15:44:56 UTC (rev 11917)
@@ -0,0 +1,514 @@
+! DART software - Copyright 2004 - 2013 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$
+
+!> test program that tries to open an obs_sequence file, print out
+!> basic information about it, and write the same information out.
+!> intended to test read_obs_seq() and write_obs_seq() routines.
+
+program obs_rwtest
+
+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
+use obs_kind_mod, only : max_defined_types_of_obs, get_name_for_type_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
+logical :: is_this_last
+integer :: size_seq_in
+integer :: num_copies_in, num_qc_in
+integer :: num_inserted, iunit, io, i, j
+integer :: max_num_obs, file_id
+character(len=129) :: read_format
+logical :: pre_I_format, cal
+character(len=512) :: msgstring, msgstring1, msgstring2, msgstring3
+type(obs_def_type) :: this_obs_def
+
+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
+
+
+logical :: prompt_for_filenames = .true.
+
+character(len=256) :: filename_in = ''
+character(len=256) :: filename_out = ''
+
+logical :: print_only = .false.
+character(len=32) :: calendar = 'Gregorian'
+
+
+namelist /obs_rwtest_nml/ &
+ prompt_for_filenames, &
+ filename_in, filename_out, &
+ print_only, calendar
+
+!----------------------------------------------------------------
+! Start of the program
+
+call setup()
+
+! Read the namelist entry
+call find_namelist_in_file("input.nml", "obs_rwtest_nml", iunit)
+read(iunit, nml = obs_rwtest_nml, iostat = io)
+call check_namelist_read(iunit, io, "obs_rwtest_nml")
More information about the Dart-dev
mailing list