Install and run Gadget4

  1. Install MPI
    $ tar xvfz mpich-3.0.2.tar.gz
    $ cd mpich-3.0.2
    $ ./configure -prefix=/home/htanimur/lib/mpich/3.0.2
    $ make
    $ make install

  2. Install gsl
    $ tar xvfz gsl-2.5.tar.gz
    $ cd gsl-2.5
    $ ./configure -prefix=/home/htanimur/lib/gsl/2.5
    $ make
    $ make install

  3. Install FFTW3
    $ tar xvfz fftw-3.3.8.tar.gz
    $ cd fftw-3.3.8
    $ ./configure -prefix=/home/htanimur/lib/fftw/3.3.8 –enable-openmp
    $ make
    $ make install

  4. Install hdf5
    $ tar xvfz hdf5-1.10.1.tar.gz
    $ cd hdf5-1.10.1
    $ ./configure -prefix=/home/htanimur/lib/hdf5/1.10.1
    $ make
    $ make install

  5. Install hwloc
    $ tar xvfz hdf5-2.2.0.tar.gz
    $ cd hdf5-2.2.0
    $ ./configure -prefix=/home/htanimur/lib/hwloc/2.2.0
    $ make
    $ make install

  6. Modify .bashrc
    export GSL_HOME=${HOME}/lib/gsl/2.5
    export FFTW3_HOME=${HOME}/lib/fftw/3.3.8
    export HDF5_HOME=${HOME}/lib/hdf5/1.10.1
    export MPICH_HOME=${HOME}/lib/mpich/3.0.2
    export HWLOC_HOME=${HOME}/lib/hwloc/2.2.0
    export LD_LIBRARY_PATH=${GSL_HOME}/lib:${FFTW3_HOME}/lib:${HDF5_HOME}/lib:${MPICH_HOME}/lib:${HWLOC_HOME}/lib:$LD_LIBRARY_PATH
    export PATH=${GSL_HOME}/bin:${FFTW3_HOME}/bin:${HDF5_HOME}/bin:${MPICH_HOME}/bin:${HWLOC_HOME}/bin:$PATH

  7. Download Gadget4
    git clone http://gitlab.mpcdf.mpg.de/vrs/gadget4

  8. Copy Template-Config.sh to Config.sh and Template-Makefile.systype to Makefile.systype

  9. Modify Makefile.systype
    #SYSTYPE=”hydra”
    ->
    SYSTYPE=”hydra”

  10. Modify buildsystem/Makefile.path.hydra
    GSL_INCL = -I${GSL_HOME}/include
    GSL_LIBS = -L${GSL_HOME}lib
    FFTW_INCL = -I${FFTW3_HOME}/include
    FFTW_LIBS = -L${FFTW3_HOME}/lib
    HDF5_INCL = -I${HDF5_HOME}/include
    HDF5_LIBS = -L${HDF5_HOME}/lib
    HWLOC_INCL = -I${HWLOC_HOME}/include
    HWLOC_LIBS = -L${HWLOC_HOME}/lib

  11. make

  12. bash make-examples.sh

  13. Test run with examples/DM-L50-N128
    ./Gadget4 param.txt

INstall cosmomc

Ref: https://arxiv.org/abs/1808.05080

– Find Intel FORTRAN Compiler in your system and the following in .bashrc

source /opt/intel/compilers_and_libraries_2018.3.222/linux/bin/ifortvars.sh intel64

source /opt/intel/compilers_and_libraries_2018.3.222/linux/mpi/intel64/bin/mpivars.sh

source /opt/intel/compilers_and_libraries_2018.3.222/linux/bin/compilervars.sh intel64

– Installing Open MPI

$ cd openmpi-4.0.4/
$ ./configure –prefix=/home/htanimur/lib/openmpi/4.0.4 F77=/opt/intel/compilers_and_libraries_2018.3.222/linux/bin/intel64/ifort FC=/opt/intel/compilers_and_libraries_2018.3.222/linux/bin/intel64/ifort F90=/opt/intel/compilers_and_libraries_2018.3.222/linux/bin/intel64/ifort
$ make
$ make install

