<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://biomolmd.org/mw/index.php?action=history&amp;feed=atom&amp;title=Ammm%3AREMD_jenny</id>
	<title>Ammm:REMD jenny - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://biomolmd.org/mw/index.php?action=history&amp;feed=atom&amp;title=Ammm%3AREMD_jenny"/>
	<link rel="alternate" type="text/html" href="https://biomolmd.org/mw/index.php?title=Ammm:REMD_jenny&amp;action=history"/>
	<updated>2026-06-07T07:07:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://biomolmd.org/mw/index.php?title=Ammm:REMD_jenny&amp;diff=1658&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;To enable logging immediately on lonestar, &quot;setenv LOG_BUFS 0&quot;. Otherwise the log may be empty when your job dies. Put in brun.  == gromacs instruction ==  http://www.gromacs.org/WIKI-import/REMD   Server: http://folding.bmc.uu.se/remd/   paper: http://www.rsc.org/ej/CP/2008/b716554d.pdf   &#039;&#039;&#039;GROMACS Procedure&#039;&#039;&#039; (http://www.gromacs.org/WIKI-import/REMD)   The setup of a REMD simulation is actually quite straightforward. The following describes the steps that lead to hav...&quot;</title>
		<link rel="alternate" type="text/html" href="https://biomolmd.org/mw/index.php?title=Ammm:REMD_jenny&amp;diff=1658&amp;oldid=prev"/>
		<updated>2022-05-10T15:57:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;To enable logging immediately on lonestar, &amp;quot;setenv LOG_BUFS 0&amp;quot;. Otherwise the log may be empty when your job dies. Put in brun.  == gromacs instruction ==  http://www.gromacs.org/WIKI-import/REMD   Server: http://folding.bmc.uu.se/remd/   paper: http://www.rsc.org/ej/CP/2008/b716554d.pdf   &amp;#039;&amp;#039;&amp;#039;GROMACS Procedure&amp;#039;&amp;#039;&amp;#039; (http://www.gromacs.org/WIKI-import/REMD)   The setup of a REMD simulation is actually quite straightforward. The following describes the steps that lead to hav...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;To enable logging immediately on lonestar, &amp;quot;setenv LOG_BUFS 0&amp;quot;. Otherwise the log may be empty when your job dies. Put in brun.&lt;br /&gt;
&lt;br /&gt;
== gromacs instruction ==&lt;br /&gt;
&lt;br /&gt;
http://www.gromacs.org/WIKI-import/REMD &lt;br /&gt;
&lt;br /&gt;
Server: http://folding.bmc.uu.se/remd/ &lt;br /&gt;
&lt;br /&gt;
paper: http://www.rsc.org/ej/CP/2008/b716554d.pdf &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;GROMACS Procedure&amp;#039;&amp;#039;&amp;#039; (http://www.gromacs.org/WIKI-import/REMD) &lt;br /&gt;
&lt;br /&gt;
The setup of a REMD simulation is actually quite straightforward. The following describes the steps that lead to have a REMD simulation running on a given system. The &amp;quot;success&amp;quot; of the simulation will depend entirely on the problem being addressed and the criterion used to judge it. Although REMD simulations are helping in increasing sampling they do not provide the ultimate answer. This should be kept in mind. &lt;br /&gt;
&lt;br /&gt;
Once the peptide and its surrounds have been determined, need to weigh up the range of temperature space to be sampled, the number of processors prepared to use and the length of time to simulate. With all versions of GROMACS 3.3 (i.e. prior to 4.0), only one processor per replica is allowed, as an additional constraint. The system, number of replicas, range of temperature space and the distribution of temperatures determine the average exchange probability between each replica. These should be constant across the replicas. To achieve this given the expected increase in system potential energy with increasing temperature, in the absence of known bottlenecks in the free energy space, the replica temperatures should be distributed exponentially. &lt;br /&gt;
&lt;br /&gt;
There is good evidence to suggest that the period between exchange attempts for peptide/protein systems should not be under 1ps. This will determine the average length of time a replica will spend exploring conformation space between exchanges, and this is more important than the actual exchange probability. In the GROMACS implementation, an exchange attempt of a particular pair will only happen at every second attempt, as the odd and even pairs attempt exchange on alternating occasions. See the GROMACS Manual. General Steps &lt;br /&gt;
&lt;br /&gt;
   1. define the system eg: peptide + solvent (implicit or explicit).&lt;br /&gt;
   2. depending on the number of processors available and the range of temperature to sample (they are actually extremely dependent on each other) choose a distribution of the temperatures. Use an exponential distribution: Ti=T0*ek*i where k and T0 can be tuned to obtain reasonable temperature intervals to allow exchanges. The exponential allows an increase of temperature interval as the temperature increases. This is necessary because the distribution of the total energy increase with the temperature and thus the exchange rate increases. Keep the exchange rate constant with the temperature.&lt;br /&gt;
   3. once have the temperature distribution, equilibrate the systems at the N temperatures separately (using a separate .mdp file for each). Then construct a series of N run input files, .tpr from the equilibrated structures, again using different .mdp files to generate the different .tpr files. If have N temperatures should have N .tpr files, named prefix_0.tpr, ... prefix_N-1.tpr.&lt;br /&gt;
   4. then run short simulations to have an estimate of the exchange rate (can get a good estimate within ~100 ps) and modify the temperatures if it does not correspond to the wished exchange. Typically 0.2 to 0.3 is good. What is actually most important than the value of the exchange rate itself is the time that a replica will spend at a give temperature. This is given by the exchange rate x frequency of exchange. eg: an exchange rate of 0.2 with exchange trials every 2 ps gives an average time at a temperature of 10 ps. One point to consider is also the way exchanged. Try to exchange all pairs at each trial or only one pair chosen randomly. In the latter case should also take this into account, the residence time of replica has then to be multiplied by N-1, the number of pairs exchanged.&lt;br /&gt;
   5. the initial conformations at each temperature may be identical or different. This a choice and will depend on the reason for performing the REMD.&lt;br /&gt;
