爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 73746|回复: 90

CESM模式移植介绍 成功

  [复制链接]

新浪微博达人勋

发表于 2013-5-13 18:39:29 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 天道酬勤 于 2013-5-16 15:38 编辑

从开始学CESM模式开始,到现在刚把模式的移植搞定,现在把模式移植过程中出现的问题,(我遇到的)以及注意的方法作一个介绍,让后面学的人可以节约点时间。主要步骤参照 http://www.mnmuc.org/thread-452-1-1.html
对于config_machines.xml 文件没什么要说的,针对自己的路径进行修改
对于env_machopts.&MACH,主要修改PGI_PATH,MPICH_PATH,以及NETCDF_PATH的路径。这些路径是根据你的.bashrc中的环境变量来进行设置的。这里的路径是很重要的,否者会出现mct和pio里的F程序不能进行编译的错误。
对于Macros.$MACH以及mkbatch.&MACH也没什么好说的。
之后照着帖子的步骤就开始测试了,在测试前,建议大家cd到cesm的上一级目录,chmod -R a+x cesm。这个可以保证在cesm下所有可执行脚本都有权限进行操作,避免以后各种Permission denied
configure -case一般不会出错,主要出现在build,当初我就是各种错误,搜了一大推帖子,没几个能解决的。我遇到的错误是:
cp: cannot stat `Makefile.conf.old': No such file or directory
cp: cannot stat `Makefile.conf': No such file or directory
Makefile:4: Makefile.conf: No such file or directory
make: *** No rule to make target `Makefile.conf'.  Stop.

这个错误是说缺少Makefile.conf.old以及Makefile.conf。缺少的这两个文件是在...../cesm/models/utils/mct下,解决办法
cd  ...../cesm/models/utils/mct
./configure
同样在...../cesm/models/utils/pio也要./configure。之后这两个缺失的文件就会出现了。
特此感谢@loftydongshi @一水天下
好了,我的错误就这些了。这仅仅是个起步,以后的路还很长,大家在转模式的时候有什么经验多多交流才是。一个人搞既没有乐趣也缺少动力。一起学习,共同进步吧!
*************************随时更新******************************
今天在移植的时候,不知道改了哪里了,又出现了一个错误,并且这个错误还挺常见,我就放在这里了。下面是错误的说明:(有点长了)
Mon Dec 20 13:34:34 CST 2010 /disk4/una/output/test1/pio/pio.bldlog.101220-133330
Copying source to CCSM EXEROOT...
ignore pio file alloc_mod.F90
ignore pio file box_rearrange.F90
cp: omitting directory `configure.old'
ignore pio file iompi_mod.F90
ignore pio file mct_rearrange.F90
ignore pio file piodarray.F90
ignore pio file pionfatt_mod.F90
ignore pio file pionfget_mod.F90
ignore pio file pionfput_mod.F90
ignore pio file pionfread_mod.F90
ignore pio file pionfwrite_mod.F90
ignore pio file pio_spmd_utils.F90
ignore pio file pio_support.F90
ignore pio file rearrange.F90
New build of PIO
Running configure...
for OS=Linux MACH=generic_linux_intel
cat: Filepath: No such file or directory
cat: Srcfiles: No such file or directory
/disk4/una/test1/Tools/mkSrcfiles > /disk4/una/output/test1/pio/Srcfiles
cp -f /disk4/una/output/test1/pio/Filepath /disk4/una/output/test1/pio/Deppath
/disk4/una/test1/Tools/mkDepends Deppath Srcfiles > /disk4/una/output/test1/pio/Depends
./configure   --disable-mct --disable-timing  CC="mpicc" F90="mpiifort" NETCDF_PATH="/disk1/soft/netcdf-3.6.2" MPI_INC="-I"
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mpicc accepts -g... yes
checking for mpicc option to accept ISO C89... none needed
checking for mpicc... mpicc
checking for MPI_Init... yes
checking for mpi.h... yes
checking how to run the C preprocessor... mpicc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for char... yes
checking size of char... 1
checking for int... yes
checking size of int... 4
checking for float... yes
checking size of float... 4
checking for double... yes
checking size of double... 8
checking for void *... yes
checking size of void *... 8
checking Fortran 90 filename extension... .F90
checking whether we are using the GNU Fortran 90 compiler... no
checking for mpxlf90_r... no
checking for mpxlf90... no
checking for mpxlf95... no
checking for mpif90... mpif90
checking for mpif.h... yes
checking MPI-IO support in MPI implementation... yes
checking how to get the version output from mpiifort... -V
checking whether byte ordering is bigendian... no
Fortran Compiler is Intel ifort
checking whether fortran .mod file is uppercase... unknown
configure: WARNING: Compilation of module did not create .mod file. Please check compiler manual.
checking for Fortran 90 name-mangling scheme... unknown
configure: WARNING: UNKNOWN FORTRAN 90 NAME-MANGLING SCHEME
checking for cpp... cpp
checking if Fortran 90 compiler performs preprocessing... no
checking if C preprocessor can work with Fortran compiler... no
configure: WARNING: FORTRAN SOURCE PREPROCESSING HAS FAILED
Full hostname= N000
Hostname=N000
Machine=x86_64
OS=Linux
using NETCDF_PATH from environment
configure: WARNING: PNETCDF_PATH not found in environment,                            defaulting to /usr/local/pnetcdf
configure: WARNING: pnetcdf.inc not found in PNETCDF_PATH/include                              disabling pnetcdf support
configure: WARNING: libpnetcdf.a not found in PNETCDF_PATH/lib                              disabling pnetcdf support
checking Fortran 90 support for sizeof()... yes

Temp variables: {F90=mpiifort} {MPIF90=mpif90}

Output Variables: {CC=mpicc} {MPICC=mpicc} {ALLCFLAGS=-g -O2 -DFORTRAN_MANGLING_UNKNOWN -DSYSLINUX -DLINUX -DCPRINTEL} {EXPLICIT_FPP=no} {FPP=cpp} {FPPFLAGS=-P -C -N -traditional} {FC=mpiifort} {MPIF90=mpif90}{OPT=} {BIT64=} {REAL8=-r8} {ENDIAN=-convert big_endian} {FFLAGS= -I} {CFLAGS=-g -O2} {F90FLAGS=-w -ftz -assume byterecl} {MACHDEFS=-DSYSLINUX -DLINUX -DCPRINTEL} {MPI_INC=-I} {MPI_LIB=} {MODINC=-I} {INCLUDEPATH=} {AR=ar} {ARFLAGS=cq} {USE_PNETCDF=no} {PNETCDF_PATH=/usr/local/pnetcdf} {USE_NETCDF=yes} {NETCDF_PATH=/disk1/soft/netcdf-3.6.2} {USE_MCT=no} {USEBOX=yes} {PDEFS= -DSPMD -DHAVE_MPI -DUSEMPIIO -D_NETCDF -D_NOPNETCDF -D_NOUSEMCT -D_USEBOX} {PDEFSF= -DSPMD -DHAVE_MPI -DUSEMPIIO -D_NETCDF -D_NOPNETCDF -D_NOUSEMCT -D_USEBOX} {PINCS=-I -I/disk1/soft/netcdf-3.6.2/include} {LDLIBS= -L/disk1/soft/netcdf-3.6.2/lib -lnetcdf } {DEBUG=no}

configure: creating ./config.status
config.status: creating Makefile.conf
Please check the Makefile.conf
Have a nice day!
Making dependencies for pio.F90 --> pio.d
Making dependencies for pio_kinds.F90 --> pio_kinds.d
Making dependencies for nf_mod.F90 --> nf_mod.d
Making dependencies for ionf_mod.F90 --> ionf_mod.d
Making dependencies for pio_types.F90 --> pio_types.d
Making dependencies for piolib_mod.F90 --> piolib_mod.d
Making dependencies for pio_mpi_utils.F90 --> pio_mpi_utils.d
Making dependencies for pio_nf_utils.F90 --> pio_nf_utils.d
Making dependencies for pio_utils.F90 --> pio_utils.d
Making dependencies for pio_quicksort.F90 --> pio_quicksort.d
/usr/bin/perl genf90.pl pionfatt_mod.F90.in > pionfatt_mod.F90
Making dependencies for pionfatt_mod.F90 --> pionfatt_mod.d
/usr/bin/perl genf90.pl pionfread_mod.F90.in > pionfread_mod.F90
Making dependencies for pionfread_mod.F90 --> pionfread_mod.d
/usr/bin/perl genf90.pl pionfwrite_mod.F90.in > pionfwrite_mod.F90
Making dependencies for pionfwrite_mod.F90 --> pionfwrite_mod.d
/usr/bin/perl genf90.pl pionfput_mod.F90.in > pionfput_mod.F90
Making dependencies for pionfput_mod.F90 --> pionfput_mod.d
/usr/bin/perl genf90.pl pionfget_mod.F90.in > pionfget_mod.F90
Making dependencies for pionfget_mod.F90 --> pionfget_mod.d
/usr/bin/perl genf90.pl alloc_mod.F90.in > alloc_mod.F90
Making dependencies for alloc_mod.F90 --> alloc_mod.d
/usr/bin/perl genf90.pl box_rearrange.F90.in > box_rearrange.F90
Making dependencies for box_rearrange.F90 --> box_rearrange.d
/usr/bin/perl genf90.pl rearrange.F90.in > rearrange.F90
Making dependencies for rearrange.F90 --> rearrange.d
/usr/bin/perl genf90.pl pio_support.F90.in > pio_support.F90
Making dependencies for pio_support.F90 --> pio_support.d
/usr/bin/perl genf90.pl mct_rearrange.F90.in > mct_rearrange.F90
Making dependencies for mct_rearrange.F90 --> mct_rearrange.d
/usr/bin/perl genf90.pl iompi_mod.F90.in > iompi_mod.F90
Making dependencies for iompi_mod.F90 --> iompi_mod.d
/usr/bin/perl genf90.pl piodarray.F90.in > piodarray.F90
Making dependencies for piodarray.F90 --> piodarray.d
/usr/bin/perl genf90.pl pio_spmd_utils.F90.in > pio_spmd_utils.F90
Making dependencies for pio_spmd_utils.F90 --> pio_spmd_utils.d
Done updating dependencies
gmake[1]: Entering directory `/disk4/una/output/test1/pio'mpicc -c -g -O2 -DFORTRAN_MANGLING_UNKNOWN -DSYSLINUX -DLINUX -DCPRINTEL -DSPMD -DHAVE_MPI -DUSEMPIIO -D_NETCDF -D_NOPNETCDF -D_NOUSEMCT -D_USEBOX  -I -I/disk1/soft/netcdf-3.6.2/include topology.cmpicc -c -g -O2 -DFORTRAN_MANGLING_UNKNOWN -DSYSLINUX -DLINUX -DCPRINTEL -DSPMD -DHAVE_MPI -DUSEMPIIO -D_NETCDF -D_NOPNETCDF -D_NOUSEMCT -D_USEBOX  -I -I/disk1/soft/netcdf-3.6.2/include pnetcdfversion.cmpif90 -c -r8 -convert big_endian  -I -w -ftz -assume byterecl -DSYSLINUX -DLINUX -DCPRINTEL -DSPMD -DHAVE_MPI -DUSEMPIIO -D_NETCDF -D_NOPNETCDF -D_NOUSEMCT -D_USEBOX -I -I/disk1/soft/netcdf-3.6.2/include pio_kinds.F90
gfortran: big_endian: No such file or directory
gfortran: byterecl: No such file or directorygfortran: unrecognized option '-r8'gfortran: unrecognized option '-convert'cc1: error: unrecognized command line option "-ftz"gmake[1]: *** [pio_kinds.o] Error 1
gmake[1]: Leaving directory `/disk4/una/output/test1/pio'
gmake: *** [all] Error 2


这个错误可能是由于我的mpi和netcdf不是同一个编译器造成的。我的netcdf肯定是pgi的,mpi我是根据which mpif90找的,MPICH_PATH的路径是/opt/mvapich2。之后为了靠谱点,我借鉴了@一水天下里MPICH_PATH的路径,改成了/gpfs/fs1/tools/mvapich2-pgi这一看就知道MPICH_PATH是pgi的。果然成功了。但我运行which mpif90,显示的路径仍然是我之前的那个路径。为什么编译就就成功了。这个还有待考究。
但前几次的移植,这个路径我也没有改,也成功了。真心不知道错误出在哪里,可能给该糊涂了吧

评分

参与人数 4金钱 +51 贡献 +8 体力 +100 收起 理由
lixingyuhihi + 10 很给力!
爱上温哥华 + 1 很给力!
残月 + 20 很给力!
mofangbao + 20 + 8 + 100 赞一个!

查看全部评分

密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-11-19 23:35:05 | 显示全部楼层
感谢分享,我来学习学习,刚接触这个,老板想让CAM部分单独运算起来
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2013-5-13 19:15:57 | 显示全部楼层
顶一下。受教了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

0
早起挑战累计收入
发表于 2013-5-13 19:24:33 | 显示全部楼层
灰常感谢楼主的分享啊~
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-5-13 21:16:14 | 显示全部楼层
CESM是气候模式吗?可以预报降水吗?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2013-5-13 21:20:09 | 显示全部楼层
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-5-13 21:30:58 | 显示全部楼层
楼主不是在IBM机器上移植的吧?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-5-13 21:38:08 | 显示全部楼层
天道酬勤 发表于 2013-5-13 21:20
恩,是气候模式,具体的介绍你可以去官网看。
http://www.cesm.ucar.edu/
预报的降水,也是气候意义上的 ...

O(∩_∩)O~谢谢!!!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2013-5-13 21:46:44 | 显示全部楼层
残月 发表于 2013-5-13 21:30
楼主不是在IBM机器上移植的吧?

学校的大型机好像是IBM的。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2013-5-13 21:48:12 | 显示全部楼层
mofangbao 发表于 2013-5-13 19:24
灰常感谢楼主的分享啊~

加了这么多分,谢谢坛主了。。。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2013-5-14 15:38:14 | 显示全部楼层
天道酬勤 发表于 2013-5-13 21:46
学校的大型机好像是IBM的。

那你是在大型机上编译通的,是吗?系统是AIX吗
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表