Compilation errors due undefined _r8

Frequently Asked Questions about ROMS usage

Moderators: arango, kate, robertson

Post Reply
Message
Author
tim_cera

Compilation errors due undefined _r8

#1 Unread post by tim_cera »

Hello,

When compiling the 'initial' package there are complaints about '_r8'. I have never seen '_r8' before attached to numbers so thought it might be a cpp thing.

Tried running cpp with the options supplied in the Makefile, but no change.

Trying this on Redhat 7.2 (we will be upgrading within the month) with g77. We also have the Portland Group compilers, but there wasn't a Makefile for them.

Any ideas?

Thanks

Tim Cera

Code: Select all

> make -f Makefile.Gnu
g77 -c -DNO_EXIT -g -O2 initial.F
g77 -c -DNO_EXIT -g -O2 bleck.F
bleck.F: In subroutine `bleck':
bleck.F:55:
           w(lis,j)=0.25_r8*(f(lis,j+1)+f(lis,j-1)+2.0_r8*f(lis,j))
                        ^
Invalid form for assignment statement at (^)

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

#2 Unread post by arango »

Seems that I keep answering this question over an over. Perhaps, the information on the web site is not that clear about this. Firstly, the Fortran codes for the initialization package have not been updated in several years. I think that nobody is using these programs nowadays since there is a lot of Matlab scripts around to build initial and other ROMS input NetCDF files. The Matlab scripts are very easy to use and have a lot of flexibility.

Secondly, every time that you see _r8 errors during compilation, it indicates that you are not using the appropriate cpp program or cpp flags in the makefile. We need a cpp program that allows multiple substitutions in a single line. The cpp program available in some operating systems do not allow this. In such a case, we provide a cpp program that the user needs to compile. It is very easy to do by downloading the following tar file:

http://www.myroms.org/software/Processing/cpp/cpp.tar

This cpp program was written by der Mouse several years ago and it is very robust. Information about this is also provided in the Processing Packages menu of the ROMS web site.

The _r8 is an alias to provide the same capability of the kind atribute of Fortran 90. Recall, that all these ROMS processing programs are written in Fortran 77. Nowadays, ROMS is written in Fortran 90 and we do not longer have such compilation problems.

tim_cera

Propose new directory structure and README for 'initial'

#3 Unread post by tim_cera »

Given the above information, I propose that the 'initial' package directory structure and README be modified.

Code: Select all

initial/
  fortran/
    All fortran file
  matlab/
    All matlab files
  example_control_scripts
    All control scripts
The README with the 'initial' package should state that the fortran code is deprecated and mention the enhanced 'cpp' if the user does want to use the fortran code.

Something like
The code in the 'fortran' directory has been deprecated. It follows the old ROMS build requirements that require the enhanced 'cpp' program written by der Mouse. The enhanced 'cpp' can be found at http://www.myroms.org/software/Processing/cpp/cpp.tar
Thanks

Tim Cera

Post Reply