error compiling my simple application

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

error compiling my simple application

#1 Unread post by mariafattorini »

Hello,

I am trying to build a my simple application, but when I type "./build.bash" to compile it, the following error appears:

Code: Select all

ROMS/Bin/cpp_clean /home/maria/roms/Projects/prova1/Build/mp_exchange.f90
cd /home/maria/roms/Projects/prova1/Build; /usr/bin/gfortran-4 -c -frepack-array
s -O3 -ffast-math mp_exchange.f90
cd /home/maria/roms/Projects/prova1/Build; /usr/bin/gfortran-4 -c -frepack-array
s -O3 -ffast-math bbl.f90
bbl.f90:17.21:

PUBLIC  :: bblm
              1
Error: Symbol 'bblm' at (1) has no IMPLICIT type
make: *** [/home/maria/roms/Projects/prova1/Build/bbl.o] Error 1
I have opened the file bbl.F in ROMS/Nonlinear directory, but I don't understand what "bblm" is and I don't know what to do and where to look.
Can somebody give me any suggestions?
Thanks,
Maria

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

Re: error compiling my simple application

#2 Unread post by kate »

bblm is the name of a public function for the bottom boundary layer. To get that error, you must have defined BBL_MODEL, but not picked a specific implementation of it. Your options:

Code: Select all

# if defined SSW_BBL
#  include "ssw_bbl.h"
# elif defined MB_BBL
#  include "mb_bbl.h"
# elif defined SG_BBL
#  include "sg_bbl.h"
# endif
In other words, if you want a bottom boundary layer, leave BBL_MODEL on and pick one of SSW_BBL, MB_BBL or SG_BBL. Otherwise, make sure BBL_MODEL is undefined.

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: error compiling my simple application

#3 Unread post by mariafattorini »

Hello all and many thanks to Kate for reply.

now, when compiling I have the following error:

Code: Select all

s -O3 -ffast-math -ffree-form -ffree-line-length-none analytical.f90
analytical.f90:463.27:
          Hwave(i,j)=2.0_r8        
                          1
Error: Unexpected STATEMENT FUNCTION statement at (1)
analytical.f90:464.36:
          Dwave(i,j)=90.0_r8*deg2rad
                                   1
Error: Unexpected STATEMENT FUNCTION statement at (1)
analytical.f90:465.31:
          Pwave_bot(i,j)=8.0_r8
                              1
Error: Unexpected STATEMENT FUNCTION statement at (1)
analytical.f90:466.28:
          Lwave(i,j)=20.0_r8
                           1
Error: Unexpected STATEMENT FUNCTION statement at (1)
make: *** [/home/maria/roms/Projects/prova1/Build/analytical.o] Error 1
I don't understand, why are these values not good? I have taken these values from Sed_Toy test case.

Many thank in advance,
Maria

jcwarner
Posts: 1179
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: error compiling my simple application

#4 Unread post by jcwarner »

looks like there is something wrong at the end of allthose lines. Did you copy that in dos? is there a ctrl^M there? Try dos2unix on that routine.

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: error compiling my simple application

#5 Unread post by mariafattorini »

Thanks Jcwarner,
I have tried "dos2unix -U ana_wwave.h", without good result.
In the ana_wwave.h I have added the following lines about my application "PROVA1":

Code: Select all

...
#if defined BL_TEST
      wdir=210.0_r8*deg2rad
      DO j=JstrR,JendR
        DO i=IstrR,IendR
          Hwave(i,j)=0.5_r8
          Dwave(i,j)=wdir
          Pwave_bot(i,j)=8.0_r8
        END DO
      END DO
#elif defined PROVA1
      DO j=JstrR,JendR
        DO i=IstrR,IendR
          Hwave(i,j)=2.0_r8
          Dwave(i,j)=90.0_r8*deg2rad
          Pwave_bot(i,j)=8.0_r8
          Lwave(i,j)=20.0_r8
        END DO
      END DO
#elif defined LAKE_SIGNELL
....
I read in the "Options" wikipage at the lines about ANA_WWAVE that BBL_MODEL is required: perhaps the problem is that I must also define BBL_MODEL in the header file, can this be?

Bye, Maria

jcwarner
Posts: 1179
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: error compiling my simple application

#6 Unread post by jcwarner »

the ana_* files can be tricky.
Did you copy that ana_wwave.h file from a different version of the code?
Can you edit Build/mod_scalars.f90 and see if deg2rad is in there?
There are several options that require waves. If you defined one of the bbl models then that is fine.
You do not need to explicilty define "BBL_MODEL". That is an automatic switch. You do need to define one of the bbls like
#define SSW_BBL
Did the code compile LAKE_SIGNELL correctly?

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

