diff --git a/src/Conventional_Monitor/data_extract/ush/ConMon_DE.sh b/src/Conventional_Monitor/data_extract/ush/ConMon_DE.sh index e02b9387..461add5b 100755 --- a/src/Conventional_Monitor/data_extract/ush/ConMon_DE.sh +++ b/src/Conventional_Monitor/data_extract/ush/ConMon_DE.sh @@ -145,16 +145,9 @@ echo "CNVSTAT_LOCATION = $CNVSTAT_LOCATION" export COMPONENT=${COMPONENT:-atmos} -# -# Is there any difference in location from ops to wkfl? -# - export C_DATDIR=${C_DATDIR:-${CNVSTAT_LOCATION}/${RUN}.${PDY}/${CYC}/${COMPONENT}} export C_GDATDIR=${C_GDATDIR:-${CNVSTAT_LOCATION}/${RUN}.${PDYm6h}/${GCYC}/${COMPONENT}} -echo "C_DATDIR = $C_DATDIR" -echo "C_GDATDIR = $C_GDATDIR" - export C_COMIN=${C_DATDIR} export C_COMINm6h=${C_GDATDIR} diff --git a/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh b/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh index f36a790d..9ecda11b 100755 --- a/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh +++ b/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh @@ -20,7 +20,7 @@ function usage { echo " Suffix is the indentifier for this data source." echo " " echo " -p | --pdate yyyymmddcc to specify the cycle to be plotted." - echo " If not specified pdate will be set using the " + echo " If not specified, pdate will be set using the " echo " C_IMGNDIR/last_plot_time file, and if that doesn't" echo " exist, then the last available date will be plotted." echo " " @@ -137,9 +137,8 @@ fi echo "C_IG_SCRIPTS = ${C_IG_SCRIPTS}" echo "C_TANKDIR = ${C_TANKDIR}" -last_cycle=`${C_IG_SCRIPTS}/find_cycle.pl \ - --cyc 1 --dir ${C_TANKDIR} --run ${RUN}` - +last_cycle=`${MON_USH}/find_last_cycle.sh --net ${CONMON_SUFFIX} \ + --run ${RUN} --tank ${TANKDIR} --mon conmon` if [[ ${PDATE} = "" ]]; then @@ -191,9 +190,7 @@ if [[ $PDATE -le ${last_cycle} ]]; then #-------------------------------------------------------------------- # Update the last_plot_time file if found #-------------------------------------------------------------------- - echo C_IMGNDIR = $C_IMGNDIR if [[ -e ${C_IMGNDIR}/last_plot_time ]]; then - echo "update last_plot_time file" echo ${PDATE} > ${C_IMGNDIR}/last_plot_time fi diff --git a/src/Conventional_Monitor/image_gen/ush/Transfer.sh b/src/Conventional_Monitor/image_gen/ush/Transfer.sh index 2ed5b4cb..f9d58142 100755 --- a/src/Conventional_Monitor/image_gen/ush/Transfer.sh +++ b/src/Conventional_Monitor/image_gen/ush/Transfer.sh @@ -80,14 +80,14 @@ export jobname=transfer_${CONMON_SUFFIX}_conmon # and leave it to the user to manually transfer files to # the server. # -if [[ $MY_MACHINE = "wcoss2" ]]; then +if [[ ${MY_MACHINE} = "wcoss2" ]]; then - $SUB -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${errfile} \ + ${SUB} -q ${JOB_QUEUE} -A ${ACCOUNT} -o ${logfile} -e ${errfile} \ -V -l select=1:mem=500M -l walltime=45:00 -N ${jobname} \ ${C_IG_SCRIPTS}/transfer_imgs.sh else - echo "Unable to transfer files from $MY_MACHINE to $WEBSVR." + echo "Unable to transfer files from ${MY_MACHINE} to ${WEBSVR}." echo "Manual intervention is required." fi diff --git a/src/Conventional_Monitor/image_gen/ush/find_cycle.pl b/src/Conventional_Monitor/image_gen/ush/find_cycle.pl deleted file mode 100755 index 0fbd5393..00000000 --- a/src/Conventional_Monitor/image_gen/ush/find_cycle.pl +++ /dev/null @@ -1,208 +0,0 @@ -#! /usr/bin/perl - -#----------------------------------------------------------------------- -# find_cycle.pl -# -# Arguments: -# --dir : Required string value containing $TANKdir/$SUFFIX. -# --cyc : Optional integer value: -# 1 = last cycle (default) -# 0 = first cycle -# --run : Run name, generally 'gdas' or 'gfs'. -# If not specified 'gdas' will be used. -# -# Return that first/last cycle as a text string in YYYYMMDDHH format, -# or return nothing if none of the expected data files are found. -# -# Note that this is designed to be used by a shell script which will -# pick up the returned cycle string. If debug statements are left -# in this perl script then the calling shell script will have -# problems. -#----------------------------------------------------------------------- - - use strict; - use warnings; - use Getopt::Long; - use Scalar::Util qw(looks_like_number); - - - #------------------------------------------------------------------- - # - # Subroutine uniq - # - # Given an input array, return all unique values in an array. - # - #------------------------------------------------------------------- - sub uniq { - my %seen; - return grep { !$seen{$_}++ } @_; - } - - - ##------------------------------------------------------------------ - ##------------------------------------------------------------------ - ## - ## begin main - ## - ##------------------------------------------------------------------ - ##------------------------------------------------------------------ - - my $run = 'gdas'; - my $dir = ''; - my $lcm = 'conmon'; - my $cyc = '1'; - - GetOptions( 'cyc:i' => \$cyc, - 'run:s' => \$run, - 'dir=s' => \$dir, - 'lcm:s' => \$lcm ); - - my @alldirs; - my $dirpath = $dir; - - #-------------------------------------------------------------------- - # Get list of $run.* directories which contain conmon subdirectories - # - opendir(DIR, $dirpath) or die "Cannot open directory $!"; - while (my $file = readdir(DIR)) { - next unless (-d "$dirpath/$file"); - push( @alldirs, $file ); - } - closedir DIR; - - my $search_string; - - if( length($run) == 0 ){ - $search_string = $lcm; - } else { - $search_string = $run; - } - - my @mmdirs = grep { /$search_string/ } @alldirs; - #----------------------------------------------------------------------- - # If there are no $run.yyyymmdd subdirectories, then exit without - # returning any date string. - # - if( $#mmdirs < 0 ) { - print "exiting with 0 mmdirs\n"; - exit; - } - - - #----------------------------------------------------------------------- - # Sort the mmdirs array and loop through it from end to beginning - # - - my @sortmm = sort( @mmdirs ); - - my $ctr; - my $incr; - my $end_ctr; - my @hrs; - - #----------------------------------------------------------------------- - # Arrange the logic here for accessing either the first or last - # cycle. If we're after the first cycle the directories will be - # processed from 0 to max. Note below the cycle hours are processed - # from max to 0, so the cycle order is reversed (18..00) when looking - # for the first cycle. - # - if( $cyc == 0 ){ - $ctr = -1; - $incr = 1; - $end_ctr = $#sortmm; - @hrs = qw( 18 12 06 00 ); - } else { - $ctr = $#sortmm + 1; - $incr = -1; - @hrs = qw( 00 06 12 18 ); - $end_ctr = 0; - } - - - my $found_cycle = 0; - - # Start with the latest directory and attempt to locate monitor - # subdirectories. - # - - my $exit_flag = 0; - - do { - $ctr = $ctr + $incr; - - # In each subdirectory attempt to locate all *stas* files - # and parse out all unique date values. The latest is the answer - # we're looking for. - # - # If there are no *stas* files, step to the next iteration. - # - - my $newdir; - my $hr_ctr = $#hrs + 1; - - do { - - $hr_ctr = $hr_ctr - 1; - - $newdir = "${dirpath}/${sortmm[$ctr]}/${hrs[$hr_ctr]}/${lcm}/time_vert"; - - - if( -d $newdir ) { - opendir DIR, $newdir or die "Cannot open the current directory: $!"; - - my @timefiles = grep { /stas/ && !/ctl/ } readdir DIR; - - if( $#timefiles >= 0 ) { - my @sorttime = sort( @timefiles ); - my @times; - my $idx = 0; - - # Find the first string of 10 digits; that's the date. Use that - # $idx number to process all files. - # - my @vals = split( '\.', $timefiles[0] ); - for ( my $ii=$#vals; $ii >= 0; $ii-- ) { - if( looks_like_number( $vals[$ii] ) && length($vals[$ii] ) == 10 ){ - $idx = $ii; - } - } - - for ( my $ii=$#sorttime; $ii >= 0; $ii-- ) { - my $teststr = $sorttime[$ii]; - - my @values = split( '\.', $teststr ); - if( length($values[$idx] ) == 10 ){ - push( @times, $values[$idx] ); - } - } - - if ( $#times >= 0 ) { - my @utimes = sort( uniq( @times ) ); - if( $cyc == 1 ) { - print "$utimes[$#utimes]"; - $found_cycle = 1; - } elsif( $cyc == 2 && $#utimes >= 1 ) { - print "$utimes[$#utimes-1]"; - $found_cycle = 1; - } else { - print "$utimes[0]"; - $found_cycle = 1; - } - } - } - - } - - } while $hr_ctr > 0 && $found_cycle == 0; - - - if( $cyc == 0 && $ctr >= $end_ctr ){ - $exit_flag = 1; - } elsif( $cyc == 1 && $ctr <= $end_ctr ){ - $exit_flag = 1; - } - - - } while $found_cycle == 0 && $exit_flag == 0; - diff --git a/src/Conventional_Monitor/image_gen/ush/mk_time_vert.sh b/src/Conventional_Monitor/image_gen/ush/mk_time_vert.sh index 691f6d1e..3429c2c4 100755 --- a/src/Conventional_Monitor/image_gen/ush/mk_time_vert.sh +++ b/src/Conventional_Monitor/image_gen/ush/mk_time_vert.sh @@ -33,7 +33,6 @@ echo "--> mk_time_vert.sh" -p ${SERVICE_PARTITION} -J ${jobname} -o ${logfile} ${pltfile} elif [[ ${MY_MACHINE} = "wcoss2" ]]; then - echo "submitting $jobname" $SUB -V -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} -l walltime=50:00 -N ${jobname} \ -l select=1:mem=200M ${pltfile} fi @@ -57,7 +56,7 @@ echo "--> mk_time_vert.sh" fi if [[ ${MY_MACHINE} == "hera" || ${MY_MACHINE} == "s4" || \ - ${MY_MACHINE} == "jet" || ${MY_MACHINE} = "orion" ]]; then + ${MY_MACHINE} == "jet" || ${MY_MACHINE} == "orion" ]]; then if [[ ${type} == "uv" || ${type} == "u" || ${type} == "v" ]]; then walltime="02:30:00" else @@ -69,11 +68,10 @@ echo "--> mk_time_vert.sh" elif [[ ${MY_MACHINE} = "wcoss2" ]]; then if [[ ${type} == "uv" || ${type} == "u" || ${type} == "v" ]]; then - walltime="01:30:00" + walltime="02:00:00" else walltime="50:00" fi - echo "submitting $jobname" $SUB -V -q ${JOB_QUEUE} -A ${ACCOUNT} -o ${logfile} -e ${logfile} -l walltime=${walltime}\ -N ${jobname} -l select=1:mem=200M ${pltfile} @@ -113,7 +111,6 @@ echo "--> mk_time_vert.sh" -p ${SERVICE_PARTITION} -J ${jobname} -o ${logfile} ${pltfile} elif [[ ${MY_MACHINE} == "wcoss2" ]]; then - echo "submitting $jobname" ${SUB} -V -q ${JOB_QUEUE} -A ${ACCOUNT} -o ${logfile} -e ${logfile} -l walltime=50:00 \ -N ${jobname} -l select=1:mem=500M ${pltfile} diff --git a/src/Conventional_Monitor/parm/ConMon_config b/src/Conventional_Monitor/parm/ConMon_config index 201b4cbd..395b858a 100644 --- a/src/Conventional_Monitor/parm/ConMon_config +++ b/src/Conventional_Monitor/parm/ConMon_config @@ -23,9 +23,6 @@ export WEBDIR=${WEBDIR:-/home/people/emc/www/htdocs/gmb/gdas/es_conv} # TANKDIR is the location for the extracted data files and # the control files used for image plotting. # -#export CONMON_TANKDIR=/u/Edward.Safford/nbns -#export C_TANKverf=${C_TANKverf:-${CONMON_TANKDIR}} - export C_TANKDIR=${TANKDIR}/stats/${CONMON_SUFFIX} export C_IMGNDIR=${TANKDIR}/imgn/${CONMON_SUFFIX}/${RUN}/conmon @@ -88,28 +85,16 @@ export C_STMP_USER=${C_STMP_USER:-${MON_STMP}/${LOGNAME}} export C_PTMP_USER=${C_PTMP_USER:-${MON_PTMP}/${LOGNAME}} export C_LOGDIR=${MON_LOGDIR}/${CONMON_SUFFIX}/${RUN}/conmon -#export WORK_conmon=${WORK_conmon:-${C_STMP_USER}/${CONMON_SUFFIX}/${RUN}/ConMon} +export CONMON_IMAGE_GEN=${CONMON_IMAGE_GEN:-${MY_CONMON}/image_gen} -# export CONMON_DATA_EXTRACT=${CONMON_DATA_EXTRACT:-${MY_CONMON}/data_extract} -# export C_DE_EXEC=${C_DE_EXEC:-${CONMON_DATA_EXTRACT}/exec} -# export C_DE_PARM=${C_DE_PARM:-${CONMON_DATA_EXTRACT}/parm} -# export C_DE_SCRIPTS=${C_DE_SCRIPTS:-${CONMON_DATA_EXTRACT}/ush} -# - export CONMON_IMAGE_GEN=${CONMON_IMAGE_GEN:-${MY_CONMON}/image_gen} -# export C_IG_EXEC=${C_IG_EXEC:-${CONMON_IMAGE_GEN}/exec} - export C_IG_GSCRIPTS=${C_IG_GSCRIPTS:-${CONMON_IMAGE_GEN}/gscripts} -# export C_IG_PARM=${C_IG_PARM:-${CONMON_IMAGE_GEN}/parm} - export C_IG_SCRIPTS=${C_IG_SCRIPTS:-${CONMON_IMAGE_GEN}/ush} - export C_IG_FIX=${C_IG_FIX:-${CONMON_IMAGE_GEN}/fix} -# export C_IG_HTML=${C_IG_HTML:-${CONMON_IMAGE_GEN}/html} -# export C_IG_SAVE_WORK=${C_IG_SAVE_WORK:-1} # switch to save plot work directories -# -# export CONMON_PARM=${CONMON_PARM:-${MY_CONMON}/parm} +export C_IG_GSCRIPTS=${C_IG_GSCRIPTS:-${CONMON_IMAGE_GEN}/gscripts} +export C_IG_SCRIPTS=${C_IG_SCRIPTS:-${CONMON_IMAGE_GEN}/ush} +export C_IG_FIX=${C_IG_FIX:-${CONMON_IMAGE_GEN}/fix} - export HOMEconmon_shared=${HOMEconmon_shared:-${MY_CONMON}/nwprod/conmon_shared} - export HOMEgdas_conmon=${HOMEgdas_conmon:-${MY_CONMON}/nwprod/gdas_conmon} - export HOMEgfs_conmon=$HOMEgdas_conmon +export HOMEconmon_shared=${HOMEconmon_shared:-${MY_CONMON}/nwprod/conmon_shared} +export HOMEgdas_conmon=${HOMEgdas_conmon:-${MY_CONMON}/nwprod/gdas_conmon} +export HOMEgfs_conmon=$HOMEgdas_conmon - export USHconmon=${USHconmon:-${HOMEconmon_shared}/ush} - export EXECconmon=${EXECconmon:-${GSI_MON_BIN}} +export USHconmon=${USHconmon:-${HOMEconmon_shared}/ush} +export EXECconmon=${EXECconmon:-${GSI_MON_BIN}}