[Dart-dev] [6877] DART/trunk/models/wrf: fix a problem with multiple nests and the option to increase

nancy at ucar.edu nancy at ucar.edu
Thu Apr 10 09:21:16 MDT 2014


Revision: 6877
Author:   nancy
Date:     2014-04-10 09:21:15 -0600 (Thu, 10 Apr 2014)
Log Message:
-----------
fix a problem with multiple nests and the option to increase
obs errors near the domain boundaries. the index computations
were using the innermost nest that contained the obs, but
doing index computations relative to the outer domain.
the result could be very large obs errors for obs near
the edges of the nest. the resulting assimilation would
then basically ignore the obs because the large error
made it have no impact. 

this was fixed by changing the get_domain_info() routine
to allow the caller to specify an optional domain number 
to start searching on.  without the argument the original
functionality remains unchanged.  the preprocess tool now
specifies domain 1 when looking for obs near the boundaries.

this preludes changing obs errors near inner nest
boundaries, which we have discussed and agreed is
not something we want to support at this time.

Reference jira DART-17.

Modified Paths:
--------------
    DART/trunk/models/wrf/WRF_DART_utilities/wrf_dart_obs_preprocess.f90
    DART/trunk/models/wrf/model_mod.f90

-------------- next part --------------
Modified: DART/trunk/models/wrf/WRF_DART_utilities/wrf_dart_obs_preprocess.f90
===================================================================
--- DART/trunk/models/wrf/WRF_DART_utilities/wrf_dart_obs_preprocess.f90	2014-04-09 22:32:10 UTC (rev 6876)
+++ DART/trunk/models/wrf/WRF_DART_utilities/wrf_dart_obs_preprocess.f90	2014-04-10 15:21:15 UTC (rev 6877)
@@ -788,10 +788,10 @@
 
 do while ( .not. last_obs )
 
-  !  get location information
+  !  get location information relative to domain 1 (skip nests)
   call get_obs_def(obs, obs_def)
   xyz_loc = get_location(get_obs_def_location(obs_def))
-  call get_domain_info(xyz_loc(1),xyz_loc(2),dom_id,xloc,yloc)
+  call get_domain_info(xyz_loc(1),xyz_loc(2),dom_id,xloc,yloc,1)
 
   !  compute distance to boundary, increase based on this distance
   bdydist = min(xloc-1.0_r8, yloc-1.0_r8, nx-xloc, ny-yloc)

Modified: DART/trunk/models/wrf/model_mod.f90
===================================================================
--- DART/trunk/models/wrf/model_mod.f90	2014-04-09 22:32:10 UTC (rev 6876)
+++ DART/trunk/models/wrf/model_mod.f90	2014-04-10 15:21:15 UTC (rev 6877)
@@ -6550,11 +6550,12 @@
 
 !#######################################################################
 
-subroutine get_domain_info(obslon,obslat,id,iloc,jloc)
+subroutine get_domain_info(obslon,obslat,id,iloc,jloc,domain_id_start)
 
 real(r8), intent(in)  :: obslon, obslat
 integer, intent(out)  :: id
 real(r8), intent(out) :: iloc, jloc
+integer,  intent(in), optional :: domain_id_start
 
 logical               :: dom_found
 
@@ -6563,7 +6564,20 @@
 
 dom_found = .false.
 
+! the default is to start at the innermost domain and stop when
+! the location is found.  however if you want to start at a particular
+! domain id number, pass it in as the last optional arg.
 id = num_domains
+if (present(domain_id_start)) then
+   if (domain_id_start < 1 .or. domain_id_start > num_domains) then
+      write(errstring,  '(A,I1)') 'bad domain_id_start: ', domain_id_start
+      write(msgstring2, '(A,I1)') 'must be between 1 and ', num_domains
+      call error_handler(E_ERR, 'model_mod', errstring, &
+                         source, revision, revdate, text2=msgstring2)
+   endif
+   id = domain_id_start
+endif
+
 do while (.not. dom_found)
 
    ! Checking for exact equality on real variable types is generally a bad idea.


More information about the Dart-dev mailing list