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

In GNUmakefile, bug fix: missing derived_types.f in

src_test_get_snapshot.

Move field speed from DBF file max_speed_contour to DBF file extremum
because it can be associated to either the contour in
outermost_contour or in max_speed_contour.
parent 94515cc5
Branches
Tags
No related merge requests found
......@@ -11,7 +11,7 @@ src_test_get_1_outerm = good_contour.f test_get_1_outerm.f derived_types.f get_1
src_test_set_max_speed = test_set_max_speed.f derived_types.f set_max_speed.f good_contour.f max_speed_contour_ssh.f mean_speed.f spherical_polygon_area.f inside_4.f
src_test_get_snapshot = test_get_snapshot.f get_snapshot.f dispatch_snapshot.f write_eddy.f send_snapshot.f receive_snapshot.f local_extrema.f set_max_speed.f outermost_possible_level.f get_1_outerm.f max_speed_contour_ssh.f good_contour.f spherical_polygon_area.f mean_speed.f inside_4.f set_all_outerm.f
src_test_get_snapshot = test_get_snapshot.f get_snapshot.f dispatch_snapshot.f write_eddy.f send_snapshot.f receive_snapshot.f local_extrema.f set_max_speed.f outermost_possible_level.f get_1_outerm.f max_speed_contour_ssh.f good_contour.f spherical_polygon_area.f mean_speed.f inside_4.f set_all_outerm.f derived_types.f
src_test_set_all_outerm = test_set_all_outerm.f derived_types.f set_all_outerm.f local_extrema.f get_1_outerm.f good_contour.f spherical_polygon_area.f
......
......@@ -22,8 +22,8 @@ program test_get_snapshot
TYPE(shpfileobject) hshp_extremum
! shapefile extremum_$m. The fields in the DBF file are, in that
! order: ssh, date index, eddy index, interpolated, cyclone, suff
! amplitude.
! order: ssh, date index, eddy index, interpolated, cyclone,
! sufficient amplitude, speed.
TYPE(shpfileobject) hshp_outermost
! shapefile outermost_contour_$m. The fields in the DBF file are,
......@@ -31,7 +31,7 @@ program test_get_snapshot
TYPE(shpfileobject) hshp_max_speed
! shapefile x_speed_contour_$m. The fields in the DBF file are, in
! that order: area, ssh, spped, date index, eddy index.
! that order: area, ssh, date index, eddy index.
integer ifield, unit_isolated, unit_number_eddies
......@@ -84,6 +84,8 @@ program test_get_snapshot
nwidth = 1, ndecimals = 0)
call dbf_add_field_03(ifield, hshp_extremum, 'suff_amp', ftinteger, &
nwidth = 1, ndecimals = 0)
call dbf_add_field_03(ifield, hshp_extremum, 'speed', ftdouble, nwidth = 13, &
ndecimals = 6)
call shp_create_03("outermost_contour_1", shpt_polygon, hshp_outermost)
call dbf_add_field_03(ifield, hshp_outermost, 'area', ftdouble, nwidth = 20, &
......@@ -104,8 +106,6 @@ program test_get_snapshot
ndecimals = 6)
call dbf_add_field_03(ifield, hshp_max_speed, 'ssh', ftdouble, nwidth = 13, &
ndecimals = 6)
call dbf_add_field_03(ifield, hshp_max_speed, 'speed', &
ftdouble, nwidth = 13, ndecimals = 6)
call dbf_add_field_03(ifield, hshp_max_speed, 'date_index', ftinteger, &
nwidth = 4, ndecimals = 0)
call dbf_add_field_03(ifield, hshp_max_speed, 'eddy_index', ftinteger, &
......
......@@ -18,7 +18,7 @@ contains
TYPE(shpfileobject), intent(inout):: hshp_extremum
! shapefile extremum_$m. We assume that the fields in the DBF file
! are, in that order: ssh, date index, eddy index, interpolated,
! cyclone, sufficient amplitude.
! cyclone, sufficient amplitude, speed.
TYPE(shpfileobject), intent(inout):: hshp_outermost
! shapefile outermost_contour_$m. We assume that the fields in the
......@@ -27,8 +27,7 @@ contains
TYPE(shpfileobject), intent(inout):: hshp_max_speed
! shapefile x_speed_contour_$m. We assume that the fields in the
! DBF file are, in that order: area, ssh, spped, date index, eddy
! index.
! DBF file are, in that order: area, ssh, date index, eddy index.
integer, intent(in):: unit_isolated
! logical unit for file isolated_nodes_$m.csv
......
......@@ -9,9 +9,9 @@ contains
! Gets one outermost contour, if it can find one. Method:
! dichotomy on level of ssh. If the procedure cannot find an
! outermost contour, it return a null polyline, zero area and ssh
! equal to missing_ssh. An outermost contour is not found if, and
! only if, there is no good contour at innermost level.
! outermost contour, it return a null ssh_contour. An outermost
! contour is not found if, and only if, there is no good contour
! at innermost level.
use contour_531, only: polyline, convert_to_reg_coord
use derived_types, only: ssh_contour, missing_ssh
......
......@@ -21,7 +21,7 @@ contains
TYPE(shpfileobject), intent(inout):: hshp_extremum
! shapefile extremum_$m. We assume that the fields in the DBF file
! are, in that order: ssh, date index, eddy index, interpolated,
! cyclone, sufficient amplitude.
! cyclone, sufficient amplitude, speed.
TYPE(shpfileobject), intent(inout):: hshp_outermost
! shapefile outermost_contour_$m. We assume that the fields in the
......@@ -30,8 +30,7 @@ contains
TYPE(shpfileobject), intent(inout):: hshp_max_speed
! shapefile x_speed_contour_$m. We assume that the fields in the
! DBF file are, in that order: area, ssh, speed, date index, eddy
! index.
! DBF file are, in that order: area, ssh, date index, eddy index.
! Local:
integer ishape
......@@ -50,6 +49,13 @@ contains
call dbf_write_attribute_03(hshp_extremum, ishape, 5, &
merge(1, 0, e%suff_amp))
if (ieee_is_nan(e%max_speed)) then
call dbf_write_attribute_03(hshp_extremum, ishape, 6, 1e4)
! (Cannot write NaN to dbf file.)
else
call dbf_write_attribute_03(hshp_extremum, ishape, 6, e%max_speed)
end if
if (e%interpolated) then
call shp_append_null_03(ishape, hshp_outermost)
call shp_append_null_03(ishape, hshp_max_speed)
......@@ -69,29 +75,17 @@ contains
end if
end if
call dbf_write_attribute_03(hshp_outermost, ishape, 0, &
e%out_cont%area)
call dbf_write_attribute_03(hshp_outermost, ishape, 1, &
e%out_cont%ssh)
call dbf_write_attribute_03(hshp_outermost, ishape, 0, e%out_cont%area)
call dbf_write_attribute_03(hshp_outermost, ishape, 1, e%out_cont%ssh)
call dbf_write_attribute_03(hshp_outermost, ishape, 2, k)
call dbf_write_attribute_03(hshp_outermost, ishape, 3, i)
call dbf_write_attribute_03(hshp_outermost, ishape, 4, merge(1, 0, e%twice))
call dbf_write_attribute_03(hshp_outermost, ishape, 5, e%radius4)
call dbf_write_attribute_03(hshp_max_speed, ishape, 0, &
e%speed_cont%area)
call dbf_write_attribute_03(hshp_max_speed, ishape, 1, &
e%speed_cont%ssh)
if (ieee_is_nan(e%max_speed)) then
call dbf_write_attribute_03(hshp_max_speed, ishape, 2, 1e4)
! (Cannot write NaN to dbf file.)
else
call dbf_write_attribute_03(hshp_max_speed, ishape, 2, e%max_speed)
end if
call dbf_write_attribute_03(hshp_max_speed, ishape, 3, k)
call dbf_write_attribute_03(hshp_max_speed, ishape, 4, i)
call dbf_write_attribute_03(hshp_max_speed, ishape, 0, e%speed_cont%area)
call dbf_write_attribute_03(hshp_max_speed, ishape, 1, e%speed_cont%ssh)
call dbf_write_attribute_03(hshp_max_speed, ishape, 2, k)
call dbf_write_attribute_03(hshp_max_speed, ishape, 3, i)
end subroutine write_eddy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment