Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Feel free to join the next
Helmholtz Hacky Hour #26
on Wednesday, April 21, 2021 from 2PM to 3PM!
Open sidebar
CHS
progs
edk_nc
Commits
c811f359
Commit
c811f359
authored
Mar 17, 2020
by
Akash Koppa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a switch to enable/disable preprocessing of meteorological files in DEM Processing
parent
9c670fd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
preprocess_dem_nc/0_DEM_Processing.sh
preprocess_dem_nc/0_DEM_Processing.sh
+15
-10
No files found.
preprocess_dem_nc/0_DEM_Processing.sh
View file @
c811f359
...
...
@@ -9,8 +9,8 @@
#------------------------USER DEFINED SETTINGS-------------------------#
## input and output paths
# absolute path to target DEM
source_dem
=
"/data/hicam/data/processed/de_hicam/morph/dem.asc"
met_dem
=
"/data/hicam/data/processed/dem_OR/raw/dem_hicam_EU.nc"
source_dem
=
"/data/hicam/data/processed/de_hicam/morph/dem
_germany
.asc"
#
met_dem="/data/hicam/data/processed/dem_OR/raw/dem_hicam_EU.nc"
# absolute path to meteorological files (currently supports mHM inputs)
path_rr
=
"/data/hicam/EOBS/raw/latlon/rr_ens_mean_0.1deg_reg_v20.0e.nc"
# precipitation
path_tg
=
"/data/hicam/EOBS/raw/latlon/tg_ens_mean_0.1deg_reg_v20.0e.nc"
# average temperature
...
...
@@ -19,19 +19,18 @@ path_tx="/data/hicam/EOBS/raw/latlon/tx_ens_mean_0.1deg_reg_v20.0e.nc" # maximu
# output directory
output_dir
=
"/work/koppa/hicam_edk/test"
# domain specifications for target dem
# domain specifications for target dem (xmin, xmax, ymin, ymax)
# hicam domain of germany with headwaters [4.0, 20.0, 45.0, 55.5]
# hicam domain of only germany [5.93, 15.75, 46.96, 55.15]
xmin
=
"4.0"
xmax
=
"
19.5
"
xmax
=
"
20.0
"
ymin
=
"45.0"
ymax
=
"55.5"
target_res
=
"0.015625"
# target resolution
# domain specification for meteorological datasets (to subset the met domain)
#xmin_met="3.7"
#xmax_met="19.8"
#ymin_met="44.7"
#ymax_met="55.8"
# meteorological flag
met_flag
=
0
# 0: no meteorological processing 1: met files will be processed
met_res
=
"0.10"
# resolution of meteorology datasets
crs_reqd
=
"+init=epsg:3
035
"
# provide the epsg of the m-m coordinate system
crs_reqd
=
"+init=epsg:3
1468
"
# provide the epsg of the m-m coordinate system
# meteorological variable details (name of the variable in the netcdf file)
var_rr
=
"rr"
...
...
@@ -47,6 +46,7 @@ var_tx="tx"
# load netcdf and R modules
module load GCC/7.3.0-2.30 OpenMPI/3.1.1 NCO/4.7.8 CDO/1.9.5 GDAL/2.2.3-Python-3.6.6 ncview/2.1.7 R/3.6.0
echo
"--------Processing DEM---------"
## process target DEM
# convert the ascii file to .tif
gdal_translate
${
source_dem
}
"
${
output_dir
}
/dem_target.tif"
...
...
@@ -68,6 +68,9 @@ cdo setmissval,-9999 "${output_dir}/dem_target.nc" "${output_dir}/dem_target.nc"
# add northing and easting to the target variable using the R script
Rscript latlon2northeast.R
"
${
output_dir
}
/dem_target.nc"
"dem"
${
crs_reqd
}
if
[
${
met_flag
}
-gt
0
]
then
echo
"-----------Processing Meteorological Data-----------"
## process input meteorological forcing
# subset the meteorological forcing
ncks
-d
longitude,
${
xmin
}
,
${
xmax
}
-d
latitude,
${
ymin
}
,
${
ymax
}
"
${
path_rr
}
"
"
${
output_dir
}
/rr_temp.nc"
...
...
@@ -103,6 +106,8 @@ Rscript add_dem2met.R "${output_dir}/rr_final.nc" "${output_dir}/dem_met.nc"
Rscript add_dem2met.R
"
${
output_dir
}
/tg_final.nc"
"
${
output_dir
}
/dem_met.nc"
Rscript add_dem2met.R
"
${
output_dir
}
/tn_final.nc"
"
${
output_dir
}
/dem_met.nc"
Rscript add_dem2met.R
"
${
output_dir
}
/tx_final.nc"
"
${
output_dir
}
/dem_met.nc"
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment