Skip to content

Commit bc125b7

Browse files
committed
code cleaning (fortran linter fortitude)
1 parent 169b4f7 commit bc125b7

File tree

58 files changed

+320
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+320
-243
lines changed

src/auxiliaries/combine_vol_data_impl.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module combine_vtk_par
2929

3030
use constants, only: CUSTOM_REAL
3131

32+
implicit none
33+
3234
! global point data
3335
real(kind=CUSTOM_REAL),dimension(:),allocatable :: total_dat
3436

src/decompose_mesh/module_database.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module module_database
3131
use shared_parameters, only: NGNOD, NGNOD2D, LOCAL_PATH, MSL => MAX_STRING_LEN
3232
use fault_scotch
3333

34+
implicit none
3435
integer :: nE_loc
3536
integer, dimension(:), allocatable :: loc2glob_elmnt
3637
integer, dimension(:), allocatable :: glob2loc_elmnt

src/decompose_mesh/module_mesh.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ module module_mesh
3131
use shared_parameters, only: NGNOD,NGNOD2D,ATTENUATION,PML_CONDITIONS
3232
use fault_scotch
3333

34+
implicit none
35+
3436
! elements
3537
integer :: nspec, nspec_glob
3638
integer, dimension(:,:), allocatable :: elmnts, elmnts_glob

src/decompose_mesh/module_partition.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ module module_partition
3131
use shared_parameters, only: NGNOD
3232
use module_qsort
3333

34+
implicit none
35+
3436
integer :: nE
3537
integer, dimension(:), allocatable :: ipart
3638

src/decompose_mesh/part_decompose_mesh_hdf5.F90

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ module part_decompose_mesh_hdf5
3131
use constants, only: MAX_STRING_LEN,NGNOD2D_FOUR_CORNERS,NGNOD_EIGHT_CORNERS
3232

3333
#ifdef USE_HDF5
34-
3534
use manager_hdf5
35+
#endif
3636

3737
implicit none
3838

39+
#ifdef USE_HDF5
40+
3941
contains
4042
!--------------------------------------------------
4143
! Write nodes (their coordinates) pertaining to iproc partition in the corresponding Database
@@ -135,11 +137,11 @@ subroutine write_material_props_database_h5(count_def_mat, &
135137
! name for material data group
136138
character(len=14), parameter :: gname_material = "material_props" ! Group name for material properties
137139
! for attribute count_def_mat and count_undef_mat
138-
character(len=13) :: m_aname = "count_def_mat"
139-
character(len=15) :: u_aname = "count_undef_mat"
140+
character(len=13), parameter :: m_aname = "count_def_mat"
141+
character(len=15), parameter :: u_aname = "count_undef_mat"
140142
! for dataset mat_prop, undef_mat_prop
141-
character(len=40) :: mdsetname = "mat_prop"
142-
character(len=40) :: udsetname = "undef_mat_prop"
143+
character(len=40), parameter :: mdsetname = "mat_prop"
144+
character(len=40), parameter :: udsetname = "undef_mat_prop"
143145

144146
! prepare groups in hdf5 file
145147
! material data group
@@ -618,7 +620,10 @@ subroutine write_partition_database_h5(iproc, nspec, elmnts, &
618620
! for ispec_local
619621
integer, dimension(:), allocatable :: ispec_local
620622

621-
integer :: o = 0
623+
integer:: off
624+
625+
! initializes
626+
off = 0
622627

623628
if (num_phase == 1) then
624629
! counts number of spectral elements in this partition
@@ -640,7 +645,7 @@ subroutine write_partition_database_h5(iproc, nspec, elmnts, &
640645
allocate(ispec_local(offset_nelems(iproc)))
641646

642647
! node id offset
643-
o = sum(offset_nnodes(0:iproc-1))
648+
off = sum(offset_nnodes(0:iproc-1))
644649

645650
! prepare a temporal array to be recorded in hdf5
646651
! element corner indices
@@ -665,26 +670,26 @@ subroutine write_partition_database_h5(iproc, nspec, elmnts, &
665670
! elm_conn_xdmf
666671
if (NGNOD == 8) then
667672
elm_conn_xdmf(1,count) = 9 ! cell type id xdmf
668-
elm_conn_xdmf(2,count) = loc_nodes(0)+o!+1 elm id starts 0
669-
elm_conn_xdmf(3,count) = loc_nodes(1)+o
670-
elm_conn_xdmf(4,count) = loc_nodes(2)+o
671-
elm_conn_xdmf(5,count) = loc_nodes(3)+o
672-
elm_conn_xdmf(6,count) = loc_nodes(4)+o
673-
elm_conn_xdmf(7,count) = loc_nodes(5)+o
674-
elm_conn_xdmf(8,count) = loc_nodes(6)+o
675-
elm_conn_xdmf(9,count) = loc_nodes(7)+o
673+
elm_conn_xdmf(2,count) = loc_nodes(0)+off !+1 elm id starts 0
674+
elm_conn_xdmf(3,count) = loc_nodes(1)+off
675+
elm_conn_xdmf(4,count) = loc_nodes(2)+off
676+
elm_conn_xdmf(5,count) = loc_nodes(3)+off
677+
elm_conn_xdmf(6,count) = loc_nodes(4)+off
678+
elm_conn_xdmf(7,count) = loc_nodes(5)+off
679+
elm_conn_xdmf(8,count) = loc_nodes(6)+off
680+
elm_conn_xdmf(9,count) = loc_nodes(7)+off
676681
else ! NGNOD = 27
677682
! NGNOD = 27 array will not be used, only the 8 corner nodes
678683
! are necessary for checkmesh visualization
679684
elm_conn_xdmf(1,count) = 9 !50 ! cell type id xdmf
680-
elm_conn_xdmf(2,count) = loc_nodes(0)+o
681-
elm_conn_xdmf(3,count) = loc_nodes(1)+o
682-
elm_conn_xdmf(4,count) = loc_nodes(2)+o
683-
elm_conn_xdmf(5,count) = loc_nodes(3)+o
684-
elm_conn_xdmf(6,count) = loc_nodes(4)+o
685-
elm_conn_xdmf(7,count) = loc_nodes(5)+o
686-
elm_conn_xdmf(8,count) = loc_nodes(6)+o
687-
elm_conn_xdmf(9,count) = loc_nodes(7)+o
685+
elm_conn_xdmf(2,count) = loc_nodes(0)+off
686+
elm_conn_xdmf(3,count) = loc_nodes(1)+off
687+
elm_conn_xdmf(4,count) = loc_nodes(2)+off
688+
elm_conn_xdmf(5,count) = loc_nodes(3)+off
689+
elm_conn_xdmf(6,count) = loc_nodes(4)+off
690+
elm_conn_xdmf(7,count) = loc_nodes(5)+off
691+
elm_conn_xdmf(8,count) = loc_nodes(6)+off
692+
elm_conn_xdmf(9,count) = loc_nodes(7)+off
688693
! elm_conn_xdmf(10,count) = loc_nodes(8)
689694
! elm_conn_xdmf(11,count) = loc_nodes(9)
690695
! elm_conn_xdmf(12,count) = loc_nodes(10)
@@ -985,7 +990,7 @@ subroutine write_moho_surface_database_h5(iproc, nspec, &
985990
integer :: loc_nspec2D_moho
986991

987992
! for loc_nspec_2d_homo attribute
988-
character(len=8) :: aname = "loc_moho"
993+
character(len=8), parameter :: aname = "loc_moho"
989994
integer , dimension(2) :: moho_attr
990995

991996
! homo_elements dataset

src/generate_databases/fault_generate_databases.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ subroutine setup_Kelvin_Voigt_eta(fdb,nspec)
347347
Kelvin_Voigt_eta(fdb%ispec2) = fdb%eta
348348
endif
349349

350-
end subroutine
350+
end subroutine setup_Kelvin_Voigt_eta
351351

352352
!===============================================================================================================
353353

src/generate_databases/get_coupling_surfaces.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,4 +981,4 @@ integer function get_iglob_index(ijk_index,ispec_in,nspec,ibool)
981981
kk = ijk_index(3)
982982
get_iglob_index = ibool(ii,jj,kk,ispec_in)
983983

984-
end function
984+
end function get_iglob_index

src/generate_databases/model_coupled.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
module model_coupled_par
4444

45+
implicit none
46+
4547
! VM VM my model for DSM coupling
4648
double precision, dimension (:,:), allocatable :: vpv_1D,vsv_1D,density_1D
4749
double precision, dimension (:), allocatable :: zlayer

src/generate_databases/model_external_values.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module external_model
4444
! ADD YOUR MODEL HERE
4545
!
4646
!---
47+
implicit none
4748
integer, parameter :: dummy_size = 1
4849

4950
! only here to illustrate an example

src/generate_databases/model_salton_trough.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
module salton_trough_par
3636

37+
implicit none
38+
3739
! Salton Sea Gocad voxet
3840
integer, parameter :: GOCAD_ST_NU = 638, GOCAD_ST_NV = 219, GOCAD_ST_NW = 76
3941
double precision, parameter :: &

0 commit comments

Comments
 (0)