BraWl
Loading...
Searching...
No Matches
metropolis_output Module Reference

Functions/Subroutines

subroutine, public energy_trajectory_writer (filename, step_number, energy)
 Subroutine to write energy of a Metropolis simulation trajectory to a plain text file.
 
subroutine, public asro_trajectory_writer (filename, step_number, asro)
 Subroutine to write ASRO of a Metropolis simulation trajectory to a plain text file.
 
subroutine, public diagnostics_writer (filename, temps, energies, c, acceptance)
 Subroutine to write outputs of a Metropolis simulation to plain text file.
 

Function/Subroutine Documentation

◆ asro_trajectory_writer()

subroutine, public metropolis_output::asro_trajectory_writer ( character(len=*), intent(in) filename,
integer step_number,
real(real64), dimension(:,:,:) asro )

Subroutine to write ASRO of a Metropolis simulation trajectory to a plain text file.

Author
C. D. Woodgate
Date
2019-2025
Parameters
filenameName of file to which to write
step_numberIndex of current MC trial step
energySimulation energy to write
Returns
None

Definition at line 66 of file metropolis_output.f90.

67
68 character(len=*), intent(in) :: filename
69 integer :: step_number, i, j, k
70 integer, dimension(3) :: asro_size
71 real(real64), dimension(:,:,:) :: asro
72 logical :: exist
73
74 asro_size = shape(asro)
75
76 inquire(file=filename, exist=exist)
77 if (exist) then
78 open(7, file=filename, status="old", position="append", action="write")
79 else
80 open(7, file=filename, status="new", action="write")
81 write(7, *) '# step_number ASRO'
82 end if
83
84 write(7,"(I13,x,f20.10,x)", advance='no') step_number
85
86 do k=1, asro_size(3)
87 do j=1, asro_size(2)
88 do i=1, asro_size(1)
89 write(7,"(f8.5,x)", advance='no') asro(i,j,k)
90 end do
91 end do
92 end do
93
94 write(7,"(x)", advance='yes')
95
96 close(7)
97

◆ diagnostics_writer()

subroutine, public metropolis_output::diagnostics_writer ( character(len=*), intent(in) filename,
real(real64), dimension(:), intent(in), allocatable temps,
real(real64), dimension(:), intent(in), allocatable energies,
real(real64), dimension(:), intent(in), allocatable c,
real(real64), dimension(:), intent(in), allocatable acceptance )

Subroutine to write outputs of a Metropolis simulation to plain text file.

Author
C. D. Woodgate
Date
2019-2025
Parameters
filenameName of file to which to write
tempsArray of simulation temperatures
energiesArray of simulation energies
CArray of simulation heat capacities
acceptanceArray of simulation heat capacities
Returns
None

Definition at line 113 of file metropolis_output.f90.

114
115 ! Filename to which to write
116 character(len=*), intent(in) :: filename
117
118 real(real64), allocatable, dimension(:), intent(in) :: &
119 temps, energies, C, acceptance
120
121 integer :: i, n_steps
122
123 n_steps = size(energies)
124
125 open(unit=7, file=filename)
126
127 write(7, *) '# T E C acceptance_rate'
128
129 do i=1, n_steps
130 write(7,'(F8.1,2X,F24.15,2X,F24.15,2X,F6.4)') temps(i), energies(i), c(i), acceptance(i)
131 end do
132
133 close(7)
134

◆ energy_trajectory_writer()

subroutine, public metropolis_output::energy_trajectory_writer ( character(len=*), intent(in) filename,
integer step_number,
real(real64) energy )

Subroutine to write energy of a Metropolis simulation trajectory to a plain text file.

Author
C. D. Woodgate
Date
2019-2025
Parameters
filenameName of file to which to write
step_numberIndex of current MC trial step
energySimulation energy to write
Returns
None

Definition at line 34 of file metropolis_output.f90.

35
36 character(len=*), intent(in) :: filename
37 integer :: step_number
38 real(real64) :: energy
39 logical :: exist
40
41 inquire(file=filename, exist=exist)
42 if (exist) then
43 open(7, file=filename, status="old", position="append", action="write")
44 else
45 open(7, file=filename, status="new", action="write")
46 write(7, *) '# step_number E'
47 end if
48
49 write(7,"(I13,x,f20.10,x)") step_number, energy
50
51 close(7)
52