我正在我的macbook pro(10.9.5,2.3GHz,8 GB RAM)和戴尔Latitude E6400(Windows 7,@。26GHz,4GB RAM)上编译fortran代码。代码在mac上运行大约12.2分钟,在PC上运行32.6分钟。我正在使用gfortran(在Mac上为4.9.0,在PC上为4.10.0)。我的make文件是:
{
# Makefile for NRMMII
F95 = gfortran
#FINCLUD=
#OBJPATH=./objG95/
# .F90 invokes the fpp preprocessor whereas .f90 does not
# the preprocessor expands source code "macros" and symbolic definitions prior to compilation
# it makes no difference with nrmm30
# compiler flags
#FLAGSC = -ffree-form -fall-intrinsics -fcheck=all -m64 -c
FLAGSC = -std=f95 -v -ffree-form -O0 -fall-intrinsics -fcheck=all -march=native -flto \
-funroll-loops -fno-protect-parens -fstack-arrays -c
# link flags
FLAGSL = -g
#-static Only for windows machines
OBJS = module_nrmmdefs.f90 module_nrmmcntc.f90 module_nrmmdevc.f90 \
module_nrmmdrvc.f90 module_nrmmploc.f90 module_nrmmprdc.f90 \
module_nrmmscnc.f90 module_nrmmstsc.f90 module_nrmmsumc.f90 \
module_nrmmterc.f90 module_nrmmtppc.f90 module_nrmmvehc.f90 \
module_nrmmvers.f90 module_nrmmvppc.f90 module_nrmm_global.f90 \
module_nrmmpbuffs.f90 module_nrmmxmlc.f90 \
main.f90 areal.f90 auxout.f90 crlsno.f90 diag.f90 histogram.f90\
input.f90 miscg95.f90 plow.f90 road.f90 summary.f90 terrain.f90\
vpp.f90 spclxml2.f90 nrmmxml.f90
# special files in nrmmii_misc
# module_spclapfc.f90 spclapf.f90 module_spclresc.f90 spclres.f90 \
# spcljody.f90 spclnode.f90 spclnode1.f90 spclnull.f90 spcltrfs.f90\
# module_nrmmxmlc.f90 nrmmxml.f90 spclxml2.f90 spcltrav.f90
# This defines the compile rules
.SUFFIXES: .o .f90
.f90.o:
$(F95) $(FLAGSC) $*.f90
nrmm30:
$(F95) $(FLAGSL) -o $@ $(OBJS)
}
有没有人对PC版本运行速度这么慢的原因有任何建议?