Skip to content

Commit

Permalink
ENH: Merge content of warnings branch; Start dealing with flake8 warn…
Browse files Browse the repository at this point in the history
…ings.
  • Loading branch information
Patol75 committed Jul 15, 2022
2 parents 1827b1a + da30e4c commit ec37f5e
Show file tree
Hide file tree
Showing 124 changed files with 503 additions and 1,092 deletions.
4 changes: 1 addition & 3 deletions assemble/Advection_Diffusion_CG.F90
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ subroutine assemble_advection_diffusion_cg(t, matrix, rhs, state, dt, velocity_n
character(len = *), optional, intent(in) :: velocity_name

character(len = FIELD_NAME_LEN) :: lvelocity_name, velocity_equation_type
integer :: i, j, stat
integer :: i, stat
integer, dimension(:), allocatable :: t_bc_types
type(scalar_field) :: t_bc, t_bc_2
type(scalar_field), pointer :: absorption, sinking_velocity, source
Expand All @@ -255,8 +255,6 @@ subroutine assemble_advection_diffusion_cg(t, matrix, rhs, state, dt, velocity_n
type(integer_set), dimension(:), pointer :: colours
integer :: clr, nnid, len, ele
integer :: num_threads, thread_num
!! Did we successfully prepopulate the transform_to_physical_cache?
logical :: cache_valid

type(element_type), dimension(:), allocatable :: supg_element

Expand Down
4 changes: 1 addition & 3 deletions assemble/Advection_Diffusion_FV.F90
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,12 @@ subroutine assemble_advection_diffusion_fv(t, matrix, rhs, state)
type(scalar_field), pointer :: source, absorption
type(tensor_field), pointer :: diffusivity

integer :: i, j, stat
integer :: stat

!! Coloring data structures for OpenMP parallization
type(integer_set), dimension(:), pointer :: colours
integer :: clr, nnid, len, ele
integer :: thread_num
!! Did we successfully prepopulate the transform_to_physical_cache?
logical :: cache_valid

ewrite(1,*) "In assemble_advection_diffusion_fv"

Expand Down
2 changes: 0 additions & 2 deletions assemble/Assemble_CMC.F90
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ subroutine assemble_diagonal_schur(schur_diagonal_matrix,u,inner_m,ctp_m,ct_m)
! (i.e. DiagonalSchurComplement):
type(vector_field) :: inner_m_diagonal

integer :: i

ewrite(1,*) 'Entering assemble_diagonal_schur'

call zero(schur_diagonal_matrix)
Expand Down
2 changes: 1 addition & 1 deletion assemble/Foam_Drainage.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ subroutine calculate_drainage_source_absor(state)

type(state_type), intent(inout) :: state

integer :: i, stat
integer :: i
type(vector_field), pointer :: K1, foamvel, liquidvelocity, liqcontentvel, source, absor
type(scalar_field), pointer :: p, liquidcontent, K2

Expand Down
3 changes: 1 addition & 2 deletions assemble/Foam_Flow.F90
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,14 @@ subroutine calculate_foam_velocity(state, foamvel)

type(state_type), intent(inout) :: state
type(vector_field), pointer, intent(out) :: foamvel
type(vector_field), pointer :: liquidvelocity
type(scalar_field), pointer :: field
type(csr_sparsity) :: gradient_sparsity
type(block_csr_matrix) :: C_m
type(csr_sparsity) :: mass_sparsity
type(csr_matrix) :: mass
type(vector_field) :: cfield

integer :: i, stat
integer :: i

foamvel => extract_vector_field(state, foamvel_name)
if (have_option(trim(foamvel%option_path)//'/diagnostic')) then
Expand Down
21 changes: 6 additions & 15 deletions assemble/Hybridized_Helmholtz.F90
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,17 @@ subroutine solve_hybridized_helmholtz(state,D_rhs,U_Rhs,&
character(len=OPTION_PATH_LEN), intent(in), optional :: solver_option_path
!
type(vector_field), pointer :: X, U, down, U_cart
type(scalar_field), pointer :: D,f, lambda_nc
type(scalar_field), pointer :: D, f
type(scalar_field) :: lambda
type(scalar_field), target :: lambda_rhs, u_cpt
type(csr_sparsity) :: lambda_sparsity, continuity_sparsity
type(csr_matrix) :: lambda_mat, continuity_block_mat,continuity_block_mat1
type(csr_matrix) :: lambda_mat, continuity_block_mat
type(block_csr_matrix) :: continuity_mat
type(mesh_type), pointer :: lambda_mesh
real :: D0, dt, g, theta
integer :: ele,i1, stat, dim1
integer :: ele, i1, dim1
logical :: l_compute_cartesian,l_check_continuity, l_output_dense
real, dimension(:,:), allocatable :: lambda_mat_dense
character(len=OPTION_PATH_LEN) :: constraint_option_string

ewrite(1,*) ' subroutine solve_hybridized_helmholtz('

Expand Down Expand Up @@ -257,21 +256,20 @@ subroutine assemble_hybridized_helmholtz_ele(D,f,U,X,down,ele, &
&l_continuity_mat, l_continuity_mat2
real, allocatable, dimension(:,:) :: helmholtz_loc_mat
real, allocatable, dimension(:,:,:) :: continuity_face_mat
real, allocatable, dimension(:,:) :: scalar_continuity_face_mat
integer :: ni, face
integer, dimension(:), pointer :: neigh
real, dimension(ele_loc(lambda_rhs,ele)) :: lambda_rhs_loc,lambda_rhs_loc2
real, dimension(ele_loc(lambda_rhs,ele)) :: lambda_rhs_loc
real, dimension(:),allocatable,target :: Rhs_loc
real, dimension(:,:), allocatable :: local_solver_matrix, local_solver_rhs
type(element_type) :: U_shape
integer :: stat, d_start, d_end, dim1, mdim, uloc,dloc, lloc
integer :: d_start, d_end, dim1, mdim, uloc,dloc, lloc
integer, dimension(mesh_dim(U)) :: U_start, U_end
type(real_vector), dimension(mesh_dim(U)) :: rhs_u_ptr
real, dimension(:), pointer :: rhs_d_ptr
type(real_matrix), dimension(mesh_dim(U)) :: &
& continuity_mat_u_ptr
logical :: have_constraint
integer :: constraint_choice, n_constraints, constraints_start
integer :: n_constraints

!Get some sizes
lloc = ele_loc(lambda_rhs,ele)
Expand Down Expand Up @@ -414,9 +412,6 @@ subroutine reconstruct_U_d_ele(D,f,U,X,down,ele, &
integer :: d_start, d_end, dim1, mdim, uloc,dloc,lloc
integer, dimension(mesh_dim(U)) :: U_start, U_end
type(real_vector), dimension(mesh_dim(U)) :: rhs_u_ptr
real, dimension(:), pointer :: rhs_d_ptr
type(real_matrix), dimension(mesh_dim(U)) :: &
& continuity_mat_u_ptr
real, dimension(ele_loc(lambda,ele)) :: lambda_val
real, dimension(:),allocatable,target :: Rhs_loc
real, dimension(:,:), allocatable :: local_solver_matrix, local_solver_rhs
Expand Down Expand Up @@ -573,7 +568,6 @@ subroutine get_local_solver(local_solver_matrix,U,X,down,D,f,ele,&
real, dimension(mesh_dim(U), X%dim, ele_ngi(U,ele)) :: J
real, dimension(ele_ngi(x,ele)) :: f_gi
real, dimension(X%dim, ele_ngi(X,ele)) :: up_gi
real, dimension(X%dim) :: up_vec
real, dimension(mesh_dim(U),ele_loc(U,ele),ele_loc(D,ele)) :: l_div_mat
real, dimension(mesh_dim(U), mesh_dim(U), ele_ngi(U,ele)) :: Metric, &
&Metricf
Expand Down Expand Up @@ -1091,8 +1085,6 @@ function get_face_normal_manifold(X,ele,face) result (normal)
real, dimension(X%dim) :: ele_normal_gi, edge_tangent_gi, X_mid_ele,&
&X_mid_face
type(element_type) :: X_shape, X_face_shape
real, dimension(X%dim,ele_loc(X,ele)) :: X_ele
real, dimension(X%dim,face_loc(X,face)) :: X_face

call compute_jacobian(X, ele, J=J, detwei=detwei)
call compute_jacobian(X,face, J=J_f, detwei=detwei_f, facet=.true.)
Expand Down Expand Up @@ -1692,7 +1684,6 @@ subroutine set_coriolis_term_ele(Coriolis_term,f,down,U_local,X,ele)
real, dimension(mesh_dim(U_local)*ele_loc(U_local,ele)) :: coriolis_rhs
real, dimension(mesh_dim(U_local), ele_ngi(U_local,ele)) :: U_gi
real, dimension(mesh_dim(U_local), ele_ngi(U_local,ele)) :: coriolis_gi
real, dimension(X%dim) :: up_vec
integer :: dim1, dim2,uloc,gi
type(element_type) :: u_shape

Expand Down
2 changes: 1 addition & 1 deletion assemble/Hydrostatic_Pressure.F90
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ end subroutine calculate_hydrostatic_pressure
subroutine calculate_hydrostatic_pressure_gradient(state)
type(state_type), intent(inout) :: state

integer :: i, stat
integer :: stat
type(vector_field), pointer :: hpg

hpg => extract_vector_field(state, hpg_name, stat = stat)
Expand Down
24 changes: 11 additions & 13 deletions assemble/Makefile.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -691,14 +691,13 @@ Sam_integration.o ../include/sam_integration.mod: Sam_integration.F90 \
../include/elements.mod ../include/fdebug.h ../include/field_options.mod \
../include/fields.mod ../include/fldebug.mod ../include/futils.mod \
../include/global_parameters.mod ../include/halos.mod \
../include/ieee_arithmetic.mod ../include/memory_diagnostics.mod \
../include/metric_tools.mod ../include/mpi_interfaces.mod \
../include/node_boundary.mod ../include/parallel_tools.mod \
../include/pickers.mod ../include/populate_state_module.mod \
../include/quadrature.mod ../include/reference_counting.mod \
../include/reserve_state_module.mod ../include/state_module.mod \
../include/surface_id_interleaving.mod ../include/surfacelabels.mod \
../include/tictoc.mod
../include/memory_diagnostics.mod ../include/metric_tools.mod \
../include/mpi_interfaces.mod ../include/node_boundary.mod \
../include/parallel_tools.mod ../include/pickers.mod \
../include/populate_state_module.mod ../include/quadrature.mod \
../include/reference_counting.mod ../include/reserve_state_module.mod \
../include/state_module.mod ../include/surface_id_interleaving.mod \
../include/surfacelabels.mod ../include/tictoc.mod

../include/shallow_water_equations.mod: Shallow_Water_Equations.o
@true
Expand All @@ -717,10 +716,9 @@ Slope_limiters_DG.o ../include/slope_limiters_dg.mod: Slope_limiters_DG.F90 \
../include/bound_field_module.mod ../include/elements.mod \
../include/eventcounter.mod ../include/fdebug.h \
../include/field_options.mod ../include/fields.mod ../include/fldebug.mod \
../include/ieee_arithmetic.mod ../include/sparse_tools.mod \
../include/state_fields_module.mod ../include/state_module.mod \
../include/transform_elements.mod ../include/vector_tools.mod \
../include/vtk_interfaces.mod
../include/sparse_tools.mod ../include/state_fields_module.mod \
../include/state_module.mod ../include/transform_elements.mod \
../include/vector_tools.mod ../include/vtk_interfaces.mod

../include/solenoidal_interpolation_module.mod: Solenoidal_interpolation.o
@true
Expand Down Expand Up @@ -844,7 +842,7 @@ Zoltan_global_variables.o ../include/zoltan_global_variables.mod: \

Zoltan_integration.o ../include/zoltan_integration.mod: Zoltan_integration.F90 \
../include/adapt_integration.mod ../include/boundary_conditions.mod \
../include/boundary_conditions_from_options.mod ../include/c_interfaces.mod \
../include/boundary_conditions_from_options.mod \
../include/data_structures.mod ../include/detector_data_types.mod \
../include/detector_parallel.mod ../include/detector_tools.mod \
../include/element_numbering.mod ../include/elements.mod \
Expand Down
8 changes: 2 additions & 6 deletions assemble/Manifold_Projections.F90
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ subroutine project_cartesian_to_local_transpose_ele(ele, X, U_cartesian, U_local
real, dimension(mesh_dim(U_local), X%dim, ele_ngi(X,ele)) :: J
real, dimension(ele_ngi(X,ele)) :: detwei, detJ
real, dimension(U_cartesian%dim, ele_ngi(X,ele)) :: U_quad
real, dimension(mesh_dim(U_local)*ele_loc(U_local,ele)) :: l_rhs
real, dimension(mesh_dim(U_local), mesh_dim(U_local), ele_loc(U_local,ele), ele_loc(U_local,ele)) :: l_mass
real, dimension(mesh_dim(U_local)*ele_loc(U_local,ele), mesh_dim(U_local)*ele_loc(U_local,ele)) :: l_big_mat
real, dimension(mesh_dim(U_local)*ele_loc(U_local,ele)) :: tmp
Expand All @@ -172,7 +171,7 @@ subroutine project_cartesian_to_local_transpose_ele(ele, X, U_cartesian, U_local
real, dimension(X%dim, ele_loc(U_cartesian,ele)) :: rhs
type(element_type), pointer :: U_shape
integer, dimension(:), pointer :: U_ele
integer :: dim, dim1, dim2, gi, loc, nloc
integer :: dim, dim1, dim2, gi, nloc

dim=U_local%dim

Expand Down Expand Up @@ -318,12 +317,9 @@ subroutine project_local_to_cartesian_transpose_ele(ele, X, U_local, U_cartesian
real, dimension(ele_loc(U_cartesian,ele), ele_loc(U_cartesian,ele)) :: mass
real, dimension(mesh_dim(U_local), X%dim, ele_ngi(X,ele)) :: J
real, dimension(ele_ngi(U_local,ele)) :: detwei
real, dimension(U_local%dim, ele_ngi(X,ele)) :: U_quad
real, dimension(X%dim, ele_ngi(X,ele)) :: U_cartesian_gi
real, dimension(X%dim, ele_loc(U_cartesian,ele)) :: rhs
real, dimension(U_cartesian%dim, ele_loc(U_cartesian, ele)) :: tmp, U_cartesian_ele
type(element_type), pointer :: U_shape
integer :: d, gi
integer :: d

call compute_jacobian(X, ele, J=J, detwei=detwei)

Expand Down
1 change: 0 additions & 1 deletion assemble/MeshMovement.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module meshmovement
use sparsity_patterns_meshes

implicit none
integer,save :: MeshCount=0

interface

Expand Down
3 changes: 1 addition & 2 deletions assemble/Momentum_Diagnostic_Fields.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ subroutine calculate_momentum_diagnostics(state, istate, submaterials, submateri
type(state_type), dimension(size(state)) :: calculated_state
type(state_type), dimension(size(submaterials)) :: calculated_submaterials
type(scalar_field), pointer :: bulk_density, buoyancy_density, sfield
type(vector_field), pointer :: vfield, x, velocity
type(vector_field) :: prescribed_source
type(vector_field), pointer :: vfield, velocity
type(tensor_field), pointer :: tfield

integer :: stat, i
Expand Down
2 changes: 0 additions & 2 deletions assemble/Momentum_Equation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ subroutine solve_momentum(state, at_first_timestep, timestep)

! Change in pressure
type(scalar_field) :: delta_p
! Change in velocity
type(vector_field) :: delta_u

! Dummy fields
type(scalar_field), pointer :: dummyscalar, dummydensity, dummypressure
Expand Down
4 changes: 2 additions & 2 deletions assemble/Multiphase.F90
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ subroutine add_fluid_particle_drag(state, istate, u, x, big_m, mom_rhs)

integer :: i, dim
logical :: not_found ! Error flag. Have we found the fluid phase?
integer :: istate_fluid, istate_particle
integer :: istate_fluid

! Types of drag correlation
integer, parameter :: DRAG_CORRELATION_TYPE_STOKES = 1, DRAG_CORRELATION_TYPE_WEN_YU = 2, DRAG_CORRELATION_TYPE_ERGUN = 3, DRAG_CORRELATION_TYPE_SCHILLER_NAUMANN = 4, DRAG_CORRELATION_TYPE_LAIN_1_1999= 5, DRAG_CORRELATION_TYPE_LAIN_2_2002 = 6
Expand Down Expand Up @@ -701,7 +701,7 @@ subroutine add_heat_transfer(state, istate, internal_energy, matrix, rhs)

logical :: is_particle_phase
logical :: not_found ! Error flag. Have we found the fluid phase?
integer :: i, istate_fluid, istate_particle
integer :: i, istate_fluid


ewrite(1, *) "Entering add_heat_transfer"
Expand Down
9 changes: 4 additions & 5 deletions assemble/Particle_Diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ subroutine initialise_constant_particle_diagnostics(state)
type(state_type), dimension(:), intent(inout) :: state

character(len = OPTION_PATH_LEN) :: group_path, subgroup_path
type(scalar_field), pointer :: s_field
integer :: i, j
integer :: particle_groups, list_counter, particle_materials
integer :: particle_groups, list_counter
integer, dimension(:), allocatable :: particle_arrays

type(detector_type), pointer :: particle
Expand Down Expand Up @@ -199,14 +198,14 @@ subroutine calculate_field_from_particles(states, state_index, s_field)
character(len=OPTION_PATH_LEN) :: lgroup, lattribute
type(vector_field), pointer :: xfield
type(detector_type), pointer :: particle
integer :: i, j
integer :: i
real, allocatable, dimension(:) :: node_values
real, allocatable, dimension(:) :: node_part_count ! real instead of integer, so we can use halo_accumulate
integer :: element, node_number
real, allocatable, dimension(:) :: local_crds
integer, dimension(:), pointer :: nodes
integer :: nprocs, att_n
real :: att_value, ratio_val
real :: att_value
character(len= OPTION_PATH_LEN) :: lmethod
logical :: from_particles

Expand Down Expand Up @@ -693,7 +692,7 @@ subroutine spawn_particles(node_part_count, node_particles, group_arrays, xfield
integer :: id, group_spawn, ele_spawn, proc_num
integer :: j, i, k, l, m, dim
logical :: spawn_group, coords_set, rand_set
real :: max_lcoord, rand_lcoord, sum_coords, rand_val
real :: max_lcoord, rand_lcoord, rand_val
real, dimension(:), allocatable :: rand_lcoords

proc_num = getprocno()
Expand Down
6 changes: 1 addition & 5 deletions assemble/Sam_integration.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ subroutine allocate_remaining_fields(states)

type(state_type), dimension(:), intent(inout) :: states

integer :: i, j, k
integer :: i, j
type(scalar_field), pointer :: s_field
type(tensor_field), pointer :: t_field
type(vector_field), pointer :: v_field
Expand Down Expand Up @@ -1252,7 +1252,6 @@ subroutine sam_init(states, options, max_coplanar_id, metric, external_mesh_name
integer, dimension(:), pointer :: ndglno
integer, dimension(:), allocatable :: surfid, sndgln
integer :: nloc, snloc
real, dimension(:), pointer :: x, y, z
real, dimension(:), allocatable :: metric_handle
integer :: nfields
real, dimension(:), pointer :: fields
Expand Down Expand Up @@ -1703,9 +1702,6 @@ end subroutine check_sam_linear_remap_validity

subroutine sam_integration_check_options

integer :: i
character (len=OPTION_PATH_LEN) :: continuity_var

!!< Check libsam integration related options

if(.not. isparallel()) then
Expand Down
15 changes: 6 additions & 9 deletions assemble/Slope_limiters_DG.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1461,16 +1461,15 @@ subroutine limit_fpn(state, t)
type(scalar_field) :: lowerbound, upperbound, inverse_lumped_mass
type(csr_matrix), pointer :: mass

type(csr_sparsity), pointer :: eelist
integer :: ele, i, j, k, row, column
integer :: ele, i, j, row, column
integer :: rows, columns
real :: node_max, node_min, extra_val, extra_val2
real :: node_max, node_min

integer, dimension(:), pointer :: nodelist, faces, neighbouring_ele_nodes
integer, dimension(:), allocatable :: face_nodes, neighbouring_nodes
integer, dimension(:), pointer :: nodelist, faces
integer, dimension(:), allocatable :: neighbouring_nodes
integer :: neighbouring_face, neighbouring_ele
logical, save :: first=.true.
logical :: midpoint, extrapolate, pre_dist_mass
logical :: midpoint, extrapolate

real :: beta=1.0, mean_val
type(vector_field), pointer :: position
Expand All @@ -1480,9 +1479,7 @@ subroutine limit_fpn(state, t)
real, dimension(:,:), allocatable :: grad_t
real :: grad, e_dist

real, dimension(ele_loc(t,1)) :: weight, tracer_val
logical, dimension(ele_loc(t,1)) :: nweight, pweight
real :: nodeval, nodemin, nodemax, adjust
real, dimension(ele_loc(t,1)) :: tracer_val

integer, dimension(:,:,:), allocatable, save :: nodes_array
! real, dimension(2,4) :: local_values
Expand Down
6 changes: 3 additions & 3 deletions assemble/Timeloop_utilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ subroutine relax_to_nonlinear(state)
velocity=>extract_vector_field(state(s), "Velocity", stat)
if(stat==0) then
if (have_option(trim(velocity%option_path)//"/prognostic")) then
call get_option(trim(velocity%option_path)//"/prognostic/temporal_discretisation/relaxation", itheta, default=0.5)
call get_option(trim(velocity%option_path)//"/prognostic/temporal_discretisation/relaxation", itheta, default=0.5)
else if (have_option(trim(velocity%option_path)//"/prescribed")) then
call get_option(trim(velocity%option_path)//"/prescribed/temporal_discretisation/relaxation", itheta, default=1.0)
call get_option(trim(velocity%option_path)//"/prescribed/temporal_discretisation/relaxation", itheta, default=1.0)
else
itheta = 0.5
itheta = 0.5
end if
else
itheta = 0.5
Expand Down
Loading

0 comments on commit ec37f5e

Please sign in to comment.