[Dart-dev] [4634] DART/trunk: Using a types_mod parameter for the length of the metadata strings.
nancy at ucar.edu
nancy at ucar.edu
Wed Jan 5 09:47:59 MST 2011
Revision: 4634
Author: thoar
Date: 2011-01-05 09:47:59 -0700 (Wed, 05 Jan 2011)
Log Message:
-----------
Using a types_mod parameter for the length of the metadata strings.
At various places they were coded in different lengths - they are now
a tidy 'types_mod:metadatalength' characters long. These strings are
primarily used for the copy metadata ... 'posterior ensemble member 100'
There's no need for these to be super long strings and causes them to
be kinda ugly in a 'ncdump' output. BTW - 75 is the maximum length you
can have for these strings and not cause ncdump to wrap it.
The default value for types_mod:metadatalength is 64 right now.
Modified Paths:
--------------
DART/trunk/diagnostics/rms_diag.f90
DART/trunk/filter/filter.dopplerfold.f90
DART/trunk/filter/filter.f90
DART/trunk/models/PBL_1d/create_real_network/create_real_network.f90
DART/trunk/models/PBL_1d/create_real_network.f90
DART/trunk/models/wrf/select.f90
DART/trunk/obs_sequence/obs_seq_to_netcdf.f90
DART/trunk/obs_sequence/obs_sequence_mod.f90
DART/trunk/obs_sequence/obs_sequence_tool.f90
DART/trunk/observations/MADIS/convert_madis_acars.f90
DART/trunk/observations/MADIS/convert_madis_marine.f90
DART/trunk/observations/SSEC/convert_ssec_satwnd.f90
DART/trunk/perfect_model_obs/perfect_model_obs.f90
-------------- next part --------------
Modified: DART/trunk/diagnostics/rms_diag.f90
===================================================================
--- DART/trunk/diagnostics/rms_diag.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/diagnostics/rms_diag.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -14,7 +14,7 @@
! of time between a truth found in one file, priors found in
! another, and posterior found in a third.
-use types_mod, only : r8
+use types_mod, only : r8, metadatalength
use location_mod, only : location_type
use assim_model_mod, only : init_diag_input, get_diag_input_copy_meta_data, &
get_model_state_vector, input_diagnostics, assim_model_type, &
@@ -30,8 +30,8 @@
integer :: prior_unit, posterior_unit, truth_unit, ens_size, model_size, copies
type(location_type), allocatable :: location(:)
-character(len = 129), allocatable :: meta_data(:)
-character(len = 129) :: prior_file, posterior_file, truth_file, global_meta_data
+character(len = metadatalength), allocatable :: meta_data(:), global_meta_data
+character(len = 129) :: prior_file, posterior_file, truth_file
integer :: i, j, num_samples
real(r8), allocatable :: prior(:, :), posterior(:, :), truth(:)
type(assim_model_type) :: truth_state, prior_state, posterior_state
Modified: DART/trunk/filter/filter.dopplerfold.f90
===================================================================
--- DART/trunk/filter/filter.dopplerfold.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/filter/filter.dopplerfold.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -802,7 +802,7 @@
! THese are the prior and posterior state output files and the observation sequence
! output file which contains both prior and posterior data.
-character(len=129) :: prior_meta_data, posterior_meta_data
+character(len=metadatalength) :: prior_meta_data, posterior_meta_data
! The 4 is for ensemble mean and spread plus inflation mean and spread
! The Prior file contains the prior inflation mean and spread only
! Posterior file contains the posterior inflation mean and spread only
@@ -922,8 +922,8 @@
integer, intent(out) :: in_obs_copy, obs_val_index
integer, intent(out) :: input_qc_index, DART_qc_index
-character(len = 129) :: qc_meta_data = 'DART quality control'
-character(len = 129) :: no_qc_meta_data = 'No incoming data QC'
+character(len = metadatalength) :: qc_meta_data = 'DART quality control'
+character(len = metadatalength) :: no_qc_meta_data = 'No incoming data QC'
character(len = 129) :: obs_seq_read_format
integer :: obs_seq_file_id, num_obs_copies
integer :: tnum_copies, tnum_qc, tnum_obs, tmax_num_obs, qc_num_inc, num_qc
Modified: DART/trunk/filter/filter.f90
===================================================================
--- DART/trunk/filter/filter.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/filter/filter.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -797,7 +797,7 @@
! THese are the prior and posterior state output files and the observation sequence
! output file which contains both prior and posterior data.
-character(len=129) :: prior_meta_data, posterior_meta_data
+character(len=metadatalength) :: prior_meta_data, posterior_meta_data
! The 4 is for ensemble mean and spread plus inflation mean and spread
! The Prior file contains the prior inflation mean and spread only
! Posterior file contains the posterior inflation mean and spread only
@@ -917,8 +917,8 @@
integer, intent(out) :: in_obs_copy, obs_val_index
integer, intent(out) :: input_qc_index, DART_qc_index
-character(len = 129) :: qc_meta_data = 'DART quality control'
-character(len = 129) :: no_qc_meta_data = 'No incoming data QC'
+character(len = metadatalength) :: qc_meta_data = 'DART quality control'
+character(len = metadatalength) :: no_qc_meta_data = 'No incoming data QC'
character(len = 129) :: obs_seq_read_format
integer :: obs_seq_file_id, num_obs_copies
integer :: tnum_copies, tnum_qc, tnum_obs, tmax_num_obs, qc_num_inc, num_qc
Modified: DART/trunk/models/PBL_1d/create_real_network/create_real_network.f90
===================================================================
--- DART/trunk/models/PBL_1d/create_real_network/create_real_network.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/models/PBL_1d/create_real_network/create_real_network.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -18,7 +18,7 @@
! create_obs_sequence. This would be run in place of both create_fixed_network
! and perfect_model_obs.
-use types_mod, only : r8, missing_r8, missing_i
+use types_mod, only : r8, missing_r8, missing_i, metadatalength
use utilities_mod, only : timestamp, register_module, open_file, &
close_file, find_namelist_in_file, &
error_handler, check_namelist_read, &
@@ -76,7 +76,7 @@
real(r8) :: this_obs_val, this_qc_val
real(r8), dimension(:), allocatable :: obs_vals, qc_vals, qc_sequence
logical :: assimilate_this_ob, evaluate_this_ob, pre_I_format
-character(len=129) :: copy_meta_data(2), qc_meta_data, obs_seq_read_format
+character(len=metadatalength) :: copy_meta_data(2), qc_meta_data, obs_seq_read_format
integer :: wrf_rnd_seed = -1
! Record the current time, date, etc. to the logfile
Modified: DART/trunk/models/PBL_1d/create_real_network.f90
===================================================================
--- DART/trunk/models/PBL_1d/create_real_network.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/models/PBL_1d/create_real_network.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -18,7 +18,7 @@
! create_obs_sequence. This would be run in place of both create_fixed_network
! and perfect_model_obs.
-use types_mod, only : r8, missing_r8, missing_i
+use types_mod, only : r8, missing_r8, missing_i, metadatalength
use utilities_mod, only : timestamp, register_module, open_file, &
close_file, find_namelist_in_file, &
error_handler, check_namelist_read, &
@@ -76,7 +76,7 @@
real(r8) :: this_obs_val, this_qc_val
real(r8), dimension(:), allocatable :: obs_vals, qc_vals, qc_sequence
logical :: assimilate_this_ob, evaluate_this_ob, pre_I_format
-character(len=129) :: copy_meta_data(2), qc_meta_data, obs_seq_read_format
+character(len=metadatalength) :: copy_meta_data(2), qc_meta_data, obs_seq_read_format
integer :: wrf_rnd_seed = -1
! Record the current time, date, etc. to the logfile
Modified: DART/trunk/models/wrf/select.f90
===================================================================
--- DART/trunk/models/wrf/select.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/models/wrf/select.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -11,7 +11,7 @@
! $Revision$
! $Date$
-use types_mod, only : r8
+use types_mod, only : r8, metadatalength
use utilities_mod, only : initialize_utilities, timestamp, &
register_module, logfileunit
use obs_sequence_mod, only : obs_type, obs_sequence_type, init_obs_sequence, &
@@ -54,7 +54,7 @@
integer :: i
integer :: num_obs, num_copies, num_qc, real_seq_num_obs
-character(len = 129) :: meta_data
+character(len = metadatalength) :: meta_data
character(len = 129) :: out_file_name = 'obs_seq.out', &
in_file_name = 'obs_seq.in'
Modified: DART/trunk/obs_sequence/obs_seq_to_netcdf.f90
===================================================================
--- DART/trunk/obs_sequence/obs_seq_to_netcdf.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/obs_sequence/obs_seq_to_netcdf.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -897,7 +897,7 @@
integer, dimension(:), intent(in) :: obs_types
integer, dimension(:), intent(in) :: obs_keys
-integer :: DimID, dimlen, obsindex, iobs, istatus
+integer :: DimID, dimlen, obsindex, iobs
integer, dimension(1) :: istart, icount, intval
integer :: obsldimlen, qcldimlen
Modified: DART/trunk/obs_sequence/obs_sequence_mod.f90
===================================================================
--- DART/trunk/obs_sequence/obs_sequence_mod.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/obs_sequence/obs_sequence_mod.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -20,7 +20,7 @@
! copy subroutines. USERS MUST BE VERY CAREFUL TO NOT DO DEFAULT ASSIGNMENT
! FOR THESE TYPES THAT HAVE COPY SUBROUTINES.
-use types_mod, only : r8, DEG2RAD, MISSING_R8
+use types_mod, only : r8, DEG2RAD, MISSING_R8, metadatalength
use location_mod, only : location_type, interactive_location, &
is_location_in_region
use obs_def_mod, only : obs_def_type, get_obs_def_time, read_obs_def, &
@@ -84,8 +84,8 @@
! F95 allows pointers to be initialized to a known value.
! However, if you get an error on the following lines from your
! compiler, remove the => NULL() from the end of the 5 lines below.
- character(len = 129), pointer :: copy_meta_data(:) => NULL()
- character(len = 129), pointer :: qc_meta_data(:) => NULL()
+ character(len = metadatalength), pointer :: copy_meta_data(:) => NULL()
+ character(len = metadatalength), pointer :: qc_meta_data(:) => NULL()
integer :: first_time
integer :: last_time
! integer :: first_avail_time, last_avail_time
@@ -430,7 +430,7 @@
type(obs_sequence_type), intent(in) :: seq
integer, intent(in) :: copy_num
-character(len=129) :: get_copy_meta_data
+character(len=metadatalength) :: get_copy_meta_data
! Should have an error check for copy_num range
get_copy_meta_data = seq%copy_meta_data(copy_num)
@@ -443,7 +443,7 @@
type(obs_sequence_type), intent(in) :: seq
integer, intent(in) :: qc_num
-character(len=129) :: get_qc_meta_data
+character(len=metadatalength) :: get_qc_meta_data
! Should have an error check for qc_num range
get_qc_meta_data = seq%qc_meta_data(qc_num)
@@ -1008,7 +1008,7 @@
type(obs_sequence_type), intent(inout) :: seq
integer, intent(in) :: num_to_add
-character(len = 129) :: meta_temp(seq%num_copies)
+character(len = metadatalength) :: meta_temp(seq%num_copies)
real(r8) :: values_temp(seq%num_copies)
integer :: i, old_num
@@ -1057,7 +1057,7 @@
type(obs_sequence_type), intent(inout) :: seq
integer, intent(in) :: num_to_add
-character(len = 129) :: qc_temp(seq%num_copies)
+character(len = metadatalength) :: qc_temp(seq%num_copies)
real(r8) :: values_temp(seq%num_copies)
integer :: i, old_num
@@ -1212,7 +1212,7 @@
if(read_format == 'unformatted') then
read(file_id, iostat=io) seq%copy_meta_data(i)
else
- read(file_id, '(a129)', iostat=io) seq%copy_meta_data(i)
+ read(file_id, '(a)', iostat=io) seq%copy_meta_data(i)
endif
if (io /= 0) then
! Read error of some type
@@ -1227,7 +1227,7 @@
if(read_format == 'unformatted') then
read(file_id, iostat=io) seq%qc_meta_data(i)
else
- read(file_id, '(a129)', iostat=io) seq%qc_meta_data(i)
+ read(file_id, '(a)', iostat=io) seq%qc_meta_data(i)
endif
if (io /= 0) then
! Read error of some type
Modified: DART/trunk/obs_sequence/obs_sequence_tool.f90
===================================================================
--- DART/trunk/obs_sequence/obs_sequence_tool.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/obs_sequence/obs_sequence_tool.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -57,7 +57,7 @@
integer :: num_inserted, iunit, io, i, j, total_num_inserted
integer :: max_num_obs, file_id, remaining_obs_count
integer :: first_seq
-character(len = 129) :: read_format, meta_data
+character(len = metadatalength) :: read_format, meta_data
logical :: pre_I_format, all_gone
logical :: trim_first, trim_last
character(len = 129) :: msgstring
@@ -750,7 +750,7 @@
integer :: num_copies2, num_qc2
integer :: num_copies , num_qc, i, j
logical :: have_match1, have_match2
-character(len=129) :: str1, str2
+character(len=metadatalength) :: str1, str2
character(len=255) :: msgstring1, msgstring2
num_copies1 = get_num_copies(seq1)
@@ -1315,7 +1315,7 @@
character(len=*), optional :: fname1
integer :: num_copies , num_qc, i
-character(len=129) :: str1
+character(len=metadatalength) :: str1
character(len=255) :: msgstring1
num_copies = get_num_copies(seq1)
Modified: DART/trunk/observations/MADIS/convert_madis_acars.f90
===================================================================
--- DART/trunk/observations/MADIS/convert_madis_acars.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/observations/MADIS/convert_madis_acars.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -30,11 +30,11 @@
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-use types_mod, only : r8, missing_r8
+use types_mod, only : r8, missing_r8, metadatalength
+use location_mod, only : VERTISPRESSURE
use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities
use time_manager_mod, only : time_type, set_calendar_type, set_date, operator(>=), &
increment_time, get_time, operator(-), GREGORIAN
-use location_mod, only : VERTISPRESSURE
use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, &
static_init_obs_sequence, init_obs, write_obs_seq, &
init_obs_sequence, get_num_obs, &
@@ -48,10 +48,10 @@
use obs_kind_mod, only : ACARS_U_WIND_COMPONENT, ACARS_V_WIND_COMPONENT, &
ACARS_TEMPERATURE, ACARS_SPECIFIC_HUMIDITY, &
ACARS_DEWPOINT, ACARS_RELATIVE_HUMIDITY
-use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, &
- create_3d_obs, getvar_int, getdimlen, set_missing_name
+use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, &
+ create_3d_obs, getvar_int, getdimlen, set_missing_name
-use netcdf
+use netcdf
implicit none
@@ -70,7 +70,7 @@
integer, parameter :: num_copies = 1, & ! number of copies in sequence
num_qc = 1 ! number of QC entries
-character (len=129) :: meta_data
+character (len=metadatalength) :: meta_data
integer :: ncid, nobs, nvars, n, i, oday, osec, nused
logical :: file_exist, first_obs
Modified: DART/trunk/observations/MADIS/convert_madis_marine.f90
===================================================================
--- DART/trunk/observations/MADIS/convert_madis_marine.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/observations/MADIS/convert_madis_marine.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -33,33 +33,33 @@
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-use types_mod, only : r8, missing_r8
+use types_mod, only : r8, missing_r8, metadatalength
use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities
use time_manager_mod, only : time_type, set_calendar_type, set_date, &
- increment_time, get_time, operator(-), GREGORIAN
+ increment_time, get_time, operator(-), GREGORIAN
use location_mod, only : VERTISSURFACE
use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, &
static_init_obs_sequence, init_obs, write_obs_seq, &
init_obs_sequence, get_num_obs, &
set_copy_meta_data, set_qc_meta_data
-use meteor_mod, only : sat_vapor_pressure, specific_humidity, &
- wind_dirspd_to_uv, pres_alt_to_pres, &
- temp_and_dewpoint_to_rh
-use obs_err_mod, only : fixed_marine_temp_error, fixed_marine_rel_hum_error, &
- fixed_marine_wind_error, fixed_marine_pres_error, &
- moving_marine_temp_error, moving_marine_rel_hum_error, &
- moving_marine_wind_error, moving_marine_pres_error
+use meteor_mod, only : sat_vapor_pressure, specific_humidity, &
+ wind_dirspd_to_uv, pres_alt_to_pres, &
+ temp_and_dewpoint_to_rh
+use obs_err_mod, only : fixed_marine_temp_error, fixed_marine_rel_hum_error, &
+ fixed_marine_wind_error, fixed_marine_pres_error, &
+ moving_marine_temp_error, moving_marine_rel_hum_error, &
+ moving_marine_wind_error, moving_marine_pres_error
use dewpoint_obs_err_mod, only : dewpt_error_from_rh_and_temp, &
rh_error_from_dewpt_and_temp
-use obs_kind_mod, only : MARINE_SFC_U_WIND_COMPONENT, MARINE_SFC_V_WIND_COMPONENT, &
- MARINE_SFC_TEMPERATURE, MARINE_SFC_SPECIFIC_HUMIDITY, &
- MARINE_SFC_ALTIMETER, MARINE_SFC_DEWPOINT, &
- MARINE_SFC_RELATIVE_HUMIDITY
+use obs_kind_mod, only : MARINE_SFC_U_WIND_COMPONENT, MARINE_SFC_V_WIND_COMPONENT, &
+ MARINE_SFC_TEMPERATURE, MARINE_SFC_SPECIFIC_HUMIDITY, &
+ MARINE_SFC_ALTIMETER, MARINE_SFC_DEWPOINT, &
+ MARINE_SFC_RELATIVE_HUMIDITY
use obs_def_altimeter_mod, only : compute_altimeter
-use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, &
- create_3d_obs, getvar_int, getdimlen, set_missing_name
+use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, &
+ create_3d_obs, getvar_int, getdimlen, set_missing_name
-use netcdf
+use netcdf
implicit none
@@ -80,7 +80,7 @@
real(r8), parameter :: def_elev = 0.0_r8
-character (len=129) :: meta_data
+character (len=metadatalength) :: meta_data
integer :: ncid, nobs, nvars, n, i, oday, osec, nused
logical :: file_exist, first_obs
real(r8) :: sfcp_miss, tair_miss, tdew_miss, wdir_miss, wspd_miss, uwnd, &
Modified: DART/trunk/observations/SSEC/convert_ssec_satwnd.f90
===================================================================
--- DART/trunk/observations/SSEC/convert_ssec_satwnd.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/observations/SSEC/convert_ssec_satwnd.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -20,7 +20,7 @@
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-use types_mod, only : r8, missing_r8
+use types_mod, only : r8, missing_r8, metadatalength
use utilities_mod, only : get_unit
use time_manager_mod, only : time_type, set_calendar_type, GREGORIAN, &
increment_time, get_time, set_date, operator(-)
@@ -33,8 +33,9 @@
use obs_err_mod, only : sat_wind_error, sat_wv_wind_error
use obs_kind_mod, only : SAT_U_WIND_COMPONENT, SAT_V_WIND_COMPONENT
use obs_utilities_mod, only : create_3d_obs, add_obs_to_seq
-use netcdf
+use netcdf
+
implicit none
character(len=16), parameter :: ssec_sat_file = 'satwnd_input.txt'
@@ -44,10 +45,11 @@
num_copies = 1, & ! number of copies in sequence
num_qc = 1 ! number of QC entries
-character (len=129) :: meta_data, header
-character (len=8) :: datein
-character (len=6) :: sat
-character (len=4) :: band, hourin
+character(len=metadatalength) :: meta_data
+character(len=129) :: header
+character(len=8) :: datein
+character(len=6) :: sat
+character(len=4) :: band, hourin
logical :: iruse, visuse, wvuse, swiruse, file_exist, qifile, eefile, &
userfqc, useqiqc, useeeqc, first_obs
Modified: DART/trunk/perfect_model_obs/perfect_model_obs.f90
===================================================================
--- DART/trunk/perfect_model_obs/perfect_model_obs.f90 2011-01-05 16:37:17 UTC (rev 4633)
+++ DART/trunk/perfect_model_obs/perfect_model_obs.f90 2011-01-05 16:47:59 UTC (rev 4634)
@@ -126,7 +126,7 @@
real(r8) :: true_obs(1), obs_value(1), qc(1)
-character(len=129) :: copy_meta_data(2), qc_meta_data, obs_seq_read_format
+character(len=metadatalength) :: copy_meta_data(2), qc_meta_data, obs_seq_read_format
character(len=metadatalength) :: state_meta(1)
logical :: assimilate_this_ob, evaluate_this_ob, pre_I_format
More information about the Dart-dev
mailing list