Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Compilation failure in PIO using NAG compiler

Hi,
I am compiling CESM1200 with NAG compiler( Release 5.3.1(907)) and the compilation is failing in PIO with the following error:

NAG Fortran Compiler Release 5.3.1(907)
Error: /home/..../cesm1_2_0/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_PAIR_I8 and GCD_PAIR_I4 in generic GCD_PAIR
Error: /home/..../cesm1_2_0/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_ARRAY_I8 and GCD_ARRAY_I4 in generic GCD_ARRAY
Error: /home/..../cesm1_2_0/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_PAIR_I8 and GCD_PAIR_I4 in generic GCD
Error: /home/..../cesm1_2_0/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_ARRAY_I8 and GCD_ARRAY_I4 in generic GCD
Errors in declarations, no further processing for CALCDISPLACE_MOD
[NAG Fortran Compiler error termination, 4 errors]
gmake[1]: *** [/home/..../cesm1_2_0/models/utils/pio/calcdisplace_mod.o] Error 2
gmake[1]: Leaving directory `/..../csmruns/cesm1200_def_run_nag/bld/pio'
gmake: *** [all] Error 2

I am not sure how to fix this problem. This code compiles fine with Intel and PGI compilers.

Thanks,
Balwinder
 

jedwards

CSEG and Liaisons
Staff member
We were not testing agasinst the nag compiler when 1.2.0 was released, but we did test the current 1.2.2 release with nag.    You might want to update to that latest release.    
 
I tried cesm1_2_2 and got into the same issue. Following is the error message: 210: Unused local variable SDIMS
NAG Fortran Compiler Release 5.3.1(907)
[NAG Fortran Compiler normal termination, 53 warnings]
Error: /home/sing201/cesm_collections/cesm1_2_2/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_PAIR_I8 and GCD_PAIR_I4 in generic GCD_PAIR
Error: /home/sing201/cesm_collections/cesm1_2_2/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_ARRAY_I8 and GCD_ARRAY_I4 in generic GCD_ARRAY
Error: /home/sing201/cesm_collections/cesm1_2_2/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_PAIR_I8 and GCD_PAIR_I4 in generic GCD
Error: /home/sing201/cesm_collections/cesm1_2_2/models/utils/pio/calcdisplace_mod.F90, line 391: Ambiguous specific names GCD_ARRAY_I8 and GCD_ARRAY_I4 in generic GCD
Errors in declarations, no further processing for CALCDISPLACE_MOD
[NAG Fortran Compiler error termination, 4 errors]
gmake[3]: *** [CMakeFiles/pio.dir/calcdisplace_mod.F90.o] Error 2
gmake[3]: Leaving directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/pio'
gmake[2]: *** [CMakeFiles/pio.dir/calcdisplace_mod.F90.o.provides] Error 2
gmake[2]: *** Waiting for unfinished jobs....
/home/scicons/cascade/apps/visit/cmake-2.8.10.2/bin/cmake -E cmake_copy_f90_mod iompi_mod CMakeFiles/pio.dir/iompi_mod.mod.stamp NAG
/home/scicons/cascade/apps/visit/cmake-2.8.10.2/bin/cmake -E touch CMakeFiles/pio.dir/iompi_mod.F90.o.provides.build
gmake[3]: Leaving directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/pio'
/home/scicons/cascade/apps/visit/cmake-2.8.10.2/bin/cmake -E cmake_copy_f90_mod pionfread_mod CMakeFiles/pio.dir/pionfread_mod.mod.stamp NAG
/home/scicons/cascade/apps/visit/cmake-2.8.10.2/bin/cmake -E touch CMakeFiles/pio.dir/pionfread_mod.F90.o.provides.build
gmake[3]: Leaving directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/pio'
/home/scicons/cascade/apps/visit/cmake-2.8.10.2/bin/cmake -E cmake_copy_f90_mod pionfget_mod CMakeFiles/pio.dir/pionfget_mod.mod.stamp NAG
/home/scicons/cascade/apps/visit/cmake-2.8.10.2/bin/cmake -E touch CMakeFiles/pio.dir/pionfget_mod.F90.o.provides.build
gmake[3]: Leaving directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/pio'
gmake[2]: Leaving directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/pio'
gmake[1]: *** [CMakeFiles/pio.dir/all] Error 2
gmake[1]: Leaving directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/pio'
gmake: *** [all] Error 2
exit 2    
 

jedwards

CSEG and Liaisons
Staff member
I think I am using the same compiler version you are, perhaps you are missing a compile flag: /usr/local/openmpi-1.6.5-gcc-g++-4.4.7-3-nag-5.3.1-907/bin/mpif90  -DNO_C_SIZEOF -D_NETCDF -D_NETCDF -D_NOPNETCDF -DUSEMPIIO -D_NOUSEMCT -D_USEBOX -kind=byte -wmismatch=mpi_send,mpi_recv,mpi_bcast,mpi_allreduce,mpi_reduce,mpi_isend,mpi_irecv,mpi_irsend,mpi_rsend,mpi_gatherv,mpi_gather,mpi_scatterv,mpi_allgather,mpi_alltoallv,mpi_file_read_all,mpi_file_write_all,mpibcast,mpiscatterv  -gline  -C=all   -DLINUX  -DMCT_INTERFACE -DHAVE_MPI -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH  -DNO_C_SIZEOF  -DLINUX -DCPRNAG  -DHAVE_SLASHPROC -I.  -I/scratch/cluster/jedwards/SMS_D.f19_g16_rx1.A.goldbach_nag.140703-062209/bld/nag/openmpi/debug/nothreads/include -I/scratch/cluster/jedwards/SMS_D.f19_g16_rx1.A.goldbach_nag.140703-062209/bld/nag/openmpi/debug/nothreads/MCT/noesmf/a1l1r1i1o1g1w1/csm_share -I/usr/local/netcdf-gcc-nag/include -I/usr/local/openmpi-gcc-nag/include -I/scratch/cluster/jedwards/SMS_D.f19_g16_rx1.A.goldbach_nag.140703-062209/bld/nag/openmpi/debug/nothreads/include -I/home/jedwards/cesm1_2_2/models/csm_share/shr -I/home/jedwards/cesm1_2_2/models/utils/pio -I/scratch/cluster/jedwards/SMS_D.f19_g16_rx1.A.goldbach_nag.140703-062209/bld/nag/openmpi/debug/nothreads/pio -I/usr/local/netcdf-gcc-nag/include    -c /home/jedwards/cesm1_2_2/models/utils/pio/calcdisplace_mod.F90 -o CMakeFiles/pio.dir/calcdisplace_mod.F90.o  
 

jedwards

CSEG and Liaisons
Staff member
Had another thought - if you are compiling on a 32 bit OS then you should try commenting out the I8 versions of these routines.   We no longer test build CESM on 32 bit systems and this may not be the only problem you run into.  
 
Thanks.I am using 64 bit compiler:$nagfor -VNAG Fortran Compiler Release 5.3.1(907)
Product NPL6A53NA for x86-64 Linux
Copyright 1990-2012 The Numerical Algorithms Group Ltd., Oxford, U.K.

My log file entry for compiling "calcdisplace_mod.F90" is:/home/scicons/cascade/apps/mpi/mvapich2-1.9/build_nag5.3.1/bin/mpif90  -DNO_C_SIZEOF -DNO_MPIMOD -DUSEMPIIO -D_NETCDF -D_NETCDF4 -D_NOPNETCDF -D_NOUSEMCT -D_USEBOX -kind=byt
e -wmismatch=mpi_send,mpi_recv,mpi_bcast,mpi_allreduce,mpi_reduce,mpi_isend,mpi_irecv,mpi_irsend,mpi_rsend,mpi_gatherv,mpi_gather,mpi_scatterv,mpi_allgather,mpi_alltoallv,mp
i_file_read_all,mpi_file_write_all,mpibcast,mpiscatterv  -ieee=full -O2   -DLINUX  -DNDEBUG -DMCT_INTERFACE -DHAVE_MPI -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH
 -DLINUX -DCPRNAG  -DHAVE_SLASHPROC -I.  -I/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/include -I/dtemp/sing201/csmruns/cesm1220_def_run_nag/
bld/NAG/mpich/nodebug/nothreads/MCT/noesmf/a1l1r1i1o1g1w1/csm_share -I/home/scicons/cascade/apps/netcdf-4.3.0/build_nag5.3.1/mvapich2/lib/../include -I/dtemp/sing201/csmruns
/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/include -I/home/sing201/cesm_collections/cesm1_2_2/models/csm_share/shr -I/home/sing201/cesm_collections/cesm1_2_2/mode
ls/utils/pio -I/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/nodebug/nothreads/pio -I/home/scicons/cascade/apps/netcdf-4.3.0/build_nag5.3.1/mvapich2/include    -
c /home/sing201/cesm_collections/cesm1_2_2/models/utils/pio/calcdisplace_mod.F90 -o CMakeFiles/pio.dir/calcdisplace_mod.F90.o

 This is quite similar to what you have except that I have debug set to false in my xml file (so some flags are different). When I use the debug option, the code fails to compile MCT and I get the following error:configure: creating ./config.status
config.status: creating Makefile.conf
config.status: creating config.h
Please check the Makefile.conf
Have a nice day!
if ( 0 == 1 ) then
cp -p Makefile.conf Makefile.conf.old
gmake
gmake[1]: Entering directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/debug/nothreads/mct/mpeu'
gcc  -c -DLINUX  -DMCT_INTERFACE -DHAVE_MPI -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH  -DLINUX -DCPRNAG  -DHAVE_SLASHPROC -DSYSLINUX -DCPRNAG  -g   -DLINUX  -DMC
T_INTERFACE -DHAVE_MPI -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH  -DLINUX -DCPRNAG  -DHAVE_SLASHPROC -I.. -I.  -I/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/
NAG/mpich/debug/nothreads/include -I/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/debug/nothreads/MCT/noesmf/a1l1r1i1o1g1w1/csm_share -I/home/scicons/cascade/app
s/netcdf-4.3.0/build_nag5.3.1/mvapich2/lib/../include -I/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/debug/nothreads/include -I/home/sing201/cesm_collections/ce
sm1_2_2/models/csm_share/shr   -I. -I../ /home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:37: error: âFC_FUNCâ declared as function returning a function
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:37: warning: parameter names (without types) in function declaration
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:38: error: âFC_FUNCâ declared as function returning a function
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:38: warning: parameter names (without types) in function declaration
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:48: warning: parameter names (without types) in function declaration
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:48: error: âFC_FUNCâ declared as function returning a function
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c: In function âFC_FUNCâ:
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:48: error: declaration for parameter âztsâ but no such parameter
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c: At top level:
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:72: warning: parameter names (without types) in function declaration
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:72: error: âFC_FUNCâ declared as function returning a function
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:71: error: redefinition of âFC_FUNCâ
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:47: note: previous definition of âFC_FUNCâ was here
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c: In function âFC_FUNCâ:
/home/sing201/cesm_collections/cesm1_2_2/models/utils/mct/mpeu/get_zeits.c:72: error: declaration for parameter âticâ but no such parameter
gmake[1]: *** [get_zeits.o] Error 1
gmake[1]: Leaving directory `/dtemp/sing201/csmruns/cesm1220_def_run_nag/bld/NAG/mpich/debug/nothreads/mct/mpeu'
gmake: *** [subdirs] Error 2
exit   -Balwinder 
 

