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

Allow field radius4 to be missing

Useful to read shapefiles from conversion of Matlab data.
parent c9c7b858
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,13 @@ contains
call dbf_read_attribute_03(e%out_cont%ssh, hshp%outermost, hshp%out_ssh, &
ishape)
call dbf_read_attribute_03(e%radius4, hshp%outermost, hshp%out_radius4, &
ishape)
if (hshp%out_radius4 /= - 1) then
call dbf_read_attribute_03(e%radius4, hshp%outermost, hshp%out_radius4, &
ishape)
else
e%radius4 = - 1
end if
call shp_read_object_03(hshp%outermost, ishape, psobject)
p = shpobj2pol(psobject)
......
......@@ -7,6 +7,7 @@ contains
subroutine read_field_indices(hshp)
! Libraries:
use shapelib, only: dbfgetfieldindex
use shapelib_03, only: dbf_get_field_index_03
use derived_types, only: shpc
......@@ -28,7 +29,9 @@ contains
call dbf_get_field_index_03(hshp%outermost, "date", hshp%out_date)
call dbf_get_field_index_03(hshp%outermost, "eddy_index", &
hshp%out_eddy_index)
call dbf_get_field_index_03(hshp%outermost, "radius4", hshp%out_radius4)
! We allow the field radius4 to be missing:
hshp%out_radius4 = dbfgetfieldindex(hshp%outermost, "radius4")
call dbf_get_field_index_03(hshp%max_speed, "r_eq_area", &
hshp%max_speed_r_eq_area)
......
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