Skip to content
44 changes: 22 additions & 22 deletions ush/getges.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# sfcges, sfcgm3, sfcgm2, sfcgm1, sfcgp1, sfcgp2, sfcgp3,
# biascr, satang, satcnt, gesfil
# pgbges, pgiges, pgbgm6, pgigm6, pgbgm3, pgigm3, pgbgp3, pgigp3,
# sigcur, sfccur, pgbcur, pgicur, prepqc, tcvg12, tcvges, tcvitl,
# sigcur, sfccur, pgbcur, pgicur, prepqc, tcvg12, tcvges, tcvitl,
# enggrb, enggri, icegrb, icegri, snogrb, snogrb_high, snogri, sstgrb, sstgri.
# natges, natgm3, natgm2, natgm1, natgp1, natgp2, natgp3, natcur,
# nsfges, nsfgm3, nsfgm2, nsfgm1, nsfgp1, nsfgp2, nsfgp3, nsfcur,
Expand All @@ -37,7 +37,7 @@
# The script uses the utility command NHOUR.
#
# Example 1. Copy the production sigma guess for 1998100100 to the file sges.
# getges.sh -e prod -t sigges -v 1998100100 sges
# getges.sh -e prod -t sigges -v 1998100100 sges
#
# Example 2. Assign the pressure grib guess for the date 1998100121.
# export XLFUNIT_12="$(getges.sh -qt pgbges||echo /dev/null)"
Expand Down Expand Up @@ -148,7 +148,7 @@ if [[ $gfile = '?' || $# -gt 1 || $err -ne 0 || -z $valid ||\
echo " gfile is the guess file to write" >&2
echo " (default is to write the guess file name to stdout)" >&2
else
echo " (Note: set a given option to '?' for more details)" >&2
echo " (Note: set a given option to '?' for more details)" >&2
fi
exit 1
fi
Expand All @@ -158,7 +158,7 @@ if [[ $envir != prod && $envir != test && $envir != para && $envir != dump && $e
envir=prod
echo '************************************************************' >&2
echo '* WARNING: Using "-e" is deprecated in this case. *' >&2
echo '* Please use "-n" instead. *' >&2
echo '* Please use "-n" instead. *' >&2
echo '************************************************************' >&2
fi
if [[ "$netwk" = "namopl" || "$resol" = "namopl" ]];then
Expand Down Expand Up @@ -188,13 +188,13 @@ if [[ $typef = enggrb ]];then
typef=icegrb
echo '************************************************************' >&2
echo '* WARNING: Using "-t enggrb" is now deprecated. *' >&2
echo '* Please use "-t icegrb". *' >&2
echo '* Please use "-t icegrb". *' >&2
echo '************************************************************' >&2
elif [[ $typef = enggri ]];then
typef=icegri
echo '************************************************************' >&2
echo '* WARNING: Using "-t enggri" is now deprecated. *' >&2
echo '* Please use "-t icegri". *' >&2
echo '* Please use "-t icegri". *' >&2
echo '************************************************************' >&2
fi

Expand Down Expand Up @@ -224,26 +224,26 @@ if [[ "$netwk" = "gdas" ]];then
$COMINgdas/gdas.t${cyc}z.radstat'
;;
pgbges) geslist='
$COMINgdas/gdas.t${cyc}z.pgrbh$fh
$COMINgdas/gdas.t${cyc}z.pgrbh$fh
$COMINgdas/gdas.t${cyc}z.pgrbf$fh'
;;
pg2ges) geslist='
$COMINgdas/gdas.t${cyc}z.pgrb2.0p25.f$gh'
;;
pgbgm6) geslist='
$COMINgdas/gdas.t${cyc}z.pgrbh$fhm6
$COMINgdas/gdas.t${cyc}z.pgrbh$fhm6
$COMINgdas/gdas.t${cyc}z.pgrbf$fhm6'
;;
pgbgm3) geslist='
$COMINgdas/gdas.t${cyc}z.pgrbh$fhm3
$COMINgdas/gdas.t${cyc}z.pgrbh$fhm3
$COMINgdas/gdas.t${cyc}z.pgrbf$fhm3'
;;
pgbgp3) geslist='
$COMINgdas/gdas.t${cyc}z.pgrbh$fhp3
$COMINgdas/gdas.t${cyc}z.pgrbh$fhp3
$COMINgdas/gdas.t${cyc}z.pgrbf$fhp3'
;;
pgbcur) geslist='
$COMINgdas/gdas.t${cyc}z.pgrbh$fh
$COMINgdas/gdas.t${cyc}z.pgrbh$fh
$COMINgdas/gdas.t${cyc}z.pgrbf$fh'
fhbeg=00
;;
Expand Down Expand Up @@ -446,35 +446,35 @@ elif [[ "$netwk" = "cfs-cdas" ]];then
$COMINcfs_cdas/cdas1.t${cyc}z.sfluxgrbf$fhp3'
;;
pgbges) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbf$fh'
;;
pgiges) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbif$fh'
;;
pgbgm6) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fhm6
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fhm6
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbf$fhm6'
;;
pgigm6) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fhm6
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fhm6
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbif$fhm6'
;;
pgbgm3) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fhm3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fhm3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbf$fhm3'
;;
pgigm3) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fhm3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fhm3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbif$fhm3'
;;
pgbgp3) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fhp3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fhp3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbf$fhp3'
;;
pgigp3) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fhp3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fhp3
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbif$fhp3'
;;
sigcur) geslist='
Expand All @@ -490,12 +490,12 @@ elif [[ "$netwk" = "cfs-cdas" ]];then
fhbeg=00
;;
pgbcur) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbh$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbf$fh'
fhbeg=00
;;
pgicur) geslist='
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbih$fh
$COMINcfs_cdas/cdas1.t${cyc}z.pgrbif$fh'
fhbeg=00
;;
Expand Down Expand Up @@ -1405,7 +1405,7 @@ if [[ -z "$gfile" ]];then
echo ${ges}
err=$?
else
cp ${ges} ${gfile}
cpfs ${ges} ${gfile}
err=$?
fi

