<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Isak Roalkvam</title>
<link>https://www.iroalkvam.com/</link>
<atom:link href="https://www.iroalkvam.com/index.xml" rel="self" type="application/rss+xml"/>
<description>Website created by Isak Roalkvam for my MSCA postdoctoral fellowship project at Aarhus University</description>
<generator>quarto-1.7.32</generator>
<lastBuildDate>Mon, 09 Feb 2026 23:00:00 GMT</lastBuildDate>
<item>
  <title>Deriving relative sea-level curves from the output of glacial isostatic adjustment models</title>
  <dc:creator>Isak Roalkvam</dc:creator>
  <link>https://www.iroalkvam.com/posts/02gia_models/</link>
  <description><![CDATA[ 





<p>This post provides a very brief introduction to physics-based models of glacial isostatic adjustment (GIA) and then goes on to show how the data derived from these can be accessed and used to retrieve a time-series of relative sea-level (RSL) change for a specific location. For this post I had to familiarise myself a bit more with the NetCDF format, which is popular for disseminating predictions from these kinds of models. The post is therefore meant to be a write-up with technical details for how to retrieve RSL data from the published result of GIA models, specifically ICE-7G_NA (Roy and Peltier 2015, 2017, 2018), along with some useful references. The technical walk-through in the text is done with Python, and at the end I have included a condensed version of the same workflow in R. I will underscore that I’m an archaeologist and not a geologist nor a geophysicists and I would encourage any reader (including future me) to approach this very much as a starting point for any dealings with GIA models.</p>
<section id="introduction-to-gia-models" class="level2" data-number="1">
<h2 data-number="1" class="anchored" data-anchor-id="introduction-to-gia-models"><span class="header-section-number">1</span> Introduction to GIA models</h2>
<p>A central aspect of my postdoc project pertains to investigating the relationship between archaeological sites and past sea-level change. I’m therefore in the process of getting a better grasp of the mechanisms that drive sea-level change and the ways in which this can be drawn on to reconstruct past sea-levels. My work with sea-level change has so far been based on empirical data and the shoreline displacement curves that have been derived from these (Roalkvam 2023, Romundset et al.&nbsp;2026). These map changes in the relative sea-level over time. That is, they concern changes to the elevation of the sea relative to land. However, the relative sea-level is (predominantly) the result of two combined effects. The first is eustatic changes to the global mean sea-level resulting from exchange of water between ice sheets and ocean. The other is isostatic changes to the surface elevation of the Earth following from its response to the redistribution of weight caused by melting and forming ice sheets. An important endeavour within the field of geophysics and geodynamics is to combine physics-based models with data on ice history and Earth rheology in so-called GIA models to predict how the sea-level and surface elevation respond to changing ice loads over time, thereby making it possible to isolate the distinct effects of eustatic and isostatic adjustments (see e.g.&nbsp;Peltier 1998 for a fairly accessible account).</p>
<p>To be able to unpick the relationship between sea-level change as induced by forming or melting ice sheets that impact the global mean sea-level, and the adjustments to the surface of the Earth that follow from its viscoelsatic response to the redistribution of weight, these models are typically global in scope, although they might be focused towards specific regions. Despite being global in scope they can nonetheless be very valuable in conjunction with empirically based local reconstructions of sea-level change. For my purposes, this especially pertains to how empirically derived displacement curves are often based on fragmented data associated with considerable temporal as well as spatial uncertainties, meaning that the GIA models can provide an important frame of reference against which to evaluate or condition purely empirical reconstructions. As GIA models provide a model for glaciation history that is physically coherent given the global history of glacaiation and deglacation, any local deviation from these expected patterns can potentially offer valuable information on local conditions. Ultimately, GIA models can only be approximations of a complex real world system, but if properly validated against geomorphological records of past conditions they hold the potential to provide plausible estimates for future geodynamical change.</p>
</section>
<section id="gia-models-and-ice-7g_na-vm7" class="level2" data-number="2">
<h2 data-number="2" class="anchored" data-anchor-id="gia-models-and-ice-7g_na-vm7"><span class="header-section-number">2</span> GIA-models and ICE-7G_NA (VM7)</h2>
<p>The precise model output that I will work with here comes from ICE-7G_NA (VM7). This, along with the result from other variations of the ICE-xG models is available from the website of W.R. Peltier: <a href="https://www.atmosp.physics.utoronto.ca/~peltier/data.php" class="uri">https://www.atmosp.physics.utoronto.ca/~peltier/data.php</a>.</p>
<p>To briefly present the core components of this model, the “ICE-7G” part of the name of the model refers to a specific ice thickness history. The extension “NA” refers to the fact that this model has been fine-tuned against geophysical observations in North America and then been evaluated in terms of its global exportability (see Roy and Peltier 2018). The parenthesis after the name of the ice history model refers to this data having been derived when employing the radial viscosity profile named VM7.</p>
<p>I will not attempt to lay out further details of how these models are calculated here, but in addition to the references given above, some important literature are the first formulations of the so-called sea-level equation (Farrell and Clark 1976; Clark et al.&nbsp;1978) which forms the numerical foundation for GIA models, and a series of important refinements and further developments of the sea-level equation underlie current GIA models (see e.g.&nbsp;Peltier and Tushingham 1989; Mitrovica and Milne 2003; and Whitehouse 2018 for a historical account). In addition to these references, papers related to the previous versions of the iCE-xG models are also useful (e.g.&nbsp;Peltier et al.&nbsp;2015, 2018; Purcell et al.&nbsp;2016), in addition to those associated with other GIA models (e.g.&nbsp;Lambeck et al.&nbsp;2014, 2017). Finally, while this post only deals with using existing results from a GIA model to plot RSL-change, open software is available to implement these models, allowing for the exploration of different input variables and parameter settings, and to adjust temporal and spatial resolutions (Spada and Melini 2019).</p>
<p>Returning to the GIA model we are dealing with here, the files representing the output from ICE-7G_NA (VM7) number a total of 48 NetCDF-files. They are named following the structure “I7G_NA.VM7_1deg.26.nc”, “I7G_NA.VM7_1deg.25.nc”, etc. You will notice that only the number just before “.nc” is changing between these. In these file names “I7G_NA.VM7” denotes the ice history and radial viscosity used in the model that produced the files. The part that reads “1deg” signifies that the data comes at a spatial resolution of 1x1 degrees. The number after this denotes the time-slice that a specific file pertains to, given in thousand years (ka) BP. In the examples above 26 and 25 ka BP, respectively. Finally, “nc” is the file extension for the NetCDF (Network Common Data Form) format.</p>
</section>
<section id="netcdf-and-xarray-in-python" class="level2" data-number="3">
<h2 data-number="3" class="anchored" data-anchor-id="netcdf-and-xarray-in-python"><span class="header-section-number">3</span> NetCDF and xarray in Python</h2>
<p>To precisely recreate the steps and output to follow, you will need to download the ICE-7G_NA files from Peltier’s website linked to above. In total, these have a size of about 38 MB. However, the code will also run with a smaller subset of the files if you only want to explore some of the functionality of the code. As stated in the beginning, I will work through this in Python in some detail, but a condensed version to achieve the same in R can be found towards the end. To read in NetCDF data in Python we can use the xarray library (Hoyer and Hamman 2017). We’ll start by reading in and exploring one of these files. I’ve chosen the one pertaining to 12 ka BP for this:</p>
<div id="a3e901dd" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os</span>
<span id="cb1-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> xarray <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> xr</span>
<span id="cb1-3"></span>
<span id="cb1-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Replace file path to where you have stored your NetCDF file(s) to load the data</span></span>
<span id="cb1-5">ds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> xr.open_dataset(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../ICE-7G_NA(VM7)/I7G_NA.VM7_1deg.12.nc"</span>)</span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print the structure of the xarray dataset</span></span>
<span id="cb1-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(ds)</span></code></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>&lt;xarray.Dataset&gt; Size: 782kB
Dimensions:    (lat: 180, lon: 360)
Coordinates:
  * lat        (lat) float64 1kB -89.5 -88.5 -87.5 -86.5 ... 86.5 87.5 88.5 89.5
  * lon        (lon) float64 3kB 0.5 1.5 2.5 3.5 4.5 ... 356.5 357.5 358.5 359.5
Data variables:
    stgit      (lat, lon) float32 259kB ...
    Topo       (lat, lon) float32 259kB ...
    Topo_Diff  (lat, lon) float32 259kB ...
Attributes:
    Model:            ICE=ICE-7G_NA, Viscosity=VM7
    Date:             December 17, 2019
    Author:           W.R. Peltier, Dept of Physics, Univ of Toronto,Canada
    Acknowledgement:  Please cite following papers [PAPER1 and PAPER2 investi...
    PAPER1:           Roy, Keven, and W. R. Peltier - Glacial isostatic adjus...
    PAPER2:           Roy, Keven, and W. R. Peltier - Space-geodetic and wate...
    PAPER3:           Roy, Keven, and W. R. Peltier - Relative sea level in t...</code></pre>
</div>
</div>
<p>This tells us that the data has two coordinates given in latitude (<em>lat</em>) and longitude (<em>lon</em>), and three data variables, the values of which are mapped to these coordinates. At the bottom we also get some metadata associated with the file. The first of the three data variables is ice thickness (<em>stgit</em>). That is, the values for <em>stgit</em> for a given coordinate pair gives the thickness of ice cover at that location at 12 ka BP. The second variable gives the topography (<em>Topo</em>), which is the surface elevation of land, ocean bottom (bathymetry) and ice cover, with 0 m representing the present-day mean sea-level. The final variable is the difference between the topography at this time slice and the present topography (<em>Topo_Diff</em>). To find the relative sea-level for a given location we will use the <em>Topo_Diff</em> variable.</p>
<p>Where ice is present the difference to the present surface elevation will be defined by the thickness of the ice and not the sea. So for locations covered by ice the RSL is undefined. In other areas where <em>Topo_Diff</em> is positive this indicates that the surface was higher than what it was at 12 ka BP, meaning that the relative sea-level was lower. Conversely, negative values for <em>Topo_Diff</em> indicates that the surface was lower in the past, and consequently that the RSL was higher. This therefore means that by flipping the sign of <em>Topo_Diff</em> we effectively find the relative sea-level for any given location, provided it was not covered by ice at that point in time. (Note that the output of other GIA models might look different from this, and sometimes already hold a variable for RSL).</p>
<div id="39ce0b09" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Change the sign of Topo_Diff and exclude areas covered by ice</span></span>
<span id="cb3-2">rsl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>ds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Topo_Diff"</span>].where(ds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div>
</div>
</section>
<section id="global-map-of-ice-cover-and-rsl-at-12-ka-bp" class="level2" data-number="4">
<h2 data-number="4" class="anchored" data-anchor-id="global-map-of-ice-cover-and-rsl-at-12-ka-bp"><span class="header-section-number">4</span> Global map of ice cover and RSL at 12 ka BP</h2>
<p>As both a sanity check and to see what the global pattern for ice cover and relative sea-level looks like according to ICE-7G_NA at 12 ka BP we can plot this on a map:</p>
<div id="ae12e408" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Import libraries for plotting and handling coordinate reference systems</span></span>
<span id="cb4-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb4-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> matplotlib.colors <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> TwoSlopeNorm</span>
<span id="cb4-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> cartopy.crs <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> ccrs</span>
<span id="cb4-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> cartopy.feature <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> cfeature</span>
<span id="cb4-6"></span>
<span id="cb4-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Set up plot</span></span>
<span id="cb4-8">fig <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.figure(figsize <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb4-9"></span>
<span id="cb4-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Provide a coordinate reference system that is often used with global data</span></span>
<span id="cb4-11">ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.axes(projection <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree())</span>
<span id="cb4-12"></span>
<span id="cb4-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ice cover and relative sea level</span></span>
<span id="cb4-14">pcm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.pcolormesh(ds.lon, ds.lat, rsl,</span>
<span id="cb4-15">    shading <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"auto"</span>, cmap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RdBu_r"</span>,</span>
<span id="cb4-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Center the colour scale and limit its range to +/- 100 m</span></span>
<span id="cb4-17">    norm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TwoSlopeNorm(vmin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, vcenter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, vmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>))</span>
<span id="cb4-18"></span>
<span id="cb4-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot the outline of the ice covers</span></span>
<span id="cb4-20">ax.contour(ds.lon, ds.lat, ds.stgit, levels <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb4-21">    colors <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, linewidths <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>)</span>
<span id="cb4-22"></span>
<span id="cb4-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot labels and title</span></span>
<span id="cb4-24">plt.colorbar(pcm, label <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Relative sea-level (m)"</span>)</span>
<span id="cb4-25">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Longitude"</span>)</span>
<span id="cb4-26">plt.ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Latitude"</span>)</span>
<span id="cb4-27">plt.title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ICE-7G_NA (VM7): Global ice cover and relative sea-level at 12 ka BP"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.iroalkvam.com/posts/02gia_models/index_files/figure-html/cell-4-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<p>This looks sensible. Areas closer to glaciated areas tend to have a higher RSL relative to the present, and areas further afield have a smaller or negative RSL. We can now use all of the NetCDF files to find the GIA predicted trajectory for RSL change over time at some specific locations.</p>
</section>
<section id="rsl-change-for-specific-locations" class="level2" data-number="5">
<h2 data-number="5" class="anchored" data-anchor-id="rsl-change-for-specific-locations"><span class="header-section-number">5</span> RSL-change for specific locations</h2>
<p>As my postdoc project deals with the region of Kattegat and Skagerrak, I will choose locations from this area, but you can replace the coordinates in the code below to whatever location you are interested in.</p>
<p>First we will need to read in all of the NetCDF files to be able to combine the RSLs for each time-slice into a time-series. This could be done by a for-loop that reads in each individual file and extracts the time and RSL at the location of interest. For a bit more stability and functionality, and to make it easier to extract RSL-change for other locations later on, we will instead read in the NetCDF files and combine these in a xarray stack and assign each element a time coordinate to help us keep track of them.</p>
<div id="28425c59" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Import some additional libraries to facilitate reading in multiple files and</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># manipulating these</span></span>
<span id="cb5-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb5-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os</span>
<span id="cb5-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb5-6"></span>
<span id="cb5-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># As above, replace this file path to where you have stored your NetCDF files</span></span>
<span id="cb5-8">path <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../../../ICE-7G_NA(VM7)"</span></span>
<span id="cb5-9"></span>
<span id="cb5-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get a list all the files in the directory</span></span>
<span id="cb5-11">files <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> os.listdir(path)</span>
<span id="cb5-12"></span>
<span id="cb5-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Exlude anything but the NetCDF files </span></span>
<span id="cb5-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (just in case some temporary files or similar are in there)</span></span>
<span id="cb5-15">files_nc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> files <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i.endswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'.nc'</span>)]</span>
<span id="cb5-16"></span>
<span id="cb5-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Define a regex function to find the time assigned to each file, which</span></span>
<span id="cb5-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># falls between the string elements "1deg." and ".nc"</span></span>
<span id="cb5-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> get_agebp(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">file</span>):</span>
<span id="cb5-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(re.search(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r'1deg</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*?</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">nc'</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">file</span>).group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb5-21"></span>
<span id="cb5-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get age ka BP for each file, sort these from oldest to youngest and store them</span></span>
<span id="cb5-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so that they can be assigned to the data when it has been loaded</span></span>
<span id="cb5-24">times_ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(np.array([get_agebp(f) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> files_nc]), reverse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-25"></span>
<span id="cb5-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Use the function again to get a list of file names sorted from oldest to youngest</span></span>
<span id="cb5-27">files_sorted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(files_nc, key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> get_agebp, reverse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-28"></span>
<span id="cb5-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Append the full path to these chronologically sorted file names</span></span>
<span id="cb5-30">files_full <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [os.path.join(path, name) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> files_sorted]</span>
<span id="cb5-31"></span>
<span id="cb5-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Read in files in a single xarray stack with a time dimension</span></span>
<span id="cb5-33">ds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> xr.open_mfdataset(</span>
<span id="cb5-34">    files_full,</span>
<span id="cb5-35">    combine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nested"</span>,</span>
<span id="cb5-36">    concat_dim <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>) </span>
<span id="cb5-37"></span>
<span id="cb5-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The time dimension is currently just an index going from 0-48, so here we'll assign </span></span>
<span id="cb5-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the actual ages ka BP.</span></span>
<span id="cb5-40">ds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ds.assign_coords(time <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> times_ka)</span>
<span id="cb5-41">ds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>].attrs[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"units"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ka BP"</span></span>
<span id="cb5-42">ds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>].attrs[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"long_name"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Model age"</span></span>
<span id="cb5-43"></span>
<span id="cb5-44"></span>
<span id="cb5-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Print the structure of the data</span></span>
<span id="cb5-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(ds)</span></code></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>&lt;xarray.Dataset&gt; Size: 37MB
Dimensions:    (time: 48, lat: 180, lon: 360)
Coordinates:
  * time       (time) float64 384B 26.0 25.0 24.0 23.0 22.0 ... 1.5 1.0 0.5 0.0
  * lat        (lat) float64 1kB -89.5 -88.5 -87.5 -86.5 ... 86.5 87.5 88.5 89.5
  * lon        (lon) float64 3kB 0.5 1.5 2.5 3.5 4.5 ... 356.5 357.5 358.5 359.5
Data variables:
    stgit      (time, lat, lon) float32 12MB dask.array&lt;chunksize=(1, 180, 360), meta=np.ndarray&gt;
    Topo       (time, lat, lon) float32 12MB dask.array&lt;chunksize=(1, 180, 360), meta=np.ndarray&gt;
    Topo_Diff  (time, lat, lon) float32 12MB dask.array&lt;chunksize=(1, 180, 360), meta=np.ndarray&gt;
Attributes:
    Model:            ICE=ICE-7G_NA, Viscosity=VM7
    Date:             December 17, 2019
    Author:           W.R. Peltier, Dept of Physics, Univ of Toronto,Canada
    Acknowledgement:  Please cite following papers [PAPER1 and PAPER2 investi...
    PAPER1:           Roy, Keven, and W. R. Peltier - Glacial isostatic adjus...
    PAPER2:           Roy, Keven, and W. R. Peltier - Space-geodetic and wate...
    PAPER3:           Roy, Keven, and W. R. Peltier - Relative sea level in t...</code></pre>
</div>
</div>
<p>You can see that time is now a third dimension and that this has 48 unique values, representing the 48 NetCDF files and their corresponding time-slice ages.</p>
<section id="regional-map-of-fennoscandia" class="level3" data-number="5.1">
<h3 data-number="5.1" class="anchored" data-anchor-id="regional-map-of-fennoscandia"><span class="header-section-number">5.1</span> Regional map of Fennoscandia</h3>
<p>Before extracting the RSL for some chosen locations in the Kattegat-Skagerrak area, we can create a map that uses data from multiple of the time slices and plots out the location of the points for where we’ll extract RSL curves. I’ve chosen Oslo, Göteborg and Aarhus for this. An important note to make here is that I’ve found the coordinates based on a coordinate system (WGS84, EPSG:4327) with a convention for longitude going from -180 to 180 whereas ICE-7G_NA uses a convention where longitude goes from 0 to 360. With positive values for longitude this has no consequence, but if the longitudinal values were negative they would have to be translated by using the modulo operator. (I’ve included this for the longitudinal values below to show how this can be done although it has no effect here as all the values for longitude are positive).</p>
<div id="22ab2efb" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Coordinates for Oslo, Göteborg and Aarhus</span></span>
<span id="cb7-2">osl_lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">59.90</span></span>
<span id="cb7-3">osl_lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.75</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">360</span></span>
<span id="cb7-4">gbg_lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">57.70</span></span>
<span id="cb7-5">gbg_lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.97</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">360</span></span>
<span id="cb7-6">aar_lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">56.14</span></span>
<span id="cb7-7">aar_lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.20</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">360</span></span>
<span id="cb7-8"></span>
<span id="cb7-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Time-slices to plot</span></span>
<span id="cb7-10">ds_12ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ds.sel(time <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb7-11">ds_lgm  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ds.sel(time <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># LGM at approx. 21 ka BP</span></span>
<span id="cb7-12"></span>
<span id="cb7-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RSL where there is not ice at 12 ka BP</span></span>
<span id="cb7-14">rsl_12ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>ds_12ka[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Topo_Diff"</span>].where(ds_12ka[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb7-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mask layer to colour ice white</span></span>
<span id="cb7-16">ice_12ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ds_12ka[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>].where(ds_12ka[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb7-17"></span>
<span id="cb7-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Projection for Fennoscandia</span></span>
<span id="cb7-19">proj <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.LambertConformal(central_longitude <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, central_latitude <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">62</span>,</span>
<span id="cb7-20">              standard_parallels <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">55</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>))</span>
<span id="cb7-21"></span>
<span id="cb7-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Set up plot with projection</span></span>
<span id="cb7-23">fig <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.figure(figsize <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>))</span>
<span id="cb7-24">ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.axes(projection <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> proj)</span>
<span id="cb7-25"></span>
<span id="cb7-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Set map extent to Fennoscandia</span></span>
<span id="cb7-27">ax.set_extent([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">75</span>], crs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree())</span>
<span id="cb7-28"></span>
<span id="cb7-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RSL layer</span></span>
<span id="cb7-30">pcm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ax.pcolormesh(ds.lon, ds.lat, rsl_12ka, transform <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree(),</span>
<span id="cb7-31">    cmap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RdBu_r"</span>, norm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TwoSlopeNorm(vmin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, vcenter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, vmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb7-32">    shading <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"auto"</span>, zorder <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb7-33"></span>
<span id="cb7-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ice mask</span></span>
<span id="cb7-35">ax.pcolormesh(ds.lon, ds.lat, ice_12ka, transform <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree(),</span>
<span id="cb7-36">    cmap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray"</span>, shading <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"auto"</span>, vmin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, vmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, zorder <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb7-37"></span>
<span id="cb7-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># LGM ice cover outline</span></span>
<span id="cb7-39">ax.contour(ds.lon, ds.lat, ds_lgm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>], levels <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], colors<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"red"</span>,</span>
<span id="cb7-40">    linewidths <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, transform <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree(), zorder <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb7-41"></span>
<span id="cb7-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add points for Oslo, Göteborg and Aarhus</span></span>
<span id="cb7-43">ax.plot(osl_lon, osl_lat, marker<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, markersize <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, color <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>,</span>
<span id="cb7-44">markeredgecolor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, transform <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree(), zorder <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb7-45">ax.plot(gbg_lon, gbg_lat, marker<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, markersize <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, color <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>,</span>
<span id="cb7-46">markeredgecolor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, transform <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree(), zorder <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb7-47">ax.plot(aar_lon, aar_lat, marker<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, markersize <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, color <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>,</span>
<span id="cb7-48">markeredgecolor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"black"</span>, transform <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ccrs.PlateCarree(), zorder <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb7-49"></span>
<span id="cb7-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add coastline for areas not covered by ice</span></span>
<span id="cb7-51">ax.coastlines(resolution<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50m"</span>, linewidth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, zorder <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb7-52"></span>
<span id="cb7-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RSL with colour gradient legend</span></span>
<span id="cb7-54">plt.colorbar(pcm, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ax, shrink <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, pad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb7-55">            label <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Relative sea-level (m)"</span>)</span>
<span id="cb7-56"></span>
<span id="cb7-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Title</span></span>
<span id="cb7-58">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ICE-7G_NA (VM7): Fennoscandia at 12 ka BP"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.iroalkvam.com/posts/02gia_models/index_files/figure-html/cell-6-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<p>And here we have the resulting map showing RSL at 12 ka BP, areas covered by ice indicated in white, the outline of the ice cover at the Last Glacial Maximum (LGM) given in red, and the location of Oslo, Göteborg and Aarhus as points. We’ll now use the coordinates for the points to find RSL change over time at these locations.</p>
</section>
<section id="rsl-change-in-aarhus-göteborg-and-oslo" class="level3" data-number="5.2">
<h3 data-number="5.2" class="anchored" data-anchor-id="rsl-change-in-aarhus-göteborg-and-oslo"><span class="header-section-number">5.2</span> RSL-change in Aarhus, Göteborg and Oslo</h3>
<p>Now that we have the complete time-series of GIA model output in an xarray stack and point coordinates for Oslo, Göteborg and Aarhus we can derive the trajectory for RSL change at these locations. A point worth making here is that the results from the GIA model is provided as a grid and our point coordinates might fall at different positions within these grid cells. It is therefore appropriate to interpolate the value for each point location based on their position on the grid. Here I’ve done this simply using the nearest neighour method from xarray, but other approaches could also be been explored.</p>
<div id="7e64e33c" class="cell" data-execution_count="6">
<div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Retrieve the data for the point representing Göteborg, using nearest neighbour</span></span>
<span id="cb8-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to interpolate the values to this point.</span></span>
<span id="cb8-3">point_gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ds.sel(lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gbg_lat, lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gbg_lon, method <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nearest"</span>)</span>
<span id="cb8-4">    </span>
<span id="cb8-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Retrieve the RSL values by flipping the Topo_Diff sign and exclude periods when</span></span>
<span id="cb8-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Göteborg was covered by ice</span></span>
<span id="cb8-7">rsl_gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>point_gbg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Topo_Diff"</span>].where(point_gbg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-8"></span>
<span id="cb8-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Transform this into a pandas series amenable for plotting</span></span>
<span id="cb8-10">rsl_gbg_ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rsl_gbg.to_series()</span>
<span id="cb8-11"></span>
<span id="cb8-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Repeat for Oslo</span></span>
<span id="cb8-13">point_osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ds.sel(lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> osl_lat, lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> osl_lon, method <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nearest"</span>)</span>
<span id="cb8-14">rsl_osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>point_osl[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Topo_Diff"</span>].where(point_osl[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-15">rsl_osl_ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rsl_osl.to_series()</span>
<span id="cb8-16"></span>
<span id="cb8-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Repeat for Aarhus</span></span>
<span id="cb8-18">point_aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ds.sel(lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> aar_lat, lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> aar_lon, method <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nearest"</span>)</span>
<span id="cb8-19">rsl_aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>point_aar[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Topo_Diff"</span>].where(point_aar[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-20">rsl_aar_ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rsl_aar.to_series()</span>
<span id="cb8-21"></span>
<span id="cb8-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Call to plot</span></span>
<span id="cb8-23">plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>,<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb8-24">plt.plot(point_osl[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>], rsl_osl_ts, color <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#27b376'</span>, label <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Oslo'</span>)</span>
<span id="cb8-25">plt.plot(point_gbg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>], rsl_gbg_ts, color <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#bf212f'</span>, label <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Göteborg'</span>)</span>
<span id="cb8-26">plt.plot(point_osl[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>], rsl_aar_ts, color <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#264b96'</span>, label <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Aarhus'</span>)</span>
<span id="cb8-27">plt.legend()</span>
<span id="cb8-28">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ka BP"</span>)</span>
<span id="cb8-29">plt.ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Relative sea-level (m)"</span>)</span>
<span id="cb8-30">plt.title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Post LGM RSL-change based on ICE-7G_NA (VM7)"</span>)</span>
<span id="cb8-31">plt.gca().invert_xaxis() </span>
<span id="cb8-32">plt.xlim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.iroalkvam.com/posts/02gia_models/index_files/figure-html/cell-7-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<p>It is worth highlighting that these curves do appear to deviate in some important ways from the local data on RSL change from these locations (see Rosentau et al.&nbsp;2021; Romundset et al.&nbsp;2026). In the area of Göteborg, for example, empirical data suggests the occurrence of a mid-Holocene sea-level transgression, which the GIA model does not indicate. This points to the value of the common exercise of comparing multiple GIA models and experimenting with their parameter settings when exploring RSL change in a given location, and to the value of also contrasting their output with empirical data. While GIA models can certainly be a valuable addition to the repertoire for archaeologists concerned with past sea-level change, a GIA model can hardly be assumed to directly provide reliable reconstruction for RSL change at a given location at the site-level scale that typically concern archaeologists.</p>
</section>
</section>
<section id="rough-outline-in-r" class="level2" data-number="6">
<h2 data-number="6" class="anchored" data-anchor-id="rough-outline-in-r"><span class="header-section-number">6</span> Rough outline in R</h2>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Expand to see condensed R code
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p>This R code gives a rough outline of how to you can achieve the same results as was achieved using Python above.</p>
<div id="5fc682d4" class="cell" data-execution_count="7">
<div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Uncomment the lines below to install the packages used in the script</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># install.packages("terra")</span></span>
<span id="cb9-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># install.packages("stringr")</span></span>
<span id="cb9-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># install.packages("here")</span></span>
<span id="cb9-5">library(terra) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># For handling NetCDF files and spatial data</span></span>
<span id="cb9-6">library(stringr) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># For wokring with strings when loading files</span></span>
<span id="cb9-7">library(here) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># For file paths relative to the directory where the R script is located</span></span>
<span id="cb9-8"></span>
<span id="cb9-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Replace file path to where you have stored the NetCDF files</span></span>
<span id="cb9-10">files <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>.files(path <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> here(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../ICE-7G_NA(VM7)"</span>),</span>
<span id="cb9-11">                     pattern <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.nc$"</span>, full.names <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRUE)</span>
<span id="cb9-12"></span>
<span id="cb9-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Get the age of the time-slice of each file</span></span>
<span id="cb9-14">ages_kBP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span>.numeric(str_extract(files, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(?&lt;=1deg</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.)[0-9]+(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.[0-9]+)?"</span>))</span>
<span id="cb9-15"></span>
<span id="cb9-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Order the list of file names based on this</span></span>
<span id="cb9-17">files_sorted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> files[order(ages_kBP, decreasing <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRUE)]</span>
<span id="cb9-18"></span>
<span id="cb9-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># And get the sorted numbers to assign to a time dimension of the rasters in the stack.</span></span>
<span id="cb9-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Using the full age BP instead of ka BP, due to how terra handles the time dimension</span></span>
<span id="cb9-21">ages_kBP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> sort(ages_kBP, decreasing <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRUE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span></span>
<span id="cb9-22"></span>
<span id="cb9-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Read in the rasters as a stack and rotate() to change longitude convention from</span></span>
<span id="cb9-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># going from 0 to 260 to -180 to 180</span></span>
<span id="cb9-25">topodiff_stack <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> rotate(rast(files_sorted, subds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Topo_Diff"</span>))</span>
<span id="cb9-26">ice_stack <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> rotate(rast(files_sorted, subds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stgit"</span>))</span>
<span id="cb9-27"></span>
<span id="cb9-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Assign ages to the stacks</span></span>
<span id="cb9-29">time(topodiff_stack) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> ages_kBP</span>
<span id="cb9-30">time(ice_stack) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> ages_kBP</span>
<span id="cb9-31"></span>
<span id="cb9-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Retrieve RSL and ice cover at 12 ka BP for plot</span></span>
<span id="cb9-33">i_12ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> which.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(time(topodiff_stack) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12000</span>))</span>
<span id="cb9-34"></span>
<span id="cb9-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RSL at 12 ka BP</span></span>
<span id="cb9-36">rsl_12ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>topodiff_stack[[i_12ka]]</span>
<span id="cb9-37"></span>
<span id="cb9-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ice cover at 12 ka BP, set to NA where ice is not present</span></span>
<span id="cb9-39">ice_12ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> ice_stack[[i_12ka]]</span>
<span id="cb9-40">ice_12ka[ice_12ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> NA</span>
<span id="cb9-41"></span>
<span id="cb9-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Point vector features for Oslo, Göteborg and Aarhus</span></span>
<span id="cb9-43">osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> vect(data.frame(lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.75</span>, lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">59.90</span>),</span>
<span id="cb9-44">            geom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lat"</span>), crs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EPSG:4326"</span>)</span>
<span id="cb9-45">gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> vect(data.frame(lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.97</span>, lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">57.70</span>),</span>
<span id="cb9-46">            geom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lat"</span>), crs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EPSG:4326"</span>)</span>
<span id="cb9-47">aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> vect(data.frame(lon <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.20</span>, lat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">56.14</span>),</span>
<span id="cb9-48">            geom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lat"</span>), crs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EPSG:4326"</span>)</span>
<span id="cb9-49"></span>
<span id="cb9-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Simple map plot for a sanity check (not reproduced here)</span></span>
<span id="cb9-51">plot(rsl_12ka,</span>
<span id="cb9-52">     main <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ICE-7G_NA (VM7): RSL and ice cover at 12 ka BP"</span>)</span>
<span id="cb9-53">plot(ice_12ka, col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>, legend <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FALSE, add <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRUE)</span>
<span id="cb9-54">plot(osl, cex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, add <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRUE)</span>
<span id="cb9-55">plot(gbg, cex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, add <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRUE)</span>
<span id="cb9-56">plot(aar, cex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, add <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRUE)</span>
<span id="cb9-57"></span>
<span id="cb9-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Flip sign of Topo_Diff and extract this for Oslo.</span></span>
<span id="cb9-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Remove the ID associated with the values using [1, -1]</span></span>
<span id="cb9-60">rsl_osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> extract(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>topodiff_stack, osl)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Extract ice cover for Oslo</span></span>
<span id="cb9-62">ice_osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> extract(ice_stack, osl)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Remove RSL for when Oslo was covered by ice, as this is undefined</span></span>
<span id="cb9-64">rsl_osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span>.numeric(ifelse(ice_osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, NA, rsl_osl))</span>
<span id="cb9-65"></span>
<span id="cb9-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Repeat for Göteborg</span></span>
<span id="cb9-67">rsl_gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> extract(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>topodiff_stack, gbg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-68">ice_gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> extract(ice_stack, gbg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-69">rsl_gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span>.numeric(ifelse(ice_gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, NA, rsl_gbg))</span>
<span id="cb9-70"></span>
<span id="cb9-71"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Repeat for Aarhus</span></span>
<span id="cb9-72">rsl_aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> extract(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>topodiff_stack, aar)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-73">ice_aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> extract(ice_stack, aar)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-74">rsl_aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span>.numeric(ifelse(ice_aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, NA, rsl_aar))</span>
<span id="cb9-75"></span>
<span id="cb9-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create data frames for plotting</span></span>
<span id="cb9-77">rsl_osl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> data.frame(BP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> time(topodiff_stack), rsl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rsl_osl)</span>
<span id="cb9-78">rsl_gbg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> data.frame(BP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> time(topodiff_stack), rsl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rsl_gbg)</span>
<span id="cb9-79">rsl_aar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;-</span> data.frame(BP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> time(topodiff_stack), rsl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rsl_aar)</span>
<span id="cb9-80"></span>
<span id="cb9-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Call to plot</span></span>
<span id="cb9-82">plot(rsl_osl$BP, rsl_osl$rsl, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>, xlim <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20000</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), ylim <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span>),</span>
<span id="cb9-83">     xlab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Years BP"</span>, ylab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Relative sea level (m)"</span>,</span>
<span id="cb9-84">     main <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Post LGM RSL-change based on ICE-7G_NA (VM7)"</span>)</span>
<span id="cb9-85">lines(rsl_osl$BP, rsl_osl$rsl, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#27b376"</span>)</span>
<span id="cb9-86">lines(rsl_gbg$BP, rsl_gbg$rsl, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#bf212f"</span>)</span>
<span id="cb9-87">lines(rsl_aar$BP, rsl_aar$rsl, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#264b96"</span>)</span>
<span id="cb9-88">legend(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"topright"</span>, legend <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Oslo"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Göteborg"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Aarhus"</span>),</span>
<span id="cb9-89">       col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#27b376"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#bf212f"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#264b96"</span>), lty <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div>
</div>
<p><img src="https://www.iroalkvam.com/posts/02gia_models/r_rsl_curves.png" class="img-fluid"></p>
</div>
</div>
</div>
</section>
<section id="references" class="level2" data-number="7">
<h2 data-number="7" class="anchored" data-anchor-id="references"><span class="header-section-number">7</span> References</h2>
<p>Clark, J. A., W. E. Farrell, and W. R. Peltier. 1978. Global Changes in Postglacial Sea Level: A Numerical Calculation. <em>Quaternary Research</em> 9(3):265–287. <a href="https://doi.org/10.1016/0033-5894(78)90033-9" class="uri">https://doi.org/10.1016/0033-5894(78)90033-9</a>.</p>
<p>Farrell, W. E., and J. A. Clark. 1976. On Postglacial Sea Level. <em>Geophysical Journal International</em> 46(3):647–667. <a href="https://doi.org/10.1111/j.1365-246X.1976.tb01252.x" class="uri">https://doi.org/10.1111/j.1365-246X.1976.tb01252.x</a>.</p>
<p>Hoyer, S., and J. Hamman. 2017. Xarray: N-D Labeled Arrays and Datasets in Python. <em>Journal of Open Research Software</em> 5(1):10. <a href="https://doi.org/10.5334/jors.148" class="uri">https://doi.org/10.5334/jors.148</a>.</p>
<p>Lambeck, K., H. Rouby, A. Purcell, Y. Sun, and M. Sambridge. 2014. Sea Level and Global Ice Volumes from the Last Glacial Maximum to the Holocene. <em>Proceedings of the National Academy of Sciences</em> 111(43):15296–15303. <a href="https://doi.org/doi:10.1073/pnas.1411762111" class="uri">https://doi.org/doi:10.1073/pnas.1411762111</a>.</p>
<p>Lambeck, Kurt, A. Purcell, and S. Zhao. 2017. North American Late Wisconsin Ice Sheet and Mantle Viscosity from Glacial Rebound Analyses. <em>Quaternary Science Reviews</em> 158:172–210. <a href="https://doi.org/10.1016/j.quascirev.2016.11.033" class="uri">https://doi.org/10.1016/j.quascirev.2016.11.033</a>.</p>
<p>Mitrovica, J. X., and G. A. Milne. 2003. On Post-Glacial Sea Level: I. General Theory. <em>Geophysical Journal International</em> 154(2):253–267. <a href="https://doi.org/10.1046/j.1365-246X.2003.01942.x" class="uri">https://doi.org/10.1046/j.1365-246X.2003.01942.x</a>.</p>
<p>Peltier, W. R. 1998. Postglacial Variations in the Level of the Sea: Implications for Climate Dynamics and Solid-Earth Geophysics. <em>Reviews of Geophysics</em> 36(4):603–689. <a href="https://doi.org/10.1029/98RG02638" class="uri">https://doi.org/10.1029/98RG02638</a>.</p>
<p>Peltier, W. R., D. F. Argus, and R. Drummond. 2015. Space Geodesy Constrains Ice Age Terminal Deglaciation: The Global ICE-6G_C (VM5a) Model. <em>Journal of Geophysical Research: Solid Earth</em> 120(1):450–487. <a href="https://doi.org/10.1002/2014JB011176" class="uri">https://doi.org/10.1002/2014JB011176</a>.</p>
<p>Peltier, W. R., D. F. Argus, and R. Drummond. 2018. Comment on ‘An Assessment of the ICE-6G_C (VM5a) Glacial Isostatic Adjustment Model’ by Purcell et al.&nbsp;<em>Journal of Geophysical Research: Solid Earth</em> 123(2):2019–2028. <a href="https://doi.org/10.1002/2016JB013844" class="uri">https://doi.org/10.1002/2016JB013844</a>.</p>
<p>Purcell, A., P. Tregoning, and A. Dehecq. 2016. An Assessment of the ICE6G_C(VM5a) Glacial Isostatic Adjustment Model. <em>Journal of Geophysical Research: Solid Earth</em> 121(5):3939–3950. <a href="https://doi.org/10.1002/2015JB012742" class="uri">https://doi.org/10.1002/2015JB012742</a>.</p>
<p>Roalkvam, I. 2023. A Simulation-Based Assessment of the Relation between Stone Age Sites and Relative Sea-Level Change along the Norwegian Skagerrak Coast. <em>Quaternary Science Reviews</em> 299:107880. <a href="https://doi.org/10.1016/j.quascirev.2022.107880" class="uri">https://doi.org/10.1016/j.quascirev.2022.107880</a>.</p>
<p>Romundset, A., I. Roalkvam, M. van Boeckel, F. Høgaas, K. E. Henningsmoen, H. I. Høeg, and R. Sørensen. 2026. Shoreline and Deglaciation Chronology in Southeast Norway. <em>Boreas</em> 55(1):29–56. <a href="https://doi.org/10.1111/bor.70024" class="uri">https://doi.org/10.1111/bor.70024</a>.</p>
<p>Rosentau, A., V. Klemann, O. Bennike, H. Steffen, J. Wehr, M. Latinović, M. Bagge, A. Ojala, M. Berglund, G. P. Becher, K. Schoning, A. Hansson, L. Nielsen, L. B. Clemmensen, M. U. Hede, A. Kroon, M. Pejrup, L. Sander, K. Stattegger, K. Schwarzer, R. Lampe, M. Lampe, S. Uścinowicz, A. Bitinas, I. Grudzinska, J. Vassiljev, T. Nirgi, Y. Kublitskiy, and D. Subetto. 2021. A Holocene Relative Sea-Level Database for the Baltic Sea. <em>Quaternary Science Reviews</em> 266:107071. <a href="https://doi.org/10.1016/j.quascirev.2021.107071" class="uri">https://doi.org/10.1016/j.quascirev.2021.107071</a>.</p>
<p>Roy, K., and W. R. Peltier. 2015. Glacial Isostatic Adjustment, Relative Sea Level History and Mantle Viscosity: Reconciling Relative Sea Level Model Predictions for the US East Coast with Geological Constraints. <em>Geophysical Journal International</em> 201(2):1156–1181. <a href="https://doi.org/10.1093/gji/ggv066" class="uri">https://doi.org/10.1093/gji/ggv066</a>.</p>
<p>Roy, K., and W. R. Peltier. 2017. Space-Geodetic and Water Level Gauge Constraints on Continental Uplift and Tilting over North America: Regional Convergence of the ICE-6G_C (VM5a/VM6) Models. <em>Geophysical Journal International</em> 210(2):1115–1142. <a href="https://doi.org/10.1093/gji/ggx156" class="uri">https://doi.org/10.1093/gji/ggx156</a>.</p>
<p>Roy, K., and W. R. Peltier. 2018. Relative Sea Level in the Western Mediterranean Basin: A Regional Test of the ICE-7G_NA (VM7) Model and a Constraint on Late Holocene Antarctic Deglaciation. <em>Quaternary Science Reviews</em> 183:76–87. <a href="https://doi.org/10.1016/j.quascirev.2017.12.021" class="uri">https://doi.org/10.1016/j.quascirev.2017.12.021</a></p>
<p>Spada, G., and D. Melini. 2019. SELEN<sup>4</sup> (SELEN Version 4.0): A Fortran Program for Solving the Gravitationally and Topographically Self-Consistent Sea-Level Equation in Glacial Isostatic Adjustment Modeling. <em>Geoscientific Model Development</em> 12(12):5055–5075. <a href="https://doi.org/10.5194/gmd-12-5055-2019" class="uri">https://doi.org/10.5194/gmd-12-5055-2019</a>.</p>
<p>Whitehouse, P. L. 2018. Glacial Isostatic Adjustment Modelling: Historical Perspectives, Recent Advances, and Future Directions. <em>Earth Surface Dynamics</em> 6(2):401–429. <a href="https://doi.org/10.5194/esurf-6-401-2018" class="uri">https://doi.org/10.5194/esurf-6-401-2018</a>.</p>


</section>

 ]]></description>
  <guid>https://www.iroalkvam.com/posts/02gia_models/</guid>
  <pubDate>Mon, 09 Feb 2026 23:00:00 GMT</pubDate>
</item>
<item>
  <title>First post and getting started with MESK</title>
  <dc:creator>Isak Roalkvam</dc:creator>
  <link>https://www.iroalkvam.com/posts/01first_post/</link>
  <description><![CDATA[ 





<p>This is the first post on this website. From the outset I can say that I will mostly be doing this for my own benefit – to write down and keep a record of my own thinking for future me. However, that is not to say that I won’t appreciate any readers who happen to drop by along the way.</p>
<p>The website itself was created as part of my postdoctoral research project <em>Modelling the Earliest Human Settlement in the Kattegat-Skagerrak Circumference</em> (MESK), a EU funded MSCA Postdoctoral Fellowship that I just started. The project is being undertaken at Aarhus University from October 2025 until October 2027. While I intend to mainly post about MESK, I will also, at least in part, treat it as a personal website (hence the address iroalkvam.com). There are a couple of reasons for this. For one, I think it is safe to assume that the borders between the project and aspects of my personal life will be blurred. One concrete example of this is how I have now moved from Oslo to Aarhus for the project. I think that trying to treat this as somehow separate from the research I will conduct stands in danger of resulting in an unnatural limitation of what I feel I can write about. Secondly, I also hope to keep using the site after the project has come to a conclusion. I believe that setting up for longevity will involve avoiding limiting myself to what falls strictly within the scientific aspects of MESK.</p>
<section id="some-techincal-details" class="level2">
<h2 class="anchored" data-anchor-id="some-techincal-details">Some techincal details</h2>
<p>Some readers (including future me) might be interested in reading a bit more about the technical details and the motivation for how I chose to set up the site. On the extreme ends of the scale I debated whether I could build the whole site from scratch using HTML/CSS or whether to use a GUI-based platform such as Wordpress. As for Wordpress, I quickly decided against this. For one, I already have experience setting up and maintaining a website for my late mother’s artwork (<a href="https://jmhk.no" class="uri">https://jmhk.no</a>) using Wordpress. It works well enough for the purposes of that simple site, but there are a lot of annoyances with the lack of control Wordpress provides, and I am contemplating migrating that site somewhere else as well. On the other hand, while attempting to build the site from scratch would have given complete control and undoubtedly have been a great learning experience, I also decided against trying this because the result would likely have been worse, it would have taken a lot more time, and given my limited experience with web development, a more user-friendly framework will likely provide more than enough learning opportunities.</p>
<p>For these reasons I went with the Quarto Blog framework. I’m already comfortable with the use of R and Quarto and so this was easy to set up. Furthermore, as Quarto allows you to write literate programming documents that can include text, images, code and rendered output such as figures (see <a href="https://github.com/quarto-dev/quarto-cli#quarto" class="uri">https://github.com/quarto-dev/quarto-cli#quarto</a>) it fits perfectly with my intended use, as I will be including all of these elements in my posts. I currently develop the site in the integrated development environment (IDE) Positron, which I’m experimenting with as a possible replacement for RStudio.</p>
</section>
<section id="a-static-and-open-source-website" class="level2">
<h2 class="anchored" data-anchor-id="a-static-and-open-source-website">A static and open source website</h2>
<p>I have my domain from <em>host1</em>, a Norwegian hosting company, where I have already paid for a one-year hosting plan as well. However, after first dipping my toes into web-development I have become aware of some very interesting initiatives for both developing, hosting and serving websites. One of these is <a href="https://homebrewserver.club">homebrewserver.club</a> which promotes setting up and running websites in light of social, political and economic needs, goals and principles. This involves using free and open source software and to host using low-power solutions from home, rather than from data centers. The hosting-the-website-myself part of this will remain an ambition for now, not least because I already paid for the hosting plan at <em>host1</em>, but the open and minimal footprint aspects as related to how the content of this site are served are with me from the start. Some related initiatives to <em>homebrewserver.club</em> is <a href="https://sustainablewebdesign.org">Sustainable Web Design</a>, the <a href="https://areyoubeingserved.constantvzw.org/Summit_afterlife.xhtml">Feminist Server Manifesto</a>, as well as the concept of <a href="https://go-dh.github.io/mincomp/thoughts/">Minimal Computing</a> that I was recently made aware of in a <a href="https://archaeo.social/@joeroe/115303037965460423">Mastodon thread initiated by Joe Roe</a>.</p>
<p>As for the open aspect of the website, all of the code that goes into creating this site is fully and freely available here <a href="https://codeberg.org/isakro/iroalkvam" class="uri">https://codeberg.org/isakro/iroalkvam</a> and everything on the website is explicitly released under the license <a href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0</a>. Another principle that <em>homebreserver.club</em> recommends is to use static websites, which this site also is. What this means is that all of the content on this is site is rendered from static files that are stored on the server-side of the site, meaning the content is not dynamically generated with new visitors or as a visitor interacts with the site. That requires more energy. Although I have included code, for example to generate the images that I will use for the thumbnails of my posts (see below), this code has been run once by me to generate the files that I need. These are then served as static images and the code is never run again.</p>
<p>Finally then, just to give an example of how Quarto can be used to display and show the results of code, I’ve included the code chunk below, written in the R programming language. This generates the image that is also used for the thumbnail for this post. I feel my site needs some light-weight graphics, and since I’m interested in exploring the world(s) of creative data visualisation and generative art, I used the R package <em>aRtsy</em> for this. <em>aRtsy</em> makes a series of algorithms for generative art readily available for novices to explore (see <a href="https://koenderks.github.io/aRtsy/" class="uri">https://koenderks.github.io/aRtsy/</a>).</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Load aRtsy (uncomment and run the install.packages() line if it's not installed)</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># install.packages("aRtsy")</span></span>
<span id="cb1-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(aRtsy)</span>
<span id="cb1-4"></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fix the random seed to create the same figure on each run</span></span>
<span id="cb1-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set.seed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb1-7"></span>
<span id="cb1-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create a Flow Field visualisation (after having played around with the</span></span>
<span id="cb1-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># parameters a bit)</span></span>
<span id="cb1-10">flow <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">canvas_flow</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outline =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle"</span>,</span>
<span id="cb1-11">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">background =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#F5F5F5"</span>,</span>
<span id="cb1-12">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lines =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8000</span>,</span>
<span id="cb1-13">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb1-14">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stepmax =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>,</span>
<span id="cb1-15">            <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colors =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">colorPalette</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dark2"</span>))</span>
<span id="cb1-16"></span>
<span id="cb1-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Save the resulting figure as a jpg so that it can be served as a static file and</span></span>
<span id="cb1-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># be used as the thumbnail for this post</span></span>
<span id="cb1-19"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">saveCanvas</span>(flow,</span>
<span id="cb1-20">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">filename =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flow.jpg"</span>,</span>
<span id="cb1-21">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>,</span>
<span id="cb1-22">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">height =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span></code></pre></div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.iroalkvam.com/posts/01first_post/flow.jpg" class="img-fluid quarto-figure quarto-figure-center figure-img" alt="An image displaying a series of flowing lines in hues of blue created with the generative art package aRtsy for the R programming language."></p>
</figure>
</div>


</section>

 ]]></description>
  <guid>https://www.iroalkvam.com/posts/01first_post/</guid>
  <pubDate>Mon, 06 Oct 2025 22:00:00 GMT</pubDate>
  <media:content url="https://www.iroalkvam.com/posts/01first_post/flow.jpg" medium="image" type="image/jpeg"/>
</item>
</channel>
</rss>
