Compile for Tianhe

without parallel

environment

module load zlib/1.2.6
module load Intel_compiler/13.0
module load autoconf/2.69

install precedure automake libtool & autoconf
Then install omp 4.0.5

compile omp

export HDF5=${HOME}/CESM/hdf5-intel
export PATH=\$HDF5/bin:\$PATH
export LD_LIBRARY_PATH=\$HDF5/lib:\$LD_LIBRARY_PATH
export INCLUDE=\$HDF5/include:$INCLUDE
export CPPFLAGS=-I\$HDF5/include
export LDFLAGS=-L\$HDF5/lib

netcdf-c

CC=icc CXX=icpc FC=ifort ./configure --prefix=${HOME}/CESM/netcdf-c-intel --enable-parallel-tests --di^Cble-dap

with parallel

本机的不能用

         SUMMARY OF THE HDF5 CONFIGURATION
            =================================

General Information:
-------------------
                   HDF5 Version: 1.12.0
                  Configured on: Tue Sep 15 00:26:24 CST 2020
                  Configured by: shlwang@ln8
                    Host system: x86_64-unknown-linux-gnu
              Uname information: Linux ln8 2.6.32-358.11.1.2.ky3.1.x86_64 #1 SMP Mon Jul 8 13:05:58 CST 2013 x86_64 x86_64 x86_64 GNU/Linux
                       Byte sex: little-endian
             Installation point: ${HOME}/CESM/hdf5-intel-parallel

Compiling Options:
------------------
                     Build Mode: debug
              Debugging Symbols: yes
                        Asserts: yes
                      Profiling: no
             Optimization Level: debug

Linking Options:
----------------
                      Libraries: static, shared
  Statically Linked Executables:
                        LDFLAGS: -L${HOME}/CESM/hdf5-intel/lib
                     H5_LDFLAGS:
                     AM_LDFLAGS:
                Extra libraries: -lz -ldl -lm
                       Archiver: ar
                       AR_FLAGS: cr
                         Ranlib: ranlib

Languages:
----------
                              C: yes
                     C Compiler: /THL4/software/mpi/mpi-intel2013/bin/mpicc ( MPICH version 3.0.4 built with icc version 13.0.0 (gcc version 4.7.0 compatibility))
                       CPPFLAGS: -I${HOME}/CESM/hdf5-intel/include
                    H5_CPPFLAGS: -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L   -UNDEBUG -DH5AC_DEBUG -DH5B2_DEBUG -DH5CX_DEBUG -DH5D_DEBUG -DH5F_DEBUG -DH5HL_DEBUG -DH5I_DEBUG -DH5O_DEBUG -DH5S_DEBUG -DH5ST_DEBUG -DH5T_DEBUG -DH5Z_DEBUG -DH5_DEBUG_API
                    AM_CPPFLAGS:
                        C Flags:
                     H5 C Flags:   -std=c99 -Wall -Wcheck  -g  -O0
                     AM C Flags:
               Shared C Library: yes
               Static C Library: yes


                        Fortran: no

                            C++: no

                           Java: no


Features:
---------
                   Parallel HDF5: yes
Parallel Filtered Dataset Writes: yes
              Large Parallel I/O: yes
              High-level library: yes
                Build HDF5 Tests: yes
                Build HDF5 Tools: yes
                    Threadsafety: no
             Default API mapping: v112
  With deprecated public symbols: yes
          I/O filters (external): deflate(zlib)
                             MPE:
                   Map (H5M) API: no
                      Direct VFD: no
              (Read-Only) S3 VFD: no
            (Read-Only) HDFS VFD: no
                         dmalloc: no
  Packages w/ extra debug output: AC,B2,CX,D,F,HL,I,O,S,ST,T,Z
                     API tracing: yes
            Using memory checker: no
 Memory allocation sanity checks: yes
          Function stack tracing: no
       Strict file format checks: yes
    Optimization instrumentation: yes

comepiled MPIIO for HDF5

compiled pnet for HDF5

