Skip to content

Commit ed4e69f

Browse files
committed
Fix indent linter errors
Signed-off-by: Nicolas Bock <[email protected]>
1 parent 4a03031 commit ed4e69f

Some content is hidden

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

61 files changed

+7316
-7311
lines changed

examples/gpmd/gpmd.F90

Lines changed: 175 additions & 175 deletions
Large diffs are not rendered by default.

examples/gpmdcov/gpmdcov.F90

Lines changed: 1183 additions & 1183 deletions
Large diffs are not rendered by default.

examples/gpmdcov/test_openmp.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
#include <omp.h>
88
#include <mpi.h>
99

10-
int main(int argc, char **argv)
10+
int
11+
main(
12+
int argc,
13+
char **argv)
1114
{
1215
int size;
1316
int rank;
@@ -20,7 +23,8 @@ int main(int argc, char **argv)
2023
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
2124
MPI_Comm_size(MPI_COMM_WORLD, &size);
2225

23-
if (rank == 0) {
26+
if (rank == 0)
27+
{
2428
printf("MPI size %d\n", size);
2529
printf("MPI_THREAD_SERIALIZED = %d\n", MPI_THREAD_SERIALIZED);
2630
printf("MPI_THREAD_MULTIPLE = %d\n", MPI_THREAD_MULTIPLE);
@@ -30,15 +34,18 @@ int main(int argc, char **argv)
3034
#pragma omp parallel
3135
{
3236
#pragma omp master
33-
printf("Rank %d, running on %d threads\n", rank, omp_get_num_threads());
37+
printf("Rank %d, running on %d threads\n", rank,
38+
omp_get_num_threads());
3439
}
3540

3641
#pragma omp parallel private(counter)
3742
{
38-
printf("Rank %d, thread %d starting up\n", rank, omp_get_thread_num());
39-
while (1) {
43+
printf("Rank %d, thread %d starting up\n", rank,
44+
omp_get_thread_num());
45+
while (1)
46+
{
4047
counter++;
41-
counter = counter%100;
48+
counter = counter % 100;
4249
}
4350
}
4451

examples/gpscf/gpscf.F90

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
!> High-level program to perform SFC cycles in Extended Huckel Hamiltonian.
2-
!! This program takes coordinates in xyz or pdb format and extracts information
3-
!! about the system.
2+
!! This program takes coordinates in xyz or pdb format and extracts information
3+
!! about the system.
44
program gpscf
55

66
!BML lib.
7-
use bml
7+
use bml
88
!Progress and LATTE lib modules.
99
use prg_progress_mod
1010
use prg_system_mod
1111
use prg_ptable_mod
1212
use latteparser_latte_mod
1313
use huckel_latte_mod
14-
use tbparams_latte_mod
14+
use tbparams_latte_mod
1515
use ham_latte_mod
1616
use coulomb_latte_mod
1717
use prg_charges_mod
@@ -30,7 +30,7 @@ program gpscf
3030
use prg_subgraphLoop_mod
3131
use prg_homolumo_mod
3232

33-
implicit none
33+
implicit none
3434

3535
integer, parameter :: dp = kind(1.0d0)
3636
integer :: i, j, nel, norb
@@ -56,56 +56,56 @@ program gpscf
5656
call prg_progress_init()
5757

5858
if (printRank() .eq. 1) then
59-
write(*,*) "gptest start ..."
59+
write(*,*) "gptest start ..."
6060
endif
6161

62-
!> Parsing input file. This file contains all the variables needed to
63-
! run the scf including the sp2 (solver) variables. lt is "latte_type" structure
64-
! containing all the variables.
62+
!> Parsing input file. This file contains all the variables needed to
63+
! run the scf including the sp2 (solver) variables. lt is "latte_type" structure
64+
! containing all the variables.
6565
! file://~/progress/build/doc/html/structlatteparser__latte__mod_1_1latte__type.html
66-
call parse_latte(lt,"input.in")
66+
call parse_latte(lt,"input.in")
6767

68-
!> Parsing system coordinates. This reads the coords.pdb file to get the position of every
68+
!> Parsing system coordinates. This reads the coords.pdb file to get the position of every
6969
! atom in the system. sy is the "system_type" structure containing all the variables.
7070
! file://~/progress/build/doc/html/classsystem__latte__mod.html
71-
call prg_parse_system(sy,"coords","pdb")
71+
call prg_parse_system(sy,"coords","pdb")
7272

7373
!> Allocate bounds vactor.
7474
allocate(gbnd(2))
7575

76-
!> Get Huckel hamiltonian. Computes the Extended Huckel Hamiltonian from the
76+
!> Get Huckel hamiltonian. Computes the Extended Huckel Hamiltonian from the
7777
! atom coordinates. The main inputs are the huckelTBparams and the system coordinate (sy%coordinate)
7878
! The main outputs are Hamiltonian (ham_bml) and Overlap (over_bml) matrices.
7979
call get_hshuckel(ham_bml,over_bml,sy%coordinate,sy%spindex,sy%spatnum,&
80-
"../../huckelTBparams",lt%bml_type,lt%mdim,lt%threshold&
81-
,tb%nsp,tb%splist,tb%basis,tb%numel,tb%onsite_energ,&
82-
tb%norbi,tb%hubbardu)
80+
"../../huckelTBparams",lt%bml_type,lt%mdim,lt%threshold&
81+
,tb%nsp,tb%splist,tb%basis,tb%numel,tb%onsite_energ,&
82+
tb%norbi,tb%hubbardu)
8383

84-
!> Get the mapping of the Hamiltonian index with the atom index
84+
!> Get the mapping of the Hamiltonian index with the atom index
8585
! hindex(1,i)=starting Hindex for atom i.
8686
! hindex(2,i)=final Hindex for atom i.
8787
! file://~/progress/build/doc/html/ham__latte__mod_8F90_source.html
88-
call get_hindex(sy%spindex,tb%norbi,hindex,norb)
89-
88+
call get_hindex(sy%spindex,tb%norbi,hindex,norb)
89+
9090
if (printRank() .eq. 1) then
9191
write(*,*) "Number of orbitals = ", norb
9292
write(*,*)
9393
call bml_print_matrix("ham0_bml",ham_bml,0,6,0,6)
9494
endif
9595

96-
!> Get occupation based on last shell population.
96+
!> Get occupation based on last shell population.
9797
! WARNING: This could change depending on the TB method being used.
9898
nel = sum(element_numel(sy%atomic_number(:)),&
99-
size(sy%atomic_number,dim=1))
99+
size(sy%atomic_number,dim=1))
100100
bndfil = nel/(2.0_dp*norb)
101101
if (printRank() .eq. 1) then
102102
write(*,*) "bndfil = ", bndfil
103103
write(*,*) "nel = ", nel
104104
endif
105105

106-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
107-
!> First Charge computation
108-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
106+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
107+
!> First Charge computation
108+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
109109

110110
!> Initialize the density matrix (rho_bml) and inverse overlap factor (zmat_bml).
111111
call prg_init_pzmat(rho_bml,zmat_bml,lt%bml_type,lt%mdim,norb)
@@ -119,15 +119,15 @@ program gpscf
119119
!> Orthogonalize ham.
120120
call prg_timer_start(ortho_timer)
121121
call prg_orthogonalize(ham_bml,zmat_bml,orthoh_bml,&
122-
lt%threshold,lt%bml_type,lt%verbose)
122+
lt%threshold,lt%bml_type,lt%verbose)
123123
call prg_timer_stop(ortho_timer)
124124

125125
#ifdef DO_MPI_BLOCK
126126
call prg_allGatherParallel(orthoh_bml)
127127
#endif
128128

129-
!> The SP2 algorithm is used to get the first orthogonal Density matrix (orthop).
130-
call prg_parse_gsp2(gsp2,"input.in")
129+
!> The SP2 algorithm is used to get the first orthogonal Density matrix (orthop).
130+
call prg_parse_gsp2(gsp2,"input.in")
131131

132132
!> Calculate gershgorin bounds
133133
call bml_gershgorin(orthoh_bml, gbnd)
@@ -139,7 +139,7 @@ program gpscf
139139
!> SP2 algorithm.
140140
call prg_timer_start(sp2_timer)
141141
call prg_sp2_alg2_genseq(orthoh_bml,orthop_bml,lt%threshold,bndfil,gsp2%minsp2iter,&
142-
gsp2%maxsp2iter,gsp2%sp2conv,gsp2%sp2tol, pp, icount, vv)
142+
gsp2%maxsp2iter,gsp2%sp2conv,gsp2%sp2tol, pp, icount, vv)
143143
call prg_timer_stop(sp2_timer)
144144
#ifdef DO_MPI_BLOCK
145145
call prg_allGatherParallel(orthop_bml)
@@ -166,20 +166,20 @@ program gpscf
166166
call bml_zero_matrix(lt%bml_type,bml_element_real,dp,norb,norb,g_bml)
167167
call bml_copy(orthop_bml, g_bml)
168168

