escape_string Subroutine

public subroutine escape_string(str_in, str_out)

Arguments

Type IntentOptional AttributesName
character(kind=CK,len=*), intent(in) :: str_in
character(kind=CK,len=:), intent(out), allocatable:: str_out

Variables

TypeVisibility AttributesNameInitial
integer(kind=IK), public :: i

counter

integer(kind=IK), public :: ipos

accumulated string size (so we can allocate it in chunks for greater runtime efficiency)

character(kind=CK,len=1), public :: c

for reading str_in one character at a time.

character(kind=CK,len=:), public, allocatable:: tmp

workaround for bug in gfortran 6.1

character(kind=CK,len=*), public, parameter:: specials =quotation_mark//backslash//slash//bspace//formfeed//newline//carriage_return//horizontal_tab