[Dart-dev] [4813] DART/trunk/adaptive_inflate: Simple utility to create inflation restart files. This all

nancy at ucar.edu nancy at ucar.edu
Wed Mar 23 16:04:31 MDT 2011


Revision: 4813
Author:   nancy
Date:     2011-03-23 16:04:31 -0600 (Wed, 23 Mar 2011)
Log Message:
-----------
Simple utility to create inflation restart files.  This allows long scripting
jobs to use the same namelist for the first step as continuation jobs do,
by making a constant valued initial inflation mean and standard deviation
file which can be read in like any inflation restart file.

Added Paths:
-----------
    DART/trunk/adaptive_inflate/fill_inflation_restart.f90
    DART/trunk/adaptive_inflate/fill_inflation_restart.html

Property Changed:
----------------
    DART/trunk/adaptive_inflate/

-------------- next part --------------

Property changes on: DART/trunk/adaptive_inflate
___________________________________________________________________
Added: svn:mergeinfo
   + /DART/branches/inf_restart:4784-4812

Copied: DART/trunk/adaptive_inflate/fill_inflation_restart.f90 (from rev 4812, DART/branches/inf_restart/fill_inflation_restart.f90)
===================================================================
--- DART/trunk/adaptive_inflate/fill_inflation_restart.f90	                        (rev 0)
+++ DART/trunk/adaptive_inflate/fill_inflation_restart.f90	2011-03-23 22:04:31 UTC (rev 4813)
@@ -0,0 +1,91 @@
+! DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+! provided by UCAR, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/DAReS/DART/DART_download
+
+program fill_inflation_restart
+
+! <next few lines under version control, do not edit>
+! $URL$ 
+! $Id$ 
+! $Revision$ 
+! $Date$ 
+!
+! Write an inflation restart file with the right number of entries,
+! based on a single inflate and standard deviation value read from the console.
+! (alternatively we could read them from a namelist, but it seems like overkill.)
+
+
+use types_mod,            only : r8, PI
+
+use utilities_mod,        only : error_handler, E_ERR, E_MSG,       &
+                                 initialize_utilities, finalize_utilities
+
+use ensemble_manager_mod, only : ensemble_type, write_ensemble_restart, &
+                                 init_ensemble_manager, end_ensemble_manager
+
+use assim_model_mod,      only : static_init_assim_model
+
+use            model_mod, only : get_model_size, static_init_model
+
+implicit none
+
+! version controlled file description for error handling, do not edit
+character(len=128), parameter :: &
+   source   = "$URL$", &
+   revision = "$Revision$", &
+   revdate  = "$Date$"
+
+! Read 2 floating point values from the console - the initial inflation value
+! and the inflation standard deviation.  Will write an output file named
+! 'inflation_ics' -- rename it to match what filter will read in.
+! (the name of the inflation restart file is a namelist option.)
+
+! Module storage for writing messages
+character(len = 129) :: msgstring
+character(len = 32)  :: out_file_name = 'inflate_ics'
+
+type(ensemble_type)  :: ens_handle
+
+real(r8) :: inf_initial, sd_initial
+integer  :: ss_inflate_index    = 1 
+integer  :: ss_inflate_sd_index = 2
+integer  :: model_size
+
+!============================================================================
+
+call initialize_utilities('fill_inflation_restart')
+
+msgstring = 'Both mean and sd will be read from console'
+call error_handler(E_MSG, 'fill_inflate_restart', trim(msgstring))
+msgstring = 'Full mean and sd fields will be written to this restart file: ' // trim(out_file_name)
+call error_handler(E_MSG, 'fill_inflate_restart', trim(msgstring))
+
+print *, 'Enter initial values for inflation mean and standard deviation:'
+read *, inf_initial, sd_initial
+
+write(msgstring, '(A, F12.6, 1X, F12.6)') 'mean and sd read from console as ', &
+         inf_initial, sd_initial
+call error_handler(E_MSG, 'fill_inflate_restart', trim(msgstring))
+
+! initialize the assim_model and model code
+call static_init_assim_model()
+model_size = get_model_size()
+
+write(msgstring, *) 'Model size/restart data length = ', model_size
+call error_handler(E_MSG,'',msgstring)
+
+call init_ensemble_manager(ens_handle, 2, model_size)
+
+ens_handle%vars(:, ss_inflate_index   ) = inf_initial
+ens_handle%vars(:, ss_inflate_sd_index) =  sd_initial
+
+call write_ensemble_restart(ens_handle, out_file_name, ss_inflate_index, &
+                            ss_inflate_sd_index, force_single_file = .true.)
+
+call end_ensemble_manager(ens_handle)
+
+call finalize_utilities()
+
+!========================================================================
+
+end program fill_inflation_restart

