Changes between Initial version and Version 2 of Ticket #267


Ignore:
Timestamp:
2012-01-19T14:30:23Z (13 years ago)
Author:
Ian Culverwell
Comment:

Not so fast, matey. ROPP test folder testing showed that the READ(proc_date(1:4) , *) business failed when proc_date(1:4) was fully blank. (Oddly, READ(proc_date(1:4) , "(i4.4)") - which generally failed on Lahey95 - coped OK with this, and returned zero as expected.)

Since the time elements of data%DTpro are initialised, it's safe to simply prefix the READ statements by IF ones:

  IF (proc_date( 1: 4) /= '    ') READ(proc_date( 1: 4), *) data%DTpro%Year
  IF (proc_date( 6: 7) /=   '  ') READ(proc_date( 6: 7), *) data%DTpro%Month
  IF (proc_date( 9:10) /=   '  ') READ(proc_date( 9:10), *) data%DTpro%Day
  IF (proc_date(12:13) /=   '  ') READ(proc_date(12:13), *) data%DTpro%Hour
  IF (proc_date(15:16) /=   '  ') READ(proc_date(15:16), *) data%DTpro%Minute
  IF (proc_date(18:19) /=   '  ') READ(proc_date(18:19), *) data%DTpro%Second
  IF (proc_date(21:23) /=  '   ') READ(proc_date(21:23), *) data%DTpro%Msec

This seems to work OK.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #267

    • Property Component ROPP (all)I/O
  • Ticket #267 – Description

    initial v2  
    1 ROPP6.0 beta testing with the (unsupported) Lahey95 compiler revealed small problem while converting string to integer with READ statement. Problem sorted (by user): replace
     1ROPP6.0 beta testing with the (unsupported) Lahey95 compiler revealed a small problem while converting string to integer with READ statement. Problem sorted (by user): replace
    22{{{
    33READ(proc_date, "(i4.4,1x,i2.2,1x,i2.2,1x,i2.2,1x,i2.2,1x,i2.2,1x,i3.3)") &