integer function test1()
!  ELEMENTAL FUNCTION len_s(string) ! generic LEN
!     type(VARYING_STRING),INTENT(IN) :: string 
!     INTEGER                         :: len_s 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string
string = "1234567890" 
if(LEN(string).eq.10) then
   test1 = 0
else
   test1 = 1
endif
end function test1
 
integer function test2()
! ELEMENTAL FUNCTION c_to_s(chr) ! generic VAR_STR
!     type(VARYING_STRING)        :: c_to_s 
!     CHARACTER(LEN=*),INTENT(IN) :: chr 
!     INTEGER                     :: lc 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING)        :: s
     s =  "1234567890"
if(VAR_STR("1234567890") .eq. s) then
   test2 = 0
else
   test2 = 1
endif
end function test2
 
integer function test3()
!ELEMENTAL SUBROUTINE s_ass_s(var,expr) VARYING
!     type(VARYING_STRING),INTENT(INOUT) :: var 
!     type(VARYING_STRING),INTENT(IN)  :: expr 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: var 
type(VARYING_STRING) :: expr
var = "abcdef" 
expr = "12345" // var
if(expr .eq. VAR_STR("12345abcdef")) then
   test3 = 0
else
   test3 = 1
endif
end function test3
 
integer function test4()
!ELEMENTAL SUBROUTINE c_ass_s(var,expr) 
!     CHARACTER(LEN=*),INTENT(OUT)    :: var 
!     type(VARYING_STRING),INTENT(IN) :: expr 
!     INTEGER                         :: lc,ls 
!>>>
USE ISO_VARYING_STRING
      CHARACTER(25)                   :: var 
      type(VARYING_STRING)            :: expr
      expr = "abcdef12345"
      var = expr 
if(var .eq. "abcdef12345") then
   test4 = 0
else
   test4 = 1
endif
end function test4
 
integer function test5()
!ELEMENTAL SUBROUTINE s_ass_c(var,expr)
!     type(VARYING_STRING),INTENT(OUT) :: var 
!     CHARACTER(LEN=*),INTENT(IN)      :: expr 
!     INTEGER                          :: lc 
!>>>
USE ISO_VARYING_STRING
      type(VARYING_STRING) :: var 
      CHARACTER(25)        :: expr
      expr = "abcdef"
	  var = expr 
if(var .eq. "abcdef") then
   test5 = 0
else
   test5 = 1
endif
end function test5
 
integer function test6()
! ELEMENTAL FUNCTION s_concat_s(string_a,string_b)  ! string//string 
!     type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!     type(VARYING_STRING)            :: s_concat_s 
!     INTEGER                         :: la,lb 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING):: string_a,string_b,string_c
	 string_a = "12345"
	 string_b = "abcdef"
	 string_c = string_a // string_b 
if(string_c == VAR_STR("12345abcdef")) then
   test6 = 0
else
   test6 = 1
endif
end function test6
 
integer function test7()
! ELEMENTAL FUNCTION s_concat_c(string_a,string_b)  ! string//character
!     type(VARYING_STRING),INTENT(IN) :: string_a 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!     type(VARYING_STRING)            :: s_concat_c 
!     INTEGER                         :: la,lb 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING):: string_a,string_c
	 character(6) string_b
	 string_a = "12345"
	 string_b = "abcdef"
	 string_c = string_a // string_b 
if(string_c == VAR_STR("12345abcdef")) then
   test7 = 0
else
   test7 = 1
endif
end function test7
 
integer function test8()
! ELEMENTAL FUNCTION c_concat_s(string_a,string_b)  ! character//string 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!     type(VARYING_STRING),INTENT(IN) :: string_b 
!     type(VARYING_STRING)            :: c_concat_s 
!     INTEGER                         :: la,lb 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string_b,string_c
	 character(5) string_a
	 string_a = "12345"
	 string_b = "abcdef"
	 string_c = string_a // string_b 
if(string_c == VAR_STR("12345abcdef")) then
   test8 = 0
else
   test8 = 1
endif
end function test8
 
integer function test9()
!ELEMENTAL FUNCTION repeat_s(string,ncopies)                                     
!    type(VARYING_STRING),INTENT(IN) :: string 
!    INTEGER,INTENT(IN)              :: ncopies 
!    type(VARYING_STRING)            :: repeat_s
!    INTEGER                         :: lr,ls 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a, string_b
    INTEGER              :: ncopies = 5
	string_b = "123"
	string_a = repeat(string_b, ncopies)
if(string_a == VAR_STR("123123123123123")) then
   test9 = 0
else
   test9 = 1
endif
end function test9
 
integer function test10()
! ELEMENTAL FUNCTION s_eq_s(string_a,string_b)  ! string==string 
!     type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!     LOGICAL                         :: s_eq_s 
!     INTEGER                         :: la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a , string_b  
 string_a = "123"
 string_b = "123"
if(string_a == string_b) then
   test10 = 0
else
   test10 = 1
endif
end function test10
 
integer function test11()
! ELEMENTAL FUNCTION s_eq_c(string_a,string_b)  ! string==character 
!     type(VARYING_STRING),INTENT(IN) :: string_a 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!     LOGICAL                         :: s_eq_c 
!     INTEGER                         :: la,lb,ls
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a
	character(3) ::  string_b = "123" 
  string_a= "123"
if(string_a == string_b) then
   test11 = 0
else
   test11 = 1
endif
end function test11
 
integer function test12()
! ELEMENTAL FUNCTION c_eq_s(string_a,string_b)  ! character==string 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!     type(VARYING_STRING),INTENT(IN) :: string_b 
!     LOGICAL                         :: c_eq_s 
!     INTEGER                         :: la,lb,ls
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_b
	character(3) ::  string_a = "123" 
