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

CCSM: nan errors when compiling. Please help!

smoggy

smogger
New Member
I'm trying to install CCSM 4_02, but I'm getting these errors during compilation (during clm.buildexe.csh):

/xxx/CESM/models/lnd/clm/src/main/ncdio.F90(5060): error #6906: The value of the integer is either too great or too small, and overflow/underflow occurred. [O'0777610000000000000000']
data_offset = nan
---------------------^
/xxx/CESM/models/lnd/clm/src/main/ncdio.F90(5094): error #6906: The value of the integer is either too great or too small, and overflow/underflow occurred. [O'0777610000000000000000']
pfts(:) = nan
---------------------^
/xxx/CESM/models/lnd/clm/src/main/ncdio.F90(5095): error #6906: The value of the integer is either too great or too small, and overflow/underflow occurred. [O'0777610000000000000000']
data_offset = nan

OS: Ubuntu 16.04
Fortran compiler: ifort 19.1.2.254 and mpiifort (that came with Parallel Studio 2020)
CCSM machine type: generic_linux_machine
CCSM version: ccsm4_0_a02

Here's the file (ncdio.F90) where the errors are happening:
On this forum (see link below), someone else had the exact same problem when trying to compile CESM (but I'm trying to compile CCSM). Another user suggested that using a newer version of CESM might fix the issue. That was indeed the solution. However, I've looked through all of the CCSM versions, and all of the "ncdioF90" files look exactly the same (based on a quick skim).
Forums link: https://bb.cgd.ucar.edu/cesm/threads/clm-buildexe-csh-failed.2593/

All the different versions of the file:

What am I doing wrong? How can I fix this issue?

Thanks in advance!
 

mlevy

Michael Levy
CSEG and Liaisons
Staff member
It looks like the fix mentioned in https://bb.cgd.ucar.edu/cesm/threads/clm-buildexe-csh-failed.2593/#post-11418 is to use bigint instead of nan. You may need to make this change in multiple files if ncdio.F90 is just the first file the compiler complained about.

Code:
$ svn diff
Index: ncdio.F90
===================================================================
--- ncdio.F90    (revision 231)
+++ ncdio.F90    (working copy)
@@ -5000,7 +5000,7 @@
 !
 ! !USES:
     use clm_varpar  , only : maxpatch
-    use nanMod      , only : nan
+    use nanMod      , only : bigint
     use clm_varctl  , only : scmlon,scmlat,single_column
 !
 ! !ARGUMENTS:
@@ -5054,8 +5054,8 @@
        call check_ret(nf_inq_varid      (ncid, 'cols1d_lat', varid),     subname)
        call check_ret(nf_get_var_double (ncid, varid,        cols1dlat), subname)

-       cols(:)     = nan
-       data_offset = nan
+       cols(:)     = bigint
+       data_offset = bigint
        i = 1
        ndata = 0
        do cc = 1, totcols
@@ -5089,8 +5089,8 @@
        call check_ret( nf_inq_varid     (ncid, 'pfts1d_lat', varid),     subname)
        call check_ret(nf_get_var_double (ncid, varid,        pfts1dlat), subname)

-       pfts(:)     = nan
-       data_offset = nan
+       pfts(:)     = bigint
+       data_offset = bigint
        i     = 1
        ndata = 0
        do cc = 1, totpfts
 
Top