New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3188 for branches/2011/DEV_r2739_STFC_dCSE – NEMO

Ignore:
Timestamp:
2011-11-28T18:13:00+01:00 (12 years ago)
Author:
spickles2
Message:

Stephen Pickles, 28 Nov 2011, DCSE NEMO branch.
Changed variable name "len" to "lenin" in function
fill_buffer() in EXTERNAL/XMLF90/src/sax/m_reader.f90

The clash with the fortran intrinsic of the same name
confuses the PGI compiler (pgi/11.9.0), which generates
erroneous code when key_iomput is enabled. The symptom
is a segmentation fault at run-time while parsing iodef.xml.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/DEV_r2739_STFC_dCSE/NEMOGCM/EXTERNAL/XMLF90/src/sax/m_reader.f90

    r2281 r3188  
    137137character(len=41)  :: str       ! 40 seems like a good compromise? 
    138138                                ! (1 extra for added newline, see below) 
    139 integer            :: len 
    140 ! 
    141 read(unit=fb%lun,iostat=iostat,advance="no",size=len,fmt="(a40)") str 
     139integer            :: lenin 
     140! 
     141read(unit=fb%lun,iostat=iostat,advance="no",size=lenin,fmt="(a40)") str 
    142142 
    143143if (iostat == io_eof) then 
     
    156156! 
    157157 if (fb%debug) then 
    158    print *, "Buffer: len, iostat", len, iostat 
     158   print *, "Buffer: len, iostat", lenin, iostat 
    159159   print *, trim(str) 
    160160 endif 
     
    166166      !  Normal read, with more stuff left on the line 
    167167      ! 
    168       fb%buffer = str(1:len)  
    169       fb%nchars = len 
     168      fb%buffer = str(1:lenin)  
     169      fb%nchars = lenin 
    170170 
    171171   else         ! (end of record) 
     
    173173      !  End of record. We mark it with an LF, whatever it is the native marker. 
    174174      ! 
    175 !!      fb%buffer = str(1:len) // char(10) 
    176       fb%buffer = str(1:len)             !! Avoid allocation of string 
    177       len = len + 1                      !! by compiler 
    178       fb%buffer(len:len) = char(10)    
    179       fb%nchars = len 
     175!!      fb%buffer = str(1:lenin) // char(10) 
     176      fb%buffer = str(1:lenin)             !! Avoid allocation of string 
     177      lenin = lenin + 1                      !! by compiler 
     178      fb%buffer(lenin:lenin) = char(10)    
     179      fb%nchars = lenin 
    180180      iostat = 0 
    181181   endif 
Note: See TracChangeset for help on using the changeset viewer.