Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dmm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Archives
dmm
Commits
86c65a62
Commit
86c65a62
authored
10 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
remove dll from slice2 and ptheta2
parent
c4708503
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.for
+2
-2
2 additions, 2 deletions
main.for
ptheta2.for
+2
-26
2 additions, 26 deletions
ptheta2.for
slice2.for
+7
-9
7 additions, 9 deletions
slice2.for
with
11 additions
and
37 deletions
main.for
+
2
−
2
View file @
86c65a62
...
...
@@ -648,7 +648,7 @@ C MCMC BURN-IN
DO it = 1,nt
IF (thetaprior(it,3).LT.thetaprior(it,4)) THEN
CALL SLICE2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk(1:nobs,:),
1 theta0,thetaprior(it,:),pdftheta(it),
pdll,
1 theta0,thetaprior(it,:),pdftheta(it),
2 NEVAL(it),theta(it))
theta0(it) = theta(it)
ENDIF
...
...
@@ -818,7 +818,7 @@ C MCMC RECORDING phase
DO it = 1,nt
IF (thetaprior(it,3).LT.thetaprior(it,4)) THEN
CALL SLICE2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk(1:nobs,:),
1 theta0,thetaprior(it,:),pdftheta(it),
pdll,
1 theta0,thetaprior(it,:),pdftheta(it),
2 NEVAL(it),theta(it))
theta0(it) = theta(it)
ENDIF
...
...
This diff is collapsed.
Click to expand it.
ptheta2.for
+
2
−
26
View file @
86c65a62
...
...
@@ -21,7 +21,7 @@ C You should have received a copy of the GNU General Public License
C along with DMM. If not, see <http://www.gnu.org/licenses/>.
C ----------------------------------------------------------------
DOUBLE PRECISION FUNCTION PTHETA2(it,nobs,d,ny,nz,nx,nu,ns,nt,
1 S,yk,theta,thetaprior,tipo
,pdll
)
1 S,yk,theta,thetaprior,tipo)
#if defined(__CYGWIN32__) || defined(_WIN32)
#ifdef __INTEL_COMPILER
USE dfwin
...
...
@@ -31,23 +31,6 @@ C ----------------------------------------------------------------
USE ISO_C_UTILITIES
USE DLFCN
#endif
INTERFACE
SUBROUTINE DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
INTEGER ny,nz,nx,nu,ns(6),nt
DOUBLE PRECISION theta(nt)
DOUBLE PRECISION c(ny,max(1,nz),ns(1)),H(ny,nx,ns(2)),
1 G(ny,nu,ns(3)),a(nx,ns(4)),F(nx,nx,ns(5)),R(nx,nu,ns(6))
END SUBROUTINE
END INTERFACE
CHARACTER*1 fittizia
#if defined(__CYGWIN32__) || defined(_WIN32)
POINTER (pdll,fittizia) ! ASSOCIATE pointer pdll alla DLL ad una varibile fittizia
POINTER (pdesign,DESIGN) ! IMPORTANT associo il puntatore pdesign alla Interface definita
#else
TYPE(C_PTR) :: pdll
TYPE(C_FUNPTR) :: pdesign=C_NULL_FUNPTR
PROCEDURE(DESIGN), POINTER :: ptrdesign=>NULL()
#endif
C INPUT
INTEGER it,nobs,d(2),ny,nz,nx,nu,ns(6),nt,S(nobs,6)
...
...
@@ -66,16 +49,9 @@ C LOCALS
C computes the log-posterior
#if defined(__CYGWIN32__) || defined(_WIN32)
pdesign = getprocaddress(pdll, "design_"C)
#if defined(ORIGDLL)
CALL DESIGN(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#else
pdesign = DLSym(pdll, 'design_'//C_NULL_CHAR)
IF(.NOT.C_ASSOCIATED(pdesign)) THEN
WRITE(*,*) ' Error in dlsym: ', C_F_STRING(DLError())
END IF
CALL C_F_PROCPOINTER(CPTR=pdesign, FPTR=ptrdesign)
CALL ptrdesign(ny,nz,nx,nu,ns,nt,theta,c,H,G,a,F,R)
#endif
CALL IKF2(d,ny,nz,nx,nu,ns,S(1:max(d(1),1),1:6),
1 yk(1:max(d(1),1),1:ny+nz),
...
...
This diff is collapsed.
Click to expand it.
slice2.for
+
7
−
9
View file @
86c65a62
...
...
@@ -22,13 +22,11 @@ C You should have received a copy of the GNU General Public License
C along with DMM. If not, see <http://www.gnu.org/licenses/>.
C -------------------------------------------------------------
SUBROUTINE SLICE2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk,
1 theta,thetaprior,tipo,
pdll,
NEVAL,XSIM)
1 theta,thetaprior,tipo,NEVAL,XSIM)
C INPUT
INTEGER it,nobs,d(2),ny,nz,nx,nu,ns(6),nt,S(nobs,6)
DOUBLE PRECISION yk(nobs,ny+nz),theta(nt),thetaprior(4)
CHARACTER*2 tipo
CHARACTER*1 fittizia
POINTER (pdll,fittizia)
C OUTPUT
INTEGER NEVAL
...
...
@@ -50,7 +48,7 @@ C THIS DEFINES THE SLICE S={x: z < ln(f(x))}
C -------------------------------------------------------
theta(it) = XOLD
FXOLD=PTHETA2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk,
1 theta,thetaprior,tipo
,pdll
)
1 theta,thetaprior,tipo)
NEVAL = NEVAL + 1
U = genunf(0.D0,1.D0)
Z = FXOLD + DLOG(U)
...
...
@@ -71,14 +69,14 @@ C U = G05CAF(U)
DO 100 WHILE(L.GT.XLB)
theta(it) = L
FXL=PTHETA2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk,
1 theta,thetaprior,tipo
,pdll
)
1 theta,thetaprior,tipo)
NEVAL = NEVAL + 1
IF (FXL.LE.Z) GOTO 110
100 L = L - W
110 DO 200 WHILE(R.LT.XUB)
theta(it) = R
FXR=PTHETA2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk,
1 theta,thetaprior,tipo
,pdll
)
1 theta,thetaprior,tipo)
NEVAL = NEVAL + 1
IF (FXR.LE.Z) GOTO 210
200 R = R + W
...
...
@@ -92,7 +90,7 @@ C U = G05CAF(U)
IF (L.LE.XLB) GOTO 310
theta(it) = L
FXL=PTHETA2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk,
1 theta,thetaprior,tipo
,pdll
)
1 theta,thetaprior,tipo)
NEVAL = NEVAL + 1
IF (FXL.LE.Z) GOTO 310
L = L - W
...
...
@@ -102,7 +100,7 @@ C U = G05CAF(U)
IF (R.GE.XLB) GOTO 410
theta(it) = R
FXR=PTHETA2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk,
1 theta,thetaprior,tipo
,pdll
)
1 theta,thetaprior,tipo)
NEVAL = NEVAL + 1
IF (FXR.LE.Z) GOTO 410
R = R + W
...
...
@@ -122,7 +120,7 @@ C U = G05CAF(U)
XSIM = L + U*(R - L)
theta(it) = XSIM
FXSIM=PTHETA2(it,nobs,d,ny,nz,nx,nu,ns,nt,S,yk,
1 theta,thetaprior,tipo
,pdll
)
1 theta,thetaprior,tipo)
NEVAL = NEVAL + 1
IF (FXSIM.GE.Z) OK = 1
IF(XSIM.GT.XOLD) THEN
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment