Commit 764234e9 authored by jan vogelsang's avatar jan vogelsang

Moving source files to submodule

parent c29eeb54
[submodule "source"]
path = source
url = https://gitlab.version.fz-juelich.de/vogelsang1/source.git
gridtype = lonlat
gridsize = 6481800
xsize = 3601
ysize = 1800
xfirst = -180
xinc = 0.1
yfirst = -89.95
yinc = 0.1
from cdo import Cdo
import sys
cdo = Cdo()
cdo.Debug = True
path_to_input = sys.argv[1]
path_to_output = sys.argv[2]
center = float(sys.argv[3]) % 360
# ----- Preprocessing START -----
# Add another column at the end of the grid, interpolate values for this column
# set time format to hours since 1970 and center the map around the given longitude
cdo.setreftime("1970-01-01,00:00:00", input="-sellonlatbox,{lon0},{lon1},-90,90 -settunits,hours -setcalendar,standard -masklonlatbox,0,360,-90,90 -remapnn,custom_grid.txt {input}".format(lon0=center-180, lon1=center+180.1, input=path_to_input), output=path_to_output, options = "-P 8 -f nc4 -z zip")
# ----- Preprocessing END -----
#!/bin/bash
start=$(($3 % 360 - 180))
sed -i -e "s/xfirst.*/xfirst\t = $start/g" custom_grid.txt
cdo -f nc4 -z zip -setreftime,'1970-01-01','00:00:00' -settunits,hours -setcalendar,standard -remapnn,custom_grid.txt $1 $2
......@@ -18,10 +18,12 @@ Stage: build
tar xzf cdo-1.9.8.tar.gz && rm cdo-1.9.8.tar.gz && cd cdo-1.9.8
./configure --with-netcdf=/usr/local && make && make install
cd .. && rm -rf cdo-1.9.8 && rm -rf hdf5-1.10.5 && rm -rf netcdf-c-4.7.2
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> /etc/profile && source /etc/profile
git clone https://gitlab.version.fz-juelich.de/vogelsang1/source.git && cd source
%environment
export LD_LIBRARY_PATH=/usr/local/lib:/root/hdf5-1.10.5/hdf5/lib:$LD_LIBRARY_PATH
%runscript
for (( i=2; i<=$#; i+=2 )) do
j=$((i+1))
......
Subproject commit 71c1ba567af4a0e81b07415d6f06db92b630c152
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