runCGS [parameter=value]
The code computes the potential on an (adaptive) grid, by expanding the density in spherical harmonics. Forces are then computed by numerical differentiation, and particles are advanced by a global but variable time-step using a leap-frog scheme.
The code consists of an original (fortran based) executable, CGS, plus a NEMO style wrapper, named runCGS. Since the fortran executable assumes files with a fixed name, it can be somewhat cumbersome to run multiple sets of simulations with different input parameters. A simple frontend organizes a directories structure and places their output in these run directories, as well as optionally handles I/O to/from NEMO snapshot(5NEMO) files.
A detailed code description can be found in Trenti M. (2005), PhD Thesis, Scuola Normale Superiore Pisa (Italy) [mainly Chapter 3]. A copy of the thesis is in $NEMO/usr/trenti/CGS/doc/.
$NEMO/usr/trenti/CGS/doc/PhDthesis.pdf file - documentation $NEMO/usr/trenti/CGS/doc/2005AAP...433...57T.pdf - paper PARAMETER.DAT basic input parameters (see below for details) initPOS.dat input positions if flag=3 initVEL.dat input velocities if flag=3 init_virial.dat input virial ratio if flag=2 fort.2 various diagnostics output (heritage from the original van Albada 1982 version) fort.11 inner lagrangian radii vs time fort.12 outer lagrangian radii vs time fort.13 radial and tangential velocity dispersions fort.14 total radial and tangential kinetic energy fort.16 inertia tensor eigenvalues vs. time fort.17 ellipticity ratios b/a and c/a vs. time fort.18 density computed over the radial grid vs. time fort.19 time, angular momentum components, and mean shape parameter or orbits fort.20 time, total energy, virial ratio -2K/W, total angular momentum fort.28 same as fort.18, but for bound particles fort.33 same as fort.13, but for bound particles fort.34 same as fort.14, but for bound particles fort.90 one or more snapshots (one line header plus index,pc/os,vel data in a table) snap.out Output snapshots, in NEMO’s snapshot(5NEMO) format. Note no masses present!
Sample PARAMETER.DAT initialization file (the default benchmark):
80 !RADIAL GRID NUMBER 40000 !NUMBER OF PARTICLES 1000 !NUMBER OF STEPS (MAX) 2000 !NUMBER OF TIME STEPS FOR CMSS CALL 50 !NUMBER OF TIME STEPS FOR DIAGNOSTIC CALL 10 !NUMBER OF TIME STEPS FOR WRITING SNAPSHOTS 0.0025 !TIME STEP OF INTEGRATION 0. !START TIME OF SIMULATION 4. !END TIME OF SIMULATION 1. !TOTAL MASS OF SYSTEM 1 !PLUMMER INIT CONDITION FLAG (1=true) 0.01 !MAX ALLOWED DT --> MDT 0.001 !MIN ALLOWED DT
% runCGS out=bench1
common.blk: parameter(NPMAX=2000000) Max number of particles common.blk: parameter(NRGMAX=501) Max number of radial grids common.blk: parameter(NHAR=4) Number of harmonics used [NHAR <= LMAX-1] common.blk: parameter(LMAX=7) Legendre Polynomials (do not modify) common.blk: parameter(NCE=28) Max number of Spherical Harmonics Coefficients (do not modify)
P4/1.6 325.9 (g77 3.2.3) P4/1.6 292.7 (gfortran 4.0.1) P4/1.6 195.9 (intel 8.1) G5/1.6 218.5 (g77 3.5.0) AMD64/ 130.3 (g77 3.4.2) Xeon-X5660@2.80GHz 79.4 (gfortran_4.4.7 -O3) - gaia i7-8550U @ 1.80GHz 43.4 (gfortran_7.3.0 -O3) - T480 i7-3820 @ 3.60GHz 52.5 (gfortran_4.4.7 -O3) - dante i7-3820 @ 3.60GHz 31.7 (ifort_12.1.0 -O3) - dante i5-1135G7 @ 2.40GHz 26.0 (gfortran 9.2.0 -O3) - XPS13 i5-1135G7 @ 2.40GHz 13.4 (flang 7.0.1 -O3) - XPS13You can run the command either as:
% make bench2 which is % /usr/bin/time runCGS out=bench1 nemo=f or % /usr/bin/time CGSAdding nemo=t (the default) would add about 15%.
tabtos $old/fort.90 snap90 nbody,time skip,pos,vel,acc,phi
Trenti, M. (2005), PhD Thesis, Pisa (see Chapter 3 for many details on the code) Trenti, M. Bertin, G. and van Albada, T.S. (2005) A&A 433, 57 van Albada, T.S. (1982), MNRAS, 201, 939. Dissipationless galaxy formation and the R to the 1/4-power law van Albada, T.S. & van Gorkum, J.H. (1977) A&A,54,121. Experimental Stellar Dynamics for Systems with Axial SymmetryThe first two listed papers by Trenti can be found with the code distribution, see also FILES.
Trenti, M. Bertin, G. and van Albada, T.S. (2005) A&A 433, 57
2003 original version M. Trenti & T.van Albada 3-nov-05 V0.1 alpha release testing PJT 12-dec-05 V0.2 writing simple pos/vel snapshots using freqout= MT/PJT 22-mar-06 V0.5 writing potential and forces to output MT 22-may-06 V1.0 released within NEMO MT/PJT