string_b = "123"
if(string_a == string_b) then
   test12 = 0
else
   test12 = 1
endif
end function test12
 
integer function test13()
! ELEMENTAL FUNCTION s_ne_s(string_a,string_b)  ! string/=string 
!     type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!     LOGICAL                         :: s_ne_s 
!     INTEGER                         :: la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a , string_b  
 string_a = "124"
 string_b = "123"
if(string_a /= string_b) then
   test13 = 0
else
   test13 = 1
endif
end function test13
 
integer function test14()
! ELEMENTAL FUNCTION s_ne_c(string_a,string_b)  ! string/=character
!     type(VARYING_STRING),INTENT(IN) :: string_a 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!     LOGICAL                         :: s_ne_c 
!     INTEGER                         :: la,lb,ls
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a
	character(3) ::  string_b = "123" 
string_a = "124"
if(string_a /= string_b) then
   test14 = 0
else
   test14 = 1
endif
end function test14
 
integer function test15()
! ELEMENTAL FUNCTION c_ne_s(string_a,string_b)  ! character/=string 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!     type(VARYING_STRING),INTENT(IN) :: string_b 
!     LOGICAL                         :: c_ne_s 
!     INTEGER                         :: la,lb,ls
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_b
	character(3) ::  string_a = "12A" 
string_b = "123"
if(string_a /= string_b) then
   test15 = 0
else
   test15 = 1
endif
end function test15
 
integer function test16()
! ELEMENTAL FUNCTION s_lt_s(string_a,string_b)  ! string<string
!     type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!     LOGICAL                         :: s_lt_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a , string_b  
 string_a = "123"
 string_b = "234"
if(string_a < string_b) then
   test16 = 0
else
   test16 = 1
endif
end function test16
 
integer function test17()
! ELEMENTAL FUNCTION s_lt_c(string_a,string_b)  ! string<character 
!     type(VARYING_STRING),INTENT(IN) :: string_a 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!     LOGICAL                         :: s_lt_c 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a 
 character(3) :: string_b = "234"
 string_a = "123"
if(string_a < string_b) then
   test17 = 0
else
   test17 = 1
endif
end function test17
 
integer function test18()
! ELEMENTAL FUNCTION c_lt_s(string_a,string_b)  ! character<string
!     CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!     type(VARYING_STRING),INTENT(IN) :: string_b 
!     LOGICAL                         :: c_lt_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_b 
 character(3) :: string_a = "123"
 string_b = "124"
if(string_a < string_b) then
   test18 = 0
else
   test18 = 1
endif
end function test18
 
integer function test19()
! ELEMENTAL FUNCTION s_le_s(string_a,string_b)  ! string<=string 
!     type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!     LOGICAL                         :: s_le_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a , string_b  
 string_a = "123"
 string_b = "123"
if(string_a <= string_b) then
   test19 = 0
else
   test19 = 1
endif
end function test19
 
integer function test20()
! ELEMENTAL FUNCTION s_le_c(string_a,string_b)  ! string<=character
!     type(VARYING_STRING),INTENT(IN) :: string_a 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!     LOGICAL                         :: s_le_c 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a 
 character(3) :: string_b = "123"
 string_a = "123"
if(string_a <= string_b) then
   test20 = 0
else
   test20 = 1
endif
end function test20
 
integer function test21()
! ELEMENTAL FUNCTION c_le_s(string_a,string_b)  ! character<=string 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!     type(VARYING_STRING),INTENT(IN) :: string_b 
!     LOGICAL                         :: c_le_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_b 
 character(3) :: string_a = "123"
 string_b = "123"
if(string_a <= string_b) then
   test21 = 0
else
   test21 = 1
endif
end function test21
 
integer function test22()
! ELEMENTAL FUNCTION s_ge_s(string_a,string_b)  ! string>=string
!     type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!     LOGICAL                         :: s_ge_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a , string_b  
 string_a = "123"
 string_b = "123"
if(string_a >= string_b) then
   test22 = 0
else
   test22 = 1
endif
end function test22
 
integer function test23()
! ELEMENTAL FUNCTION s_ge_c(string_a,string_b)  ! string>=character 
!     type(VARYING_STRING),INTENT(IN) :: string_a 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!     LOGICAL                         :: s_ge_c 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a 
 character(3) :: string_b = "123"
 string_a = "123"
if(string_a >= string_b) then
   test23 = 0
else
   test23 = 1
endif
end function test23
 
integer function test24()
! ELEMENTAL FUNCTION c_ge_s(string_a,string_b)  ! character>=string
!     CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!     type(VARYING_STRING),INTENT(IN) :: string_b 
!     LOGICAL                         :: c_ge_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_b 
 character(3) :: string_a = "123"
 string_b = "123"
if(string_a >= string_b) then
   test24 = 0
else
   test24 = 1
endif
end function test24
 
integer function test25()
! ELEMENTAL FUNCTION s_gt_s(string_a,string_b)  ! string>string 
!     type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!     LOGICAL                         :: s_gt_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a, string_b
 string_a = "124"
 string_b = "123"
if(string_a > string_b) then
   test25 = 0
else
   test25 = 1
endif
end function test25
 
integer function test26()
! ELEMENTAL FUNCTION s_gt_c(string_a,string_b)  ! string>character
!     type(VARYING_STRING),INTENT(IN) :: string_a 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!     LOGICAL                         :: s_gt_c 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_a 
 character(3) :: string_b = "123"
 string_a = "124"
