Only in cosmomc_fields/camb: binfspline.f90
diff -r -c -b -B -B cosmomc/camb/cmbmain.f90 cosmomc_fields/camb/cmbmain.f90
*** cosmomc/camb/cmbmain.f90	2010-01-27 11:54:17.000000000 +0100
--- cosmomc_fields/camb/cmbmain.f90	2010-01-29 14:24:27.488696490 +0100
***************
*** 1933,1944 ****
           integer, intent(in) :: numks, pix
           real(dl) pows(numks), ks(numks)
           integer i
!       
           do i = 1, numks
           !!change to vec...
              pows(i) =  ScalarPower(ks(i) ,pix)
           end do
! 
          end subroutine GetInitPowerArrayVec
  
  
--- 1933,1949 ----
           integer, intent(in) :: numks, pix
           real(dl) pows(numks), ks(numks)
           integer i
! !fields
! !$omp parallel do &
! !$omp default(shared) &
! !$omp private(i) &
! !$omp schedule(dynamic)      
           do i = 1, numks
           !!change to vec...
              pows(i) =  ScalarPower(ks(i) ,pix)
           end do
! !$omp end parallel do
! !end fields
          end subroutine GetInitPowerArrayVec
  
  
***************
*** 1946,1956 ****
           integer, intent(in) :: numks, pix
           real(dl) pows(numks), ks(numks)
           integer i
!       
           do i = 1, numks
              pows(i) =  TensorPower(ks(i) ,pix)
           end do
! 
          end subroutine GetInitPowerArrayTens
  
  
--- 1951,1966 ----
           integer, intent(in) :: numks, pix
           real(dl) pows(numks), ks(numks)
           integer i
! !fields
! !$omp parallel do &
! !$omp default(shared) &
! !$omp private(i) &
! !$omp schedule(dynamic)     
           do i = 1, numks
              pows(i) =  TensorPower(ks(i) ,pix)
           end do
! !$omp end parallel do
! !end fields
          end subroutine GetInitPowerArrayTens
  
  
***************
*** 1966,1972 ****
  
  
           do pix=1,CP%InitPower%nn
! 
            do q_ix = 1, CTrans%q%npoints 
  
               if (CP%flat) then
--- 1976,1986 ----
  
  
           do pix=1,CP%InitPower%nn
! !field: calling ScalarPower is time consumming when it comes from inflation code. Better to parallelise
! !$omp parallel do &
! !$omp default(shared) &
! !$omp private(q_ix) &
! !$omp schedule(dynamic,1)
            do q_ix = 1, CTrans%q%npoints 
  
               if (CP%flat) then
***************
*** 1981,1987 ****
  
        
            end do
! 
  
          !$OMP PARAllEl DO DEFAUlT(SHARED),SCHEDUlE(STATIC,4) &
          !$OMP & PRIVATE(j,q_ix,dlnk,apowers,ctnorm,dbletmp)
--- 1995,2002 ----
  
        
            end do
! !$omp end parallel do
! !end field
  
          !$OMP PARAllEl DO DEFAUlT(SHARED),SCHEDUlE(STATIC,4) &
          !$OMP & PRIVATE(j,q_ix,dlnk,apowers,ctnorm,dbletmp)
Only in cosmomc_fields/camb: infbackmain.f90
Only in cosmomc_fields/camb: infbg.f90
Only in cosmomc_fields/camb: infbgmodel.f90
Only in cosmomc_fields/camb: infbgspline.f90
Only in cosmomc_fields/camb: infinout.f90
Only in cosmomc_fields/camb: infpert.f90
Only in cosmomc_fields/camb: infpowspline.f90
Only in cosmomc_fields/camb: infprec.f90
Only in cosmomc_fields/camb: infsrmodel.f90
Only in cosmomc_fields/camb: inftools.f90
Only in cosmomc_fields/camb: inftools.h
Only in cosmomc_fields/camb: inftorad.f90
diff -r -c -b -B -B cosmomc/camb/inidriver.F90 cosmomc_fields/camb/inidriver.F90
*** cosmomc/camb/inidriver.F90	2009-12-15 16:34:40.000000000 +0100
--- cosmomc_fields/camb/inidriver.F90	2010-01-29 14:24:39.148698034 +0100
***************
*** 302,307 ****
--- 302,311 ----
  
          call CAMB_cleanup             
    
+ !fields
+         call FreePowers(P%InitPower) 
+ !end fields             
+   
          end program driver
  
  
diff -r -c -b -B -B cosmomc/camb/Makefile cosmomc_fields/camb/Makefile
*** cosmomc/camb/Makefile	2009-10-22 15:59:31.000000000 +0200
--- cosmomc_fields/camb/Makefile	2010-01-29 14:24:50.781197986 +0100
***************
*** 1,69 ****
! #CAMB Makefile
  
! #Edit for your compiler
! #Note there are many ifc versions, some of which behave oddly
  
! #Intel , -openmp toggles mutli-processor:
! #note version 10.0 gives wrong result for lensed when compiled with -openmp [fixed in 10.1]
! F90C     = ifort
! FFLAGS = -openmp -O2 -ip -W0 -WB -fpp2 -vec_report0
! 
! # Intel 9 on IA-64 (eg. COSMOS)
! # (do "module load icomp90" before compiling)
! #F90C = ifort
! #FFLAGS = -openmp -fpp2 -w -O3 -ip -mP2OPT_hlo_prefetch=F
! 
! #Intel ifc, add -openmp for multi-processor (some have bugs):
! #F90C     = ifc
! #FFLAGS = -O2 -Vaxlib -ip -W0 -WB -quiet -fpp2
! #some systems can can also add e.g. -tpp7 -xW
! 
! #G95 compiler
! #F90C   = g95
! #FFLAGS = -O2
! 
! #Gfortran compiler: if pre v4.3 add -D__GFORTRAN__
! #F90C     = gfc
! #FFLAGS =  -O2 
! 
! #SGI, -mp toggles multi-processor. Use -O2 if -Ofast gives problems.
! #F90C     = f90
! #FFLAGS  = -Ofast -mp
! 
! #Digital/Compaq fortran, -omp toggles multi-processor
! #F90C    = f90
! #FFLAGS  = -omp -O4 -arch host -math_library fast -tune host -fpe1
! 
! #Absoft ProFortran, single processor:
! #F90C     = f95
! #FFLAGS = -O2 -cpu:athlon -s -lU77 -w -YEXT_NAMES="LCS" -YEXT_SFX="_"
! 
! #NAGF95, single processor:
! #F90C     = f95
! #FFLAGS = -DNAGF95 -O3
! 
! #PGF90
! #F90C = pgf90
! #FFLAGS = -O2 -DESCAPEBACKSLASH
! 
! #Sun V880
! #F90C = mpf90
! #FFLAGS =  -O4 -openmp -ftrap=%none -dalign -DMPI
! 
! #Sun parallel enterprise:
! #F90C     = f95
! #FFLAGS =  -O2 -xarch=native64 -openmp -ftrap=%none
! #try removing -openmp if get bus errors. -03, -04 etc are dodgy.
! 
! #IBM XL Fortran, multi-processor (run gmake)
! #F90C     = xlf90_r
! #FFLAGS  = -DESCAPEBACKSLASH -DIBMXL -qsmp=omp -qsuffix=f=f90:cpp=F90 -O3 -qstrict -qarch=pwr3 -qtune=pwr3
  
  #Settings for building camb_fits
  #Location of FITSIO and name of library
! FITSDIR       = /home/cpac/cpac-tools/lib
  FITSLIB       = cfitsio
  #Location of HEALPIX for building camb_fits