169-
!> Deprg_orthogonalize rho.
169+
!> Deprg_orthogonalize rho.
170170
call prg_timer_start(deortho_timer)
171171
call prg_deorthogonalize(orthop_bml,zmat_bml,rho_bml,&
172-
lt%threshold,lt%bml_type,lt%verbose)
172+
lt%threshold,lt%bml_type,lt%verbose)
173173
call prg_timer_stop(deortho_timer)
174174
#ifdef DO_MPI_BLOCK
175175
call prg_allGatherParallel(rho_bml)
176176
#endif
177177

178178
if (printRank() .eq. 1) then
179-
call bml_print_matrix("rho_bml",rho_bml,0,6,0,6)
179+
call bml_print_matrix("rho_bml",rho_bml,0,6,0,6)
180180
endif
181181

182-
!> Get charges based on rho. rho_bml is the input and sy%net_charge is the outputs vector containing
182+
!> Get charges based on rho. rho_bml is the input and sy%net_charge is the outputs vector containing
183183
! the charges.
184184
call prg_get_charges(rho_bml, over_bml, hindex, sy%net_charge, tb%numel, sy%spindex, lt%mdim, lt%threshold)
185185
charges_old = sy%net_charge
@@ -188,9 +188,9 @@ program gpscf
188188
write(*,*)"Total charges =", sum(sy%net_charge(:),size(sy%net_charge,dim=1))
189189
endif
190190

