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

Do not write valid attribute to shapefile extremum

The attribute written was always true.
parent 65f9fbd1
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ module derived_types
logical cyclone
! Field identifiers in the DBF files:
integer extr_ssh, extr_date, extr_eddy_index, extr_valid, extr_speed
integer extr_ssh, extr_date, extr_eddy_index, extr_speed
integer extr_proj_date, extr_proj_eddy_index
integer out_r_eq_area, out_ssh, out_date, out_eddy_index, out_radius4
integer max_speed_r_eq_area, max_speed_ssh, max_speed_date, &
......
......@@ -20,7 +20,6 @@ contains
call dbf_get_field_index_03(hshp%extremum, "date", hshp%extr_date)
call dbf_get_field_index_03(hshp%extremum, "eddy_index", &
hshp%extr_eddy_index)
call dbf_get_field_index_03(hshp%extremum, "valid", hshp%extr_valid)
call dbf_get_field_index_03(hshp%extremum, "speed", hshp%extr_speed)
if (.not. dbffileisnull(hshp%extr_proj)) then
......
......@@ -32,7 +32,6 @@ def define_fields(writers):
writers["extr"].field("ssh", "N", 13, 6)
writers["extr"].field("date", "N", 5)
writers["extr"].field("eddy_index", "N", 5)
writers["extr"].field("valid", "N", 1)
writers["extr"].field("speed", "N", 13, 6)
writers["centroid"].field("date", "N", 5)
......@@ -79,9 +78,8 @@ def write_to_shp(writers, cyclone, d, cell = None, X = None, Y = None,
i = np.argwhere(X == eddy[0]).item()
j = np.argwhere(Y == eddy[1]).item()
speed = 1e4 if np.isnan(eddy[12]) else eddy[12] # Azimuthal Vit
writers["extr"].record(ssh = ADT[i, j], valid = 1,
date = d, eddy_index = eddy_index,
speed = speed)
writers["extr"].record(ssh = ADT[i, j], date = d,
eddy_index = eddy_index, speed = speed)
# Amplitude Out:
if cyclone:
......
......@@ -33,8 +33,6 @@ contains
ftinteger, nwidth = 5, ndecimals = 0)
call dbf_add_field_03(hshp%extr_eddy_index, hshp%extremum, 'eddy_index', &
ftinteger, nwidth = 5, ndecimals = 0)
call dbf_add_field_03(hshp%extr_valid, hshp%extremum, 'valid', &
ftinteger, nwidth = 1, ndecimals = 0)
call dbf_add_field_03(hshp%extr_speed, hshp%extremum, 'speed', ftdouble, &
nwidth = 13, ndecimals = 6)
......
......@@ -36,8 +36,6 @@ contains
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_date, date)
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_eddy_index, &
i)
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_valid, &
merge(1, 0, e%out_cont%closed))
if (ieee_is_nan(e%max_speed)) then
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_speed, &
......
......@@ -37,7 +37,6 @@ program test_write_null
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_date, 0)
call dbf_write_attribute_03(hshpc%extremum, ishape, &
hshpc%extr_eddy_index, i)
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_valid, 1)
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_speed, &
0.)
call shp_append_null_03(ishape, hshpc%outermost)
......@@ -68,7 +67,6 @@ program test_write_null
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_date, 0)
call dbf_write_attribute_03(hshpc%extremum, ishape, &
hshpc%extr_eddy_index, i)
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_valid, 1)
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_speed, &
0.)
end do
......
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