登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 andrewsoong 于 2023-11-20 05:06 编辑
最近看到家园里面不少的同学在询问如何转CESM的问题,想着写一个简单的介绍如何移植的东西。 今个儿终于得空,写一下。本例子以CESM1.0.3为例,最新的为CESM1.2.1改进的部分已在前面的帖子介绍过了,在此不多说。其实有两种移植方法,在此只介绍一种一劳永逸的方法。另一种方法请其他同学补充。另外需要声明的是,这只是本人在移植的时候的一点经验,文中所述肯定不如CESM用户说明全面!!!所以出了问题,请先查看用户手册相关内容。一切以用户说明为准。CESM讨论QQ群:NCAR/CESM&NCAR/CLM&NCAR/CAM:856703472
1,netcdf-3.6.3,intel-fortran,impi安装好,不再赘述。在移植之前,用户需要下载一些inputdata,可参考NCAR/CESM官网http://www2.cesm.ucar.edu/。推荐使用svn下载。注意,此处netcdf需要使用intel fortran编译的,也就是说与自己的使用的编译器相对应。PS:大型机Linux系统为Cent OS 6.3。
2,开始
2.1 查看模式支持的系统 > cd ccsm4/scripts
> ./create_newcase–l 可列出模式支持的系统信息。这里使用 generic_linux_intel 的设置进行参考创建新的可支持的机器 new_intel ,即generic_linux_intel是原有的可支持系统,new_intel为新的目标机器。
2.2 编辑config_machines.xml文件 > cd ccsm4/scripts/ccsm_utils/Machines/
> vi config_machines.xml
将generic_linux_intel中的一段复制一次,然后修改如下: <machine MACH=“ new_intel ”
DESC=“ new_intel, os is Linux, 8 pes/node,batch system is PBS”
EXEROOT=“ /你的目录/cesm1_0_3/mycases/case_run/$CASE/ ”
OBJROOT=“$EXEROOT”
INCROOT=“$EXEROOT/lib/include”
DIN_LOC_ROOT_CSMDATA=“/inputdata目录/data_of_model/CESM_input_part/ ”
DIN_LOC_ROOT_CLMQIAN=“ /大气强迫目录/atm_forcing.datm7.Qian.T62.c080727” DOUT_S_ROOT=" /你的目录/cesm1_0_3/mycases/archive/$CASE/ "
DOUT_L_HTAR="TRUE"
DOUT_L_MSROOT="UNSET"
CCSM_BASELINE="UNSET"
CCSM_CPRNC="UNSET"
OS=" Linux "
BATCHQUERY="qstat"
BATCHSUBMIT="qsub" 注:提交作业的命令
GMAKE_J="1"
MAX_TASKS_PER_NODE="8"
MPISERIAL_SUPPORT="FALSE"/>
2.3 创建env_machopts文件,并修改权限 > cd ccsm4/scripts/ccsm_utils/Machines/
> cp env_machopts.generic_linux_intel env_machopts. new_intel > chmod u+x env_machopts.new_intel
> vi env_machopts.new_intel
修改其中的参数,以适应new_intel机器:
setenv INTEL_PATH 对应自己的机器修改/intel/Compiler/11.1/073/bin/intel64 setenv MPICH_PATH对应自己的机器修改/intel/impi/4.0.0.028/bin64 setenv INC_MPI对应自己的机器修改/intel/impi/4.0.0.028/include64 setenv LIB_MPI 对应自己的机器修改/intel/impi/4.0.0.028/lib64 setenv LD_LIBRARY_PATH 对应自己的机器修改/intel/Compiler/11.1/073/lib/intel64 setenv NETCDF_PATH对应自己的机器修改/netcdf
如果不知道自己的机器这些文件的目录,可使用which来查找,例如:
PGI可以用 which pgf90 查找
netcdf用 which ncdump查找
mpi用 which mpif90 查找 intel用 which ifort查找
2.4 创建Macros文件,并修改其权限
> cd ccsm4/scripts/ccsm_utils/Machines/
> cp Macros.generic_linux_pgi Macros.new_intel > chmod u+x Macros.new_intel 2.5 创建mkbatch文件,并修改其权限 >cd ccsm4/scripts/ccsm_utils/Machines/
> cpmkbatch.generic_linux_intel mkbatch.new_intel > chmod u+x mkbatch.new_intel
> vi mkbatch.new_intel
修改其中的参数,以适应new_intel机器:
set mach=new_intel
/对应自己的机器修改/intel/impi/4.0.0.028/bin64/mpirun -np${maxtasks}./ccsm.exe >&! ccsm.log.\$LID
2.6 测试
> cd ccsm4/scripts
> create_newcase -case test \
-res f19_g16 \
-compset X \
-mach new_intel 注1:其中res部分是分辨率的一些信息,用户可根据自己的需要选择合适的分辨率等等,可参考用户文档附录部分。 注2:其中compset部分的X可以根据自己的需要改成其他的,具体请参考CESM使用说明书的附录部分。 产生如下结果,则表示这一步成功了: -------------------------------------------------------------------------------- CESM1.0 README
For both a quick start as well as a detailed summary of creating and running a CESM model case, see the CESM1.0 User's Guide athttp://www.cesm.ucar.edu/models/cesm1.0
IMPORTANT INFORMATION ABOUT SCIENTIFIC VALIDATION
CESM1.0 has the flexibility to configure cases with many different combinations of component models, grids, and model settings, but this version of CESM has only been validated scientifically for the following fully active configurations:
1.9x2.5_gx1v6 B_1850_CN 1.9x2.5_gx1v6 B_1850_RAMPCO2_CN 1.9x2.5_gx1v6 B_1850-2000_CN
1.9x2.5_gx1v6 B_1850_CAM5_CN 0.9x1.25_gx1v6 B_1850_CAM5_CN 0.9x1.25_gx1v6 B_1850-2000_CAM5_CN
0.9x1.25_gx1v6 B_1850_CN 0.9x1.25_gx1v6 B_1850_RAMPCO2_CN 0.9x1.25_gx1v6 B_1850-2000_CN
0.9x1.25_gx1v6 B_1850_BGC-BPRP 0.9x1.25_gx1v6 B_1850_BGC-BDRD 0.9x1.25_gx1v6 B_1850-2000_BGC-BPRP 0.9x1.25_gx1v6 B_1850-2000_BGC-BDRD
0.9x1.25_gx1v6 B_1850_CN_CHEM 0.9x1.25_gx1v6 B_1850-2000_CN_CHEM
1.9x2.5_gx1v6 B_1850_WACCM_CN 1.9x2.5_gx1v6 B_1850-2005_WACCM_CN 1.9x2.5_gx1v6 B_1955-2005_WACCM_CN 1.9x2.5_gx1v6 B_RCP2.6_WACCM_CN 1.9x2.5_gx1v6 B_RCP4.5_WACCM_CN 1.9x2.5_gx1v6 B_RCP8.5_WACCM_CN T31_gx3v7 B_1850_CN T31_gx3v7 B_1850-2000_CN
If the user is interested in running a "stand-alone" component configuration, the following model configurations have been validated scientifically and have associated diagnostic output as part of the release:
1.9x2.5_1.9x2.5 F_2000_WACCM 1.9x2.5_1.9x2.5 F_AMIP_CAM5 0.9x1.25_0.9x1.25 F_AMIP_CAM5 1.9x2.5_1.9x2.5 F_AMIP_CN 0.9x1.25_0.9x1.25 F_AMIP_CN
0.9x1.25_gx1v6 I_2000 0.9x1.25_gx1v6 I_2000_CN
T62_gx1v6 C_NORMAL_YEAR
For more information regarding alternative component configurations, please refer to the individual component web pages at http://www.cesm.ucar.edu/models/cesm1.0
--------------------------------------------------------------------------------***********************************************************Component set : X_PRESENT_DAY (X)Desc : All dead model ***********************************************************
Creating /你的目录/cesm1_0_3/scripts/test Locking file /你的目录/cesm1_0_3/scripts/test/env_case.xml Successfully created the case for new_intel
然后: > cd test
> configure -case 注意:在configure之前,请在env开头的文件中配置好你所要使用的cpu数量等等信息, 一旦configure,就锁定,不能修改了。 产生如下提示信息则表示成功: Generating resolved namelist, prestage, and build scriptsSuccessfully generated resolved namelist, prestage, and build scriptsLocking file env_conf.xmlGenerating clean_build script Generating submit script Generating build script Generating run script Locking file env_mach_pes.xmlSuccessfully configured the case for new_intelIf an old build exists for this case, you might want to run the *.clean_build script before building
然后 > ./test.new_intel.build
会产生以下信息: ------------------------------------------------------------------------- CCSM BUILDNML SCRIPT STARTING - To prestage restarts, untar a restart.tar file into /你的目录/cesm1_0_3/mycases/case_run/test//run - Create modelio namelist input files CCSM BUILDNML SCRIPT HAS FINISHED SUCCESSFULLY ------------------------------------------------------------------------- CCSM PRESTAGE SCRIPT STARTING - CCSM input data directory, DIN_LOC_ROOT_CSMDATA, is /inputdata路径/CESM_input_part/ - Case input data directory, DIN_LOC_ROOT, is /inputdata路径/CESM_input_part/ - Checking the existence of input datasets in DIN_LOC_ROOT CCSM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY ------------------------------------------------------------------------- CCSM BUILDEXE SCRIPT STARTING - Build Libraries: mct pio csm_share Wed Jul 10 17:23:23 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//mct/mct.bldlog.130710-172322 Wed Jul 10 17:23:57 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//pio/pio.bldlog.130710-172322 Wed Jul 10 17:24:36 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//csm_share/csm_share.bldlog.130710-172322 Wed Jul 10 17:25:23 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//run/cpl.bldlog.130710-172322 Wed Jul 10 17:25:23 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//run/atm.bldlog.130710-172322 Wed Jul 10 17:25:24 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//run/lnd.bldlog.130710-172322 Wed Jul 10 17:25:25 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//run/ice.bldlog.130710-172322 Wed Jul 10 17:25:25 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//run/ocn.bldlog.130710-172322 Wed Jul 10 17:25:26 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//run/glc.bldlog.130710-172322 Wed Jul 10 17:25:26 CST 2013 /你的目录/cesm1_0_3/mycases/case_run/test//run/ccsm.bldlog.130710-172322 - Locking file env_build.xml - Locking file Macros.new_intel CCSM BUILDEXE SCRIPT HAS FINISHED SUCCESSFULLY 此处已提示你Build成功!!!! > ./test_new_intel.submit 此步就是提交作业,开始运行了。 至于最新版本的CESM1.2.0的移植也是大同小异。 到此为止已介绍完毕。大家可根据自己机器的实际情况予以修改! 其中有不足之处请各位给予建议改正,不胜感激。谢谢!欢迎提出宝贵建议!欢迎交流!
2013.7.10
Andrew Soong
此贴乃原创,转载请注明出处!谢谢!
|