Quantitative experiments: Part 1
Hello and welcome to this module,
which will consist of several videos
in which we will see how to set up a quantitative experiment.
The theory and algorithms of quantitative experiments
are presented in the videos on the theory of Ariane
made by my colleague Bruno Blanke.
We can define a quantitative experiment
as the study of the transfer and transformation of water bodies
from one ocean region (or 'section') to another.
In these videos, we will carry out a real study
of water mass transfer from the North Atlantic towards the South,
using the outputs of the global configuration
ORCA 'quarter degree' of the NEMO model.
We will use a completely different data set
from the one used in the videos
on qualitative experiments.
We will look at the files you'll need (including the data set)
to perform such a quantitative experiment,
and describe the creation of the Namelist file in detail.
The rest of the experiment will be covered in later videos.
I open a terminal and go into the directory
that you now know: 'Ariane'.
There, I'll create a new directory for my quantitative experiments.
I'll go into in this directory.
I'll create another directory for my first experiment
and go into this directory ('Exp0').
Now I'll need a number of files
to conduct my quantitative experiment.
Let's look at all the files I'll need.
As for the qualitative experiment,
we need an Ariane executable.
In our directory, we will point,
using a symbolic link,
to the Ariane executable we compiled
and installed in '/home/ariane/Ariane/bin/ariane'.
The executable is called 'Ariane'.
You should know how to do this.
Next, we will create a Namelist file.
This is going to be the main focus of the current video.
We will use the wizard on the Ariane web page,
called the 'Ariane Namelist Assistant'.
We'll come back later in this video to the details
of creating the Namelist file using the
'Ariane Namelist Assistant'.
There's a file that we'll create in other videos,
a file called 'sections.txt'.
Making this file is a little more complicated
than for the 'initial_positions' file of qualitative experiments.
We are going to need a file called 'segrid',
and we'll create it using the executables 'mkseg0' and 'mkseg'.
These are located in the same directory as the Ariane executable.
We will come back to all these executables in detail later,
and to the creation of 'segrid' and 'sections.txt'.
We will see that if, in the Namelist file, we set
(which I strongly recommend)
the 'key_reducmem' parameter to 'TRUE',
we optimise the use of our computer's memory
by only reading the region in the NetCDF file
included in the sections we have defined.
I will come back to this point in later videos.
Finally, the data set I use
in this experiment is a real data set
from the NOC (National Oceanography Centre),
extracted from a simulation with the NEMO model
with a 1/4° ORCA configuration
on a C-grid.
If I click here, I open a web page.
where these data can be found under the heading
'Global 1/4 degree forced ocean configuration'.
Here, 44 years of data are available.
So I used data from this website
provided by the NOC.
Here you have the URL if you wish to download this data.
Now, we will create the Namelist file
needed for our Ariane experiment.
For this we go to the Ariane web page,
to the 'Ariane Namelist Assistant'
provided on the official Ariane web page.
In other videos,
I will detail each of the parameters
available on this page and how to fill them in.
We'll quickly go over the simple parameters
and I will focus on two or three that are important
for setting up a quantitative experiment.
I start by selecting the NEMO model.
Then I'll fill in the dimensions of my model.
To do this, I return to my terminal.
In one of my directories
which I called 'DATA'
I stored the data I downloaded from the NOC site.
Here are all the files.
To find out the dimensions, I use
the 'ncdump' utility with the '-h' option
and I take any file. For example, that one.
The header information given by 'ncdump'
should tell me the dimensions of my model.
Here I have 1442 points in longitude,
1021 points in latitude
and 64 vertical levels.
So this is the information I'm going to enter:
1442 for the longitudes,
1021 for the latitudes,
and 64 vertical levels.
How many recordings or instants in time do I have?
In this case, I recovered 21 years out of 44.
Each year has 12 months
because these fields are monthly.
So I will have 21 * 12 = 252 recordings
in the ensemble of my files,
each file having one piece of information per month.
Even if the model is global,
the version that the NOC proposes
does not contain periodicity in longitude and latitude.
So I leave these two parameters set at 'FALSE'.
I will also ask to recalculate the speed 'w',
because I only took 'u' and 'v'
to reduce the amount of disk space used.
This model does not use partialsteps
so I'm going to put 'FALSE'.
Each record corresponds to a month of 30 days.
Here I have one day in seconds
so I'll put 'ntfic = 30'.
and leave 'tcyc = 0'.
Will I read the data sequentially? – Yes,
because my data set will not fit into the memory,
so I'll have to read the files one after the other.
As this is a realistic simulation,
I'm not going to 'loop' over the 21 years,
so I leave 'maxcycles' at '1'.
Now we come to the important part ('Diagnostic modes')
Here, I select 'Quantitative'
and I will have several parameters
to be checked or modified according to my experiment.
The first point, which is important and we'll look at in detail,
is the value of 'max_transport'.
On this slide, I'm repeating what we did
in a qualitative experiment.
You remember that we had to position
each particle by hand and to do this we
filled in the file 'initial_positions.txt'
with five parameters: 'gi', 'gj', 'gk', 'gl',
and a last parameter, 'transport', always set at '1'.
For more details, rewatch the videos on qualitative experiments.
Each of the particles always had the same weight: '1'.
In quantitative mode, it's Ariane that positions the particles
according to a section that we predetermine. We'll see that in later videos.
Depending on the current or transport through this section,
in each mesh of the model,
if only one particle is positioned,
then this particle will have a different weight
or different transport.
So each particle will have a different weight
and some particles will be more or less important than the others.
The 'max_transport' command
will allow us to tell Ariane
if we position only one particle per mesh
or several particles per mesh.
We'll look at this together in the next slide.
Another important point:
here, we start from an initial experiment.
In our Namelist file, we will put 'bin=bin'.
So Ariane will automatically instrument the sections we determine.
This is one of the strengths of Ariane,
which is not usually found in other applications.
How does 'max_transport' work in Ariane?
I'll take a diagram from
the videos by my colleague Bruno Blanke,
which represents a vertical section
with the meshes of the model,
and here the depths 'k' and 'i',
which represent the longitudes.
Here, we have represented in isolines,
a transport that crosses this section.
Here we see the intensity of this transport,
which decreases as one moves away from the centre.
The small red crosses show
how Ariane will instrument each mesh of the model
according to the intensity of the current.
We can conclude, here, that
the stronger the current, the more particles Ariane will put.
While this is true, it also depends
on the value you enter for 'max_transport'.
If you set a very high value,
Ariane will put only one particle.
As the value of 'max_transport' decreases, however,
Ariane will add more particles.
Here, we have a reminder
of the algorithm that Ariane uses
which was covered in the videos by my colleague Bruno Blanke.
For all the details, please refer to
the 1997 paper by Blanke and Raynaud, in the appendix.
What it is important to remember here is that
each particle will have a different transport
and if 'max_transport' is low,
Ariane will put more particles where there is more transport
and less particles where there is less transport.
This is the spatial distribution of our particles,
but you need to know that, over time,
the increase in the number of particles
is also done on the recording.
Here we have two time sections.
When there is only one particle,
Ariane positions it in the centre of our recording.
Here we have the recording of one month.
The particle can be positioned on day 15, for example.
However, if we have eight particles positioned by Ariane,
their number is based on a cube (n^3); so, 1, 8, 27, etc.
So, if Ariane positions 8 particles,
they will be positioned temporally
at the first and second thirds of our recording.
To clarify what I just said for 'max_transport',
the higher the value you give it...
and here we deliberately set a very high value
to be sure that Ariane would only put one particle
in the centre of the mesh and time recording,
with the transport associated with what passes through the mesh
so each particle will have a different transport.
However, if you decrease this value,
it will be up to you to do some tests and then,
depending on the transports that cross your section,
adjust this parameter to increase
or decrease the number of particles.
The more you increase the number of particles,
the greater the degree of precision with which
Ariane will describe the water mass transfer.
The default is always to start with 1.e9.
Then, if you find the description of the water mass transfer
is a bit rough, you can reduce this value
so that Ariane increases the number of particles
and describes the water mass transfer more accurately.
So, 'max_transport' is a very important adjustable parameter.
We'll leave it at 1.e9 in this first experiment.
Two other very important parameters are 'lmin' and 'lmax'.
By default 'lmin'=1
and 'lmax'=maximum number of recordings.
Parameters 'lmin' and 'lmax', in terms of recordings,
will give the period over which Ariane should instrument the section.
We will illustrate this on some slides.
I'll take an example with just 5 years, for easy readability.
Here we have a time series of 5 years,
each containing 12 recordings.
This gives us one recording per month.
Suppose we set 'lmin'=1 and 'lmax'=12.
This sends the following instruction to Ariane:
- instrument the determined section
over the period between the 1st and the 12th record.
- do not instrument the other years (2, 3, 4 and 5).
Then, Ariane will integrate the particles according to our choice:
positive in time (forward) or negative.
Ariane will integrate each particle over the 5 years available.
Please note (I shall come back to this later on) that
a particle that sets out on January 1st of the 1st year
will have an integration period of 5 years.
However, a particle that sets out on December 31st
will only be integrated over 4 years.
So, if we do statistics, we'll see that
these particles will not get the same integration time.
This raises other questions that we'll go into later.
Here, we integrate in the positive time direction.
But let's imagine that we want to integrate backwards in time.
As you have instrumented your 1st year (lmin=1 to lmax=12),
the backward integration time will be very short.
It is almost zero for a particle started on January 1st.
A particle started on December 31st will be integrated over just one year.
So, in the backward direction, we prefer to instrument
the end of our time series rather than the beginning.
In this case we can put 'lmin'=48 and 'lmax'=60.
These explanations should help you
to fill in the values for 'lmin' and 'lmax'.
In our case, we have 21 years of data.
I'll run the particle integration on the first year only.
Then, they can be integrated for the next 20 years.
So I put 'lmin'=1 and 'lmax'=12.
Let's quickly look at the other parameters, which are quite simple.
I recommend that you set 'key_reducmem' to TRUE.
This parameter is used to optimise the reading of NetCDF files
and memory usage.
The following parameters I leave as they are
and refer you to the videos on the Namelist file description.
We are in 'nobin' mode.
The maximum number of particles. Here we have a dilemma.
When doing a qualitative experiment,
you simply fill in the file 'initial_positions.txt'
and you know exactly how many lines are filled in.
So, you set 'lmax' by putting the number of particles you have.
This time, it's Ariane that will instrument the section.
Furthermore, with the 'max_transport' tool, we don't know
how many particles will be put in our model.
I advise you to put a relatively high value.
For example, I put 200,000 particles.
When you start your experiment, there are two possibilities:
– Either, the experiment runs
and at the end you will know the exact number
of particles Ariane has used.
This will allow you, in later experiments done from this one,
to optimise this value of 'lmax'.
– Or, the value is too small and Ariane stops.
You will then have to increase 'lmax' and redo the experiment.
We will use an integration in the positive time direction
so I leave it on 'Forward'.
Now, we will fill in
where the data set is located:
the directory and file names.
I return to my terminal
and go into in the directory of my data.
When I display my data,
I realise that this file name format
is not accepted by Ariane.
So I'll have to change these names
to make the files available to Ariane.
I go to the 'examples' directory,
in which the 'shell_scripts' directory is located.
This directory contains some scripts
to perform certain actions.
For example, there are scripts allowing files to be renamed
from filenames that you have.
I copied one of these scripts into my directory,
and modified it to take on the nomenclature of my files.
Let's have a quick look.
I'm not going to spend too much time on this step.
Here the file name starts with a prefix: 'ORCA025-N102'
As I have a large number of files,
I prefer to put the number in three digits
as this is a common practice in 'ksh'.
I've got 'U' and 'V' as variables.
I'm going to run the script that will create symbolic links
using the 'ln -s' command for each of my files.
This will allow Ariane to accept
these file names when integrating them.
I run the script...
It does its work: we see that there are 252 files
and that the symbolic links have been created.
For example here for '250'...
I'll go back to the Namelist file creation page.
I need to identify the directory where the data is.
So I go back to my terminal, type the command 'pwd',
and get the information,
which I paste here.
What is the prefix of my NetCDF files?
I do the same operation, I find the information
and I paste it here.
Files start at 'ind0_zo'=1
and end at 'indn_zo'=252.
And the number of digits is three.
The suffix of my files is '_U.nc'.
What is the name of the variable that contains the current
in this NetCDF file?
We will check this with an 'ncdump' command.
So the name of the current variable is 'vozocrtx'.
This was the same name already in the application.
There is no variable for 'eddy induced velocity'.
The value for the mask, you can see here…
It will be 'missing value'.
This value is already in 'ANA', so that's alright.
For the meridional component, we'll copy the information
from the zonal component.
The file name stays the same.
The number of files stays the same.
The number of digits stays the same.
However, for the extension, I reuse what's here,
and change to '_V.nc'.
We check the name of the variable,
which is 'vomecrty'.
'vomecrty' is correct.
There is no 'eddy induced velocity' in the meridional component
and 'missing value' is indeed the parameter
for values that are not filled in.
Now, in the Namelist file, we have
all the data needed for this Ariane quantitative experiment.
As I didn't download the temperature and salinity,
I leave this parameter on 'FALSE',
but this information is available on the NOC website.
Next, the 'Meshmask' file must be filled in,
i.e. the detail of the model grid in longitude, latitude,
the scale factors to recalculate the transports, and the mask.
We are still in the same directory.
I created a 'meshmask' file,
which corresponds to my grid and whose name I will retrieve,
and paste here.
Now I'll have to check this NetCDF file for
the corresponding set of variables:
– the longitude for point 't',
– longitude for point 'u',
– latitude for point 't',
– latitude for point 'v',
– depths (verticals) for point 'w',
– the scale factors, which, if you click here,
have a graphic representation to help you,
– and the mask, which is three-dimensional.
I will use the 'ncdump -h' command again
and I see 'glamt', 'glamu', 'gphit', 'gphiv', 'gdept'...
...'w' correspond to the names entered in the 'ANA'.
Then we have the scaling factors 'e1t', 'e2t',
e2u', 'e1v' and 'e3t', which are also available and have the same names.
Finally, we have the three-dimensional mask: 'tmask'.
Everything is correct in my Namelist file, I come to the end.
I didn't ask for 'ascii' output from my experiment,
so I leave this option on 'FALSE'.
I click on 'Print on screen a beautiful Ariane Namelist'.
We get this page, displaying
the parameters of your Namelist file.
Just select them with the mouse
and we'll save them in the Namelist file
in the directory of our quantitative experiment.
I go back to my terminal.
I return to my 'quantitative' directory
and the current experiment.
I create my Namelist file
and in it I paste all the parameters copied from the web page.
Then I save the file.
I now have a first file in my directory: the Namelist file.
We'll stop here.
In this video we have seen:
We've seen the beginning of the set-up of a quantitative experiment.
We have described all the necessary files
to carry out an experiment of this type.
Then, we filled in the details
of a Namelist file using the wizard on the Ariane web page.
Finally, we copied the parameters into a Namelist file in our directory.
We will also have to create a link to the Ariane application.
In the next videos, we will see how to create the other necessary file: 'sections.txt'.
For this we will need to use the executables
'mkseg0' and 'mkseg', which are in the 'bin' directory.
Thank you, see you soon!