if(string_a > string_b) then
   test26 = 0
else
   test26 = 1
endif
end function test26
 
integer function test27()
! ELEMENTAL FUNCTION c_gt_s(string_a,string_b)  ! character>string 
!     CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!     type(VARYING_STRING),INTENT(IN) :: string_b 
!     LOGICAL                         :: c_gt_s 
!     INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
    type(VARYING_STRING) :: string_b 
 character(3) :: string_a = "124"
 string_b = "123"
if(string_a > string_b) then
   test27 = 0
else
   test27 = 1
endif
end function test27
 
integer function test28()
!ELEMENTAL FUNCTION s_llt_s(string_a,string_b)  ! string_a<string_b ISO-646 ordering 
!    type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!    LOGICAL                         :: s_llt_s 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a, string_b
 string_a = "121"
 string_b = "123"
if(LLT(string_a, string_b)) then
   test28 = 0
else
   test28 = 1
endif
end function test28
 
integer function test29()
!ELEMENTAL FUNCTION s_llt_c(string_a,string_b)   ! string_a<string_b ISO-646 ordering 
!    type(VARYING_STRING),INTENT(IN) :: string_a 
!    CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!    LOGICAL                         :: s_llt_c 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a
character(3) :: string_b = "123"
 string_a = "121"
if(LLT(string_a, string_b)) then
   test29 = 0
else
   test29 = 1
endif
end function test29
 
integer function test30()
!ELEMENTAL FUNCTION c_llt_s(string_a,string_b)  ! string_a,string_b ISO-646 ordering
!    CHARACTER(LEN=*),INTENT(IN)     :: string_a
!    type(VARYING_STRING),INTENT(IN) :: string_b
!    LOGICAL                         :: c_llt_s
!    INTEGER                         :: ls,la,lb
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_b
character(3) :: string_a = "123"
 string_b = "124"
if(LLT(string_a, string_b)) then
   test30 = 0
else
   test30 = 1
endif
end function test30
 
integer function test31()
!ELEMENTAL FUNCTION s_lle_s(string_a,string_b)  ! string_a<=string_b ISO-646 ordering 
!    type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!    LOGICAL                         :: s_lle_s 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a, string_b
 string_a = "121"
 string_b = "123"
if(LLE(string_a, string_b)) then
   test31 = 0
else
   test31 = 1
endif
end function test31
 
integer function test32()
!ELEMENTAL FUNCTION s_lle_c(string_a,string_b)  ! strung_a<=string_b ISO-646 ordering
!    type(VARYING_STRING),INTENT(IN) :: string_a 
!    CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!    LOGICAL                         :: s_lle_c 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a
character(3) :: string_b = "123"
 string_a = "121"
if(LLE(string_a, string_b)) then
   test32 = 0
else
   test32 = 1
endif
end function test32
 
integer function test33()
!ELEMENTAL FUNCTION c_lle_s(string_a,string_b)  ! string_a<=string_b ISO-646 ordering 
!    CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!    type(VARYING_STRING),INTENT(IN) :: string_b 
!    LOGICAL                         :: c_lle_s 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_b
character(3) :: string_a = "121"
 string_b = "123"
if(LLT(string_a, string_b)) then
   test33 = 0
else
   test33 = 1
endif
end function test33
 
integer function test34()
!ELEMENTAL FUNCTION s_lge_s(string_a,string_b)  ! string_a>=string_b ISO-646 ordering 
!    type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!    LOGICAL                         :: s_lge_s 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a, string_b
 string_a = "123"
 string_b = "123"
if(LGE(string_a, string_b)) then
   test34 = 0
else
   test34 = 1
endif
end function test34
 
integer function test35()
!ELEMENTAL FUNCTION s_lge_c(string_a,string_b)  ! string_a>=string_b ISO-646 ordering
!    type(VARYING_STRING),INTENT(IN) :: string_a 
!    CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!    LOGICAL                         :: s_lge_c 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a
 character(3) :: string_b = "123"
 string_a = "123"
if(LGE(string_a, string_b)) then
   test35 = 0
else
   test35 = 1
endif
end function test35
 
integer function test36()
!ELEMENTAL FUNCTION c_lge_s(string_a,string_b)  ! string_a>=string_b ISO-646 ordering 
!    CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!    type(VARYING_STRING),INTENT(IN) :: string_b 
!    LOGICAL                         :: c_lge_s 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_b
 character(3) :: string_a = "123"
 string_b = "123"
if(LGE(string_a, string_b)) then
   test36 = 0
else
   test36 = 1
endif
end function test36
 
integer function test37()
!ELEMENTAL FUNCTION s_lgt_s(string_a,string_b)  ! string_a>string_b ISO-646 ordering 
!    type(VARYING_STRING),INTENT(IN) :: string_a,string_b 
!    LOGICAL                         :: s_lgt_s 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a, string_b
 string_a = "124"
 string_b = "123"
if(LGT(string_a, string_b)) then
   test37 = 0
else
   test37 = 1
endif
end function test37
 
integer function test38()
!ELEMENTAL FUNCTION s_lgt_c(string_a,string_b)  ! string_a>string_b ISO-646 ordering 
!    type(VARYING_STRING),INTENT(IN) :: string_a 
!    CHARACTER(LEN=*),INTENT(IN)     :: string_b 
!    LOGICAL                         :: s_lgt_c 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_a
 character(3) :: string_b = "123"
 string_a = "124"
if(LGT(string_a, string_b)) then
   test38 = 0
else
   test38 = 1
endif
end function test38
 
