Skip to content

Commit

Permalink
Github issue #265, MinMon maintenance update. Completes #265.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardSafford-NOAA committed Jan 13, 2022
1 parent 9e765da commit 63963a9
Show file tree
Hide file tree
Showing 62 changed files with 685 additions and 2,877 deletions.
31 changes: 23 additions & 8 deletions util/Minimization_Monitor/MinMon_install.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#
# This script makes sets all configuration definitions
# and calls the makeall.sh script to build all the necessary
# executables. This script works for wcoss, wcoss_d, cray, and
# hera.
# executables. This script works for wcoss, wcoss_d, cray, hera,
# and wcoss2.
#
#-------------------------------------------------------------------

Expand All @@ -16,7 +16,7 @@
my $machine = `/usr/bin/perl get_hostname.pl`;
my $my_machine="export MY_MACHINE=$machine";

if( $machine ne "hera" && $machine ne "wcoss" &&
if( $machine ne "hera" && $machine ne "wcoss" && $machine ne "wcoss2" &&
$machine ne "wcoss_d" && $machine ne "cray" ) {
die( "ERROR --- Unrecognized machine hostname, $machine. Exiting now...\n" );
}
Expand Down Expand Up @@ -61,6 +61,9 @@
elsif( $machine eq "wcoss_d" ){
$tankdir = "/gpfs/dell2/emc/modeling/noscrub/$user_name/nbns";
}
elsif( $machine eq "wcoss2" ){
$tankdir = "/lfs/h2/emc/da/noscrub/$user_name/nbns";
}
else {
$tankdir = "/global/save/$user_name/nbns";
}
Expand Down Expand Up @@ -148,6 +151,10 @@
$my_ptmp="export MY_PTMP=\${MY_PTMP:-/gpfs/dell2/ptmp/$user_name}";
$my_stmp="export MY_STMP=\${MY_STMP:-/gpfs/dell2/stmp/$user_name}";
}
elsif( $machine eq "wcoss2" ) {
$my_ptmp="export MY_PTMP=\${MY_PTMP:-/lfs/h2/emc/ptmp/$user_name}";
$my_stmp="export MY_STMP=\${MY_STMP:-/lfs/h2/emc/stmp/$user_name}";
}
elsif( $machine eq "hera" ) {
$ptmp = "/scratch2/NCEPDEV/stmp3/${user_name}";
print "Please specify PTMP location. This is used for temporary work space.\n";
Expand Down Expand Up @@ -185,8 +192,6 @@
print "\n\n";
sleep( 1 );

# $my_ptmp="export MY_PTMP=\${MY_PTMP:-/scratch2/NCEPDEV/stmp3/${user_name}}";
# $my_stmp="export MY_STMP=\${MY_STMP:-/scratch2/NCEPDEV/stmp1/${user_name}}";
}

#
Expand Down Expand Up @@ -232,7 +237,7 @@
#
# Web directory
#
my $webdir = "/home/people/emc/www/htdocs/gmb/gdas/radiance/${webuser}/gsi_stat/pngs";
my $webdir = "/home/people/emc/www/htdocs/gmb/gdas/gsi_stat/pngs";
print "Please specify the top level web site directory $server.\n";
print " Return to accept default directory location or enter new location.\n";
print " \n";
Expand Down Expand Up @@ -306,7 +311,13 @@
#
# project definition
#
my $project = "GDAS-T2O";
my $project = "GDAS-DEV";
if( $machine eq "wcoss_d" ) {
$project = "GFS-DEV";
} elsif( $machine eq "cray" ){
$project = "GDAS-T2O"
}

my $my_project = "";

if( $machine eq "hera" ) {
Expand All @@ -333,6 +344,9 @@
# job queue definition
#
my $job_queue = "dev_shared";
if( $machine eq "wcoss2" ) {
$job_queue = "dev";
}
my $my_job_queue = "";

if( $machine eq "hera" ) {
Expand All @@ -348,6 +362,7 @@
if( length($new_queue ) > 0 ) {
$job_queue = $new_queue;
}

$my_job_queue="export JOB_QUEUE=\${JOB_QUEUE:-$job_queue}";
print "my_job_queue = $my_job_queue\n";
print "\n\n";
Expand All @@ -369,7 +384,7 @@
elsif( $_ =~ "export PROJECT" ){
print $out "$my_project\n";
}
elsif( $line =~ "export JOB_QUEUE" ){
elsif( $_ =~ "export JOB_QUEUE" ){
print $out "$my_job_queue\n";
}
else {
Expand Down
128 changes: 128 additions & 0 deletions util/Minimization_Monitor/data_xtrct/ush/MinMon_CP.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/bin/bash

# MinMon data copy script

#--------------------------------------------------------------------
# usage
#--------------------------------------------------------------------
function usage {
echo "Usage: MinMon_CP.sh suffix [-p|--pdate pdate -r|--run gdas|gfs]"
echo " Suffix is the indentifier for this data source."
echo " -p | --pdate yyyymmddcc to specify the cycle to be processed"
echo " if unspecified the last available date will be processed"
echo " -r | --run the gdas|gfs run to be processed"
echo " use only if data in TANKdir stores both runs"
echo " -d | --data base location of minmon data without any"
echo " date-dependent subdirectories"
echo " "
}

#--------------------------------------------------------------------
# MinMon_DE.sh begins here
#--------------------------------------------------------------------

set -x

nargs=$#
if [[ $nargs -lt 1 || $nargs -gt 7 ]]; then
usage
exit 1
fi

#-----------------------------------------------
# Process command line arguments
#
while [[ $# -ge 1 ]]
do
key="$1"
echo $key

case $key in
-p|--pdate)
pdate="$2"
shift # past argument
;;
-r|--run)
run="$2"
shift # past argument
;;
-d|--data) # base location of minmon data
data="$2"
shift # past argument
;;
*)
#any unspecified key is MINMON_SUFFIX
export MINMON_SUFFIX=$key
;;
esac

shift
done

if [[ $data = "" ]]; then
data=/gpfs/dell1/nco/ops/com/gfs/prod
fi

if [[ $run = "" ]]; then
run=gdas
fi

#-----------------------------------
# source config and settings files
#
this_dir=`dirname $0`
top_parm=${this_dir}/../../parm

minmon_config=${minmon_config:-${top_parm}/MinMon_config}
if [[ ! -e ${minmon_config} ]]; then
echo "Unable to locate ${minmon_config} file"
exit 3
fi

. ${minmon_config}
if [[ $? -ne 0 ]]; then
echo "Error detected while sourcing ${minmon_config} file"
exit $?
fi


minmon_user_settings=${minmon_user_settings:-${top_parm}/MinMon_user_settings}
if [[ ! -e ${minmon_user_settings} ]]; then
echo "Unable to locate ${minmon_user_settings} file"
exit 4
fi

. ${minmon_user_settings}
if [[ $? -ne 0 ]]; then
echo "Error detected while sourcing ${minmon_user_settings} file"
exit $?
fi


tank=${M_TANKverf}/stats/${MINMON_SUFFIX}

echo NDATE = $NDATE
if [[ $pdate = "" ]]; then
ldate=`${this_dir}/find_cycle.pl --cyc 1 --dir ${tank} --run ${run}`
echo ldate = $ldate
pdate=`${NDATE} +06 $ldate`
fi

echo pdate = $pdate

pdy=`echo $pdate|cut -c1-8`
cyc=`echo $pdate|cut -c9-10`

data_loc=${data}/${run}.${pdy}/${cyc}/atmos/minmon
tank=${tank}/${run}.${pdy}/${cyc}/minmon
mkdir -p ${tank}

if [[ ! -d ${data_loc} ]]; then
echo "Unable to copy, ${data_loc} not found"
exit 5
fi

cp ${data_loc}/*${pdate}* ${tank}/.
cp ${data_loc}/gnorm_data.txt ${tank}/.


Loading

0 comments on commit 63963a9

Please sign in to comment.