[Dart-dev] DART/branches Revision: 12684

dart at ucar.edu dart at ucar.edu
Wed Jun 27 13:19:30 MDT 2018


jla at ucar.edu
2018-06-27 13:19:30 -0600 (Wed, 27 Jun 2018)
91
Updates to allow more general definition of power forward operator for non-integer powers.



Modified: DART/branches/gigg/observations/forward_operators/obs_def_1d_state_mod.f90
===================================================================
--- DART/branches/gigg/observations/forward_operators/obs_def_1d_state_mod.f90	2018-06-26 14:14:18 UTC (rev 12683)
+++ DART/branches/gigg/observations/forward_operators/obs_def_1d_state_mod.f90	2018-06-27 19:19:30 UTC (rev 12684)
@@ -465,7 +465,7 @@
 integer,             intent(out) :: istatus(ens_size)
 
 integer :: i
-real(r8) :: pval(ens_size)
+real(r8) :: pval(ens_size), pow
 
 ! The forward operator interface for this type of observation.  It is
 ! called with a state vector, a location, and a key to identify which
@@ -475,6 +475,13 @@
 ! The call to 'interpolate()' below calls the forward operator in
 ! whatever model this code has been compiled with.
 
+! The power expected operator raises the interpolated state variable to the power specified as the
+! additional metadata value in the obs_seq file. For a non-integer power, this operation is not 
+! defined for negative state variable values. Here, the forward operator for negative values of
+! the observation with non-integer power is instead defined as 
+! ob = -(-state^power). This allows exploration of a variety of 
+! qualitatively different functional relations between the observation and the state.
+
 if ( .not. module_initialized ) call initialize_module
 
 ! Make sure key is within valid range
@@ -483,22 +490,25 @@
 ! Interpolate the raw state to the location for each ensemble member
 call interpolate(state_handle, ens_size, location, QTY_STATE_VARIABLE, pval, istatus)
 
-if(power(powkey) == int(power(powkey))) then
+pow = power(powkey)
+
+! NOTE: WORRY ABOUT SMALL ROUND_OFF AWAY FROM INTEGER IN FILES?
+if(pow == int(pow)) then
    ! Integer power, just use standard definition
-   val = pval ** power(powkey)
+   val = pval ** pow
 else
    ! For non-integer powers, fix up values for negative bases
    do i = 1, ens_size
       if(pval(i) >= 0.0_r8) then
-         val(i) = pval(i) ** power(powkey)
+         val(i) = pval(i) ** pow
       else
-         val(i) = -1.0_r8 * (-1.0_r8 * pval(i)) ** power(powkey)
+         val(i) = -1.0_r8 * (-1.0_r8 * pval(i)) ** pow
       endif
    end do
 endif
 
 if(debug) print*, 'get_expected_power key is ', powkey
-if(debug) print*, 'metadata value is: ', power(powkey)
+if(debug) print*, 'metadata value is: ', pow
 if(debug) print*, 'return value for forward operator is ', val
 if(debug) print*, 'return status (0 good; >0 error; <0 reserved for system use) is ', istatus
 

Modified: DART/branches/gigg/observations/forward_operators/obs_def_1d_state_mod.html
===================================================================
--- DART/branches/gigg/observations/forward_operators/obs_def_1d_state_mod.html	2018-06-26 14:14:18 UTC (rev 12683)
+++ DART/branches/gigg/observations/forward_operators/obs_def_1d_state_mod.html	2018-06-27 19:19:30 UTC (rev 12684)
@@ -62,7 +62,11 @@
 vector that is equally spaced on a 1D cyclic domain. The three observation types
 are: a straight linear interpolation to a point on a [0,1] domain called
 a RAW_STATE_VARIABLE; the RAW_STATE_VAR_POWER is the interpolated
-RAW_STATE_VARIABLE raised to a real-valued power; 
+RAW_STATE_VARIABLE raised to a real-valued power (see the description of the
+public interface
+<TR><TD> </TD><TD><A HREF="#get_expected_power">get_expected_power</A></TD></TR>
+for details on what this forward operator does
+for non-integer powers and negative interpolated state variables); 
 an area-weighted 'integral' of the state variable
 over some part of the cyclic 1D domain called RAW_STATE_1D_INTEGRAL. 
 The second type is convenient for studying non-gaussian, non-linear
@@ -600,6 +604,9 @@
 Calls the <em class="code">interpolate()</em> routine 
 to invoke the forward operator code in whatever model this has been 
 compiled with, then raises the result to the specified power associated with this powkey.
+For non-integer values of powkey, this operation would be undefined for negative values
+of the interpolated state variable. In this case, the forward operator becomes
+-[(-state)^powkey].
 </P>
 
 <TABLE width=100% border=0 summary="" cellpadding=3>


More information about the Dart-dev mailing list