! HEALPIXDIR    = /home/cpac/cpac-tools/healpix
  
- include ./Makefile_main
\ No newline at end of file
--- 1,109 ----
! # >>> DESIGNED FOR GMAKE <<<
! #CAMB System unified Makefile
  
! ext=$(shell uname | cut -c1-3)
  
! ifeq ($(ext),IRI)
! F90C=f90
! FFLAGS = -Ofast=ip35 -n32
! endif
! 
! ifeq ($(ext),Lin)
! F90C=gfortran
! FFLAGS= -O -fopenmp #-D__GFORTRAN__
! endif 
! 
! ifeq ($(ext),OSF)
! F90C=f90
! FFLAGS= -omp -O -arch host -math_library fast -tune host -fpe1
! endif
! 
! ifeq ($(ext),Sun)
! F90C=f90
! FFLAGS= -O4 -xarch=native64 -openmp -ftrap=%none
! endif
! 
! ifeq ($(ext),AIX)
! F90C=xlf90_r
! FFLAGS= -O4 -q64 -qsmp=omp -qmaxmem=-1 -qstrict -qfree=f90 -qsuffix=f=f90:cpp=F90
! endif
! 
! 
! #Files containing evolution equations initial power spectrum module
! EQUATIONS     = equations
! POWERSPECTRUM = power_inf
! REIONIZATION = reionization
! RECOMBINATION = recfast
! 
! #inf module
! INFOBJ       = infprec.o binfspline.o specialinf.o infinout.o inftools.o infbgmodel.o infsrmodel.o infbg.o infbgspline.o inftorad.o infpert.o infpowspline.o
! 
! #Module doing non-linear scaling
! NONLINEAR     = halofit
! 
! #Driver program
! DRIVER        = inidriver.F90
! #DRIVER        = sigma8.f90
! #DRIVER        = tester.f90
  
  #Settings for building camb_fits
  #Location of FITSIO and name of library
! FITSDIR       = /usr
  FITSLIB       = cfitsio
  #Location of HEALPIX for building camb_fits
! HEALPIXDIR    = /usr
! 
! CAMBLIB       = libcamb.a
! INFLIB	      = libinf.a
! 
! #Shouldn't need to change anything else...
! 
! F90FLAGS      = $(FFLAGS)
! HEALPIXLD     = -L$(HEALPIXDIR)/lib -lhealpix -L$(FITSDIR) -l$(FITSLIB)
! FC            = $(F90C)
! 
! CAMBOBJ       = constants.o utils.o subroutines.o inifile.o $(POWERSPECTRUM).o\
! 	$(RECOMBINATION).o $(REIONIZATION).o modules.o \
! 	bessels.o $(EQUATIONS).o $(NONLINEAR).o lensing.o cmbmain.o camb.o
! 
! 
! default: camb.$(ext)
! 
! all: camb.$(ext) $(CAMBLIB) $(INFLIB)
! 
! 
! subroutines.o: constants.o utils.o
! $(POWERSPECTRUM): subroutines.o  inifile.o
! $(RECOMBINATION).o: subroutines.o inifile.o
! $(REIONIZATION).o: constants.o inifile.o
! modules.o: $(REIONIZATION).o
! bessels.o: modules.o
! $(EQUATIONS): bessels.o
! $(NONLINEAR).o:  modules.o
! lensing.o: bessels.o
! cmbmain.o: lensing.o
! camb.o: cmbmain.o
! 
! 
! camb.$(ext): $(INFOBJ) $(CAMBOBJ) $(DRIVER)
! 	$(F90C) $(F90FLAGS) $(INFOBJ) $(CAMBOBJ) $(DRIVER) -o $@
! 
! $(CAMBLIB): $(CAMBOBJ)
! 	ar -r $@ $?
! 
! $(INFLIB): $(INFOBJ)
! 	ar -r $@ $?
! 
! camb_fits.$(ext): writefits.f90 $(CAMBOBJ) $(DRIVER)
! 	$(F90C) $(F90FLAGS) -I$(HEALPIXDIR)/include $(CAMBOBJ) writefits.f90 $(DRIVER) $(HEALPIXLD) -DWRITE_FITS -o $@
! 
! %.o: %.f90
! 	$(F90C) $(F90FLAGS) -c $*.f90
! 
! utils.o:
! 	$(F90C) $(F90FLAGS) -c utils.F90	
! 
! clean:
! 	-rm -f *.o *.a *.d core *.mod
! 
  
diff -r -c -b -B -B cosmomc/camb/params.ini cosmomc_fields/camb/params.ini
*** cosmomc/camb/params.ini	2010-01-26 19:42:44.000000000 +0100
--- cosmomc_fields/camb/params.ini	2010-01-29 14:25:56.472697781 +0100
***************
*** 1,12 ****
! #Parameters for CAMB
  
  #output_root is prefixed to output file names
! output_root = test
  
  #What to do
  get_scalar_cls = T
  get_vector_cls = F
! get_tensor_cls = F
  get_transfer   = F
  
  #if do_lensing then scalar_output_file contains additional columns of l^4 C_l^{pp} and l^3 C_l^{pT}
--- 1,12 ----
! xx#Parameters for CAMB
  
  #output_root is prefixed to output file names
! output_root = fields
  
  #What to do
  get_scalar_cls = T
  get_vector_cls = F
! get_tensor_cls = T
  get_transfer   = F
  
  #if do_lensing then scalar_output_file contains additional columns of l^4 C_l^{pp} and l^3 C_l^{pT}
***************
*** 63,81 ****
  #Fraction of total omega_nu h^2 accounted for by each eigenstate, eg. 0.5 0.5
  nu_mass_fractions = 1
  
- #Initial power spectrum, amplitude, spectral index and running. Pivot k in Mpc^{-1}.
- initial_power_num         = 1
- pivot_scalar              = 0.05
- pivot_tensor              = 0.05
- scalar_amp(1)             = 2.1e-9
- scalar_spectral_index(1)  = 0.96
- scalar_nrun(1)            = 0
- tensor_spectral_index(1)  = 0
- #ratio is that of the initial tens/scal power spectrum amplitudes
- initial_ratio(1)          = 1
- #note vector modes use the scalar settings above
- 
- 
  #Reionization, ignored unless reionization = T, re_redshift measures where x_e=0.5
  reionization         = T
  
--- 63,68 ----
***************
*** 96,101 ****
--- 83,145 ----
  RECFAST_Heswitch = 6
  RECFAST_Hswitch  = T
  
+ #inflationary model parameters (see infbgmodel.f90)
+ #param(1)=M; param(2)=p; param(3)=nu; param(4)=mu, param(5)=q
+ #largef:      V = M^4 phi^p                              p > 0
+ #smallf:      V = M^4 [1 - (phi/mu)^p]                   p > 2
+ #hybrid:      V = M^4 [1 + (phi/mu)^p]
+ #runmas:      V = M^4 {1 + nu [1/p + ln(phi/mu)]phi^p}          
+ #kklmmt:      V = M^4 [1 - q (phi/mu)^-p]^q              p > 0; q=+-1   
+ 
+ #number of read parameters
+ inf_param_number     = 7
+ 
+ #should be consistent with the above defs
+ inf_model_name       = largef
+ inf_param(1)         = 1
+ inf_param(2)         = 2
+ inf_param(3)         = 0
+ inf_param(4)         = 0
+ inf_param(5)         = 1
+ 
+ 
+ #Hard prior that reject models with field values greater that
+ #field_bound. May be used for keeping models out of the
+ #self-reproducing regime, or constrain the branes to be inside the
+ #throat. In unit of kappa
+ inf_check_bound      = F
+ inf_param(6)         = 0
+ 
+ 
+ #stops artificially inflation for this matter field value.  Unit of
+ #kappa for large field and running mass; unit of mu for small fields
+ #and kklmmt; unit of a maximal field value that gives 120 efolds of
+ #hybrid inflation
+ inf_check_stop       = F
+ inf_param(7)         = 0
+ 
+ #initial fields value. Unit of kappa for large field and running; unit
+ #of mu for small field, hybrid and kklmmt. For inf_matter = 0, uses
+ #a slow-roll approximation to guess the relevant values
+ inf_conform(1) = 1
+ inf_matter(1) = 0
+ 
+ #This is ln(aend/areh) - 1/4 ln(rhoreh kappa^4) + 1/2 ln(rhoend kappa^4)
+ inf_ln_reheat       = 0
+ 
+ 
+ #speed up A LOT the computations (only for featureless power spectra)
+ power_spectra_spline = T
+ 
+ #if false then every k required are computed from their quantum birth
+ #during the inflationary era. Otherwise, only a few of them are
+ #computed and the others interpolated. The following parameters set
+ #the range and number (ln=log base e)
+ spline_lnkmpc_min   = -14
+ spline_lnkmpc_max   = 0
+ spline_lnkmpc_num   = 12
+ 
+ 
  #Initial scalar perturbation mode (adiabatic=1, CDM iso=2, Baryon iso=3, 
  # neutrino density iso =4, neutrino velocity iso = 5) 
  initial_condition   = 1
Only in cosmomc_fields/camb: power_inf.f90
Only in cosmomc_fields/camb: specialinf.f90
diff -r -c -b -B -B cosmomc/distparams.ini cosmomc_fields/distparams.ini
*** cosmomc/distparams.ini	2009-09-17 15:14:51.000000000 +0200
--- cosmomc_fields/distparams.ini	2010-01-29 14:32:12.436939263 +0100
***************
*** 100,106 ****
  
  #Parameters to use. If zero use all parameters which have lables.
  plotparams_num = 0
! plotparams = omegabh2 omegadmh2 tau ns
  
  #Get set label to empty to not include a parameter in the parameter_names file
  #lab[asz]=
--- 100,106 ----
  
  #Parameters to use. If zero use all parameters which have lables.
  plotparams_num = 0
! plotparams = omegabh2 omegadmh2 tau ns p mu nu q lnR Xend Xstop lnA asz
  
  #Get set label to empty to not include a parameter in the parameter_names file
  #lab[asz]=
diff -r -c -b -B -B cosmomc/params_CMB.paramnames cosmomc_fields/params_CMB.paramnames
*** cosmomc/params_CMB.paramnames	2009-09-17 17:47:04.000000000 +0200
--- cosmomc_fields/params_CMB.paramnames	2009-10-28 16:16:05.692218134 +0100
***************
*** 5,14 ****
  omegak        \Omega_K
  fnu           f_\nu		#neutrino energy density as fraction of omegadmh2
  w             w			#constant equation of state parameter for scalar field dark energy 
! ns            n_s		#beware that pivot scale can change in .ini file
! nt            n_t
! nrun          n_{run}
! logA          log[10^{10} A_s]
  r             r			#ratio of tensor to scalar primordial amplitudes at pivot scale
  asz           A_{SZ}		#SZ template amplitude, as in WMAP
  omegal*       \Omega_\Lambda
--- 5,20 ----
  omegak        \Omega_K
  fnu           f_\nu			#neutrino energy density as fraction of omegadmh2
  w             w				#constant equation of state parameter for scalar field dark energy 
! Aini	      A_{ini}			#initial conformal factor in the Einstein frame
! Xini	      \kappa\chi_{ini}		#initiai field value
! p	      p	     			#potential parameter p
! mu	      \mu			#potential parameter mu
! nu	      \nu			#potential parameter nu
! q 	      q				#potential parameter q
! lnR	      ln(R)			#reheating parameter
! Xend	      \kappa\chi_{uv}		#bound on fields values
! Xstop	      \kappa\chi_{stop}		#force inflation to stop at this fied value
! lnA           ln[10^{10} P_*]		#scalar power spectrum amplitude
  r             r				#ratio of tensor to scalar primordial amplitudes at pivot scale
  asz           A_{SZ}			#SZ template amplitude, as in WMAP
  omegal*       \Omega_\Lambda
***************
*** 18,20 ****
--- 24,31 ----
  zrei*         z_{re}
  r10*          r_{10}			#tensor-scalar C_l amplitude at l=10
  H0*           H_0			#hubble parameter is H0 km/s/Mpc
+ logM*	      log(M)			#potential normalisation
+ lnRrad*	      ln(R_{rad})		#derived reheating parameter ln(a_{end}/a_{reh}) - 1/4 ln(\rho_{reh}/\rho_{end})
+ lnzinf*	      ln(a_0/a_{end})		#redshit of the end of inflation
+ lnrhoinf*     ln(kappa^4\rho_{\end})	#energy at the end of inflation
+       
diff -r -c -b -B -B cosmomc/params.ini cosmomc_fields/params.ini
*** cosmomc/params.ini	2009-11-09 21:42:56.000000000 +0100
--- cosmomc_fields/params.ini	2010-01-29 14:32:08.948722113 +0100
***************
*** 1,7 ****
  #Sample parameters for cosmomc in default parameterization
  
  #Root name for files produced
! file_root = chains/test
  
  #action = 0:  MCMC, action=1: postprocess .data file, action=2: find best fit point only
  action = 0
--- 1,7 ----
  #Sample parameters for cosmomc in default parameterization
  
  #Root name for files produced
! file_root = chains/fields
  
  #action = 0:  MCMC, action=1: postprocess .data file, action=2: find best fit point only
  action = 0
***************
*** 10,16 ****
  samples = 200000
  
  #Feedback level ( 2=lots,1=chatty,0=none)
! feedback = 1
  
  #Temperature at which to Monte-Carlo
  temperature = 1
--- 10,16 ----
  samples = 200000
  
  #Feedback level ( 2=lots,1=chatty,0=none)
! feedback = 3
  
  #Temperature at which to Monte-Carlo
  temperature = 1
***************
*** 67,84 ****
  
  #use fast-slow parameter distinctions to speed up 
  #(note for basic models WMAP3 code is only ~3x as fast as CAMB)
! use_fast_slow = F
  
  #Can use covariance matrix for proposal density, otherwise use settings below
  #Covariance matrix can be produced using "getdist" program.
! propose_matrix = params_CMB.covmat
  
  #If propose_matrix is blank (first run), can try to use numerical Hessian to 
  #estimate a good propose matrix. As a byproduct you also get an approx best fit point
  estimate_propose_matrix = F
  
  #Tolerance on log likelihood to use when estimating best fit point
! delta_loglike = 2
  
  #Scale of proposal relative to covariance; 2.4 is recommended by astro-ph/0405462 for Gaussians
  #If propose_matrix is much broader than the new distribution, make proportionately smaller
--- 67,84 ----
  
  #use fast-slow parameter distinctions to speed up 
  #(note for basic models WMAP3 code is only ~3x as fast as CAMB)
! use_fast_slow = T
  
  #Can use covariance matrix for proposal density, otherwise use settings below
  #Covariance matrix can be produced using "getdist" program.
! #propose_matrix = params_CMB.covmat
  
  #If propose_matrix is blank (first run), can try to use numerical Hessian to 
  #estimate a good propose matrix. As a byproduct you also get an approx best fit point
  estimate_propose_matrix = F
  
  #Tolerance on log likelihood to use when estimating best fit point
! delta_loglike = 0.1
  
  #Scale of proposal relative to covariance; 2.4 is recommended by astro-ph/0405462 for Gaussians
  #If propose_matrix is much broader than the new distribution, make proportionately smaller
***************
*** 135,146 ****
  #If true, generate checkpoint files and terminated runs can be restarted using exactly the same command
  #and chains continued from where they stopped
  #With checkpoint=T note you must delete all chains/file_root.* files if you want new chains with an old file_root
! checkpoint = F
  
  
  #CAMB parameters
  #If we are including tensors
! compute_tensors = F
  #Initial power spectrum amplitude point (Mpc^{-1})
  pivot_k = 0.05
  #If using tensors, enforce n_T = -A_T/(8A_s)
--- 135,146 ----
  #If true, generate checkpoint files and terminated runs can be restarted using exactly the same command
  #and chains continued from where they stopped
  #With checkpoint=T note you must delete all chains/file_root.* files if you want new chains with an old file_root
! checkpoint = T
  
  
  #CAMB parameters
  #If we are including tensors
! compute_tensors = T
  #Initial power spectrum amplitude point (Mpc^{-1})
  pivot_k = 0.05
  #If using tensors, enforce n_T = -A_T/(8A_s)
***************
*** 152,157 ****
--- 152,160 ----
  #(default is about 0.3%, accuracy_level=2 around 0.1% at high l)
  accuracy_level = 1
  
+ #select the inflationary model
+ inflation_model = largef
+ 
  #If action = 1
  redo_likelihoods = T
  redo_theory = F
***************
*** 176,187 ****
  param[fnu] = 0 0 0 0 0
  param[w] = -1 -1 -1 0 0
  
! param[ns] = 0.95 0.5 1.5 0.02 0.01
! param[nt] = 0 0 0 0 0
! param[nrun] = 0 0 0 0 0
  
  #log[10^10 A_s]
! param[logA] = 3 2.7 4 0.01 0.01
! param[r] = 0 0 0 0 0
  #SZ amplitude, as in WMAP analysis
  param[asz]= 1 0 2 0.4 0.4
--- 179,211 ----
  param[fnu] = 0 0 0 0 0
  param[w] = -1 -1 -1 0 0
  
! #initial field values
! #dilaton
! param[Aini] = 1 1 1 0 0
! #matter field X (0 to use guessed values)
! param[Xini] = 0 0 0 0 0
! #potential parameters: mu = nu = 0 for large fields
! #p
! param[p] = 2 2 2 0 0
! #mu
! param[mu] = 0 0 0 0 0
! #nu
! param[nu] = 0 0 0 0 0
! #q
! param[q] = 1 1 1 0 0
! 
! #reheating correction
! #ln(aend/areh) + 1/4 ln(1/rhoreh) - 1/2 ln(1/rhoend)
! param[lnR] = 0 -46 15 10 10
! 
! #bound on field values (need checkBound=T)
! param[Xend] = 0 0 0 0 0
! 
! #end field values (needs checkStop=T)
! param[Xstop] = 0 0 0 0 0
  
  #log[10^10 A_s]
! param[lnA] = 3 2.7 4 0.01 0.01
! param[r] = 1 1 1 0 0
  #SZ amplitude, as in WMAP analysis
  param[asz]= 1 0 2 0.4 0.4
diff -r -c -b -B -B cosmomc/source/CMB_Cls_simple.f90 cosmomc_fields/source/CMB_Cls_simple.f90
*** cosmomc/source/CMB_Cls_simple.f90	2009-12-10 17:26:00.000000000 +0100
--- cosmomc_fields/source/CMB_Cls_simple.f90	2010-01-29 14:29:20.816939356 +0100
***************
*** 127,134 ****
        !Always get everything again. Slight waste of time in general, but allows complete mixing of fast
        !parameters, and works with lensing
  
!          call SetCAMBInitPower(Info%Transfers%Params,CMB,1)       
! 
           call CAMB_TransfersToPowers(Info%Transfers)
              !this sets slow CAMB params correctly from value stored in Transfers
             
--- 127,139 ----
        !Always get everything again. Slight waste of time in general, but allows complete mixing of fast
        !parameters, and works with lensing
  
! !fields  call SetCAMBInitPower(Info%Transfers%Params,CMB,1)       
!         call SetCAMBInitPower(Info%Transfers%Params,CMB,1,error)
!         if (error.ne.0) then
!            if (Feedback > 1) write(*,*)'CMB_Cls_simple: out of prior error =',error
!            return        
!         endif
! !end fields
           call CAMB_TransfersToPowers(Info%Transfers)
              !this sets slow CAMB params correctly from value stored in Transfers
             
***************
*** 245,252 ****
     Threadnum =num_threads
     call CMBToCAMB(CMB, P)
     P%OnlyTransfers = .false.
!    call SetCAMBInitPower(P,CMB,1)   
!     
     MatterOnly = .false.
     if (DoPk) then
        P%WantTransfer = .true.
--- 250,262 ----
     Threadnum =num_threads
     call CMBToCAMB(CMB, P)
     P%OnlyTransfers = .false.
! !fields call SetCAMBInitPower(P,CMB,1)   
!      call SetCAMBInitPower(P,CMB,1,error)
!    if (error.ne.0) then
!       if (Feedback > 1) write(*,*)'GetClsInfo: out of prior error =',error
!       stop
!    endif
! !end fields
     MatterOnly = .false.
     if (DoPk) then
        P%WantTransfer = .true.
***************
*** 455,460 ****
--- 465,474 ----
          P%Reion%use_optical_depth = .false.
          P%OnlyTransfers = .true.
  
+ !fields
+         P%InitPower%infParam%name = InfModelName
+ !end fields
+ 
          if (CMB_Lensing) then
              P%DoLensing = .true.
              P%Max_l = lmax +250 + 50 !+50 in case accuracyBoost>1 and so odd l spacing
diff -r -c -b -B -B cosmomc/source/driver.F90 cosmomc_fields/source/driver.F90
*** cosmomc/source/driver.F90	2009-12-10 00:34:24.000000000 +0100
--- cosmomc_fields/source/driver.F90	2010-01-29 14:30:28.397225501 +0100
***************
*** 58,68 ****
  
  #ifdef MPI 
  
!         if (instance /= 0) call DoStop('With MPI should not have second parameter')
          call mpi_comm_rank(mpi_comm_world,MPIrank,ierror)
  
          instance = MPIrank +1 !start at 1 for chains                                             
!         write (numstr,*) instance
          rand_inst = instance
          if (ierror/=MPI_SUCCESS) call DoStop('MPI fail')
  
--- 58,77 ----
  
  #ifdef MPI 
  
! !fields
! !        if (instance /= 0) call DoStop('With MPI should not have second parameter')
!         instance_shift=instance
!         write(*,*)'MPI file names shifted by: ',instance_shift
! !end fields
          call mpi_comm_rank(mpi_comm_world,MPIrank,ierror)
  
+   
          instance = MPIrank +1 !start at 1 for chains                                             
! !fields
! !        write (numstr,*) instance
!         instance_shift = MPIrank + instance_shift
!         write (numstr,*) instance_shift
! !end fields
          rand_inst = instance
          if (ierror/=MPI_SUCCESS) call DoStop('MPI fail')
  
***************
*** 85,91 ****
  
          propose_scale = Ini_Read_Real('propose_scale',2.4)
          AccuracyLevel = Ini_Read_Real('accuracy_level',1.)
