"""
Aina Johannessen. 
2017/2018 - Masterthesis

"""


#get wind at 250 hpa and height 500-1000 hpa:


#---PATHS-----------------------------------------------------------------------------------
path_gribs="../gribs/"
#path_figures="../figs/"
#path_norestore_files="/Users/ainajohannessen/Documents/Aina/skole/master/Masterthesis/data_norstore/"

#-------------------------------------------------------------------------------------------
#dates=( 20160920 20160921 20160922 20160923 20160924 20160925 20160926 20160927 20160928 20160929 20160930 20161001 )
dates=(20160930)
times=( 0000 0600 1200 1800 ) # 1200 1800 )

for date in ${dates[@]}; do
	for time in ${times[@]}; do	
		path_name_wind="${path_gribs}param_uv_${date}_${time}.grib"
                #wind at 250 hpa
		wind="cdo -sellevel,25000 ${path_name_wind} ${path_gribs}wind250_${date}_${time}.grib"
		echo $wind
		$wind
		path_name_z="${path_gribs}param_z_${date}_${time}.grib"
                #Thickness=z_500 - z_1000 is thickness of layer between 1000 hpa and 500 hpa
		Thickness="cdo -R -sub -sellevel,50000 ${path_name_z} -sellevel,100000 ${path_name_z} ${path_gribs}Z_1000_500_${date}_${time}.grib"
		echo $Thickness
		$Thickness
	done
done

#path_name_z="${path_norestore_files}SCA/pl/z/param_z_${date}_${time}.grib"
#z_500="cdo sellevidx,9 ${path_name_z} ${path_gribs}z500.grib"
#Thicness="cdo -R -sub -sellevidx,9 ${path_name_z} -sellevidx,1 ${path_name_z} ${path_gribs}Z_1000_500.grib"
#cdo -R -sub -sellevidx,9 data_norstore/SCA/pl/z/param_z_20160920_0000.grib -sellevidx,1 ...
#  ..  data_norstore/SCA/pl/z/param_z_20160920_0000.grib test_Z_1000_500.grib
