libsim Versione 7.2.0

◆ csv_record_getfield_char()

subroutine, private csv_record_getfield_char ( type(csv_record), intent(inout)  this,
character(len=*), intent(out), optional  field,
integer, intent(out), optional  flen,
integer, intent(out), optional  ier 
)
private

Returns next field from the record this as a CHARACTER variable.

The field pointer is advanced to the next field. If all the fields have already been interpreted it returns an empty string anyway; in order to verify the end-of-record condition the ier parameter must be used.

Parametri
[in,out]thisobject to be decoded
[out]fieldcontents of the field, if not provided, the field pointer is increased only; if the variable is not long enough, a warning is printed and the part that fits is returned; the variable is space-terminated anyway, so the flen parameter has to be used in order to evaluate possible significant trailing spaces
[out]flenactual length of the field including trailing blanks, it is correctly computed also when field is not provided or too short
[out]iererror code, 0 = OK, 1 = field too short, 2 = end of record

Definizione alla linea 778 del file file_utilities.F90.

779SUBROUTINE csv_record_getfield_double(this, field, ier)
780TYPE(csv_record),INTENT(INOUT) :: this
781DOUBLE PRECISION,INTENT(OUT) :: field
782INTEGER,INTENT(OUT),OPTIONAL :: ier
783
784CHARACTER(len=32) :: cfield
785INTEGER :: lier
786
787CALL csv_record_getfield(this, field=cfield, ier=ier)
788IF (c_e(cfield) .AND. len_trim(cfield) /= 0) THEN
789 READ(cfield, '(F32.0)', iostat=lier) field
790 IF (lier /= 0) THEN
791 field = dmiss
792 IF (.NOT.PRESENT(ier)) THEN
793 CALL l4f_log(l4f_error, &
794 'in csv_record_getfield, invalid double precision field: '//trim(cfield))
795 CALL raise_error()
796 ELSE
797 ier = 3 ! conversion error
798 ENDIF
799 ENDIF
800ELSE
801 field = dmiss
802ENDIF
803
804END SUBROUTINE csv_record_getfield_double
805
806
809FUNCTION csv_record_end(this)
810TYPE(csv_record), INTENT(IN) :: this
811LOGICAL :: csv_record_end
812
813csv_record_end = this%cursor > SIZE(this%record)
814
815END FUNCTION csv_record_end
816
817
818FUNCTION is_space_c(char) RESULT(is_space)
819CHARACTER(len=1) :: char
820LOGICAL :: is_space
821
822is_space = (ichar(char) == 32 .OR. ichar(char) == 9) ! improve
823
824END FUNCTION is_space_c
825
826
827FUNCTION is_space_b(char) RESULT(is_space)
828INTEGER(kind=int_b) :: char
829LOGICAL :: is_space
830
831is_space = (char == 32 .OR. char == 9) ! improve
832
833END FUNCTION is_space_b
834
835
836END MODULE file_utilities
Utilities for managing files.

Generated with Doxygen.