Re: error compiling my simple application

#7 Unread post by kate »

Error: Unexpected STATEMENT FUNCTION statement at (1)
analytical.f90:466.28:
Lwave(i,j)=20.0_r8
1
This points more to what was declared in mod_forces.F. If it doesn't think Lwave is an array, then this must be a statement function. Check for Lwave and friends in mod_forces.f90 in the build directory. From mod_forces.F:

Code: Select all

#ifdef WAVES_LENGTH
          real(r8), pointer :: Lwave(:,:)
# ifndef ANA_WWAVE
          real(r8), pointer :: LwaveG(:,:,:)
# endif
#endif
Make sure that WAVES_LENGTH and so forth are defined.

Check globaldefs.h to see what it's defining for you:

Code: Select all

#if defined SSW_BBL || defined MB_BBL || defined SG_BBL
# define BBL_MODEL
#endif
It also defines these WAVES_LENGTH in some cases. Is yours one of those cases?

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: error compiling my simple application

#8 Unread post by mariafattorini »

Hello Kate and Jcwarner,
thank you much for your help.

1. in my "mod_scalars.f90" there is deg2rad;
2. the Lake signell test case is correctly compiled;
3. in my "mod_forces.f90" (in Build directory), any variable about wave (Hwave and friends) are not definited;
4. in the "globaldefs.h" (in the ROMS/Include directory) there are the lines reported by Kate (#if defined SSW_BBL ....).

Now I have also defined SSW_BBL and BBL_MODEL options (before I did not define them) in the header file and there are only these errors:

Code: Select all

s -O3 -ffast-math -ffree-form -ffree-line-length-none analytical.f90
analytical.f90:626.27:

          Hwave(i,j)=2.0_r8
                          1
Error: Unexpected STATEMENT FUNCTION statement at (1)
analytical.f90:629.28:

          Lwave(i,j)=20.0_r8
                           1
Error: Unexpected STATEMENT FUNCTION statement at (1)
make: *** [/home/maria/roms/Projects/prova1/Build/analytical.o] Error 1
while Dwave and Pwave are defined in mod_forces.f90.
I don't know where my error is.
Maria

jcwarner
Posts: 1179
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: error compiling my simple application

#9 Unread post by jcwarner »

almost there.
1) you should not define BBL_MODEL. that is an internal switch.
You should define SSW_BBL.
2) with SSW_BBL, it needs certain wave parameters.
It needs 3 things:
- Dwave,
- Pwave_bot,
- Then a choice of Hwave or Ub_swan.
If you have values of bottom orbital velocity (Ub_swan), then give those values and do not give Hwave.
or
If you want the bbl routine to calculate Ub_swan then you need to give it Hwave and not UB_swan, and define
define SSW_CALC_UB.

( i need to change the name of Ub_swan to just Ub. )

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: error compiling my simple application

#10 Unread post by mariafattorini »

Hello jcwarner,
you are right: in my mod_forces.f90 (in the Build directory) there are "Ub_swan" "Dwave" and "Pwave_bot" and there are not Hwave and Lwave.

In my test I defined the following CPP options:

Code: Select all

#define UV_ADV 
#define UV_COR
#define UV_LDRAG
#define UV_VIS2
#define MIX_S_UV

#define TS_U3HADVECTION
#define TS_C4VADVECTION
#define MIX_S_TS

#define SOLVE3D

#define AVERAGES
#define DIAGNOSTICS_TS
#define DIAGNOSTICS_UV

#define SSW_BBL

#define ANA_INITIAL
#define ANA_WINDS
#define ANA_SEDIMENT
#define ANA_WWAVE
#define ANA_VMIX
I don't know how and where I have defined Ub_swan.

Maria

jcwarner
Posts: 1179
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: error compiling my simple application

#11 Unread post by jcwarner »

a little bit of confusion still exists. Hope this clears it up.
You need to decide:
1) Do you have bottom orbital velocity values
-- or --
2) Do you have wave heights and you need the model to compute bottom orbital velocities.

if 1) then
#define SSW_BBl
and give values for
Pwave_bot
Dwave
Ub_swan

-- or --
if 2) then
#define SSW_BBL
#define SSW_CALC_UB
and give values for
Pwave_bot
Dwave
Hwave

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: error compiling my simple application

#12 Unread post by mariafattorini »

Ok, it's clear now, I understand.
thank you very much.

I have added SSW_CALC_UB in the header file.
Now only this error remains:

Code: Select all

 s -O3 -ffast-math -ffree-form -ffree-line-length-none analytical.f90
analytical.f90:618.28:

          Lwave(i,j)=20.0_r8
                           1
Error: Unexpected STATEMENT FUNCTION statement at (1)
make: *** [/home/maria/roms/Projects/prova1/Build/analytical.o] Error 1
Do you know on what this error depends?

Thanks, maria

jcwarner
Posts: 1179
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: error compiling my simple application

#13 Unread post by jcwarner »

There is no need for Lwave, so it does not know what that variable is.
So just comment that part out and see if it compiles.

mariafattorini
Posts: 52
Joined: Tue Mar 03, 2009 2:39 pm
Location: C.N.R. - LaMMA

Re: error compiling my simple application

#14 Unread post by mariafattorini »

yes, removing Lwave in ana_wwave.h the compiler runs correctly.
I want not being tedious but I would like to know when Lwave is used;

many thanks again, Maria

jcwarner
Posts: 1179
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: error compiling my simple application

#15 Unread post by jcwarner »

Lwave is used in :
1) NEARSHORE_MELLOR
for radiation stress computations
2) COARE_TAYLOR_YELLAND or COARE_OOST - look in the bulk_flux.F

-j

rgon
Posts: 12
Joined: Thu Jan 29, 2009 4:00 pm
Location: University of Plymouth

Re: error compiling my simple application

#16 Unread post by rgon »

Hello,
I'm trying to add ANA_WWAVES to my test run but got the following compilation error:

Code: Select all

cd /.../roms/Projects/wh10/Build; /cvos/shared/apps/intel/Compiler/11.0/074/bin/intel64/ifort -c -heap-arrays -fp-model precise -ip -O3 -xW bbl.f90
bbl.f90(84): error #6460: This is not a field name that is defined in the encompassing structure.   [Z_R]
     &                GRID(ng) % z_r,                                   &
---------------------------------^
bbl.f90(85): error #6460: This is not a field name that is defined in the encompassing structure.   [Z_W]
     &                GRID(ng) % z_w,                                   &
---------------------------------^
bbl.f90(91): error #6460: This is not a field name that is defined in the encompassing structure.   [RHO]
     &                OCEAN(ng) % rho,                                  &
----------------------------------^
bbl.f90(92): error #6460: This is not a field name that is defined in the encompassing structure.   [U]
     &                OCEAN(ng) % u,                                    &
----------------------------------^
bbl.f90(93): error #6460: This is not a field name that is defined in the encompassing structure.   [V]
     &                OCEAN(ng) % v,                                    &
----------------------------------^
bbl.f90(84): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [Z_R]
     &                GRID(ng) % z_r,                                   &
---------------------------------^
bbl.f90(85): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [Z_W]
     &                GRID(ng) % z_w,                                   &
---------------------------------^
bbl.f90(91): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [RHO]
     &                OCEAN(ng) % rho,                                  &
----------------------------------^
bbl.f90(92): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [U]
     &                OCEAN(ng) % u,                                    &
----------------------------------^
bbl.f90(93): error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [V]
     &                OCEAN(ng) % v,                                    &
----------------------------------^
compilation aborted for bbl.f90 (code 1)
make: *** [/.../roms/Projects/wh10/Build/bbl.o] Error 1
Is there something wrong within the grid file?
Thanks for suggestions.

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

Re: error compiling my simple application

#17 Unread post by kate »

Which boundary layer model are you using? Did you turn on SOLVE3D?

rgon
Posts: 12
Joined: Thu Jan 29, 2009 4:00 pm
Location: University of Plymouth

Re: error compiling my simple application

#18 Unread post by rgon »

Dear Kate,
Below is my cpp.h file, and before adding ana_wwaves the model was running good with a tidal forcing file in the depth-averaged mode (2D).

Code: Select all

#define UV_COR
#define UV_QDRAG
#define UV_VIS2
#define UV_ADV

#define MASKING
#define WET_DRY

#define NORTH_FSCHAPMAN
#define NORTH_M2FLATHER
#define NORTH_TRADIATION

#define WEST_FSCHAPMAN
#define WEST_M2FLATHER
#define WEST_TRADIATION

#define SOUTH_FSCHAPMAN
#define SOUTH_M2FLATHER
#define SOUTH_TRADIATION

/* TIDES */

#define SSH_TIDES 
#define UV_TIDES
#define RAMP_TIDES

#ifdef SSH_TIDES
#define ADD_FSOBC
#endif

#ifdef UV_TIDES
#undef FSOBC_REDUCED
#define ADD_M2OBC
#endif

#define ANA_INITIAL
#define ANA_SMFLUX
#define ANA_FSOBC
#define ANA_M2OBC

/* WAVES define only one of the four following, copied from Lake_Signell */

#undef UV_LOGDRAG
#undef MB_BBL
#undef SG_BBL
#define SSW_BBL

#ifdef SG_BBL
# define SG_CALC_ZNOT
# undef  SG_LOGINT
#endif
#ifdef MB_BBL
# define MB_CALC_ZNOT
# undef  MB_Z0BIO
# undef  MB_Z0BL
# undef  MB_Z0RIP
#endif
#ifdef SSW_BBL
# define SSW_CALC_ZNOT
# undef  SSW_LOGINT
#endif

#if defined MB_BBL || defined SG_BBL || defined SSW_BBL
# define ANA_WWAVE
#endif
Thanks for the wise replay

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

Re: error compiling my simple application

#19 Unread post by kate »

I don't see "#define SOLVE3D". The fields it complains about are from the 3-D model. I believe the BBL codes don't make sense in just 2-D either.

rgon
Posts: 12
Joined: Thu Jan 29, 2009 4:00 pm
Location: University of Plymouth

Re: error compiling my simple application

#20 Unread post by rgon »

Hi,
I turned the model into a 3D mode to use the ANA_WWAVE, it compiles ok with/without ANA_WWAVE (waves) (see the cpp options below), but when I run it with ana_wwave asks for an ocean_ini.nc file or variables, I’ve checked everything and don’t know what could be. What variables do I have to define/declare in order to use ANA_WWAVE?
Thanks for any replay.

Code: Select all

CPP.H

#define UV_ADV                 /* use to turn ON or OFF advection terms  */
#define UV_COR                 /* use to turn ON or OFF Coriolis term    */
#define UV_QDRAG               /* use to turn ON or OFF quadratic bottom friction */
#define UV_VIS4                /* use to turn ON or OFF harmonic horizontal mixing */
#define MIX_S_UV               /* momentum mixing on s-surfaces */
#define DJ_GRADPS              /* use if splines density Jacobian (Shchepetkin, 2000) */
#define TS_U3HADVECTION        /* use if 3rd-order upstream horiz. advection */
#define TS_C4VADVECTION        /* use if 4th-order centered vertical advection */
#define SOLVE3D                /* use if solving 3D primitive equations */
#define SPLINES                /* use to activate parabolic splines reconstruction */
#define MASKING
#define WET_DRY

#define NORTH_FSCHAPMAN
#define NORTH_M2FLATHER
#define NORTH_TRADIATION
#define NORTH_M3GRADIENT 

#define WEST_FSCHAPMAN
#define WEST_M2FLATHER
#define WEST_TRADIATION
#define WEST_M3GRADIENT 

#define SOUTH_FSCHAPMAN
#define SOUTH_M2FLATHER
#define SOUTH_TRADIATION
#define SOUTH_M3GRADIENT 

/* TIDES */

#define SSH_TIDES 
#define UV_TIDES
#define RAMP_TIDES

#ifdef SSH_TIDES
#define ADD_FSOBC
#endif

#ifdef UV_TIDES
#undef FSOBC_REDUCED
#define ADD_M2OBC
#endif

#define ANA_INITIAL
#define ANA_SMFLUX
#define ANA_FSOBC
#define ANA_M2OBC
#define ANA_STFLUX             /* use if analytical surface temperature flux */
#define ANA_SSFLUX             /* use if analytical surface salinity flux */
#define ANA_BSFLUX             /* use if analytical bottom salinity flux */
#define ANA_BTFLUX             /* use if analytical bottom temperature flux */

[color=#FF0000]--------->  up to here the model works fine, but when I add the next three options it asks for an ocean_ini.nc file[/color]

/* WAVES */   
#define ANA_WWAVE
#define SSW_BBL
#define SSW_CALC_UB

_________________________________________
[color=#FF0000]Here the values of the ana_wwave.h file:[/color]

#elif defined WH_COAST
      DO j=JstrR,JendR
        DO i=IstrR,IendR
          Hwave(i,j)=1.4_r8
          Dwave(i,j)=1.0_r8*deg2rad
          Pwave_bot(i,j)=6.0_r8
        END DO
      END DO

______________________________________________________
[color=#FF0000]OUTPUT FILE:[/color]
Output/Input Files:

             Output Restart File:  wh_rst.nc
             Output History File:  wh_his.nc
                 Input Grid File:  wh_easyfine_grd.nc

 READ_PHYPAR - could not find input file:  ocean_ini.nc    [color=#FF0000]< --- HERE IS THE PROBLEM[/color]

 Elapsed CPU time (seconds):

 Thread #  0 CPU:       0.063
 Total:                 0.063

 Nonlinear model elapsed time profile:

                                              Total:         0.000    0.0000

 All percentages are with respect to total time =            0.063

 ROMS/TOMS - Output NetCDF summary for Grid 01:

 ROMS/TOMS - I/O error ............... exit_flag:   4


 ERROR: I/O related problem.

Post Reply