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

Fix indentation in forecast scripts #319

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions scripts/exglobal_forecast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@

VERBOSE=${VERBOSE:-"YES"}
if [ $VERBOSE = "YES" ] ; then
echo $(date) EXECUTING $0 $* >&2
set -x
echo $(date) EXECUTING $0 $* >&2
set -x
fi

SCRIPTDIR=$(dirname $(readlink -f "$0") )/../ush
Expand Down Expand Up @@ -137,9 +137,9 @@ esac
[[ $cplchem = .true. ]] && GSD_predet

case $RUN in
'gfs') FV3_GFS_det;;
'gdas') FV3_GFS_det;;
'gefs') FV3_GEFS_det;;
'gfs') FV3_GFS_det;;
'gdas') FV3_GFS_det;;
'gefs') FV3_GEFS_det;;
esac #no run type determination for data atmosphere
[[ $cplflx = .true. ]] && MOM6_det
[[ $cplwav = .true. ]] && WW3_det
Expand All @@ -151,7 +151,7 @@ echo "MAIN: RUN Type Determined"
echo "MAIN: Post-determination set up of run type"
echo $RUN
case $RUN in
'data') DATM_postdet;;
'data') DATM_postdet;;
'gfs') FV3_GFS_postdet;;
'gdas') FV3_GFS_postdet;;
'gefs') FV3_GEFS_postdet;;
Expand All @@ -164,10 +164,10 @@ echo "MAIN: Post-determination set up of run type finished"

echo "MAIN: Writing name lists and model configuration"
case $RUN in
'data') DATM_nml;;
'gfs') FV3_GFS_nml;;
'gdas') FV3_GFS_nml;;
'gefs') FV3_GEFS_nml;;
'data') DATM_nml;;
'gfs') FV3_GFS_nml;;
'gdas') FV3_GFS_nml;;
'gefs') FV3_GEFS_nml;;
esac #no namelist for data atmosphere
[[ $cplflx = .true. ]] && MOM6_nml
[[ $cplwav = .true. ]] && WW3_nml
Expand All @@ -176,10 +176,10 @@ esac #no namelist for data atmosphere
[[ $cplgocart = .true. ]] && GOCART_rc

case $RUN in
'data') DATM_model_configure;;
'gfs') FV3_model_configure;;
'gdas') FV3_model_configure;;
'gefs') FV3_model_configure;;
'data') DATM_model_configure;;
'gfs') FV3_model_configure;;
'gdas') FV3_model_configure;;
'gefs') FV3_model_configure;;
esac
echo "MAIN: Name lists and model configuration written"

Expand All @@ -191,48 +191,48 @@ echo "MAIN: NEMS configured"
# run the executable

if [ $esmf_profile ]; then
export ESMF_RUNTIME_PROFILE=ON
export ESMF_RUNTIME_PROFILE_OUTPUT=SUMMARY
export ESMF_RUNTIME_PROFILE=ON
export ESMF_RUNTIME_PROFILE_OUTPUT=SUMMARY
fi

if [ $machine != 'sandbox' ]; then
$NCP $FCSTEXECDIR/$FCSTEXEC $DATA/.
export OMP_NUM_THREADS=$NTHREADS_FV3
$APRUN_FV3 $DATA/$FCSTEXEC 1>&1 2>&2
export ERR=$?
export err=$ERR
$ERRSCRIPT || exit $err
$NCP $FCSTEXECDIR/$FCSTEXEC $DATA/.
export OMP_NUM_THREADS=$NTHREADS_FV3
$APRUN_FV3 $DATA/$FCSTEXEC 1>&1 2>&2
export ERR=$?
export err=$ERR
$ERRSCRIPT || exit $err
else
echo "MAIN: mpirun launch here"
echo "MAIN: mpirun launch here"
fi

if [ $machine != 'sandbox' ]; then
case $RUN in
'data') data_out_Data_ATM;;
'gfs') data_out_GFS;;
'gdas') data_out_GFS;;
'gefs') data_out_GEFS;;
esac
[[ $cplflx = .true. ]] && MOM6_out
[[ $cplwav = .true. ]] && WW3_out
[[ $cplice = .true. ]] && CICE_out
[[ $cplchem = .true. ]] && GSD_out
[[ $esmf_profile = .true. ]] && CPL_out
case $RUN in
'data') data_out_Data_ATM;;
'gfs') data_out_GFS;;
'gdas') data_out_GFS;;
'gefs') data_out_GEFS;;
esac
[[ $cplflx = .true. ]] && MOM6_out
[[ $cplwav = .true. ]] && WW3_out
[[ $cplice = .true. ]] && CICE_out
[[ $cplchem = .true. ]] && GSD_out
[[ $esmf_profile = .true. ]] && CPL_out
else
echo "MAIN: Running on sandbox mode, no output linking"
echo "MAIN: Running on sandbox mode, no output linking"
fi
echo "MAIN: Output copied to COMROT"

