Quantitative experiments: Part 2
Hello and welcome!
This video is part of a series
in which we will set up a full-scale experiment in the North Atlantic region
from the outputs of a NEMO 1/4° global ORCA configuration.
The main objective is to show you how to generate a 'sections.txt' file,
which is needed by the Ariane application to delimit an ocean region
for which you want to analyse the water mass transfers.
We will define a set of vertical sections delimiting an ocean region,
which must be closed.
I insist that the region must be closed
either by the use of sections or by bathymetry.
We wish to obtain a completely sealed volume
from which no particle can escape.
They are forced to be intercepted by a section.
A distinction must be made between
the 'initial section' from which the water masses originate
and the 'interception sections'.
I refer you to the videos by my colleague Bruno Blanke
on the quantitative mode of Ariane for more information.
Before getting into the practical part of the Ariane application,
we will explain and show our objectives.
This visualisation is not a direct part of the Ariane software.
On the left of my screen we have a terminal
and on the right, an artistic representation
of the bathymetry of the model
for the Atlantic basin area.
What we want to study is the transfer of water masses
in the strait between Greenland and Iceland.
So we are going to place a section in this strait.
And our scientific question is:
According to this model, where do the water masses crossing this strait finish up?
We are going to study the waters that cross this strait from north to south.
To do this, we will first place an initial section
between Greenland and Iceland.
On my 3D bathymetry representation,
you can see a section that has been positioned.
We are going to study the transfer of water masses through this section.
This is the transfer of water masses from north to south.
Let's go back to the theoretical part of Ariane.
In a quantitative experiment, you need an initial section.
This is the section between Greenland and Iceland.
Here it is represented schematically
and we see that Ariane will automatically instrument
this section in relation to the transport that will cross it.
This is the transport moving from north to south.
Here we have a representation of the iso-contours of a transport
and we see that there are more particles in the core of the transport
than in the places where there is no transport.
The number of particles is also dependent on a parameter
that is called 'max_transport' in the Namelist file.
You can find all the details of this theory
in the appendix of the article Blanke and Raynaud, 1997.
In addition to geographical instrumentation (on the vertical of this section),
we also have instrumentation in time.
Remember that, in the Namelist file, we positioned
the parameters 'lmin=1' and 'lmax=12'.
That is, for the first 12 records,
we are going to instrument that section.
I remind you that our data covers 21 years (from 1980 to 2000).
This is monthly data,
so 12 records correspond to the first year: 1980.
In my model, Ariane will instrument
this section for the 12 records.
So, Ariane will calculate the transport that crosses it from north to south
and put the number of particles needed
to represent this transport correctly.
Now that we have our initial section,
we have to add some interception sections,
i.e. to close our region.
To do this, we will place a number of sections.
Here, we will put two sections called 'section2'.
These sections are located north of the Labrador Sea
so, if water comes up this way,
the particles will be intercepted by either of these sections.
Then we will put a section to the south
to close our domain.
We will put a section between South America and Africa,
which will close our model in the southern part.
We will also put a section, which is not shown here,
at the Strait of Gibraltar.
This section is very small and difficult to represent here.
And we are going to put one last section, section 5,
at the strait between Norway and Iceland,
so that our oceanic domain is completely closed.
So we have an initial section,
and now our region is completely closed,
either by bathymetry or by the sections we laid out,
with the Strait of Gibraltar here.
Please note that sometimes models have
vertical velocities for the current
which, at the surface, evaporates into the atmosphere.
In some models, this speed is not zero.
In such cases, it would be necessary to add a so-called 'lid' section,
which would cover the surface of our ocean region.
This is not the case here in our example.
I will now switch to Ariane to convert these scientific choices
into instructions via the 'sections.txt' file.
I'll go back to my slides.
Here we have represented the files needed
to carry out a quantitative experiment in Ariane.
So, we have the Ariane executable,
the Namelist file, which we already filled in an earlier video,
and we now have to create a 'sections.txt' file
which will correspond to what I have already shown you in 3D.
This is a text file,
similar to 'initial_positions.txt'
when we did a qualitative experiment.
But it's quite complicated to fill in.
You can't fill it in easily by hand.
For this, we rely on two executables.
These two executables, 'mkseg0' and 'mkseg',
are located in the same directory as the Ariane executable.
They were generated during the compilation
and installation of the Ariane application.
'mkseg0' will allow us to generate a 'segrid' text file.
in 'segrid' we will have a representation
of the land-sea mask on the surface of our model.
In this file, the sea points will be represented by '-'.
and the land points by '#'.
'segrid' is simply a 2D representation
of the land-sea mask on the model surface.
I will show this in a terminal.
I am in my 'Ariane/Quant/Exp0' directory
in which I find the Namelist file I created earlier.
I will now create a symbolic link to the 'mkseg0' executable.
This file is in the same directory as the Ariane executable.
The executable is now available in my directory.
What will this executable do?
It will read the Namelist file to find out where
the NetCDF file that describes the model grid is located.
From the NetCDF file, it will extract the variable 'tmask',
which is a 3D representation of the land-sea mask of the model.
It will only extract the first level,
i.e. the surface layer.
It will write the sea dots using the '-' character
and the land dots using the '#' character.
I will now run 'mkseg0'.
'mkseg0' stores all this information in the 'segrid' file
which we have here.
We will open the 'segrid' file with the NEdit editor.
We use NEdit because it allows us, among other things,
to easily place our sections in this text file.
NEdit opens a window.
We will change the font size
in order to see the whole model,
which contains many points
in longitude and latitude. So we will change the font
and choose something rather small.
We are going to use a large part of the screen
to display this mask on the surface.
Indeed, we have '-' for the ocean and '#' for the land,
and we find all the surface bathymetry of our model.
We are interested in the North Atlantic region,
with Greenland here,
and Iceland, Norway, part of North America, England and Europe.
We will position our sections by hand.
For the initial section, we want a section between Greenland and Iceland.
You won't see it on the screen
but to select several characters
and replace them by another character,
you have to press the 'Ctrl' key and right click on the mouse.
You will then be able to select a set of characters
as I'm doing on the screen.
Then, you'll use a macro function
to replace each of the selected characters with a '1'.
We have positioned our initial section in the 'segrid' file.
The initial section in Ariane is represented by the number '1'.
All other digits from 2 to 9
will represent the interception sections.
As I said in my 3D representation,
we have to close the Labrador Sea.
I am going to put an interception section here
with number '2' closing off the north
of the Labrador Sea.
Again, I press the 'Ctrl' key
and use the left mouse button
to select my ocean characters.
I will replace them with '2s'.
I have created a first section,
which can be composed of several parts.
To create a vertical section
I click on 'Ctrl'.
I select with the left mouse button,
but this time vertically,
the ocean characters,
and I will replace them with the '2s' as well,
so my section 2 is in two parts.
Then, we saw earlier that I put a section
in the southern part
of the Atlantic Ocean
so it's going to start about here.
I press the 'Ctrl' key again
and I am going to put a value that will be section '3'
to differentiate it from my section '2'.
I will have different results between section '2' and section '3'
in terms of particle interceptions.
As I said, I have to close the Strait of Gibraltar
to prevent particles from entering the Mediterranean Sea.
I use the 'Ctrl' key and the left mouse click again.
I create a section that I will call section '4'
and then I will close my domain
by putting a section between Norway and Iceland,
which will take the value '5'.
Now my domain, my oceanic region of study, is closed
by an initial section and several interception sections.
The initial section also acts as an interception section
if the particles happen to return to this section.
My domain is closed, either by bathymetry,
as we see here,
or by my sections.
Now I have to tell Ariane
in which direction I want to study the transport through this section.
I'm interested in the north to south currents
and not the south to north currents.
So I choose any spot in my closed domain,
and replace one of the 'ocean' characters with '@'.
Now that we have saved the 'segrid' file,
we can close this window.
We will now create a symbolic link to the second executable
'mkseg'.
The 'mkseg' executable is available
and we can run it.
It will read the 'segrid' file
and output a 'sections.txt' file,
which is the file we want to obtain.
Now Ariane is reading the contents of our 'segrid' file
and will determine, with respect to the positioned sections
in the 'segrid' file,
the coordinates that are found here.
For section 1, Ariane will write the coordinates
and name the section 'section 1'.
For section 2 (two parts), we will have 2 lines
with the coordinates 'i' and 'j' corresponding to these sections.
For section 3, which is to the south, the coordinates, section 4 and section 5.
Here, it takes a little longer to run because
Ariane generates a file: 'segrid_region_limits'.
I have enabled the 'key_reduc_mem' option,
which allows me to read in the NetCDF files
only the oceanic region that I'm interested in,
which saves memory
and allows a faster execution of the model.
We can see what Ariane reads from the NetCDF files
by opening the 'segrid_region_limits' file.
I will do this quickly...
I'm going to change the font size for better visibility...
We see small dots on the regions that are not read
and here we have the studied region,
which is what Ariane will actually read from the NetCDF file.
We see that the model takes into account the sections, but also the bathymetry,
and stops a few points below my southern region.
It takes into account all the points in the Caribbean Sea.
This is perfect, as the model will read the ocean region of interest.
The 'sections.txt' file is now in my directory.
I will edit the 'sections.txt' file.
We can add a lid if necessary
as I told you before.
I'm going to create a lid.
In general, we give it a higher number
than the previous interception section numbers.
Generally, a lid is put on the whole oceanic domain of the model
and not just the region of interest.
So I put '1' for 'i'.
I know that there are 1442 dots in 'i'.
I put 1 for 'j',
and 1021 points in 'j'.
And to specify it's on the surface, I put '0' and '0' for the depth
and I will call this section 'lid', for example.
In the 'sections.txt' file, you can also change the names of the sections.
Here, we will rename section 1
and give it a more explicit name,
for example 'detroitGI' (Greenland Iceland).
We will change the name of section 3, for example,
and call it 'South'.
Section 4 can be called 'Gibraltar', and so on.
I won't do them all now, but it's a good idea
to give them more explicit names
to make the results interpretation easier later on.
I will now write this file and save it.
Now I have a 'sections.txt' file in my directory.
I will create a symbolic link to the Ariane executable,
as this was not yet done.
I have the Ariane executable,
I have the Namelist file, I have the 'sections.txt' file.
I am ready to submit my quantitative experiment.
We will do this in a later video.
In this video, we learned how to position sections to delineate an ocean region
and how to turn this into a text file, 'sections.txt',
interpretable by the Ariane application.
We have seen the steps necessary to create 'sections.txt'.
In the following videos, we will submit this to the Ariane application
and interpret the output files.
Thank you and see you soon!