[Dart-dev] DART/branches Revision: 12923

dart at ucar.edu dart at ucar.edu
Thu Nov 1 15:46:27 MDT 2018


thoar at ucar.edu
2018-11-01 15:46:27 -0600 (Thu, 01 Nov 2018)
217
This will now work on 'obs_seq.out' files and calculate what it can ~ 
considering there are no prior or posterior means or spreads or ensemble members.

This matches the functionality of the threed_sphere version.
 



Modified: DART/branches/rma_trunk/assimilation_code/programs/obs_diag/oned/obs_diag.f90
===================================================================
--- DART/branches/rma_trunk/assimilation_code/programs/obs_diag/oned/obs_diag.f90	2018-10-29 20:58:55 UTC (rev 12922)
+++ DART/branches/rma_trunk/assimilation_code/programs/obs_diag/oned/obs_diag.f90	2018-11-01 21:46:27 UTC (rev 12923)
@@ -488,6 +488,18 @@
          call get_obs_def(observation, obs_def)
 
          flavor    = get_obs_def_type_of_obs(obs_def)
+
+         ! Check to see if it is an identity observation.
+         ! Redefine identity observations as flavor = RAW_STATE_VARIABLE
+         !> Still have a problem determining what state type best relates
+         !> to the observation kind - but it would allow us to
+         !> do this for all models, regardless of dimensionality.
+
+         if ( flavor < 0 ) then
+            Nidentity = Nidentity + 1
+            flavor = RAW_STATE_VARIABLE
+         endif
+
          obsname   = get_name_for_type_of_obs(flavor)
          obs_time  = get_obs_def_time(obs_def)
          obs_loc   = get_obs_def_location(obs_def)
@@ -503,31 +515,28 @@
             trusted = .false.
          endif
 
-         ! Check to see if it is an identity observation.
-         ! Redefine identity observations as flavor = RAW_STATE_VARIABLE
-         !> Still have a problem determining what state type best relates
-         !> to the observation kind - but it would allow us to
-         !> do this for all models, regardless of dimensionality.
-
-         if ( flavor < 0 ) then
-            Nidentity = Nidentity + 1
-            flavor = RAW_STATE_VARIABLE
-         endif
-
          if ( use_zero_error_obs ) then
             obs_error_variance = 0.0_r8
          else
             obs_error_variance = get_obs_def_error_variance(obs_def)
          endif
-
          ! retrieve observation prior and posterior means and spreads
 
-         call get_obs_values(observation,              obs,              obs_index)
-         call get_obs_values(observation,       prior_mean,       prior_mean_index)
-         call get_obs_values(observation,   posterior_mean,   posterior_mean_index)
-         call get_obs_values(observation,     prior_spread,     prior_spread_index)
-         call get_obs_values(observation, posterior_spread, posterior_spread_index)
+         prior_mean(1)       = 0.0_r8
+         posterior_mean(1)   = 0.0_r8
+         prior_spread(1)     = 0.0_r8
+         posterior_spread(1) = 0.0_r8
 
+            call get_obs_values(observation,              obs,              obs_index)
+         if (prior_mean_index > 0) &
+            call get_obs_values(observation,       prior_mean,       prior_mean_index)
+         if (posterior_mean_index > 0) &
+            call get_obs_values(observation,   posterior_mean,   posterior_mean_index)
+         if (prior_spread_index > 0) &
+            call get_obs_values(observation,     prior_spread,     prior_spread_index)
+         if (posterior_spread_index > 0) &
+            call get_obs_values(observation, posterior_spread, posterior_spread_index)
+
          pr_mean =       prior_mean(1)
          po_mean =   posterior_mean(1)
          pr_sprd =     prior_spread(1)
@@ -1392,7 +1401,7 @@
         org_qc_index, trim(get_qc_meta_data(seq,org_qc_index))
    call error_handler(E_MSG,'SetIndices',string1)
 
-   if (          dart_qc_index > 0 ) then
+   if (dart_qc_index > 0 ) then
    write(string1,'(''DART quality control index '',i2,'' metadata '',a)') &
         dart_qc_index, trim(get_qc_meta_data(seq,dart_qc_index))
    call error_handler(E_MSG,'SetIndices',string1)
@@ -1399,6 +1408,14 @@
    endif
 endif
 
+if ( any( (/ prior_mean_index,     prior_spread_index, &
+         posterior_mean_index, posterior_spread_index /) < 0) ) then
+   string1 = 'Observation sequence has no prior/posterior information.'
+   string2 = 'You will still get a count, maybe observation value, incoming qc, ...'
+   string3 = 'For simple information, you may want to use "obs_seq_to_netcdf" instead.'
+   call error_handler(E_MSG, 'SetIndices', string1, text2=string2, text3=string3)
+endif
+
 end subroutine SetIndices
 
 


More information about the Dart-dev mailing list