Commit 94d92107 authored by Tomas Verdugo's avatar Tomas Verdugo
Browse files

mamposst test0

parent 4b2e2a9c
real*8 rr1, avz1, evz1
common /Rvz/ rr1, avz1, evz1
c
c
c
integer nrbins, icsigr, MAXRBINS
parameter (MAXRBINS=51)
real*8 lnr(MAXRBINS), lsigmar(MAXRBINS), csigr(MAXRBINS,3)
real*8 phi(MAXRBINS), cphi(MAXRBINS,3)
common /CSIG/ lnr, lsigmar, csigr, phi, cphi, icsigr, nrbins
c
c
c
real*8 pi, twopi, sqrttwopi
common /CSTS/ pi, twopi, sqrttwopi
c
c
c
integer ilopflagg
real*8 Bilop, kappa
common /ILOP/ Bilop, kappa, ilopflagg
c
c
c
gfortran -m64 -c -O5 -w -std=legacy mamposstcommons.f mamposstutils.f mamposstlnlik.f
mv mam*.o ../src
c=======================================================================
c234567890
c program main
double precision function fortfunc(tt1,tt2,tt3,tt4,tt5,tt6,
1 tt7,tt8,tt9,tt10,tt11,tt12,tt13,tt14,tt15,tt16,tt17,tt18,
2 tt19,tt20,tt21,tt22,tt23,tt24,tt25,tt26,tt27,tt28,tt29,tt30,
3 tt31,tt32,tt33,tt34,tt35,tt36,tt37,tt38,tt39,tt40,tt41,tt42,
4 tt43,tt44, tt46, tt47, tt48)
c integer ii
real*8 tt1,tt2,tt3,tt4,tt5,tt6,tt7,tt8,tt9
real*8 tt10,tt11,tt12,tt13,tt14,tt15
integer tt16,tt17
real*8 tt18,tt19,tt20,tt21,tt22,tt23,tt24,tt25
integer tt26,tt27,tt28,tt29,tt30
real*8 tt31
integer tt32,tt33
cc character*16 tt38
integer tt39
real*8 tt40
BYTE tt34(17),tt35(17),tt36(17),tt37(17)
c BYTE tt38(81)
integer tt41,tt42,tt43,tt44
character*16 tt34b,tt35b,tt36b,tt37b
real*8 tt46(tt39),tt47(tt39),tt48(tt39),tt38(tt39)
c character*20 tt1
C character*30 tt2
Cc character*30 tt3
c implicit none
c=======================================================================
real*8 rr1, avz1, evz1
common /Rvz/ rr1, avz1, evz1
c
c
c
integer nrbins, icsigr, MAXRBINS
parameter (MAXRBINS=51)
real*8 lnr(MAXRBINS), lsigmar(MAXRBINS), csigr(MAXRBINS,3)
real*8 phi(MAXRBINS), cphi(MAXRBINS,3)
common /CSIG/ lnr, lsigmar, csigr, phi, cphi, icsigr, nrbins
c
c
c
real*8 pi, twopi, sqrttwopi
common /CSTS/ pi, twopi, sqrttwopi
c
c
c
integer ilopflagg
real*8 Bilop, kappa
common /ILOP/ Bilop, kappa, ilopflagg
c
c
c
real*8 atracer, adark, anispar, ranis, anispar2, rad
real*8 rcube, rfiddark, rmaxx, rhs, darkparam2
real*8 Mtraceratatr11, Mdarkatad11, MBH11
real*8 fourpideltarhocover3, rmaxdata, tracerparam2
real*8 param2, rvir, gam
integer debugg
character*16 tracermod, darkmod, anismod, v3dmod
common /MODEL/ atracer, adark, tracermod, tracerparam2, darkmod,
& anismod, param2,
& anispar, ranis, anispar2,
& rcube, rfiddark, Mtraceratatr11, Mdarkatad11,
& rmaxx, rad, MBH11, rhs, fourpideltarhocover3, rmaxdata,
& darkparam2, rvir, gam, v3dmod, debugg
c
c
c
integer iatrmax, icatr, MAXATRACER
parameter (MAXATRACER=101)
real*8 latr(MAXATRACER), lnlikatr(MAXATRACER), catr(MAXATRACER,3)
common /SPLINEATR/ latr, lnlikatr, catr, icatr, iatrmax
c
c
c real rr0,avz0,evz0,ndata0
c real rrmindata0,rrmaxdata0,rrminallow0,rrmaxallow0
c real avzmaxdata0,avzmaxallow0
c real tracermodel0,ltracerradius0,tracerpar20,ltracermass0,rfidtracer0
c real anismodel0,lanispar0,lranis20,lanispar20
c real darkmodel,norm0,darknormflag0,darkscale0,darkscaleflag0
c real darktotflag0,darkpar20
c real lbhmass0,v3dmodel0
c real Delta0,h0,Omegam0,z0
c real rmax0,MfLflag0,TLMflag0,TALflag0,splitpflag0,ninterp0
c real wt0,lBilop0,ilopflag0
c real debug0
integer ndata,numero,MAXATRACE
cc parameter (MAXATRACE=tt39)
real*8 kk(tt39),kkk(tt39),kkkk(tt39)
real*8 rr(tt39), avz(tt39), evz(tt39)
real*8 rrminallow, rrmaxallow, rrmindata, rrmaxdata
real*8 avzmaxallow, avzmaxdata, rfidtracer
real*8 ltracerradius, ltracermass
real*8 lanispar, lranis2, lanispar2
real*8 norm, darknormflag, darkscale
integer darkscaleflag
integer darktotflag
real*8 darkpar2
real*8 lbhmass,tracerpar2
real*8 Delta, h, Omegam, z
real*8 rmax
integer MfLflag,TLMflag,TALflag,splitpflag,ninterp
real*8 wt(tt39)
real*8 lBilop
real*8 UnaPrueba
integer ilopflag, debug
character*16 tracermodel, darkmodel, anismodel, v3dmodel
c No necesitamos las siguientes lineas porque ya no leeremos aqui el archivo
c real*8 PPrueba
c character*80 fileprueba
c
c write (tt38b, '(80a)') (tt38(i),i=1,tt45)
c fileprueba = tt38b
cc fileprueba = tt38
cc'1131_x.dat'
ndata = tt39
c rr(1) = 300.
c avz(1) = 1200.
c evz(1) = 100.
rrmindata = tt3
cc1.2
rrmaxdata = tt4
cc1166.
rrminallow = tt1
cc30
rrmaxallow = tt2
cc0
avzmaxdata = tt6
cc2652.
avzmaxallow = tt5
cc0
rfidtracer = tt7
cc3.16
cc tracermod = tt34
cc'NFW'
write (tt34b, '(16a)') (tt34(i),i=1,tt41)
tracermod = tt34b
tracerparam2 = tt20
cc0.71
ltracerradius = tt8
cc2.5
ltracermass = tt9
cc-99
tracerpar2 = tt20
cc71
cc anismod = tt36
cc'Tiret'
write (tt36b, '(16a)') (tt36(i),i=1,tt43)
anismod = tt36b
lanispar = tt10
cc0.
lranis2 = tt11
c-99
lanispar2 = tt12
cc0
cc darkmod = tt35
cc'NFW'
write (tt35b, '(16a)') (tt35(i),i=1,tt42)
darkmod = tt35b
norm = tt13
cc3.3
darknormflag = tt14
cc-1
darkscale = tt15
cc2.5
darkscaleflag = tt16
cc1
darktotflag = tt17
cc1
darkpar2 = tt18
cc1
lbhmass = tt19
cc-99
cc v3dmod = tt37
cc'gauss'
write (tt37b, '(16a)') (tt37(i),i=1,tt44)
v3dmod = tt37b
Delta = tt21
cc100
z = tt24
cc0.0
Omegam = tt23
cc0.3
h = tt22
cc0.7
rmax = tt25
cc40000
MfLflag = tt26
cc0
TLMflag = tt27
cc0
splitpflag = tt29
cc0
ninterp = tt30
cc0
ilopflag = tt32
cc1
lbhmass = tt19
cc-99
lBilop = tt31
cc-90
wt = tt38
ctt38
debug = tt33
cc2
cc PPrueba = 35678.
cccccccccc
cc write(6,100) Delta, v3dmod,Delta, tt37,Delta
cc100 format(f10.4,a16,f10.4,a16,f10.4)
cc write(6,110) v3dmod, v3dmod,v3dmod,v3dmod
cc110 format(a16,a16,a16,a16)
cc write(6,120) tt37,tt37,tt37,tt37
cc120 format(a16,a16,a16,a16)
cc WRITE(*,'(a,a)'),"This is the string passed from C: "
cc write(6,130) tt34b,tt34b,tt34b,tt34b
cc130 format(a16,a16,a16,a16)
c write(6,140) tt34,tt34,tt34,tt34
c140 format(a16,a16,a16,a16)
c Try running with my data file. Try latr=2.5 (log tracer radius in kpc)
c lanis=0 (isotropy) norm=3.3 (log r_vir in kpc)
c darkscale=2.5(log dark matter scale radius in kpc).
c For the other parameters use those of the input file I sent you yesterday.
c Tell me what lnlik is returned.
c Ahora no necesitamos estas dos lineas porque el archivo es leido y pasado desde C
c call nlines(fileprueba,numero)
c call leyendo(fileprueba,numero,rr,avz,evz)
rr = tt46
avz = tt47
evz = tt48
c #parameter start center, min, max, start width, propose width
c #e.g. for 2D Gaussian
c ParamNamesFile = params_mamposst_cosmo.paramnames
c param[ltracerradius] = 2.5 2 3 0.2 0.2
c param[ltracermass] = -99 -99 -99 0 0
c param[tracerpar2] = 0 0 0 0 0
c param[norm] = 3.5 3 4 0.2 0.2
c param[darkscale] = 2.5 1.5 3.5 0.5 0.5
c param[darkpar2] = 1 1 1 0 0
c param[lanispar] = 0 -0.5 1 0.15 0.15
c param[lranis2] = -99 -99 -99 0 0
c param[lanispar2] = 0 0 0 0 0
c param[lbhmass] = -99 -99 -99 0 0
c param[lBilop] = -99 -99 -99 0 0
c234567890
CALL mamposstlnlik(rr,avz,evz,ndata,rrmindata,rrmaxdata,
1 rrminallow,rrmaxallow,avzmaxdata,avzmaxallow,
2 tracermod,ltracerradius,tracerparam2,ltracermass,rfidtracer,
3 anismod,lanispar,lranis2,lanispar2,
4 darkmod,norm,darknormflag,darkscale,darkscaleflag,
5 darktotflag,darkpar2,
6 lbhmass,v3dmod,Delta,h,Omegam,z,
7 rmax,MfLflag,TLMflag,TALflag,splitpflag,ninterp,
8 wt,lBilop,ilopflag,
9 debug, tt40)
cc write(*,*) ' Este es UnaPrueba = ', tt40
c mamposstlnlik(rr,avz,evz,ndata,
c . rrmindata,rrmaxdata,rrminallow,rrmaxallow,
c . avzmaxdata,avzmaxallow,
c . tracermod,ltracerradius,tracerparam2,ltracermass,rfidtracer,
c . anismod,lanispar,lranis2,lanispar2,
c . darkmod,norm,darknormflag,darkscale,darkscaleflag,
c . darktotflag,darkpar2,
c . lbhmass,v3dmodel,
c . Delta,h,Omegam,z,
c . rmax,MfLflag,TLMflag,TALflag,splitpflag,ninterp,
c . wt,lBilop,ilopflag,
c . debug)
c PRINT '(A)', 'caca'
c print *,' h prueba = ', h
c write(*,*) ' darkmodel = ', darkmod
c write(*,*) ' tracermod = ', tracermod
c STOP
c
return
end
c=======================================================================
c=======================================================================
This diff is collapsed.
This diff is collapsed.
real*8 atracer, adark, anispar, ranis, anispar2, rad
real*8 rcube, rfiddark, rmaxx, rhs, darkparam2
real*8 Mtraceratatr11, Mdarkatad11, MBH11
real*8 fourpideltarhocover3, rmaxdata, tracerparam2
real*8 param2, rvir, gam
integer debugg
character*16 tracermod, darkmod, anismod, v3dmod
common /MODEL/ atracer, adark, tracermod, tracerparam2, darkmod,
& anismod, param2,
& anispar, ranis, anispar2,
& rcube, rfiddark, Mtraceratatr11, Mdarkatad11,
& rmaxx, rad, MBH11, rhs, fourpideltarhocover3, rmaxdata,
& darkparam2, rvir, gam, v3dmod, debugg
c
c
c
integer iatrmax, icatr, MAXATRACER
parameter (MAXATRACER=101)
real*8 latr(MAXATRACER), lnlikatr(MAXATRACER), catr(MAXATRACER,3)
common /SPLINEATR/ latr, lnlikatr, catr, icatr, iatrmax
c
c
c
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment