ran_state compilation error in ROMS

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
nirnimesh
Posts: 27
Joined: Tue Sep 11, 2007 6:57 pm
Location: University of Washington
Contact:

ran_state compilation error in ROMS

#1 Unread post by nirnimesh »

Dear All

I am trying to compile ROMS (checked out today using svn) in a new Linux server with Intel Fortran Compiler and OPEN MPI and get this compilation error:

Code: Select all

ran_state.f90(112): error #6284: There is no matching specific function for this generic function reference.   [REALLOCATE]
        ranseeds => reallocate (ranseeds, length, 5_i8b)
--------------------^
ran_state.f90(112): error #6678: When the target is an expression it must deliver a pointer result.   [REALLOCATE]
        ranseeds => reallocate (ranseeds, length, 5_i8b)
--------------------^
ran_state.f90(113): error #6284: There is no matching specific function for this generic function reference.   [REALLOCATE]
        ranv => reallocate (ranv, length-1_i8b)
----------------^
ran_state.f90(113): error #6678: When the target is an expression it must deliver a pointer result.   [REALLOCATE]
        ranv => reallocate (ranv, length-1_i8b)
----------------^
ran_state.f90(128): error #6284: There is no matching specific function for this generic function reference.   [ARTH]
      ranseeds(new:,2:5)=SPREAD(arth(new,1_i8b,sz),2,4)
--------------------------------^
ran_state.f90(128): error #6283: The DIM specification is out-of-range.   [2]
      ranseeds(new:,2:5)=SPREAD(arth(new,1_i8b,sz),2,4)
---------------------------------------------------^
ran_state.f90(128): error #6366: The shapes of the array expressions do not conform.   [RANSEEDS]
      ranseeds(new:,2:5)=SPREAD(arth(new,1_i8b,sz),2,4)
I am not sure what is the reason behind this error. When compared to an earlier version of the code the numbers in this new file have changed from "_i4b" to "i_8b". Coincidentally, a friend of mine tried to compile ROMS (checked out today using svn) in Mac with gfortran compiler and he got the same error as can be seen in the attached image. I might be doing something silly here, however, it would be great if someone else can take a quick look at this error as well.
Attachments
ROMS compilation error in Mac OSX with gfortran
ROMS compilation error in Mac OSX with gfortran

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: ran_state compilation error in ROMS

#2 Unread post by kate »

There was an update today, ticket 726, with changes like the following, only in ran_state:

Code: Select all

-      integer(i4b), parameter :: hg = HUGE(1_i4b)
-      integer(i4b), parameter :: hgm = -hg
-      integer(i4b), parameter :: hgng = hgm - 1
+      integer(i8b), parameter :: hg = HUGE(1_i8b)
+      integer(i8b), parameter :: hgm = -hg
+      integer(i8b), parameter :: hgng = hgm - 1
Perhaps you can revert just that file.

nirnimesh
Posts: 27
Joined: Tue Sep 11, 2007 6:57 pm
Location: University of Washington
Contact:

Re: ran_state compilation error in ROMS

#3 Unread post by nirnimesh »

Hi Kate

Thanks for getting back to me. I reverted ran_state.F to svn version 842, and now the code compiles, and I can run upwelling example. However, I do get a warning saying:

Code: Select all

ran1.f90(47): warning #6046: The INTEGER(KIND=2) value is out-of-range.   [2147483579]
      IF (rans.lt.0) rans=rans+2147483579_i4b
-------------------------------^
ran1.f90(61): warning #6046: The INTEGER(KIND=2) value is out-of-range.   [270369]
      IF (nran0.eq.1) nran0=270369_i4b
----------------------------^
ran1.f90(125): warning #6046: The INTEGER(KIND=2) value is out-of-range.   [2147483579]
     &  ranv(1:n)=ranv(1:n)+2147483579_i4b
----------------------------^
ran1.f90(140): warning #6046: The INTEGER(KIND=2) value is out-of-range.   [270369]
     &  nran(1:n)=270369_i4b
------------------^
-Nirni

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: ran_state compilation error in ROMS

#4 Unread post by kate »

Well, mod_kinds changed what i4b means:

Code: Select all

-        integer, parameter :: i1b= selected_int_kind(2)        !  1-byte
-        integer, parameter :: i2b= selected_int_kind(4)        !  2-byte
-        integer, parameter :: i4b= selected_int_kind(9)        !  4-byte
-        integer, parameter :: c8 = selected_real_kind(6,30)    ! 32-bit
-        integer, parameter :: r4 = selected_real_kind(6,30)    ! 32-bit
-        integer, parameter :: r8 = selected_real_kind(12,300)  ! 64-bit
+        integer, parameter :: i1b= SELECTED_INT_KIND(1)        !  8-bit
+        integer, parameter :: i2b= SELECTED_INT_KIND(2)        !  8-bit
+        integer, parameter :: i4b= SELECTED_INT_KIND(4)        ! 16-bit
+        integer, parameter :: i8b= SELECTED_INT_KIND(8)        ! 32-bit
+        integer, parameter :: c8 = SELECTED_REAL_KIND(6,30)    ! 32-bit
+        integer, parameter :: r4 = SELECTED_REAL_KIND(6,30)    ! 32-bit
+        integer, parameter :: r8 = SELECTED_REAL_KIND(12,300)  ! 64-bit
You still want a 32-bit int. Maybe try the new ran_state with i8b as selected_int_kind(9).

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: ran_state compilation error in ROMS

#5 Unread post by kate »

I had the same trouble with ifort. I had to switch to the old mod_kinds and the old ran_state. Weird!

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: ran_state compilation error in ROMS

#6 Unread post by arango »

Weird, I compiled with ifort, gfortran, and pgi and didn't get those errors. It turns out that I missed to transfer the updated files gasdev.F, nrutil.F, and ran1.F when I committed the ticket in another computer. We need these files to have i8b instead i4b. This is the reason why you are having problems compiling because of the mismatch between integer type arguments between these routines and ran_state.F.

Please update again. Thank you reporting this problem.

Post Reply