191-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
191+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
192192
!> SCF loop
193-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
193+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
194194

195195
!> Save actual hamiltonian as the non-scf Hamiltonian (H0)
196196
call bml_copy_new(ham_bml,ham0_bml)
@@ -199,7 +199,7 @@ program gpscf
199199
call prg_get_recip_vects(sy%lattice_vector,sy%recip_vector,sy%volr,sy%volk)
200200

201201
!> Beginning of the SCF loop.
202-
do i=1,lt%maxscf
202+
do i=1,lt%maxscf
203203

204204
if (printRank() .eq. 1) then
205205
write(*,*)"SCF iter", i
@@ -210,34 +210,34 @@ program gpscf
210210
write(*,*)"In real Coul ..."
211211
endif
212212
call get_ewald_real(sy%spindex,sy%splist,sy%coordinate&
213-
,sy%net_charge,tb%hubbardu,sy%lattice_vector,&
214-
sy%volr,lt%coul_acc,coul_forces_r,coul_pot_r);
213+
,sy%net_charge,tb%hubbardu,sy%lattice_vector,&
214+
sy%volr,lt%coul_acc,coul_forces_r,coul_pot_r);
215215

216216
!> Reciprocal contribution to the Coul energy. The outputs are coul_forces_k,coul_pot_k.
217217
if (printRank() .eq. 1) then
218-
write(*,*)"In recip Coul ..."
218+
write(*,*)"In recip Coul ..."
219219
endif
220220
call get_ewald_recip(sy%spindex,sy%splist,sy%coordinate&
221-
,sy%net_charge,tb%hubbardu,sy%lattice_vector,&
222-
sy%recip_vector,sy%volr,lt%coul_acc,coul_forces_k,coul_pot_k);
221+
,sy%net_charge,tb%hubbardu,sy%lattice_vector,&
222+
sy%recip_vector,sy%volr,lt%coul_acc,coul_forces_k,coul_pot_k);
223223

