Home > User’s guide > 1. How to install the software > 1.1. Export off-line version of SURFEX (until version 7.1 included)

1.1. Export off-line version of SURFEX (until version 7.1 included)

Instructions to install surfex on a linux-PC and to run a 1d example.

  1. select a directory where installation has to be done: for example $HOME or $HOME/MYDIR, where MYDIR is an existing directory (if not, it has to be created by the user).
    From now on, it is supposed that the user has defined a MYDIR directory.

  2. download EXPORT_v7.1.gz and move it into $HOME/MYDIR/EXPORT_v7.1.gz

  3. extract files from archive: tar zxvf EXPORT_v7.1.gz (or gunzip EXPORT_v7.1.gz and then tar xvf EXPORT_v7.1.tar) at this stage directory EXPORT_v7.1 is created in MYDIR and contains all software peaces.

  4. initialize environment variables needed for surfex:
    1. set main environment variable:
    3. then run a configuration script included in the archive:
    4. . $SURFEX_EXPORT/conf/profile_surfex

  5. run install_surfex:
    if your linux distribution is ubuntu, don't run install_surfex but install_surfex_ubuntu.
    install_surfex / install_surfex_ubuntu:
    1. realizes the compilation of surfex sources
    2. prepares executable files for pgd, prep, offline and sxpost applications stored in $SURFEX_EXPORT/src/exe directory
      If everything goes well until this step, then surfex has been successfully installed on you computer.

  6. How to install a pre-defined experiment:
    1. go to $SURFEX_EXPERIMENT/forcing directory
    2. run 1_compile_and_link.bash script in order to prepare executable that will then be used to install an experiment.
    3. run 2_prepare_files.bash to know the available experiments
    4. run 2_prepare_files.bash with a name of experiment as argument:
      for example "2_prepare_files.bash hapex"
      a namelist MY_PARAM.nam will open (vi editor), simply quit (use command :q)
      Some information will then be written on the screen and should look like:
      -- namelist NAM_MY_PARAM read
      > ==========================================
      > ===========================================
      -rw-r--r-- 1 lemoigne mc2 1543644 jui 22 16:51 /home/lemoigne/surfex/EXPORT_v7.0//EXP/forcing/FORCING.nc
      -rw-r--r-- 1 lemoigne mc2 644 jui 22 16:51 /home/lemoigne/surfex/EXPORT_v7.0//EXP/forcing/PARAMS.nc
      > input files moved to /home/lemoigne/surfex/EXPORT_v7.0//EXP/rundir/hapex

  7. once the installation is done, go to $SURFEX_EXPERIMENT/rundir/hapex directory and launch successively:
    1. pgd.exe
    2. prep.exe
    3. offline.exe

  8. to view output 1d, you can use vespa tool. Type vespa to get available fields and then vespa FIELDNAME to plot FIELDNAME

  9. How to rerun a pre-defined experiment with new inputs:

    1. you can define new surface characteristics by modifying file $SURFEX_EXPERIMENT/rundir/hapex/OPTIONS.nam and then run pgd.exe, prep.exe and offline.exe
    2. you can define new initial values for state variables by modifying file $SURFEX_EXPERIMENT/rundir/hapex/OPTIONS.nam and then run prep.exe and offline.exe
    3. you can modify the forcing characteristics
      1. you can rerun $SURFEX_EXPERIMENT/forcing/2_prepapre_files.bash and modify namelist MY_PARAM to select the number of time steps you want to treat (parameter NUMBER_OF_TIME_STEPS_FINAL) the format of the input forcing files (parameter YFORCING_FILETYPE)
      2. then go to $SURFEX_EXPERIMENT/rundir/hapex and rerun pgd.exe, prep.exe and offline.exe

  10. How to create a new experiment:
    1. you need to modify $SURFEX_EXPERIMENT/forcing/src/my_forcing.f90 to introduce the call to the new program that is going to read your dataset
    2. you need to create a new subroutine named $SURFEX_EXPERIMENT/forcing/src/my_forc_xxxx.f90 that corresponds to experiment xxxx
    3. go then to $SURFEX_EXPERIMENT/forcing and run successively:
      1. 1_compile_and_link.bash (to account for your new subroutine)
      2. 2_prepare_files.bash (to create input files related to your experiment)
      3. then go to $SURFEX_EXPERIMENT/rundir/xxxx and run pgd.exe, prep.exe and offline.exe

  11. How to compile your own source for surfex
    1. cp the sources (from OFF_LINE or SURFEX directories) that you want to modify onto $SURFEX_EXPORT/src/MYSRC
    2. go to $SURFEX_EXPORT/src/MYSRC and make your modifications
    3. go to $SURFEX_EXPORT/src and simply launch command "make" new executable files will be created in exe directory and will replace the old ones.

  12. How to include the BUGFIX (when exists)
    1. download BUGFIX_EXPORT_v7.1.gz
    2. extract files from archive BUGFIX_EXPORT_v7.1.gz, a directory named MYSRC and containing bug fixes will be created
    3. place extracted MYSRC in $SURFEX_EXPORT/src/ as replacement of the old one
    4. go to $SURFEX_EXPORT/src and simply launch command "make" new executable files will be created in exe directory and will replace the old ones.

| Site Map | Download in pdf format | Legal notices | Follow site activity RSS 2.0 | Top of the page | SPIP | ScolaSPIP