Expand Down
48 changes: 24 additions & 24 deletions ush/minmon_xtrct_costs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#---------------------------------------------------------------------------
# minmon_xtrct_costs.pl
#
# Extract cost data from gsistat file and load into cost
# Extract cost data from gsistat file and load into cost
# and cost term files.
#---------------------------------------------------------------------------

Expand Down Expand Up @@ -63,7 +63,7 @@
my $jl_number = 8;

my $costfile = $ENV{"mm_costfile"};

if( (-e $costfile) ) {
open( COSTFILE, "<${costfile}" ) or die "Can't open ${costfile}: $!\n";
my $line;
Expand All @@ -87,7 +87,7 @@

#------------------------------------------------------------------------
# Open the infile and search for the $costterms_target and $cost_target
# strings. If found, parse out the cost information and push into
# strings. If found, parse out the cost information and push into
# holding arrays.
#------------------------------------------------------------------------
if( $rc == 0 ) {
Expand All @@ -107,14 +107,14 @@
$use_costterms = 1;
}

if( $line =~ /$cost_target/ ) {
if( $line =~ /$cost_target/ ) {
my @costline = split( / +/, $line );
push( @cost_array, $costline[$cost_number] );
}

if( $term_ctr > 0 ) {
my @termline = split( / +/, $line );

if ( $term_ctr < 10 ) {
push( @term_array, trim($termline[1]) );
push( @term_array, trim($termline[2]) );
Expand All @@ -132,7 +132,7 @@
push( @term_array, trim($termline[3]) );
push( @term_array, trim($termline[4]) );
$term_ctr = 1;
}
}
}

close( INFILE );
Expand All @@ -145,13 +145,13 @@
for my $i (0 .. $#cost_array) {
my $iterline;
if( $use_costterms == 1 ){
$iterline = sprintf ' %d,%e,%e,%e,%e,%e%s',
$i, $cost_array[$i], $jb_array[$i], $jo_array[$i],
$iterline = sprintf ' %d,%e,%e,%e,%e,%e%s',
$i, $cost_array[$i], $jb_array[$i], $jo_array[$i],
$jc_array[$i], $jl_array[$i], "\n";
}
else {
$iterline = sprintf ' %d,%e,%e,%e,%e,%e%s',
$i, $cost_array[$i], $no_data, $no_data,
$iterline = sprintf ' %d,%e,%e,%e,%e,%e%s',
$i, $cost_array[$i], $no_data, $no_data,
$no_data, $no_data, "\n";
}

Expand All @@ -161,7 +161,7 @@
#---------------------------------------------------
# move term_array into all_cost_terms by iteration
#---------------------------------------------------
if( @term_array > 0 ) {
if( @term_array > 0 ) {
my $nterms = 32;
my $max_iter = ($#term_array+1)/$nterms;
my $niter = $max_iter -1;
Expand All @@ -170,18 +170,18 @@
my $step = $iter * $nterms;
my $iterline = sprintf '%d, %e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e%s',
$iter, $term_array[$step], $term_array[$step+1], $term_array[$step+2],
$term_array[$step+3], $term_array[$step+4], $term_array[$step+5],
$term_array[$step+6], $term_array[$step+7], $term_array[$step+8],
$term_array[$step+9], $term_array[$step+10], $term_array[$step+11],
$term_array[$step+12], $term_array[$step+13], $term_array[$step+14],
$term_array[$step+15], $term_array[$step+16], $term_array[$step+17],
$term_array[$step+18], $term_array[$step+19], $term_array[$step+20],
$term_array[$step+21], $term_array[$step+22], $term_array[$step+23],
$term_array[$step+24], $term_array[$step+25], $term_array[$step+26],
$term_array[$step+27], $term_array[$step+28], $term_array[$step+29],
$term_array[$step+3], $term_array[$step+4], $term_array[$step+5],
$term_array[$step+6], $term_array[$step+7], $term_array[$step+8],
$term_array[$step+9], $term_array[$step+10], $term_array[$step+11],
$term_array[$step+12], $term_array[$step+13], $term_array[$step+14],
$term_array[$step+15], $term_array[$step+16], $term_array[$step+17],
$term_array[$step+18], $term_array[$step+19], $term_array[$step+20],
$term_array[$step+21], $term_array[$step+22], $term_array[$step+23],
$term_array[$step+24], $term_array[$step+25], $term_array[$step+26],
$term_array[$step+27], $term_array[$step+28], $term_array[$step+29],
$term_array[$step+30], $term_array[$step+31], "\n";
push( @all_cost_terms, $iterline );
}
}
}

#------------------------------------------
Expand Down Expand Up @@ -210,15 +210,15 @@
my $tankdir = $ENV{"M_TANKverf"};
if(! -d $tankdir) {
system( "mkdir -p $tankdir" );
}
}

if( -e $filename2 ) {
my $newfile2 = "${tankdir}/${filename2}";
system("cp -f $filename2 $newfile2");
system("cpfs $filename2 $newfile2");
}
if( -e $filename3 ) {
my $newfile3 = "${tankdir}/${filename3}";
system("cp -f $filename3 $newfile3");
system("cpfs $filename3 $newfile3");
}

} # $rc still == 0 after reading gmon_cost.txt
Expand Down
Loading