! 
          checkpoint = Ini_Read_Logical('checkpoint',.false.)
          if (checkpoint) flush_write = .true.
          
--- 94,102 ----
  
          propose_scale = Ini_Read_Real('propose_scale',2.4)
          AccuracyLevel = Ini_Read_Real('accuracy_level',1.)
! !fields
!         InfModelName = Ini_Read_String('inflation_model')
! !end fields
          checkpoint = Ini_Read_Logical('checkpoint',.false.)
          if (checkpoint) flush_write = .true.
          
diff -r -c -b -B -B cosmomc/source/Makefile cosmomc_fields/source/Makefile
*** cosmomc/source/Makefile	2010-01-27 17:23:02.000000000 +0100
--- cosmomc_fields/source/Makefile	2010-01-29 15:05:45.897936692 +0100
***************
*** 1,118 ****
! #You may need to edit the library paths for MKL for Intel
! #Beware of using optmizations that lose accuracy - may give errors when running
  
! ##Uncomment the next line to include dr7 LRG
! EXTDATA = 
! #EXTDATA = LRG
  
! #set WMAP empty not to compile with WMAP
! WMAP = /home/aml1005/WMAP7/likelihood_v4
  
! #Only needed for WMAP
! cfitsio = /usr/local/cfitsio/intel10/64/3.040
  
- #GSL only needed for DR7 LRG
- GSLPATH = /home/aml1005/libs/gsl
  
- IFLAG = -I
- INCLUDE=
- 
- #Intel MPI (assuming mpif77 set to point to ifort)
- #change -lmkl_ia32 to -lmkl_p3 for MKL versions earlier than 6 (6 needed for ifc 8+) 
- F90C     = mpif90
- FFLAGS = -O2 -ip -W0 -WB -openmp -fpp -DMPI -vec_report0
- LAPACKL = -L/usr/local/intel/mkl/9.1/lib/em64t -lmkl_lapack -lmkl_em64t -lguide -lpthread
- 
- #HPCF settings. Use Inteal 9 or 10.1+, not 10.0
- #F90C     = mpif90
- #FFLAGS = -O2 -Vaxlib -W0 -WB -openmp -fpp -DMPI -vec_report0
- #LAPACKL = -L/usr/local/Cluster-Apps/intel/mkl/10.2.2.025/lib/em64t -lmkl_lapack -lmkl -lguide -lpthread
- #GSLPATH = /usr/local/Cluster-Apps/gsl/1.9
- #cfitsio = /usr/local/Cluster-Users/cpac/cmb/2.1.0/cfitsio
- #INCLUDE=
- 
- #COSMOS: use "module load cosmolib latest" 
- #use "runCosmomc" (globally installed) to run, defining required memory usage
- ifeq ($(COSMOHOST),cosmos)
- F90C = ifort
- FFLAGS = -openmp -O3 -w -fpp2 -DMPI
- LAPACKL = -mkl=sequential -lmkl_lapack -lmpi
- cfitsio = $(CFITSIO)
- WMAP = $(COSMOLIB)/WMAP7
- GSLPATH = $(GSL_ROOT)
- endif
- 
- #Intel fortran 8, check you have the latest update from the Intel web pages
- #See Makefile_intel for ifc 7.1 or lower (some versions have problems)
- #F90C     = ifort
- #FFLAGS = -O2 -Vaxlib -ip -W0 -WB -openmp -fpp
- #LAPACKL = -L/opt/intel/mkl61/lib/32 -lmkl_lapack -lmkl_ia32 -lguide -lpthread
- 
- #G95; make sure LAPACK and MPI libs also compiled with g95
- #F90C     = mpif90
- #FFLAGS = -O2 -DMPI
- #LAPACKL = /LAPACK/lapack_LINUX.a /LAPACK/blas_LINUX.a
- 
- #GFortran: if pre v4.3 add -D__GFORTRAN__
- #F90C     = gfortran
- #FFLAGS = -O2 -ffree-form -x f95-cpp-input 
- #LAPACKL = -Wl,-framework -Wl,accelerate
- 
- #SGI, -mp toggles multi-processor. Use -O2 if -Ofast gives problems.
- #Not various versions of the compiler are buggy giving erroneous seg faults with -mp.
- #Version 7.3 is OK, currently version 7.4 is bugged, as are some earlier versions.
- #F90C     = f90
- #LAPACKL = -lcomplib.sgimath
- #FFLAGS  = -Ofast -mp
- 
- #Digital/Compaq fortran, -omp toggles multi-processor
- #F90C    = f90
- #FFLAGS  = -omp -O4 -arch host -math_library fast -tune host -fpe1
- #LAPACKL  = -lcxml
- 
- #Absoft ProFortran, single processor, set -cpu:[type] for your local system 
- #F90C     = f95
- #FFLAGS = -O2 -s -cpu:athlon -lU77 -w -YEXT_NAMES="LCS" -YEXT_SFX="_" 
- #LAPACKL =  -llapack -lblas -lg2c 
- #IFLAG = -p
- 
- #NAGF95, single processor:
- #F90C     = f95
- #FFLAGS = -DNAGF95 -O3
- #LAPACKL = -llapack -lblas -lg2c
- 
- #PGF90
- #F90C = pgf90
- #FFLAGS = -O2 -DESCAPEBACKSLASH
- #LAPACKL = -llapack -lblas
- 
- 
- #Sun, single processor:
- #F90C     = f90
- #FFLAGS = -fast -ftrap=%none
- #LAPACKL = -lsunperf -lfsu
- #LAPACKL = -lsunperf -lfsu -lsocket -lm
- #IFLAG = -M
- 
- #Sun MPI
- #F90C = mpf90
- #FFLAGS =  -O4 -openmp -ftrap=%none -dalign -DMPI
- #LAPACKL = -lsunperf -lfsu -lmpi_mt
- #IFLAG = -M
- 
- #Sun parallel enterprise:
- #F90C     = f95
- #FFLAGS =  -O4 -xarch=native64 -openmp -ftrap=%none
- #LAPACKL = -lsunperf -lfsu
- #IFLAG = -M
- 
- 
- #IBM XL Fortran, multi-processor (run "module load lapack" then run "gmake")
- # See also http://cosmocoffee.info/viewtopic.php?t=326
- #F90C     = xlf90_r $(LAPACK)
- #FFLAGS  = -WF,-DIBMXL -qsmp=omp -qsuffix=f=f90:cpp=F90 -O3 -qstrict -qarch=pwr3 -qtune=pwr3
- #INCLUDE = -lessl
- #LAPACKL =
  
  PROPOSE = propose.o
  CLSFILE = CMB_Cls_simple.o
--- 1,84 ----
! # >>> DESIGNED FOR GMAKE <<<
  
! # Unified Systems makefile for COSMOMC
! # Add FLAGS -DMPI for using MPI
! 
! ext=$(shell uname | cut -c1-3)
  
! CC=cc
! 
! ifeq ($(ext),IRI)
! F90C= f90
! FFLAGS= -Ofast -mp -n32 -LANG:recursive=ON -lmpi -DMPI
! WMAPFLAGS= $(FFLAGS)
! LAPACKL = -lcomplib.sgimath_mp
! INCLUDE = -I../camb
! CFITSIODIR = /people/ringeval/usr
! GSLDIR =
! endif
  