#------------------------------------------------------------------
if [ $VERBOSE = "YES" ] ; then
echo $(date) EXITING $0 with return code $err >&2
echo $(date) EXITING $0 with return code $err >&2
fi

if [ $err != 0 ]; then
echo "MAIN: $confignamevarfornems Forecast failed"
exit $err
echo "MAIN: $confignamevarfornems Forecast failed"
exit $err
else
echo "MAIN: $confignamevarfornems Forecast completed at normal status"
if [ $KEEPDATA != "YES" ]; then rm -rf $DATA; fi
exit 0
echo "MAIN: $confignamevarfornems Forecast completed at normal status"
if [ $KEEPDATA != "YES" ]; then rm -rf $DATA; fi
exit 0
fi
74 changes: 37 additions & 37 deletions ush/forecast_det.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,50 @@ FV3_GFS_det(){
# warm start?
warm_start=${warm_start:-".false."}
read_increment=${read_increment:-".false."}
res_latlon_dynamics="''"
res_latlon_dynamics="''"

# Determine if this is a warm start or cold start
# Determine if this is a warm start or cold start
if [ -f $gmemdir/RESTART/${sPDY}.${scyc}0000.coupler.res ]; then
export warm_start=".true."
export warm_start=".true."
fi

# turn IAU off for cold start
DOIAU_coldstart=${DOIAU_coldstart:-"NO"}
if [ $DOIAU = "YES" -a $warm_start = ".false." ] || [ $DOIAU_coldstart = "YES" -a $warm_start = ".true." ]; then
export DOIAU="NO"
echo "turning off IAU since warm_start = $warm_start"
DOIAU_coldstart="YES"
IAU_OFFSET=0
sCDATE=$CDATE
sPDY=$PDY
scyc=$cyc
tPDY=$sPDY
tcyc=$cyc
fi
# turn IAU off for cold start
DOIAU_coldstart=${DOIAU_coldstart:-"NO"}
if [ $DOIAU = "YES" -a $warm_start = ".false." ] || [ $DOIAU_coldstart = "YES" -a $warm_start = ".true." ]; then
export DOIAU="NO"
echo "turning off IAU since warm_start = $warm_start"
DOIAU_coldstart="YES"
IAU_OFFSET=0
sCDATE=$CDATE
sPDY=$PDY
scyc=$cyc
tPDY=$sPDY
tcyc=$cyc
fi

#-------------------------------------------------------
# determine if restart IC exists to continue from a previous forecast
RERUN="NO"
filecount=$(find $RSTDIR_ATM -type f | wc -l)
if [ $CDUMP = "gfs" -a $rst_invt1 -gt 0 -a $FHMAX -gt $rst_invt1 -a $filecount -gt 10 ]; then
reverse=$(echo "${restart_interval[@]} " | tac -s ' ')
for xfh in $reverse ; do
yfh=$((xfh-(IAU_OFFSET/2)))
SDATE=$($NDATE +$yfh $CDATE)
PDYS=$(echo $SDATE | cut -c1-8)
cycs=$(echo $SDATE | cut -c9-10)
flag1=$RSTDIR_ATM/${PDYS}.${cycs}0000.coupler.res
flag2=$RSTDIR_ATM/coupler.res
if [ -s $flag1 ]; then
CDATE_RST=$SDATE
[[ $RERUN = "YES" ]] && break
mv $flag1 ${flag1}.old
if [ -s $flag2 ]; then mv $flag2 ${flag2}.old ;fi
RERUN="YES"
[[ $xfh = $rst_invt1 ]] && RERUN="NO"
fi
done
fi
RERUN="NO"
filecount=$(find $RSTDIR_ATM -type f | wc -l)
if [ $CDUMP = "gfs" -a $rst_invt1 -gt 0 -a $FHMAX -gt $rst_invt1 -a $filecount -gt 10 ]; then
reverse=$(echo "${restart_interval[@]} " | tac -s ' ')
for xfh in $reverse ; do
yfh=$((xfh-(IAU_OFFSET/2)))
SDATE=$($NDATE +$yfh $CDATE)
PDYS=$(echo $SDATE | cut -c1-8)
cycs=$(echo $SDATE | cut -c9-10)
flag1=$RSTDIR_ATM/${PDYS}.${cycs}0000.coupler.res
flag2=$RSTDIR_ATM/coupler.res
if [ -s $flag1 ]; then
CDATE_RST=$SDATE
[[ $RERUN = "YES" ]] && break
mv $flag1 ${flag1}.old
if [ -s $flag2 ]; then mv $flag2 ${flag2}.old ;fi
RERUN="YES"
[[ $xfh = $rst_invt1 ]] && RERUN="NO"
fi
done
fi

#-------------------------------------------------------
}
Expand Down
Loading