Steps	  for	  Install	  and	  run	  RAPID	  in	  less	  than	  an	  hour	  By	  Ahmad	  Tavakoly	  and	  Abdoul	  Oubeidillah	  	  (partly	  based	  on	  documents	  by	  Cédric	  H.	  David)	  15	  June	  2015	  Introduction	  In	  this	  short	  document	  we	  explain	  how	  to	  quickly	  implement	  a	  regular	  run	  of	  RAPID.	  	  Everything	  in	  this	  tutorial	  uses	  files	  that	  are	  openly	  available	  online,	  except	  for	  this	  particular	  example	  simulation	  files	  which	  are	  hosted	  on	  the	  machine	  used	  by	  participants	  of	  the	  National	  Flood	  Interoperability	  Experiment	  (NFIE)	  Summer	  Institute.	  	  However,	  similar	  files	  are	  available	  at:	  http://dx.doi.org/10.5281/zenodo.16565	  for	  a	  smaller	  domain.	  

Download	  the	  RAPID	  source	  code	  	  Login	  to	  the	  Linux	  machine	  and	  type	  the	  following	  command:	  	  git clone https://github.com/c-h-david/rapid.git
It	  will	  get	  the	  latest	  version	  of	  RAPID	  from	  the	  RAPID	  website:	  	  RAPID	  prerequisites	  	  A	  few	  libraries	  should	  be	  installed	  in	  order	  to	  run	  RAPID.	  A	  shell	  script	  prepared	  by	  Alan	  Snow	  and	  allowing	  downloading	  and	  installing	  the	  necessary	  libraries	  is	  available	  on	  the	  RAPID	  website:	  	  	  We	  recommend	  downloading	  and	  installing	  the	  libraries	  in	  the	  home	  directory;	  even	  you	  will	  be	  running	  RAPID	  from	  a	  work	  directory.	  	  To	  go	  to	  your	  home	  directory,	  use:	  cd ~The	  shell	  script	  can	  now	  be	  downloaded	  using	  the	  following	  command:	  wget http://rapid-hub.org/data/rapid_install_prereqs.sh.gz
Decompress	  the	  file	  by	  running:	  gunzip rapid_install_prereqs.sh.gz

Edit	  (using	  a	  text	  editor	  like	  vi)	  the	  name	  of	  the	  directory	  in	  which	  all	  libraries	  will	  be	  installed,	  here	  we	  use	  the	  name	  rapid	  for	  the	  directory	  name:	  	  Run	  the	  shell	  script	  using	  by	  the	  following	  command:	  ./rapid_install_prereqs.sh
Once	  the	  libraries	  and	  downloaded	  and	  installed,	  do	  not	  rename	  any	  of	  the	  installation	  folders,	  and	  do	  not	  move	  any	  of	  the	  installation	  folders.	  	  Such	  would	  break	  your	  install.	  
In	  the	  following,	  you’ll	  need	  the	  absolute	  path	  of	  your	  where	  you	  installed	  all	  libraries.	  	  To	  do	  that,	  use	  pwd.	  	  In	  our	  example:	  	  	  	  Set	  environmental	  variables	  RAPID	  will	  know	  where	  the	  libraries	  are	  installed	  based	  on	  a	  few	  environment	  variables	  (i.e.	  shortcuts).	  
Based	  on	  the	  full	  path	  mentioned	  above	  (adapt	  your	  installation	  based	  on	  your	  own	  full	  path)	  specify	  the	  variables	  using:	  	  	  export TACC_NETCDF_LIB='/home1/03295/tg825940/rapid/installz/netcdf3.6.3-install/lib'
export TACC_NETCDF_INC='/home1/03295/tg825940/rapid/installz/netcdf3.6.3-install/include'
export PETSC_DIR='/home1/03295/tg825940/rapid/installz/petsc-3.3-p7'
export PETSC_ARCH='linux-gcc-cxx'
export TAO_DIR='/home1/03295/tg825940/rapid/installz/tao-2.1-p2'
export PATH=$PATH:/$PETSC_DIR/PETSC_ARCH/bin
export PATH=$PATH:/home1/03295/tg825940/rapid/installz/netcdf-3.6.3install/bin
More	  information	  can	  be	  found	  in	  one	  of	  the	  documents	  on	  the	  RAPID	  website:	  “Compile	  and	  run	  RAPID	  on	  the	  Microsoft	  Azure	  Cloud”;	  (http://rapid-­‐hub.org/docs/RAPID_Azure.pdf).	  The	  screenshot	  from	  the	  section	  of	  the	  document	  that	  we	  used	  is	  shown	  below:	  	  	  You	  can	  edit	  the	  .bashrc	  file	  using	  a	  text	  editor	  such	  as	  	  “vi”.	  	  Reload	  the	  .bashrc	  	  file	  by	  either	  logging	  out	  and	  logging	  back	  in	  or	  by	  typing	  source ~/.bashrc	  	  on	  the	  terminal.	  This	  insures	  that	  every	  time	  the	  computer	  starts,	  those	  environment	  variables	  are	  set.	  	  Optionally,	  you	  can	  set	  the	  environment	  variables	  by	  just	  typing	  those	  commands	  on	  a	  terminal	  window	  and	  continue	  the	  rapid	  install	  steps	  on	  the	  same	  window	  without	  closing	  it.	  

Compile	  RAPID	  Once	  the	  environment	  variables	  are	  set,	  we	  can	  compile	  RAPID,	  to	  do	  this,	  use	  the	  following	  command	  in	  the	  source	  directory	  (src):	  make rapid
You	  should	  be	  able	  to	  see	  the	  rapid	  executable	  in	  the	  src	  directory:	  	  	  	  	  	  	  	  Run	  RAPID	  	  (This	  particular	  section	  uses	  files	  that	  are	  not	  currently	  openly	  available	  online.)	  	  	  The	  input	  files	  are	  located	  at:	  /work/03295/tg825940/aat669/rapid/input/Reg12/The	  namelist	  is	  located	  at:	  /work/03295/tg825940/aat669/rapid/run/rapid_namelist_Reg12Copy	  these	  files	  in	  your	  own	  RAPID	  folder.	  
RAPID	  is	  run	  in	  the	  run	  directory.	  	  Use	  the	  following	  line	  to	  link	  to	  the	  default	  namelist	  name	  to	  the	  namelist	  of	  the	  project:	  ln -s ../../rapid_project/rapid_unified/rapid_namelist_Reg12
rapid_namelist
The	  last	  step	  is	  to	  Run	  RAPID.	  Type	  the	  following	  short	  command:	  ./rapid
You	  are	  done!	  	  Take	  a	  coffee	  break	  before	  digging	  to	  the	  results.