Compiling problem with swan coupling

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
hbzong
Posts: 36
Joined: Thu Oct 04, 2007 4:14 am
Location: Fathom Science
Contact:

Compiling problem with swan coupling

#1 Unread post by hbzong »

I updated ROMS this morning and then I couldn't compile it successfully with swan coupling. A array named 'OutField' in roms_export.f90 (line 91)was not be declared.

hbzong
Posts: 36
Joined: Thu Oct 04, 2007 4:14 am
Location: Fathom Science
Contact:

#2 Unread post by hbzong »

New update was applied this morning. However, I couldn't compile it either.

fortcom: Error: inp_par.f90, line 494: The ARRAY argument of the ALLOCATED inquiry intrinsic function shall be an allocatable array. [ALLOCATED]
IF (.not.allocated(Export(Iocean)%code)) THEN
------------------------------------------------^
fortcom: Error: inp_par.f90, line 504: The ARRAY argument of the ALLOCATED inquiry intrinsic function shall be an allocatable array. [ALLOCATED]
IF (.not.allocated(Export(Iwaves)%code)) THEN
------------------------------------------------^
fortcom: Error: inp_par.f90, line 514: The ARRAY argument of the ALLOCATED inquiry intrinsic function shall be an allocatable array. [ALLOCATED]
IF (.not.allocated(Export(Iatmos)%code)) THEN
------------------------------------------------^
fortcom: Error: inp_par.f90, line 536: The ARRAY argument of the ALLOCATED inquiry intrinsic function shall be an allocatable array. [ALLOCATED]
IF (.not.allocated(Import(Iocean)%code)) THEN
------------------------------------------------^
fortcom: Error: inp_par.f90, line 546: The ARRAY argument of the ALLOCATED inquiry intrinsic function shall be an allocatable array. [ALLOCATED]
IF (.not.allocated(Import(Iwaves)%code)) THEN
------------------------------------------------^
fortcom: Error: inp_par.f90, line 556: The ARRAY argument of the ALLOCATED inquiry intrinsic function shall be an allocatable array. [ALLOCATED]
IF (.not.allocated(Import(Iatmos)%code)) THEN

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

#3 Unread post by arango »

It works for me. The error that you are having indicates to me that the option MODEL_COUPLING has not be activated internally (globaldefs.h) to declare all the necessary arrays in Modules/mod_coupler.F. The switch to couple to SWAN is SWAN_COUPLING :idea:

The other error that you are having is probably because you haven't activated MCT_LIB. You need to put something like this in your application header file:

Code: Select all

#define SWAN_COUPLING
#ifdef SWAN_COUPLING
# define MCT_LIB
#endif
Recall that there are two coupling libraries options in ROMS: ESMF_LIB and MCT_LIB. Currently, the coupling with SWAN is only available with the MCT library. These kind of errors are very easy to find by just looking the compiled f90 files and the standard output information during compilation. You just need to read carefully the dependencies.

I just compiled the INLET_TEST with no errors :!:

hbzong
Posts: 36
Joined: Thu Oct 04, 2007 4:14 am
Location: Fathom Science
Contact:

#4 Unread post by hbzong »

I see. Thank you very much.

hbzong
Posts: 36
Joined: Thu Oct 04, 2007 4:14 am
Location: Fathom Science
Contact:

#5 Unread post by hbzong »

I added #define MCT_LIB to my application header file:

#define SWAN_COUPLING
#ifdef SWAN_COUPLING
# define MCT_LIB
# define SSW_BBL
#endif

The error still occurred during compiling.

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

#6 Unread post by arango »

I think that you are doing something wrong. Try to run the INLET_TEST to see if works for you. You may have done changes to the code that failed when you updated. Need to check if you got rejected files.

hbzong
Posts: 36
Joined: Thu Oct 04, 2007 4:14 am
Location: Fathom Science
Contact:

#7 Unread post by hbzong »

Same error during compiling.
I created a new directory and used svn checkout to get the totally new codes. And same problem ...

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

#8 Unread post by arango »

I don't get that. I works for me. I compiled the latest version (revision 175) from the trunk with PGI and IFORT. I don't know where your problem is. I compile the INLET_TEST using the build.sh script. You need to check what you are doing and the Build sub-directory to see what files you have. Check the MakeDepend file.

We don't have time to check every problem reported by an user. I only intervene when there is actually a problem that I need to fix. Users need to be more curious and become problem solvers, troubleshooters. There are hundreds of posts in this forum of reported problems with very minimal information.

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

#9 Unread post by arango »

I have more time to think about your problem. This looks like a compiler problem when allocating that structure. It seems that other compilers do this allocation differently. I tried with a newer version of the IFORT compiler and I was able to reproduce your error.

I experimented with different ways to allocate this structure in a more robust way. Then, I was able to compile with the newer IFORT compiler. I think that this will solve your problem. Thank you for reporting this problem. Please update your code.

Post Reply