[cam-users] CCM3 on CRAY SV1

Bill Peterson bill@essc.psu.edu
Tue, 22 Apr 2003 16:11:42 -0400


Rick,
If you are using cpp to preprocess the source and not using the -N
option in its invocation try adding same.  From man cpp:

     -N   cc, CC, and cpp commands.  Enables the old style (referred to as
          K&R) preprocessing.  Use this option if you have problems with
          preprocessing (especially non-C source code).

Specifically without the -N, I believe // is treated as a C++ comment by cpp
and hence it and the rest of the line are stripped.  To demonstrate, on our
SV1:

    bill[220]% cpp -I. -P  getfil.F > getfil.f
    bill[221]% cpp -I. -PN getfil.F > getfil-N.f
    bill[222]% diff getfil.f getfil-N.f
    64,65c64,65
    <       tmpnam = datadir(1:lencs(datadir)) 
    <      $     
    ---
    >       tmpnam = datadir(1:lencs(datadir)) // '/'
    >      $     // locfn(1:lencs(locfn)) 
    84c84
    <       text='msread '
    ---
    >       text='msread '//locfn(1:lencs(locfn))//' '//

Hope this helps, cheers.
-- Bill

   --------------------------------------------------------------------------
   Bill Peterson                                bill@essc.psu.edu    
   Environmental Computing Facility Director    +1 814 865 0294      
   EMS Environment Institute                    FAX:                 
   2217 Earth-Engineering Sciences, room 316    +1 814 865 3191      
   Penn State                                   ECF web site:
   University Park, PA  16802-6813              http://www.emsei.psu.edu/ecf
   --------------------------------------------------------------------------

 Tue, Apr 22, 2003 at 11:10:10AM -0400, Rick Toracinta wrote:
> 
> Greetings,
> 
> I'm hoping someone can shed some light on a plaguing problem. I'm
> attempting to run the CCM3 (version 3.6.16) on a CRAY SV1 at the
> Ohio Supercomputer Center (OSC).  I have successfully compiled and 
> run the code on the SV1 in the recent past (10 months ago).  In the
> last weeks, I came across a series of syntax errors when trying to 
> compile on the SV1.  It seems the compiler doesn't like
> "dangling" concatenation characters (//) at the end of a line that 
> is continued on the next line.  For instance, this code segment
> from getfil.F gives a compilation error:
> 
>        tmpnam = datadir(1:lencs(datadir)) // '/' //
>      $     locfn(1:lencs(locfn))
>  
> So, to correct this, I simply moved the concatenation
> characters to the next line:
> 
>        tmpnam = datadir(1:lencs(datadir)) // '/'
>      $    // locfn(1:lencs(locfn))
>  
> and that allowed the code to compile correctly.  However, it appears
> that the REAL problem, on execution, is that the program won't 
> concatenate the strings regardless of syntax (e.g., whether the
> command is one line or continued on multiple lines).  In the
> above examples, the code doesn't cat the filename onto the directory
> path.  tmpnam is set to datadir, it tries (unsuccessfully) to open the
> directory, and aborts.  
>  
> This problem never occurred running CCM3 previously on the SV1.
> I've been told by the folks at OSC that there was a compiler 
> upgrade a few months ago.  However, suggestions thus far from 
> the OSC technical folks haven't resolved the problem.  Furthermore,
> they have _not_ been able to duplicate the failed concatenation
> using a simple test program.  I realize this is probably
> compiler/platform specific, but has anyone else encountered a similar
> problem running CCM3 on a CRAY or have any suggestions on how to 
> resolve this?  
> 
> 
> Many thanks,
> 
> 
> Rick Toracinta
> Byrd Polar Research Center
> The Ohio State University
> Columbus, OH
> 
> 
> _______________________________________________
> cam-users mailing list
> cam-users@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/cam-users