[Dart-dev] DART/branches Revision: 13100
dart at ucar.edu
dart at ucar.edu
Fri Apr 5 10:16:15 MDT 2019
raeder at ucar.edu
2019-04-05 10:16:14 -0600 (Fri, 05 Apr 2019)
478
This is a draft of a script to run obs_diag and matlab (noninteractively)
as either a batch job or called from a near future, repackaging script
for the Reanalysis (CAM6 forcing) output.
It operates within the user's $archive/esp/hist directory.
It harvests a list of obs_types from
input.nml:{assimilate,evaluate}_these_obs_types
and generates a matlab script to process them.
Parts have been tested offline, but it has not been tested on a
series of obs_seq.final files.
Added: DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/obs_diags.csh
===================================================================
--- DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/obs_diags.csh (rev 0)
+++ DART/branches/reanalysis/models/cam-fv/shell_scripts/cesm2_1/obs_diags.csh 2019-04-05 16:16:14 UTC (rev 13100)
@@ -0,0 +1,281 @@
+#!/bin/tcsh
+
+#BSUB -n 1
+#BSUB -R "span[ptile=1]"
+#BSUB -W 1:30
+#BSUB -q casper
+#BSUB -P P86850054
+#BSUB -N
+#BSUB -u raeder at ucar.edu
+#BSUB -o obs_diags.%J
+#BSUB -e obs_diags.%J
+#BSUB -J obs_diags
+#-----------------------------------------
+#PBS -N obs_diags
+#PBS -A P86850054
+#PBS -q casper
+# Resources I want:
+# select=#nodes
+# ncpus=#CPUs/node
+# mpiprocs=#MPI_tasks/node
+#PBS -l select=1:ncpus=1:mpiprocs=1
+#PBS -l walltime=02:00:00
+# Send email after a(bort) or e(nd)
+#PBS -m ae
+#PBS -M raeder at ucar.edu
+# Send standard output and error to this file.
+# It's helpful to use the $casename here.
+#PBS -o obs_diags.eo
+#PBS -j oe
+#--------------------------------------------
+
+# DART software - Copyright 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
+
+# DART $Id$
+
+# This script feeds a series of obs_seq.final files to obs_diag,
+# which processes them according to its namelist.
+# The resulting obs_diag_output.nc is fed to matlab to generate observation space plots
+# according to the script which is defined in this script.
+# It can be run as a batch job, or called by a batch job,
+# because it can take longer than is allowed on many systems' login nodes.
+# It can be run interactively for smaller jobs.
+
+if ($#argv == 0) then
+ # User submitted, independent batch job (not run by another batch job).
+ # CASE could be replaced by setup_*, as is done for DART_config.
+ set arch_dir = /glade/scratch/${USER}/CASE/archive/esp/hist
+ set date_string = '2017-03'
+ set output_dir = Diags_NTrS_2017.3.1-2017.4.1H0_s0
+# Diags_NTrS_2017.3.1-2017.4.1H0_s0
+# ^ ^ ^ ^
+# | | | Skip first N cycles for vert profiles
+# | | | (or other details)
+# | Start, end dates
+# Domains
+
+else if ($#argv == 1) then
+ # Request for help; any argument will do.
+ echo "Usage: call by user or script:"
+ echo " obs_diags.csh arch_dir 'date_string' output_dir [dart_dir]"
+ echo " arch_dir = directory where $case.dart.e.cam_obs_seq_final.$date.nc are"
+ echo " date_string = cshell regular expression which selects the files, e.g. '2017-03-[01]',"
+ echo " or set manually in the script."
+ echo " output_dir = directory where output from obs_diag and matlab will be put."
+ echo " I give it a name that will distinguish it from other obs space output"
+ echo " in the same arch_dir."
+ echo " dart_dir = optional local DART code root."
+
+else
+ # Script run by another (batch) script or interactively.
+ set arch_dir = $1
+ set date_string = "$2"
+ set output_dir = $3
+ # DART could be filled by setup_*, as is done for DART_config.
+ if ($#argv == 4)
+ set DART = $4
+ else
+ set DART = ~/DART/reanalysis
+ endif
+
+# echo 'Two scripts are required to generate observation space diagnostics '
+# echo 'from obs_seq.[dates].final files; this one and ~/Scripts/matlab_cesm.csh.'
+# echo '1) Go to the $EXEDIR directory, which contains the run directory.'
+# echo '2) If needed, make a directory, e.g. "Obs_seq_final", to hold the obs_seq.final files.'
+# echo '3) Link (or copy: >hsi >cd hsi_dir >get obs*) the obs_seq.final files into Obs_seq_final.'
+# echo '4) In EXEDIR run this script, giving it the directory where'
+# echo ' the diagnostics will be created and Obs_seq_final (no ../):'
+# echo ' > > > ~/Scripts/diags_cesm.csh Diag_[details]_[dates] Obs_seq_final < < < '
+# echo '5) Go to the diag_[dates] directory. '
+# echo '6) Execute ~/Scripts/matlab_cesm.csh'
+# exit
+# endif
+endif
+
More information about the Dart-dev
mailing list