From: fan li (fanliqmul_at_gmail.com)
Date: Thu Aug 16 2018 - 05:47:22 CDT

Hi everyone
I am trying to select atoms with specific region of SOL of each frame and
change the selected atom's resname. I list part of my code below.

############################################
set zmin 30.3

set nf [molinfo top get numframes]
for {set i 0} {$i < [expr (3-1)]} {incr i} {

        set sel_water($i) [atomselect top "resname SOL and z<$zmin"]
        $sel_water($i) frame $i

        #reset the resname of the selected water
        $sel_water($i) set resname den

        $sel_water($i) writegro "water_interest$i.gro"

}

########################################
This "set sel_water($i) [atomselect top "resname SOL and z<$zmin"]"
selection is not working properly as the outcome is not the region I
specified.

Then I removed the "z<$zmin" and changed it to "set sel_water($i)
[atomselect top "resname SOL"]", it woks fine as the entire water is
selected.

So could someone tell me why the selection is not working with the
position selected condition is not working?

As position selected condition changes over each frame in the actual code,
so I can not put the selection outside the loop?

Fan