c****************************************************************** SUBROUTINE csv_write_integer( lun, value, advance ) ! csv_write_integer/real/dble -- ! write a single integer/real/double precision real to the CSV-file ! Arguments: ! lun LU-number of the CSV-file ! value Value to write ! advance Advance (.true.) or not, so that more items can be ! written to the same record ! Result: ! The value is written to the current record of the CSV-file ! ! write a single integer to the CSV-file c Auteurs: T.Guillot, P.Morel (adaptation à CESAM2k) Laboratoire Lagrange, OCA c----------------------------------------------------------------- IMPLICIT NONE INTEGER, INTENT(in) :: lun, value LOGICAL, INTENT(in) :: advance CHARACTER(len=40) :: buffer c------------------------------------------------------------ WRITE( buffer, '(I10)' ) value buffer = ADJUSTL(buffer) IF ( advance ) THEN WRITE(lun,'(a)') TRIM(buffer) ELSE ! Most probably: write the comma only when needed, depends on other actions WRITE(lun,'(a,a)',advance='no') TRIM(buffer), ',' ENDIF RETURN END SUBROUTINE csv_write_integer