diff --git a/Inst_eddies/Tests/test_get_1_outerm.f90 b/Inst_eddies/Tests/test_get_1_outerm.f90 index 6013c1509a516a47ee130e353345b69a92aba184..8dec23cb51a0ea50120732e223f6492154935801 100644 --- a/Inst_eddies/Tests/test_get_1_outerm.f90 +++ b/Inst_eddies/Tests/test_get_1_outerm.f90 @@ -1,7 +1,10 @@ program test_get_1_outerm ! Libraries: - use jumble, only: csvread, deg_to_rad + use jumble, only: csvread, deg_to_rad, rad_to_deg + use shapelib, only: shpfileobject, ftdouble, shpt_polygon, shpclose + use shapelib_03, only: shp_create_03, dbf_add_field_03, & + shp_append_object_03, dbf_write_attribute_03 use config_m, only: config use derived_types, only: eddy, shpc_slice_handler, null_ssh_contour, & @@ -14,7 +17,7 @@ program test_get_1_outerm implicit none - integer:: date = 0 + integer:: date = 0, i, ifield, ishape real, allocatable:: ssh(:, :) ! (1 - max_radius(1):nlon + max_radius(1), nlat) if the grid is periodic @@ -57,6 +60,7 @@ program test_get_1_outerm ! contours are in monotonic order of ssh. integer n_cont ! number of good contours found and stored in cont_list + TYPE(shpfileobject) hshp_cont_list namelist /main_nml/ ind_targ_extr, innermost_level, cyclone, date, & grid_lon_lat @@ -89,6 +93,22 @@ program test_get_1_outerm write(hshp%unit, fmt = *) 0 CALL shpc_close(hshp) print *, 'test_get_1_outerm: Created "SHPC".' + + ! cont_list shapefile: + + call shp_create_03("cont_list", shpt_polygon, hshp_cont_list) + call dbf_add_field_03(ifield, hshp_cont_list, 'ssh', ftdouble, & + nwidth = 13, ndecimals = 6) + + 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, & + cont_list(i)%ssh) + end do + + CALL shpclose(hshp_cont_list) + print *, 'test_get_1_outerm: Created shapefile "cont_list".' else print *, "test_get_1_outerm: Could not find an outermost contour." end if