I want to analyze climate projection data for the different RCPs for a region in north western India, which has an arid climate. I chose MPI-ESM data downscaled with CORDEX. An example filename looks like this:
pr_EAS-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_CLMcom-CCLM5-0-2_v1_mon_208101-209012.nc
However, while all other variables like temperature, windspeed, relative humidity are on the right, scale, the precipitation is completely off. The unit in the precipitation nc files is specified as kg m-2 s-1, which would equal a precipitation height of mm s-1.
Since I have monthly data, multiplying the precipitation value with 86400 should get me to days, multiplying that with 30.42 should get me to months. If I now select a random year and do a cell-wise summation, I should get the total annual precipitation.
The results are off by an order of magnitude. Here's a histogram of the cells showing total annual precipitation in mm for the EAS44 domain:
I read the data into a rasterbrick in R, which gave me the warning,
Warning messages:
1: In .getCRSfromGridMap4(atts) : cannot process these parts of the CRS:
grid_north_pole_latitude=77.6100006103516; grid_north_pole_longitude=-64.7799987792969
2: In .getCRSfromGridMap4(atts) : cannot create a valid CRS
grid_north_pole_latitude=77.6100006103516; grid_north_pole_longitude=-64.7799987792969
... since it is on a curvilinear grid. I then subsetted the first twelve elements and calculated the values. I somewhere read about scale factors and offsets in nc files, however, in my case I couldn't find a hint on something like that.
EDIT: the header of the nc file:
$ ncdump pr_EAS-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_CLMcom-CCLM5-0-2_v1_mon_208101-209012.nc
netcdf pr_EAS-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_CLMcom-CCLM5-0-2_v1_mon_208101-209012 {
dimensions:
bnds = 2 ;
rlon = 203 ;
rlat = 167 ;
time = UNLIMITED ; // (120 currently)
variables:
char rotated_pole ;
rotated_pole:grid_mapping_name = "rotated_latitude_longitude" ;
rotated_pole:grid_north_pole_latitude = 77.61f ;
rotated_pole:grid_north_pole_longitude = -64.78f ;
double rlon(rlon) ;
rlon:axis = "X" ;
rlon:standard_name = "grid_longitude" ;
rlon:long_name = "longitude in rotated pole grid" ;
rlon:units = "degrees" ;
double lon(rlat, rlon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
double rlat(rlat) ;
rlat:axis = "Y" ;
rlat:standard_name = "grid_latitude" ;
rlat:long_name = "latitude in rotated grid" ;
rlat:units = "degrees" ;
double lat(rlat, rlon) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
double time(time) ;
time:units = "days since 1949-12-01 00:00:00" ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:calendar = "proleptic_gregorian" ;
time:bounds = "time_bnds" ;
double time_bnds(time, bnds) ;
time_bnds:long_name = "time bounds" ;
float pr(time, rlat, rlon) ;
pr:standard_name = "precipitation_flux" ;
pr:long_name = "Precipitation" ;
pr:units = "kg m-2 s-1" ;
pr:cell_methods = "time: mean" ;
pr:coordinates = "lon lat" ;
pr:grid_mapping = "rotated_pole" ;
pr:missing_value = 1.e+20f ;
pr:_FillValue = 1.e+20f ;
// global attributes:
:Conventions = "CF-1.4" ;
:conventionsURL = "http://www.cfconventions.org" ;
:creation_date = "2017-09-07T11:34:35" ;
:contact = "http://coastmod.hzg.de" ;
:experiment_id = "rcp45" ;
:driving_model_id = "MPI-M-MPI-ESM-LR" ;
:driving_model_ensemble_member = "r1i1p1" ;
:driving_experiment_name = "rcp45" ;
:frequency = "mon" ;
:institute_id = "CLMcom" ;
:rcm_version_id = "v1" ;
:model_id = "CLMcom-CCLM5-0-2" ;
:project_id = "CORDEX" ;
:CORDEX_domain = "EAS-44" ;
:product = "output" ;
:experiment = "rcp45" ;
:driving_experiment = "MPI-M-MPI-ESM-LR, rcp45, r1i1p1" ;
:Institution = "Helmholtz-Zentrum Geesthacht" ;
:references = "http://cordex.clm-community.eu" ;
:institution_run_id = "r15m4r4" ;
:institution_data_path = "/hpss/arch/gg0302/g260068/CORDEX-EA/r15m4r4" ;
:source = "Climate Limited-area Modelling Community (CLM-Community)" ;
:title = "CLMcom-CCLM5-0-2 model output prepared for CORDEX rcp45" ;
:comment = "Please use the following reference for this climate data: Climate projection performed by Helmholtz-Zentrum Geesthacht in the Climate Limited-area Modelling Community (CLM-Community)" ;
data:
This is the R code I used for generating the data in the plot:
library(raster)
library(purrr)
library(dplyr)
raster_brick <- brick('original_data/pr_EAS-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_CLMcom-CCLM5-0-2_v1_mon_205101-206012.nc')*86400*30.42
# map the first twelve raster into a list of rasters and merge them into a new rasterbrick
first_year_rasters <- 1:12 %>% map(~ raster_brick[[.]]) %>% brick
# cell-wise sum
sum_raster <- sum(first_year_rasters)
EDIT: Here are two screenshots of ncview of monthly data for 2053
The unit clearly is stated as kg per square meter and second. The datapoint for July 2053 is at about 0.00375 kg m-2 -s1, that equals a monthly precipitation of 0.00375*86400*30.42 = 9.9 meters ...
Here's a screenshot from the 2006-2100 monthly precipitation values from RCP4.5, CMIP5, MPI-ESM-MR model. I used the cdo operator -yearsum on it, so these should correspond to the annual precipitation in kg m-2 s-1. Multiplied with 86400*30.42 I still arrive at the order of magnitude of several meters.
pr
variable. $\endgroup$