Commit 8158e290 authored by Carl Schreck's avatar Carl Schreck

Automated Nightly Commit - Tue Jul 9 00:01:20 EDT 2019

parent 2db13886
""" Kick off a series of openlava jobs."""
__author__ = "Carl Schreck"
__email__ = "cjschrec@ncsu.edu"
__copyright__ = "Copyright 2019, North Carolina State University"
__license__ = "BSD-3.0"
import os
import sys
import cjs # '~carl/lib-py'
cjs.tstamp('Here we go!')
# These are some parameters that could be useful to have up top
if len(sys.argv) > 1:
queue = sys.argv[1]
else:
queue = 'allnodes'
print(queue)
py_script = 'wave_phase'
py_dir = os.getcwd()
log_dir = f'{py_dir}/log'
if not os.path.exists(log_dir): os.makedirs(log_dir)
for lon in [100, 120, 140, 160]:
for wave_name in ['mjo', 'kelvin', 'er']:
for var_name in ['olr', 'trmm']:
job_name = f'{py_script}_{var_name}_{wave_name}_{lon}'
cjs.tstamp(job_name)
py_option = f'{wave_name} {var_name} {lon}'
log_file = f'{log_dir}/{job_name}.log'
err_file = f'{log_dir}/{job_name}.err'
if os.path.exists(log_file): os.remove(log_file)
if os.path.exists(err_file): os.remove(err_file)
os.system(f'bsub -J {job_name} -o {log_file} -e {err_file}'
f' -q {queue} -n 1 -R "span[hosts=1]" -W 48:00 -sp 75'
f' ~/template/run_py.sh'
f' {py_dir} {py_script} "{py_option}"')
cjs.tstamp('Thank you, come again.')
#!/bin/bash --login
#if [ -z "$1" ]; then
# QUEUE=`pick_queue`
#else
# QUEUE=$1
#fi
QUEUE=allnodes
echo $QUEUE
PY_SCRIPT=wave_phase
PY_DIR=`pwd`
LOG_DIR=$PY_DIR/log
mkdir -p $LOG_DIR
for lon in 100 120 140 160
do
for wave_name in mjo kelvin er
do
for var_name in olr trmm
do
JOB_NAME=$PY_SCRIPT"_"$var_name"_"$wave_name"_"$lon
echo $JOB_NAME `date`
LOG_FILE=$LOG_DIR/$JOB_NAME.log
ERR_FILE=$LOG_DIR/$JOB_NAME.err
rm $LOG_FILE $ERR_FILE
bsub \
-J $JOB_NAME \
-o $LOG_FILE \
-e $ERR_FILE \
-q $QUEUE \
-n 1 -R "span[hosts=1]" -W 48:00 \
-sp 75 \
py $PY_DIR $PY_SCRIPT
done
done
done
""" Read wave-filtered data for a point/box and calculate four phases based on
standardized value and tendency. """
standardized value and tendency. Arguments: wave_name, var_name, min/max_lon
"""
__author__ = "Carl Schreck"
__email__ = "cjschrec@ncsu.edu"
......@@ -9,14 +10,25 @@ __license__ = "BSD-3.0"
import xarray as xr
import pandas as pd
import os
import sys
import cjs # '~carl/lib-py'
cjs.tstamp('Here we go!')
# These are some parameters that could be useful to have up top
wave_name = 'mjo'
var_name = 'olr'
min_lon = 100
max_lon = 100
if len(sys.argv) > 1:
wave_name = sys.argv[1]
else:
wave_name = 'mjo'
if len(sys.argv) > 2:
var_name = sys.argv[2]
else:
var_name = 'olr'
if len(sys.argv) > 3:
min_lon = float(sys.argv[3])
max_lon = float(sys.argv[3])
else:
min_lon = 100
max_lon = 100
min_lat = -10
max_lat = 10
out_path = 'output/' + var_name + '_' + wave_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment