There is no “configuration” step for MPAS, unlike, e.g., for the WRF model - All build flags are either set in the top-level Makefile or on the command-line General MPAS build command:
1
$ make target CORE=core options
target can be either - clean or - gfortran - ifort - nvhpc - llvm - intel-mpi (MPASv8.1.0) ... plus a few others...
For MPAS-Atmosphere, core may be - atmosphere - init_atmosphere
options can be zero or more of - DEBUG=true - AUTOCLEAN=true - PRECISION=single - OPENMP=true
Typical build of both the init_atmosphere and atmosphere cores involves:
make gfortran CORE=init_atmosphere (build init_atmosphere_model)
make clean CORE=atmosphere (clean any infrastructure files used by both init_atmosphere and atmosphere)
make gfortran CORE=atmosphere (build atmosphere_model)
By default, MPAS cores are built with double-precision reals
MPAS-Atmosphere can be built in single precision - Add PRECISION=single to build commands for single-precision executables - execution time ~35% less compared with double-precision - output files approximately half as large
For mpich, - see https://www.mpich.org/static/downloads/4.2.0/mpich-4.2.0-installguide.pdf
echo"Copy MPAS-Model to build-mpas ... " rm -rf build-mpas cp -r MPAS-Model-8.0.0 build-mpas cd build-mpas
############################## init_atmosphere ############################ -g -O0 -fbacktrace if [[ ${do_init_atmosphere} == True ]]; then echo"=== init_atmosphere ===="
make clean CORE=init_atmosphere make clean CORE=atmosphere
# mpas_dmpar.F: # call MPI_Allreduce(inArray, outArray, nElements, MPI_INTEGERKIND, MPI_MAX, dminfo % comm, mpi_ierr) # Warning: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
# make gfortran CORE=init_atmosphere PRECISION=single DEBUG=true USE_PIO2=true >& log_build2.txt
make -j8 gfortran CORE=init_atmosphere PRECISION=single USE_PIO2=true 2>&1 |tee log_build_init.txt
### Check MPAS model. #ls -la init_atmosphere_model echo"=== init_atmosphere (end) ====" : ' ******************************************************************************* MPAS was built with default single-precision reals. Debugging is off. Parallel version is on. Papi libraries are off. TAU Hooks are off. MPAS was built without OpenMP support. MPAS was built with .F files. The native timer interface is being used Using the PIO 2 library. ******************************************************************************* make[1]: Leaving directory /home/wpsze/MPAS-A/mpasv73/MPAS-Model-7.3 If compilation of the init_atmosphere core was successful, we should also have an executable file named init_atmosphere_model ' fi
############################## atmosphere_model ############################ if [[ ${do_atmosphere} == True ]]; then echo"=== atmosphere_model ====" # To preserve all executables except atmosphere_model and clean the MPAS infrastructure, run: make clean CORE=atmosphere
make gfortran CORE=atmosphere PRECISION=single USE_PIO2=true 2>&1 |tee log_build_atm.txt
### Check MPAS model. #ls -la atmosphere_model echo"=== atmosphere_model (end) ====" : ' ******************************************************************************* MPAS was built with default single-precision reals. Debugging is off. Parallel version is on. Papi libraries are off. TAU Hooks are off. MPAS was built without OpenMP support. MPAS was built with .F files. The native timer interface is being used Using the PIO 2 library. ******************************************************************************* '
wait
fi
if [[ -f atmosphere_model ]]; then mkdir -p $HOME/${mpas_version} mv streams.init_atmosphere $HOME/${mpas_version} mv namelist.init_atmosphere $HOME/${mpas_version} mv init_atmosphere_model $HOME/${mpas_version}
############################## MPICH ############################ if [[ ${do_mpich} == True ]]; then #export PATH=$libs_DIR/gcc-v8.3.0/bin:$PATH #export LD_LIBRARY_PATH=$libs_DIR/gcc-v8.3.0/lib:$LD_LIBRARY_PATH #export LD_LIBRARY_PATH=$libs_DIR/gcc-v8.3.0/lib64:$LD_LIBRARY_PATH
echo"=== MPICH ====" cd$download_DIR tar xvf mpich-4.0.2.tar.gz 1>/dev/null 2>&1 # 3.3.1 4.0.2 cd mpich-4.0.2/
./configure --prefix=$libs_DIR --with-device=ch3 #--enable-pic make -j 4 make check make install #make testing cd .. rm -rf mpich-4.0.2 echo"=== MPICH (end) ====" fi
### Compilers ## commment out for mpich !! export SERIAL_FC=gfortran export SERIAL_F77=gfortran export SERIAL_CC=gcc export SERIAL_CXX=g++ export MPI_FC=mpifort export MPI_F77=mpifort export MPI_F90=mpifort export MPI_CC=mpicc export MPI_CXX=mpic++ ### all serial are same as MPI export FC=${MPI_FC} export F77=${MPI_F77} export F90=${MPI_F77} export CC=${MPI_F77} export CXX=${MPI_F77}
############################## zlib ############################ *** zlib test OK *** if [[ ${do_zlib} == True ]]; then echo"=== zlib ====" cd$download_DIR tar xvf zlib-1.2.13.tar.gz 1>/dev/null 2>&1 cd zlib-1.2.13/
./configure --prefix=$libs_DIR#--static make -j 4 make install make check cd .. rm -rf zlib-1.2.13 echo"=== zlib (end) ====" fi
############################## HDF5 ############################ if [[ ${do_hdf5} == True ]]; then echo"=== hdf5 ====" cd$download_DIR tar xvf hdf5-1.12.0.tar.gz 1>/dev/null 2>&1 cd hdf5-1.12.0/
./configure --prefix=$libs_DIR --enable-parallel --with-zlib=$libs_DIR --enable-fortran #--disable-shared make -j 4 make check make install cd .. rm -rf hdf5-1.12.0 echo"=== hdf5 (end) ====" fi
############################## pnetcdf ############################ PnetCDF has been successfully installed if [[ ${do_pnetcdf} == True ]]; then echo"=== pnetcdf ====" cd$download_DIR tar xvf pnetcdf-1.11.2.tar.gz 1>/dev/null 2>&1 cd pnetcdf-1.11.2/
./configure --prefix=$libs_DIR make -j 4 make check make ptest make testing make install cd .. rm -rf pnetcdf-1.11.2 echo"=== pnetcdf (end) ====" fi
############################## netcdf-C ############################ Congratulations! You have successfully installed netCDF! if [[ ${do_netcdfC} == True ]]; then echo"=== netcdf-C ====" ## -disable-dap:--disable-dap的原因是缺少一个‘curl’的lib ## 4.1.3以后的版本Fortran和C分开了。把disable--netcdf-4 写进去也无所谓 cd$download_DIR tar xvf netcdf-c-4.7.4.tar.gz 1>/dev/null 2>&1 cd netcdf-c-4.7.4/
# have to define below parameters export FC=mpifort export F77=mpifort export F90=mpifort export CC=mpicc export CXX=mpic++
make -j 4 make check make install cd .. rm -rf netcdf-fortran-4.5.3 echo"=== netcdf-F (end) ====" fi
############################## Pio ############################ if [[ ${do_pio} == True ]]; then echo"=== PIO ====" cd$download_DIR tar xvf ParallelIO-pio2_5_8.tar.gz 1>/dev/null 2>&1 cd ParallelIO-pio2_5_8/
export CC=mpicc export FC=mpif90 #./configure --prefix=$libs_DIR --enable-fortran #cmake -DNetCDF_C_PATH=$libs_DIR -DNetCDF_Fortran_PATH=$libs_DIR -DPnetCDF_PATH=$libs_DIR -DPIO_ENABLE_TIMING=OFF -DCMAKE_INSTALL_PREFIX=$libs_DIR cmake -DNetCDF_C_PATH=$NETCDF -DNetCDF_Fortran_PATH=$NETCDF -DPnetCDF_PATH=$PNETCDF -DHDF5_PATH=$libs_DIR -DCMAKE_INSTALL_PREFIX=$libs_DIR -DPIO_USE_MALLOC=ON -DCMAKE_VERBOSE_MAKEFILE=1 -DPIO_ENABLE_TIMING=OFF ./ make #make check make install cd .. rm -rf ParallelIO-pio2_5_8 echo"=== PIO (end) ====" fi
############################## metis ############################ if [[ ${do_metis} == True ]]; then echo"=== metis ====" cd$download_DIR tar xvf metis-5.1.0.tar.gz 1>/dev/null 2>&1 cd metis-5.1.0/ #./configure --prefix=$libs_DIR
make config prefix=$libs_DIR make #make check make install cd .. rm -rf metis-5.1.0 echo"=== metis (end) ====" fi
MPAS Version 8.2.0 This release of MPAS introduces several significant changes to MPAS-Atmosphere.
New physics
The Noah-MP v5.0.1 land-surface model is now available by setting
config_lsm_scheme = 'sf_noahmp' in the &physics namelist group.
New static files that include the soilcomp, soilcl1, soilcl2, soilcl3, and soilcl4 fields are required when activating Noah-MP in the model.
The aerosol-aware Thompson microphysics (as in WRF v4.1.4) is available by setting config_microp_scheme = 'mp_thompson_aerosols' in the &physics namelist group.
An aerosol climatology file (QNWFA_QNIFA_SIGMA_MONTHLY.dat) is used when running the init_atmosphere_model program to produce initial and lateral boundary conditions for nifa and nwfa.
It includes Noah-MP, so have to download Noah-MP Geographical Input Data (soilgrids).