diff --git a/Inst_eddies/Analysis/plot_ssh_lev.py b/Inst_eddies/Analysis/plot_ssh_lev.py index 647799f8670392eda10b54ed54766893646b1082..c53cfa2b42bfcef61e2b3d6e20736b8a00de5d72 100755 --- a/Inst_eddies/Analysis/plot_ssh_lev.py +++ b/Inst_eddies/Analysis/plot_ssh_lev.py @@ -4,9 +4,9 @@ import shapefile import matplotlib.pyplot as plt import numpy as np -cont_list = shapefile.Reader("cont_list") +cont_list_proj = shapefile.Reader("cont_list_proj") ssh_lev = [] -for rec in cont_list.iterRecords(fields = ["ssh"]): ssh_lev.append(rec[0]) +for rec in cont_list_proj.iterRecords(fields = ["ssh"]): ssh_lev.append(rec[0]) ssh_lev = np.array(ssh_lev) left = 0.95 * ssh_lev.min() right = 1.05 * ssh_lev.max() diff --git a/Inst_eddies/Tests/cont_list.f90 b/Inst_eddies/Tests/cont_list.f90 index c6b5bd334a72212a081dce8fb648a79be2788fa9..db15a49dc705dfdd867b41772ac1f3f2b9330074 100644 --- a/Inst_eddies/Tests/cont_list.f90 +++ b/Inst_eddies/Tests/cont_list.f90 @@ -4,7 +4,7 @@ module cont_list_m implicit none - TYPE(shpfileobject), protected, save:: hshp_cont_list + TYPE(shpfileobject), protected, save:: hshp_cont_list, hshp_cont_list_proj logical, protected:: write_cont_list = .false. integer, save:: ifield_ssh, ifield_speed @@ -19,9 +19,10 @@ contains !--------------------------------------------------------------- - call shp_create_03("cont_list", shpt_polygon, hshp_cont_list) - call dbf_add_field_03(ifield_ssh, hshp_cont_list, 'ssh', ftdouble, & + call shp_create_03("cont_list_proj", shpt_polygon, hshp_cont_list_proj) + call dbf_add_field_03(ifield_ssh, hshp_cont_list_proj, 'ssh', ftdouble, & nwidth = 13, ndecimals = 6) + call shp_create_03("cont_list", shpt_polygon, hshp_cont_list) call dbf_add_field_03(ifield_speed, hshp_cont_list, 'speed', ftdouble, & nwidth = 13, ndecimals = 6) write_cont_list = .true. @@ -37,6 +38,7 @@ contains !--------------------------------------------------------------- CALL shpclose(hshp_cont_list) + CALL shpclose(hshp_cont_list_proj) end subroutine close_cont_list diff --git a/Inst_eddies/Tests/test_get_1_outerm.f90 b/Inst_eddies/Tests/test_get_1_outerm.f90 index 7d053c3c68f7a8d9478ee668de0681f1b6fcc6f8..be62f2969d1a553711e8b2f979cfca9e1d7be37d 100644 --- a/Inst_eddies/Tests/test_get_1_outerm.f90 +++ b/Inst_eddies/Tests/test_get_1_outerm.f90 @@ -111,18 +111,32 @@ program test_get_1_outerm ! cont_list shapefile: call shp_create_03("cont_list", shpt_polygon, hshp) - call dbf_add_field_03(ifield, hshp, 'ssh', ftdouble, & - nwidth = 13, ndecimals = 6) + call dbf_add_field_03(ifield, hshp, 'speed', ftdouble, nwidth = 13, & + ndecimals = 6) do i = 1, n_cont call shp_append_object_03(ishape, hshp, shpt_polygon, & cont_list(i)%points * rad_to_deg) - call dbf_write_attribute_03(hshp, ishape, ifield, & - cont_list_proj(i)%ssh) + call dbf_write_attribute_03(hshp, ishape, ifield, missing_speed) end do CALL shpclose(hshp) print *, 'test_get_1_outerm: Created shapefile "cont_list".' + + ! cont_list_proj shapefile: + + call shp_create_03("cont_list_proj", shpt_polygon, hshp) + call dbf_add_field_03(ifield, hshp, 'ssh', ftdouble, nwidth = 13, & + ndecimals = 6) + + do i = 1, n_cont + call shp_append_object_03(ishape, hshp, shpt_polygon, & + cont_list_proj(i)%points) + call dbf_write_attribute_03(hshp, ishape, ifield, cont_list_proj(i)%ssh) + end do + + CALL shpclose(hshp) + print *, 'test_get_1_outerm: Created shapefile "cont_list_proj".' else print *, "test_get_1_outerm: Could not find an outermost contour." end if diff --git a/Inst_eddies/set_max_speed.f90 b/Inst_eddies/set_max_speed.f90 index 81b8127576a1f3bcc7324db6fb7c3cbf566a30f4..cc82777c1dbd6553ad32e4bcab233a9f18dd7c30 100644 --- a/Inst_eddies/set_max_speed.f90 +++ b/Inst_eddies/set_max_speed.f90 @@ -31,8 +31,8 @@ contains use input_ssh_m, only: corner_whole => corner 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, ifield_ssh, & - ifield_speed + use cont_list_m, only: write_cont_list, hshp_cont_list, & + hshp_cont_list_proj, ifield_ssh, ifield_speed type(ssh_contour), intent(out):: speed_cont @@ -116,10 +116,12 @@ contains if (write_cont_list) then do i = 1, n_cont + call shp_append_object_03(ishape, hshp_cont_list_proj, & + shpt_polygon, cont_list_proj(i)%points) + call dbf_write_attribute_03(hshp_cont_list_proj, ishape, ifield_ssh, & + fieldvalue = cont_list_proj(i)%ssh) 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_ssh, & - fieldvalue = cont_list_proj(i)%ssh) if (ieee_is_nan(speed(i))) then call dbf_write_attribute_03(hshp_cont_list, ishape, ifield_speed, &