[Dart-dev] [5868] DART/branches/development/obs_def: added a 'set_1d_integral()' routine.

nancy at ucar.edu nancy at ucar.edu
Mon Sep 17 10:55:42 MDT 2012


Revision: 5868
Author:   nancy
Date:     2012-09-17 10:55:41 -0600 (Mon, 17 Sep 2012)
Log Message:
-----------
added a 'set_1d_integral()' routine.  it isn't used by filter but it is needed to create obs of this type from a standalone program.  we use this file as an example, but it isn't have a routine that adds the metadata to an obs if you aren't using 'create_obs_sequence' interactively.   

Modified Paths:
--------------
    DART/branches/development/obs_def/obs_def_1d_state_mod.f90
    DART/branches/development/obs_def/obs_def_1d_state_mod.html

-------------- next part --------------
Modified: DART/branches/development/obs_def/obs_def_1d_state_mod.f90
===================================================================
--- DART/branches/development/obs_def/obs_def_1d_state_mod.f90	2012-09-13 23:06:58 UTC (rev 5867)
+++ DART/branches/development/obs_def/obs_def_1d_state_mod.f90	2012-09-17 16:55:41 UTC (rev 5868)
@@ -58,7 +58,8 @@
 
 ! These are the required interfaces for an obs_def module.  
 public :: write_1d_integral, read_1d_integral, &
-          interactive_1d_integral, get_expected_1d_integral
+          interactive_1d_integral, get_expected_1d_integral, &
+          set_1d_integral
 
 ! Storage for the special information required for observations of this type
 integer               :: num_1d_integral_obs = 0     ! current count of obs
@@ -324,6 +325,55 @@
 
 !----------------------------------------------------------------------
 
+subroutine set_1d_integral(integral_half_width, num_eval_pts, localize_type, igrkey, istatus)
+
+! inputs are: half width of integral 
+!             the number of evaluation points (5-20 recommended) 
+!             localization type: 1=Gaspari-Cohn; 2=Boxcar; 3=Ramped Boxcar
+
+ real(r8), intent(in)  :: integral_half_width
+ integer,  intent(in)  :: num_eval_pts
+ integer,  intent(in)  :: localize_type
+ integer,  intent(out) :: igrkey
+ integer,  intent(out) :: istatus
+
+! Available to be called by a program creating these types of observations.
+! Notice that igrkey is intent(out) here, not (in) as in some other routines.
+! Sets the additional metadata for this obs, increments the key, and returns
+! the new value.  This key value should be set in the obs_def derived type by
+! calling set_obs_def_key().   Notice that this is different from the main
+! observation key, which all observation entries have.  This key is specific
+! to this observation type and is used to index into the metadata for only
+! this type of obs.
+
+if ( .not. module_initialized ) call initialize_module
+
+! Increment the counter so all key values are unique
+num_1d_integral_obs = num_1d_integral_obs + 1
+
+! Set the return value for the key, and use it as the index below
+igrkey = num_1d_integral_obs
+
+! Make sure key is within valid range
+call check_valid_key(igrkey, 'GENERATED', 'set_1d_integral')
+
+! Set the corresponding values in the module global arrays
+half_width(igrkey) = integral_half_width
+num_points(igrkey) = num_eval_pts
+localization_type(igrkey) = localize_type
+
+istatus = 0
+
+if(debug) print*, 'setting metadata for 1D integral obs ', igrkey
+if(debug) print*, 'metadata values are: ', half_width(igrkey), num_points(igrkey), localization_type(igrkey)
+
+if(debug) print*, 'return key set to ', igrkey
+if(debug) print*, 'return status (0 good; >0 error; <0 reserved for system use) is ', istatus
+
+end subroutine set_1d_integral
+
+!----------------------------------------------------------------------
+
 subroutine check_valid_key(igrkey, what, fromwhere)
  integer, intent(in)          :: igrkey
  character(len=*), intent(in) :: what, fromwhere