integer function test39()
!ELEMENTAL FUNCTION c_lgt_s(string_a,string_b)  ! string_a>string_b ISO-646 ordering
!    CHARACTER(LEN=*),INTENT(IN)     :: string_a 
!    type(VARYING_STRING),INTENT(IN) :: string_b 
!    LOGICAL                         :: c_lgt_s 
!    INTEGER                         :: ls,la,lb 
!>>>
USE ISO_VARYING_STRING
type(VARYING_STRING) :: string_b
 character(3) :: string_a = "124"
 string_b = "123"
if(LGT(string_a, string_b)) then
   test39 = 0
else
   test39 = 1
endif
end function test39
 
integer function test40()
! ELEMENTAL FUNCTION insert_ss(string,start,substring)
!     type(VARYING_STRING)            :: insert_ss
!     type(VARYING_STRING),INTENT(IN) :: string
!     INTEGER,INTENT(IN)              :: start
!     type(VARYING_STRING),INTENT(IN) :: substring
!     CHARACTER,POINTER,DIMENSION(:) :: work 
!     INTEGER                        :: ip,is,lsub,ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, substring, res
string = "12345678"
substring = "abcd"
res = INSERT(string, 4, substring)
if(res == VAR_STR("123abcd45678")) then
   test40 = 0
else
   test40 = 1
endif
end function test40
 
integer function test41()
! ELEMENTAL FUNCTION insert_sc(string,start,substring)
!     type(VARYING_STRING)            :: insert_sc
!     type(VARYING_STRING),INTENT(IN) :: string
!     INTEGER,INTENT(IN)              :: start
!     CHARACTER(LEN=*),INTENT(IN) :: substring
!     CHARACTER,POINTER,DIMENSION(:) :: work 
!     INTEGER                        :: ip,is,lsub,ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
     character(4) :: substring = "abcd"
string = "12345678"
res = INSERT(string, 4, substring)
if(res == VAR_STR("123abcd45678")) then
   test41 = 0
else
   test41 = 1
endif
end function test41
 
integer function test42()
! ELEMENTAL FUNCTION insert_cs(string,start,substring)
!     type(VARYING_STRING)            :: insert_cs
!     CHARACTER(LEN=*),INTENT(IN)     :: string
!     INTEGER,INTENT(IN)              :: start
!     type(VARYING_STRING),INTENT(IN) :: substring
!     CHARACTER,POINTER,DIMENSION(:) :: work 
!     INTEGER                        :: ip,is,lsub,ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: substring, res
     character(8) :: string = "12345678"
substring = "abcd"
res = INSERT(string, 4, substring)
if(res == VAR_STR("123abcd45678")) then
   test42 = 0
else
   test42 = 1
endif
end function test42
 
integer function test43()
! ELEMENTAL FUNCTION insert_cc(string,start,substring)
!     type(VARYING_STRING)        :: insert_cc
!     CHARACTER(LEN=*),INTENT(IN) :: string
!     INTEGER,INTENT(IN)          :: start
!     CHARACTER(LEN=*),INTENT(IN) :: substring
!     CHARACTER,POINTER,DIMENSION(:) :: work 
!     INTEGER                        :: ip,is,lsub,ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: res
	 character(4) :: substring = "abcd"
     character(8) :: string = "12345678"
res = INSERT(string, 4, substring)
if(res == VAR_STR("123abcd45678")) then
   test43 = 0
else
   test43 = 1
endif
end function test43
 
integer function test44()
! ELEMENTAL FUNCTION replace_ss(string,start,substring)
!    type(VARYING_STRING)            :: replace_ss
!    type(VARYING_STRING),INTENT(IN) :: string
!    INTEGER,INTENT(IN)              :: start
!    type(VARYING_STRING),INTENT(IN) :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, substring, res
string = "12345678"
substring = "abcd"
res = REPLACE(string, 4, substring)
if(res == VAR_STR("123abcd8")) then
   test44 = 0
else
   test44 = 1
endif
end function test44
 
integer function test45()
! ELEMENTAL FUNCTION replace_ss_sf(string,start,finish,substring)
!    type(VARYING_STRING)            :: replace_ss_sf
!    type(VARYING_STRING),INTENT(IN) :: string
!    INTEGER,INTENT(IN)              :: start,finish
!    type(VARYING_STRING),INTENT(IN) :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,if,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, substring, res
string = "12345678"
substring = "abcd"
res = REPLACE(string, 4, 5, substring)
if(res == VAR_STR("123abcd678")) then
   test45 = 0
else
   test45 = 1
endif
end function test45
 
integer function test46()
!ELEMENTAL FUNCTION replace_sc(string,start,substring)
!    type(VARYING_STRING)            :: replace_sc
!    type(VARYING_STRING),INTENT(IN) :: string
!    INTEGER,INTENT(IN)              :: start
!    CHARACTER(LEN=*),INTENT(IN)     :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
character(4) :: substring = "abcd"
string = "12345678"
res = REPLACE(string, 4, substring)
if(res == VAR_STR("123abcd8")) then
   test46 = 0
else
   test46 = 1
endif
end function test46
 
integer function test47()
!ELEMENTAL FUNCTION replace_sc_sf(string,start,finish,substring)
!    type(VARYING_STRING)            :: replace_sc_sf
!    type(VARYING_STRING),INTENT(IN) :: string
!    INTEGER,INTENT(IN)              :: start,finish
!    CHARACTER(LEN=*),INTENT(IN)     :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,if,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
character(4) :: substring = "abcd"
string = "12345678"
res = REPLACE(string, 4, 5, substring)
if(res == VAR_STR("123abcd678")) then
   test47 = 0
else
   test47 = 1
