22 SUBROUTINE parse_line(LINE, LMAX, RXN_FLAG, READ_FLAG)
42 CHARACTER(len=*),
INTENT(IN) :: LINE
45 INTEGER,
INTENT(IN) :: LMAX
49 LOGICAL,
INTENT(OUT) :: RXN_FLAG
53 LOGICAL,
INTENT(OUT) :: READ_FLAG
77 lend = lstart - 1 + index(line(lstart:lmax),
end_str)
78 IF (lend <= lstart)
THEN 79 WRITE (*, 1000)
mype,line(lstart:lmax)
84 IF (
end_rxn(line(lstart:lend),lend-lstart))
THEN 88 IF(.NOT.rxn_flag)
THEN 109 ELSEIF(
start_rxn(line(lstart:lend),lend-lstart))
THEN 138 1000
FORMAT(//1x,70(
'*')/
' (PE ',i6,
'): From: PARSE_LINE',/&
139 ' Message: An evaluation statement "@(" was found in ',&
140 'the input line,',/
' but no ending parenthesis was located:',/&
141 ' INPUT: ',a,/1x,70(
'*')//)
143 1010
FORMAT(/1x,70(
'*')/
': From: PARSE_LINE',/&
144 ' Error: END keyword before a start keyword in line: ', &
174 CHARACTER(len=*),
INTENT(IN) :: LINE
179 IF (index(line(1:lmax),
rxn_blk) == 0)
THEN 212 CHARACTER(len=*),
INTENT(IN) :: LINE
251 LOGICAL FUNCTION end_rxn (LINE, LMAX)
254 CHARACTER(len=*),
INTENT(IN) :: LINE
259 IF (index(line(1:lmax),
end_blk) == 0)
THEN 293 IF(
Allocated( rxn_name ))
GoTo 100
294 Allocate( rxn_name( dimension_rxn ))
297 IF(
Allocated( rxn_chem_eq ))
GoTo 100
298 Allocate( rxn_chem_eq( dimension_rxn ))
301 IF(
Allocated( usrdh ))
GoTo 100
302 Allocate( usrdh( dimension_rxn ))
305 IF(
Allocated( usrfdh ))
GoTo 100
306 Allocate( usrfdh( dimension_rxn, 0:dim_m ))
307 usrfdh(:,:) = undefined
310 in_construct = .false.
316 more_chemeq = .false.
324 1001
FORMAT(/1x,70(
'*')/
' From: PARSE_LINE --> INIT_PARSE_RXN',/ &
325 ' Error 1001: More than one reaction block has been located!',&
326 ' A data file',/
' can only contain one reaction block', &
327 ' [@(RXNS)...@(END)].'/)
329 1000
FORMAT(
' Please refer to the Readme file for chemical equation', &
330 ' input formats',/
' and correct the data file.',/1x,70(
'*')/)
357 IF(
Allocated( des_rxn_name ))
GoTo 100
358 Allocate( des_rxn_name( dimension_rxn ))
361 IF(
Allocated( des_rxn_chem_eq ))
GoTo 100
362 Allocate( des_rxn_chem_eq( dimension_rxn ))
363 des_rxn_chem_eq(:) =
'' 365 IF(
Allocated( des_usrdh ))
GoTo 100
366 Allocate( des_usrdh( dimension_rxn ))
367 des_usrdh(:) = undefined
369 IF(
Allocated( des_usrfdh ))
GoTo 100
370 Allocate( des_usrfdh( dimension_rxn, 0:dim_m ))
371 des_usrfdh(:,:) = undefined
374 in_des_construct = .false.
380 more_chemeq = .false.
388 1001
FORMAT(/1x,70(
'*')/
' From: PARSE_LINE --> INIT_PARSE_DES_RXN',/ &
389 ' Error 1001: More than one DES reaction block has been', &
390 ' located! A data',/
' file can only contain one reaction', &
391 ' block [@(DES_RXNS)...@(END)].'/)
393 1000
FORMAT(
' Please refer to the Readme file for chemical equation', &
394 ' input formats',/
' and correct the data file.',/1x,70(
'*')/)
415 reading_rxn = .false.
416 reading_rate = .false.
484 DOUBLE PRECISION VALUE, SUB_VALUE
499 CHARACTER(LEN=1) :: OPERATION
502 CHARACTER(LEN=80) :: SUB_STR
516 IF (lstart == 0)
RETURN 518 lend = lstart - 1 + index(line(lstart:lmax),
end_str)
519 IF (lend <= lstart)
THEN 520 WRITE (*, 1000)
mype,line(lstart:lmax)
529 DO l = lstart + 2, lend
530 IF (line(l:l)==
'*' .OR. line(l:l)==
'/' .OR. line(l:l)==
end_str)
THEN 532 WRITE (*, 1015)
mype,line(lstart:lend)
535 IF (sub_str(1:lsub-1) ==
'PI')
THEN 538 READ (sub_str(1:lsub-1), *, err=900) sub_value
540 IF (operation ==
'*')
THEN 541 VALUE =
VALUE*sub_value
542 ELSE IF (operation ==
'/')
THEN 543 VALUE =
VALUE/sub_value
546 operation = line(l:l)
547 ELSE IF (line(l:l) ==
' ')
THEN 549 sub_str(lsub:lsub) = line(l:l)
553 length = lend - lstart + 1
554 IF (length > 22)
THEN 555 DO l = lstart + 22, lend
558 ELSE IF (length < 22)
THEN 561 IF (lmax + ldif > len(line))
THEN 562 WRITE (*, 1020)
mype,line(1:80)
565 DO l = lmax, lend + 1, -1
566 line(l+ldif:l+ldif) = line(l:l)
572 WRITE (sub_str,
'(G22.15)')
VALUE 575 line(l:l) = sub_str(lsub:lsub)
581 WRITE (*, 1010)
mype, sub_str(1:lsub-1)
583 1000
FORMAT(/1x,70(
'*')//
'(PE ',i6,
'): From: PARSE_ARITH',/&
584 ' Message: No ending ) found in the input line: ',/9x,a,/1x,70(
'*' 585 FORMAT(/1x,70(
'*')//
'(PE ',i6,
'): From: PARSE_ARITH',/&
586 ' Message: Error reading the input string: ',/9x,a,/1x,70(
'*')/
587 FORMAT(/1x,70(
'*')//
'(PE ',i6,
'): From: PARSE_ARITH',/&
588 ' Message: Invalid operator in the input string: ',/9x,a,/1x,70
'*' 589 FORMAT(/1x,70(
'*')//
'(PE ',i6,
'): From: PARSE_ARITH',/&
590 ' Message: Too many arithmetic operations in the line: ',/1x,a,
character(len=32), dimension(:), allocatable rxn_name
double precision, parameter one
logical function start_rxn(LINE, LMAX)
character(len=3), parameter end_blk
double precision, dimension(:,:), allocatable des_usrfdh
character(len=8), parameter des_rxn_blk
subroutine init_parse_rxn()
subroutine parse_arith(LINE, LMAX)
character(len=4), parameter rxn_blk
subroutine parse_line(LINE, LMAX, RXN_FLAG, READ_FLAG)
character(len=32), dimension(:), allocatable des_rxn_name
logical function end_rxn(LINE, LMAX)
integer function seek_end(LINE, MAXCOL)
double precision, dimension(:), allocatable usrdh
subroutine init_parse_des_rxn()
double precision, dimension(:), allocatable des_usrdh
subroutine end_parse_rxn()
character(len=512), dimension(:), allocatable des_rxn_chem_eq
character(len=1), parameter end_str
double precision, dimension(:,:), allocatable usrfdh
character(len=512), dimension(:), allocatable rxn_chem_eq
logical function start_des_rxn(LINE, LMAX)
subroutine parse_rxn(LINE, lNoOfRxns, lName, lChemEq, lDH, lFDH)
character(len=2), parameter start_str