Skip to content

Commit

Permalink
Update run scripts and download fix data from aws
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanJovic-NOAA committed Mar 26, 2024
1 parent ed91712 commit e0de16b
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 78 deletions.
1 change: 1 addition & 0 deletions run/configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
sufs=$( cd $(pwd)/.. ; pwd -P )

res=${res:-96}
ocn=${ocn:-100}
levp=${levp:-65} # 28, 42 or 65

gtype=uniform
Expand Down
76 changes: 37 additions & 39 deletions run/fetch_fix_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ set -eux

source configuration.sh

FIX_URL="https://ftp.emc.ncep.noaa.gov/static_files/public/UFS/GFS/fix"
FIX_URL="https://noaa-nws-global-pds.s3.amazonaws.com/fix"

rm -rf ${FIX_DATA}
mkdir -p ${FIX_DATA}
cd ${FIX_DATA}

(
rm -rf fix_am
mkdir -p fix_am
cd fix_am
rm -rf am/20220805
mkdir -p am/20220805
cd am/20220805

#for res in 96 192; do
for res in ${res}; do
Expand Down Expand Up @@ -89,71 +89,69 @@ cd ${FIX_DATA}
global_vegtype.igbp.t${JCAP}.${LONB}.${LATB}.rg.grb
"
for file in ${FIX_AM_FILES}; do
curl -f -s -S -R -L -C - -O ${FIX_URL}/fix_am/${file}
curl -f -s -S -R -L -C - -O ${FIX_URL}/am/20220805/${file}
done

# ln -s global_mxsnoalb.uariz.t126.384.190.rg.grb global_mxsnoalb.uariz.t190.384.192.rg.grb
# ln -s global_snowfree_albedo.bosu.t126.384.190.rg.grb global_snowfree_albedo.bosu.t190.384.192.rg.grb
# ln -s global_soilmgldas.t126.384.190.grb global_soilmgldas.t190.384.192.grb
# ln -s global_soiltype.statsgo.t126.384.190.rg.grb global_soiltype.statsgo.t190.384.192.rg.grb
# ln -s global_vegtype.igbp.t126.384.190.rg.grb global_vegtype.igbp.t190.384.192.rg.grb

done # res
)

if [[ $gtype == uniform ]]; then
(
rm -rf fix_fv3_gmted2010
mkdir fix_fv3_gmted2010
cd fix_fv3_gmted2010
rm -rf orog/20231027
mkdir -p orog/20231027
cd orog/20231027

#for res in 96 192; do
for res in ${res}; do
(
FIX_FV3_FILES="
C${res}_grid.tile[1-6].nc
C${res}_mosaic.nc
C${res}_oro_data.tile[1-6].nc
C${res}.mx${ocn}_oro_data.tile[1-6].nc
"
mkdir -p C${res}
cd C${res}
for file in ${FIX_FV3_FILES}; do
curl -f -s -S -R -L -C - -O ${FIX_URL}/fix_fv3_gmted2010/C${res}/${file}
curl -f -s -S -R -L -C - -O ${FIX_URL}/orog/20231027/C${res}/${file}
done

FIX_FV3_FIX_SFC_FILES="
C${res}.facsf.tile[1-6].nc
C${res}.maximum_snow_albedo.tile[1-6].nc
C${res}.slope_type.tile[1-6].nc
C${res}.snowfree_albedo.tile[1-6].nc
C${res}.soil_type.tile[1-6].nc
C${res}.substrate_temperature.tile[1-6].nc
C${res}.vegetation_greenness.tile[1-6].nc
C${res}.vegetation_type.tile[1-6].nc
C${res}.mx${ocn}.facsf.tile[1-6].nc
C${res}.mx${ocn}.maximum_snow_albedo.tile[1-6].nc
C${res}.mx${ocn}.slope_type.tile[1-6].nc
C${res}.mx${ocn}.snowfree_albedo.tile[1-6].nc
C${res}.mx${ocn}.soil_type.tile[1-6].nc
C${res}.mx${ocn}.substrate_temperature.tile[1-6].nc
C${res}.mx${ocn}.vegetation_greenness.tile[1-6].nc
C${res}.mx${ocn}.vegetation_type.tile[1-6].nc
"
mkdir -p fix_sfc
cd fix_sfc
mkdir -p sfc
cd sfc
for file in ${FIX_FV3_FIX_SFC_FILES}; do
sleep 5
curl -f -s -S -R -L -C - -O ${FIX_URL}/fix_fv3_gmted2010/C${res}/fix_sfc/${file}
curl -f -s -S -R -L -C - -O ${FIX_URL}/orog/20231027/C${res}/sfc/${file}
done
)
done # res
)
elif [[ $gtype == regional* ]]; then
(
# redefine s3 bucket to SRW
FIX_URL="https://noaa-ufs-srw-pds.s3.amazonaws.com/fix"
OROG_FILES="
gmted2010.30sec.int
landcover30.fixed
thirty.second.antarctic.new.bin
topography.gmted2010.30s.nc
landcover.umd.30s.nc
topography.antarctica.ramp.30s.nc
"
rm -rf fix_orog
mkdir fix_orog
cd fix_orog
# gmted2010.30sec.int
# landcover30.fixed
# thirty.second.antarctic.new.bin
rm -rf raw/orog
mkdir -p raw/orog
cd raw/orog
for file in ${OROG_FILES}; do
curl -f -s -S -R -L -C - -O ${FIX_URL}/fix_orog/${file}
done
cd ..
cd ../..

SFC_CLIMO_FILES="
facsf.1.0.nc
Expand All @@ -165,13 +163,13 @@ elif [[ $gtype == regional* ]]; then
vegetation_greenness.0.144.nc
vegetation_type.modis.igbp.0.05.nc
"
rm -rf fix_sfc_climo
mkdir -p fix_sfc_climo
cd fix_sfc_climo
rm -rf sfc_climo/20230925
mkdir -p sfc_climo/20230925
cd sfc_climo/20230925
for file in ${SFC_CLIMO_FILES}; do
curl -f -s -S -R -L -C - -O ${FIX_URL}/fix_sfc_climo/${file}
done
cd ..
cd ../..
)
else
echo "Unknown gtype $gtype"
Expand Down
13 changes: 9 additions & 4 deletions run/run_grid_orog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ export target_lon target_lat idim jdim delx dely
if [[ $gtype == uniform ]]; then # use pregenerated grid/orog files

rm -rf ${GRID_OROG_DATA}/C${res}
ln -sf ${FIX_DATA}/fix_fv3_gmted2010/C${res} ${GRID_OROG_DATA}/C${res}
ln -sf ${FIX_DATA}/orog/20231027/C${res} ${GRID_OROG_DATA}/C${res}

else # run fv3gfs_driver_grid.sh

[[ -e ${sufs}/src/preproc/ush/fv3gfs_driver_grid.sh ]] || exit 1

ln -sf ${FIX_DATA}/fix_am ${sufs}/src/preproc/fix/.
ln -sf ${FIX_DATA}/fix_orog ${sufs}/src/preproc/fix/.
ln -sf ${FIX_DATA}/fix_sfc_climo ${sufs}/src/preproc/fix/.
rm -f ${sufs}/src/preproc/fix/am
rm -f ${sufs}/src/preproc/fix/orog
rm -f ${sufs}/src/preproc/fix/orog_raw
rm -f ${sufs}/src/preproc/fix/sfc_climo
ln -sf ${FIX_DATA}/am/20220805 ${sufs}/src/preproc/fix/am
ln -sf ${FIX_DATA}/orog/20231027 ${sufs}/src/preproc/fix/orog
ln -sf ${FIX_DATA}/raw/orog ${sufs}/src/preproc/fix/orog_raw
ln -sf ${FIX_DATA}/sfc_climo/20230925 ${sufs}/src/preproc/fix/sfc_climo

export machine=linux
export TEMP_DIR=${MYDIR}/tmp_grid_orog_$$
Expand Down
66 changes: 33 additions & 33 deletions run/run_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ halo=3
if [[ $gtype == uniform ]]; then

