TerraClimate and Standardized Precipitation-Evapotranspiration Index (SPEI)
Last month, I have a chance to give a try TerraClimate data from Climatology Lab of University of California, Merced.
TerraClimate is a dataset of monthly climate and climatic water balance for global terrestrial surfaces from 1958-2020. These data provide important inputs for ecological and hydrological studies at global scales that require high spatial resolution and time-varying data. All data have monthly temporal resolution and a 4-km (1/24th degree) spatial resolution.
And here’s some of the datasets
Primary Climate Variables: Maximum temperature, minimum temperature, vapor pressure, precipitation accumulation, downward surface shortwave radiation, wind-speed
Derived variables: Reference evapotranspiration (ASCE Penman-Montieth), Runoff, Actual Evapotranspiration, Climate Water Deficit, Soil Moisture, Snow Water Equivalent, Palmer Drought Severity Index, Vapor pressure deficit
Name | Description | Units |
---|---|---|
aet |
Actual Evapotranspiration, monthly total | mm |
def |
Climate Water Deficit, monthly total | mm |
pet |
Potential evapotranspiration, monthly total | mm |
ppt |
Precipitation, monthly total | mm |
q |
Runoff, monthly total | mm |
soil |
Soil Moisture, total column - at end of month | mm |
srad |
Downward surface shortwave radiation | W/m2 |
swe |
Snow water equivalent - at end of month | mm |
tmax |
Max Temperature, average for month | °C |
tmin |
Min Temperature, average for month | °C |
vap |
Vapor pressure, average for month | kPa |
ws |
Wind speed, average for month | m/s |
vpd |
Vapor Pressure Deficit, average for month | kpa |
PDSI |
Palmer Drought Severity Index, at end of month | unitless |
If you are interested to download it, individual years data are accessible via this link: http://thredds.northwestknowledge.net:8080/thredds/catalog/TERRACLIMATE_ALL/data/catalog.html
I am planning to use TerraClimate data to calculate Standardize Precipitation-Evapotranspiration Index (SPEI). SPEI requires monthly precipitation and potential evapotranspiration data. To calculate SPEI, I will use climate-indices python package which enables the user to calculate SPEI using any gridded netCDF dataset.
In my previous blog post, I have write some articles related to SPI calculation using various type of data. I suggest those article as prerequisite reading for you to get familiar with the python package and how to prepare the data before starting the SPEI calculation, as the SPEI step is almost similar.
There are certain requirements for input files that vary based on input type.
Precipitation and potential evapotranspiration unit must be written as millimeters, milimeter, mm, inches, inch or in.
Data dimension and order must be written as lat, lon, time (Windows machine required this order) or time, lat, lon (Works tested on Mac/Linux and Linux running on WSL).
If your study area are big, it's better to prepare all the data following this dimension order: lat, lon, time as all the data will force following this order during SPEI calculation by NCO module. Let say you only prepare the data as is (leaving the order to lat, lon, time), it also acceptable but it will required lot of memory to use re-ordering the dimension, and usually NCO couldn't handle all the process and failed.
Calculate SPEI
Before starting the calculation, please make sure below points:
You are still inside `climate_indices` environment to start working on SPEI calculation.
Variable name on precipitation `--var_name_precip`, usually TerraClimate data use `ppt` as name while other precipitation data like CHIRPS using `precip` and IMERG using `precipitation` as a variable name. To make sure, check using command `ncdump -h file.nc` then adjust it in SPEI script if needed.
Variable name on potential evapotranspiration `--var_name_pet`, usually TerraClimate data use `pet` as name.
Precipitation and potential evapotranspiration unit must be written as `millimeters`, `milimeter`, `mm`, `inches`, `inch` or `in`.
Data dimension and order must be written as `lat`, `lon`, `time` (Windows machine required this order) or `time`, `lat`, `lon` (Works tested on Mac/Linux and Linux running on WSL).
Let's start the calculation! In your Terminal, run the following code.
process_climate_indices --index spei --periodicity monthly --netcdf_precip input_precipitation.nc --var_name_precip ppt --netcdf_pet input_pet.nc --var_name_pet pet --output_file_base wld_cli_spei --scales 1 2 3 6 9 12 18 24 36 48 60 72 --calibration_start_year 1958 --calibration_end_year 2020 --multiprocessing all
Above code is example for calculating SPEI 1 to 72-months. It's ok if you think you only need some of them. Example: you are interested to calculate SPEI 1 - 3-months or SPEI 12-months, then adjust above code into `--scales 1 2 3` or `--scales 12`.
The above command will compute SPEI (both gamma and Pearson Type III distributions) from monthly precipitation dataset and potential evapotranspiration, and the calibration period used will be Jan-1958 through Dec-2020. The index will be computed at `1`,`2`,`3`,`6`,`9`,`12`,`18`,`24`,`36`,`48`,`60` and `72-month` timescales. The output files will be <`out_dir>/wld_cli_spei_gamma_xx.nc`, and `<out_dir>/wld_cli_spei_pearson_xx.nc`.
After the calculation process is completed, you can visualize it using Panoply or convert to GeoTIFF using GDAL for further processing.
Global SPEI data and comparison with other data provider
Below is the example of global SPEI-12 as of December 2020
SPEI Global Drought Monitor
Santiago Begueria and friend from Spanish National Research Council who invented SPEI, released the SPEI Global Drought Monitor which offers near real-time information about drought conditions at the global scale, with a 1 degree spatial resolution and a monthly time resolution.
Link for SPEI 12-month, December 2020 from Global Drought Monitor - https://spei.csic.es/map/maps.html#months=4#month=11#year=2020
Climate Engine
Climate Engine is a free web application powered by Google Earth Engine that can be used to create on-demand maps and charts from publicly available satellite and climate data using a standard web browser. Climate Engine allows users to analyze and interact with climate and earth observations for decision support related to drought, water use, agricultural, wildfire, and ecology.
One of the product that could generate easily using Climate Engine is SPEI and using TerraClimate data. Link https://climengine.page.link/yMtH