Compiling error

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
Sohana

Compiling error

#1 Unread post by Sohana »

Hi, can anyone help me work out what this error means? I am completely new to ROMS and I am using cygwin to run

In file uv_rotate.f90:260

Vout(i,j,k)=Vout(i,j,k)+ &
1
Error: Rank mismatch in array reference at (1) (3/4)
In file uv_rotate.f90:274

Vout(i,j,k)=Vrho*CosAngler(i,j)+ &
1
Error: Rank mismatch in array reference at (1) (3/4)
ROMS/Utility/Module.mk:15: recipe for target 'Build/uv_rotate.o' failed
make: *** [Build/uv_rotate.o] Error 1

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

Re: Compiling error

#2 Unread post by kate »

It's saying you have a rank mis-match for Vout. Looking at uv_rotate.F, there's a routine in which Vout is 2-D, then a routine in which Vout is 3-D. Did your uv_rotate.f90 somehow get garbled? Perhaps try deleting the uv_rotate.f90 and let the build process recreate it.

Reta91
Posts: 1
Joined: Tue Dec 15, 2015 1:30 pm
Location: University of Edinburgh

Re: Compiling error

#3 Unread post by Reta91 »

HI was there ever any solution to this problem. I have tried many many times to install ROMS at this point and this error keeps coming up. Even after I did the suggested delete of the uv_rotate.f90

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

Re: Compiling error

#4 Unread post by kate »

Did you compare uv_rotate.F to uv_rotate.f90? We edit the former while the compiler sees the latter. One gets from the first to the second using "cpp --traditional". The C preprocessor should do the right thing... and does for most of us.

roopakotta
Posts: 11
Joined: Mon Jan 16, 2017 1:02 am
Location: DSS

Re: Compiling error

#5 Unread post by roopakotta »

when i am trying to compile roms, uv_rotate.F has failed to build with this error.
uv_rotate.f90:268.18:

Vout(i,j,k)=Vout(i,j,k)+ &
1
Error: Rank mismatch in array reference at (1) (3/4)
uv_rotate.f90:268.30:

Vout(i,j,k)=Vout(i,j,k)+ &
1
Error: Rank mismatch in array reference at (1) (3/4)
uv_rotate.f90:272.18:

Vout(i,j,k)=Vout(i,j,k)*rmask_full(i,j)
1
Error: Rank mismatch in array reference at (1) (3/4)
uv_rotate.f90:272.30:

Vout(i,j,k)=Vout(i,j,k)*rmask_full(i,j)
1
Error: Rank mismatch in array reference at (1) (3/4)
uv_rotate.f90:284.18:

Vout(i,j,k)=Vrho*CosAngler(i,j)+ &
1
Error: Rank mismatch in array reference at (1) (3/4)
uv_rotate.f90:287.18:

Vout(i,j,k)=Vout(i,j,k)*rmask_full(i,j)
1
Error: Rank mismatch in array reference at (1) (3/4)
uv_rotate.f90:287.30:

Vout(i,j,k)=Vout(i,j,k)*rmask_full(i,j)
1
Error: Rank mismatch in array reference at (1) (3/4)



I am using gcc 4.9.2 and gfortran 4.9.2. my Linux_gfortran.mk file has
FC := gfortran
FFLAGS := -frepack-arrays
CPP := /usr/bin/cpp
CPPFLAGS := -P
MDEPFLAGS := --cpp --fext=f90 --file=- --objdir=$(SCRATCH_DIR)

I noticed that the error appears when SOLVE3D is defined. It is trying to do both 2d and 3d in uv_rotate.F

Any help would be appreciated.
Last edited by roopakotta on Tue Feb 21, 2017 5:53 pm, edited 1 time in total.

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

Re: Compiling error

#6 Unread post by kate »

Again, you need to look at the uv_rotate.f90 file to see what's what there with Vout. The problem is either with the cpp step or with the compile step and we can't tell from here. Maybe if you attach your uv_rotate.f90?

roopakotta
Posts: 11
Joined: Mon Jan 16, 2017 1:02 am
Location: DSS

Re: Compiling error

#7 Unread post by roopakotta »

Thank you for your reply.
I defined SOLVE3d in my cppdefs.h

Attached is my uv_rotate.f90
Attachments
uv_rotate.f90
(13.08 KiB) Downloaded 321 times

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

Re: Compiling error

#8 Unread post by kate »

There's a problem here:

Code: Select all

Vout(LBi:UBi,LBj:UBj,LBk,UBk)
which should be:

Code: Select all

Vout(LBi:UBi,LBj:UBj,LBk:UBk)
I haven't run into this problem because I have ASSUMED_SHAPE turned on and this is in the "else" case.

roopakotta
Posts: 11
Joined: Mon Jan 16, 2017 1:02 am
Location: DSS

Re: Compiling error

#9 Unread post by roopakotta »

Thank you so much kate.
It is working now.

Post Reply