[Dart-dev] [4516] DART/trunk/diagnostics/threed_sphere/obs_diag.f90: If the namelist input does not intersect the information in the observation
nancy at ucar.edu
nancy at ucar.edu
Fri Oct 8 14:56:37 MDT 2010
Revision: 4516
Author: thoar
Date: 2010-10-08 14:56:37 -0600 (Fri, 08 Oct 2010)
Log Message:
-----------
If the namelist input does not intersect the information in the observation
sequence files (most usually when the time information does not match) a nice
little summary of the min/max timestamps in the observation file(s) and
the namelist input is printed - providing guidance for better namelist input.
The routine also errors out and does not create an output netcdf file.
Beautiful ...
Modified Paths:
--------------
DART/trunk/diagnostics/threed_sphere/obs_diag.f90
-------------- next part --------------
Modified: DART/trunk/diagnostics/threed_sphere/obs_diag.f90
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_diag.f90 2010-10-08 17:31:50 UTC (rev 4515)
+++ DART/trunk/diagnostics/threed_sphere/obs_diag.f90 2010-10-08 20:56:37 UTC (rev 4516)
@@ -299,6 +299,7 @@
type(time_type) :: beg_time, end_time ! of the particular bin
type(time_type) :: binsep, binwidth, halfbinwidth
type(time_type) :: seqT1, seqTN ! first,last time in entire observation sequence
+type(time_type) :: AllseqT1, AllseqTN ! first,last time in ALL observation sequences
type(time_type) :: obs_time, skip_time
character(len = 129) :: ncName, locName, msgstring
@@ -720,6 +721,12 @@
call get_obs_def(obsN, obs_def)
seqTN = get_obs_def_time(obs_def)
+ ! Capture a little information to assist in an error message if the
+ ! namelist input does not intersect the observation sequence file.
+
+ if ( ifile == 1 ) AllseqT1 = seqT1
+ AllseqTN = seqTN
+
call print_time(seqT1,'First observation time',logfileunit)
call print_time(seqTN,'Last observation time',logfileunit)
call print_date(seqT1,'First observation date',logfileunit)
@@ -1595,6 +1602,7 @@
write(*,*) '# poste DART QC 5 : ',sum(analy%NDartQC_5)
write(*,*) '# poste DART QC 6 : ',sum(analy%NDartQC_6)
write(*,*) '# poste DART QC 7 : ',sum(analy%NDartQC_7)
+write(*,*)
write(logfileunit,*)
write(logfileunit,*) '# observations used : ',sum(obs_used_in_epoch)
@@ -1624,6 +1632,7 @@
write(logfileunit,*) '# poste DART QC 5 : ',sum(analy%NDartQC_5)
write(logfileunit,*) '# poste DART QC 6 : ',sum(analy%NDartQC_6)
write(logfileunit,*) '# poste DART QC 7 : ',sum(analy%NDartQC_7)
+write(logfileunit,*)
if (Nidentity > 0) then
write(*,*)'There were identity observations in this observation sequence file.'
@@ -1638,6 +1647,23 @@
endif
!----------------------------------------------------------------------
+! If the namelist input does not result in some observations, print
+! a little summary that may result in better user input.
+!----------------------------------------------------------------------
+
+if ( sum(obs_used_in_epoch) == 0 ) then
+
+ call print_date(AllseqT1,'First observation date')
+ call print_date( TimeMin,'First requested date')
+ call print_date(AllseqTN,'Last observation date')
+ call print_date( TimeMax,'Last requested date')
+
+ write(msgstring,*)'No observations in requested time bins.'
+ call error_handler(E_ERR,'obs_diag',msgstring,source,revision,revdate)
+
+endif
+
+!----------------------------------------------------------------------
! Open netCDF output file
!----------------------------------------------------------------------
More information about the Dart-dev
mailing list