Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. You want to use CDO, a popular tool to manipulate climate and NWP model data. What do you need to do to get the following result?

    No Format
    $ cdo --version
    Climate Data Operators version X.Y.Z (https://mpimet.mpg.de/cdo)
    System: x86_64-pc-linux-gnu
    ...


    Expand
    titleSolution

    If you run the command without any prior action, you may get:

    No Format
    $ cdo --version
    -bash: cdo: command not found

    Many software packages and tools are not part of your default environment, and need to be explicitly loaded via modules.

    So the following commands would be sufficient to get to the desired result:

    No Format
    module load cdo
    cdo --version


    Tip
    titleml shortcut

    You can also use the ml shortcut to load the module

    No Format
    ml cdo


    Note that we did not ask for any specific version. In those cases, you will get the one defined as default.


  2. How many versions of CDO can be used at ECMWF? Can you pick the newest?

    Expand
    titleSolution

    There are hundreds of different packages with their corresponding different versions installed at ECMWF. You can use:

    No Format
    module avail

    To see what modules can be loaded at any time.

    However, not all modules can be loaded at any time, some will only become available if a certain combination of modules is loaded.

    You can also use the following command for an overview or all the packages that are installed, including those that may not be visible in module avail:

    No Format
    module spider

    In this case we are only interested in CDO so we can do either:

    No Format
    module avail cdo

    or 

    No Format
    module spider cdo

    To load the newest, you can either explicitly pick up the latest version explicitly, so assuming that it was "X.Y.Z":

    No Format
    module load cdo/X.Y.Z

    But you can also use the module tag "new":

    No Format
    module load cdo/new

    or also ask for the latest with:

    No Format
    module --latest load cdo


    Tip
    titleNo swap needed

    If you had another version of the module loaded, the system will automatically swap it by the new one requested.



  3. Load the netcdf4 module. Can you see what modules do you have loaded in your environment now?

    Expand
    titleSolution

    To load the netcdf4 module just do:

    No Format
    module load netcdf4

    Then, you can see what your software environment looks like with:

    No Format
    module list

    or with just the shortcut:

    No Format
    ml

    You should see both the CDO and netcdf4, beside the default modules loaded in your environment.


  4. Remove the netcdf4 module from your environment and check it is gone/

    Expand
    titleSolution

    To unload the netcdf4 module just do:

    No Format
    module unload netcdf4

    or with just the shortcut:

    No Format
    ml -netcdf4

    Then, you can see what your software environment looks like with:

    No Format
    module list



  5. Can you restore the default environment you had when you logged in? Check that that the environment is back to the desired state.

    Expand
    titleSolution

    If you log out of your session, next time you log in you will start with a fresh default environment. Modules are only loaded for that specific session.

    However, if you don't want to log out, you can also reset your module environment with:

    No Format
    module reset

    You can then check the effects with

    No Format
    module list


    Tip
    titlereset vs purge

    There is a subtile difference between module reset and module purge. While the former will go back the default environment, which typically contains some default modules, the latter will completely unload all modules and leave you with a blank environment.