endif
end function test47
 
integer function test48()
!ELEMENTAL FUNCTION replace_cs(string,start,substring)
!    type(VARYING_STRING)            :: replace_cs
!    CHARACTER(LEN=*),INTENT(IN)     :: string
!    INTEGER,INTENT(IN)              :: start
!    type(VARYING_STRING),INTENT(IN) :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: substring, res
character(8) :: string = "12345678"
substring = "abcd"
res = REPLACE(string, 4, substring)
if(res == VAR_STR("123abcd8")) then
   test48 = 0
else
   test48 = 1
endif
end function test48
 
integer function test49()
!ELEMENTAL FUNCTION replace_cs_sf(string,start,finish,substring)
!    type(VARYING_STRING)            :: replace_cs_sf
!    CHARACTER(LEN=*),INTENT(IN)     :: string
!    INTEGER,INTENT(IN)              :: start,finish
!    type(VARYING_STRING),INTENT(IN) :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,if,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: substring, res
character(8) :: string = "12345678"
substring = "abcd"
res = REPLACE(string, 4, 5,  substring)
if(res == VAR_STR("123abcd678")) then
   test49 = 0
else
   test49 = 1
endif
end function test49
 
integer function test50()
!ELEMENTAL FUNCTION replace_cc(string,start,substring)
!    type(VARYING_STRING)            :: replace_cc
!    CHARACTER(LEN=*),INTENT(IN)     :: string
!    INTEGER,INTENT(IN)              :: start
!    CHARACTER(LEN=*),INTENT(IN)     :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) ::  res
character(8) :: string = "12345678"
character(4) ::substring = "abcd"
res = REPLACE(string, 4, substring)
if(res == VAR_STR("123abcd8")) then
   test50 = 0
else
   test50 = 1
endif
end function test50
 
integer function test51()
!ELEMENTAL FUNCTION replace_cc_sf(string,start,finish,substring)
!    type(VARYING_STRING)            :: replace_cc_sf
!    CHARACTER(LEN=*),INTENT(IN)     :: string
!    INTEGER,INTENT(IN)              :: start,finish
!    CHARACTER(LEN=*),INTENT(IN)     :: substring
!    CHARACTER,POINTER,DIMENSION(:) :: work
!    INTEGER                        :: ip,is,if,nw,lsub,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) ::  res
character(8) :: string = "12345678"
character(4) ::substring = "abcd"
res = REPLACE(string, 4, 5, substring)
if(res == VAR_STR("123abcd678")) then
   test51 = 0
else
   test51 = 1
endif
end function test51
 
