[Dart-dev] <P>Jump/ Revision: 12390

dart at ucar.edu dart at ucar.edu
Thu Feb 1 16:20:16 MST 2018


nancy at ucar.edu
2018-02-01 16:20:16 -0700 (Thu, 01 Feb 2018)
237
add documentation for obs_loop, and add a block
in the code to make it easier to see what to do if
you want to avoid copying an observation from the
input to output.  you still have to execute get_next_obs()
so you cannot simply cycle.




Modified: DART/branches/rma_trunk/assimilation_code/programs/obs_loop/obs_loop.f90
===================================================================
--- DART/branches/rma_trunk/assimilation_code/programs/obs_loop/obs_loop.f90	2018-02-01 23:19:25 UTC (rev 12389)
+++ DART/branches/rma_trunk/assimilation_code/programs/obs_loop/obs_loop.f90	2018-02-01 23:20:16 UTC (rev 12390)
@@ -111,7 +111,7 @@
 ! and last timestamps in the obs_seq files.
 call set_calendar_type(calendar)
 
-! set a logial to see if we have a calendar or not
+! set a logical to see if we have a calendar or not
 cal = (get_calendar_type() /= NO_CALENDAR)
 
 ! if you add anything to the namelist, you can process it here.
@@ -203,29 +203,38 @@
       ! and you have to set it back if you change it
       !call set_obs_def(obs_out, this_obs_def)
 
+      ! if you do NOT want to insert this observation in the output
+      ! file, set a condition that skips the next block.  you *must*
+      ! still call get_next_obs() before looping.
+
       ! ----------- MODIFY HERE ----------------
 
+      if (.true.) then
 
-      ! Since the stride through the observation sequence file is always
-      ! guaranteed to be in temporally-ascending order, we can use the
-      ! 'previous' observation as the starting point to search for the
-      ! correct insertion point.  This speeds up the insert code a lot.
+         ! Since the stride through the observation sequence file is always
+         ! guaranteed to be in temporally-ascending order, we can use the
+         ! 'previous' observation as the starting point to search for the
+         ! correct insertion point.  This speeds up the insert code a lot.
+   
+         if (num_inserted > 0) then
+            call insert_obs_in_seq(seq_out, obs_out, prev_obs_out)
+         else
+            call insert_obs_in_seq(seq_out, obs_out)
+         endif
+   
+         prev_obs_out = obs_out  ! update position in seq for next insert
+         num_inserted = num_inserted + 1
+   
+         if (print_every > 0) then
+            if (mod(num_inserted,print_every) == 0) then
+               print*, 'inserted number ',num_inserted,' of ',size_seq_out
+            endif
+         endif
 
-      if (num_inserted > 0) then
-         call insert_obs_in_seq(seq_out, obs_out, prev_obs_out)
-      else
-         call insert_obs_in_seq(seq_out, obs_out)
       endif
 
-      prev_obs_out = obs_out  ! update position in seq for next insert
-      num_inserted = num_inserted + 1
+      ! ---- THIS MUST BE EXECUTED BEFORE THE NEXT LOOP ----
 
-      if (print_every > 0) then
-         if (mod(num_inserted,print_every) == 0) then
-            print*, 'inserted number ',num_inserted,' of ',size_seq_out
-         endif
-      endif
-
       call get_next_obs(seq_in, obs_in, next_obs_in, is_this_last)
 
    enddo ObsLoop

Added: DART/branches/rma_trunk/assimilation_code/programs/obs_loop/obs_loop.html
===================================================================
--- DART/branches/rma_trunk/assimilation_code/programs/obs_loop/obs_loop.html	                        (rev 0)
+++ DART/branches/rma_trunk/assimilation_code/programs/obs_loop/obs_loop.html	2018-02-01 23:20:16 UTC (rev 12390)
@@ -0,0 +1,295 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+<HTML>
+<HEAD>
+<TITLE>program obs_loop</TITLE>
+<link rel="stylesheet" type="text/css" href="../../../documentation/html/doc.css" />
+<link href="../../../documentation/images/dart.ico" rel="shortcut icon" />
+</HEAD>
+<BODY>
+<A NAME="TOP"></A>
+
+<H1>program <em class=program>obs_loop</em></H1>
+
+<table border=0 summary="" cellpadding=5>
+<tr>
+    <td valign=middle>
+    <img src="../../../documentation/images/Dartboard7.png" alt="DART project logo" height=70 />
+    </td>
+    <td>
+       <P>Jump to <a href="../../../documentation/index.html">DART Documentation Main Index</a><br />
+          <small><small>version information for this file: <br />
+          <!-- version tag follows, do not edit -->
+          $Id$</small></small>
+       </P></td>
+</tr>
+</table>
+


More information about the Dart-dev mailing list