Modified: DART/branches/development/obs_def/obs_def_1d_state_mod.html
===================================================================
--- DART/branches/development/obs_def/obs_def_1d_state_mod.html	2012-09-13 23:06:58 UTC (rev 5867)
+++ DART/branches/development/obs_def/obs_def_1d_state_mod.html	2012-09-17 16:55:41 UTC (rev 5868)
@@ -120,8 +120,9 @@
 obs_def module.  This section is optional if there are no external interfaces.
 <pre>
 ! BEGIN DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE 
-!   use obs_def_1d_state_mod, only : write_1d_integral, read_1d_integral, 
-!                                    interactive_1d_integral, get_expected_1d_integral 
+!   use obs_def_1d_state_mod, only : write_1d_integral, read_1d_integral,  &amp;
+!                                    interactive_1d_integral, get_expected_1d_integral, &amp;
+!                                    set_1d_integral
 ! END DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE 
 </pre>
 <br /><br />
@@ -247,6 +248,7 @@
 <TR><TD>&nbsp;</TD><TD><A HREF="#read_1d_integral">read_1d_integral</A></TD></TR>
 <TR><TD>&nbsp;</TD><TD><A HREF="#interactive_1d_integral">interactive_1d_integral</A></TD></TR>
 <TR><TD>&nbsp;</TD><TD><A HREF="#get_expected_1d_integral">get_expected_1d_integral</A></TD></TR>
+<TR><TD>&nbsp;</TD><TD><A HREF="#set_1d_integral">set_1d_integral</A></TD></TR>
 </TABLE>
 
 <!--============= DESCRIPTION OF A SUBROUTINE =======================-->
@@ -404,6 +406,59 @@
 </div>
 <br />
 
+<!--============= DESCRIPTION OF A SUBROUTINE =======================-->
+
+<A NAME="set_1d_integral"></A>
+<br />
+<div class=routine>
+<em class=call>call set_1d_integral(integral_half_width, num_eval_pts, localize_type, igrkey, istatus) </em>
+<pre>
+real(r8), intent(in)  :: <em class=code>integral_half_width</em>
+integer,  intent(in)  :: <em class=code>num_eval_pts</em>
+integer,  intent(in)  :: <em class=code>localize_type</em>
+integer,  intent(out) :: <em class=code>igrkey</em>
+integer,  intent(out) :: <em class=code>istatus</em>
+</pre>
+</div>
+
+<div class=indent1>
+<!-- Description -->
+
+<P>
+Available for use by programs that create observations to set
+the additional metadata for these observation types.  This 
+information includes the integral half-width, localization type and 
+number of quadrature points for this observation.
+The key that is returned is uniquely associated with the definition
+that has been created and should be set in the obs_def structure
+by calling <em class=code>set_obs_def_key()</em>.
+This key is different from the main observation key which all
+observation types have.  This key is unique to this observation
+type and is used when reading in the observation sequence to
+match the corresponding metadata with each observation of
+this type.
+</P>
+
+<TABLE width=100% border=0 summary="" cellpadding=3>
+<TR><TD valign=top><em class=code>integral_half_width&nbsp;&nbsp;</em></TD>
+    <TD>Real value setting the half-width of the integral.
+    </TD></TR>
+<TR><TD valign=top><em class=code>num_eval_pts&nbsp;&nbsp;</em></TD>
+    <TD>Integer, number of evaluation points.  5-20 recommended.
+    </TD></TR>
+<TR><TD valign=top><em class=code>localize_type&nbsp;&nbsp;</em></TD>
+    <TD>Integer localization type: 1=Gaspari-Cohn; 2=Boxcar; 3=Ramped Boxcar
+    </TD></TR>
+<TR><TD valign=top><em class=code>igrkey&nbsp;&nbsp;</em></TD>
+    <TD>Unique integer key associated with the observation being 
+       processed.</TD></TR>
+<TR><TD valign=top><em class=code>istatus&nbsp;&nbsp;</em></TD>
+    <TD>Return code.  0 means success, any other value is an error</TD></TR>
+</TABLE>
+
+</div>
+<br />
+
 <!--==================================================================-->
 <!-- Describe the Files Used by this module.                          -->
 <!--==================================================================-->


More information about the Dart-dev mailing list