ROMS compiling error: mod_tides.f90

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
d.kobashi
Posts: 67
Joined: Tue Sep 28, 2010 11:59 pm
Location: Texas A&M University

ROMS compiling error: mod_tides.f90

#1 Unread post by d.kobashi »

Dear ROMS users,

I am a bit struggling to figure out the problem I am encountering on ROMS compiling.
I have successfully compiled the upwelling example and recently yellow sea example.
When I tried to compile my own model (barotropic model with winds and tidal elevation/current as OBC), I encountered the following errors (I actually had a total of 15 similar errors, but show just three here). I use _M2FLATHER and _FSCHAPMAN as OBC options for all open boundaries. I processed OTPS tidal model outputs to create a forcing file (via matlab program provided by OSU). I use intel fortran 10.1 for linux on Ubuntu 10.4.

---------------------------errors from here--------------------------------------------------------------
mod_tides.f90(49): error #5082: Syntax error, found '(' when expecting one of: %FILL <IDENTIFIER>
TYPE (T_TIDES), allocatable :: (:)
---------------------------------------^
mod_tides.f90(110): error #5082: Syntax error, found '(' when expecting one of: TYPE COMPLEX BYTE CHARACTER CLASS DOUBLE DOUBLECOMPLEX DOUBLEPRECISION INTEGER ...
IF (ng.eq.1) allocate ( (Ngrids) )
------------------------------^
mod_tides.f90(114): error #5082: Syntax error, found '(' when expecting one of: TYPE COMPLEX BYTE CHARACTER CLASS DOUBLE DOUBLECOMPLEX DOUBLEPRECISION INTEGER ...
allocate ( (ng) % Tperiod(MTC) )
-----------------^


I tracked down the file mod_tides.f90. There was not the variable, "TIDES" in mod_tides.f90 in my Build folder when compared to mod_tides.f90 in the ./ROMS/src/ROMS/Modules/mod_tides.F (see below. The last line). I don't know how that happened. Did anyone have this error before? My custom cppdefs.h is also attached. Any comments would be appreciated. Kind regards, -DJ


---------------------original file (mod_tides.F)----------------------------
USE mod_kinds

implicit none

TYPE T_TIDES

real(r8), pointer :: Tperiod(:)
# if defined AVERAGES_DETIDE && defined AVERAGES
real(r8), pointer :: CosOmega(:)
real(r8), pointer :: SinOmega(:)
real(r8), pointer :: CosW_avg(:)
real(r8), pointer :: CosW_sum(:)
real(r8), pointer :: SinW_avg(:)
real(r8), pointer :: SinW_sum(:)
real(r8), pointer :: CosWCosW(:,:)
real(r8), pointer :: SinWSinW(:,:)
real(r8), pointer :: SinWCosW(:,:)
# endif
# if defined SSH_TIDES
real(r8), pointer :: SSH_Tamp(:,:,:)
real(r8), pointer :: SSH_Tphase(:,:,:)
# endif
# if defined UV_TIDES
real(r8), pointer :: UV_Tangle(:,:,:)
real(r8), pointer :: UV_Tmajor(:,:,:)
real(r8), pointer :: UV_Tminor(:,:,:)
real(r8), pointer :: UV_Tphase(:,:,:)
# endif
# if defined AVERAGES_DETIDE && defined AVERAGES
real(r8), pointer :: ubar_detided(:,:)
real(r8), pointer :: ubar_tide(:,:,:)

real(r8), pointer :: vbar_detided(:,:)
real(r8), pointer :: vbar_tide(:,:,:)

real(r8), pointer :: zeta_detided(:,:)
real(r8), pointer :: zeta_tide(:,:,:)
# ifdef SOLVE3D
real(r8), pointer :: t_detided(:,:,:,:)
real(r8), pointer :: t_tide(:,:,:,:,:)

real(r8), pointer :: u_detided(:,:,:)
real(r8), pointer :: u_tide(:,:,:,:)

real(r8), pointer :: v_detided(:,:,:)
real(r8), pointer :: v_tide(:,:,:,:)
# endif
# endif

END TYPE T_TIDES

TYPE (T_TIDES), allocatable :: TIDES(:)

------------------------mod_tides.f90 in the Build folder-------------------------------------------

USE mod_kinds
implicit none
TYPE T_TIDES
real(r8), pointer :: Tperiod(:)
real(r8), pointer :: SSH_Tamp(:,:,:)
real(r8), pointer :: SSH_Tphase(:,:,:)
real(r8), pointer :: UV_Tangle(:,:,:)
real(r8), pointer :: UV_Tmajor(:,:,:)
real(r8), pointer :: UV_Tminor(:,:,:)
real(r8), pointer :: UV_Tphase(:,:,:)
END TYPE T_TIDES
TYPE (T_TIDES), allocatable :: (:)
^^^^^^
Attachments
seq_test.h
custom cppdefs file
(2.42 KiB) Downloaded 313 times

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

Re: ROMS compiling error: mod_tides.f90

#2 Unread post by arango »

It seems that your application CPP option is TIDES. You cannot used this word because it is the name of the Fortran pointer structure. That's the reason why you have blanks in the pre-processed code. Use a different word for your application.

:idea: :idea: :idea: We cannot use words that are either a Fortran intrinsic function, a executable instruction, a subroutine name, a variable name, or TILE!!! Please check how C-preprocessing works.

User avatar
d.kobashi
Posts: 67
Joined: Tue Sep 28, 2010 11:59 pm
Location: Texas A&M University

Re: ROMS compiling error: mod_tides.f90 (SOLVED)

#3 Unread post by d.kobashi »

Thanks Hernan for your input,
You were absolutely right! My cpp option included "TIDES". :oops: I changed it to something else and it worked like a charm... :D

Good to know how ROMS works. Still learning.

Thanks again for your help.

Kind regards,

DJ

Post Reply