integer function test52()
!ELEMENTAL FUNCTION replace_sss(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_sss
!    type(VARYING_STRING),INTENT(IN) :: string,target,substring
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, target, substring, res
string = "123A45A678"
target = "A"
substring = "abcd"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test52 = 0
else
   test52 = 1
endif
end function test52
 
integer function test53()
!ELEMENTAL FUNCTION replace_ssc(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_ssc
!    type(VARYING_STRING),INTENT(IN) :: string,target
!    CHARACTER(LEN=*),INTENT(IN)     :: substring
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, target, res
character(4) :: substring = "abcd"
string = "123A45A678"
target = "A"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test53 = 0
else
   test53 = 1
endif
end function test53
 
integer function test54()
!ELEMENTAL FUNCTION replace_scs(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_scs
!    type(VARYING_STRING),INTENT(IN) :: string,substring
!    CHARACTER(LEN=*),INTENT(IN)     :: target
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp,tget
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, substring, res
character(1) :: target = "A"

substring = "abcd"
string = "123A45A678"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test54 = 0
else
   test54 = 1
endif
end function test54
 
integer function test55()
!ELEMENTAL FUNCTION replace_scc(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_scc
!    type(VARYING_STRING),INTENT(IN) :: string
!    CHARACTER(LEN=*),INTENT(IN)     :: target,substring
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp,tget
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
character(1) :: target = "A"
character(4) :: substring = "abcd"
string = "123A45A678"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test55 = 0
else
   test55 = 1
endif
end function test55
 
integer function test56()
!ELEMENTAL FUNCTION replace_css(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_css
!    CHARACTER(LEN=*),INTENT(IN)     :: string
!    type(VARYING_STRING),INTENT(IN) :: target,substring
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp,str
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: target, substring, res
character(10) :: string = "123A45A678"
target = "A"
substring = "abcd"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test56 = 0
else
   test56 = 1
endif
end function test56
 
integer function test57()
!ELEMENTAL FUNCTION replace_csc(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_csc
!    type(VARYING_STRING),INTENT(IN) :: target
!    CHARACTER(LEN=*),INTENT(IN)     :: string,substring
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp,str
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: target, res
character(10) :: string = "123A45A678"
character(4) :: substring = "abcd"
target = "A"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test57 = 0
else
   test57 = 1
endif
end function test57
 
integer function test58()
!ELEMENTAL FUNCTION replace_ccs(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_ccs
!    type(VARYING_STRING),INTENT(IN) :: substring
!    CHARACTER(LEN=*),INTENT(IN)     :: string,target
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: substring, res
character(10) :: string = "123A45A678"
character(1) :: target = "A"
substring = "abcd"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test58 = 0
else
   test58 = 1
endif
end function test58
 
integer function test59()
!ELEMENTAL FUNCTION replace_ccc(string,target,substring,every,back)
!    type(VARYING_STRING)            :: replace_ccc
!    CHARACTER(LEN=*),INTENT(IN)     :: string,target,substring
!    LOGICAL,INTENT(IN),OPTIONAL     :: every,back
!    LOGICAL                        :: dir_switch, rep_search
!    CHARACTER,DIMENSION(:),POINTER :: work,temp
!    INTEGER                        :: ls,lt,lsub,ipos,ipow
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: res
character(10) :: string = "123A45A678"
character(1) :: target = "A"
character(4) :: substring = "abcd"
res = REPLACE(string, target, substring, .TRUE., .FALSE.)
if(res == VAR_STR("123abcd45abcd678")) then
   test59 = 0
else
   test59 = 1
endif
end function test59
 
integer function test60()
!ELEMENTAL FUNCTION remove_s(string,start,finish)
!    type(VARYING_STRING)            :: remove_s
!    type(VARYING_STRING),INTENT(IN) :: string
!    INTEGER,INTENT(IN),OPTIONAL     :: start
!    INTEGER,INTENT(IN),OPTIONAL     :: finish
!    CHARACTER,DIMENSION(:),POINTER :: arg_str
!    INTEGER                        :: is,if,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
string = "12345678"
res = REMOVE(string, 5, 7)
if(res == VAR_STR("12348")) then
   test60 = 0
else
   test60 = 1
endif
end function test60
 
integer function test61()
!ELEMENTAL FUNCTION remove_c(string,start,finish)
!    type(VARYING_STRING)        :: remove_c
!    CHARACTER(LEN=*),INTENT(IN) :: string
!    INTEGER,INTENT(IN),OPTIONAL :: start
!    INTEGER,INTENT(IN),OPTIONAL :: finish
!    CHARACTER,DIMENSION(:),POINTER :: arg_str
!    INTEGER                        :: is,if,ls
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) ::  res
character(8) ::string = "12345678"
res = REMOVE(string, 5, 7)
if(res == VAR_STR("12348")) then
   test61 = 0
else
   test61 = 1
endif
end function test61
 
integer function test62()
!ELEMENTAL FUNCTION extract_s(string,start,finish) 
!     type(VARYING_STRING),INTENT(IN) :: string 
!     INTEGER,INTENT(IN),OPTIONAL     :: start     
!     INTEGER,INTENT(IN),OPTIONAL     :: finish     
!     type(VARYING_STRING)            :: extract_s 
!     INTEGER                         :: is,if 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
string = "12345678"
res = EXTRACT(string, 5, 7)
if(res == VAR_STR("567")) then
   test62 = 0
else
   test62 = 1
endif
end function test62
 
integer function test63()
!ELEMENTAL FUNCTION extract_c(string,start,finish)
!     CHARACTER(LEN=*),INTENT(IN) :: string 
!     INTEGER,INTENT(IN),OPTIONAL :: start   
!     INTEGER,INTENT(IN),OPTIONAL :: finish  
!     type(VARYING_STRING)        :: extract_c 
!     INTEGER                      :: is,if 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: res
character(8) :: string = "12345678"
res = EXTRACT(string, 5, 7)
if(res == VAR_STR("567")) then
   test63 = 0
else
   test63 = 1
endif
end function test63
 
integer function test64()
!ELEMENTAL SUBROUTINE split_s(string,word,set,separator,back)
!     type(VARYING_STRING),INTENT(INOUT)        :: string
!     type(VARYING_STRING),INTENT(OUT)          :: word
!     type(VARYING_STRING),INTENT(IN)           :: set
!     type(VARYING_STRING),INTENT(OUT),OPTIONAL :: separator
!     LOGICAL,INTENT(IN),OPTIONAL               :: back
!     LOGICAL           :: dir_switch 
!     INTEGER           :: ls,tpos
!     CHARACTER,ALLOCATABLE :: wst(:) ! working copy of string
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, word, set, separator
string = "123a45678"
set = "ab"
call SPLIT(string, word, set, separator, .FALSE.)
if((word == VAR_STR("123"))       .and.   &
   (string ==VAR_STR("45678"))   .and.   &
   (separator == VAR_STR("a"))) then
     test64 = 0
else
     test64 = 1
endif
end function test64
 
integer function test65()
!ELEMENTAL SUBROUTINE split_c(string,word,set,separator,back)
!     type(VARYING_STRING),INTENT(INOUT)        :: string
!     type(VARYING_STRING),INTENT(OUT)          :: word
!     CHARACTER(LEN=*),INTENT(IN)               :: set
!     type(VARYING_STRING),INTENT(OUT),OPTIONAL :: separator
!     LOGICAL,INTENT(IN),OPTIONAL               :: back
!     LOGICAL                    :: dir_switch 
!     INTEGER                    :: ls,tpos,lset
!     CHARACTER,ALLOCATABLE :: wst(:) ! working copy of string
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, word, separator
     character(2) :: set = "ab"
string = "123a45678"
call SPLIT(string, word, set, separator, .FALSE.)
if((word == VAR_STR("123"))      .and.   &
   (string ==VAR_STR("45678"))   .and.   &
   (separator == VAR_STR("a"))) then
     test65 = 0
else
     test65 = 1
endif
end function test65
 
integer function test66()
! ELEMENTAL FUNCTION index_ss(string,substring,back) 
!     type(VARYING_STRING),INTENT(IN) :: string,substring 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: index_ss 
!     LOGICAL                         :: dir_switch 
!     INTEGER                         :: ls,lsub 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, substring
     integer res
string =   "abcdefghijk"
substring= "def" 
res  = INDEX(string, substring, .FALSE.)
if(res==4) then
   test66 = 0
else
   test66 = 1
endif
end function test66
 
integer function test67()
! ELEMENTAL FUNCTION index_sc(string,substring,back)
!     type(VARYING_STRING),INTENT(IN) :: string 
!     CHARACTER(LEN=*),INTENT(IN)     :: substring 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: index_sc 
!     LOGICAL                         :: dir_switch,matched 
!     INTEGER                         :: ls,lsub 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string
     integer res    
     character :: substring= "def" 
string =   "abcdefghijk"
res  = INDEX(string, substring, .FALSE.)
if(res==4) then
   test67 = 0
else
   test67 = 1
endif
end function test67
 
integer function test68()
! ELEMENTAL FUNCTION index_cs(string,substring,back)
!     CHARACTER(LEN=*),INTENT(IN)     :: string 
!     type(VARYING_STRING),INTENT(IN) :: substring 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: index_cs 
!     LOGICAL                         :: dir_switch,matched 
!     INTEGER                         :: ls,lsub 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: substring
     integer res
character(10) :: string =   "abcdefghijk"
substring= "def" 
res  = INDEX(string, substring, .FALSE.)
if(res==4) then
   test68 = 0
else
   test68 = 1
endif
end function test68
 
integer function test69()
! ELEMENTAL FUNCTION scan_ss(string,set,back) 
!     type(VARYING_STRING),INTENT(IN) :: string,set 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: scan_ss 
!     LOGICAL                         :: dir_switch 
!     INTEGER                         :: ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, set
     integer res
string =   "abcdefghijk"
set= "def" 
res  = SCAN(string, set, .FALSE.)
if(res==4) then
   test69 = 0
else
   test69 = 1
endif
end function test69
 
integer function test70()
! ELEMENTAL FUNCTION scan_sc(string,set,back)
!     type(VARYING_STRING),INTENT(IN) :: string 
!     CHARACTER(LEN=*),INTENT(IN)     :: set 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: scan_sc 
!     LOGICAL                         :: dir_switch,matched 
!     INTEGER                         :: ls 
!>>>
USE ISO_VARYING_STRING
     integer res    
     type(VARYING_STRING) :: string  
     character(3) :: set = "def" 
string =   "abcdefghijk"
res  = SCAN(string, set, .FALSE.)
if(res==4) then
   test70 = 0
else
   test70 = 1
endif
end function test70
 
integer function test71()
! ELEMENTAL FUNCTION scan_cs(string,set,back)
!     CHARACTER(LEN=*),INTENT(IN)     :: string 
!     type(VARYING_STRING),INTENT(IN) :: set 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: scan_cs 
!     LOGICAL                         :: dir_switch,matched 
!     INTEGER                         :: ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: set 
     integer res
     character(10) :: string =   "abcdefghijk"
set = "def" 
res  = SCAN(string, set, .FALSE.)
if(res==4) then
   test71 = 0
else
   test71 = 1
endif
end function test71
 
integer function test72()
! ELEMENTAL FUNCTION verify_ss(string,set,back) 
!     type(VARYING_STRING),INTENT(IN) :: string,set 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: verify_ss 
!     LOGICAL                     :: dir_switch 
!     INTEGER                     :: ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, set
     integer res
string =   "abcdefghijk"
set= "abc" 
res  = VERIFY(string, set, .FALSE.)
if(res==4) then
   test72 = 0
else
   test72 = 1
endif
end function test72
 
integer function test73()
! ELEMENTAL FUNCTION verify_sc(string,set,back)
!     type(VARYING_STRING),INTENT(IN) :: string 
!     CHARACTER(LEN=*),INTENT(IN)     :: set 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: verify_sc 
!     LOGICAL                     :: dir_switch
!     INTEGER                     :: ls 
!>>>
USE ISO_VARYING_STRING
     integer res    
     type(VARYING_STRING) :: string  
     character(3) :: set = "abc" 
string =   "abcdefghijk"
res  = VERIFY(string, set, .FALSE.)
if(res==4) then
   test73 = 0
else
   test73 = 1
endif
end function test73
 
integer function test74()
! ELEMENTAL FUNCTION verify_cs(string,set,back)
!     CHARACTER(LEN=*),INTENT(IN)     :: string 
!     type(VARYING_STRING),INTENT(IN) :: set 
!     LOGICAL,INTENT(IN),OPTIONAL     :: back 
!     INTEGER                         :: verify_cs 
!     LOGICAL                     :: dir_switch
!     INTEGER                     :: ls 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: set 
     integer res
     character(10) :: string =   "abcdefghijk"
set = "abc" 
res  = VERIFY(string, set, .FALSE.)
if(res==4) then
   test74 = 0
else
   test74 = 1
endif
end function test74
 
integer function test75()
!ELEMENTAL FUNCTION len_trim_s(string) 
!    type(VARYING_STRING),INTENT(IN) :: string 
!    INTEGER                         :: len_trim_s 
!    INTEGER                         :: ls 
!>>>
USE ISO_VARYING_STRING
     integer res
     type(VARYING_STRING) :: string
string = "abc   "
res = LEN_TRIM(string)	  
if(res==3) then
   test75 = 0
else
   test75 = 1
endif
end function test75
 
integer function test76()
!ELEMENTAL FUNCTION trim_s(string) 
!    type(VARYING_STRING),INTENT(IN)  :: string 
!    type(VARYING_STRING)             :: trim_s 
!    INTEGER                      :: ls,pos 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
string = "abc   "
res = TRIM(string)	  
if((LEN(res)==3) .and. (res==VAR_STR("abc"))) then
   test76 = 0
else
   test76 = 1
endif
end function test76
 
integer function test77()
!ELEMENTAL FUNCTION iachar_s(string) 
!    type(VARYING_STRING),INTENT(IN) :: string 
!    INTEGER                         :: iachar_s 
!    iachar_s = IACHAR(CHAR(string)) 
!   ENDFUNCTION iachar_s 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: c
c = "Y"
if(IACHAR(c) == 89) then
   test77 = 0
else
   test77 = 1
endif
end function test77
 
integer function test78()
!ELEMENTAL FUNCTION ichar_s(string) 
!    type(VARYING_STRING),INTENT(IN) :: string 
!    INTEGER                         :: ichar_s 
!    ichar_s = ICHAR(CHAR(string)) 
!   ENDFUNCTION ichar_s 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: c
c = "Y"
if(ICHAR(c) == 89) then
   test78 = 0
else
   test78 = 1
endif
end function test78
 
integer function test79()
!ELEMENTAL FUNCTION adjustl_s(string) 
!    type(VARYING_STRING),INTENT(IN) :: string 
!    type(VARYING_STRING)            :: adjustl_s 
!    INTEGER                         :: ls,pos 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
string = "   abcdef"
res = ADJUSTL(string)
if(res == VAR_STR("abcdef   ")) then
   test79 = 0
else
   test79 = 1
endif
end function test79
 
integer function test80()
!ELEMENTAL FUNCTION adjustr_s(string) 
!    type(VARYING_STRING),INTENT(IN) :: string 
!    type(VARYING_STRING)            :: adjustr_s 
!    INTEGER                         :: ls,pos 
!>>>
USE ISO_VARYING_STRING
     type(VARYING_STRING) :: string, res
string = "abcdef   "
res = ADJUSTR(string)
if(res == VAR_STR("   abcdef")) then
   test80 = 0
else
   test80 = 1
endif
end function test80
 
Program iso_var_unit_tests
 integer errors(80), i
  external test1, test2,test3,test4,test5
  external test6, test7,test8,test9,test10
  external test11, test12,test13,test14,test15
  external test16, test17,test18,test19,test20
  external test21, test22,test23,test24,test25
  external test26, test27,test28,test29,test30
  external test31, test32,test33,test34,test35
  external test36, test37,test38,test39,test40
  external test41, test42,test43,test44,test45
  external test46, test47,test48,test49,test50
  external test51, test52,test53,test54,test55
  external test56, test57,test58,test59,test60
  external test61, test62,test63,test64,test65
  external test66, test67,test68,test69,test70
  external test71, test72,test73,test74,test75
  external test76, test77,test78,test79,test80
 
  integer test1, test2,test3,test4,test5
  integer test6, test7,test8,test9,test10
  integer test11, test12,test13,test14,test15
  integer test16, test17,test18,test19,test20
  integer test21, test22,test23,test24,test25
  integer test26, test27,test28,test29,test30
  integer test31, test32,test33,test34,test35
  integer test36, test37,test38,test39,test40
  integer test41, test42,test43,test44,test45
  integer test46, test47,test48,test49,test50
  integer test51, test52,test53,test54,test55
  integer test56, test57,test58,test59,test60
  integer test61, test62,test63,test64,test65
  integer test66, test67,test68,test69,test70
  integer test71, test72,test73,test74,test75
  integer test76, test77,test78,test79,test80
 
  errors(1) = test1()
  errors(2) = test2()
  errors(3) = test3()
  errors(4) = test4()
  errors(5) = test5()
  errors(6) = test6()
  errors(7) = test7()
  errors(8) = test8()
  errors(9) = test9()
  errors(10) = test10()
  errors(11) = test11()
  errors(12) = test12()
  errors(13) = test13()
  errors(14) = test14()
  errors(15) = test15()
  errors(16) = test16()
  errors(17) = test17()
  errors(18) = test18()
  errors(19) = test19()
  errors(20) = test20()
  errors(21) = test21()
  errors(22) = test22()
  errors(23) = test23()
  errors(24) = test24()
  errors(25) = test25()
  errors(26) = test26()
  errors(27) = test27()
  errors(28) = test28()
  errors(29) = test29()
  errors(30) = test30()
  errors(31) = test31()
  errors(32) = test32()
  errors(33) = test33()
  errors(34) = test34()
  errors(35) = test35()
  errors(36) = test36()
  errors(37) = test37()
  errors(38) = test38()
  errors(39) = test39()
  errors(40) = test40()
  errors(41) = test41()
  errors(42) = test42()
  errors(43) = test43()
  errors(44) = test44()
  errors(45) = test45()
  errors(46) = test46()
  errors(47) = test47()
  errors(48) = test48()
  errors(49) = test49()
  errors(50) = test50()
  errors(51) = test51()
  errors(52) = test52()
  errors(53) = test53()
  errors(54) = test54()
  errors(55) = test55()
  errors(56) = test56()
  errors(57) = test57()
  errors(58) = test58()
  errors(59) = test59()
  errors(60) = test60()
  errors(61) = test61()
  errors(62) = test62()
  errors(63) = test63()
  errors(64) = test64()
  errors(65) = test65()
  errors(66) = test66()
  errors(67) = test67()
  errors(68) = test68()
  errors(69) = test69()
  errors(70) = test70()
  errors(71) = test71()
  errors(72) = test72()
  errors(73) = test73()
  errors(74) = test74()
  errors(75) = test75()
  errors(76) = test76()
  errors(77) = test77()
  errors(78) = test78()
  errors(79) = test79()
  errors(80) = test80()
  do i = 1,80
    if(errors(i) .eq. 0) then
      write(*,*) "PASS            TEST", i
    else
      write(*,*) "FAIL*********** TEST", i
    endif
  enddo   
end Program iso_var_unit_tests
