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

Test `with_proj`

Rather than calling dbffileisnull or shpfileisnull. This should be
faster and more robust.
parent 5505c14f
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,6 @@ contains
subroutine read_field_indices(hshp)
! Libraries:
use shapelib, only: dbffileisnull
use shapelib_03, only: dbf_get_field_index_03
use derived_types, only: shpc_slice_handler
......@@ -22,7 +21,7 @@ contains
hshp%extr_eddy_index)
call dbf_get_field_index_03(hshp%extremum, "speed", hshp%extr_speed)
if (.not. dbffileisnull(hshp%extr_proj)) then
if (hshp%with_proj) then
call dbf_get_field_index_03(hshp%extr_proj, "date", hshp%extr_proj_date)
call dbf_get_field_index_03(hshp%extr_proj, "eddy_index", &
hshp%extr_proj_eddy_index)
......
......@@ -18,7 +18,7 @@ contains
CALL shpclose(hshp%extremum)
CALL shpclose(hshp%outermost)
CALL shpclose(hshp%max_speed)
CALL shpclose(hshp%extr_proj)
if (hshp%with_proj) CALL shpclose(hshp%extr_proj)
close(hshp%unit)
deallocate(hshp%dir)
......
......@@ -44,6 +44,7 @@ contains
pszaccess)
call shp_open_03(hshp%max_speed, hshp%dir // "/max_speed_contour", &
pszaccess)
hshp%with_proj = with_proj ! needed before calling read_field_indices
call read_field_indices(hshp)
call new_unit(hshp%unit)
......@@ -56,7 +57,6 @@ contains
end if
hshp%cyclone = cyclone
hshp%with_proj = with_proj
else if (.not. present(iostat)) then
write(ERROR_UNIT, fmt = *) "shpc_open: failed"
write(ERROR_UNIT, fmt = *) "shpc_dir = ", shpc_dir
......
......@@ -40,7 +40,7 @@ contains
call dbf_write_attribute_03(hshpc%extremum, ishape, hshpc%extr_speed, &
e%max_speed)
if (.not. shpfileisnull(hshpc%extr_proj)) then
if (hshpc%with_proj) then
call shp_append_point_03(ishape, hshpc%extr_proj, &
real(e%extr%coord_proj))
......
......@@ -13,7 +13,6 @@ contains
use contour_531, only: null_polyline
use gpc_f, only: shp_read_pol, polygon
use jumble, only: deg_to_rad, pi
use shapelib, only: shpfileisnull
use shapelib_03, only: dbf_read_attribute_03, shp_read_point
use derived_types, only: eddy, shpc_slice_handler, missing_speed
......@@ -50,7 +49,7 @@ contains
e%extr%coord = e%extr%coord * deg_to_rad
! extr_proj:
if (.not. shpfileisnull(hshp%extr_proj)) then
if (hshp%with_proj) then
call shp_read_point(point, hshp%extr_proj, ishape)
e%extr%coord_proj = nint(point)
end if
......
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