43 subroutine examples(setup, metropolis, my_rank)
46 integer,
intent(in) :: my_rank
55 integer :: i,j, div_steps, accept, n_save
58 real(real64) :: beta, temp, sim_temp, current_energy, step_E, &
59 step_Esq, C, acceptance
62 character(len=36) :: xyz_file
65 character(len=43) :: diagnostics_file
68 character(len=37) :: radial_file
71 real(real64),
allocatable,
dimension(:,:,:) :: r_densities
79 if (metropolis%nbr_swap)
then
80 setup%mc_step => monte_carlo_step_nbr
82 setup%mc_step => monte_carlo_step_lattice
95 call initial_setup(setup,
config)
99 print*,
' This is what the grid initially looks like: '
114 temp = metropolis%T + real(j-1, real64)*metropolis%delta_T
115 sim_temp = temp*k_b_in_ry
116 beta = 1.0_real64/sim_temp
120 do while (accept .lt. 0.5_real64)
121 accept = setup%mc_step(
config, beta)
124 if(my_rank == 0)
then
126 print*,
' This is what the grid looks like after one successful step: '
136 current_energy = setup%full_energy(
config)
138 if(my_rank == 0)
then
140 print*,
' The energy of that configuration is: ', current_energy,
' Ry'
141 print*,
' or: ', current_energy*13.606*1000.0,
' meV'
142 print*,
' or: ', current_energy*13.606*1000.0/setup%n_atoms,
' meV/atom'
149 n_save=floor(real(metropolis%n_mc_steps)/real(metropolis%n_sample_steps))
151 acceptance = 0.0_real64
153 step_esq = 0.0_real64
155 do i=1, metropolis%n_mc_steps
158 accept = setup%mc_step(
config, beta)
160 acceptance = acceptance + accept
163 if (mod(i, metropolis%n_sample_steps) .eq. 0)
then
164 current_energy = setup%full_energy(
config)
165 step_e = step_e + current_energy
166 step_esq = step_esq + current_energy**2
175 c = (step_esq/n_save - (step_e/n_save)**2)/(sim_temp*temp)/setup%n_atoms
183 if (my_rank ==0)
then
185 write(6,
'(a,f7.2,a)',advance=
'yes') &
186 " Temperature ", temp,
" complete on process 0."
187 write(6,
'(a,f7.2,a)',advance=
'yes') &
188 " Internal energy was ", 13.606_real64*1000*
energies_of_t(j),
" meV/atom"
189 write(6,
'(a,f9.4,a)',advance=
'yes') &
190 " Heat capacity was ",
c_of_t(j)/k_b_in_ry,
" kB/atom"
191 write(6,
'(a,f7.2,a,/)',advance=
'yes') &
199 write(xyz_file,
'(A11 I3.3 A12 I4.4 F2.1 A4)')
'configs/proc_', &
200 my_rank,
'config_at_T_', int(temp), temp-int(temp),
'.xyz'
215 write(radial_file,
'(A,I3.3,A)')
'asro/proc_', my_rank,
'_rho_of_T.nc'
220 if(my_rank == 0)
then
221 write(6,
'(25("-"),x,"Simulation Complete!",x,25("-"))')
real(real64) function, dimension(setup%n_species, setup%n_species, n_shells), public radial_densities(setup, configuration, n_shells, shell_distances)
Subroutine to compute radial densities (ASRO parameters)
subroutine, public display_grid(grid, show_borders, title)
Subroutine to print the current state of the grid to the screen, layer by layer.
subroutine, public ncdf_radial_density_writer_once(filename, rho, r, setup)
Routine to write radial density (calculated once) to file.