{"id":2334,"date":"2019-12-11T15:05:14","date_gmt":"2019-12-11T15:05:14","guid":{"rendered":"http:\/\/www.meiotic.co.uk\/my\/?p=2334"},"modified":"2019-12-12T11:36:35","modified_gmt":"2019-12-12T11:36:35","slug":"chess-effective-precipitation","status":"publish","type":"post","link":"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/","title":{"rendered":"Playing CHESS with Effective Rainfall (GB)"},"content":{"rendered":"<p><script>document.getElementById('menu-item-102').className += \" current-menu-item current_page_item\";<\/script><br \/>\nIt&#8217;s useful to know how much water enters a system, particularly as part of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Runoff_model_(reservoir)\" target=\"_blank\">runoff model<\/a>. I&#8217;ve always thought of the budget of precipiation (Prec) &#038; potential evapotranspiration (PET) as <em>effective rainfall<\/em> (Rain<sub>eff<\/sub>), but you rarely see it calculated with anything other than <em>precipitation<\/em> data, which is what I&#8217;m using here.<\/p>\n<p>Using Precipitation and PET data from the Climate, Hydrology and Ecology research Support System (<a href=\"https:\/\/eip.ceh.ac.uk\/chess\" target=\"_blank\">CHESS<\/a>), we can generate effective rainfall data at a 1km resolution for most of GB (sorry, <a href=\"https:\/\/www.bbc.co.uk\/news\/uk-scotland-scotland-politics-45733111\" target=\"_blank\">Shetland<\/a>). The monthly NetCDF files (.nc) available for download include data for every day as a separate layer.<\/p>\n<h4 style=\"margin-top:.0px;\">GIF time<\/h4>\n<p>Before we get into the nuts and bolts, let&#8217;s have a look at some outputs! Shown below is the variation in effective rainfall over the last 10 years, centred on the Kintyre peninsula. Although there are a couple of dry years, there are annual values of over 3000mm on the higher ground &#8211; that&#8217;s 3 metres of rain!<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.meiotic.co.uk\/my\/wp-content\/uploads\/2019\/12\/eff_rain_2006-2015_kintyre.gif\" alt=\"Effective Rainfall 2006-2015, Kintyre\" width=\"765\" height=\"500\" class=\"alignnone size-full wp-image-2391\" \/><\/p>\n<p>So how do we go about generating this?<\/p>\n<h4>Calculating Effective Rainfall<\/h4>\n<p>The basic formula to calculate these values is as follows:<\/p>\n<p><strong>Rain<sub>eff<\/sub> = Prec &#8211; PET<\/strong><\/p>\n<p>But there are a couple of caveats:<\/p>\n<ul>\n<li>You can&#8217;t evaporate more water than there is<\/li>\n<li>The remaining water at the end of each day is the starting point for the next<\/li>\n<\/ul>\n<p>Essentially every day you have a starting point which is the previous day&#8217;s end point. By way of example, here&#8217;s a running total:<\/p>\n<table>\n<tr>\n<td>Day<\/td>\n<td>Eff Rain (Day-1)<\/td>\n<td>Prec<\/td>\n<td>PET<\/td>\n<td>Eff Rain<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0.0<\/td>\n<td>1.1<\/td>\n<td>0.7<\/td>\n<td>0.0 + 1.1 &#8211; 0.7 = <strong>0.4<\/strong><\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>0.4<\/td>\n<td>0.9<\/td>\n<td>0.8<\/td>\n<td>0.4 + 0.9 &#8211; 0.8 = <strong>0.5<\/strong><\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>0.5<\/td>\n<td>0.1<\/td>\n<td>0.7<\/td>\n<td>0.5 + 0.1 &#8211; 0.7 = -0.1 -> <strong>0.0<\/strong><\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>0.0<\/td>\n<td>0.8<\/td>\n<td>0.6<\/td>\n<td>0.0 + 0.8 &#8211; 0.6 = <strong>0.2<\/strong><\/td>\n<\/tr>\n<\/table>\n<p>From that you can see the running equation for any given day (d) is actually:<\/p>\n<p><strong>Rain<sub>eff<sub>d<\/sub><\/sub> = Rain<sub>eff<sub>d-1<\/sub><\/sub> + Prec<sub>d<\/sub> &#8211; PET<sub>d<\/sub><\/strong><\/p>\n<h4>Processing the Data<\/h4>\n<p>Handling NetCDF is really easy in R, and more intuitive than other GIS systems. Using the raster package we can quickly run through each .nc file and access loop through the daily layers one at a time. I&#8217;ve written this script to expect the <u>same number<\/u> of months in each year and for all months to be <u>concurrent<\/u>. The output files are named for each year, so I would recomment having a <u>all twelve months<\/u> for each year also. It&#8217;s worth noting that each year starts again using a &#8216;running total&#8217; of zero, but this will have little impact on the annual sum &#8211; it&#8217;s common to see each year treated as a separate entity.<\/p>\n<p>Other than downloading your desired data and setting the range at the top of the script, there&#8217;s not much to do but run it &#8211; the running equation shown above is implemented and annual raster files (.tif) are exported. I&#8217;ve made the script available on <a href=\"https:\/\/github.com\/ScienceAndMaps\/CHESS\/blob\/master\/CHESS_eff_rain.R\" target=\"_blank\">GitHub<\/a>, but it&#8217;s also embedded below:<\/p>\n<style type=\"text\/css\">\n.gist-it-gist .gist-file .gist-data {background-color:#fcf7f2 !important; border-left:solid 4px rgb(230, 164, 85) !important;}\n.gist-meta {background-color:white !important;}\n.prettyprint {overflow:hidden !important;}\n<\/style>\n<div style=\"margin-left:5% !important; margin-right:5% !important;\">\n<script src=\"http:\/\/gist-it.appspot.com\/https:\/\/github.com\/ScienceAndMaps\/CHESS\/blob\/master\/CHESS_eff_rain.R\" style=\"background-color:white;\"><\/script>\n<\/div>\n<h4 style=\"margin-top:20px;\">Data<\/h4>\n<p>It&#8217;s worth noting that downloads can be automated using the <a href=\"https:\/\/eip.ceh.ac.uk\/thredds\" target=\"_blank\">CEH THREDDS server<\/a> (requires login), or downloaded individually from these sources:<\/p>\n<ul>\n<li><a href=\"https:\/\/catalogue.ceh.ac.uk\/documents\/8baf805d-39ce-4dac-b224-c926ada353b7\" target=\"_blank\">CHESS PET \/ PETI<\/a><\/li>\n<li><a href=\"https:\/\/catalogue.ceh.ac.uk\/documents\/b745e7b1-626c-4ccc-ac27-56582e77b900\" target=\"_blank\">CHESS Precipitation<\/a><\/li>\n<\/ul>\n<h4 style=\"margin-top:.0px;\">DOI<\/h4>\n<p>This article is an attempt to use a new approach to writing and publishing code. The code lives on <a href=\"https:\/\/github.com\/ScienceAndMaps\/CHESS\/blob\/master\/CHESS_eff_rain.R\" target=\"_blank\">GitHub<\/a> and is automatically synced above using <a href=\"https:\/\/gist-it.appspot.com\/\" target=\"_blank\">gist-it<\/a> and synced to <a href=\"https:\/\/zenodo.org\/\" target=\"_blank\">Zenodo<\/a> to get a DOI (linked below). Many thanks to <a href=\"http:\/\/mikerspencer.com\/\" target=\"_blank\">Mike Spencer<\/a> for highlighting this approach at <a href=\"https:\/\/uk.osgeo.org\/foss4guk2019\/\" target=\"_blank\">FOSS4G UK 2019<\/a>.<\/p>\n<p><a href=\"https:\/\/zenodo.org\/badge\/latestdoi\/227450715\"><img decoding=\"async\" src=\"https:\/\/zenodo.org\/badge\/227450715.svg\" alt=\"DOI\"><\/a><\/p>\n<h4 style=\"margin-top:.0px;\">References<\/h4>\n<p>Robinson, E.L.; Blyth, E.; Clark, D.B.; Comyn-Platt, E.; Finch, J.; Rudd, A.C. (2016). Climate hydrology and ecology research support system potential evapotranspiration dataset for Great Britain (1961-2015) [CHESS-PE] . NERC Environmental Information Data Centre. <a href=\"https:\/\/doi.org\/10.5285\/8baf805d-39ce-4dac-b224-c926ada353b7\" target=\"_blank\">DOI: 10.5285\/8baf805d-39ce-4dac-b224-c926ada353b7<\/a><\/p>\n<p>Robinson, E.L.; Blyth, E.; Clark, D.B.; Comyn-Platt, E.; Finch, J.; Rudd, A.C. (2017). Climate hydrology and ecology research support system meteorology dataset for Great Britain (1961-2015) [CHESS-met] v1.2. NERC Environmental Information Data Centre.  <a href=\"https:\/\/doi.org\/10.5285\/b745e7b1-626c-4ccc-ac27-56582e77b900\" target=\"_blank\">DOI: 10.5285\/b745e7b1-626c-4ccc-ac27-56582e77b9007<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s useful to know how much water enters a system, particularly as part of the runoff model. I&#8217;ve always thought of the budget of precipiation (Prec) &#038; potential evapotranspiration (PET) as effective rainfall (Raineff), but<\/p>\n","protected":false},"author":1,"featured_media":2397,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[8,122,9,121,110,58],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.7.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Playing CHESS with Effective Rainfall (GB) | *meiotic*<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Playing CHESS with Effective Rainfall (GB) | *meiotic*\" \/>\n<meta property=\"og:description\" content=\"It&#8217;s useful to know how much water enters a system, particularly as part of the runoff model. I&#8217;ve always thought of the budget of precipiation (Prec) &#038; potential evapotranspiration (PET) as effective rainfall (Raineff), but\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/\" \/>\n<meta property=\"og:site_name\" content=\"*meiotic*\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-11T15:05:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-12T11:36:35+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.meiotic.co.uk\/my\/wp-content\/uploads\/2019\/12\/CHESS_cover.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"765\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"meiotic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ScienceAndMaps\" \/>\n<meta name=\"twitter:site\" content=\"@ScienceAndMaps\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"meiotic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/\",\"url\":\"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/\",\"name\":\"Playing CHESS with Effective Rainfall (GB) | *meiotic*\",\"isPartOf\":{\"@id\":\"https:\/\/www.meiotic.co.uk\/my\/#website\"},\"datePublished\":\"2019-12-11T15:05:14+00:00\",\"dateModified\":\"2019-12-12T11:36:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.meiotic.co.uk\/my\/#\/schema\/person\/1995e1cecd67d2ff1e6a638aa331d032\"},\"breadcrumb\":{\"@id\":\"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.meiotic.co.uk\/my\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Playing CHESS with Effective Rainfall (GB)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.meiotic.co.uk\/my\/#website\",\"url\":\"https:\/\/www.meiotic.co.uk\/my\/\",\"name\":\"*meiotic*\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.meiotic.co.uk\/my\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.meiotic.co.uk\/my\/#\/schema\/person\/1995e1cecd67d2ff1e6a638aa331d032\",\"name\":\"meiotic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.meiotic.co.uk\/my\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/0.gravatar.com\/avatar\/cacd48b532259fb621d7acf4cc462290?s=96&d=retro&r=r\",\"contentUrl\":\"http:\/\/0.gravatar.com\/avatar\/cacd48b532259fb621d7acf4cc462290?s=96&d=retro&r=r\",\"caption\":\"meiotic\"},\"sameAs\":[\"http:\/\/meiotic.co.uk\",\"https:\/\/twitter.com\/ScienceAndMaps\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Playing CHESS with Effective Rainfall (GB) | *meiotic*","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_GB","og_type":"article","og_title":"Playing CHESS with Effective Rainfall (GB) | *meiotic*","og_description":"It&#8217;s useful to know how much water enters a system, particularly as part of the runoff model. I&#8217;ve always thought of the budget of precipiation (Prec) &#038; potential evapotranspiration (PET) as effective rainfall (Raineff), but","og_url":"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/","og_site_name":"*meiotic*","article_published_time":"2019-12-11T15:05:14+00:00","article_modified_time":"2019-12-12T11:36:35+00:00","og_image":[{"width":765,"height":500,"url":"http:\/\/www.meiotic.co.uk\/my\/wp-content\/uploads\/2019\/12\/CHESS_cover.jpg","type":"image\/jpeg"}],"author":"meiotic","twitter_card":"summary_large_image","twitter_creator":"@ScienceAndMaps","twitter_site":"@ScienceAndMaps","twitter_misc":{"Written by":"meiotic","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/","url":"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/","name":"Playing CHESS with Effective Rainfall (GB) | *meiotic*","isPartOf":{"@id":"https:\/\/www.meiotic.co.uk\/my\/#website"},"datePublished":"2019-12-11T15:05:14+00:00","dateModified":"2019-12-12T11:36:35+00:00","author":{"@id":"https:\/\/www.meiotic.co.uk\/my\/#\/schema\/person\/1995e1cecd67d2ff1e6a638aa331d032"},"breadcrumb":{"@id":"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.meiotic.co.uk\/my\/research\/effective-rainfall-chess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.meiotic.co.uk\/my\/"},{"@type":"ListItem","position":2,"name":"Playing CHESS with Effective Rainfall (GB)"}]},{"@type":"WebSite","@id":"https:\/\/www.meiotic.co.uk\/my\/#website","url":"https:\/\/www.meiotic.co.uk\/my\/","name":"*meiotic*","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.meiotic.co.uk\/my\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.meiotic.co.uk\/my\/#\/schema\/person\/1995e1cecd67d2ff1e6a638aa331d032","name":"meiotic","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.meiotic.co.uk\/my\/#\/schema\/person\/image\/","url":"http:\/\/0.gravatar.com\/avatar\/cacd48b532259fb621d7acf4cc462290?s=96&d=retro&r=r","contentUrl":"http:\/\/0.gravatar.com\/avatar\/cacd48b532259fb621d7acf4cc462290?s=96&d=retro&r=r","caption":"meiotic"},"sameAs":["http:\/\/meiotic.co.uk","https:\/\/twitter.com\/ScienceAndMaps"]}]}},"_links":{"self":[{"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/posts\/2334"}],"collection":[{"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/comments?post=2334"}],"version-history":[{"count":73,"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/posts\/2334\/revisions"}],"predecessor-version":[{"id":2410,"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/posts\/2334\/revisions\/2410"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/media\/2397"}],"wp:attachment":[{"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/media?parent=2334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/categories?post=2334"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.meiotic.co.uk\/my\/wp-json\/wp\/v2\/tags?post=2334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}