Quantitative experiments: Part 7
Hello and welcome to this last video
about implementing and interpreting a quantitative experiment with Ariane.
In this video, we will learn how to plot a streamfunction
from the NetCDF statistical result files of our quantitative experiment.
We will see how to isolate only the water mass transfers
between the initial section and section 3 in the south of our domain,
in order to remove the transfers of water mass to the other sections.
And, finally, I will present how we can refine our results
using the 'max_transport' parameter.
Let's start from the idealized representation of a quantitative experiment
presented in a previous video.
If you remember, we had six particles that started from section 1:
T1, T2, T3, T4, T5 and T6.
These particles had trajectories and reached interception sections
such as section 1, the section 2s or section 3.
Each time these trajectories crossed a cell wall,
either zonal or meridian,
we would calculate the accumulated transports on these walls.
So we adopted a convention,
and we saved this information on the zonal and meridian walls independently
in the statistics NetCDF file.
In order to calculate the ψ function in an idealized way,
we will make a convention in this graphical representation
which is that T1, T2, T3, T4, T5 and T6 are equal to 1.
In reality, the transports are not equal to 1 and are all different.
We use this trick to simplify our calculations.
Thus, we will replace our representation in T1, T2, T3, T4, T5, T6
by the calculation of the cumulative values for each of our cell wall surfaces.
Now, how can we calculate our ψ function?
We will have to rely on the equations presented
in the previous video on the quantitative mode
from the 1989 paper by Bruno Blanke et al.
and the fact that we will manually position
this first value for ψ.
In general, we take an earth point because we know that the ψ value for this point will be equal to zero.
When you want to calculate ψ, you will have to fill in this first value.
Here, we take an earth point and we set the ψ value to '0'.
One simple way to apply these equations is to use the following diagram.
From a known value of ψ,
if we want to calculate its value above, we add the transport Ty,
if we want to calculate its value towards the right, we subtract Tx,
if we want to calculate its value on the left, we add Tx,
and if we want to calculate its value below, we subtract Ty.
Since we have set the first value at '0' here,
and since we have information on Tx and Ty here,
we can calculate these values on the left, right, above and below.
So we calculate our ψ function
from point to point and cover the whole of our domain.
Here, we have 'ψ = 0',
plus 'Ty = -1'
so ψ = '0' + '-1' = '-1'.
Here, we have a value that can be calculated in two ways,
either we take this '0' value here
'0' + '-1' = '-1'
or we take the value of ψ
that we know here: '0' - '1' = '-1', with '-Ty' here.
So we will progressively be able to fill in all the values in our table,
and thus obtain the streamfunction over our entire domain.
Once we have all the values, we can make a graphic representation.
This is the figure I used in the conclusion of the previous video.
We have plotted the streamfunction
between section 1 and all the other sections.
The streamfunction is represented here,
mainly between section 1 and section 3,
because, out of the 22.73 Sverdrup (Sv),
almost 20 Sv go through section 3.
We also have some particles escaping through section 5,
representing 0.20 Sv;
particles escaping through the section 2s (0.21 Sv);
and particles that come back to the initial section (2.28 Sv).
Now, you understand that in relation to the initial question that we asked ourselves,
which was to know the transfer of water mass between section 1 and section 3,
the trajectories of the particles escaping through the other sections
will somehow 'pollute' our statistical results
because they will be taken into account when crossing the grid cell walls.
So, the objective now is to take only the trajectories of the particles
that start from the initial section and go to section 3.
Let's go back to our terminal,
and the directory of our quantitative experiments.
Here I have already carried out an experiment
that only takes into account the particles going to section 3.
I have already done this experiment, so all the necessary files
and result files are ready.
Now, we know the files needed to run our experiment.
One of them is the Namelist file.
Let's have a look at its contents.
We see that we are in 'subbin' mode,
that is, we are only going to take a part of the particles,
which will be defined in 'subset.txt'.
Here, we will only take the particles that have reached section 3.
We have the file 'sections.txt', which is exactly the same
as 'Exp1_nolost_criter1'
and 'region_limits', which remains unchanged.
We are pointing to our Ariane executable.
Let's recall that the source code of this Ariane executable
was modified with respect to 'criter1' (see previous videos).
In order to start from the initial positions of the particles
on the initial section that will only reach section 3,
we need the 'ariane_initial.nc' file
that will point directly to the 'Exp1_nolost_criter1' directory
and the 'ariane_positions_quantitative.nc' file.
Here, we have a shell executable file,
which is located in the 'examples/shellscripts' source code directory
and is called 'subset_select_sections.sh'.
This script will allow us to select particles
that reach a particular section.
This is how I ran that particular experiment.
You use the 'subset_select_sections.sh' command
and you enter the number of the section of interest.
So I enter '3' for section 3 and I submit the command.
The script will look in 'ariane_positions_quantitatives.nc'
from the previous experiment ('Exp1_nolost_criter1')
and take only the particles labelled '3'.
In this case, 8351 particles will be selected.
If you look at 'stats.txt' from the previous experiment,
you will see that 8351 is indeed the number of particles
that have reached section 3.
Now, my 'subset.txt' file has been generated,
I can run my experiment.
Here are the results I obtain after running the experiment.
You now know that the first file to look at is 'stats.txt'.
Let's have a closer look.
I can see that total transport has decreased
and now only represents the transport of the particles
that have reached section 3.
This represents 19.9721 Sv,
which is exactly what I had in my previous 'stats.txt' file,
but this time my results won't be polluted
by the particles that go to other sections.
What does this look like graphically?
I am now able to plot a graph
no longer showing the transport going through the other sections.
We now see that the particles going through sections 1, 2 and 5 are equal to zero.
Our graph has not changed much because the main transport is quite strong,
but it is more accurate because
we have removed the 'pollution' due to the other particle transfers
between the initial section and sections 2, 4 and 5.
For the record, and for the sake of this presentation,
I want to stress the fact that we have 'max_transport = 1e09',
that is, when Ariane has instrumented the initial section,
we assigned a high value to 'max_transport'
and made sure there was only one particle per mesh square.
We had 8351 particles, allowing us
to describe this transfer between the initial section and section 3.
Here is another graphical presentation of our streamfunction
here in black isolines
and having selected only the main vein.
The background colour shows the average depth associated with this streamfunction.
It is expressed here in metres.
This map for average depth was obtained
using the variables 'xy_zuh', 'xy_zvh', 'xy_uh' and 'xy_vh',
which are contained in the statistical result file.
I remind you that 'xy_zuh' and 'xy_zvh' represent the transport weighted depth
and that 'xy_uh' and 'xy_vh' represent the total transport.
So we can find this information about the average depth
for our streamfunction.
In our particular case of water mass transfer
between the initial section and section 3,
we have a main water vein here,
where the particles have an average depth of between 500 and 1500 metres.
They probably follow the topography to finish
a little deeper because the colours are getting lighter,
so the depth is probably between 1000 and 2000 metres.
Here, they follow the topography
and, at a certain latitude, they disperse along the longitude.
We see that on the western part of section 3
the particles are at depths of between 500 and 1500 metres,
whereas on the eastern part, which is much wider,
the particles are at depths of between 1500 and 3000 metres.
In this 'Exp1', in which we describe the transfer of water mass
between the initial section and section 3,
we set 'max_transport' to '1e09',
which meant that Arianne only put one particle per cell
on the initial section.
We want to see if this result is robust
and to do this we will decrease the value for 'max_transport'
in order to increase the number of particles and thus describe
the transfer of water mass more accurately
between section 1 and section 3.
To do this, I will go back to my terminal.
I'm going back to a previous experiment: 'Exp2',
in which I decreased the value of 'max_transport'.
We find all the files in this directory:
'namelist', 'sections.txt', 'region_limits' and 'ariane'.
We are going to compare the namelist file in 'Exp2' with 'Exp1'
using the 'diff' command.
We see a number of differences between 'Exp2' and 'Exp1_nolost_criter1'.
The first difference is that we decreased the value of 'max_transport'.
We went from '1e09' to '1e04',
which means an increase of the number of particles needed by Ariane
to instrument the initial section.
That is why I also increased 'nmax' from 50,000 to 100,000
because the number of particles, as we will see later,
will be about 72,000 or 73,000 particles.
I also switched back to 'nobin' mode,
whereas in 'Exp1_nolost_criter1' I was in 'subbin' mode.
When I submit this 'Exp2',
I will get the full results displayed here,
and I will have a look at 'stats.txt'.
In 'stats.txt', we can see that the value for 'transport' is slightly higher,
and that the number of particles is much higher:
there are 73,354 particles.
On the other hand, for section 3, the associated transport
is slightly lower than the one I had in my first experiment.
It is 19.90 Sv, versus 19.97 Sv in 'Exp1'.
In the same way as I did in 'Exp1',
that is, selecting only the transports from section 1 to section 3,
I will redo an 'Exp2'
taking only the particles that reach section 3
using 'subset.txt'.
I've already done this experiment
and I saved it in 'Exp2_section3'.
Here we have all the files necessary to conduct an experiment
in which we only select particles that reach a particular section.
Let's have a quick look at the Namelist file.
We see that we are now in 'subbin' mode
and that we take the initial positions of our particles.
Please note that we have lowered the number of particles to 80,000
instead of 100,000 because the result of 'Exp2'
showed that we had approximately 73,000 particles.
So I decreased the number to use less memory.
I submit this experiment after selecting only the particles
that reach section 3 using this shell script
and creating the 'subset.txt' file.
All the results are displayed here.
Let's have a look at the most important file: 'stats.txt'.
In this 'Exp2' we see that we have selected
only the transfers that take place between the initial section and section 3.
We can plot a graph of this second experiment,
in which we select only the particles that reach section 3.
The graph is shown here.
Please note that the number of particles
is clearly higher than our first experiment,
in which we had between 8,000 and 9,000 particles ('1e09').
Now with 'max_transport = 1e04',
we have almost 60,000 particles
to describe this transfer.
Therefore, we have a much more robust result.
This result and its graphical representation
can be published in your favourite scientific journal.
This is the result we were originally looking for in this quantitative experiment.
In this video
we have learned to calculate the streamfunction 'ψ'
and its graphical representation
from the results of the NetCDF files of our quantitative experiment.
We have seen how to select only those particles
that reach a particular interception section.
Our target section was section 3.
Finally, we saw that we could refine our results
by increasing the number of particles
and decreasing the value for 'max_transport'.
This video was the last in the series of videos
on the implementation and interpretation of Ariane's quantitative mode.
Thank you for watching.