Sovereign 8s.is mirror of standardgalactic/CUBE2
  • Fortran 89.4%
  • Shell 8.7%
  • Makefile 1%
  • Python 0.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-01-19 22:42:02 +08:00
Green first commit 2026-01-16 21:59:36 +08:00
tf_wmap9 first commit 2026-01-16 21:59:36 +08:00
utilities first commit 2026-01-16 21:59:36 +08:00
velocity_conversion first commit 2026-01-16 21:59:36 +08:00
basic_functions.f08 first commit 2026-01-16 21:59:36 +08:00
buffer_grid.f90 first commit 2026-01-16 21:59:36 +08:00
buffer_particle.f90 first commit 2026-01-16 21:59:36 +08:00
checkpoint.f90 first commit 2026-01-16 21:59:36 +08:00
cubefft.f90 first commit 2026-01-16 21:59:36 +08:00
drift.f90 first commit 2026-01-16 21:59:36 +08:00
finalize.f90 first commit 2026-01-16 21:59:36 +08:00
ic.py first commit 2026-01-16 21:59:36 +08:00
initialize.f90 first commit 2026-01-16 21:59:36 +08:00
kick.f90 first commit 2026-01-16 21:59:36 +08:00
main.f90 first commit 2026-01-16 21:59:36 +08:00
Makefile first commit 2026-01-16 21:59:36 +08:00
parameters.f90 first commit 2026-01-16 21:59:36 +08:00
particle_initialization.f90 first commit 2026-01-16 21:59:36 +08:00
particle_mesh.f90 first commit 2026-01-16 21:59:36 +08:00
pencil_fft.f90 first commit 2026-01-16 21:59:36 +08:00
README.md first commit 2026-01-16 21:55:43 +08:00
RUN first commit 2026-01-16 21:59:36 +08:00
timestep.f90 first commit 2026-01-16 21:59:36 +08:00
variables.f90 first commit 2026-01-16 21:59:36 +08:00
z_checkpoint.txt first commit 2026-01-16 21:59:36 +08:00
z_halofind.txt first commit 2026-01-16 21:59:36 +08:00

快速入门

设置参数

在parameters.f90中设置基础参数

  • 环境变量
    • XFLAG_NO_OMP=-O3 -fpp -qopenmp -coarray=distributed -mcmodel=large
    • XFLAG=-O3 -fpp -qopenmp -coarray=distributed -mcmodel=large
    • FFTFLAG=-I/opt/intel/oneapi/mkl/latest/include/fftw/ -qmkl
  • 模拟参数
    • opath: 模拟数据的目录,所有模拟数据快照将存在这里
    • nn: 每一个纬度的节点数
    • box: 模拟的盒子的大小/Mpc
    • ncore: 每一个节点的核心数 > ntram*nnest
    • nteam: 第一层OpenMP并行数
    • nnest: 第二层OpenMP并行数
    • ng: 模拟的标准格点大小
    • nic: 初始条件的格点大小
    • z_checkpoint: 快照点的红移,读取自根目录的 z_checkpoint.txt
  • 宇宙学参数
    • h0: 哈勃常数
    • Mass_nu: 中微子质量和
    • omega_cdm: 冷暗物质质量分数
    • omega_bar: 重子质量分数
    • omega_mhd: 热暗物质质量分数

在initialize.f90中设置

  • read_Gks: 是否读取已有的格林函数,首次运行需为.false.
  • sim%cur_checkpoint: 开始模拟的快照点

在kick.f90中设置

  • PM3: 是否计算PM3的力
  • PP: 是否计算PP力

配置环境

生产初始条件

  • 进入utilities目录
cd utilities
  • 编译初始条件程序ic.x
make ic.x
  • 回到主目录运行ic.x或者提交ic.sh
cd ..
./utilities/ic.x
    or 
sbatch ic.sh

开始模拟

  • 首次运行
    • 编译主程序main.x,并运行或提交main.sh
    make
    ./main.x
    or
    sbatch main.sh
    
  • 断点运行
    • 根据输出或者数据目录确定已完成的快照z = z_checkpoint(i)
    • 设置initialize.f90 line:34
      logical,parameter :: read_Gks=.true.
      
      ···
      
      sim%cur_checkpoint= i 
      
    • 编译运行

故障排查

数据处理

功率谱

  • 设置需要的产物cicpower.f90
    • 计算快照点z_checkpoint(i)到z_checkpoint(j)的功率谱
      do cur_checkpoint= i,j
      
    • 使用gadget的模拟结构
      #define gadget
      ···
      ! read Gadget output
      open(11,file='path_to_gadget_output_file',access='stream')
      
      
    • 获取投影
      #define merge_projection
      
    • 获取中微子密度场
      #define density_nu
      
    • 获取物质密度场
      #define density_matter
      
  • 进行功率谱修正powerspectrum.f90 解除注释
    subroutine auto_power(xi,cube1,n_particle,n_interp)
    
    ···
    
    xi(5,:)=xi(4,:)
    call pk_correction(xi,n_interp,3)
    call pk_correction(xi,n_interp,3)
    call pk_correction(xi,n_interp,3)
    call pk_correction(xi,n_interp,3)
    ! divide and normalize
    
    ···
    
    endsubroutine auto_power
    
  • 编译并运行cicpower.x(参考ic.x)

查找halo

  • 编译并运行fof.x(参考ic.x)