– Add openmpi environemnt in .bashrc to call mpif90 command
export PATH=${HOME}/lib/openmpi/4.0.4/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib/openmpi/4.0.4/lib:$LD_LIBRARY_PATH

– Installing CFITSIO, FFTW and GSL

See https://kaizokuow.wordpress.com/2020/10/02/install-polspice/
https://kaizokuow.wordpress.com/2018/02/12/install-gadget-2/

– Building Planck Likelihood Code

$ wget http://pla.esac.esa.int/pla/aio/product-action?COSMOLOGY.FILE_ID=COM_Likelihood_Code-v3.0_R3.01.tar.gz

$ mv code/plc_3.01 $HOME/lib/likelihood
$ cd plc_3.01
$ ./waf configure
$ ./waf install

– add environement in .bashrc
export PLANCKLIKE=cliklike
export CLIKPATH=${HOME}/lib/likelihood/plc-3.01
source $CLIKPATH/bin/clik_profile.sh

– Install CosmoMC

$ git clone — recursive https://github.com/cmbant/CosmoMC.git
$ cd CosmoMC/
$ ln -s ${HOME}/lib/likelihood/plc-3.01 data/clik_14.0
$ cd source/
$ make

– Run CAMB

$ cd camb/fortran
$ make
$ ./camb ../inifiles/params.ini

– Run CosmoMC

$ ./cosmomc test.ini

install Polspice

Installed PolSpice v03-06-08 (version on 2020-05-26), but failed with PolSpice v03-06-09 (version on 2020-09-22) (Installation succeeded, but failed to run.)

Install Healpix 3.70

$ ./configure
$ make

Install cfitsio 3.49

$ ./configure –prefix=/home/htanimur/lib/cfitsio/3490
$ make
$ make install

– Add library in LD_LIBRARY_PATH (in .bashrc)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/lib/cfitsio/3490/lib:${HOME}/lib/Healpix/3.70/lib

Install PolSpice

$ cd src
$ cp Makefile_template Makefile

– Set Healpix environment (in .bashrc)
export HEALPIX=${HOME}/lib/Healpix/3.70/
export HEALPIXDATA=${HOME}/lib/Healpix/3.70/data/

– Edit Makefile
USEPKGCONFIG := 0 # 1 if there is $HEALPIX/lib/pkgconfig/healpix.pc
FC = gfortran
CC = gcc
FITSLIB = /home/htanimur/lib/cfitsio/3490/lib

$ make
(It will make spice in ../bin directory.)

– Add environment in .bashrc
export PATH=$PATH:${HOME}/lib/PolSpice/bin
export SPICE_DIR=${HOME}/lib/PolSpice/bin
export PYTHONPATH=$SPICE_DIR:$PYTHONPATH
export PATH=$PATH:$SPICE_DIR

– Test code

—————————————————–
import sys
import ispice as isp
from astropy.io import fits
import matplotlib.pyplot as plt

lmax = 256
input_cl = np.ones(lmax + 1)
np.random.seed(1000)
input_map = hp.synfast(input_cl, nside=256, pixwin=True)
hp.write_map(‘input.fits’, input_map, overwrite=True)

isp.ispice(‘input.fits’, clout=’clout.fits’, nlmax=lmax)

f1 = fits.open(‘clout.fits’)
cl = f1[1].data

plt.figure(figsize=(10,7))
plt.plot(cl)
plt.plot(input_cl, color=”red”, linewidth=3)
plt.xlim([0, lmax+1])
plt.xlabel(“$\ell$”)
plt.ylabel(“$C_\ell$”)
plt.show()

Ref: https://github.com/zonca/python_spice
—————————————————–

gitlab

基本コマンド

https://qiita.com/yuki476/items/c6e5c41abffd78e77c47

(Font style)
https://about.gitlab.com/handbook/product/technical-writing/markdown-guide/

Git global setup

git config --global user.name "ユーザ名"
git config --global user.email "メールアドレス"

