Commit a4dc26f5 by Jérémy Baudry

### ajout documentation

parent a7863271

21.8 KB

15.7 KB

 \documentclass[10pt,a4paper]{report} \usepackage[utf8x]{inputenc} \usepackage{ucs} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{float} \usepackage{graphicx} \usepackage{listings} \usepackage{color} %May be necessary if you want to color links \usepackage{hyperref} \hypersetup{ colorlinks=true, %set true if you want colored links linktoc=all, %set to all if you want both sections and subsections linked linkcolor=blue, %choose some color if you want links to stand out } %\usepackage[obeyspaces]{url} \newcommand{\inlinecode}{\texttt} %\author{Dany Dumont, Eliott Bismuth, Jérémy Baudry} \title{User Manual and Documentation of WIM} \begin{document} \maketitle \tableofcontents \chapter{Introduction} WIM (Wave in-ice Model) is a simple conceptual 1D spectral model designed to assess some processes evolving in the interactions between waves and sea ice. \chapter{Physical aspects} The model capture two main features of the interactions between waves and sea ice: The attenuation of wave energy by ice and the fracturation of the ice by waves. This section review the physical processes implemented in WIM. \section{The basics: The wave spectrum} A record of the sea surface elevation $\eta(t)$ can be considered to be the sum of a large number of harmonic waves with random amplitude and phase. \eta(t)=\sum_{i=1}^{N}\underline{a_i}cos(2\pi f_it+\underline{\alpha_i}) \begin{figure}[H] \begin{center} \includegraphics[scale=0.5]{harmonic} \caption{A wave record is a sum of many harmonic waves with different amplitudes and phases } \end{center} \end{figure} The phases and amplitudes being random variables, they can be characterised with their probability density function. For each frequency, the phase $\underline{\alpha_i}$ is uniformly distributed between 0 and 2$\pi$ and the amplitude $\underline{a_i}$ is rayleigh distributed. P(a_i)=\frac{\pi}{2}\frac{a_i}{\mu_i^2}\text{exp}\left( -\frac{\pi a_i^2}{4\mu_i^2}\right) where $\mu_i$ is the expected value of the amplitude $\mu_i=E\lbrace\underline{a_i}\rbrace$. The function that shows this expected value over each frequency is called the amplitude spectrum. \begin{figure}[H] \begin{center} \includegraphics[scale=0.5]{spectre1} \caption{amplitude spectrum} \end{center} \end{figure} But it is more relevant to consider the variance density spectrum \begin{figure}[H] \begin{center} \includegraphics[scale=0.5]{spectre2} \caption{variance density spectrum} \end{center} \end{figure} By multiplying the variance density spectrum by $\rho g$, we obtain the \emph{energy spectrum} S_{energy}=\rho gS_{variance} In WIM, the energy spectrum is described using an analytical function. There are many differents equation used to model the wave spectrum, in WIM it is possible to choose between a JONSWAP or a Bretschneider type spectrum. (see section 4.2.3) \section{Advection} The wave spectrum is advected by solving \frac{\partial S}{\partial t}+c_g\frac{\partial S}{\partial x}=0 \section{Attenuation} The attenuation source term is defined as: R_{ice}=\widehat{\alpha} S where $\widehat{\alpha}$ is a dimensional attenuation coefficient defined such as: \widehat{\alpha}=\frac{\alpha c}{\left\langle D\right\rangle } where $\alpha$ is the dimensionless attenuation coefficient, i.e. the (average) amount of attenuation per individual floe, which is a function of ice thickness and wave period. \begin{figure}[H] \begin{center} \includegraphics[scale=0.5]{alpha} \caption{Dimensionless energy attenuation coefficient $\alpha$ given bythe model of kohout et meylan (2008) } \end{center} \end{figure} \section{floe breaking} The model of Williams et al.(2013) is used to parametrize the wave induced floe breaking. \\ The flexural strain imposed by passing waves on ice is defined as: \varepsilon=\frac{h}{2}\frac{\partial^2\eta}{\partial x^2} where $\eta$ is the sea surface elevation,$h$ the ice thickness and $x$ the horizontal distance. We can also define the significant strain E_s=2\sqrt{\left\langle \varepsilon^2\right\rangle} The mean square value is $\left\langle \varepsilon^2\right\rangle=m_0\left[ \varepsilon\right]$ where $m_0\left[ \varepsilon\right]$ is the 0th moment of the strain spectrum. For a sinusoidal wave of the form $A_{ice}sin\left(k_{ice}x-\omega t\right)$ the maximum strain is E=\frac{h}{2}k_{ice}^2A_{ice}(\omega) where $k_{ice}$ is the wavelength in ice and $A_{ice}$ is the amplitude in the ice. We can then define the 0th moment of the strain spectrum m_0\left[ \varepsilon\right]=\int S(\omega)E^2(\omega)d\omega If the significant strain $E_s$ exceed a certain threshold $E_s>\varepsilon_c$ then the ice breaks and the maximumfloesiwe is set to D_{max}=max\left[ \lambda_w/2,D_{min}\right] where $D_{min}$ is the minimum floe size and $\lambda_w$ the dominant wavelength defined as $\lambda_w=2\pi/k_w$ and $k_w=k_{ice}(2\pi/T_w)$. $T_w$ is the dominant period of the spectrum defined as: T_w=2\pi\sqrt{\frac{m_0\left[\eta \right] }{m_2\left[\eta \right]}} where $m_n\left[\eta \right]$ is the nth moment of the wave spectrum defined as: m_n\left[\eta \right]=\int\omega^nS(\omega)d\omega \chapter{Getting started} \section{Get WIM source code} The WIM source code is available on the plateform \url{https://gitlasso.uqar.ca/}. To download WIM from this plateform, please execute the following steps: \begin{enumerate} \item create the destination folder where the source code will be download by typing \inlinecode{mkdir } \item go to the destination folder \inlinecode{cd } and execute \inlinecode{ git clone https://gitlasso.uqar.ca/bauj0001/WIM2.git .} \end{enumerate} \subsection{Contents} There are 3 subdirectories: \begin{enumerate} \item \path{src}: This directory contains all the source files of the routines and subroutines of WIM and the makefile to link and compile all source files \item \path{nml}: Contains the namelist file which allow to change model parameters without recompiling the code \item \path{output}: Contains the outputs in NETCDF format. \end{enumerate} \section{Compile and execute WIM} Compilation in WIM is relatively easy. The following steps should however be executed correctly to compile the code without errors. \begin{enumerate} \item Open the \textbf{makefile} in \path{WIM/src/} \item Choose the compiler that will be used to produce the executable by changing the variable COMPILER. By default, the compiler used is GFORTRAN but it should work with other compilers like INTEL FORTRAN \item WIM uses the NETCDF library to save outputs. Ensure first that the fortran NETCDF library is currently installed on your machine. If it is not the case, you can download it at \url{http://www.unidata.ucar.edu/downloads/netcdf/index.jsp}. Once the NETCDF library is installed on your machine, you should link it to WIM by indicating the path of the includes files, modules and libraries in the variables NETCDFINC, NETCDFMOD, NETCDFLIB. \item You can now compile the code by typing \inlinecode{make} in \path{src/}. The executable will be created in the parent directory \path{WIM/}.You can also type \inlinecode{make clean} or \inlinecode{make mrproper} to remove the executable, the objects .o and modules .mod if needed. \item Now execute WIM by typing \inlinecode{./} \end{enumerate} \section{Beginning with WIM: using namelists} Designing a simulation with WIM is quite easy. The WIM model uses \textit{namelists} allowing to change some parameter values without recompiling the source code. afterchanging parameters in the namelists, the values will be read by the routine \textbf{parameters.f90} (see \textit{routines details} for more informations). All namelists are written in a single file \path{nml/parameter.nml}. The file is composed by 4 namelists: \begin{itemize} \item \textbf{model paramete}r: This namelist allow to change some global parameters of the simulations such as the siwe of the domain, the name of the output directory, the name of the simulation etc.. \item \textbf{waves parameters}: Specifies the waves parameters such as the significant height, the peak period and some features like allowing dispersion or not. \item \textbf{spectrum parameters}: Specifies the parameters to construct the wave spectrum such as the number of frequency bin, the minimal and maximal frequency. \item \textbf{ice parameters}: Specifies some ice features like the ice concentration, thickness, initial mean diameters of the floes etc.. \end{itemize} After having changed the parameters in the namelists, you can now run WIM. \chapter{Implementation} \section{General} \subsection{General algorithm} \begin{verbatim} read namelists allocate memory initialize do time loop advection do space loop attenuation floe breaking compute new FSD end space loop end time loop write outputs deallocate memory \end{verbatim} \subsection{Solving ODEs} Time ordinary differential equations are solved in WIM using the first-order Euler method. For a ODE of the general form \frac{dX}{dt}=F(X,t) The euler method give: X_{n+1}=X_n + F(X_n,t_n)\Delta t \section{Routine details} \subsection{main.f90} This is the main program of WIM. It calls all the other subroutines and does the time Loop. It also contains the subroutine \inlinecode{progress} which displays a progress bar in the consol while the model is running. \subsection{parameters.f90} The module \path{parameters.f90} contains all variable and parameters definitions used in the model. All others routines call this module with the Fortran function \inlinecode{USE PARAMETERS}. This module also contains some other subroutines: \begin{enumerate} \item \textbf{read namelists}: Read parameters value specified in the differents namelists contained in the file \inlinecode{parameters.nml} (see Beginning with WIM: using namelists) \item \textbf{array allocation}: Allocate memory for the different arrays and matrix. \end{enumerate} \subsection{initialization.f90} In this routine, the initial spectrum and ice transect are built and initial values for arrays are set. \subsubsection{initial spectrum} It is possible de choose between different methods to build the initial spectrum by setting the parameter \inlinecode{init spec} in the namelist \inlinecode{spectrum parameters}. If \inlinecode{init spec}=1 then a JONSWAP spectrum is built according to S_{init}=\alpha H_s^2\frac{f_p^4}{f^5}\text{exp}\left[\frac{-5}{4}\left(\frac{f_p}{f} \right)^4 \right] \gamma^{\text{exp}\left[ \frac{-(f-fp)^2}{2\sigma^2f_p^2}\right] } where $\alpha=\frac{0.0624}{0.23+0.0336\gamma-\frac{0.185}{1.9+\gamma}}$ and $\sigma= \begin{cases} 0.07, & \text{if } f\leq f_p \\ 0.09 , & \text{if } f> f_p \end{cases}$ (see \url{http://hmf.enseeiht.fr/travaux/CD0910/bei/beiere/groupe4/node/59}).\\ If \inlinecode{init spec}=2 then a Bretschneider spectrum is built according to S_{init}=\frac{1.25H_s^2T^5}{8\pi T_p^2}e^{-1.25(T/T_p)^4} where $T_p$ is the peak period and $H_s$ the significant height \subsubsection{Ice transect} Parameters for ice transect can be set in the namelist \inlinecode{ice parameters}. Ice concentration is uniform through the domain C(x)= \begin{cases} 0, & \text{if } x

36.5 KB

15.6 KB

7.21 KB

14.9 KB

10.1 KB

15.7 KB

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!