cp -r ${GRID_OROG_DATA}/C${res}/* .
mv C${res}_mosaic.nc grid_spec.nc
mv C${res}_oro_data.tile1.nc oro_data.tile1.nc
mv C${res}_oro_data.tile2.nc oro_data.tile2.nc
mv C${res}_oro_data.tile3.nc oro_data.tile3.nc
mv C${res}_oro_data.tile4.nc oro_data.tile4.nc
mv C${res}_oro_data.tile5.nc oro_data.tile5.nc
mv C${res}_oro_data.tile6.nc oro_data.tile6.nc
mv C${res}_mosaic.nc grid_spec.nc
mv C${res}.mx${ocn}_oro_data.tile1.nc oro_data.tile1.nc
mv C${res}.mx${ocn}_oro_data.tile2.nc oro_data.tile2.nc
mv C${res}.mx${ocn}_oro_data.tile3.nc oro_data.tile3.nc
mv C${res}.mx${ocn}_oro_data.tile4.nc oro_data.tile4.nc
mv C${res}.mx${ocn}_oro_data.tile5.nc oro_data.tile5.nc
mv C${res}.mx${ocn}_oro_data.tile6.nc oro_data.tile6.nc

elif [[ $gtype == regional* ]]; then

Expand Down Expand Up @@ -112,32 +112,32 @@ FNVETC="global_vegtype.igbp.t${JCAP}.${LONB}.${LATB}.rg.grb"
FNSOTC="global_soiltype.statsgo.t${JCAP}.${LONB}.${LATB}.rg.grb"
FNSMCC="global_soilmgldas.t${JCAP}.${LONB}.${LATB}.grb"

cp ${FIX_DATA}/fix_am/global_climaeropac_global.txt aerosol.dat
cp ${FIX_DATA}/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb .
cp ${FIX_DATA}/fix_am/global_co2historicaldata_2013.txt co2historicaldata_2013.txt
cp ${FIX_DATA}/fix_am/RTGSST.1982.2012.monthly.clim.grb .
cp ${FIX_DATA}/fix_am/global_albedo4.1x1.grb .
cp ${FIX_DATA}/fix_am/global_co2historicaldata_glob.txt co2historicaldata_glob.txt
cp ${FIX_DATA}/fix_am/co2monthlycyc.txt .
cp ${FIX_DATA}/fix_am/global_glacier.2x2.grb .
cp ${FIX_DATA}/fix_am/global_h2o_pltc.f77 global_h2oprdlos.f77
cp ${FIX_DATA}/fix_am/global_maxice.2x2.grb .
cp ${FIX_DATA}/fix_am/ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77 global_o3prdlos.f77
cp ${FIX_DATA}/fix_am/global_shdmax.0.144x0.144.grb .
cp ${FIX_DATA}/fix_am/global_shdmin.0.144x0.144.grb .
cp ${FIX_DATA}/fix_am/global_slope.1x1.grb .
cp ${FIX_DATA}/fix_am/global_snoclim.1.875.grb .
cp ${FIX_DATA}/fix_am/global_solarconstant_noaa_an.txt solarconstant_noaa_an.txt
cp ${FIX_DATA}/fix_am/global_tg3clim.2.6x1.5.grb .
cp ${FIX_DATA}/fix_am/global_vegfrac.0.144.decpercent.grb .
cp ${FIX_DATA}/fix_am/global_sfc_emissivity_idx.txt sfc_emissivity_idx.txt

cp ${FIX_DATA}/fix_am/${FNABSC} .
cp ${FIX_DATA}/fix_am/global_slmask.t1534.3072.1536.grb seaice_newland.grb
cp ${FIX_DATA}/fix_am/${FNALBC} .
cp ${FIX_DATA}/fix_am/${FNSMCC} .
cp ${FIX_DATA}/fix_am/${FNSOTC} .
cp ${FIX_DATA}/fix_am/${FNVETC} .
cp ${FIX_DATA}/am/20220805/global_climaeropac_global.txt aerosol.dat
cp ${FIX_DATA}/am/20220805/CFSR.SEAICE.1982.2012.monthly.clim.grb .
cp ${FIX_DATA}/am/20220805/global_co2historicaldata_2013.txt co2historicaldata_2013.txt
cp ${FIX_DATA}/am/20220805/RTGSST.1982.2012.monthly.clim.grb .
cp ${FIX_DATA}/am/20220805/global_albedo4.1x1.grb .
cp ${FIX_DATA}/am/20220805/global_co2historicaldata_glob.txt co2historicaldata_glob.txt
cp ${FIX_DATA}/am/20220805/co2monthlycyc.txt .
cp ${FIX_DATA}/am/20220805/global_glacier.2x2.grb .
cp ${FIX_DATA}/am/20220805/global_h2o_pltc.f77 global_h2oprdlos.f77
cp ${FIX_DATA}/am/20220805/global_maxice.2x2.grb .
cp ${FIX_DATA}/am/20220805/ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77 global_o3prdlos.f77
cp ${FIX_DATA}/am/20220805/global_shdmax.0.144x0.144.grb .
cp ${FIX_DATA}/am/20220805/global_shdmin.0.144x0.144.grb .
cp ${FIX_DATA}/am/20220805/global_slope.1x1.grb .
cp ${FIX_DATA}/am/20220805/global_snoclim.1.875.grb .
cp ${FIX_DATA}/am/20220805/global_solarconstant_noaa_an.txt solarconstant_noaa_an.txt
cp ${FIX_DATA}/am/20220805/global_tg3clim.2.6x1.5.grb .
cp ${FIX_DATA}/am/20220805/global_vegfrac.0.144.decpercent.grb .
cp ${FIX_DATA}/am/20220805/global_sfc_emissivity_idx.txt sfc_emissivity_idx.txt

cp ${FIX_DATA}/am/20220805/${FNABSC} .
cp ${FIX_DATA}/am/20220805/global_slmask.t1534.3072.1536.grb seaice_newland.grb
cp ${FIX_DATA}/am/20220805/${FNALBC} .
cp ${FIX_DATA}/am/20220805/${FNSMCC} .
cp ${FIX_DATA}/am/20220805/${FNSOTC} .
cp ${FIX_DATA}/am/20220805/${FNVETC} .

if [[ $gtype == uniform ]]; then
cp ${MYDIR}/global_conf/* .
Expand Down
5 changes: 3 additions & 2 deletions run/run_preproc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ mkdir ${DATA}
cd ${DATA}

export APRUN="${MPIEXEC} -n 6"
export OMP_NUM_THREADS_CH=1
export OMP_NUM_THREADS=1
export CDATE=${START_YEAR}${START_MONTH}${START_DAY}${START_HOUR}
export HOMEufs=${sufs}/src/preproc
export EXECufs=${sufs}/bin
export FIXam=${MYDIR}/fix_data/fix_am
export FIXam=${MYDIR}/fix_data/am/20220805
export CRES=${res}
export VCOORD_FILE=${FIXam}/global_hyblev.l${levp}.txt
export INPUT_TYPE
export ocn

export COMIN=${INPUT_DATA}

Expand Down

0 comments on commit e0de16b

Please sign in to comment.