santos

Member
I think that Jim is right; the version of mvapich (or mpich?) that you are using with NAG is probably using 32 bit offsets for some reason (even though you are on a 64 bit system), so you would have to get rid of the I8 versions of the routines.I don't know why you're getting those MCT errors in DEBUG mode. Can you post your config.log from that build? It is in the build directory, in the directory ending with "mpich/debug/nothreads/mct".
 

santos

Member
I see. In order to run with DEBUG on, you need to have the Fortran runtime linked in, even in the autoconf script, and you are missing the flags to handle that:
Code:
CFLAGS += -Wl,--as-needed,--allow-shlib-undefined
       SLIBS += -L$(COMPILER_PATH)/lib/NAG_Fortran -lf53
These should be present automatically, without you having to add them. Maybe the problem is that you are using the name "NAG" for the compiler, whereas it is expecting a lowercase "nag"? In addition, you will need to define COMPILER_PATH to the location of the NAG installation on your system (which may be simply "/usr" or may be somewhere else), so that the NAG_Fortran directory can be found.
 
Thanks Sean. That solved the MCT problem while running in debug mode. I did the following based on your suggestions (in machine file, env_mach_specific.):

setenv COMPILER nag
setenv COMPILER_PATH /msc/apps/compilers/nag/5.3.1/For debug mode, now I am getting the same error message I got for non-debug mode in PIO. I added a CPP flag -DnoI8 but I still got errors while compiling PIO. I have attached the bld log for PIO for your reference. Thank,BalwinderFor the solving PIO problem
 

santos

Member
I think you will have to edit calcdisplace_mod in the PIO source to remove or comment out all the I8 routines. (But then you won't be able to use that copy of the code with any other compiler.)Or maybe you can try to get a different MPI library built, to use 32-bit instead of 64-bit offset? If Intel or PGI work on the exact same system, my guess is that the MPI library you are using for NAG is configured differently and that that is the problem.
 
Top