Copied: DART/trunk/adaptive_inflate/fill_inflation_restart.html (from rev 4812, DART/branches/inf_restart/fill_inflation_restart.html)
===================================================================
--- DART/trunk/adaptive_inflate/fill_inflation_restart.html	                        (rev 0)
+++ DART/trunk/adaptive_inflate/fill_inflation_restart.html	2011-03-23 22:04:31 UTC (rev 4813)
@@ -0,0 +1,153 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+<HTML>
+<HEAD>
+<TITLE>program fill_inflation_restart</TITLE>
+<link rel="stylesheet" type="text/css" href="../doc/html/doc.css">
+<link href="../doc/html/dart.ico" rel="shortcut icon" />
+</HEAD>
+<BODY>
+<A NAME="TOP"></A>
+
+<H1>PROGRAM <em class=program>fill_inflation_restart</em></H1>
+
+<table border=0 summary="" cellpadding=5>
+<tr>
+    <td valign=middle>
+    <img src="../doc/html/Dartboard9.png" alt="DART project logo" height=70 />
+    </td>
+    <td>
+       <P>Jump to <a href="../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>
+
+<A HREF="#Namelist">NAMELIST</A> /
+<A HREF="#Modules">MODULES</A> /
+<A HREF="#FilesUsed">FILES</A> /
+<A HREF="#References">REFERENCES</A> /
+<A HREF="#Errors">ERRORS</A> /
+<A HREF="#FuturePlans">PLANS</A> /
+<A HREF="#Legalese">TERMS OF USE</A>
+
+<H2>Overview</H2>
+
+<P>
+Utility program to fill in the inflation restart file with a fixed
+inflation and standard deviation value.  
+</P><P>
+For a multi-jobstep run where the only difference between the
+first step and the rest is whether the inflation is read from
+the namelist or a restart file, this allows the same namelist
+to be used in all steps by constructing a restart file for
+the first job step.
+</P><P>
+The program reads 2 real values from the console and always
+writes out a file called "inflate_ics", which can be renamed
+to match the input inflation restart file in the filter namelist.
+</P>
+
+<!--==================================================================-->
+<!--=================== DESCRIPTION OF A NAMELIST ====================-->
+<!--==================================================================-->
+
+<A NAME="Namelist"></A>
+<HR>
+<H2>NAMELIST</H2>
+<P>No namelist</P>
+<br>
+
+<!--==================================================================-->
+
+<A NAME="Modules"></A>
+<HR>
+<H2>MODULES USED</H2>
+<PRE>
+types_mod
+time_manager_mod
+utilities_mod
+assim_model_mod
+</PRE>
+
+<!--==================================================================-->
+<!-- Describe the Files Used by this module.                          -->
+<!--==================================================================-->
+
+<A NAME="FilesUsed"></A>
+<HR>
+<H2>FILES</H2>
+<UL><LI>inflate_ics (output file)
+</UL>
+
+<!--==================================================================-->
+<!-- Cite references, if need be.                                     -->
+<!--==================================================================-->
+
+<A NAME="References"></A>
+<HR>
+<H2>REFERENCES</H2>
+<ul>
+<li> none </li>
+</ul>
+
+<!--==================================================================-->
+<!-- Describe all the error conditions and codes.                     -->
+<!--==================================================================-->
+
+<A NAME="Errors"></A>
+<HR>
+<H2>ERROR CODES and CONDITIONS</H2>
+<div class=errors>
+<TABLE border=1 cellspacing=1 cellpadding=10 width=100%>
+<TR><TH>Routine</TH><TH>Message</TH><TH>Comment</TH></TR>
+
+</TABLE>
+</div>
+
+<H2>KNOWN BUGS</H2>
+<P>
+none
+</P>
+
+<!--==================================================================-->
+<!-- Describe Future Plans.                                           -->
+<!--==================================================================-->
+
+<A NAME="FuturePlans"></A>
+<HR>
+<H2>FUTURE PLANS</H2>
+<P>
+none
+</P>
+
+<!--==================================================================-->
+<!-- Legalese & Metadata                                              -->
+<!--==================================================================-->
+
+<A NAME="Legalese"></A>
+<HR>
+<H2>Terms of Use</H2>
+
+<P>
+DART software - Copyright &copy; 2004 - 2010 UCAR.<br>
+This open source software is provided by UCAR, "as is",<br>
+without charge, subject to all terms of use at<br>
+<a href="http://www.image.ucar.edu/DAReS/DART/DART_download">
+http://www.image.ucar.edu/DAReS/DART/DART_download</a>
+</P>
+
+<TABLE border=0 cellpadding=0 width=100% summary="">
+<TR><TD valign=top>Contact:       </TD><TD> DART core group   </TD></TR>
+<TR><TD valign=top>Revision:      </TD><TD> $Revision$ </TD></TR>
+<TR><TD valign=top>Source:        </TD><TD> $URL$ </TD></TR>
+<TR><TD valign=top>Change Date:   </TD><TD> $Date$ </TD></TR>
+<TR><TD valign=top>Change&nbsp;history:&nbsp;</TD><TD> try "svn&nbsp;log" or "svn&nbsp;diff" </TD></TR>
+</TABLE>
+
+<!--==================================================================-->
+
+</BODY>
+</HTML>


More information about the Dart-dev mailing list