Skip to content
Snippets Groups Projects
Commit 292b0046 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Polish

parent bfc3455c
No related branches found
No related tags found
No related merge requests found
...@@ -292,13 +292,15 @@ ...@@ -292,13 +292,15 @@
], ],
"input": "f\n" "input": "f\n"
}, },
"Extraction_eddies_region_1": { "Extraction_eddies_region_1":
{
"create_file": [ "create_file": [
"config_nml.txt", "config_nml.txt",
"&config_nml min_amp = 0./\n" "&config_nml min_amp = 0./\n"
], ],
"input": "&dates_nml date = 20454/\n", "input": "&dates_nml date = 20454/\n",
"commands": [ "commands":
[
[ [
"mkdir", "mkdir",
"-p", "-p",
......
program inst_eddies program inst_eddies
! The current directory should contain directory SHPC. ! The current directory at run-time should contain directory SHPC.
use, intrinsic:: ieee_arithmetic, only: IEEE_SUPPORT_DATATYPE, & use, intrinsic:: ieee_arithmetic, only: IEEE_SUPPORT_DATATYPE, &
ieee_support_nan ieee_support_nan
......
...@@ -101,7 +101,7 @@ contains ...@@ -101,7 +101,7 @@ contains
! Done sorting ! Done sorting
do l = 1, s%number_extr loop_extr: do l = 1, s%number_extr
i = sorted_extr(l) i = sorted_extr(l)
associate (e => s%list(i)) associate (e => s%list(i))
...@@ -161,7 +161,7 @@ contains ...@@ -161,7 +161,7 @@ contains
cont_list(:n_cont)) cont_list(:n_cont))
end if end if
end associate end associate
end do end do loop_extr
end subroutine set_all_contours end subroutine set_all_contours
......
...@@ -8,9 +8,9 @@ contains ...@@ -8,9 +8,9 @@ contains
! This procedure defines the components speed_cont and max_speed ! This procedure defines the components speed_cont and max_speed
! of argument e. On return, e%speed_cont may be a null ssh contour ! of argument e. On return, e%speed_cont may be a null ssh contour
! and e%max_speed may be set to missing_speed. However, ! and e%max_speed may be set to missing_speed. e%max_speed is
! e%max_speed is never NaN. On return, if e%speed_cont is not a ! never NaN. On return, if e%speed_cont is not a null ssh contour
! null ssh contour then e%max_speed is the speed on e%speed_cont. ! then e%max_speed is the speed on e%speed_cont.
! The length of the interval of longitudes of the domain, step(1) ! The length of the interval of longitudes of the domain, step(1)
! * (size(ssh, 1) - 1), should be < 180 degrees, so that the ! * (size(ssh, 1) - 1), should be < 180 degrees, so that the
...@@ -37,10 +37,10 @@ contains ...@@ -37,10 +37,10 @@ contains
real, intent(in):: step(:) ! (2) longitude and latitude steps, in rad real, intent(in):: step(:) ! (2) longitude and latitude steps, in rad
type(ssh_contour), intent(in):: cont_list(:) ! (n_cont) type(ssh_contour), intent(in):: cont_list(:) ! (n_cont)
! Contour list. The outermost contour is element with subscript ! Contour list. n_cont >= 1. The outermost contour is element with
! n_cont. The contours are in monotonic order of ssh. If n_cont >= ! subscript n_cont. The contours are in monotonic order of ssh. If
! 2, cont_list(:n_cont - 1)%area is missing and cont_list(:n_cont ! n_cont >= 2, cont_list(:n_cont - 1)%area are missing and
! - 1) is not oriented. n_cont >= 1. ! cont_list(:n_cont - 1) are not oriented.
! Local: ! Local:
real speed(size(cont_list)) ! (n_cont) speed on the contour real speed(size(cont_list)) ! (n_cont) speed on the contour
......
...@@ -30,7 +30,9 @@ def calculate_radii_rossby(properties): ...@@ -30,7 +30,9 @@ def calculate_radii_rossby(properties):
"""Compute average on some instantaneous eddies of Rossby number and """Compute average on some instantaneous eddies of Rossby number and
radius of maximum speed contour. The required properties for each radius of maximum speed contour. The required properties for each
eddy are position, radius and speed. "properties" is a list of eddy are position, radius and speed. "properties" is a list of
dictionaries. Each dictionary in the list contains the three properties. dictionaries. Each dictionary in the list contains the three
properties. If the speed is not defined for any eddy then the
returned value of avg_Rossby is 0.
""" """
...@@ -181,10 +183,9 @@ for edge in g.edges(): ...@@ -181,10 +183,9 @@ for edge in g.edges():
source_node = edge.source() source_node = edge.source()
target_node = edge.target() target_node = edge.target()
lat_for_conv = (g.vp.pos_last[source_node][1] + lat_for_conv = math.radians((g.vp.pos_last[source_node][1] +
g.vp.pos_first[target_node][1]) / 2 g.vp.pos_first[target_node][1]) / 2)
# (latitude needed for conversion of degrees to kilometers) # (latitude needed for conversion of degrees to kilometers)
lat_for_conv = math.radians(lat_for_conv) # need to convert to radians
# Because of the wrapping issue (360° wrapping incorrectly to 0°), # Because of the wrapping issue (360° wrapping incorrectly to 0°),
# we check for that here: # we check for that here:
...@@ -203,7 +204,6 @@ for edge in g.edges(): ...@@ -203,7 +204,6 @@ for edge in g.edges():
- g.vp.first_av_ros[target_node] - g.vp.first_av_ros[target_node]
else: else:
# At least one of the rossbies is invalid. # At least one of the rossbies is invalid.
# Delta_Ro = delta_ro_mean
Delta_Ro = 0 Delta_Ro = 0
second_term = ((Delta_Ro - delta_ro_mean)/delta_ro_std)**2 second_term = ((Delta_Ro - delta_ro_mean)/delta_ro_std)**2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment