yorick banner

Home

Manual

Packages

Global Index

Keywords

Quick Reference



#include "Chris/randfield.i"
#include "Eric/regul.i"
#include "Eric/fft_utils.i"
#include "Chris/gadget.i"
#include "Eric/random.i"


func RMakeIC (seed,npart,boxsize,omegam,omegav,ramses=,dir=)
{
  
  cd,"$HOME/ramses/GRAFIC";
  cur_d=get_cwd();
  if(is_void(dir)) dir=".";
  
  dx=array(float);
  x1o=array(float);
  x2o=array(float);
  x3o=array(float);
  astart=array(float);
 
  h0=array(float);

  boxsize/=1000.;
  
  gg=open("grafic1.inc","w");
  write,gg,"       "+"integer offvelb,offvelc";
  write,gg,"       "+"parameter (offvelb=0,offvelc=+1)";
  write,gg,"       "+"real sigstart";
  write,gg,"       "+"parameter (sigstart=0.2)";
  write,gg,"       "+"integer np1,np2,np3";
  write,gg,"       "+"parameter (np1="+pr1(npart)+",np2="+pr1(npart)+",np3="+pr1(npart)+")";
  
  close,gg;

  if(omegav==0)
    {
      s8=-0.52*omegam^(-0.46+0.1*omegam);
    }
  else
    {
      s8=-0.52*omegam^(-0.52+0.13*omegam);
    }

  write,"**************************";
  write,"        Cosmology         ";
  write," Omegam =",omegam;
  write," Omegav =",omegav;
  write," s8     =",s8;
  write,"**************************";
  
  if(!is_void(ramses)){ system,"make -f Makefile.ramses clean; make -f Makefile.ramses grafic1";} else  system," make clean; make grafic1";
  commande=swrite(format="Run_Grafic %3g %3g %09d %5g %5g %5g",boxsize,-boxsize,seed,omegam,omegav,s8);
  write,commande;
  
  print,"Grafic is running ...";
  system,commande;
  cd,cur_d;
  system,"\mv ic_* "+dir;
  return dir;
}