Skip to content

Commit

Permalink
Merge pull request #1481 from karsenau/s2s_fix/cfsv2_check
Browse files Browse the repository at this point in the history
S2S CFSv2 script update
  • Loading branch information
emkemp authored Jan 22, 2024
2 parents 3a6dbb5 + de31843 commit 77bb3ee
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions lis/utils/usaf/s2s/s2s_app/s2s_hcst_preprocess.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Copyright (c) 2024 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#-------------------------END NOTICE -- DO NOT EDIT-----------------------
# -------------------------END NOTICE -- DO NOT EDIT-----------------------

# source and load shared functions from s2s_run.sh
source s2s_app/s2s_run.sh --source-only
Expand Down Expand Up @@ -147,9 +147,9 @@ reorg_cfsv2(){
/bin/ln -s ${E2ESDIR}/bcsd_fcst/

jobname=reorg_cfsv2
python $LISHDIR/s2s_modules/bcsd_fcst/forecast_task_01.py -s $clim_syr -e $clim_mid -m $mmm -c $BWD/$CFILE -w ${CWD} -t 1 -H 9 -j ${jobname}_set1
python $LISHDIR/s2s_modules/bcsd_fcst/forecast_task_01.py -s $clim_syr -e $clim_mid -m $mmm -c $BWD/$CFILE -w ${CWD} -t 1 -H 10 -j ${jobname}_set1
((clim_mid++))
python $LISHDIR/s2s_modules/bcsd_fcst/forecast_task_01.py -s $clim_mid -e $clim_eyr -m $mmm -c $BWD/$CFILE -w ${CWD} -t 1 -H 9 -j ${jobname}_set2
python $LISHDIR/s2s_modules/bcsd_fcst/forecast_task_01.py -s $clim_mid -e $clim_eyr -m $mmm -c $BWD/$CFILE -w ${CWD} -t 1 -H 10 -j ${jobname}_set2

job_list="$jobname*.j"
for jfile in $job_list
Expand Down
42 changes: 21 additions & 21 deletions lis/utils/usaf/s2s/s2s_app/wget_cfsv2_oper_ts_e2es.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Copyright (c) 2024 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#-------------------------END NOTICE -- DO NOT EDIT-----------------------
# -------------------------END NOTICE -- DO NOT EDIT-----------------------

# Title: CFSv2 Operational Timeseries (Oper_TS) Download Script
#
Expand Down Expand Up @@ -128,10 +128,11 @@ main_loop() {
echo $ret_code > $ret_code_pipe
}
# ________________________________________________________________
# Main script
#
# Main part of the script
# ________________________________________________________________

# process command line arguments
# Process command line arguments

ret_code=0
while getopts y:m:c:d: flag
Expand All @@ -154,6 +155,7 @@ do
;;
esac
done

if [[ -z "$year" ]] || [[ -z "$mon" ]] || [[ -z "$configfile" ]] || [[ -z "$download" ]]; then
echo "`basename ${0}`: usage: [-y year] [-m month ] [-c FULL_PATH/config_file] [-d download (Y/N)]"
exit 1
Expand All @@ -163,14 +165,15 @@ echo "Month: $mon";
echo "Configfile: $configfile";
echo

# Read config file and extract information

# Read config file and extract information:
export NODE_NAME=`uname -n`
if [[ $NODE_NAME =~ discover* ]] || [[ $NODE_NAME =~ borg* ]]; then
cfsv2datadir=`grep fcst_download_dir $configfile | cut -d':' -f2 | tr -d "[:space:]"`"/Oper_TS/"
else
cfsv2datadir=`grep fcst_download_dir $configfile | cut -d':' -f2 | tr -d "[:space:]"`
fi

# Patch file info:
patchfile=`grep supplementarydir $configfile | cut -d':' -f2 | tr -d "[:space:]"`"/bcsd_fcst/patch_files/patch_files_list.txt"
patchdir=`grep supplementarydir $configfile | cut -d':' -f2 | tr -d "[:space:]"`"/bcsd_fcst/patch_files/"
export LISFDIR=`grep LISFDIR $configfile | cut -d':' -f2 | tr -d "[:space:]"`
Expand Down Expand Up @@ -222,11 +225,19 @@ ulimit -s unlimited
fi
yearmo=${year}${mon}
cd ${cfsv2datadir}
echo ${year}
mkdir -p ${year}
cd ${year}

# open CFSv2 missing/corrupted file info log
echo " -- Run year :: "${year}
# - Need to account for Dec/Jan crossover
if [ ${mon} -eq "01" ]; then
year2=$((year-1))
else
year2=${year}
fi
echo " -- Making and changing directory to target year for downloads -- "${year2}
mkdir -p ${year2}
cd ${year2}

# Open CFSv2 missing/corrupted file info log
SCRDIR=${E2ESDIR}/scratch/${yearmo}/
mkdir -p -m 775 ${SCRDIR}/
CFSV2_LOG=${SCRDIR}/CFSv2_missing_corrupted_files
Expand Down Expand Up @@ -262,7 +273,6 @@ if [ ${mon} -eq "01" ]; then
# "jan01" : ['1217', '1222', '1227']
echo "January ..."
prevmon=12
year2=$((year-1))
day1=17
day2=22
day3=27
Expand All @@ -271,7 +281,6 @@ elif [ ${mon} -eq "02" ]; then
# "feb01" : ['0121', '0126', '0131']
echo "February ..."
prevmon=01
year2=${year}
day1=21
day2=26
day3=31
Expand All @@ -280,7 +289,6 @@ elif [ ${mon} -eq "03" ]; then
# "mar01" : ['0215', '0220', '0225']
echo "March ..."
prevmon=02
year2=${year}
day1=15
day2=20
day3=25
Expand All @@ -289,7 +297,6 @@ elif [ ${mon} -eq "04" ]; then
# "apr01" : ['0317', '0322', '0327']
echo "April ..."
prevmon=03
year2=${year}
day1=17
day2=22
day3=27
Expand All @@ -298,7 +305,6 @@ elif [ ${mon} -eq "05" ]; then
# "may01" : ['0416', '0421', '0426']
echo "May ..."
prevmon=04
year2=${year}
day1=16
day2=21
day3=26
Expand All @@ -307,7 +313,6 @@ elif [ ${mon} -eq "06" ]; then
# "jun01" : ['0521', '0526', '0531']
echo "June ..."
prevmon=05
year2=${year}
day1=21
day2=26
day3=31
Expand All @@ -316,7 +321,6 @@ elif [ ${mon} -eq "07" ]; then
# "jul01" : ['0620', '0625', '0630']
echo "July ..."
prevmon=06
year2=${year}
day1=20
day2=25
day3=30
Expand All @@ -325,7 +329,6 @@ elif [ ${mon} -eq "08" ]; then
# "aug01" : ['0720', '0725', '0730']
echo "August ..."
prevmon=07
year2=${year}
day1=20
day2=25
day3=30
Expand All @@ -334,7 +337,6 @@ elif [ ${mon} -eq "09" ]; then
# "sep01" : ['0819', '0824', '0829']
echo "September ..."
prevmon=08
year2=${year}
day1=19
day2=24
day3=29
Expand All @@ -343,7 +345,6 @@ elif [ ${mon} -eq "10" ]; then
# "oct01" : ['0918', '0923', '0928']
echo "October ..."
prevmon=09
year2=${year}
day1=18
day2=23
day3=28
Expand All @@ -352,7 +353,6 @@ elif [ ${mon} -eq "11" ]; then
# "nov01" : ['1018', '1023', '1028']
echo "November ..."
prevmon=10
year2=${year}
day1=18
day2=23
day3=28
Expand All @@ -361,11 +361,11 @@ elif [ ${mon} -eq "12" ]; then
# "dec01" : ['1117', '1122', '1127']
echo "December ..."
prevmon=11
year2=${year}
day1=17
day2=22
day3=27
fi

echo "Previous mon,days 1-2-3 :: "${prevmon}", "${day1}"-"${day2}"-"${day3}
echo " "
echo "=================================================================================================="
Expand Down

0 comments on commit 77bb3ee

Please sign in to comment.