&lt;br /&gt;
A web-server that implements the step of choosing temperatures for T-REMD can be [found here]. It works based on known energy distributions for solvated proteins. You input the number of protein atoms, the number of water atoms, the temperature range and the desired exchange probability and then the algorithm generates temperatures. Execution Steps &lt;br /&gt;
&lt;br /&gt;
   1. make a set of .mdp files, each specifying a different temperature being used. Number the output .tpr files according to index, from 0 to whatever (i.e., if have 10 different temperatures have prefix_0.tpr, prefix_1.tpr ... prefix_9.tpr). Prior to GROMACS 4.0, only a single processor may be used per replica, so either omit the -np flag to grompp or use -np 1. For GROMACS 4.0 no gromacs requires no -np flag.&lt;br /&gt;
   2. the interval for replica exchange is given by the mdrun flag -replex. The number of cores (and the -np flag for mdrun for GROMACS prior 4.0) must agree with the number of .tpr files (i.e., 10 for the above general example using prefix_0.tpr through prefix_9.tpr). Nomenclature for the input files is critical to getting mdrun to work.&lt;br /&gt;
   3. For a command line example, see below. Number of steps is the number of steps required to give you the exchange attempt period desired. Other command line options may be required, e.g. -o prefix.&lt;br /&gt;
