Skip to content

Commit 41d51b7

Browse files
authored
Common Directory, Formatting and Added Intent (#476)
1 parent 37dd0f4 commit 41d51b7

File tree

9 files changed

+274
-263
lines changed

9 files changed

+274
-263
lines changed

src/common/include/inline_conversions.fpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
#else
66
!$acc routine seq
77
#endif
8-
real(kind(0d0)), intent(IN) :: pres
9-
real(kind(0d0)), intent(IN) :: rho, gamma, pi_inf
10-
real(kind(0d0)), intent(IN) :: H
11-
real(kind(0d0)), dimension(num_fluids), intent(IN) :: adv
12-
real(kind(0d0)), intent(IN) :: vel_sum
13-
real(kind(0d0)), intent(OUT) :: c
8+
real(kind(0d0)), intent(in) :: pres
9+
real(kind(0d0)), intent(in) :: rho, gamma, pi_inf
10+
real(kind(0d0)), intent(in) :: H
11+
real(kind(0d0)), dimension(num_fluids), intent(in) :: adv
12+
real(kind(0d0)), intent(in) :: vel_sum
13+
real(kind(0d0)), intent(out) :: c
1414

1515
real(kind(0d0)) :: blkmod1, blkmod2
1616

src/common/m_compile_specific.f90

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module m_compile_specific
1616
!> Creates a directory and all its parents if it does not exist
1717
!! @param dir_name Directory path
1818
subroutine s_create_directory(dir_name)
19-
character(LEN=*), intent(IN) :: dir_name
19+
character(LEN=*), intent(in) :: dir_name
2020

2121
#ifdef _WIN32
2222
call system('mkdir "'//dir_name//'" 2> NUL')
@@ -27,7 +27,7 @@ subroutine s_create_directory(dir_name)
2727
end subroutine s_create_directory
2828

2929
subroutine s_delete_file(filepath)
30-
character(LEN=*), intent(IN) :: filepath
30+
character(LEN=*), intent(in) :: filepath
3131

3232
#ifdef _WIN32
3333
call system('del "'//filepath//'"')
@@ -38,7 +38,7 @@ subroutine s_delete_file(filepath)
3838
end subroutine s_delete_file
3939

4040
subroutine s_delete_directory(dir_name)
41-
character(LEN=*), intent(IN) :: dir_name
41+
character(LEN=*), intent(in) :: dir_name
4242

4343
#ifdef _WIN32
4444
call system('rmdir "'//dir_name//'" /s /q')
@@ -52,8 +52,8 @@ end subroutine s_delete_directory
5252
!! @param fileloc File directory location
5353
!! @param dircheck Switch that indicates if directory exists
5454
subroutine my_inquire(fileloc, dircheck)
55-
character(LEN=*), intent(IN) :: fileloc
56-
logical, intent(INOUT) :: dircheck
55+
character(LEN=*), intent(in) :: fileloc
56+
logical, intent(inout) :: dircheck
5757

5858
#ifdef __INTEL_COMPILER
5959
inquire (DIRECTORY=trim(fileloc), EXIST=dircheck) !Intel
@@ -64,14 +64,14 @@ subroutine my_inquire(fileloc, dircheck)
6464
end subroutine my_inquire
6565

6666
subroutine s_get_cwd(cwd)
67-
character(LEN=*), intent(OUT) :: cwd
67+
character(LEN=*), intent(out) :: cwd
6868

6969
call GETCWD(cwd)
7070
end subroutine s_get_cwd
7171

7272
subroutine s_get_basename(dirpath, basename)
73-
character(LEN=*), intent(IN) :: dirpath
74-
character(LEN=*), intent(OUT) :: basename
73+
character(LEN=*), intent(in) :: dirpath
74+
character(LEN=*), intent(out) :: basename
7575

7676
integer :: iUnit
7777
character(len=30) :: tmpfilepath

src/common/m_delay_file_access.f90

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ module m_delay_file_access
22
implicit none
33
private
44

5-
public :: &
6-
DelayFileAccess
5+
public :: DelayFileAccess
76

87
integer, private, parameter :: &
98
N_PROCESSES_FILE_ACCESS = 128, &
@@ -12,16 +11,10 @@ module m_delay_file_access
1211
contains
1312

1413
subroutine DelayFileAccess(ProcessRank)
14+
integer, intent(in) :: ProcessRank
1515

16-
integer, intent(in) :: &
17-
ProcessRank
18-
19-
integer :: &
20-
iDelay, &
21-
nFileAccessDelayIterations
22-
real(kind(0d0)) :: &
23-
Number, &
24-
Dummy
16+
integer :: iDelay, nFileAccessDelayIterations
17+
real(kind(0d0)) :: Number, Dummy
2518

2619
nFileAccessDelayIterations &
2720
= (ProcessRank/N_PROCESSES_FILE_ACCESS)*FILE_ACCESS_DELAY_UNIT

src/common/m_eigen_solver.f90

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module m_eigen_solver
1010

1111
implicit none
1212

13-
private; public :: cg, cbal, corth, comqr2, csroot, cdiv, pythag
13+
private;
14+
public :: cg, cbal, corth, comqr2, csroot, cdiv, pythag
1415

1516
contains
1617

@@ -51,9 +52,14 @@ subroutine cg(nm, nl, ar, ai, wr, wi, zr, zi, fv1, fv2, fv3, ierr)
5152
! this version dated august 1983.
5253
!
5354
! ------------------------------------------------------------------
54-
integer nm, nl, is1, is2, ierr
55-
real(kind(0d0)), dimension(nm, nl) :: ar, ai, zr, zi
56-
real(kind(0d0)), dimension(nl) :: wr, wi, fv1, fv2, fv3
55+
integer, intent(in) :: nm, nl
56+
real(kind(0d0)), dimension(nm:nl), intent(inout) :: ar, ai
57+
real(kind(0d0)), dimension(nl), intent(out) :: wr, wi
58+
real(kind(0d0)), dimension(nm, nl), intent(out) :: zr, zi
59+
real(kind(0d0)), dimension(nl), intent(out) :: fv1, fv2, fv3
60+
integer, intent(out) :: ierr
61+
62+
integer :: is1, is2
5763

5864
if (nl <= nm) go to 10
5965
ierr = 10*nl
@@ -125,11 +131,14 @@ subroutine cbal(nm, nl, ar, ai, low, igh, scale)
125131
! this version dated august 1983.
126132
!
127133
! ------------------------------------------------------------------
128-
integer i, j, k, l, ml, nl, jj, nm, igh, low, iexc
129-
real(kind(0d0)), dimension(nm, nl) :: ar, ai
130-
real(kind(0d0)), dimension(nl) :: scale
134+
integer, intent(in) :: nm, nl
135+
real(kind(0d0)), dimension(nm, nl), intent(inout) :: ar, ai
136+
integer, intent(out) :: low, igh
137+
real(kind(0d0)), dimension(nl), intent(out) :: scale
138+
139+
integer :: i, j, k, l, ml, jj, iexc
131140
real(kind(0d0)) :: c, f, g, r, s, b2, radix
132-
logical noconv
141+
logical :: noconv
133142

134143
radix = 16.0d0
135144

@@ -295,12 +304,13 @@ subroutine corth(nm, nl, low, igh, ar, ai, ortr, orti)
295304
! this version dated august 1983.
296305
!
297306
! ------------------------------------------------------------------
298-
integer i, j, ml, nl, ii, jj, la, mp, nm, igh, kp1, low
299-
real(kind(0d0)), dimension(nm, nl) :: ar, ai
300-
real(kind(0d0)), dimension(igh) :: ortr, orti
307+
integer, intent(in) :: nm, nl, low, igh
308+
real(kind(0d0)), dimension(nm, nl), intent(inout) :: ar, ai
309+
real(kind(0d0)), dimension(igh), intent(out) :: ortr, orti
310+
311+
integer :: i, j, ml, ii, jj, la, mp, kp1, mll
301312
real(kind(0d0)) :: f, g, h, fi, fr, scale, c
302313

303-
integer mll
304314
mll = 6
305315

306316
la = igh - 1
@@ -460,11 +470,14 @@ subroutine comqr2(nm, nl, low, igh, ortr, orti, hr, hi, wr, wi, zr, zi, ierr)
460470
! this version dated october 1989.
461471
!
462472
! ------------------------------------------------------------------
463-
integer i, j, k, l, ml, nl, en, ii, jj, ll, nm, nn, igh, ip1, &
464-
itn, its, low, lp1, enm1, iend, ierr
465-
real(kind(0d0)), dimension(nm, nl) :: hr, hi, zr, zi
466-
real(kind(0d0)), dimension(nl) :: wr, wi
467-
real(kind(0d0)), dimension(igh) :: ortr, orti
473+
integer, intent(in) :: nm, nl, low, igh
474+
real(kind(0d0)), dimension(nm, nl), intent(inout) :: hr, hi
475+
real(kind(0d0)), dimension(nl), intent(out) :: wr, wi
476+
real(kind(0d0)), dimension(nm, nl), intent(out) :: zr, zi
477+
real(kind(0d0)), dimension(igh), intent(inout) :: ortr, orti
478+
integer, intent(out) :: ierr
479+
480+
integer :: i, j, k, l, ml, en, ii, jj, ll, nn, ip1, itn, its, lp1, enm1, iend
468481
real(kind(0d0)) :: si, sr, ti, tr, xi, xr, yi, yr, zzi, zzr, &
469482
norm, tst1, tst2, c, d
470483
!
@@ -843,9 +856,13 @@ subroutine cbabk2(nm, nl, low, igh, scale, ml, zr, zi)
843856
!
844857
! ------------------------------------------------------------------
845858
!
846-
integer i, j, k, ml, nl, ii, nm, igh, low
847-
double precision scale(nl), zr(nm, ml), zi(nm, ml)
848-
double precision s
859+
integer, intent(in) :: nm, nl, low, igh
860+
double precision, intent(in) :: scale(nl)
861+
integer, intent(in) :: ml
862+
double precision, intent(inout) :: zr(nm, ml), zi(nm, ml)
863+
864+
integer :: i, j, k, ii
865+
double precision :: s
849866

850867
if (ml == 0) go to 200
851868
if (igh == low) go to 120
@@ -885,7 +902,8 @@ subroutine cbabk2(nm, nl, low, igh, scale, ml, zr, zi)
885902
end subroutine cbabk2
886903

887904
subroutine csroot(xr, xi, yr, yi)
888-
real(kind(0d0)) :: xr, xi, yr, yi
905+
real(kind(0d0)), intent(in) :: xr, xi
906+
real(kind(0d0)), intent(out) :: yr, yi
889907
!
890908
! (yr,yi) = complex dsqrt(xr,xi)
891909
! branch chosen so that yr .ge. 0.0 and sign(yi) .eq. sign(xi)
@@ -904,7 +922,8 @@ subroutine csroot(xr, xi, yr, yi)
904922
end subroutine csroot
905923

906924
subroutine cdiv(ar, ai, br, bi, cr, ci)
907-
real(kind(0d0)) :: ar, ai, br, bi, cr, ci
925+
real(kind(0d0)), intent(in) :: ar, ai, br, bi
926+
real(kind(0d0)), intent(out) :: cr, ci
908927
!
909928
! complex division, (cr,ci) = (ar,ai)/(br,bi)
910929
!
@@ -921,7 +940,8 @@ subroutine cdiv(ar, ai, br, bi, cr, ci)
921940
end subroutine cdiv
922941

923942
subroutine pythag(a, b, c)
924-
real(kind(0d0)) :: a, b, c
943+
real(kind(0d0)), intent(in) :: a, b
944+
real(kind(0d0)), intent(out) :: c
925945
!
926946
! finds dsqrt(a**2+b**2) without overflow or destructive underflow
927947
!

0 commit comments

Comments
 (0)