-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm_shift.f90
83 lines (66 loc) · 1.51 KB
/
m_shift.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
!----------------------------------------------------------------------
! MELQUIADES: Metropolis Monte Carlo Program
!----------------------------------------------------------------------
!bop
!
! !Module: m_shift
!
! !Description: This module contains a routine for volume shifted!\\
!\\
! !Interface:
!
module m_shift
!
! !Uses
use m_kind
use m_boxtype
use m_simtype
use m_unit
!
! !Public member functions:
private
public :: r_shift
!
! ! Revision history:
! ! 12Nov 2015 Asdrubal Lozada
!
!eop
!-----------------------------------------------
contains
!
!bop
!
! !Iroutine: r_shift
!
! !Description: Shifted volume
!\\
!\\
! !Interface:
subroutine r_shift( edge, iter, y, x )
implicit none
! Dummy arguments
type(box), pointer :: x
type(simulation), intent(inout) :: y
real(rkind) :: dv, vol, edgen
real(rkind), dimension(:), intent(inout) :: edge
integer, intent(inout) :: iter
if( y%m_drho > 0.0_rkind .and. y%m_drho <= 1.0_rkind ) then
iter = iter - 0.05
dv = y%m_vol * (1.0_rkind - y%m_drho ) / y%m_drho
vol = y%m_vol + iter * dv
edgen = dlog(vol) / 3.0_rkind
edgen = dexp(edgen)
edge(1) = edgen
edge(2) = edgen
edge(3) = edgen
x%m_edge(1) = edge(1)
x%m_edge(2) = edge(1)
x%m_edge(3) = edge(1)
y%m_dens = real(y%m_mxmol,rkind) * (1.0_rkind/vol)
y%m_voli = 1.0_rkind/vol
write(*,*)'edge var: ', y%m_drho, dv, edge(1)
else
continue
end if
end subroutine r_shift
end module m_shift