Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/subseasonal mpmd plots fix #611

40 changes: 28 additions & 12 deletions scripts/plots/subseasonal/exevs_subseasonal_grid2grid_plots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,43 @@ for group in condense_stats filter_stats make_plots tar_images; do
nc=$((nc+1))
done
fi
python $USHevs/subseasonal/subseasonal_copy_job_dir_output.py
export err=$?; err_chk
# Cat the plotting log files
if [ $JOB_GROUP = make_plots ]; then
log_dir=$DATA/${VERIF_CASE}_${STEP}/plot_output/job_work_dir/${JOB_GROUP}/job*/*/*/*/*/logs
else
log_dir=$DATA/${VERIF_CASE}_${STEP}/plot_output/job_work_dir/${JOB_GROUP}/job*/*/*/*/logs
fi
log_file_count=$(find $log_dir -type f |wc -l)
if [[ $log_file_count -ne 0 ]]; then
for log_file in $log_dir/*; do
echo "Start: $log_file"
cat $log_file
echo "End: $log_file"
done
fi
done

# Cat the plotting log files
log_dir=$DATA/${VERIF_CASE}_${STEP}/plot_output/${RUN}.${end_date}/logs
log_file_count=$(find $log_dir -type f |wc -l)
if [[ $log_file_count -ne 0 ]]; then
for log_file in $log_dir/*; do
echo "Start: $log_file"
cat $log_file
echo "End: $log_file"
done
fi
#log_dir=$DATA/${VERIF_CASE}_${STEP}/plot_output/${RUN}.${end_date}/logs
malloryprow marked this conversation as resolved.
Show resolved Hide resolved
#log_file_count=$(find $log_dir -type f |wc -l)
#if [[ $log_file_count -ne 0 ]]; then
#for log_file in $log_dir/*; do
#echo "Start: $log_file"
#cat $log_file
#echo "End: $log_file"
#done
#fi

# Copy files to desired location
if [ $SENDCOM = YES ]; then
# Make and copy tar file
cd $DATA/$VERIF_CASE_STEP/plot_output/${RUN}.${end_date}/images
for VERIF_TYPE_SUBDIR_PATH in $DATA/$VERIF_CASE_STEP/plot_output/$RUN.${end_date}/images/*; do
cd $DATA/$VERIF_CASE_STEP/plot_output/${RUN}.${end_date}/tar_files
for VERIF_TYPE_SUBDIR_PATH in $DATA/$VERIF_CASE_STEP/plot_output/$RUN.${end_date}/tar_files/*; do
VERIF_TYPE_SUBDIR=$(echo ${VERIF_TYPE_SUBDIR_PATH##*/})
cd $VERIF_TYPE_SUBDIR
large_tar_file=${DATA}/${VERIF_CASE_STEP}/plot_output/${RUN}.${end_date}/images/evs.plots.${COMPONENT}.${RUN}.${VERIF_CASE}_${VERIF_TYPE_SUBDIR}.last${NDAYS}days.v${end_date}.tar
large_tar_file=${DATA}/${VERIF_CASE_STEP}/plot_output/${RUN}.${end_date}/tar_files/evs.plots.${COMPONENT}.${RUN}.${VERIF_CASE}_${VERIF_TYPE_SUBDIR}.last${NDAYS}days.v${end_date}.tar
tar -cvf $large_tar_file *.tar
if [ -s $large_tar_file ]; then
cp -v $large_tar_file $COMOUT/.
Expand Down
33 changes: 19 additions & 14 deletions scripts/plots/subseasonal/exevs_subseasonal_grid2obs_plots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,32 @@ for group in condense_stats filter_stats make_plots tar_images; do
nc=$((nc+1))
done
fi
python $USHevs/subseasonal/subseasonal_copy_job_dir_output.py
export err=$?; err_chk
# Cat the plotting log files
if [ $JOB_GROUP = make_plots ]; then
log_dir=$DATA/${VERIF_CASE}_${STEP}/plot_output/job_work_dir/${JOB_GROUP}/job*/*/*/*/*/logs
else
log_dir=$DATA/${VERIF_CASE}_${STEP}/plot_output/job_work_dir/${JOB_GROUP}/job*/*/*/*/logs
fi
log_file_count=$(find $log_dir -type f |wc -l)
if [[ $log_file_count -ne 0 ]]; then
for log_file in $log_dir/*; do
echo "Start: $log_file"
cat $log_file
echo "End: $log_file"
done
fi
done

# Cat the plotting log files
log_dir=$DATA/${VERIF_CASE}_${STEP}/plot_output/${RUN}.${end_date}/logs
log_file_count=$(find $log_dir -type f |wc -l)
if [[ $log_file_count -ne 0 ]]; then
for log_file in $log_dir/*; do
echo "Start: $log_file"
cat $log_file
echo "End: $log_file"
done
fi

# Copy files to desired location
if [ $SENDCOM = YES ]; then
# Make and copy tar file
cd $DATA/$VERIF_CASE_STEP/plot_output/${RUN}.${end_date}/images
for VERIF_TYPE_SUBDIR_PATH in $DATA/$VERIF_CASE_STEP/plot_output/$RUN.${end_date}/images/*; do
cd $DATA/$VERIF_CASE_STEP/plot_output/${RUN}.${end_date}/tar_files
for VERIF_TYPE_SUBDIR_PATH in $DATA/$VERIF_CASE_STEP/plot_output/$RUN.${end_date}/tar_files/*; do
VERIF_TYPE_SUBDIR=$(echo ${VERIF_TYPE_SUBDIR_PATH##*/})
cd $VERIF_TYPE_SUBDIR
large_tar_file=${DATA}/${VERIF_CASE_STEP}/plot_output/${RUN}.${end_date}/images/evs.plots.${COMPONENT}.${RUN}.${VERIF_CASE}_${VERIF_TYPE_SUBDIR}.last${NDAYS}days.v${end_date}.tar
large_tar_file=${DATA}/${VERIF_CASE_STEP}/plot_output/${RUN}.${end_date}/tar_files/evs.plots.${COMPONENT}.${RUN}.${VERIF_CASE}_${VERIF_TYPE_SUBDIR}.last${NDAYS}days.v${end_date}.tar
tar -cvf $large_tar_file *.tar
if [ -s $large_tar_file ]; then
cp -v $large_tar_file $COMOUT/.
Expand Down
13 changes: 8 additions & 5 deletions ush/subseasonal/create_METplus_subseasonal_output_dirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,22 @@
'plot_output')
working_dir_list.append(working_output_base_dir)
working_dir_list.append(
os.path.join(working_output_base_dir,
RUN+'.'+end_date_dt.strftime('%Y%m%d'))
os.path.join(working_output_base_dir, 'job_work_dir')
)
working_dir_list.append(
os.path.join(working_output_base_dir,
RUN+'.'+end_date_dt.strftime('%Y%m%d'),
'logs')
RUN+'.'+end_date_dt.strftime('%Y%m%d'))
)
#working_dir_list.append(
malloryprow marked this conversation as resolved.
Show resolved Hide resolved
#os.path.join(working_output_base_dir,
#RUN+'.'+end_date_dt.strftime('%Y%m%d'),
#'logs')
#)
for VCS_type in VCS_type_list:
working_dir_list.append(
os.path.join(working_output_base_dir,
RUN+'.'+end_date_dt.strftime('%Y%m%d'),
'images', VCS_type)
'tar_files', VCS_type)
)
working_dir_list.append(
os.path.join(working_output_base_dir,
Expand Down
22 changes: 8 additions & 14 deletions ush/subseasonal/subseasonal_copy_job_dir_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
STEP = os.environ['STEP']
COMPONENT = os.environ['COMPONENT']
JOB_GROUP = os.environ['JOB_GROUP']
if STEP == 'plots':
NDAYS = os.environ['NDAYS']

# Copy files to desired location
if STEP == 'stats':
Expand All @@ -44,28 +42,24 @@
if JOB_GROUP == 'condense_stats':
job_wildcard_dir = os.path.join(
job_work_JOB_GROUP_dir, 'job*', f"{RUN}.*", '*',
f"last{NDAYS}days", '*', '*', '*', 'condensed_stats*'
'*', 'model1_*.stat'
)
elif JOB_GROUP == 'filter_stats':
job_wildcard_dir = os.path.join(
job_work_JOB_GROUP_dir, 'job*', f"{RUN}.*", '*',
f"last{NDAYS}days", '*', '*', '*', 'fcst*.stat'
'*', 'fcst*.stat'
)
elif JOB_GROUP == 'make_plots':
job_wildcard_dir = os.path.join(
job_work_JOB_GROUP_dir, 'job*', f"{RUN}.*", '*',
f"last{NDAYS}days", '*', '*', '*', '*', '*.png'
'*', '*', '*.png'
)
elif JOB_GROUP == 'tar_images':
job_wildcard_dir = os.path.join(
job_work_JOB_GROUP_dir, 'job*', f"{RUN}.*", '*',
'*', '*.tar'
)
output_file_JOB_list = glob.glob(job_wildcard_dir)
if STEP == 'plots' and JOB_GROUP == 'make_plots':
job_wildcard_dir2 = os.path.join(
job_work_JOB_GROUP_dir, 'job*', f"{RUN}.*", '*',
f"last{NDAYS}days", '*', '*', '*', '*', '*.gif'
)
output_file_JOB_list = (
output_file_JOB_list
+ glob.glob(job_wildcard_dir2)
)
for output_file_JOB in sorted(output_file_JOB_list, key=len):
output_file_end_path = output_file_JOB.partition(
job_work_JOB_GROUP_dir+'/'
Expand Down
Loading