224224
!> Get the scf hamiltonian. The outputs is ham_bml.
225225
if (printRank() .eq. 1) then
226226
write(*,*)"in prg_get_hscf ..."
227227
endif
228228
call prg_get_hscf(ham0_bml,over_bml,ham_bml,sy%spindex,hindex,tb%hubbardu,sy%net_charge,&
229-
coul_pot_r,coul_pot_k,lt%mdim,lt%threshold)
229+
coul_pot_r,coul_pot_k,lt%mdim,lt%threshold)
230230

231231
!> Initialize the orthogonal versions of ham and rho.
232232
call prg_init_ortho(orthoh_bml,orthop_bml,lt%bml_type,lt%mdim,norb)
233233

234234
!> Orthogonalize the Hamiltonian
235-
! if (printRank() .eq. 1) then
236-
write(*,*)"in prg_orthogonalize H ..."
237-
! endif
235+
! if (printRank() .eq. 1) then
236+
write(*,*)"in prg_orthogonalize H ..."
237+
! endif
238238
call prg_timer_start(ortho_timer)
239239
call prg_orthogonalize(ham_bml,zmat_bml,orthoh_bml,&
240-
lt%threshold,lt%bml_type,lt%verbose)
240+
lt%threshold,lt%bml_type,lt%verbose)
241241
call prg_timer_stop(ortho_timer)
242242
#ifdef DO_MPI_BLOCK
243243
call prg_allGatherParallel(orthoh_bml)
@@ -246,7 +246,7 @@ program gpscf
246246
if (printRank() .eq. 1) then
247247
call bml_print_matrix("orthoh_bml",orthoh_bml,0,6,0,6)
248248
call bml_print_matrix("ham_bml",ham_bml,0,6,0,6)
249-
call bml_print_matrix("zmat_bml",zmat_bml,0,6,0,6)
249+
call bml_print_matrix("zmat_bml",zmat_bml,0,6,0,6)
250250
endif
251251

252252
!> Threshold the graph
@@ -260,27 +260,27 @@ program gpscf
260260
call prg_equalPartition(gp, gsp2%nodesPerPart, norb)
261261
call prg_timer_stop(part_timer)
262262

263-
! call prg_timer_start(dyn_timer,"metis+SA")
264-
! call metis
265-
! call SA
266-
! call prg_timer_start(dyn_timer,1)
263+
! call prg_timer_start(dyn_timer,"metis+SA")
264+
! call metis
265+
! call SA
266+
! call prg_timer_start(dyn_timer,1)
267+
268+
! call prg_timer_start(dyn_timer,"metisSA")
269+
! call system("echo 'hello'")
270+
! call prg_timer_stop(dyn_timer,1)
267271

268-
! call prg_timer_start(dyn_timer,"metisSA")
269-
! call system("echo 'hello'")
270-
! call prg_timer_stop(dyn_timer,1)
271-
272272
!> Calculate gershgorin bounds
273273
call bml_gershgorin(orthoh_bml, gbnd)
274274
gp%mineval = gbnd(1)
275-
gp%maxeval = gbnd(2)
275+
gp%maxeval = gbnd(2)
276276
if (printRank() .eq. 1) then
277277
write(*,*) "Gershgorin: mineval = ", gbnd(1), " maxeval = ", gbnd(2)
278278
write(*,*)
279279
endif
280280

