[Dart-dev] [5850] DART/branches/development/models/noah: First crack at generating an initial ensemble.
nancy at ucar.edu
nancy at ucar.edu
Fri Aug 17 14:36:10 MDT 2012
Revision: 5850
Author: thoar
Date: 2012-08-17 14:36:10 -0600 (Fri, 17 Aug 2012)
Log Message:
-----------
First crack at generating an initial ensemble.
Must create filter_ics files with same time a the source NOAH restart.nc files.
Modified Paths:
--------------
DART/branches/development/models/noah/shell_scripts/run_filter.csh
DART/branches/development/models/noah/work/input.nml
Added Paths:
-----------
DART/branches/development/models/noah/shell_scripts/setup_filter.csh
-------------- next part --------------
Modified: DART/branches/development/models/noah/shell_scripts/run_filter.csh
===================================================================
--- DART/branches/development/models/noah/shell_scripts/run_filter.csh 2012-08-17 16:53:45 UTC (rev 5849)
+++ DART/branches/development/models/noah/shell_scripts/run_filter.csh 2012-08-17 20:36:10 UTC (rev 5850)
@@ -64,6 +64,30 @@
#PBS -q medium
#PBS -l nodes=4:ppn=2
+#==============================================================================
+# Set the commands so we can avoid problems with aliases, etc.
+#==============================================================================
+
+set MOVE = '/usr/local/bin/mv -fv'
+set COPY = '/usr/local/bin/cp -fv --preserve=timestamps'
+set LINK = '/usr/local/bin/ln -fvs'
+set REMOVE = '/usr/local/bin/rm -fr'
+
+set MOVE = '/bin/mv -fv'
+set COPY = '/bin/cp -fvp'
+set LINK = '/bin/ln -fvs'
+set REMOVE = '/bin/rm -fr'
+
+#==============================================================================
+# Stage all the required files in CENTRALDIR
+#
+# CENTRALDIR is where 'filter' will run, each model advance takes place
+# in a subdirectory created and populated by 'advance_model.csh'
+#==============================================================================
+
+set CENTRALDIR = `pwd`
+
+#==============================================================================
# Check for the existence of variables that are set by different
# queuing mechanisms. This way, we can make a single script which
# works for any queuing system.
@@ -71,9 +95,7 @@
if ($?LS_SUBCWD) then
# LSF has a list of processors already in a variable (LSB_HOSTS)
-
mpirun.lsf ./filter
-
else if ($?PBS_O_WORKDIR) then
@@ -101,10 +123,9 @@
else
- # interactive - e.g. you are using 'lam-mpi' and you have
- # already run 'lamboot' once to start the lam server.
+ # interactive - single-threaded filter, single-threaded noah
- mpirun -np 4 ./filter
+ ./filter
endif
Added: DART/branches/development/models/noah/shell_scripts/setup_filter.csh
===================================================================
--- DART/branches/development/models/noah/shell_scripts/setup_filter.csh (rev 0)
+++ DART/branches/development/models/noah/shell_scripts/setup_filter.csh 2012-08-17 20:36:10 UTC (rev 5850)
@@ -0,0 +1,176 @@
+#!/bin/csh
+#
+# DART software - Copyright 2004 - 2011 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
+#
+# $Id$
+#
+# This is an example script for how to stage the files in CENTRALDIR
+# in preparation for an assimilation.
+#
+#==============================================================================
+# Set the commands so we can avoid problems with aliases, etc.
+#==============================================================================
+
+set MOVE = '/usr/local/bin/mv -fv'
+set COPY = '/usr/local/bin/cp -fv --preserve=timestamps'
+set LINK = '/usr/local/bin/ln -fvs'
+set REMOVE = '/usr/local/bin/rm -fr'
+
+set MOVE = '/bin/mv -fv'
+set COPY = '/bin/cp -fvp'
+set LINK = '/bin/ln -fvs'
+set REMOVE = '/bin/rm -fr'
+
+#==============================================================================
+# Stage all the required files in CENTRALDIR
+#
+# CENTRALDIR is where 'filter' will run, each model advance takes place
+# in a subdirectory created and populated by 'advance_model.csh'
+#
+# The files may exist from a perfect model setup, use them. If not, get them.
+#==============================================================================
+
+set CENTRALDIR = `pwd`
+
+set NOAHDIR = /Users/thoar/svn/DART/devel/models/noah/src/hrldas-v3.3
+set DARTDIR = /Users/thoar/svn/DART/devel/models/noah
+
+foreach FILE ( Noah_hrldas_beta SOILPARM.TBL VEGPARM.TBL GENPARM.TBL URBPARM.TBL )
+ if ( -e ${FILE} ) then
+ echo "Using existing $FILE"
+ else
+ ${COPY} ${NOAHDIR}/Run/${FILE} . || exit 1
+ endif
+end
+
+if ( -e wrfinput ) then
+ echo "Using existing wrfinput"
+else
+ ${COPY} ${NOAHDIR}/Run/wrfinput.template wrfinput || exit 1
+endif
+
+foreach FILE ( namelist.hrldas obs_seq.out input.nml filter dart_to_noah noah_to_dart restart_file_tool )
+ if ( -e ${FILE} ) then
+ echo "Using existing $FILE"
+ else
+ echo "$FILE needs to be copied."
+ ${COPY} ${DARTDIR}/work/${FILE} . || exit 1
+ endif
+end
+
+foreach FILE ( run_filter.csh advance_model.csh )
+ if ( -e ${FILE} ) then
+ echo "Using existing $FILE"
+ else
+ ${COPY} ${DARTDIR}/shell_scripts/${FILE} . || exit 1
+ endif
+end
+
+#==============================================================================
+# need a set of noah restart files to define the initial ensemble
+#
+# 1) point to a directory full of noah restart files and pick N of them;
+# 2) convert them to DART format;
+# 3) make sure the time in each DART file is 'identical'
+# 4) the original noah restart files are also needed to start up
+# advance_model.csh for the first model advance. The tricky part is
+# that the Time variable in those files is all wrong.
+#
+# NOTE : This is for testing the machinery ONLY! If you try to publish a paper
+# with this ensemble I will REJECT IT AND EVERY OTHER PAPER IN YOUR CAREER.
+#
+# COME UP WITH YOUR OWN ENSEMBLE.
+#==============================================================================
+
+set ENSEMBLESOURCE = /Users/thoar/svn/DART/devel/models/noah/src/hrldas-v3.3/Run/hourly_output
+
+set nfiles = `ls -1 ${ENSEMBLESOURCE}/RESTART*DOMAIN* | wc -l`
+set filelist = `ls -1 ${ENSEMBLESOURCE}/RESTART*DOMAIN*`
+
+@ ifile = 1
+@ ensemble_member = 0
+while ($ifile <= $nfiles)
+
+ @ ensemble_member = $ensemble_member + 1
+ set fext = `printf %04d $ensemble_member`
+
+ ${COPY} $filelist[$ifile] restart.nc
+
+ # change the time here ... and simplify life
+
+ ./noah_to_dart || exit 3
+ ${MOVE} dart_ics filter_ics.$fext || exit 4
+
+ @ ifile = $ifile + 10
+end
+
+#==============================================================================
+# Now we make sure all the initial ensemble files have the same time.
+#==============================================================================
+
+echo "Make sure the earliest time in the obs_seq.out file is at or after"
+echo "the time we are inserting in the initial ensemble."
+echo "DART can advance the model states to the observation time."
+echo "DART cannot move the model state back in time."
+
+set MODEL_DAY = 147192
+set MODEL_SECOND = 0
+
+ex input.nml <<ex_end
+/restart_file_tool_nml
+g;ens_size ;s;= .*;= 1,;
+g;single_restart_file_in ;s;= .*;= .true.,;
+g;single_restart_file_out ;s;= .*;= .true.,;
+g;write_binary_restart_files ;s;= .*;= .false.,;
+g;overwrite_data_time ;s;= .*;= .true.,;
+g;new_data_days ;s;= .*;= $MODEL_DAY,;
+g;new_data_secs ;s;= .*;= $MODEL_SECOND,;
+g;input_is_model_advance_file ;s;= .*;= .false.,;
+g;output_is_model_advance_file ;s;= .*;= .false.,;
+g;gregorian_cal ;s;= .*;= .true.;
+wq
+ex_end
+
+foreach FILE ( filter_ics.* )
+
+ ln -svf ${FILE} filter_restart
+ ./restart_file_tool
+ ${MOVE} filter_updated_restart ${FILE}
+
+ ${REMOVE} filter_restart
+end
+
+# Since we have some knowledge of the ensemble size,
+# provide reasonable default values.
+
+ex input.nml <<ex_end
+/filter
+g;ens_size ;s;= .*;= $ensemble_member,;
+g;num_output_state_members ;s;= .*;= $ensemble_member,;
+g;num_output_obs_members ;s;= .*;= $ensemble_member,;
+g;single_restart_file_in ;s;= .*;= .false.,;
+g;single_restart_file_out ;s;= .*;= .false.,;
+wq
+ex_end
+
+#==============================================================================
+# Finish up.
+#==============================================================================
+
+echo
+echo "CENTRALDIR is ${CENTRALDIR}"
+echo "Configure the ${CENTRALDIR}/input.nml"
+echo "Configure the ${CENTRALDIR}/namelist.hrldas"
+echo "execute ${CENTRALDIR}/run_filter.csh"
+echo "Configure ${CENTRALDIR}/wrfinput"
+echo
+
+exit 0
+
+# <next few lines under version control, do not edit>
+# $URL$
+# $Revision$
+# $Date$
+
Property changes on: DART/branches/development/models/noah/shell_scripts/setup_filter.csh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
Modified: DART/branches/development/models/noah/work/input.nml
===================================================================
--- DART/branches/development/models/noah/work/input.nml 2012-08-17 16:53:45 UTC (rev 5849)
+++ DART/branches/development/models/noah/work/input.nml 2012-08-17 20:36:10 UTC (rev 5850)
@@ -52,7 +52,7 @@
/
&filter_nml
- async = 0,
+ async = 2,
adv_ens_command = "./advance_model.csh",
ens_size = 20,
start_from_restart = .true.,
@@ -61,14 +61,14 @@
obs_sequence_out_name = "obs_seq.final",
restart_in_file_name = "filter_ics",
restart_out_file_name = "filter_restart",
- init_time_days = 0,
- init_time_seconds = 0,
+ init_time_days = -1,
+ init_time_seconds = -1,
first_obs_days = -1,
first_obs_seconds = -1,
last_obs_days = -1,
last_obs_seconds = -1,
num_output_state_members = 20,
- num_output_obs_members = 0,
+ num_output_obs_members = 20,
output_interval = 1,
num_groups = 1,
input_qc_threshold = 3.0,
More information about the Dart-dev
mailing list