Skip to content

Commit

Permalink
Couple of minor cosmetic edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-P-Allen committed Aug 11, 2024
1 parent 8e8937a commit 4b8803a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When using or citing the software, you should not imply endorsement by the autho

## Language
The programs contain some explanatory comments,
and are written, in the main, in Fortran 2003/2008.
and are written, in the main, in Fortran 2003/2008/2018.
This has some advantages: a built-in syntax for array operations,
a straightforward approach to modular programming, and a basic simplicity.
It is also a compiled language, which means that it is quite efficient,
Expand Down Expand Up @@ -59,7 +59,7 @@ A few examples consist of individual routines or modules,
rather than working programs,
so there is no need to build them.

The build process for the Fortran examples has been tested using SCons v4.6.0
The build process for the Fortran examples has been tested using SCons v4.8.0
(and some earlier versions back to v2.5.1 with minor changes to the `SConstruct` file).

If you don't like using SCons, or can't get it to work,
Expand All @@ -79,7 +79,7 @@ it is advisable to __compile each example in its own build directory__
or to delete all intermediate files before each individual compilation.

We have used gfortran v13.2.0 (and earlier versions back to v6.3) for testing,
but have attempted to stick to code which conforms to the Fortran 2008 standard.
but have attempted to stick to code which conforms to the Fortran 2018 standard.
Note that, by default, we do not select any optimization options in compilation.
If you are using a different compiler,
then the compiler and linker options in the `SConstruct` file will most likely need changing.
Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import os, sys
# we cannot offer more specific advice on the build process.

# NB by default we do not invoke any optimization
MY_FLAGS='-fdefault-real-8 -fall-intrinsics -std=f2008 -Wall'
MY_FLAGS='-fdefault-real-8 -fall-intrinsics -std=f2018 -Wall'
LAPACK_LIBPATH='/opt/local/lib/lapack'
LAPACK_LIBS='lapack'
FFTW_LIBPATH='/opt/local/lib'
Expand Down
2 changes: 1 addition & 1 deletion md_chain_lj_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ SUBROUTINE rattle_b ( dt, bond, wc ) ! Second part of velocity Verlet with const
LOGICAL :: done
REAL :: dot, g
INTEGER :: i, j, iter
REAL, PARAMETER :: tol = 1.0e-9, tol2 = 2.0 * tol, dot_tol = 1.0e-9
REAL, PARAMETER :: tol = 1.0e-9
INTEGER, PARAMETER :: iter_max = 500

iter = 0
Expand Down
16 changes: 7 additions & 9 deletions md_lj_mts.f90
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,15 @@ PROGRAM md_lj_mts
WRITE ( unit=error_unit, fmt='(a,*(i15))' ) 'n_mts values must be positive', n_mts
STOP 'Error in md_lj_mts'
END IF
DO k = 1, k_max
dt(1) = dt1 ! n_mts(1) equals 1
vol_shell(1) = (4.0/3.0)*pi * r_cut(1)**3
DO k = 2, k_max
dt(k) = PRODUCT(n_mts(1:k))*dt1 ! Define time steps cumulatively
IF ( k == 1 ) THEN
vol_shell(k) = (4.0/3.0)*pi * r_cut(k)**3
ELSE
IF ( r_cut(k)-r_cut(k-1) < lambda ) THEN
WRITE ( unit=error_unit, fmt='(a,3f15.6)' ) 'r_cut interval error', r_cut(k-1), r_cut(k), lambda
STOP 'Error in md_lj_mts'
END IF
vol_shell(k) = (4.0/3.0)*pi * ( r_cut(k)**3 - r_cut(k-1)**3 )
IF ( r_cut(k)-r_cut(k-1) < lambda ) THEN
WRITE ( unit=error_unit, fmt='(a,3f15.6)' ) 'r_cut interval error', r_cut(k-1), r_cut(k), lambda
STOP 'Error in md_lj_mts'
END IF
vol_shell(k) = (4.0/3.0)*pi * ( r_cut(k)**3 - r_cut(k-1)**3 )
END DO
WRITE ( unit=output_unit, fmt='(a,t40,*(f15.6))' ) 'Time step for each shell', dt(:)
WRITE ( unit=output_unit, fmt='(a,t40,*(f15.6))' ) 'Volume of each shell', vol_shell(:)
Expand Down

0 comments on commit 4b8803a

Please sign in to comment.