diff --git a/Inst_eddies/Tests/examine_eddy.f90 b/Inst_eddies/Tests/examine_eddy.f90 index 061624658dc97a985706fd1e0f34dc173e914656..6987e2512c1b3b87d7d37d18369af7d39cd68cb8 100644 --- a/Inst_eddies/Tests/examine_eddy.f90 +++ b/Inst_eddies/Tests/examine_eddy.f90 @@ -2,13 +2,13 @@ program examine_eddy ! Libraries: use contour_531, only: convert_to_ind - use jumble, only: get_command_arg_dyn, read_column, deg_to_rad, pi, & - rad_to_deg, twopi, new_unit + use jumble, only: get_command_arg_dyn, read_column, deg_to_rad, rad_to_deg, & + twopi, new_unit use shapelib, only: shpfileobject, shpclose use shapelib_03, only: dbf_read_attribute_03, dbf_get_field_index_03, & shp_read_point, shp_open_03 - use config_m, only: config, min_radius + use config_m, only: config use cont_list_m, only: create_cont_list, close_cont_list use derived_types, only: snapshot, shpc_slice_handler, eddy use input_ssh_m, only: input_ssh, max_radius @@ -169,7 +169,7 @@ program examine_eddy call set_contours(e%out_cont, e%speed_cont, e%max_speed, cyclone, e%extr, & e%innermost_level, step, ssh(llc(1):urc(1), llc(2):urc(2)), & u(llc(1):urc(1), llc(2):urc(2)), v(llc(1):urc(1), llc(2):urc(2)), & - corner_window, pi * (min_radius * 1e3)**2, outside_points) + corner_window, outside_points) call close_cont_list call shpc_create(hshpc, shpc_dir = "SHPC", cyclone = cyclone, slice = 0, & grid_lon_lat = .true.) diff --git a/Inst_eddies/Tests/test_get_1_outerm.f90 b/Inst_eddies/Tests/test_get_1_outerm.f90 index 748d3282596a376f110285daede8126b7f0f766b..3c09899d690a6210824ad36bcc58a0e860b49df8 100644 --- a/Inst_eddies/Tests/test_get_1_outerm.f90 +++ b/Inst_eddies/Tests/test_get_1_outerm.f90 @@ -1,12 +1,12 @@ program test_get_1_outerm ! Libraries: - use jumble, only: csvread, deg_to_rad, rad_to_deg, pi + 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, min_radius + use config_m, only: config use derived_types, only: eddy, shpc_slice_handler, null_ssh_contour, & missing_speed, ssh_contour use get_1_outerm_m, only: get_1_outerm @@ -82,8 +82,7 @@ program test_get_1_outerm e%extr%coord_proj = ind_targ_extr e%extr%coord = corner + (ind_targ_extr - 1) * step call get_1_outerm(e%out_cont, cont_list, n_cont, cyclone, e%extr%coord, & - innermost_level, outside_points, ssh, corner, step, & - min_area = pi * (min_radius * 1e3)**2) + innermost_level, outside_points, ssh, corner, step) if (e%out_cont%closed) then e%extr%ssh = ssh(ind_targ_extr(1), ind_targ_extr(2)) diff --git a/Inst_eddies/config.f90 b/Inst_eddies/config.f90 index f3147765ffe6f880409375fb9159df15563ce613..a6e93fb046fe9adb5955852ed1d5baa4b19a557e 100644 --- a/Inst_eddies/config.f90 +++ b/Inst_eddies/config.f90 @@ -1,6 +1,7 @@ module config_m use, intrinsic:: ISO_FORTRAN_ENV + use jumble, only: pi implicit none @@ -13,8 +14,9 @@ module config_m ! degrees. Beware: run time is roughly proportional to ! product(max_radius_deg / step_deg). max_radius_deg(1) must be < 90. - real, protected:: min_radius = 25. - ! minimum radius of the equal-area disk for an outermost contour, in km + real, protected, save:: min_area ! minimum area of an outermost contour, in m2 + + private pi contains @@ -24,8 +26,13 @@ contains use jumble, only: new_unit ! Local: + logical exist integer unit, iostat + + real:: min_radius = 25. + ! minimum radius of the equal-area disk for an outermost contour, in km + namelist /config_nml/ min_amp, max_radius_deg, min_radius character(len = 1000) iomsg @@ -59,6 +66,8 @@ contains close(unit) end if + min_area = pi * (min_radius * 1e3)**2 + end subroutine config end module config_m diff --git a/Inst_eddies/get_1_outerm.f90 b/Inst_eddies/get_1_outerm.f90 index 8bfc4ed34ad3672c76c7a31b0ecd0445654e8eb7..273dd523cea38cded845733b1b62ee5b37940d15 100644 --- a/Inst_eddies/get_1_outerm.f90 +++ b/Inst_eddies/get_1_outerm.f90 @@ -5,7 +5,7 @@ module get_1_outerm_m contains subroutine get_1_outerm(out_cont, cont_list, n_cont, cyclone, coord_extr, & - innermost_level_2, outside_points, ssh, corner, step, min_area) + innermost_level_2, outside_points, ssh, corner, step) ! This procedure gets one outermost good contour with sufficient ! area, if it can find one. If the procedure cannot find an @@ -45,6 +45,7 @@ contains use jumble, only: assert use ccw_orient_m, only: ccw_orient + use config_m, only: min_area use derived_types, only: ssh_contour, null_ssh_contour use good_contour_m, only: good_contour use spher_polyline_area_m, only: spher_polyline_area @@ -82,9 +83,6 @@ contains real, intent(in):: step(:) ! (2) ! longitude and latitude steps, in rad - real, intent(in):: min_area - ! minimum area of an outermost contour, in m2 - ! Local: real level_try, level_good, level_bad ! in m real, parameter:: precision = 5e-4 ! in m diff --git a/Inst_eddies/inst_eddies.f90 b/Inst_eddies/inst_eddies.f90 index 01eeae7af401c0740ddf26cd43fb20ca6d2c4508..2020cbf1a895e7325150c38befae78ccfe7ae8cb 100644 --- a/Inst_eddies/inst_eddies.f90 +++ b/Inst_eddies/inst_eddies.f90 @@ -7,10 +7,10 @@ program inst_eddies use, intrinsic:: ISO_FORTRAN_ENV, only: ERROR_UNIT ! Libraries: - use jumble, only: assert, new_unit, pi, argwhere, twopi + use jumble, only: assert, new_unit, argwhere, twopi use numer_rec_95, only: indexx - use config_m, only: config, min_radius + use config_m, only: config use derived_types, only: snapshot, shpc_slice_handler use input_ssh_m, only: input_ssh, max_radius use nearby_extr_m, only: nearby_extr @@ -54,8 +54,6 @@ program inst_eddies ! order of decreasing SSH, and second, maxima sorted in order of ! increasing SSH. - real min_area ! minimum area of an outermost contour, in m2 - integer, allocatable:: selection(:) ! identifying numbers of a selection of extrema @@ -121,7 +119,6 @@ program inst_eddies call set_all_extr(s, step, periodic, ssh, corner) allocate(sorted_extr(s%number_extr)) - min_area = pi * (min_radius * 1e3)**2 forall (i = 1:s%number_extr) s%list(i)%out_cont%closed = .true. @@ -177,7 +174,7 @@ program inst_eddies s%list(i)%max_speed, s%list(i)%cyclone, s%list(i)%extr, & s%list(i)%innermost_level, step, ssh(llc(1):urc(1), llc(2):urc(2)), & u(llc(1):urc(1), llc(2):urc(2)), v(llc(1):urc(1), llc(2):urc(2)), & - corner_window, min_area, outside_points) + corner_window, outside_points) end do call cpu_time(t1) diff --git a/Inst_eddies/set_contours.f90 b/Inst_eddies/set_contours.f90 index 9520159133782215eb043cce6316a8adf5e0c8c8..b5ff9a01b240c21e8008575306094f7ba146cec3 100644 --- a/Inst_eddies/set_contours.f90 +++ b/Inst_eddies/set_contours.f90 @@ -5,7 +5,7 @@ module set_contours_m contains subroutine set_contours(out_cont, speed_cont, max_speed, cyclone, extr, & - innermost_level, step, ssh, u, v, corner, min_area, outside_points) + innermost_level, step, ssh, u, v, corner, outside_points) ! This procedure sets contours in an eddy. @@ -44,8 +44,6 @@ contains real, intent(in):: corner(:) ! (2) longitude and latitude of the ! corner of the grid, in rad - real, intent(in):: min_area ! minimum area of an outermost contour, in m2 - real, intent(in):: outside_points(:, :) ! (2, :) longitude and ! latitude, in rad, of all the significant extrema, except the ! target extremum @@ -83,7 +81,7 @@ contains innermost_level, abs(extr%ssh - innermost_level) < min_amp) call get_1_outerm(out_cont, cont_list, n_cont, cyclone, extr%coord, & - innermost_level_2, outside_points, ssh, corner, step, min_area) + innermost_level_2, outside_points, ssh, corner, step) ! Done with outermost contour, now let us take care of the ! max-speed contour.