[Dart-dev] [6171] DART/branches/development: Pass down an additional flag to indicate whether the forward operators

nancy at ucar.edu nancy at ucar.edu
Wed May 29 09:55:04 MDT 2013


Revision: 6171
Author:   nancy
Date:     2013-05-29 09:55:04 -0600 (Wed, 29 May 2013)
Log Message:
-----------
Pass down an additional flag to indicate whether the forward operators
are being called for the prior or the posterior.  This is an optional
argument that a custom forward operator can use, but is fully backwards
compatible if the forward operator doesn't need this information.

Modified Paths:
--------------
    DART/branches/development/obs_def/DEFAULT_obs_def_mod.F90
    DART/branches/development/obs_sequence/obs_sequence_mod.f90

-------------- next part --------------
Modified: DART/branches/development/obs_def/DEFAULT_obs_def_mod.F90
===================================================================
--- DART/branches/development/obs_def/DEFAULT_obs_def_mod.F90	2013-05-29 15:54:11 UTC (rev 6170)
+++ DART/branches/development/obs_def/DEFAULT_obs_def_mod.F90	2013-05-29 15:55:04 UTC (rev 6171)
@@ -353,7 +353,7 @@
 !----------------------------------------------------------------------------
 
 subroutine get_expected_obs_from_def(key, obs_def, obs_kind_ind, ens_index, &
-   state, state_time, obs_val, istatus, assimilate_this_ob, evaluate_this_ob)
+   state, state_time, isprior, obs_val, istatus, assimilate_this_ob, evaluate_this_ob)
 
 ! Compute forward operator for a particular obs_def
 integer,            intent(in)  :: key
@@ -361,6 +361,7 @@
 integer,            intent(in)  :: obs_kind_ind, ens_index
 real(r8),           intent(in)  :: state(:)
 type(time_type),    intent(in)  :: state_time
+logical,            intent(in)  :: isprior
 real(r8),           intent(out) :: obs_val
 integer,            intent(out) :: istatus
 logical,            intent(out) :: assimilate_this_ob, evaluate_this_ob
@@ -398,6 +399,7 @@
       !   obs_kind_ind -- the index of the observation specific type 
       !   obs_time     -- the time of the observation
       !   error_var    -- the observation error variance
+      !   isprior      -- true for prior eval; false for posterior
       !
       ! the routine must return values for:
       !   obs_val -- the computed forward operator value

Modified: DART/branches/development/obs_sequence/obs_sequence_mod.f90
===================================================================
--- DART/branches/development/obs_sequence/obs_sequence_mod.f90	2013-05-29 15:54:11 UTC (rev 6170)
+++ DART/branches/development/obs_sequence/obs_sequence_mod.f90	2013-05-29 15:55:04 UTC (rev 6171)
@@ -322,7 +322,7 @@
 
 !---------------------------------------------------------
 
-subroutine get_expected_obs(seq, keys, ens_index, state, state_time, &
+subroutine get_expected_obs(seq, keys, ens_index, state, state_time, isprior, &
    obs_vals, istatus, assimilate_this_ob, evaluate_this_ob)
 
 ! Compute forward operator for set of obs in sequence
@@ -332,6 +332,7 @@
 integer,                 intent(in)  :: ens_index
 real(r8),                intent(in)  :: state(:)
 type(time_type),         intent(in)  :: state_time
+logical,                 intent(in)  :: isprior
 real(r8),                intent(out) :: obs_vals(:)
 integer,                 intent(out) :: istatus
 logical,                 intent(out) :: assimilate_this_ob, evaluate_this_ob
@@ -367,7 +368,7 @@
 ! Otherwise do forward operator for this kind
    else
       call get_expected_obs_from_def(keys(i), obs_def, obs_kind_ind, &
-         ens_index, state, state_time, obs_vals(i), istatus, &
+         ens_index, state, state_time, isprior, obs_vals(i), istatus, &
          assimilate_this_ob, evaluate_this_ob)
    endif
 end do
@@ -1746,9 +1747,9 @@
    call error_handler(E_ERR,'delete_obs_by_qc', msgstring, &
                       source, revision, revdate)
 endif
-! Ok for min/max to be missing_r8; if both specified, min must be < max.
-if (qc_min /= missing_r8 .and. qc_max /= missing_r8 .and. qc_min >= qc_max) then
-   write(msgstring,*) 'qc_min must be less than qc_max'
+! Ok for min/max to be missing_r8; if both specified, min must be <= max.
+if (qc_min /= missing_r8 .and. qc_max /= missing_r8 .and. qc_min > qc_max) then
+   write(msgstring,*) 'qc_min must be less than or equal qc_max'
    call error_handler(E_ERR,'delete_obs_by_qc', msgstring, &
                       source, revision, revdate)
 endif
@@ -1839,10 +1840,10 @@
    call error_handler(E_ERR,'delete_obs_by_copy', msgstring, &
                       source, revision, revdate)
 endif
-! Ok for min/max to be missing_r8; if both specified, min must be < max.
+! Ok for min/max to be missing_r8; if both specified, min must be <= max.
 if (copy_min /= missing_r8 .and. copy_max /= missing_r8 .and. &
-    copy_min >= copy_max) then
-   write(msgstring,*) 'copy_min must be less than copy_max'
+    copy_min > copy_max) then
+   write(msgstring,*) 'copy_min must be less than or equal copy_max'
    call error_handler(E_ERR,'delete_obs_by_copy', msgstring, &
                       source, revision, revdate)
 endif


More information about the Dart-dev mailing list