forked from mjlaine/mcmcf90
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmcmc_main.F90
75 lines (55 loc) · 1.39 KB
/
mcmc_main.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
!!! $Id: mcmc_main.F90,v 1.19 2012/07/03 10:57:34 mjlaine Exp $
!!! ------------------------------------------------------------------------
!!! mcmc library
!!! File: mcmc_main.F90
!!! Purpose: main program (as a subroutine) for standalone MCMC code
!!!
!!! Marko Laine 2008 <[email protected]>
!!! Copyrights licensed under a MIT License.
!!! See the accompanying LICENSE.txt file for terms.
!!!
!!!
subroutine mcmc_main()
use mcmcmod
implicit none
integer(4) fstatus
write(*,*) 'MCMC code version: ',Mcmc_Code_Version
call MCMC_init()
if ( nsimu <= 0 ) then
write(*,*) 'nsimu <= 0 stopping'
stop
end if
MCMC_running = 1
if (method == 'scam') then
call MCMC_run_scam()
elseif (method == 'er') then
call MCMC_run_er()
elseif (method == 'ram') then
call MCMC_run_ram()
else
call MCMC_run()
end if
MCMC_running = 0
call MCMC_writechains(fstatus)
call MCMC_cleanup(fstatus)
end subroutine mcmc_main
!!!
!!! For consecutive one time runs with MCMC_run1
!!!
subroutine mcmc_main_one()
use mcmcmod
implicit none
integer(4) fstatus
write(*,*) 'MCMC code version: ',Mcmc_Code_Version
call MCMC_init()
if ( nsimu <= 0 ) then
stop 'nsimu <= 0'
end if
if (method == 'er') then
call MCMC_run1_er()
else
call MCMC_run1()
end if
call MCMC_writechains(fstatus)
call MCMC_cleanup(fstatus)
end subroutine mcmc_main_one