<h2>TLDR;</h2>

<p>The precipitation values (and possibly some other variables; see below) need to be divided by 24.</p>

<h2>Background</h2>

<p>The global attributes of the netCDF file in the question provide an URL to a description page: <a href="http://coastmod.hzg.de" rel="noreferrer">coastmod.hzg.de</a></p>

<p>From that URL a user should be redirected to <a href="http://wiki.coast.hzg.de/display/MD" rel="noreferrer">wiki.coast.hzg.de/display/MD</a> (access at 9th Feb 2018). Unfortunately, the redirect does not work in the moment due to an internal server error (status: February 2018).</p>

<p>On <a href="http://wiki.coast.hzg.de/display/MD" rel="noreferrer">wiki.coast.hzg.de/display/MD</a> a comment is provided for the <strong>CORDEX-EastAsia</strong> data set -- reading:</p>

<blockquote>
  <p>pr (precipitation rate)</p>
  
  <p>Due to a post processing error all precipitation rates have to be divided by a factor of 24 to get the right dimension kg m-2 s-1.</p>
  
  <p>The following parameters may also be affected:
  evspsbl,mrro,mrros, prc, prhmax, prsn, snm</p>
</blockquote>

CC BY-SA 3.0
2018-02-09T09:57:31.080Z
2018-02-09T09:57:31.080Z
daniel.heydebreck
<p>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:</p>

<pre><code>pr_EAS-44_MPI-M-MPI-ESM-LR_rcp45_r1i1p1_CLMcom-CCLM5-0-2_v1_mon_208101-209012.nc
</code></pre>

<p>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. </p>

<p>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. </p>

<p>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:</p>

<p><a href="https://i.sstatic.net/lOUnQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lOUnQ.png" alt="per-cell precipitation histogram of total annual precipitation in mm"></a></p>

<p>I read the data into a rasterbrick in R, which gave me the warning,</p>

<pre><code>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
</code></pre>

<p>... 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.</p>

<p>EDIT: the header of the nc file:</p>

<pre><code>$ 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:
</code></pre>

<p>This is the R code I used for generating the data in the plot:</p>

<pre><code>library(raster)
library(purrr)
library(dplyr)

raster_brick &lt;- 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 &lt;- 1:12 %&gt;% map(~ raster_brick[[.]]) %&gt;% brick
# cell-wise sum
sum_raster &lt;- sum(first_year_rasters)
</code></pre>

<p>EDIT: Here are two screenshots of ncview of monthly data for 2053</p>

<p><a href="https://i.sstatic.net/XmlX8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XmlX8.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/RbLsf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RbLsf.png" alt="enter image description here"></a></p>

<p>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 ...</p>

<p>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.</p>

<p><a href="https://i.sstatic.net/Nz3UU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Nz3UU.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2018-02-06T10:13:07.350Z
Given that you have a 10 year file, are you sure you're not accidentally summing over the whole 10 years rather than just 12 months?  It also might be worth showing us the ncdump header for the `pr` variable.
Deditos
CC BY-SA 3.0
2018-02-06T14:12:46.627Z
I am not familiar with these R-packages. Therefore, I cannot give a comment to the data processes. But, if you look into the file with ncview (or something else), is the precipitation also in the wrong order of magnitude?
daniel.heydebreck
CC BY-SA 3.0
2018-02-06T17:27:52.350Z
Can't help with the R code either.  Does it work for other CORDEX models? It's also worth checking whether you are out by a factor of 10 or ~30, as the latter might indicate that the netCDF files weren't produced correctly, e.g., daily rates summed but not divided by N days.
Deditos
CC BY-SA 3.0
2018-02-07T17:05:41.377Z
Looking at the global attributes I realized that I might know the producer of the data. I'll try to contact him.
daniel.heydebreck
CC BY-SA 3.0
2018-02-09T09:42:06.140Z
The values have to be divided by 24. It is a known issue. For details please have a look here: http://wiki.coast.hzg.de/display/MD . The URL http://coastmod.hzg.de (see global attributes of the netCDF file) should point to the first URL. The redirect is (apparently) not working in the moment due to a server error.
daniel.heydebreck
<precipitation><climate-models><climatology><gis>
Confusion with precipitation values in CORDEX MPI-ESM rcp data
telegott
# Confusion with precipitation values in CORDEX MPI-ESM rcp data

(Asked by: username_0 on 2018-02-05)

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:

[![per-cell precipitation histogram of total annual precipitation in mm](https://i.sstatic.net/lOUnQ.png)](https://i.sstatic.net/lOUnQ.png)

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

[![enter image description here](https://i.sstatic.net/XmlX8.png)](https://i.sstatic.net/XmlX8.png)

[![enter image description here](https://i.sstatic.net/RbLsf.png)](https://i.sstatic.net/RbLsf.png)

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.

[![enter image description here](https://i.sstatic.net/Nz3UU.png)](https://i.sstatic.net/Nz3UU.png)

**Tags:** precipitation, climate-models, climatology, gis

> **Comments:**
> **username_1**: Given that you have a 10 year file, are you sure you're not accidentally summing over the whole 10 years rather than just 12 months?  It also might be worth showing us the ncdump header for the `pr` variable.  
> **username_2**: I am not familiar with these R-packages. Therefore, I cannot give a comment to the data processes. But, if you look into the file with ncview (or something else), is the precipitation also in the wrong order of magnitude?  
> **username_1**: Can't help with the R code either.  Does it work for other CORDEX models? It's also worth checking whether you are out by a factor of 10 or ~30, as the latter might indicate that the netCDF files weren't produced correctly, e.g., daily rates summed but not divided by N days.  
> **username_2**: Looking at the global attributes I realized that I might know the producer of the data. I'll try to contact him.  
> **username_2**: The values have to be divided by 24. It is a known issue. For details please have a look here: http://wiki.coast.hzg.de/display/MD . The URL http://coastmod.hzg.de (see global attributes of the netCDF file) should point to the first URL. The redirect is (apparently) not working in the moment due to a server error.  

---

## 1 answers

### Answer by username_2 on 2018-02-09. Score: 8 | Accepted answer

## TLDR;

The precipitation values (and possibly some other variables; see below) need to be divided by 24.

## Background

The global attributes of the netCDF file in the question provide an URL to a description page: [coastmod.hzg.de](http://coastmod.hzg.de)

From that URL a user should be redirected to [wiki.coast.hzg.de/display/MD](http://wiki.coast.hzg.de/display/MD) (access at 9th Feb 2018). Unfortunately, the redirect does not work in the moment due to an internal server error (status: February 2018).

On [wiki.coast.hzg.de/display/MD](http://wiki.coast.hzg.de/display/MD) a comment is provided for the **CORDEX-EastAsia** data set -- reading:

> pr (precipitation rate)
>
> Due to a post processing error all precipitation rates have to be divided by a factor of 24 to get the right dimension kg m-2 s-1.
>
> The following parameters may also be affected:
> evspsbl,mrro,mrros, prc, prhmax, prsn, snm


---