&lt;br /&gt;
GROMACS 3.0: mpirun -np 10 mdrun -s prefix_.tpr -np 10 -multi -replex (number of steps) (followed by output options) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GROMACS 4.0: mpirun -np 10 mdrun -s prefix_.tpr -multi (integer) -replex (number of steps) (followed by output options) &lt;br /&gt;
&lt;br /&gt;
*With -replex replica exchange is attempted every given number of steps.&lt;br /&gt;
*With -multi multiple systems are simulated in parallel. As many input files are required as the number of systems. The system number is appended to the run input and each output filename, for instance topol.tpr becomes topol0.tpr, topol1.tpr etc. The number of nodes per system is the total number of nodes divided by the number of systems.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Understanding REMD-related Output &lt;br /&gt;
&lt;br /&gt;
mdrun writes important information to your md.log file, you can extract it like this: &lt;br /&gt;
&lt;br /&gt;
% grep Repl md0.log gives: &lt;br /&gt;
&lt;br /&gt;
Initializing Replica Exchange Repl There are 6 replicas: Repl 0 1 2 3 4 5 Repl T 300.0 350.0 410.0 480.0 560.0 650.0 Repl Repl exchange interval: 1000 Repl random seed: 525106 Repl below: x=exchange, pr=probability Replica exchange at step 1000 time 2 Repl 0 &amp;amp;lt;-&amp;amp;gt; 1 dE = 2.492e+00 Repl ex 0 1 2 3 4 5 Repl pr .08 .00 .13 Replica exchange at step 2000 time 4 Repl ex 0 1 2 3 x 4 5 Repl pr .00 1.0 &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This is indeed a very short explanation, but it should hopefully provide enough information to comprehend the results. Post-Processing &lt;br /&gt;
&lt;br /&gt;
If you would like to make your trajectories continuous again you can use the script src/contrib/scripts/demux.pl that will read your md0.log file (you can concatenate several if necessary) and produce a few output files. One of these is a .xvg file (replica_ndx.xvg) that can be passed to trjcat, along with the original trajectory files, in order to produce continuous trajectories. The other file (replica_temp.xvg) contains the temperatures for each replica, starting at the original temperature. So if your replica of interest starts at, say, 300 K, you can follow its trajectory through temperature space. It would be interesting to add some functionality to make histograms of temperature distributions for each replica, which according to most authors, should be flat. The demuxed trajectories have been used in an application (implemented in g_kinetics - not available in GROMACS 3.3.1 or earlier) to obtain protein folding kinetics from REMD trajectories Phys. Rev. Lett. 96, 238102 (2006). &lt;br /&gt;
&lt;br /&gt;
== Jenny: Gromacs replica exchange ==&lt;br /&gt;
&lt;br /&gt;
1. run a 3 ns annealing to raise T from 300K to 800K. This is to generate a range of structures&lt;br /&gt;
&lt;br /&gt;
2. use remdgen.pl to create 70 structures (remdxxx.gro) from the ann.trj from above. In GROMACS call on last line, &amp;quot;grp&amp;quot; input file contains only the number &amp;quot;0&amp;quot;. This indicates &amp;quot;group 0: System&amp;quot; for the structure dump.&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/perl -w&lt;br /&gt;
 for ($i=0;$i&amp;lt;=69;$i++) {&lt;br /&gt;
 $fr=$i*40;# one frame every 40 ps&lt;br /&gt;
 $ogrom=&amp;quot;remd&amp;quot;.&amp;quot;$i.gro&amp;quot;; #output structure&lt;br /&gt;
 `trjconv -s ann.tpr -f ann.trj -dump $fr -o $ogrom &amp;lt; grp`;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 grp is a file with &amp;quot;0&amp;quot; in it&lt;br /&gt;
&lt;br /&gt;
3. Use the following perl to prepare corresponding tpr files (remdxxx.tpr)&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/perl -w&lt;br /&gt;
 $tmp=280;&lt;br /&gt;
 for ($i=0; $i&amp;lt;=72;$i++){&lt;br /&gt;
 $tmp=1.0/(1/$tmp-0.00003*300**0.5/$tmp**0.5);&lt;br /&gt;
 # $tmp=1.0/(1/$tmp-0.00003); # temperature gap between simulation following Gaussian&lt;br /&gt;
 $f=&amp;quot;remd&amp;quot;.&amp;quot;$i.mdp&amp;quot;;&lt;br /&gt;
 `cp remd.mdp $f`;&lt;br /&gt;
 `replace.pl TTT $tmp $f`;&lt;br /&gt;
 $f2=&amp;quot;remd&amp;quot;.&amp;quot;$i.tpr&amp;quot;;&lt;br /&gt;
 $f3=&amp;quot;remd&amp;quot;.&amp;quot;$i.gro&amp;quot;;&lt;br /&gt;
 ` grompp -v -f $f -c $f3 -o $f2 -p cmat.top `;&lt;br /&gt;
 } &lt;br /&gt;
&lt;br /&gt;
The perl script needs &amp;quot;replace.pl&amp;quot; in your path and a &amp;quot;remd.mdp&amp;quot; (below). Modify accordingly:&lt;br /&gt;
&lt;br /&gt;
 title               =  replica exchange &lt;br /&gt;
 cpp                 =  /usr/bin/cpp&lt;br /&gt;
 constraints         =  all-bonds&lt;br /&gt;
 ;define              =  -DPOSRES&lt;br /&gt;
 integrator          =  md&lt;br /&gt;
 dt                  =  0.002   &amp;amp;nbsp;; 2 fs time step&amp;amp;nbsp;!&lt;br /&gt;
 nsteps              =  2500000 &amp;amp;nbsp;; total 4 ns.&lt;br /&gt;
 ;init_step = 2000&lt;br /&gt;
 ;disre = simple&lt;br /&gt;
 ;disre_fc = 5000&lt;br /&gt;
 ; freezing polymer matrix&lt;br /&gt;
 ;pbc = full&lt;br /&gt;
 ;freezegrps = pyu pyc CL &lt;br /&gt;
 ;freezedim = Y Y Y Y Y Y Y Y Y &lt;br /&gt;
 nstcomm             =  10&lt;br /&gt;
 nstxout             =  1000&lt;br /&gt;
 nstvout             =  1000&lt;br /&gt;
 nstfout             =  0&lt;br /&gt;
 nstlog              =  1000&lt;br /&gt;
 nstenergy           =  1000&lt;br /&gt;
 nstlist             =  10&lt;br /&gt;
 ns_type             =  grid&lt;br /&gt;
 rlist               =  0.9&lt;br /&gt;
 rcoulomb            =  0.9&lt;br /&gt;
 rvdw                =  0.9&lt;br /&gt;
 ; Berendsen temperature coupling is on in two groups&lt;br /&gt;
 ;Tcoupl              =  nose-hoover &lt;br /&gt;
 Tcoupl              =  Berendsen&lt;br /&gt;
 tc-grps             =  System &lt;br /&gt;
 tau_t               =  0.5 &lt;br /&gt;
 ref_t               =  TTT &lt;br /&gt;
 ; Energy monitoring&lt;br /&gt;
 energygrps          =  SYSTEM &lt;br /&gt;
 ;ergygrp_excl = pep pep&lt;br /&gt;
 ; Isotropic pressure coupling is now on&lt;br /&gt;
 Pcoupl = no&lt;br /&gt;
 ;Pcoupl              =  Berendsen&lt;br /&gt;
 ;tau_p                  = 20&lt;br /&gt;
 ;pcoultype      = isotropic&lt;br /&gt;
 ;ref_p          = 100&lt;br /&gt;
 ;compressibility = 4.5E-5&lt;br /&gt;
 ;; Generate velocites is off at 300 K.&lt;br /&gt;
 gen_vel             =  no&lt;br /&gt;
 gen_temp            =  no&lt;br /&gt;
 gen_seed            = -1&lt;br /&gt;
 andersen_seed        = 371854&lt;br /&gt;
 ;pme&lt;br /&gt;
 coulombtype              = pme&lt;br /&gt;
 fourierspacing           = 0.10&lt;br /&gt;
 pme_order                = 4&lt;br /&gt;
 ewald_rtol               = 1e-05&lt;br /&gt;
 epsilon_surface          = 0&lt;br /&gt;
 optimize_fft             = yes&lt;br /&gt;
&lt;br /&gt;
4. To submit job to tacc (or other cluster), &amp;quot;bsub &amp;lt; brun&amp;quot;&lt;br /&gt;
&lt;br /&gt;
brun: Note remd matches the gro and tpr files prepared above.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #BSUB -n   70&lt;br /&gt;
 #BSUB -J remd&lt;br /&gt;
 #BSUB -o 1.o%J&lt;br /&gt;
 #BSUB -q normal&lt;br /&gt;
 #BSUB -W 24:00&lt;br /&gt;
 module load gromacs&lt;br /&gt;
 #setenv GMXLIB /home/utexas/bio/prentacc/ANPtop&lt;br /&gt;
 ibrun mdrun_mpi -replex 500 -s remd -o remd -c remd.gro -e -v -g remd -np 70&lt;br /&gt;
&lt;br /&gt;
The interval should be at least 1 ps (500 steps with 2 fs step).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000;&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Xiaojia&amp;#039;s script (7/2014)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 My lonestar script 1(using gromacs4.5.3):&lt;br /&gt;
 #!/bin/tcsh&lt;br /&gt;
 #$ -V&lt;br /&gt;
 #$ -cwd&lt;br /&gt;
 #$ -N remd_9&lt;br /&gt;
 #$ -q normal&lt;br /&gt;
 #$ -j y&lt;br /&gt;
 #$ -o remd9.out&lt;br /&gt;
 #$ -e remd9.err&lt;br /&gt;
 #$ -A TG-MCB100057&lt;br /&gt;
 #$ -l h_rt=24:00:00&lt;br /&gt;
 #$ -m be&lt;br /&gt;
 #$ -pe 16way 1920&lt;br /&gt;
 #$ -hold_jid 2456421                                               Note this line is for continuing different scripts&lt;br /&gt;
 setenv BUF_LOGS 0&lt;br /&gt;
 module load gromacs/4.5.3&lt;br /&gt;
 ibrun mdrun_mpi -s -deffnm remd -multi 120 -replex 250 -cpi -append   Note this line is for Gromacs remd simulation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. To restart a REMD, use the following script (change 69 to however many runs you have):&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/perl -w&lt;br /&gt;
&lt;br /&gt;
 for ($i=0; $i&amp;lt;=69;$i++){&lt;br /&gt;
 $trr=&amp;quot;remd&amp;quot;.&amp;quot;$i.trr&amp;quot;;&lt;br /&gt;
 $tpr=&amp;quot;remd&amp;quot;.&amp;quot;$i.tpr&amp;quot;;&lt;br /&gt;
 $otpr=&amp;quot;rc&amp;quot;.&amp;quot;$i.tpr&amp;quot;;&lt;br /&gt;
 ` tpbconv -s $tpr -f $trr -o $otpr`;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;Then submit the job with &amp;quot;remd&amp;quot; replaced by &amp;quot;rc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. &amp;#039;&amp;#039;&amp;#039;At the bottom of the log file (remd0.log), the replica exchange statistical is printed. Ideally you want the probability of switching uniform across different Ts, and &amp;gt; 20% at least.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
7. to join two trjactories in case you restarted:&lt;br /&gt;
&lt;br /&gt;
  cp remd6.trr 298-1.trr&lt;br /&gt;
 cp rc6.trr 298-2.trr&lt;br /&gt;
 module load gromacs&lt;br /&gt;
 trjcat -f 298-1.trr 298-2.trr -o 298.trr&lt;br /&gt;
 rm 298-1.trr 298-2.trr&lt;br /&gt;
&lt;br /&gt;
== Additional REMD Scripts from Fonner  ==&lt;br /&gt;
&lt;br /&gt;
Using this website (also listed at the tope of the page) [http://folding.bmc.uu.se/remd/], you can get a list of comma separated temperatures for your REMD simulation based on your system size, temperature range, and the acceptance ratio you want. You can save that list to a file and use this perl script to generate a set of .gro files. This script is also located in /home/johnfonner/bin/remdExtract.pl. A couple of notes on usage: 1.) type remdExtract.pl -h for a reminder on the input formatting. 2.) Make sure your trajectory only uses a given reference value once. If there is more than one instance of a temperature (like you heated and then cooled your system), the script will take a snapshot of the first instance only (which is probably not the one you want in a full annealing trajectory. If this affects you, I would just clip the first part of your trr file with the command &amp;lt;code&amp;gt;trjconv_mpi -f traj.trr -s tprfile.tpr -o traj_out.trr -b 1000&amp;lt;/code&amp;gt; or something like that. &lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/perl &lt;br /&gt;
 &lt;br /&gt;
 # Input: Gromacs md.log, traj.trr file, and a comma separated list of temperatures&lt;br /&gt;
 # Output: series of .gro file snapshots taken at the temperatures in the input file&lt;br /&gt;
 &lt;br /&gt;
 # PROCESS INPUT&lt;br /&gt;
 &lt;br /&gt;
 while  ($ARGV = shift(@ARGV)) {&lt;br /&gt;
        if ($ARGV eq &amp;#039;-h&amp;#039;) {&lt;br /&gt;
                die &amp;quot;Usage: remdExtract.pl -t temps.csv -r traj.trr -p tpr -g md.log \n&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        elsif ($ARGV eq &amp;#039;-g&amp;#039;) {&lt;br /&gt;
                open(LOG, shift(@ARGV))||die &amp;quot;can&amp;#039;t open log file\n&amp;quot;;&lt;br /&gt;
                @mdlog=&amp;amp;lt;LOG&amp;amp;gt;;&lt;br /&gt;
                close(LOG);&lt;br /&gt;
        }&lt;br /&gt;
        elsif ($ARGV eq &amp;#039;-t&amp;#039;) {&lt;br /&gt;
                open(TEMP, shift(@ARGV))||die &amp;quot;can&amp;#039;t open temperature file\n&amp;quot;;&lt;br /&gt;
                @temps=sort { $a &amp;amp;lt;=&amp;amp;gt; $b } split(&amp;#039;,&amp;#039;,&amp;amp;lt;TEMP&amp;amp;gt;);&lt;br /&gt;
                close(TEMP);&lt;br /&gt;
        }&lt;br /&gt;
        elsif ($ARGV eq &amp;#039;-p&amp;#039;) { $tpr = shift(@ARGV); }&lt;br /&gt;
        elsif ($ARGV eq &amp;#039;-r&amp;#039;) { $traj = shift(@ARGV); }&lt;br /&gt;
        else {die &amp;quot;could not process $ARGV\n&amp;quot;;}&lt;br /&gt;
 }&lt;br /&gt;
 die &amp;quot;No log file given. \n&amp;quot; unless (@mdlog);&lt;br /&gt;
 die &amp;quot;No temperature file given. \n&amp;quot; unless (@temps);&lt;br /&gt;
 $traj = &amp;quot;traj.trr&amp;quot; unless ($traj);&lt;br /&gt;
 die &amp;quot;Can&amp;#039;t find trajectory file. \n&amp;quot; unless (`ls $traj`);&lt;br /&gt;
 die &amp;quot;Can&amp;#039;t find tpr file. \n&amp;quot; unless (`ls $tpr`);&lt;br /&gt;
 &lt;br /&gt;
 # trim leading whitespace from md.log file because it causes trouble&lt;br /&gt;
 foreach (@mdlog) {s/^\s+//;}&lt;br /&gt;
 &lt;br /&gt;
 # search process&lt;br /&gt;
 for ($i = 0; $i &amp;amp;lt;= $#mdlog; $i++) {&lt;br /&gt;
        if ($mdlog[$i] =~ /Current ref\_t for group/) {&lt;br /&gt;
                for ($j = $i+2; $j &amp;amp;lt; $i + 8; $j++) {&lt;br /&gt;
                        @tokens2 = split (&amp;#039;\s{2,}&amp;#039;,$mdlog[$j]);&lt;br /&gt;
                        for ($k = 0; $k &amp;amp;lt;= $#tokens2; $k++) {&lt;br /&gt;
                                if ($tokens2[$k] =~ /Temperature/) {$thisTemp = (split(&amp;#039; &amp;#039;,$mdlog[$j+1]))[$k];}&lt;br /&gt;
                        }&lt;br /&gt;
                }&lt;br /&gt;
                $time = (split(&amp;#039; &amp;#039;,$mdlog[$i-2]))[1];&lt;br /&gt;
                for ($l=0; $l &amp;amp;lt;= $#temps; $l++) {&lt;br /&gt;
                        if (abs($thisTemp - $temps[$l]) &amp;amp;lt; 0.2) {&lt;br /&gt;
                                $grofile = &amp;quot;remd&amp;quot;.&amp;quot;$l&amp;quot;.&amp;quot;.gro&amp;quot;;&lt;br /&gt;
                                $temps[$l]=0;  #zero out this temperature so that it isn&amp;#039;t used again but it still holds its place in the array.&lt;br /&gt;
                                # &amp;quot;the echo command tells trjconv to use the &amp;quot;0&amp;quot; group, which is &amp;quot;System&amp;quot;.  Output is suppressed by redirecting to /dev/null.&lt;br /&gt;
                                `echo &amp;quot;0\n&amp;quot; | trjconv_mpi -f $traj -s $tpr -o $grofile -b $time -e $time -sep 2&amp;amp;gt; /dev/null`; #the &amp;quot;-sep option makes sure you see it if you get multiple frames&lt;br /&gt;
                                print &amp;quot;$grofile created with reference temperature $thisTemp at timestep $time\.\n&amp;quot;;&lt;br /&gt;
                        }&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>