Create a new repository

git clone http://<gitlabアドレス>/<ユーザ名>/<リポジトリ名>.git
cd <ローカルリポジトリフォルダ名>
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Existing folder

cd existing_folder
git init
git remote add origin http://<gitlabアドレス>/<ユーザ名>/<リポジトリ名>.git
git add .
git commit -m "Initial commit"
git push -u origin master

GitHubの使い方【超初心者向け】

https://techacademy.jp/magazine/6235

GitLabにSSHで接続するまでの手順

https://qiita.com/kyamawaki/items/07fb3332cf3c2f47728a

Start using Git on the command line | GitLab

Why the angular diameter distance starts to decrease after a certain redshift (around z = 1.5)?

The angular diameter of something is the angular diameter it had when the light was emitted and started on its way to us.

Because pure expansion does not change angles. If you think diagrammatically, the lightrays are not spread apart or squinched together by expansion. They are just stretched out longer.

But the angular-size distance is just based on the angular diameter of some standard ruler (like a 100 thousand lightyear galaxy), and since the angle spread of the incoming light does not change the angular size distance equals the instantaneous proper distance to the object measured on the day when the light was emitted.

And that is smaller than the presentday distance by a factor of z+1.

So think about this example: the matter that emitted the CMB which we are now detecting is now about 45 billion LY from us. But the redshift of that ancient light is z = 1090. So the distances have increased by a factor of z+1 = 1091. Not to be too fussy, distances have increased by a factor of 1100. So when the light was emitted, that matter was only about 41 million LY from our matter! When the ancient light was emitted, the matter was much much closer

Reference:
https://www.physicsforums.com/threads/angular-diameter-distance.501108/
https://forum.cosmoquest.org/showthread.php?103185-angular-diameter-distance

赤方偏移、宇宙年齢、距離の表(Plankパラメータ)

赤方偏移 宇宙年齢 ルックバック 角度距離 光度距離
     _(Gy)  _タイム(Gy)  (Gly) _ _(Gly) _
0.000   13.798    0.000    0.000     0.000
0.010   13.654    0.143    0.143     0.145
0.050   13.102    0.696    0.680     0.749
0.100   12.454    1.344    1.281     1.550
0.200   11.288    2.510    2.291     3.299
0.500   8.604     5.194    4.231     9.519
0.700   7.310     6.488    4.948    14.298
1.000   5.862     7.935    5.538    22.152
1.500   4.278     9.520    5.844    36.522
2.000   3.284    10.514    5.775    51.972
3.000   2.148    11.649    5.3080    84.928
4.000   1.541    12.257    4.7875   119.69
5.000   1.173    12.624    4.3243   155.67
6.000   0.931    12.866    3.9301   192.57
7.000   0.762    13.036    3.5967   230.19
8.000   0.639    13.159    3.3134   268.38
9.000   0.545    13.253    3.0706   307.06
10.00   0.472    13.325    2.8608   346.16
15.00    0.269    13.529    2.1336   546.19
20.00    0.178    13.619    1.7039   751.44
25.00    0.129    13.668    1.4202   960.09
50.00  46.63×10-3  13.751    0.7808   2031.0
100   16.46×10-3  13.781    0.4149   4232.4
500   1.341×10-3  13.796    0.0891   22374
1000   0.430×10-3  13.797    0.0452   45316
1090*   0.373×10-3  13.797    0.0415   49455
* 宇宙晴れあがり期

ref: https://blogs.yahoo.co.jp/karaokegurui/70712013.html

出典:谷口義明、岡村定矩、祖父江義明 編 『銀河I-銀河と宇宙の階層構造』 日本評論社 シリーズ現代の天文学[第2版]第4巻 2018年8月発行
P.362~364 付表
Plank宇宙論パラメータ H0=67.7kms-1Mpc-1,Ωm0=0.309,ΩΛ0=0.691に基づく,赤方偏移と宇宙年齢,ルックバックタイム,角度距離,光度距離の関係(Gy=10億年,Gly=10億光年=3.06×108pc)