[Dart-dev] [4119] DART/trunk/utilities: These files are obsolete. The rest
nancy at ucar.edu
nancy at ucar.edu
Fri Oct 23 10:56:24 MDT 2009
Revision: 4119
Author: nancy
Date: 2009-10-23 10:56:24 -0600 (Fri, 23 Oct 2009)
Log Message:
-----------
These files are obsolete. The restart_file_tool is the
same code, renamed for consistency.
Removed Paths:
-------------
DART/trunk/utilities/restart_file_utility.f90
DART/trunk/utilities/restart_file_utility.html
DART/trunk/utilities/restart_file_utility.nml
-------------- next part --------------
Deleted: DART/trunk/utilities/restart_file_utility.f90
===================================================================
--- DART/trunk/utilities/restart_file_utility.f90 2009-10-22 23:35:06 UTC (rev 4118)
+++ DART/trunk/utilities/restart_file_utility.f90 2009-10-23 16:56:24 UTC (rev 4119)
@@ -1,325 +0,0 @@
-! Data Assimilation Research Testbed -- DART
-! Copyright 2004-2007, Data Assimilation Research Section
-! University Corporation for Atmospheric Research
-! Licensed under the GPL -- www.gpl.org/licenses/gpl.html
-
-program restart_file_utility
-
-! <next few lines under version control, do not edit>
-! $URL$
-! $Id$
-! $Revision$
-! $Date$
-
-! Program to overwrite the time on each ensemble in a restart file.
-
-use types_mod, only : r8
-use time_manager_mod, only : time_type, operator(<), operator(==), &
- set_time_missing, set_time, &
- operator(/=), print_time, print_date
-
-use utilities_mod, only : initialize_utilities, register_module, &
- error_handler, nmlfileunit, E_MSG, E_ERR, &
- timestamp, find_namelist_in_file, &
- check_namelist_read, do_output
-
-use assim_model_mod, only : static_init_assim_model, get_model_size, &
- open_restart_read, open_restart_write, &
- awrite_state_restart, aread_state_restart, &
- close_restart
-
-use ensemble_manager_mod, only : init_ensemble_manager, ensemble_type, &
- put_copy, get_copy
-
-use mpi_utilities_mod, only : initialize_mpi_utilities, task_count, &
- finalize_mpi_utilities
-
-
-implicit none
-
-! version controlled file description for error handling, do not edit
-character(len=128), parameter :: &
- source = "$URL$", &
- revision = "$Revision$", &
- revdate = "$Date$"
-
-integer :: iunit, model_size, io, member
-type(ensemble_type) :: ens_handle
-character(len = 128) :: ifile, ofile
-logical :: one_by_one
-character(len=16) :: write_format
-
-!----------------------------------------------------------------
-! Most of these variables are namelist-controllable.
-!
-character(len = 128) :: input_file_name = "filter_restart", &
- output_file_name = "filter_updated_restart"
-integer :: ens_size = 1
-logical :: single_restart_file_in = .true.
-logical :: single_restart_file_out = .true.
-logical :: write_binary_restart_files = .true.
-logical :: overwrite_data_time = .false.
-type(time_type) :: data_time, old_data_time
-integer :: new_data_days = -1, new_data_secs = -1
-logical :: input_is_model_advance_file = .false.
-logical :: output_is_model_advance_file = .false.
-logical :: overwrite_advance_time = .false.
-type(time_type) :: advance_time, old_advance_time
-integer :: new_advance_days = -1, new_advance_secs = -1
-
-namelist /restart_file_utility_nml/ &
- input_file_name, &
- output_file_name, &
- ens_size, &
- single_restart_file_in, &
- single_restart_file_out, &
- write_binary_restart_files, &
- overwrite_data_time, &
- new_data_days, &
- new_data_secs, &
- input_is_model_advance_file, &
- output_is_model_advance_file, &
- overwrite_advance_time, &
- new_advance_days, &
- new_advance_secs
-
-
-!----------------------------------------------------------------
-!----------------------------------------------------------------
-
-! This program should only be run with a single process
-call initialize_mpi_utilities('restart_file_utility')
-if(task_count() > 1) &
- call error_handler(E_ERR,'restart_file_utility','Only use single process', &
- source,revision,revdate)
-
-call register_module(source,revision,revdate)
-
-! Read the namelist entry and print it
-call find_namelist_in_file("input.nml", "restart_file_utility_nml", iunit)
-read(iunit, nml = restart_file_utility_nml, iostat = io)
-call check_namelist_read(iunit, io, "restart_file_utility_nml")
-
-if (do_output()) write(nmlfileunit, nml=restart_file_utility_nml)
-if (do_output()) write( * , nml=restart_file_utility_nml)
-
-! ens_size is in the filter namelist, and the single restart file flags
-! are in the ensemble manager namelist. how do i get access to them
-! here without replication? write accessor routines for those parms
-! in filter and the ens_mod code? but filter is a main program, so ?
-
-old_advance_time = set_time_missing()
-advance_time = set_time_missing()
-old_data_time = set_time_missing()
-data_time = set_time_missing()
-
-! Time to reset model/data time to - if set in namelist
-if (overwrite_data_time) then
- if (new_data_days >= 0 .and. new_data_secs >= 0) then
- data_time = set_time(new_data_secs, new_data_days)
- else
- call error_handler(E_ERR,'restart_file_utility','must specify data days and times', &
- source,revision,revdate)
- endif
-endif
-
-! Time to reset advance/target time to - if set in namelist
-if (overwrite_advance_time) then
- if (.not. output_is_model_advance_file) then
- call error_handler(E_ERR,'restart_file_utility','output_is_model_advance_file must be true to set advance time',&
- source,revision,revdate)
- endif
- if (new_advance_days >= 0 .and. new_advance_secs >= 0) then
- advance_time = set_time(new_advance_secs, new_advance_days)
- else
- call error_handler(E_ERR,'restart_file_utility','must specify advance days and times',&
- source,revision,revdate)
- endif
-else
-! Cannot output an advance time if input is not already one and if the user
-! has not given us a time to use.
-if (.not. input_is_model_advance_file .and. output_is_model_advance_file) then
- call error_handler(E_ERR,'restart_file_utility','overwrite_advance_time must be true if output file has advance time',&
- source,revision,revdate)
- endif
-endif
-
-! Figure out the output format string. (Input format automatically detected.)
-if (write_binary_restart_files) then
- write_format = "unformatted"
-else
- write_format = "formatted"
-endif
-
-! Initialize the model so we can get the size.
-call static_init_assim_model()
-model_size = get_model_size()
-
-! If either the restart in or out data is all together in a single file,
-! then there has to be room for the entire dataset in memory at once --
-! which is the size of the state vector times the ensemble count.
-one_by_one = .not. (single_restart_file_in .or. single_restart_file_out)
-
-! if both in and out are single files, we can loop here over all ens members
-! doing each one piecemeal; no need for space for all members in memory.
-if (one_by_one) then
-
- ! Initialize the ens manager with enough room for a single ensemble member.
- call init_ensemble_manager(ens_handle, num_copies=1, num_vars=model_size)
-
- do member=1, ens_size
-
- ! add member number as a suffix: e.g. base.0000
- write(ifile, "(a,a,i4.4)") trim(input_file_name), '.', member
- write(ofile, "(a,a,i4.4)") trim(output_file_name), '.', member
-
- !------------------- Read restart from file ----------------------
- iunit = open_restart_read(ifile)
- ! Read in the advance time if present
- if (input_is_model_advance_file) then
- call aread_state_restart(ens_handle%time(1), ens_handle%vars(:, 1), iunit, old_advance_time)
- else
- call aread_state_restart(ens_handle%time(1), ens_handle%vars(:, 1), iunit)
- endif
- call close_restart(iunit)
- !------------------- Read restart from file ----------------------
-
- !----------------- Update data, advance times if requested -------------
- old_data_time = ens_handle%time(1)
- if (overwrite_data_time) &
- ens_handle%time(1) = data_time
- if (.not. overwrite_advance_time) &
- advance_time = old_advance_time
- !----------------- Update data, advance times if requested -------------
-
- !------------------- Write restart to file -----------------------
- ! Output the restart file if requested; Force to binary for bitwise reproducing
- ! use in filter and perfect_model obs with shell advance options
- iunit = open_restart_write(ofile, write_format)
- if (output_is_model_advance_file) then
- call awrite_state_restart(ens_handle%time(1), ens_handle%vars(:, 1), iunit, advance_time)
- else
- call awrite_state_restart(ens_handle%time(1), ens_handle%vars(:, 1), iunit)
- endif
- call close_restart(iunit)
- !------------------- Write restart to file -----------------------
-
- enddo
-
-else
-
- ! Initialize the ens manager with enough room for all ensemble members.
- ! Either read, write, or both will need this.
- call init_ensemble_manager(ens_handle, num_copies=ens_size, num_vars=model_size)
-
- ! make the defaults be a single filename, and overwrite them below if
- ! there are individual files.
- ifile = trim(input_file_name)
- ofile = trim(output_file_name)
-
- !------------------- Read restart from file ----------------------
- ! If only one restart file on input, read it all up front. For individuals
- ! read each one in the loop below.
- if (single_restart_file_in) then
- iunit = open_restart_read(ifile)
- ! Read in the advance time if not present
- do member=1, ens_size
- if (input_is_model_advance_file) then
- call aread_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit, old_advance_time)
- else
- call aread_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit)
- endif
- enddo
- call close_restart(iunit)
- else
- ! loop over each ensemble member, reading in each individually.
- do member=1, ens_size
-
- ! add member number as a suffix: e.g. base.0000
- write(ifile, "(a,a,i4.4)") trim(input_file_name), '.', member
-
- iunit = open_restart_read(ifile)
- ! Read in the advance time if present
- if (input_is_model_advance_file) then
- call aread_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit, old_advance_time)
- else
- call aread_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit)
- endif
- call close_restart(iunit)
-
- enddo
- endif
- !------------------- Read restart from file ----------------------
-
-
- !----------------- Update data, advance times if requested -----------
- do member=1, ens_size
- old_data_time = ens_handle%time(member)
- if (overwrite_data_time) &
- ens_handle%time(member) = data_time
- if (.not. overwrite_advance_time) &
- advance_time = old_advance_time
- enddo
- !----------------- Update data, advance times if requested -----------
-
- !------------------- Write restart to file -----------------------
- ! If only one restart file on output, write it all in one go.
- ! Otherwise, write each ens in a loop below.
- if (single_restart_file_out) then
- ! Output the restart file if requested; Force to binary for bitwise reproducing
- ! use in filter and perfect_model obs with shell advance options
- iunit = open_restart_write(ofile, write_format)
- do member=1, ens_size
- if (output_is_model_advance_file) then
- call awrite_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit, advance_time)
- else
- call awrite_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit)
- endif
- enddo
- call close_restart(iunit)
- else
- ! loop over each ensemble member, reading in each individually.
- do member=1, ens_size
-
- ! add member number as a suffix: e.g. base.0000
- write(ofile, "(a,a,i4.4)") trim(output_file_name), '.', member
-
- ! Output the restart file if requested; Force to binary for bitwise reproducing
- ! use in filter and perfect_model obs with shell advance options
- iunit = open_restart_write(ofile, write_format)
- if (output_is_model_advance_file) then
- call awrite_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit, advance_time)
- else
- call awrite_state_restart(ens_handle%time(member), ens_handle%vars(:, member), iunit)
- endif
- call close_restart(iunit)
-
- enddo
- endif
- !------------------- Write restart to file -----------------------
-
-endif
-
-
-if (old_advance_time .ne. set_time_missing()) then
- call print_time(old_advance_time, "input file had an advance_time, which was ")
- call print_date(old_advance_time, "input file had an advance_time, which was ")
-endif
-if ((advance_time .ne. set_time_missing()) .and. output_is_model_advance_file) then
- call print_time(advance_time, "output file advance_time is now set to ")
- call print_date(advance_time, "output file advance_time is now set to ")
-endif
-if (old_data_time .ne. set_time_missing()) then
- call print_time(old_data_time, "input file data_time was ")
- call print_date(old_data_time, "input file data_time was ")
-endif
-if ((data_time .ne. set_time_missing()) .or. overwrite_data_time) then
- call print_time(data_time, "output file data_time is now set to ")
- call print_date(data_time, "output file data_time is now set to ")
-endif
-
-call timestamp(source,revision,revdate,'end') ! closes the log file.
-
-call finalize_mpi_utilities()
-
-end program restart_file_utility
Deleted: DART/trunk/utilities/restart_file_utility.html
===================================================================
--- DART/trunk/utilities/restart_file_utility.html 2009-10-22 23:35:06 UTC (rev 4118)
+++ DART/trunk/utilities/restart_file_utility.html 2009-10-23 16:56:24 UTC (rev 4119)
@@ -1,237 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>program restart_file_utility</TITLE>
-<link rel="stylesheet" type="text/css" href="../doc/html/doc.css"></link>
-</HEAD>
-<BODY>
-<!--
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! !!
-!! GNU General Public License !!
-!! !!
-!! This file is part of the Data Assimilation Research Testbed (DART). !!
-!! !!
-!! DART is free software; you can redistribute it and/or modify !!
-!! it and are expected to follow the terms of the GNU General Public !!
-!! License as published by the Free Software Foundation. !!
-!! !!
-!! DART is distributed in the hope that it will be useful, !!
-!! but WITHOUT ANY WARRANTY; without even the implied warranty of !!
-!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the !!
-!! GNU General Public License for more details. !!
-!! !!
-!! You should have received a copy of the GNU General Public License !!
-!! along with DART; if not, write to: !!
-!! Free Software Foundation, Inc. !!
-!! 59 Temple Place, Suite 330 !!
-!! Boston, MA 02111-1307 USA !!
-!! or see: !!
-!! http://www.gnu.org/licenses/gpl.txt !!
-!! !!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--->
-
-<DIV ALIGN=CENTER>
-<A HREF="#Interface">INTERFACE</A> /
-<A HREF="#PublicEntities">PUBLIC COMPONENTS</A> /
-<A HREF="#Namelist">NAMELIST</A> /
-<A HREF="#FilesUsed">FILES</A> /
-<A HREF="#References">REFERENCES</A> /
-<A HREF="#Errors">ERRORS</A> /
-<A HREF="#KnownBugs">BUGS</A> /
-<A HREF="#FuturePlans">PLANS</A> /
-<A HREF="#PrivateComponents">PRIVATE COMPONENTS</A>
-</DIV>
-
-<!--==================================================================-->
-
-<H1>PROGRAM restart_file_utility</H1>
-<A NAME="HEADER"></A>
-<TABLE summary="">
-<TR><TD>Contact: </TD><TD> Jeff Anderson </TD></TR>
-<TR><TD>Revision: </TD><TD> $Revision$ </TD></TR>
-<TR><TD>Source: </TD><TD> $URL$ </TD></TR>
-<TR><TD>Change Date: </TD><TD> $Date$ </TD></TR>
-<TR><TD>Change history:</TD><TD> try "svn log" or "svn diff" </TD></TR>
-</TABLE>
-
-<!--==================================================================-->
-
-<A NAME="OVERVIEW"></A>
-<HR>
-<H2>OVERVIEW</H2>
-
-<P>
-Utility program to alter the data timestamp in a DART restart file,
-to add or remove a model-advance time, to convert from ascii to binary
-or back, and to either split or combine ensemble restarts into
-one or multiple files.
-</P>
-
-<P>
-DART restart files contain a single timestamp with the model
-time at which the data was generated, followed by the model data.
-Each file can be ASCII or binary format, and can contain a
-timestamp and data for a single ensemble member or repeated
-timestamp/data blocks for multiple ensemble members.
-</P>
-
-<P>
-The files named <em class=code>temp_ic</em> or
-<em class=code>assim_model_state_ic00001</em> contain the same
-information as a normal restart file but the data for each
-ensemble is preceeded by an additional
-timestamp which indicates to the model advance code how far in time
-the model needs to run. This program can add or remove these
-timestamps, in addition to altering the normal data timestamps.
-</P>
-
-<P>
-Note that the output from the model advance, <em class=code>temp_ud</em>
-or <em class=code>assim_model_state_ud00001</em>, are normal restart
-files without the extra timestamp.
-</P>
-
-<!--==================================================================-->
-
-<A NAME="OTHER MODULES USED"></A>
-<BR><HR><BR>
-<H2>OTHER MODULES USED</H2>
-<PRE>
-types_mod
-time_manager_mod
-utilities_mod
-assim_model_mod
-obs_model_mod
-ensemble_manager_mod
-mpi_utilities_mod
-</PRE>
-
-<!--==================================================================-->
-<!--Note to authors. The first row of the table is different. -->
-
-<A NAME="Interface"></A>
-<BR><HR><BR>
-<H2>PUBLIC INTERFACE</H2>
-
-<H3 class=indent1>NOTES</H3>
-
-<P>
-</P>
-
-
-<!--==================================================================-->
-
-<!--==================================================================-->
-<!-- Describe the Files Used by this module. -->
-<!--==================================================================-->
-
-<A NAME="FilesUsed"></A>
-<BR><HR><BR>
-<H2>FILES</H2>
-<UL><LI>inputfile (filter_restart)
- <LI>restart_file_utility.nml
- <LI>outputfile (filter_updated_restart)
-</UL>
-
-<!--==================================================================-->
-<!-- Cite references, if need be. -->
-<!--==================================================================-->
-
-<A NAME="References"></A>
-<BR><HR><BR>
-<H2>REFERENCES</H2>
-
-<!--==================================================================-->
-<!-- Describe all the error conditions and codes. -->
-<!-- Putting a <BR> after the synopsis creates a nice effect. -->
-<!--==================================================================-->
-
-<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>
-
-<TR><!-- routine --><TD VALIGN=top>restart_file_utility</TD>
- <!-- message --><TD VALIGN=top>Only use single process</TD>
- <!-- comment --><TD VALIGN=top>Only a single mpi process can be used
- with this program</TD>
-</TR>
-
-<TR><!-- routine --><TD VALIGN=top>restart_file_utility</TD>
- <!-- message --><TD VALIGN=top>must specify data days and times</TD>
- <!-- comment --><TD VALIGN=top>If overwrite_data_time is true,
- the namelist must include the new day and time.</TD>
-</TR>
-
-<TR><!-- routine --><TD VALIGN=top>restart_file_utility</TD>
- <!-- message --><TD VALIGN=top>output_is_model_advance_file must
- be true to set advance time</TD>
- <!-- comment --><TD VALIGN=top>If overwrite_advance_time is true,
- output_is_model_advance_file must also be true.</TD>
-</TR>
-
-<TR><!-- routine --><TD VALIGN=top>restart_file_utility</TD>
- <!-- message --><TD VALIGN=top>must specify advance days and times</TD>
- <!-- comment --><TD VALIGN=top>If overwrite_advance_time is true,
- the namelist must include the new day and time.</TD>
-</TR>
-
-<TR><!-- routine --><TD VALIGN=top>restart_file_utility</TD>
- <!-- message --><TD VALIGN=top>overwrite_advance_time must be true
- if output file has advance time</TD>
- <!-- comment --><TD VALIGN=top>If the incoming file does not have
- a model advance time, the output cannot have one unless
- the user gives one in the namelist, and sets
- overwrite_advance_time to true.</TD>
-</TR>
-
-</TABLE>
-</div>
-
-
-<!--==================================================================-->
-<!-- Describe the bugs. -->
-<!--==================================================================-->
-
-<A NAME="KnownBugs"></A>
-<BR><HR><BR>
-<H2>KNOWN BUGS</H2>
-<P>
-</P>
-
-<!--==================================================================-->
-<!-- Descibe Future Plans. -->
-<!--==================================================================-->
-
-<A NAME="FuturePlans"></A>
-<BR><HR><BR>
-<H2>FUTURE PLANS</H2>
-<P>
-</P>
-
-<!--==================================================================-->
-<!-- Have not fleshed out this part yet ... ha ha ha -->
-<!--==================================================================-->
-
-<A NAME="PrivateComponents"></A>
-<BR><HR><BR>
-<H2>PRIVATE COMPONENTS</H2>
-
-<!-- <div class=routine> -->
-<!-- <pre> -->
-<!-- type location_type -->
-<!-- private -->
-<!-- real(r8) :: x -->
-<!-- end type location_type</pre> -->
-<!-- </div> -->
-
-<H3 class=indent1>Discussion</H3>
-
-<!--==================================================================-->
-
-<HR>
-</BODY>
-</HTML>
Deleted: DART/trunk/utilities/restart_file_utility.nml
===================================================================
--- DART/trunk/utilities/restart_file_utility.nml 2009-10-22 23:35:06 UTC (rev 4118)
+++ DART/trunk/utilities/restart_file_utility.nml 2009-10-23 16:56:24 UTC (rev 4119)
@@ -1,19 +0,0 @@
-
-&restart_file_utility_nml
- input_file_name = "filter_restart",
- output_file_name = "filter_updated_restart",
- ens_size = 1,
- single_restart_file_in = .true.,
- single_restart_file_out = .true.,
- write_binary_restart_files = .true.,
- overwrite_data_time = .false.,
- new_data_days = -1,
- new_data_secs = -1,
- input_is_model_advance_file = .false.,
- output_is_model_advance_file = .false.,
- overwrite_advance_time = .false.,
- new_advance_days = -1,
- new_advance_secs = -1
-/
-
-
More information about the Dart-dev
mailing list