[Dart-dev] [7850] DART/trunk/diagnostics/threed_sphere/obs_diag.f90: Now initializes the temporary U_wind component pieces to be missing.
nancy at ucar.edu
nancy at ucar.edu
Tue Apr 7 15:07:36 MDT 2015
Revision: 7850
Author: thoar
Date: 2015-04-07 15:07:36 -0600 (Tue, 07 Apr 2015)
Log Message:
-----------
Now initializes the temporary U_wind component pieces to be missing.
The U_flavor was uninitialized and could be checked if the FIRST
wind component was a a V component. Now, it just indicates that
there is a V without a companion U.
I put the 'missing u,v' print statements inside the verbose flag
so the warnings only get printed in verbose mode.
I printed the summary table of all the known observation types
and how many observations were possible - a single time, since
the number of observations possible is the same for the prior and
posterior.
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 2015-04-07 20:10:31 UTC (rev 7849)
+++ DART/trunk/diagnostics/threed_sphere/obs_diag.f90 2015-04-07 21:07:36 UTC (rev 7850)
@@ -98,16 +98,16 @@
! observations serially. Consequently, we exploit the fact that
! the U observations are _followed_ by the V observations.
-real(r8) :: U_obs = 0.0_r8
-real(r8) :: U_obs_err_var = 0.0_r8
+real(r8) :: U_obs = MISSING_R8
+real(r8) :: U_obs_err_var = MISSING_R8
type(location_type) :: U_obs_loc
-integer :: U_flavor
-integer :: U_type = KIND_V_WIND_COMPONENT ! intentional mismatch
-real(r8) :: U_pr_mean = 0.0_r8
-real(r8) :: U_pr_sprd = 0.0_r8
-real(r8) :: U_po_mean = 0.0_r8
-real(r8) :: U_po_sprd = 0.0_r8
-integer :: U_qc = 0
+integer :: U_flavor = MISSING_I
+integer :: U_type = MISSING_I
+real(r8) :: U_pr_mean = MISSING_R8
+real(r8) :: U_pr_sprd = MISSING_R8
+real(r8) :: U_po_mean = MISSING_R8
+real(r8) :: U_po_sprd = MISSING_R8
+integer :: U_qc = MISSING_I
integer :: obs_index, prior_mean_index, posterior_mean_index
integer :: prior_spread_index, posterior_spread_index
@@ -994,8 +994,6 @@
ierr = CheckMate(flavor, U_flavor, obs_loc, U_obs_loc, wflavor )
if ( ierr /= 0 ) then
- write(string1,*)'time series : V with no U at index ', keys(obsindex)
- call error_handler(E_MSG,'obs_diag',string1,source,revision,revdate)
call IPE(prior%NbadUV(iepoch, level_index, iregion, flavor), 1)
call IPE(poste%NbadUV(iepoch, level_index, iregion, flavor), 1)
else
@@ -1163,8 +1161,6 @@
call Normalize4Dvars()
call Normalize3Dvars()
-
-
!-----------------------------------------------------------------------
! Print final summary.
!-----------------------------------------------------------------------
@@ -2791,8 +2787,10 @@
flavor = -1 ! bad flavor
if ( (vflavor == MISSING_I) .or. (uflavor == MISSING_I)) then
- write(string1,*) 'missing U or V without companion - around OBS ', keys(obsindex)
- call error_handler(E_MSG,'CheckMate',string1,source,revision,revdate)
+ if (verbose) then
+ write(string1,*) 'missing U or V without companion - around OBS ', keys(obsindex)
+ call error_handler(E_MSG,'CheckMate',string1,source,revision,revdate)
+ endif
return
endif
@@ -3558,11 +3556,6 @@
call nc_check(nf90_create(path = trim(fname), cmode = nf90_share, &
ncid = ncid), 'WriteNetCDF', 'create '//trim(fname))
-if (verbose) then
- write(string1,*)trim(ncName), ' is fortran unit ',ncid
- call error_handler(E_MSG,'WriteNetCDF',string1,source,revision,revdate)
-endif
-
!----------------------------------------------------------------------------
! Write Global Attributes
!----------------------------------------------------------------------------
@@ -3683,11 +3676,24 @@
&ObservationTypes variable has all types known.' ), &
'WriteNetCDF', 'put_att obstypes comment '//trim(fname))
+if ( verbose ) then
+ ! print a banner to help identify the columns - the whitespace makes it work.
+ write(string1,*)' # obs vertical'
+ write(string2,*)'observation type possible system scaling'
+ call error_handler(E_MSG,'WriteNetCDF',string1,text2=string2)
+endif
+
typesdimlen = 0
do ivar = 1,max_obs_kinds
nobs = sum(poste%Nposs(:,:,:,ivar))
+ if ( verbose ) then
+ write(string1,'(i4,1x,(a32),1x,i8,1x,'' obs at vert '',i3,f11.3)') ivar, &
+ obs_type_strings(ivar), nobs, which_vert(ivar), scale_factor(ivar)
+ call error_handler(E_MSG,'WriteNetCDF',string1)
+ endif
+
if (nobs > 0) then
typesdimlen = typesdimlen + 1
@@ -3700,6 +3706,7 @@
call nc_check(nf90_put_att(ncid, NF90_GLOBAL, string1, ivar), &
'WriteNetCDF', 'put_att:obs_type_string '//trim(obs_type_strings(ivar)))
endif
+
enddo
if (typesdimlen < 1) then
@@ -4053,19 +4060,12 @@
! write the data we took such pains to collate ...
!----------------------------------------------------------------------------
-if (verbose) write(logfileunit,*) ! a little whitespace
-if (verbose) write(logfileunit,*)'summary for Priors of time-level-region vars'
-if (verbose) write(*,*) ! a little whitespace
-if (verbose) write(*,*)'summary for Priors of time-level-region vars'
if ( create_rank_histogram ) then
ierr = WriteTLRV(ncid, prior, TimeDimID, CopyDimID, RegionDimID, RankDimID)
else
ierr = WriteTLRV(ncid, prior, TimeDimID, CopyDimID, RegionDimID)
endif
-if (verbose) write(logfileunit,*) ! a little whitespace
-if (verbose) write(logfileunit,*)'summary for Posteriors of time-level-region vars'
-if (verbose) write(*,*) ! a little whitespace
-if (verbose) write(*,*)'summary for Posteriors of time-level-region vars'
+
ierr = WriteTLRV(ncid, poste, TimeDimID, CopyDimID, RegionDimID)
ierr = WriteLRV( ncid, priorAVG, CopyDimID, RegionDimID)
ierr = WriteLRV( ncid, posteAVG, CopyDimID, RegionDimID)
@@ -4449,13 +4449,6 @@
nobs = sum(vrbl%Nposs(:,:,:,ivar))
if (nobs < 1) cycle DEFINE
- if (verbose) then
- write(logfileunit,'(i4,1x,(a32),1x,i8,1x,'' obs at vert '',i3,f11.3)') ivar, &
- obs_type_strings(ivar), nobs, which_vert(ivar), scale_factor(ivar)
- write(*,'(i4,1x,(a32),1x,i8,1x,'' obs at vert '',i3,f11.3)') ivar, &
- obs_type_strings(ivar), nobs, which_vert(ivar), scale_factor(ivar)
- endif
-
! Create netCDF variable name
string2 = obs_type_strings(ivar)
More information about the Dart-dev
mailing list