! ifeq ($(ext),Lin)
! F90C=gfortran
! FFLAGS= -O -cpp -fopenmp
! WMAPFLAGS= -O
! LAPACKL = -llapack
! INCLUDE = -I../camb 
! CFITSIODIR = /opt/gnu/cfitsio
! GSLDIR = /usr
! endif 
! 
! ifeq ($(ext),OSF)
! F90C=f90
! FFLAGS= -omp -O -arch host -math_library fast -tune host -fpe1
! WMAPFLAGS= $(FFLAGS)
! LAPACKL  = -lcxml
! INCLUDE = -I../camb 
! CFITSIODIR = 
! GSLDIR =
! endif
! 
! ifeq ($(ext),Sun)
! F90C=f90
! FFLAGS= -O4 -xarch=native64 -openmp -ftrap=%none
! WMAPFLAGS= $(FFLAGS)
! LAPACKL = -lsunperf -lfsu
! INCLUDE = -I../camb -M../camb
! CFITSIODIR = 
! GSLDIR =
! endif
! 
! ifeq ($(ext),AIX)
! F90C    = mpxlf90_r
! FFLAGS  = -O4 -WF,-DIBMXL,-DMPI -qstrict -qsmp=omp -qmaxmem=-1 -qsuffix=f=f90:cpp=F90
! WMAPFLAGS= $(FFLAGS)
! LAPACKL = -lessl
! INCLUDE = -I../camb
! CFITSIODIR = 
! GSLDIR =
! endif
! 
! #EXTDATA = LRG
! EXTDATA = LRG
! EXTINCLUDE = -I$(GSLDIR)/include
! EXTOBJS = bsplinepk.o
! 
! 
! WMAPDIR = ../WMAP
! WMAPINCLUDE = -I$(CFITSIODIR)/include
! WMAPOBJS = read_archive_map.o \
! 	read_fits.o \
! 	healpix_types.o \
! 	br_mod_dist.o \
! 	WMAP_7yr_options.o \
! 	WMAP_7yr_util.o \
! 	WMAP_7yr_gibbs.o \
! 	WMAP_7yr_tt_pixlike.o \
! 	WMAP_7yr_tt_beam_ptsrc_chisq.o \
! 	WMAP_7yr_teeebb_pixlike.o \
! 	WMAP_7yr_tetbeebbeb_pixlike.o \
! 	WMAP_7yr_likelihood.o
  
  
  
  PROPOSE = propose.o
  CLSFILE = CMB_Cls_simple.o
***************
*** 120,132 ****
  #Can use params_H if you prefer more generic parameters
  PARAMETERIZATION = params_CMB.o
  
! F90FLAGS = -DMATRIX_SINGLE $(FFLAGS) $(IFLAG)../camb $(INCLUDE)
! LINKFLAGS = -L../camb -lcamb $(LAPACKL) 
  
  DISTFILES = utils.o ParamNames.o Matrix_utils.o settings.o GetDist.o
  
! OBJFILES= utils.o ParamNames.o Matrix_utils.o settings.o IO.o cmbtypes.o Planck_like.o \
! 	cmbdata.o WeakLen.o bao.o lrggettheory.o mpk.o supernovae.o HST.o SDSSLy-a-v3.o \
  	$(CLSFILE) paramdef.o $(PROPOSE) $(PARAMETERIZATION) calclike.o \
  	conjgrad_wrapper.o EstCovmat.o postprocess.o MCMC.o driver.o
  
--- 86,101 ----
  #Can use params_H if you prefer more generic parameters
  PARAMETERIZATION = params_CMB.o
  
! LINKFLAGS =  -L../camb -lcamb -linf $(LAPACKL)
! 
! F90FLAGS = -DMATRIX_SINGLE $(FFLAGS) $(INCLUDE)
  
  DISTFILES = utils.o ParamNames.o Matrix_utils.o settings.o GetDist.o
  
! 
! 
! OBJFILES = utils.o ParamNames.o Matrix_utils.o settings.o IO.o cmbtypes.o Planck_like.o \
! 	cmbdata.o WeakLen.o bao.o lrggettheory.o mpk.o supernovae.o HST.o SDSSLy-a-v3.o\
  	$(CLSFILE) paramdef.o $(PROPOSE) $(PARAMETERIZATION) calclike.o \
  	conjgrad_wrapper.o EstCovmat.o postprocess.o MCMC.o driver.o
  
***************
*** 130,165 ****
  	$(CLSFILE) paramdef.o $(PROPOSE) $(PARAMETERIZATION) calclike.o \
  	conjgrad_wrapper.o EstCovmat.o postprocess.o MCMC.o driver.o
  
- 
  ifeq ($(EXTDATA),LRG)
  F90FLAGS += -DDR71RG
! OBJFILES += bsplinepk.o
! GSLINC = -I$(GSLPATH)/include
! LINKFLAGS += -L$(GSLPATH)/lib -lgsl -lgslcblas
! endif
! 
! ifneq ($(WMAP),)
! F90FLAGS += $(IFLAG)$(cfitsio)/include $(IFLAG)$(WMAP)
! LINKFLAGS +=  -L$(cfitsio)/lib -L$(WMAP) -lcfitsio
! 
! OBJFILES += $(WMAP)/read_archive_map.o \
! 	$(WMAP)/read_fits.o \
! 	$(WMAP)/healpix_types.o \
! 	$(WMAP)/WMAP_7yr_options.o \
! 	$(WMAP)/WMAP_7yr_util.o \
! 	$(WMAP)/WMAP_7yr_tt_pixlike.o \
! 	$(WMAP)/WMAP_7yr_teeebb_pixlike.o \
! 	$(WMAP)/WMAP_7yr_likelihood.o \
! 	$(WMAP)/WMAP_7yr_gibbs.o \
! 	$(WMAP)/WMAP_7yr_tt_beam_ptsrc_chisq.o \
! 	$(WMAP)/br_mod_dist.o 
  else
  F90FLAGS += -DNOWMAP
  endif
  
- default: cosmomc
  
! all : cosmomc getdist
  
  utils.o: ../camb/libcamb.a
  settings.o: utils.o
--- 99,124 ----
  	$(CLSFILE) paramdef.o $(PROPOSE) $(PARAMETERIZATION) calclike.o \
  	conjgrad_wrapper.o EstCovmat.o postprocess.o MCMC.o driver.o
  
  ifeq ($(EXTDATA),LRG)	
  F90FLAGS += -DDR71RG
! EXTINCLUDE = -I$(GSLDIR)/include
! LINKFLAGS += -lgsl -lgslcblas
! OBJFILES += $(EXTOBJS)
! endif	
! 
! ifneq ($(WMAPDIR),)
! F90FLAGS += $(WMAPINCLUDE)
! LINKFLAGS += -L$(CFITSIODIR)/lib -lcfitsio
! OBJFILES += $(WMAPOBJS)
  else
  F90FLAGS += -DNOWMAP
  endif
  
  
! 
! default: cosmomc.$(ext)
! 
! all : cosmomc.$(ext) getdist.$(ext)
  
  utils.o: ../camb/libcamb.a
  settings.o: utils.o
***************
*** 183,196 ****
  MCMC.o: calclike.o
  driver.o: MCMC.o
  
- export FFLAGS
- export F90C
- 
  .f.o:
  	f77 $(F90FLAGS) -c $<
  
  %.o: %.c
! 	$(CC) $(GSLINC) -c $*.c
  
  %.o: %.f90
  	$(F90C) $(F90FLAGS) -c $*.f90
--- 142,159 ----
  MCMC.o: calclike.o
  driver.o: MCMC.o
  
  .f.o:
  	f77 $(F90FLAGS) -c $<
  
  %.o: %.c
