Procedure - Build NEMO

  1. Download the NEMO package. Obtain the reference version from the NEMPGCM SVN repository.

    svn co
    cd NEMOGCM
  2. Create an arch-aarch64_arm.fcm file in the ARCH directory to contain the details of the compiler, build flags, and the locations of the various libraries required:

    # generic gfortran compiler options for linux
    # NCDF_INC    netcdf include file
    # NCDF_LIB    netcdf library
    # FC          Fortran compiler command
    # FCFLAGS     Fortran compiler flags
    # FFLAGS      Fortran 77 compiler flags
    # LD          linker
    # LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
    # FPPFLAGS    pre-processing flags
    # AR          assembler
    # ARFLAGS     assembler flags
    # MK          make
    # USER_INC    additional include files for the compiler,  e.g. -I<include dir>
    # USER_LIB    additional libraries to pass to the linker, e.g. -l<library>
    # CC          C compiler used to compile conv for AGRIF
    # CFLAGS      compiler flags used with CC
    # Note that:         
    #  - unix variables "$..." are accepted and will be evaluated before calling fcm.
    #  - fcm variables are starting with a % (and not a $)

    %NCDF_HOME           $NETCDF_DIR
    %HDF5_HOME           $HDF_DIR
    %XIOS_HOME           $XIOS_DIR

    %NCDF_LIB            -L$HDF_LIBRARY_DIR -L$NETCDF_LIBRARY_DIR -lnetcdf -lnetcdff
    %XIOS_INC            -I%XIOS_HOME/inc
    %XIOS_LIB            -L%XIOS_HOME/lib -lxios

    %CPP                 cpp
    %FC                  mpifort
    %FCFLAGS             -cpp -r8 -O3 -march=armv8.1-a -mcpu=native -ffp-contract=fast -fcray-pointer
    %FFLAGS              %FCFLAGS
    %LD                  mpif90
    %LDFLAGS             -lstdc++
    %FPPFLAGS            -P -C -traditional
    %AR                  ar
    %ARFLAGS             -rs
    %MK                  gmake
    #%USER_INC            %NCDF_INC
    #%USER_LIB            %NCDF_LIB
    %USER_INC            %XIOS_INC %NCDF_INC -I$ARMPL_DIR/include
    %USER_LIB            %XIOS_LIB %NCDF_LIB -L$ARMPL_DIR/lib -lamath

    %CC                  armclang
    %CFLAGS              -O0

    Note: References to -lmath (including the ArmPL lib and include directories) are optional and can be omitted. Linking against libamath provides optimized versions of common math functions, such as exp, pow, and similar.

  3. Move to the CONFIG directory and build NEMO using the AMM12 config:

    cd CONFIG
    ./makenemo -m aarch64_arm -r AMM12 -n 'MY_AMM12' add_key key_nosignedzero
  4. Test the build:

    1. Download the AMM12 test data for NEMO 3.6 into the MY_AMM12/EXP00 directory:

      cd MY_AMM12/EXP00
    2. Unpack and uncompress:

      tar xf AMM12_v3.6.tar
      gunzip *.gz */*.gz
    3. Run the MPI job:

      Note: Set the number of MPI tasks to suit your system by substituting 56 with the number of tasks you wish to test with.

      mpirun -np 56 ./opa
Previous Next