27 use dc_trace,
only: beginsub, endsub, dbgmessage
28 use dc_string,
only: putline, printf, split, strinclude, stoa, joinchar
29 use dc_present,
only: present_and_not_empty, present_and_true
34 character(*),
intent(in):: name
49 logical,
intent(out),
optional:: err
70 character(TOKEN),
pointer:: varnames_array(:) =>null()
73 character(STRING):: cause_c
74 character(*),
parameter:: subname =
'HstNmlInfoDelete'
76 call beginsub( subname, &
86 if ( .not. gthstnml % initialized )
then
88 cause_c =
'GTHST_NMLINFO'
92 if ( .not. gthstnml % define_mode )
then
102 if ( present_and_not_empty(name) )
then
104 call dbgmessage(
'multiple entries (%c) will be deleted', c1 = trim(name) )
106 & carray = varnames_array )
107 vnmax =
size( varnames_array )
111 & gthstnml = gthstnml, &
112 & name = varnames_array(i), &
114 if ( present_and_true( err ) )
then
115 deallocate( varnames_array )
120 deallocate( varnames_array )
129 hptr => gthstnml % gthstnml_list
132 & previous = hptr_prev, &
135 if ( .not.
associated( hptr ) )
goto 999
136 if ( ( trim(hptr % name) /=
'' ) .and.
associated( hptr_prev ) )
then
137 call dbgmessage(
'entry (%c) is deleted', c1 = trim( adjustl( name ) ) )
138 hptr_prev % next => hptr_next
147 call storeerror( stat, subname, err, cause_c )
148 call endsub( subname )