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

Write speed to shapefile `cont_list`

parent dd70bed3
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ module cont_list_m
TYPE(shpfileobject), protected, save:: hshp_cont_list
logical, protected:: write_cont_list = .false.
integer, save:: ifield_ssh, ifield_speed
private shpfileobject
......@@ -16,13 +17,12 @@ contains
use shapelib, only: ftdouble, shpt_polygon
use shapelib_03, only: shp_create_03, dbf_add_field_03
! Local:
integer ifield
!---------------------------------------------------------------
call shp_create_03("cont_list", shpt_polygon, hshp_cont_list)
call dbf_add_field_03(ifield, hshp_cont_list, 'ssh', ftdouble, &
call dbf_add_field_03(ifield_ssh, hshp_cont_list, 'ssh', ftdouble, &
nwidth = 13, ndecimals = 6)
call dbf_add_field_03(ifield_speed, hshp_cont_list, 'speed', ftdouble, &
nwidth = 13, ndecimals = 6)
write_cont_list = .true.
......
......@@ -29,7 +29,8 @@ contains
use good_contour_m, only: good_contour
use mean_speed_m, only: mean_speed
use spher_polyline_area_m, only: spher_polyline_area
use cont_list_m, only: write_cont_list, hshp_cont_list
use cont_list_m, only: write_cont_list, hshp_cont_list, ifield_ssh, &
ifield_speed
type(ssh_contour), intent(out):: speed_cont
......@@ -115,8 +116,17 @@ contains
do i = 1, n_cont
call shp_append_object_03(ishape, hshp_cont_list, shpt_polygon, &
cont_list(i)%points * rad_to_deg)
call dbf_write_attribute_03(hshp_cont_list, ishape, ifield = 0, &
call dbf_write_attribute_03(hshp_cont_list, ishape, ifield_ssh, &
fieldvalue = cont_list(i)%ssh)
if (ieee_is_nan(speed(i))) then
call dbf_write_attribute_03(hshp_cont_list, ishape, ifield_speed, &
missing_speed)
! (Cannot write NaN to dbf file.)
else
call dbf_write_attribute_03(hshp_cont_list, ishape, ifield_speed, &
speed(i))
end if
end do
end if
#endif
......
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