281281
!! Calculate SP2 sequence
282282
call prg_sp2sequence(gp%pp, gp%maxIter, gp%mineval, gp%maxeval, ehomo, elumo, &
283-
gsp2%errlimit)
283+
gsp2%errlimit)
284284
if (printRank() .eq. 1) then
285285
write(*,*)
286286
write(*,*) "SP2Sequence: Max iterations = ", gp%maxIter
@@ -290,9 +290,9 @@ program gpscf
290290
!> Now use the graph-based SP2 algorithm to get the orthogonal Density
291291
! matrix.
292292
call prg_timer_start(graphsp2_timer)
293-
294-
call prg_subgraphSP2Loop(orthoh_bml, g_bml, orthop_bml, gp, lt%threshold)
295-
! call prg_sp2_alg1_seq(orthoh_bml,orthop_bml,lt%threshold, gp%pp, gp%maxIter, gp%vv)
293+
294+
call prg_subgraphSP2Loop(orthoh_bml, g_bml, orthop_bml, gp, lt%threshold)
295+
! call prg_sp2_alg1_seq(orthoh_bml,orthop_bml,lt%threshold, gp%pp, gp%maxIter, gp%vv)
296296

297297
call prg_timer_stop(graphsp2_timer)
298298
#ifdef DO_MPI_BLOCK
@@ -328,7 +328,7 @@ program gpscf
328328
!> Deprg_orthogonalize orthop_bml to get the density matrix rho_bml.
329329
call prg_timer_start(deortho_timer)
330330
call prg_deorthogonalize(orthop_bml,zmat_bml,rho_bml,&
331-
lt%threshold,lt%bml_type,lt%verbose)
331+
lt%threshold,lt%bml_type,lt%verbose)
332332
call prg_timer_stop(deortho_timer)
333333
#ifdef DO_MPI_BLOCK
334334
call prg_allGatherParallel(rho_bml)
@@ -343,38 +343,38 @@ program gpscf
343343

344344
!> Get the system charges.
345345
call prg_get_charges(rho_bml,over_bml,hindex,sy%net_charge,tb%numel,&
346-
sy%spindex,lt%mdim,lt%threshold)
346+
sy%spindex,lt%mdim,lt%threshold)
347347

348348
!if (printRank() .eq. 1) then
349-
write(*,*)"Total charge", sum(sy%net_charge(:)),size(sy%net_charge,dim=1)
349+
write(*,*)"Total charge", sum(sy%net_charge(:)),size(sy%net_charge,dim=1)
350350
!endif
351351

352352
call prg_qmixer(sy%net_charge,charges_old,dqin,&
353-
dqout,scferror,i,lt%pulaycoeff,lt%mpulay,lt%verbose)
353+
dqout,scferror,i,lt%pulaycoeff,lt%mpulay,lt%verbose)
354354

355355
charges_old = sy%net_charge
356-
356+
357357
if (printRank() .eq. 1) then
358358
write(*,*)"System charges:"
359359
do j=1,4
360360
write(*,*)sy%symbol(j),sy%net_charge(j)
361361
enddo
362362
endif
363-
if(scferror.lt.lt%scftol.and.i.gt.5) then
363+
if(scferror.lt.lt%scftol.and.i.gt.5) then
364364
if (printRank() .eq. 1) then
365365
write(*,*)"SCF converged within",i,"steps ..."
366366
write(*,*)"SCF error =",scferror
367367
endif
368368
exit
369-
endif
369+
endif
370370

371371
enddo
372372
!> End of SCF loop.
373373

374374
allocate(eigenvals(norb))
375375
call prg_get_eigenvalues(ham_bml,eigenvals,lt%verbose)
376376
call prg_write_tdos(eigenvals, 0.01_dp, 1000, -25.0_dp, 20.0_dp, "dos.dos")
377-
377+
378378
deallocate(gbnd)
379379

380380
call bml_deallocate(ham_bml)

0 commit comments

Comments
 (0)