Skip to content

Commit

Permalink
Update GDAS INIT utility for GFS COM reorganization (#820)
Browse files Browse the repository at this point in the history
Changes to the GDAS INIT utility's copy_coldstart_file.sh:

1. Rename SAVEDIR to SAVEDIR_MODEL_DATA (for the model directory).
2. Introduce SAVEDIR_ANALYSIS for the newly separated analysis
subfolder (where the abias and radstat ICs go).
3. Remove the enkf loginc.txt file (no longer need).
4. Moved SAVEDIR* variable settings into the copy_data function
(to reduce redundancy in the if-block since they are all the same
now for SAVEDIR_MODEL_DATA regardless of member/suite).
5. Add $MEMBER as an argument for copy_data so I could do item 4
(used $MEM within the function but can use $MEMBER if desired).

Fixes #817
  • Loading branch information
KateFriedman-NOAA committed May 4, 2023
1 parent 7186ea6 commit 72a0471
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions util/gdas_init/copy_coldstart_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,26 @@
copy_data()
{

set -x
set -x

MEM=$1

SAVEDIR_MODEL_DATA=$SUBDIR/model_data/atmos/input
mkdir -p $SAVEDIR_MODEL_DATA
cp gfs_ctrl.nc $SAVEDIR_MODEL_DATA

mkdir -p $SAVEDIR
cp gfs_ctrl.nc $SAVEDIR
for tile in 'tile1' 'tile2' 'tile3' 'tile4' 'tile5' 'tile6'
do
cp out.atm.${tile}.nc ${SAVEDIR_MODEL_DATA}/gfs_data.${tile}.nc
cp out.sfc.${tile}.nc ${SAVEDIR_MODEL_DATA}/sfc_data.${tile}.nc
done

for tile in 'tile1' 'tile2' 'tile3' 'tile4' 'tile5' 'tile6'
do
cp out.atm.${tile}.nc ${SAVEDIR}/gfs_data.${tile}.nc
cp out.sfc.${tile}.nc ${SAVEDIR}/sfc_data.${tile}.nc
done
if [ ${MEM} == 'gdas' ]; then
SAVEDIR_ANALYSIS=$SUBDIR/analysis/atmos
mkdir -p $SAVEDIR_ANALYSIS
cp ${INPUT_DATA_DIR}/*abias* $SAVEDIR_ANALYSIS/
cp ${INPUT_DATA_DIR}/*radstat $SAVEDIR_ANALYSIS/
fi
}

set -x
Expand All @@ -39,13 +49,7 @@ set -x
if [ ${MEMBER} == 'gdas' ] || [ ${MEMBER} == 'gfs' ]; then
SUBDIR=$OUTDIR/${MEMBER}.${yy}${mm}${dd}/${hh}
rm -fr $SUBDIR
SAVEDIR=$SUBDIR/atmos/INPUT
copy_data
if [ ${MEMBER} == 'gdas' ]; then
cp ${INPUT_DATA_DIR}/*abias* $SAVEDIR/..
cp ${INPUT_DATA_DIR}/*radstat $SAVEDIR/..
fi
touch $SAVEDIR/../${MEMBER}.t${hh}z.loginc.txt
copy_data ${MEMBER}
elif [ ${MEMBER} == 'enkf' ]; then # v16 retro data only.
MEMBER=1
while [ $MEMBER -le 80 ]; do
Expand All @@ -56,17 +60,13 @@ elif [ ${MEMBER} == 'enkf' ]; then # v16 retro data only.
fi
SUBDIR=$OUTDIR/enkfgdas.${yy}${mm}${dd}/${hh}/mem${MEMBER_CH}
rm -fr $SUBDIR
SAVEDIR=$SUBDIR/atmos/INPUT
copy_data
touch $SAVEDIR/../enkfgdas.t${hh}z.loginc.txt
copy_data ${MEMBER}
MEMBER=$(( $MEMBER + 1 ))
done
else
SUBDIR=$OUTDIR/enkfgdas.${yy}${mm}${dd}/${hh}/mem${MEMBER}
rm -fr $SUBDIR
SAVEDIR=$SUBDIR/atmos/INPUT
copy_data
touch $SAVEDIR/../enkfgdas.t${hh}z.loginc.txt
copy_data ${MEMBER}
fi

exit 0

0 comments on commit 72a0471

Please sign in to comment.