Skip to content
Snippets Groups Projects
Commit bcb26046 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 23/03/2023: AIRCRAFT_CSV_READ: improve problem detection

parent ad4dc5de
Branches
Tags
No related merge requests found
...@@ -223,10 +223,13 @@ CHARACTER(LEN=*), INTENT(IN) :: HFILE !Name of the CSV file with the aircr ...@@ -223,10 +223,13 @@ CHARACTER(LEN=*), INTENT(IN) :: HFILE !Name of the CSV file with the aircr
CHARACTER(LEN=NMAXLINELGT) :: YSTRING CHARACTER(LEN=NMAXLINELGT) :: YSTRING
INTEGER :: ILU ! logical unit of the file INTEGER :: ILU ! logical unit of the file
INTEGER :: ILINESREAD ! Number of lines read and treated (the 1st one is skipped)
INTEGER :: JI INTEGER :: JI
REAL :: ZLAT, ZLON, ZALT REAL :: ZLAT, ZLON, ZALT
REAL :: ZTIME REAL :: ZTIME
ILINESREAD = 0
! Open file ! Open file
OPEN( NEWUNIT = ILU, FILE = HFILE, FORM = 'formatted' ) OPEN( NEWUNIT = ILU, FILE = HFILE, FORM = 'formatted' )
...@@ -235,6 +238,7 @@ READ( ILU, END = 101, FMT = '(A)' ) YSTRING ! Reading of header (skip it) ...@@ -235,6 +238,7 @@ READ( ILU, END = 101, FMT = '(A)' ) YSTRING ! Reading of header (skip it)
DO JI = 1, TPAIRCRAFT%NPOS DO JI = 1, TPAIRCRAFT%NPOS
! Read aircraft position ! Read aircraft position
READ( ILU, END = 101, FMT = '(A)' ) YSTRING READ( ILU, END = 101, FMT = '(A)' ) YSTRING
ILINESREAD = ILINESREAD + 1
READ( YSTRING, * ) ZTIME, ZLAT, ZLON, ZALT READ( YSTRING, * ) ZTIME, ZLAT, ZLON, ZALT
...@@ -252,7 +256,7 @@ END DO ...@@ -252,7 +256,7 @@ END DO
CLOSE( ILU ) CLOSE( ILU )
IF ( JI < TPAIRCRAFT%NPOS ) & IF ( ILINESREAD < TPAIRCRAFT%NPOS ) &
CALL PRINT_MSG( NVERB_ERROR, 'GEN', 'AIRCRAFT_CSV_READ', 'Data not found in file ' // TRIM( HFILE ), OLOCAL = .TRUE. ) CALL PRINT_MSG( NVERB_ERROR, 'GEN', 'AIRCRAFT_CSV_READ', 'Data not found in file ' // TRIM( HFILE ), OLOCAL = .TRUE. )
TPAIRCRAFT%TLAND = TPAIRCRAFT%TLAUNCH + TPAIRCRAFT%XPOSTIME(TPAIRCRAFT%NPOS) TPAIRCRAFT%TLAND = TPAIRCRAFT%TLAUNCH + TPAIRCRAFT%XPOSTIME(TPAIRCRAFT%NPOS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment