Commit 1da98a63 authored by Paul Gierz's avatar Paul Gierz

downscaling without temperature

parent b9a6a95d
......@@ -667,6 +667,15 @@ ic_atm2pism_regrid_downscale_precipitation() {
gamma="-0.07"
echo -e "\t\t- factor γ=${gamma}"
echo -e "\t\t- P_downscaled = P * e ** (gamma * (T_downscaled - T_original))"
if [ "x${DOWNSCALE_TEMP}" != "x1"]; then
if [ ! -f ${COUPLE_DIR}/atmosphere_file_for_ice_for_downscaling_${atmosphere_name_temperature}.nc ]; then
echo -e "\t\t* You did NOT want to downscale temperature and I could not find an appropriate file"
echo -e "\t\t The downscaling routine for temperature will be run, but the interpolated values will be resored later"
mv ${COUPLE_DIR}/temperature.nc ${COUPLE_DIR}/atmosphere_file_for_ice_for_downscaling_${atmosphere_name_temperature}.nc
backup_temperature=1
ic_atm2pism_regrid_downscale_temperature
fi
fi
${cdo} -s \
-mul \
${COUPLE_DIR}/atmosphere_file_for_ice_for_downscaling_${atmosphere_name_precipitation}.nc \
......@@ -681,6 +690,10 @@ ic_atm2pism_regrid_downscale_precipitation() {
echo " fldmean: $(cdo -s -output -fldmean -timmean -sub ${COUPLE_DIR}/precip_hi.nc ${COUPLE_DIR}/atmosphere_file_for_ice_for_downscaling_${atmosphere_name_precipitation}.nc)"
echo " fldmax: $(cdo -s -output -fldmax -timmean -sub ${COUPLE_DIR}/precip_hi.nc ${COUPLE_DIR}/atmosphere_file_for_ice_for_downscaling_${atmosphere_name_precipitation}.nc)"
mv ${COUPLE_DIR}/precip_hi.nc ${COUPLE_DIR}/precipitation.nc
if [ "x$backup_temperature" == "x1" ]; then
echo -e "\t\t Restoring interpolated temperature for use in atmo_given_file.nc"
mv ${COUPLE_DIR}/atmosphere_file_for_ice_for_downscaling_${atmosphere_name_temperature}.nc ${COUPLE_DIR}/temperature.nc
fi
else
echo ""; echo -e "\t\t* NOT downscaling precipitation"
echo -e "\t\t- falling back to bilinear interpolation for precipitation!"
......
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