[Dart-dev] DART/branches Revision: 12707

dart at ucar.edu dart at ucar.edu
Tue Jul 3 10:09:07 MDT 2018


jla at ucar.edu
2018-07-03 10:09:07 -0600 (Tue, 03 Jul 2018)
176
Included Craig Bishop's GIGG filter variants in assim_tools_mod and added new namelist entry
in perfect_model_obs to allow different error distributions for testing the GIGGs.



Modified: DART/branches/gigg/assimilation_code/modules/assimilation/assim_tools_mod.f90
===================================================================
--- DART/branches/gigg/assimilation_code/modules/assimilation/assim_tools_mod.f90	2018-07-03 15:30:15 UTC (rev 12706)
+++ DART/branches/gigg/assimilation_code/modules/assimilation/assim_tools_mod.f90	2018-07-03 16:09:07 UTC (rev 12707)
@@ -17,7 +17,7 @@
 use  utilities_mod,       only : file_exist, get_unit, check_namelist_read, do_output,    &
                                  find_namelist_in_file, register_module, error_handler,   &
                                  E_ERR, E_MSG, nmlfileunit, do_nml_file, do_nml_term,     &
-                                 open_file, close_file, timestamp, to_upper
+                                 open_file, close_file, timestamp
 use       sort_mod,       only : index_sort 
 use random_seq_mod,       only : random_seq_type, random_gaussian, init_random_seq,       &
                                  random_uniform, random_gamma, random_inverse_gamma
@@ -90,7 +90,7 @@
 logical                :: first_inc_ran_call = .true.
 type (random_seq_type) :: inc_ran_seq
 
-! sequence for the GIGG filter
+! Random sequence for the GIGG filter
 logical                :: first_ran_gigg = .true.
 type (random_seq_type) :: gigg_ran_seq
 
@@ -134,12 +134,10 @@
 !      8 = Rank Histogram Filter (see Anderson 2011)
 !     (9 = Localized Particle Filter (see Poterjoy 2016), in assim_tools_mod.pf.f90)
 !
-!     100 = GIGG, Craig Bishop. Detect interior type from observation quantity (NOT YET IMPLEMENTED) 
-!     101 ="Gauss_Gauss"     gaussian prior, gaussian observation likelihood
+!     101 = GIGG, Craig Bishop. Detect interior type from observation quantity (NOT YET IMPLEMENTED) 
 !     102 ="Gamma_InvGamma"  gamma prior, inverse-gamma observation likelihood
 !     103 ="InvGamma_Gamma"  inverse-gamma prior, gamma observation likelihood
 !      
-!
 !  special_localization_obs_types -> Special treatment for the specified observation types
 !  special_localization_cutoffs   -> Different cutoff value for each specified obs type
 !
@@ -674,7 +672,10 @@
             grp_top = grp_end(group)
             call obs_increment(obs_prior(grp_bot:grp_top), grp_size, obs(1), &
                obs_err_var, obs_inc(grp_bot:grp_top), inflate, my_inflate,   &
-               my_inflate_sd, net_a(group), base_obs_kind)
+               my_inflate_sd, net_a(group))
+               ! For gigg filter could pass base_obs_kind into obs_increment to allow 
+               ! decision on filter kind to be made depending on the observed quantity 
+               ! my_inflate_sd, net_a(group), base_obs_kind)
          end do
 
          ! Compute updated values for single state space inflation
@@ -1245,7 +1246,9 @@
 !-------------------------------------------------------------
 
 subroutine obs_increment(ens_in, ens_size, obs, obs_var, obs_inc, &
-   inflate, my_cov_inflate, my_cov_inflate_sd, net_a, quantity)
+   inflate, my_cov_inflate, my_cov_inflate_sd, net_a)
+   ! For gigg quantity would be passed in here.
+   ! inflate, my_cov_inflate, my_cov_inflate_sd, net_a, quantity)
 
 ! Given the ensemble prior for an observation, the observation, and
 ! the observation error variance, computes increments and adjusts
@@ -1257,7 +1260,8 @@
 type(adaptive_inflate_type), intent(inout) :: inflate
 real(r8),                    intent(inout) :: my_cov_inflate, my_cov_inflate_sd
 real(r8),                    intent(out)   :: net_a
-integer,                     intent(in)    :: quantity
+! Declaration for implementing quanity-dependent gigg filter.
+!integer,                     intent(in)    :: quantity
 
 real(r8) :: ens(ens_size), inflate_inc(ens_size)
 real(r8) :: prior_mean, prior_var, new_val(ens_size)
@@ -1342,11 +1346,13 @@
       call obs_increment_boxcar(ens, ens_size, obs, obs_var, obs_inc, rel_weights)
     case (8) 
       call obs_increment_rank_histogram(ens, ens_size, prior_var, obs, obs_var, obs_inc)
-    case (100, 101, 102, 103)
-      call obs_increment_GIGG(ens, ens_size, prior_mean, prior_var, obs, obs_var, quantity, obs_inc)
+    case (101, 102, 103)
+      call obs_increment_GIGG(ens, ens_size, prior_mean, prior_var, obs, obs_var, obs_inc)
+      ! Need to pass quantity for quanitity-dependent gigg capability
+      !call obs_increment_GIGG(ens, ens_size, prior_mean, prior_var, obs, obs_var, quantity, obs_inc)
     case default
       call error_handler(E_ERR,'obs_increment', &
-                 'Unexpected error: Illegal value of filter_kind in assim_tools namelist [1-8, 100-103 OK]', &
+                 'Illegal value of filter_kind in assim_tools namelist [1-8, 101-103 OK]', &
                  source, revision, revdate)
    end select
 endif
@@ -2390,15 +2396,17 @@
 end subroutine obs_increment_rank_histogram
 
 
-subroutine obs_increment_GIGG(ens, ens_size, prior_mean, prior_var, obs, obs_var, quantity, obs_inc)
+subroutine obs_increment_GIGG(ens, ens_size, prior_mean, prior_var, obs, obs_var, obs_inc)
+! Need quanity for implementation of quantity-dependent gigg
+!subroutine obs_increment_GIGG(ens, ens_size, prior_mean, prior_var, obs, obs_var, quantity, obs_inc)
 !------------------------------------------------------------------------
 !
-! Craig Bishop's GIGG filter variant.
+! Thanks to Craig Bishop for providing his GIGG filter variant for DART.
 !  Filter subtype determined here based on whether prior and observation 
 !  likelihood pdfs are best approximated by the following assumptions:
-!   GIGG_type 1: Gaussian prior and Gaussian observation likelihood assumed


More information about the Dart-dev mailing list