We will model the 1.1 and 1.2 IMBIE drainage bassins in north Greenland with Elmer/Ice.
26 & 27 November 2020
We will model the 1.1 and 1.2 IMBIE drainage bassins in north Greenland with Elmer/Ice.
We will see how to:
mesh a complex domain
interpolate netcdf data sets on the mesh
use the 2D mesh adaptation
use shallow approximations to model large domains
use the inverse methods to initialise poorly known fields
This example is based on the configuration files for the Greenland Ice Sheet described here.
The material for this course has been moved to github
You can:
git clone https://github.com/ElmerCSC/ElmerIceCourses
We use python codes under Codes/PreProcessing to make a gmsh .geo file from the shapefile.
Original source codes and documentation are given here
Go to Elmer/1_MESH_INI:
Use Contour2geo.py to make the gmsh .geo
python ../../Codes/PreProcessing/Contour2geo.py -r 2000.0 -i ../../Data/domain/bassin.shp -o mesh.geo
Make the mesh and convert to Elmer format
gmsh -2 mesh.geo ElmerGrid 14 2 mesh.msh -autoclean
For visualisation you can convert the Elmer mesh to a shapefile using MeshToShp.py:
python ../../Codes/PreProcessing/MeshToShp.py -d mesh gdalsrsinfo -o wkt "EPSG:3413" > mesh_shp/elements.prj gdalsrsinfo -o wkt "EPSG:3413" > mesh_shp/boundaries.prj
Available solvers:
Read a structured netcdf file (2D,3D,4D)
Elmer has to be compiled with the netcdf libraries
cmake -DNetCDF_INCLUDE_DIR=PATH_TO_INCLUDE \ -DNetCDF_LIBRARY=PATH_TO_libnetcdf.so \ -DNetCDFF_LIBRARY=PATH_TO_libnetcdff.so
Linear interpolation
Linear transformation can be applied
Valid Min & Max values can be given in the .sif file; results will get this value if any data in the current cell is out of the range
A default value can be given if a node is outside the dataset
Do not check for the _FillValue attribute
Interpolate sparse 2D data sets, i.e. no structure required
The data can be provided as an ASCII file (x,y,value) or a structured 2D netcdf files with x and y coordinates
Rely on external librairies, :
Need to compile Elmer with these libraries
cmake -DWITH_ScatteredDataInterpolator:BOOL=TRUE \ -DNetCDF_INCLUDE_DIR=PATH_TO_INCLUDE \ -DNetCDF_LIBRARY=PATH_TO_libnetcdf.so \ -DNetCDFF_LIBRARY=PATH_TO_libnetcdff.so \ -DCSA_LIBRARY=PATH_TO_libcsa.a \ -DCSA_INCLUDE_DIR=PATH_TO_csa \ -DNN_INCLUDE_DIR=/PATH_TO_nn \ -DNN_LIBRARY=PATH_TO_libnn.a
The _FillValue attribute is used to define a no data value in a netcdf file
See example in Elmer/1b_IMPORT_DATA
Solver *solver id* Equation = Reader Procedure = "GridDataReader" "GridDataReader" Variable = -nooutput dumy Read full array = logical True ! read the full netcdf at once instead of ! inquiring values for each cell Filename = File "$TOPOGRAPHY_DATA$" ! name of the .nc file X Dim Name = File "x" ! dimensions Y Dim Name = File "y" Variable 1 = File "thickness" ! var name in .nc file Target Variable 1 = String "HGrid" ! name of the Elmer variable Valid Min Value 1 = Real $HMin ! valid min value Exported Variable 1 = HGrid ! create the variable in Elmer End
Solver 2 Equation = Reader2 Procedure = "Scattered2DDataInterpolator" "Scattered2DDataInterpolator" Variable = -nooutput dumy2 Variable 1 = File "thickness" ! var name in .nc file Variable 1 data file = File "$TOPOGRAPHY_DATA$" ! name of the .nc file Variable 1 Valid Min Value = Real $HMin ! valid min value Target Variable 1 = String "H" ! name of the Elmer variable Exported Variable 1 = H ! create the variable in Elmer End
In many applications some variables changes by order of magnitudes or present discontinuites.
In these cases it becomes desirable to increase the mesh resolution in some areas while keeping low resolution in some other to keep computing ressources.
Elmer/Ice includes a 2D anisotropic mesh adaptation scheme and rely on the external library mmg to do the remeshing.
See the documentation for the installation procedure.
For additionnal informations, you can see this presentation that was presented at the Advanced Elmer/Ice Workshop - IGE 2017
Limited to serial
Can be used in a transient scheme so that the mesh refinement follow the simulation. See here
The optimised 2D mesh can be extruded for 3D simulations
Joe Todd’s 3D calving machinery relies on the 3D version of mmg
Elmer/Ice also includes shallow approximations to the Stokes equations
Focus has been more on ice sheet margins and ice-streams/ice shelf systems, the Shelfy-Stream Approximation has been used “operationnaly” to run simulations of the Greenland and Antarctic ice sheets
There is a SIA solver however it has been implemented mostly for comparison with the Stokes solution and thus is not optimised for large scale simulations
I will not give a course on ice sheet modelling; see e.g. Greve and Blatter, “Dynamics of Ice Sheets and Glaciers” for details on the derivation of these approximations
Here, we will see how to use the SSA solver to compute the velocity field and make transients simulations with the thickness solver
with :
the ice thickness \(H=z_s-z_b\)
the averaged effective viscosity \(\bar{\eta}\) given by \[\bar{\eta} = \dfrac{1}{2} 2^{1/n} E_e^{1/n-1} \bar{\nu}\]
where :
\(\bar{\nu}=\dfrac{1}{H} \int_{z_b}^{z_s} (2A)^{-1/n}\)
\(E_e=((\dfrac{\partial u}{\partial x})^2+(\dfrac{\partial v}{\partial y})^2+\dfrac{\partial u}{\partial x}\dfrac{\partial v}{\partial y}+1/4(\dfrac{\partial u}{\partial y}+\dfrac{\partial v}{\partial x})^2)^{1/2}\)
To compute the solution we need to initialize :
The material properties
the mean viscosity \(\nu\)
T (\(^\circ\)C) | \(A\) \((\textrm{s}^{-1} \, \textrm{Pa}^{-3})\) | \(\bar{\nu}\) \((\textrm{MPa} \, \textrm{a}^{1/3})\) |
---|---|---|
0 | 2.4e-24 | 0.188 |
-2 | 1.7e-24 | 0.210 |
-5 | 9.3e-25 | 0.257 |
-10 | 3.5e-25 | 0.356 |
the basal friction coefficient
The topography:
The bed elevation \(b\)
The ice thickness \(H\)
Lower order models use the hydrostatic approximation, the bottom \(z_b\) and top zs surfaces are deduced from the ice thickness and bed elevation using the flotation criterion:
All the variables to run the examples have been interpolated on the optimised mesh under the directory Elmer/3_INITIALISATION
See Elmer/4a_DIAGNOSTIC to compute the velocity field in the model domain
Solver 1 Equation = "SSA" Variable = -dofs 2 "SSAVelocity" Procedure = "ElmerIceSolvers" "SSABasalSolver" ! Numerical settings; Linear System Solver = Direct Linear System Direct Method = umfpack Nonlinear System Max Iterations = 20 Nonlinear System Convergence Tolerance = 1.0e-05 Nonlinear System Newton After Iterations = 6 Nonlinear System Newton After Tolerance = 1.0e-03 Nonlinear System Relaxation Factor = 1.00 ! GL subgrid scheme Sub-Element GL parameterization = logical True GL integration points number = Integer 20 End
GL subgrid scheme:
Constants sea level = Real $zsl water density = Real $rhow End
Material properties are defined in the material section
Material 1 ! Material properties Viscosity Exponent = Real $1/n Critical Shear Rate = Real 1.0e-16 SSA Mean Viscosity = Equals Mu SSA Mean Density = Real $rhoi SSA Critical Thickness = Real $HMin ! slip coeff for the SSA SSA Friction Law = String "linear" SSA Friction Parameter = Equals slc0 End
Body Forces:
Body Force 1 Flow BodyForce 1 = Real 0.0 Flow BodyForce 2 = Real 0.0 Flow BodyForce 3 = Real $gravity End
Boundary Conditions:
Boundary Condition 1 Target Boundaries = 1 Normal-Tangential SSAVelocity = Logical True SSAVelocity 1 = Real 0.0 End
Boundary Condition 2 Target Boundaries = 2 Calving Front = Logical True End
The natural condition for the SSA is the difference between force due the ice hysdrostatic pressure and the force exerted by the exterior, i.e. the hydrostatic water pressure below sea level and the atmosphere pressure (=0) above.
If nothing is prescribed the natural Boundary condition is no force difference which is equivalent of having a block of ice of the same thickness at the BC.
The thickness solver solves the continuity equation for the ice thickness:
\[ \dfrac{\partial H}{\partial t} + \textrm{div} (\bar{u}H) = \dot{a}_s + \dot{a}_b \] with :
In Elmer/4b_PROGNOSTIC we run three 50y prognostic simulations
a control simulation with constant surface mass balance CTRL.sif
a perturbation experiment using a synthetic smb perturbation from InitMIP dSMB.sif
an experiment with basal melting under floating ice shelfs BMB.sif
Solver 3 Equation = "Thickness" Variable = -dofs 1 "H" Procedure = "ElmerIceSolvers" "ThicknessSolver" Exported Variable 1 = -dofs 1 "H Residual" Exported Variable 2 = DhDt Compute DhDt = Logical True ! Numerical settings; Linear System Solver = Direct Linear System Direct Method = umfpack ! required for limitation Linear System Convergence Tolerance = 1.0e-12 ! equation is linear if no min/max Nonlinear System Max Iterations = 10 Nonlinear System Convergence Tolerance = 1.0e-09 !! Stabilization Method = Stabilized Transient Stabilisation = logical true Apply Dirichlet = Logical True !! the convection velocity (mean horizontal velocity) Flow Solution Name = String "SSAVelocity" End
Simulation ... Timestepping Method = "bdf" BDF Order = 2 ... End
Solver X ... !% use limiters Apply Dirichlet = Logical True !% the residual of the solution;i.e. volume to add to satisfy the limit Exported Variable 1 = -dofs 1 "H Residual" !% a toelrance criterion Linear System Convergence Tolerance = 1.0e-12 End
Material 1 ... !% Min Value for H Min H = Real $HMin End
Body Force 1 Top Surface Accumulation = ... Bottom Surface Accumulation = ... End
The following solvers are solved in sequence during a time step
Flotation: Update geometry and mask for current \(H\)
SSA: compute the advection field
Thickness Solver: compute new thickness
An iterative scheme can be used within time steps to couple the solvers; leading to a semi-implicit method, so this should improve the robustness of the solution
Simulation ... Steady State Min Iterations = 1 Steady State Max Iterations = 3 ... End
Convergence of the steady-state iterations is checked for each solver with the keyword
Steady State convergence Tolerance = Real …
Simulation ... Post File = "$name$.vtu" vtu: Vtu Time Collection = Logical True ... End
To visualise the total mass balance we create an intermediate variable using the UpdateExport Solver
Solver 1 Exec Solver = Before Timestep Equation = "Update" Procedure = "ElmerIceSolvers" "UpdateExport" Variable = -nooutput "up" ! This solver update exported variables from their definition in ! the body forces Exported Variable 1 = smba End
Body Force 1 ! update the total smb (see solver 1) smba = Variable Time, smb, dsmb real procedure "SMB_A" "SMB_ANOM" End
Body Force 1 bmb = Variable GroundedMask,Zb real procedure "SUB_MELT" "SUB_MELT" SUB_MELT meltA = Real 0.0 SUB_MELT meltB = Real -1.25e-4 End
We can apply a no-melt parameterisation (see Seroussi and Morlighem (2018)) by checking if we are in a floating element or a partially floating element:
Body Force 1 Bottom Surface Accumulation = Variable bmb real procedure "SUB_MELT" "DISC_MELT" End
FUNCTION DISC_MELT ... CurEl => Model % CurrentElement NodeIndexes => CurEl % NodeIndexes(:) GM => VariableGet(Model%Mesh%Variables,"groundedmask",UnFoundFatal=.TRUE.) GMValues => GM % Values(:) GMPerm => GM % Perm(:) IF (ANY(GMValues(GMPerm(NodeIndexes(:))).GT.-0.5)) THEN VarOut=0._dp ELSE VarOut = VarIn END IF END FUNCTION DISC_MELT
Developpement perspectives for large scale simulations:
develop a 2D calving parametrisation for prognostic calving fronts
thermo-mechanical coupling
hybrid SIA/SSA solution
….
A control inverse method is available for the Stokes and SSA solver.
This is a variationnal method, i.e. the optimal set of parameters is found by minimising a cost function that measures the mismatch between the model and some observations (usually surface velocities).
These method are routinely used to tune the basal friction coefficient field, can also be used for the ice viscosity
See details in the Elmer/Ice 2017 workshop
I have made some re-organisation of the codes in Spring 2020
It is now fully documented in markdown documents here
There is updated examples in the elmer repository
Initialisation : here we take an ad-hoc value but better to start from you best guess
Initial Condition 1 ! Initial guess of log10(slip coef.) alpha = Real -3.5 End
Compute the velocity field (SSASolver)
Compute the cost function (Adjoint_CostDiscSolver)
Compute the adjoint state (Adjoint_LinearSolver)
Compute the derivative of the cost function with respect to the optimised parameter (AdjointSSA_GradientSolver)
Compute the regularisation term (Adjoint_CostRegSolver)
Update the friction coefficient (Optimize_m1qn3Parallel)
The test case to initialise the basal friction coefficient is available under /Elmer/5_OPTIMISATION
We run several inversions with increasing values of the regularisation parameter
Optimal regularisation is found by plotting the L-Curve:
Optimisation procedure is fairly robust and should not evolve too much, still need to version some solvers related to the mass conservation method for thickness inversions.
challenges are related to:
regularisation; very simple for the moment (only assume smooth fields). How can we use optimisation results to better define background statistics?
transient assimilation to assimilate observation series
How to initialise the friction in non glaciated areas?