compiling

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

compiling

#1 Unread post by fdaryabor »

Hi
When compile I face to following error:

OPERATING SYSTEM IS: Linux
PROCESSOR IS: i686
cp: No match.
/bin/rm -rf core *.o AGRIFZOOM/AGRIF_YOURFILES/*.o *.i *.s *.f *.trace *.mod
/bin/rm -rf roms mpc cross_matrix cppcheck srcscheck checkkwds partit ncjoin ncrename ./rii_files
fpp -free -P -I../netcdf_ifc/ mpc.F > mpc.f
mpc.F(124): #warning: keyword redefined: integer
ifort -O3 -w90 -w95 -cm -72 -fno-alias -i4 -r8 -Vaxlib -openmp -o mpc mpc.f
fpp -free -P -I../netcdf_ifc/ main.F | ./mpc > main.f
main.F(371): #error: #if without #endif.
ifort -c -O3 -w90 -w95 -cm -72 -fno-alias -i4 -r8 -Vaxlib -openmp main.f -o main.o
fortcom: Error: main.f, line 290: Syntax error, found END-OF-FILE when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM TYPE COMPLEX BYTE CHARACTER ...
write(*,*) ' -3'
-----------------------^
fortcom: Error: main.f, line 208: This label is undefined. [100]
if (ierr.ne.0) goto 100
--------------------------^
fortcom: Error: main.f, line 221: This label is undefined. [99]
if (may_day_flag.ne.0) goto 99
----------------------------------^
compilation aborted for main.f (code 1)
gmake: *** [main.o] Error 1
mv: cannot stat `roms': No such file or directory

Everybody could help me for resolve problem thank so much.

Best Regards
F.Daryabor

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

Re: compiling

#2 Unread post by kate »

main.F(371): #error: #if without #endif.
This is where I'd look - check your main.F. If the preprocessor is unhappy, it will create an incomplete main.f that the compiler is not happy with. Somewhere along the line, I picked up a Perl script to check for matching #if/#endif tests, which I'll attach here.

OK, that didn't work due to 'The extension is not allowed.' What the heck? Let's rename that sucker and try again...
Attachments
ifdefs.F
Perl script for checking #ifdefs.
(1.5 KiB) Downloaded 209 times

fdaryabor
Posts: 78
Joined: Wed Jan 02, 2008 3:15 pm
Location: University of Copenhagen

Re: compiling

#3 Unread post by fdaryabor »

Hi kate
I have question, when I checked up Roms_Agrif directory I saw some of scripts was undefined for my case 'REGIONAL' and some of parameters for tracers (Temperature and Salinity) and baroclinic and barotropic mode was undefine thus I defined them for model ans so in main.F for example was undefined following line in main.F:

! Create climatological environment:
!-------------------------------------------------------
! Set nudging coefficient for sea surface hight and tracer
! climatology;
! Set bottom sediment grain size [m] and density [kg/m^3]
! used in bottom boundary layer formulation;
! Set initial analytical tracer climatology fields;
! Set initial sea surface height climatology;
!
#if defined TNUDGING || defined ZNUDGING || defined SPONGE \
|| (defined BBL && defined ANA_BSEDIM)\
|| (defined SEDIMENT && defined ANA_SEDIMENT)\
|| (defined TCLIMATOLOGY)\
|| (defined ZCLIMATOLOGY && defined ANA_SSH)

LINE AFTER DEFINE
! Create climatological environment:
!-------------------------------------------------------
! Set nudging coefficient for sea surface hight and tracer
! climatology;
! Set bottom sediment grain size [m] and density [kg/m^3]
! used in bottom boundary layer formulation;
! Set initial analytical tracer climatology fields;
! Set initial sea surface height climatology;
!
#if defined TNUDGING || defined ZNUDGING || defined SPONGE
# if defined BBL && defined ANA_BSEDIM
# if defined SEDIMENT && defined ANA_SEDIMENT
# if defined TCLIMATOLOGY
# if defined ZCLIMATOLOGY && defined ANA_SSH

next case for example in 'set_nudgcof.F' and 'set_nudgcof_fine.F' I define following line to script:

#if defined SCS
lon0=18.37
lat0=-33.91
rsponge=300.e3
cff=1./(50.*86400.)
cff1=Eradius*cos(lat0*deg2rad)*deg2rad
cff2=Eradius*deg2rad
do j=JstrR,JendR
do i=IstrR,IendR
dx=cff1*(lonr(i,j)-lon0)
dy=cff2*(latr(i,j)-lat0)
dr=sqrt(dx**2+dy**2)
if (dr .lt. rsponge) then
do k=1,N
Tnudgcof(i,j,k,itemp)=.5*cff*(cos(pi*dr/rsponge)+1)
& *(-atan((z_r(i,j,k)+750.)*2.e-2)/pi+.5)
Tnudgcof(i,j,k,isalt)=Tnudgcof(i,j,k,itemp)
enddo
endif
enddo
enddo
# endif
#else
subroutine set_nudgcof_fine_empty
#endif /* AGRIF && (TNUDGING || ZNUDGING || SPONGE) */
return
end

seem like this cases. whether is need that I touch to those?
Could you please guide me. Thank so much.
Best Regards
F.Daryabor

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

Re: compiling

#4 Unread post by kate »

I've said it before - you are not using the flavor of ROMS which I am familiar with. If you need this level of help, you will have to switch ROMS or find someone who is more conversant with that ROMS. I suggest you look at the .f90 file after the preprocessor has been through the code - do what you need to do to get it right there.

Post Reply