Commit 88618560 authored by saeed's avatar saeed
Browse files

new version

parent de5f54bc
......@@ -4,8 +4,8 @@
##SBATCH -e err
##SBATCH -o log
module add odb/1.0.3
module add odb_api/0.19.0
module add odb/1.0.3
module add odb_api/0.19.1
function getyear(){
time_d=${1}
......@@ -78,13 +78,23 @@ function do_filter(){
fi
}
do_era5=0
do_era5=1
do_precise=1
PRECISE_ODB_DIR="/scratch/ms/se/smdk/scratchdir/"
use_report_file=1
PRECISE_ODB_DIR="/scratch/ms/se/smdk/scratchdir/"
OUTPUT_DIR="/home/ms/se/smdk/odb_panel/OUTPUT"
OUTPUT_DIR="OUTPUT"
list_report=(16001 16005)
list_report=[]
if [ ${use_report_file} -eq 1 ];then
if [ ! -f report_type_list ];then
echo "please provide the file named report_type_list"
exit
fi
list_report=(`cat report_type_list`)
else
list_report=(16001 16005)
fi
startdate="2017-01-01"
enddate="2017-01-05"
time_cycle="00,12"
......@@ -127,9 +137,9 @@ if [ ${do_era5} -eq 1 ];then
sed -e "s/<reptype>/${vr}/g" -e "s/<time_cycle>/${time_cycle_out}/g" -e "s/<startdate_out>/${startdate_out}/g" -e "s/<enddate_out>/${enddate_out}/g" -e "s/<startdate>/${startdate}/g" -e "s/<enddate>/${enddate}/g" request_odb_temp_era5 > request_odb_temp
mars request_odb_temp
do_filter ${fin}
rm -f ${fin}
rm -f ${fin} 2>/dev/null
mv ${fout} ${OUTPUT_DIR} 2>/dev/null
rm -f request_odb_temp
rm -f request_odb_temp 2>/dev/null
else
echo "${OUTPUT_DIR}/${fout} already exists"
fi
......@@ -157,16 +167,29 @@ if [ ${do_precise} -eq 1 ];then
cd ${mon}
HERE_P=`pwd`
for j in ${!list_report[*]};do
report_type=${list_report[j]}
nc=`echo ${time_cycle} | awk -F',' '{print NF}'`
for nf in `seq 1 ${nc}`;do
vb=`echo ${time_cycle} | cut -d, -f${nf}`
fout="odb_precise_${report_type}_${startdate_out}_${enddate_out}_cycle${vb}.txt"
if [ -f ${OUTPUT_DIR}/${fout} ];then
echo "file ${OUTPUT_DIR}/${fout} already exist"
fi
done
done
for j in ${!list_report[*]};do
cd ${HERE_P}
report_type=${list_report[j]}
nc=`echo ${time_cycle} | awk -F',' '{print NF}'`
fout="odb_precise_${report_type}_${startdate_out}_${enddate_out}_cycle${vb}.txt"
if [ ! -f ${OUTPUT}/${fout} ];then
for va in ${drange[*]};do
echo "va " ${va}
for nf in `seq 1 ${nc}`;do
vb=`echo ${time_cycle} | cut -d, -f${nf}`
for nf in `seq 1 ${nc}`;do
vb=`echo ${time_cycle} | cut -d, -f${nf}`
fout="odb_precise_${report_type}_${startdate_out}_${enddate_out}_cycle${vb}.txt"
if [ ! -f ${OUTPUT_DIR}/${fout} ];then
for va in ${drange[*]};do
echo "va " ${va}
if [ -d "${va}"/"${vb}"/odb_ccma/CCMA ];then
cd "${va}"/"${vb}"/odb_ccma/CCMA
dcagen
......@@ -176,25 +199,18 @@ if [ ${do_precise} -eq 1 ];then
cd ${HERE_P}
done
cd ${HERE_P}
done
cd ${HERE_P}
nc=`echo ${time_cycle} | awk -F',' '{print NF}'`
for nf in `seq 1 ${nc}`;do
vb=`echo ${time_cycle} | cut -d, -f${nf}`
fout="odb_precise_${report_type}_${startdate_out}_${enddate_out}_cycle${vb}.txt"
for va in ${drange[*]};do
if [ -d ${va}/${vb}/odb_ccma/CCMA ];then
cd ${va}/${vb}/odb_ccma/CCMA
if [ -f odb_precise_${report_type}_${vb}.txt ];then
sed '1d' odb_precise_${report_type}_${vb}.txt >> ${fout}
sed '1d' odb_precise_${report_type}_${vb}.txt >> ${OUTPUT_DIR}/${fout}
fi
fi
cd ${HERE_P}
done
cd ${HERE_P}
if [ -f ${fout} ];then mv ${fout} ${OUTPUT};fi
done
cd ${HERE_P}
fi
fi
done
cd ${HERE_P}
done
fi
......
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