CC=icc CXX=icpc FC=ifort ./configure –prefix=${HOME}/CESM/netcdf-c-intel –enable-parallel-tests –disable-dap

# NetCDF C Configuration Summary
==============================

# General
-------
NetCDF Version:         4.7.4
Dispatch Version:       2
Configured On:          Tue Sep 15 00:51:19 CST 2020
Host System:            x86_64-pc-linux-gnu
Build Directory:        ${HOME}/CESM2/netcdf-c-4.7.4
Install Prefix:         ${HOME}/CESM/netcdf-c-intel-parallel

# Compiling Options
-----------------
C Compiler:             /THL4/software/mpi/mpi-intel2013/bin/mpicc
CFLAGS:
CPPFLAGS:               -I${HOME}/CESM/hdf5-intel-parallel/include
LDFLAGS:                -L${HOME}/CESM/hdf5-intel-parallel/lib
AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library:         yes
Static Library:         yes
Extra libraries:        -lhdf5_hl -lhdf5 -lm -lz

# Features
--------
NetCDF-2 API:           yes
HDF4 Support:           no
HDF5 Support:           yes
NetCDF-4 API:           yes
NC-4 Parallel Support:  yes
PnetCDF Support:        no
DAP2 Support:           no
DAP4 Support:           no
Byte-Range Support:     no
Diskless Support:       yes
MMap Support:           no
JNA Support:            no
CDF5 Support:           yes
ERANGE Fill Support:    no
Relaxed Boundary Check: yes
SZIP Support:           no
SZIP Write Support:     no
Parallel Filters:       yes

修改xml credit:MrXun_

$ vim Macros.make
# 修改以下内容
MPIFC := mpiif90
MPICC := mpiicc
MPICXX := mpiicxx
# 在 endif 后面加入
NETCDF_PATH := 你的NetCDF安装路径
HDF5_PATH :=  你的HDF5安装路径

SLIBS += -L${NETCDF_PATH}/lib -lnetcdff -lnetcdf -L${HDF5_PATH}/lib -lhdf5_hl -lhdf5 -ldl -lm -lz -lcurl -L${MKLROOT}/lib/intel64 -lmkl_rt -lpthread -ldl
LDFLAGS += -L${NETCDF_PATH}/lib -lnetcdff -lnetcdf -L${HDF5_PATH}/lib -lhdf5_hl -lhdf5 -ld -lm -lz -lcurl -L${MKLROOT}/lib/intel64 -lmkl_rt -lpthread-ldl

# 注释下面的代码
#ifeq ($(MPILIB),mvapich2)
#SLIBS := $(SLIBS) #-mkl=cluster
#endif
#ifeq ($(MPILIB),mpich2)
#SLIBS := $(SLIBS) #-mkl=cluster
#endif
#ifeq ($(MPILIB),mpt)
#SLIBS := $(SLIBS) #-mkl=cluster
#endif
#ifeq ($(MPILIB),openmpi)
#SLIBS := $(SLIBS) #-mkl=cluster
#endif
#ifeq ($(MPILIB),mpich)
#SLIBS := $(SLIBS) #-mkl=cluster
#endif
#ifeq ($(MPILIB),mvapich)
#SLIBS := $(SLIBS) #-mkl=cluster
#endif
#ifeq ($(MPILIB),impi)
#SLIBS := $(SLIBS) #-mkl=cluster
#endif
#ifeq ($(MPILIB),mpi-serial)
#SLIBS := $(SLIBS) #-mkl
#endif

如何创建

/create_newcase --case /data/gpfs01/$USER/cases/g.e20.G1850ECO.f19_g17.test --compset G1850ECO --res f19_g17 --run-unsupported   (蓝色标注部分为 创建案例的路径,需修改)
用xmlchange命令修改设定,比如
./xmlchange NTASKS=12
./xmlchange STOP_OPTION=nmonths, STOP_N=5
之后setup、build、submit任务即可:
./case.setup
./case.build
./case.submit