################################################################################ dcdfreq $amsstep outputEnergies 10000000 restartfreq 10000000 outputname ${name} firsttimestep 0 set statusfile [open $AMS_sharedDataPrefix.status w] set t1file [open $AMS_sharedDataPrefix.t1 w] set t2file [open $AMS_sharedDataPrefix.t2 w] set t3file [open $AMS_sharedDataPrefix.t3 w] ### initialization procedure #### set replica_id 0 reinitatoms # wait until we get out of A to start DCDfile ${AMS_sharedDataPrefix}.dcd run 0 while { [zone]==-1 } { run $amsstep } # we are out of A: we wait until we reach zmin while { [ams_measure] <= $zmin } { run $amsstep } while { $replica_id < $numRep } { # we reached zmin, now start saving the trajectory set count 0 set framenum 0 set outname [format "%s.%06i" $AMS_sharedDataPrefix $replica_id ] file mkdir ${outname}.frames output [file join ${outname}.frames f.0] DCDfile ${outname}.dcd set maxlevel [ams_measure] set zdatfile [open ${outname}.zdat w] puts $zdatfile "$framenum $maxlevel" set trajfile [open ${outname}.traj w] puts $trajfile "$framenum [variables]" while { [zone]==0 } { run $amsstep incr count $amsstep incr framenum set level [ams_measure] puts $trajfile "$framenum [variables]" if { $level > $maxlevel } { output [file join ${outname}.frames f.$framenum] puts $zdatfile "$framenum $level" set maxlevel $level } } set lzone [zone] if { $maxlevel > $maxz && $lzone == -1 } { puts $statusfile "$replica_id c $maxlevel" } if { $maxlevel > $maxz && $lzone == 1 } { puts $statusfile "$replica_id b $maxlevel" } if { $maxlevel <= $maxz && $lzone == -1 } { puts $statusfile "$replica_id s $maxlevel" } close $zdatfile close $trajfile incr replica_id # our trajectory ended, so now we wait until we go out from A again DCDfile ${AMS_sharedDataPrefix}.dcd if { $lzone == -1 } { # we are in A # count for T2 puts $t2file $count set count 0 while { [zone]==-1 } { run $amsstep incr count $amsstep } } if { $lzone == 1 } { # we are in B # count for T3 puts $t3file $count set count 0 while { $lzone == 1 && [zone]!=-1 } { # go back to A run $amsstep } while { $lzone == 1 && [zone]==-1 } { # go out of A run $amsstep incr count $amsstep } } # we are out of A: we wait until we reach zmin while { [ams_measure] <= $zmin } { run $amsstep incr count $amsstep } puts $t1file $count } flush $statusfile close $statusfile close $t1file close $t2file close $t3file ###############################################################################