nuistjdc的个人博客分享 http://blog.sciencenet.cn/u/nuistjdc

博文

关于CESM模式移植、运行过程中遇到的一些问题

已有 16337 次阅读 2014-8-27 12:54 |系统分类:科研笔记

   最近,尝试着调试CESM(1.2.2)模式,虽然迄今为止还没有成功运行,但是遇到了很多问题,中间无数次的想放弃,前前后后差不多两个星期,未来如果可以成功运行CESM的话,将会完善这篇攻略,今天写把刚遇到的问题记下来。


问题1:

WARNING: did not find netcdf fortran library
NETCDF built with hdf5 MPIIO support
-- Could NOT find HDF5 (missing:  HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
-- Could NOT find NETCDF (missing:  NETCDF_Fortran_LIBRARY)
CMake Warning at CMakeLists.txt:63 (MESSAGE):
 Warning: Not building with PNetcdf - cannot run all regression tests.


需要修改:

scripts/ccsm_utils/CMake/FindNETCDF.cmake

===============

Index: FindNETCDF.cmake =================================================================== --- FindNETCDF.cmake (revision 44) +++ FindNETCDF.cmake (working copy) @@ -21,14 +21,14 @@ NO_DEFAULT_PATH ) #MESSAGE("PAR_H: ${NETCDF4_PAR_H}") -set(NETCDF_C_LIBRARY "-L${NETCDF_LIB_DIR} -lnetcdf") +find_library(NETCDF_C_LIBRARY NAMES libnetcdf.a netcdf HINTS ${NETCDF_LIB_DIR}) if(NOT NETCDF_FORTRAN_LIB_DIR) MESSAGE("WARNING: did not find netcdf fortran library") else() - set(NETCDF_Fortran_LIBRARY "-L${NETCDF_LIB_DIR} -lnetcdff") + find_library(NETCDF_Fortran_LIBRARY NAMES libnetcdff.a netcdff HINTS ${NETCDF_FORTRAN_LIB_DIR}) endif() -set(NETCDF_LIBRARIES "${NETCDF_Fortran_LIBRARY} ${NETCDF_C_LIBRARY}") +set(NETCDF_LIBRARIES ${NETCDF_Fortran_LIBRARY} ${NETCDF_C_LIBRARY}) if(NOT NETCDF4_PAR_H) set(NETCDF4_PARALLEL "no") MESSAGE("NETCDF built without MPIIO") @@ -49,7 +49,9 @@ include(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set NETCDF_FOUND to TRUE # if all listed variables are TRUE +# (Note that the Fortran interface is not always a separate library, so +# don't require it to be found.) find_package_handle_standard_args(NETCDF DEFAULT_MSG NETCDF_LIBRARIES - NETCDF_C_LIBRARY NETCDF_Fortran_LIBRARY NETCDF_INCLUDE_DIR) + NETCDF_C_LIBRARY NETCDF_INCLUDE_DIR) mark_as_advanced(NETCDF_INCLUDE_DIR NETCDF_LIBRARIES NETCDF_C_LIBRARY NETCDF_Fortran_LIBRARY NETCDF4_PARALLEL )



若用的是mvapich编译器,并且编译模式遇到问题:ld: cannot find -limpi,则需要在cesm1_2_2/scripts/ccsm_utils/Machines/Makefile中将mpi的lmpi改为lmpich



问题:undefined reference to `netcdf_mp_nf90_strerror_'

NETCDF 4.2以上的版本,需要修改cesm1_2_2/scripts/ccsm_utils/Machines/Makefile里

  SLIBS := -L$(LIB_NETCDF) -lnetcdf 为:SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff

;#####################

Calling the short-term archiving script st_archive.sh

st_archive.sh: start of short-term archiving
[: 79: FALSE: unexpected operator
[: 143: ifiles_n: unexpected operator
[: 144: ifiles_n: unexpected operator
[: 145: ifiles_y: unexpected operator
……


方法:修改Tools/st_archive.sh文件,将if [ "$1" == "ifiles_y" ] && [ "$DOUT_S_SAVE_INT_REST_FILES" !== "True" ]及 "$DOUT_S_SAVE_INT_REST_FILES" !== "False"改为if [ "$1" = "ifiles_y" ] && [ "$DOUT_S_SAVE_INT_REST_FILES" != "True" ]及 "$DOUT_S_SAVE_INT_REST_FILES" != "False"

;#####################


选择compset B的时候,一直提示:

./cesm_setup

#####################

Creating Macros file for nuist
/fs3/jindc/cesm1_2_2/scripts/ccsm_utils/Machines/config_compilers.xml intel nuist
Creating batch script cesm-test.run
Locking file env_mach_pes.xml
Creating user_nl_xxx files for components and cpl
Running preview_namelist script
infile is /fs3/jindc/cesm1_2_2/scripts/cesm-test/Buildconf/cplconf/cesm_namelist
CAM writing dry deposition namelist to drv_flds_in
CAM writing namelist to atm_in
CLM configure done.
CLM adding use_case 2000_control defaults for var sim_year with val 2000
CLM adding use_case 2000_control defaults for var sim_year_range with val constant
CLM adding use_case 2000_control defaults for var use_case_desc with val Conditions to simulate 2000 land-use
CICE configure done.
SYNOPSIS
    generate_pop_decomp.pl [options]
OPTIONS
    -res <resolution>    (or -r)   Horizontal resolution (gx1v6 etc.). (default gx1v6))
    -nproc <number>      (or -n)   Number of processors to use.    (required)
    -thrds <number>      (or -t)   Number of threads per processor    (default 1)
    -output <type>      (or -o)   Either output: all, maxblocks, bsize-x, bsize-y, or decomptype
             (default: all)
EXAMPLES

  generate_pop_decomp.pl -res gx1v6 -nproc 80 -output maxblocks

  will return a single value -- the optimum max number of blocks to use.

if: Expression Syntax.
ERROR: pop2.buildnml.csh failed
ERROR: /fs3/jindc/cesm1_2_2/scripts/cesm-test/preview_namelists failed: 25344

#####################

解决方法,vi Buildconf/pop2.buildnml.csh

 set config = `env UTILROOT=$UTILROOT ./generate_pop_decomp.pl -res $OCN_GRID \
                                -nproc $ntasks -thrds $NTHRDS_OCN -output all`

删除换行符,并合并为一行:“\”:set config = `env UTILROOT=$UTILROOT ./generate_pop_decomp.pl -res $OCN_GRID -nproc $ntasks -thrds $NTHRDS_OCN -output all`



https://blog.sciencenet.cn/blog-728999-822687.html


下一篇:[WRF] proc_oml.f executed by gfortran
收藏 IP: 163.143.166.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (1 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-28 20:41

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部