! 	$(CC) $(EXTINCLUDE) -c $*.c
! 
! %.o: $(WMAPDIR)/%.f90
! 	$(F90C) $(WMAPFLAGS) $(WMAPINCLUDE) -c $<
! 
! %.o: $(WMAPDIR)/%.F90
! 	$(F90C) $(WMAPFLAGS) $(WMAPINCLUDE) -c $<
! 
  
  %.o: %.f90
  	$(F90C) $(F90FLAGS) -c $*.f90
***************
*** 199,217 ****
  	$(F90C) $(F90FLAGS) -c $*.F90
  
  
! cosmomc: camb $(OBJFILES)
! 	$(F90C) -o ../cosmomc $(OBJFILES) $(LINKFLAGS) $(F90FLAGS)
! 
  
- clean: cleancosmomc
- 	rm -f ../camb/*.o ../camb/*.obj ../camb/*.mod
  
! cleancosmomc:
  	rm -f *.o *.mod *.d *.pc *.obj ../core 
  
  
- getdist: camb $(DISTFILES)
- 	$(F90C) -o ../getdist $(DISTFILES) $(LINKFLAGS) $(F90FLAGS) 
  
- camb:
- 	cd ../camb && $(MAKE) --file=Makefile_main libcamb.a
--- 162,175 ----
  	$(F90C) $(F90FLAGS) -c $*.F90
  
  
! cosmomc.$(ext): $(OBJFILES) ../camb/libcamb.a ../camb/libinf.a
! 	$(F90C) -o ../$@ $(OBJFILES) $(LINKFLAGS) $(F90FLAGS)
  
  
! clean:
  	rm -f *.o *.mod *.d *.pc *.obj ../core
  
+ getdist.$(ext): $(DISTFILES)
+ 	$(F90C) -o ../$@ $(DISTFILES) $(LINKFLAGS) $(F90FLAGS) 
  
  
diff -r -c -b -B -B cosmomc/source/MCMC.f90 cosmomc_fields/source/MCMC.f90
*** cosmomc/source/MCMC.f90	2009-09-18 18:32:05.000000000 +0200
--- cosmomc_fields/source/MCMC.f90	2010-01-29 14:30:47.513198234 +0100
***************
*** 215,221 ****
    
      Like = GetLogLike(grid(r))
     
!     if (Feedback > 1) write (*,*) r, 'Likelihood: ', Like, 'Current Like:', CurLike
  
      if ((Like /= logZero) .and. (CurLike > Like .or. randexp1() > Like - CurLike)) then
      !Accept
--- 215,221 ----
    
      Like = GetLogLike(grid(r))
     
!     if (Feedback > 1) write (*,*) r, 'Likelihood: ', Like, 'Current Like:', CurLike, 'Rank', MPIRank
  
      if ((Like /= logZero) .and. (CurLike > Like .or. randexp1() > Like - CurLike)) then
      !Accept
***************
*** 501,507 ****
             output_lines = output_lines +1
             call WriteParams(CurParams, real(mult), CurLike)
            end if
!           if (Feedback > 1) write (*,*) instance, 'Slicing, Current Like:', CurLike
            mult = 1
            if (num_slow /=0) call SliceSampleSlowParam(CurParams, CurLike) 
            if (num_fast /=0) call SliceSampleFastParams(CurParams, CurLike) 
--- 501,507 ----
             output_lines = output_lines +1
             call WriteParams(CurParams, real(mult), CurLike)
            end if
!           if (Feedback > 1) write (*,*) instance, 'Slicing, Current Like:', CurLike, 'Rank', MPIRank
            mult = 1
            if (num_slow /=0) call SliceSampleSlowParam(CurParams, CurLike) 
            if (num_fast /=0) call SliceSampleFastParams(CurParams, CurLike) 
***************
*** 536,542 ****
  
      Like = GetLogLike(Trial) 
  
!     if (Feedback > 1) write (*,*) 'Likelihood: ', Like, 'Current Like:', CurLike
  
  !!!    accpt = (Like /= logZero) .and. (CurLike > Like .or. randexp1() > Like - CurLike) 
               !Include the min() so that compilers not doing optimal compilation don't complain
--- 536,542 ----
  
      Like = GetLogLike(Trial) 
  
!     if (Feedback > 1) write (*,*) 'Likelihood: ', Like, 'Current Like:', CurLike,  'Rank', MPIRank
  
  !!!    accpt = (Like /= logZero) .and. (CurLike > Like .or. randexp1() > Like - CurLike) 
               !Include the min() so that compilers not doing optimal compilation don't complain
diff -r -c -b -B -B cosmomc/source/params_CMB.f90 cosmomc_fields/source/params_CMB.f90
*** cosmomc/source/params_CMB.f90	2009-12-10 00:24:25.000000000 +0100
--- cosmomc_fields/source/params_CMB.f90	2010-01-29 14:31:13.368698025 +0100
***************
*** 46,52 ****
  
  
  !Mapping between array of power spectrum parameters and CAMB
!      subroutine SetCAMBInitPower(P,CMB,in)
         use camb
         use settings
         use cmbtypes
--- 46,54 ----
  
  
  !Mapping between array of power spectrum parameters and CAMB
! !fields     subroutine SetCAMBInitPower(P,CMB,in)
!   subroutine SetCAMBInitPower(P,CMB,in,inferror)
!     use infprec, only : kp
         use camb
         use settings
         use cmbtypes
***************
*** 56,82 ****
  
         integer, intent(in) :: in
  
  
!        if (Power_Name == 'power_tilt') then
  
-        P%InitPower%k_0_scalar = pivot_k
-        P%InitPower%k_0_tensor = pivot_k
  
!        P%InitPower%ScalarPowerAmp(in) = cl_norm*CMB%norm(norm_As)
!        P%InitPower%rat(in) = CMB%norm(norm_amp_ratio)
!         
!        P%InitPower%an(in) = CMB%InitPower(1)
!        P%InitPower%ant(in) = CMB%InitPower(2)
!        P%InitPower%n_run(in) = CMB%InitPower(3)
!        if (inflation_consistency) then
!          P%InitPower%ant(in) = - CMB%norm(norm_amp_ratio)/8.
!           !note input n_T is ignored, so should be fixed (to anything)
!        end if
!        else
           stop 'params_CMB:Wrong initial power spectrum'
!        end if
  
      end subroutine SetCAMBInitPower
   
  
   subroutine SetForH(Params,CMB,H0)
--- 58,127 ----
  
         integer, intent(in) :: in
  
+     integer :: inferror
  
!     real(kp) :: Pstar
  
  
!     if (Power_Name /= 'power_inf') then
           stop 'params_CMB:Wrong initial power spectrum'
!     endif
! 
!     P%InitPower%kstar = pivot_k
!     Pstar = cl_norm*CMB%norm(norm_As)
! 
! 
! !fields    
!     P%InitPower%infParam%conforms(1) = CMB%InitPower(1)
!     P%InitPower%infParam%matters(1) = CMB%InitPower(2)
! 
! !power    
!     P%InitPower%infParam%consts(2) = CMB%InitPower(3)
! 
! !mu
!     P%InitPower%infParam%consts(3) = CMB%InitPower(4)
! 
! !nu
!     P%InitPower%infParam%consts(4) = CMB%InitPower(5)
! 
! !q
!     P%InitPower%infParam%consts(5) = CMB%InitPower(6)
! 
! !changed below
!     P%InitPower%infParam%consts(1) = 1.
!     
!     P%InitPower%lnReheat = CMB%InitPower(7)
! 
! 
! !field bound related
!     P%InitPower%infParam%consts(6) = CMB%InitPower(8)
! 
! !field stop related
!     P%InitPower%infParam%consts(7) = CMB%InitPower(9)
!   
!         
!     call SetInfBg(P%InitPower,inferror)
!     if (inferror.ne.0) then
!        write(*,*)'SetCAMBInitPower: infbg out of prior',inferror
!        return
!     endif
! 
! 
!     call SetInfScalPow(P%InitPower,Pstar)
! 
!     call SetInfBgSpline(P%InitPower)
! 
!         
!     call SetInfCosmo(P%InitPower,inferror)
!     if (inferror.ne.0) then
!        write(*,*)'SetCAMBInitPower: inftorad out of prior',inferror
!        return
!     endif
!     
  
      end subroutine SetCAMBInitPower
+ !end fields 
+ 
   
  
   subroutine SetForH(Params,CMB,H0)
***************
*** 221,232 ****
--- 266,283 ----
       use settings
       use cmbtypes
       use ParamDef
+ !fields
+      use initialpower, only : exportinfprop,updateinfprop
+ !end fields
       use IO
       implicit none
       Type(ParamSet) P
       real, intent(in) :: mult, like
       Type(CMBParams) CMB
       real r10
+ !fields
+      type(exportinfprop) :: infExport
+ !end fields
       real, allocatable :: output_array(:)
    
      if (outfile_handle ==0) return
***************
*** 244,250 ****
        else
          r10 = 0
        end if
!       allocate(output_array(num_real_params + 7 + nuisance_params_used ))
        output_array(1:num_real_params) =  P%P(1:num_real_params)
        output_array(num_real_params+1) = CMB%omv
        output_array(num_real_params+2) = P%Info%Theory%Age
--- 295,305 ----
        else
          r10 = 0
        end if
! !fields
!       call UpdateInfProp(infExport)
! !      allocate(output_array(num_real_params + 7 + nuisance_params_used ))
!       allocate(output_array(num_real_params + 11 + nuisance_params_used ))
! !end fields
        output_array(1:num_real_params) =  P%P(1:num_real_params)
        output_array(num_real_params+1) = CMB%omv
        output_array(num_real_params+2) = P%Info%Theory%Age
***************
*** 257,263 ****
         output_array(num_real_params+8:num_real_params+8+nuisance_params_used-1) = &
          P%P(num_real_params+1:num_real_params+nuisance_params_used) 
        end if
!  
        call IO_OutputChainRow(outfile_handle, mult, like, output_array)
        deallocate(output_array)           
      end if
--- 312,325 ----
         output_array(num_real_params+8:num_real_params+8+nuisance_params_used-1) = &
          P%P(num_real_params+1:num_real_params+nuisance_params_used) 
        end if
! !fields
!       output_array(num_real_params+nuisance_params_used+8) &
!            = log10(P%Info%Transfers%Params%InitPower%infParam%consts(1)) 
!       output_array(num_real_params+nuisance_params_used+9) &
!            = P%Info%Transfers%Params%InitPower%lnReheat - 0.25*infExport%lnEnergyEnd
!       output_array(num_real_params+nuisance_params_used+10) = infExport%efoldEndToToday
!       output_array(num_real_params+nuisance_params_used+11) = infExport%lnEnergyEnd
! !end fields
        call IO_OutputChainRow(outfile_handle, mult, like, output_array)
        deallocate(output_array)           
      end if
***************
*** 271,276 ****
--- 333,341 ----
       use settings
       use cmbtypes
       use ParamDef
+ !fields
+      use initialpower, only : exportinfprop,updateinfprop
+ !end fields
       use IO
       implicit none
      Type(ParamSet) P
***************
*** 278,283 ****
--- 343,351 ----
      character(LEN =30) fmt
      Type(CMBParams) CMB
      real r10
+ !fields
+      type(exportinfprop) :: infExport
+ !end fields
      real,allocatable :: output_array(:)
         
      if (outfile_handle ==0) return
***************
*** 288,295 ****
        else
          r10 = 0
        end if
! 
!      allocate(output_array(num_real_params + 7 + num_matter_power ))
        output_array(1:num_real_params) =  P%P(1:num_real_params)
        output_array(num_real_params+1) = CMB%omv
        output_array(num_real_params+2) = P%Info%Theory%Age
--- 356,366 ----
        else
          r10 = 0
        end if
! !fields
!       call UpdateInfProp(infExport)
! !      allocate(output_array(num_real_params + 7 + num_matter_power ))
!       allocate(output_array(num_real_params + 11 + num_matter_power ))
! !end fields     
        output_array(1:num_real_params) =  P%P(1:num_real_params)
        output_array(num_real_params+1) = CMB%omv
        output_array(num_real_params+2) = P%Info%Theory%Age
***************
*** 300,306 ****
        output_array(num_real_params+7) = CMB%H0
        output_array(num_real_params+8:num_real_params+8+num_matter_power-1) = &
          P%Info%Theory%matter_power(:,1) 
! 
        call IO_OutputChainRow(outfile_handle, mult, like, output_array)
        deallocate(output_array)
  
--- 371,384 ----
        output_array(num_real_params+7) = CMB%H0
        output_array(num_real_params+8:num_real_params+8+num_matter_power-1) = &
          P%Info%Theory%matter_power(:,1) 
! !fields
!       output_array(num_real_params+num_matter_power+8) &
!            = log10(P%Info%Transfers%Params%InitPower%infParam%consts(1))
!       output_array(num_real_params+num_matter_power+9) &
!            = P%Info%Transfers%Params%InitPower%lnReheat - 0.25*infExport%lnEnergyEnd
!       output_array(num_real_params+num_matter_power+10) = infExport%efoldEndToToday
!       output_array(num_real_params+num_matter_power+11) = infExport%lnEnergyEnd
! !end fields
        call IO_OutputChainRow(outfile_handle, mult, like, output_array)
        deallocate(output_array)
  
diff -r -c -b -B -B cosmomc/source/settings.f90 cosmomc_fields/source/settings.f90
*** cosmomc/source/settings.f90	2009-12-10 00:24:48.000000000 +0100
--- cosmomc_fields/source/settings.f90	2010-01-29 14:31:40.800696876 +0100
***************
*** 6,11 ****
--- 6,12 ----
    implicit none
  
    real :: AccuracyLevel = 1.
+   character (len=6) :: InfModelName
    !Set to >1 to use CAMB etc on higher accuracy settings. 
    !Does not affect MCMC (except making it all slower)
  
***************
*** 19,25 ****
  !                    (e.g. beam uncertainty modes, etc, specific to dataset)
  
    integer, parameter :: num_hard =7 
!   integer, parameter :: num_initpower = 3 
    integer, parameter :: num_freq_params = 1
    integer, parameter :: num_norm = 2 + num_freq_params 
    integer, parameter :: num_nuisance_params= 0
--- 20,29 ----
  !                    (e.g. beam uncertainty modes, etc, specific to dataset)
  
    integer, parameter :: num_hard =7 
! !fields
! !  integer, parameter :: num_initpower = 3 
!   integer, parameter :: num_initpower = 9
! !end fields 
    integer, parameter :: num_freq_params = 1
    integer, parameter :: num_norm = 2 + num_freq_params 
    integer, parameter :: num_nuisance_params= 0
***************
*** 62,67 ****
--- 66,74 ----
  
    integer :: num_threads = 0
    integer :: instance = 0
+ !addon
+   integer :: instance_shift = 0
+ !end addon
    integer :: MPIchains = 1, MPIrank = 0
  
    logical :: Use_LSS = .true.
