<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://chemwiki.ch.ic.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gd2613</id>
	<title>ChemWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://chemwiki.ch.ic.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gd2613"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Gd2613"/>
	<updated>2026-06-21T22:50:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=462167</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=462167"/>
		<updated>2014-11-21T18:50:24Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... conduct a systematic conformational analysis for an ion pair dimer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|500px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one of the atom coordinates is altered all the other atoms referred to it follows that atom; Notwithstanding, the first three atoms declared are an exception as they has to be referred to atoms external to the molecule. To obtain uniquely the rotation of the molecule around the other these three atoms were referred to a set of dummy atoms. To execute a 2D rotational scan 4 dummy atoms has been used. Two of them are static trough the scan whereas the other two rotates around the two static ones. Thinking thoughtfully to the system can be understood why 4 atoms are used.&lt;br /&gt;
To define a point in the space by a Z-matrix you define it in relation to other points previously defined.&lt;br /&gt;
Three parameters are used to define a point in the space : the interatomic distance, the angle, and the dihedral angle. The first two parameters can be defined respectively to the two static dummy atoms. Because the rotation of the other two atoms is in plane with the two static dummy atoms it does not affect a dihedral angle defined by the use of rotating atom as one of the terminal atoms of the dihedral angle.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’. The two molecules will respectively move in 2 perpendicular planes of rotation, which will allow to carry out the spheric scan of the interactions between the two molecules.&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first atom (atom 30 in this case) is set so that the sample-probe distance is determined by the variable B1, then the angle defines that the atom will be positioned approximatively in line with the atom 1 and 3 so that moving 3 will inherently move this atom and the dihedral angle defines the plane perpendicular to the 1 2 3 atoms plane where the atom 30 will lay(notice that the plane containing 1 2 3 will change through the scan with the movement of the atom 3).&lt;br /&gt;
&lt;br /&gt;
The second atom (atom 31 in this case) is defined with respect to the previous atom for the interatomic distance. Because 1 is the center of the system the angle 1 30 31 will be constant therefore is a good way to define the atom 31 position. Dihedral angle is defined but left variable so that the molecule can tilt respect to the 30-1 axis. The atom 2 is not modified through the scan so it is a good place holder to be used to define the dihedral angle and the variation of the 30 atom position with respect to the movement of the atom 3 does not affect the 31 30 1 2 dihedral angle because it doesn&#039;t vary the plane defined by the atoms 30 1 2.&lt;br /&gt;
&lt;br /&gt;
The third atom is defined for the interatomic distance and the angle with respect of the two other atoms defined before. The dihedral angle is defined with respect of the atom 1 that being the centre of the system does not make the dihedral angle trough the scan (plane defined by 30 31 and 1 does not vary trough the scan)&lt;br /&gt;
&lt;br /&gt;
All the remaining atoms of the molecule are defined with respect to these three atoms defined here so that when these three atoms move all the molecule moves coherently. THis can be imposed by the button in gaussview with the letter &#039;A&#039; that allows to change the coordinates.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the sample molecule are defined as it follows :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
&lt;br /&gt;
N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
&lt;br /&gt;
N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of the molecule is fixed but the first of the three atoms defines the dihedral angle with respect of the coordinates of the atoms C(5) 1 2 4 therefore the rotation of the dummy atom 4 will result in the inherent rotation of the C atom (the dihedral angle that defines the position of the atom 4 is a variable).&lt;br /&gt;
The other two atoms are defined with the atoms 1 and 2 that does not move during the scan.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the butyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I have tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I have tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more conformational freedom, carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I have added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442717</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442717"/>
		<updated>2014-10-10T17:32:38Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|500px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one of the atom coordinates is altered all the other atoms referred to it follows that atom; Notwithstanding, the first three atoms declared are an exception as they has to be referred to atoms external to the molecule. To obtain uniquely the rotation of the molecule around the other these three atoms were referred to a set of dummy atoms. To execute a 2D rotational scan 4 dummy atoms has been used. Two of them are static trough the scan whereas the other two rotates around the two static ones. Thinking thoughtfully to the system can be understood why 4 atoms are used.&lt;br /&gt;
To define a point in the space by a Z-matrix you define it in relation to other points previously defined.&lt;br /&gt;
Three parameters are used to define a point in the space : the interatomic distance, the angle, and the dihedral angle. The first two parameters can be defined respectively to the two static dummy atoms. Because the rotation of the other two atoms is in plane with the two static dummy atoms it does not affect a dihedral angle defined by the use of rotating atom as one of the terminal atoms of the dihedral angle.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first atom (atom 30 in this case) is set so that the sample-probe distance is determined by the variable B1, then the angle defines that the atom will be positioned approximatively in line with the atom 1 and 3 so that moving 3 will inherently move this atom and the dihedral angle defines the plane perpendicular to the 1 2 3 atoms plane where the atom 30 will lay(notice that the plane containing 1 2 3 will change through the scan with the movement of the atom 3).&lt;br /&gt;
&lt;br /&gt;
The second atom (atom 31 in this case) is defined with respect to the previous atom for the interatomic distance. Because 1 is the center of the system the angle 1 30 31 will be constant therefore is a good way to define the atom 31 position. Dihedral angle is defined but left variable so that the molecule can tilt respect to the 30-1 axis. The atom 2 is not modified through the scan so it is a good place holder to be used to define the dihedral angle and the variation of the 30 atom position with respect to the movement of the atom 3 does not affect the 31 30 1 2 dihedral angle because it doesn&#039;t vary the plane defined by the atoms 30 1 2.&lt;br /&gt;
&lt;br /&gt;
The third atom is defined for the interatomic distance and the angle with respect of the two other atoms defined before. The dihedral angle is defined with respect of the atom 1 that being the centre of the system does not make the dihedral angle trough the scan (plane defined by 30 31 and 1 does not vary trough the scan)&lt;br /&gt;
&lt;br /&gt;
All the remaining atoms of the molecule are defined with respect to these three atoms defined here so that when these three atoms move all the molecule moves coherently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442666</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442666"/>
		<updated>2014-10-06T15:32:58Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|500px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first atom (atom 30 in this case) is set so that the sample-probe distance is determined by the variable B1, then the angle defines that the atom will be positioned approximatively in line with the atom 1 and 3 so that moving 3 will inherently move this atom and the dihedral angle defines the plane perpendicular to the 1 2 3 atoms plane where the atom 30 will lay(notice that the plane containing 1 2 3 will change through the scan with the movement of the atom 3).&lt;br /&gt;
&lt;br /&gt;
The second atom (atom 31 in this case) is defined with respect to the previous atom for the interatomic distance. Because 1 is the center of the system the angle 1 30 31 will be constant therefore is a good way to define the atom 31 position. Dihedral angle is defined but left variable so that the molecule can tilt respect to the 30-1 axis. The atom 2 is not modified through the scan so it is a good place holder to be used to define the dihedral angle and the variation of the 30 atom position with respect to the movement of the atom 3 does not affect the 31 30 1 2 dihedral angle because it doesn&#039;t vary the plane defined by the atoms 30 1 2.&lt;br /&gt;
&lt;br /&gt;
The third atom is defined for the interatomic distance and the angle with respect of the two other atoms defined before. The dihedral angle is defined with respect of the atom 1 that being the centre of the system does not make the dihedral angle trough the scan (plane defined by 30 31 and 1 does not vary trough the scan)&lt;br /&gt;
&lt;br /&gt;
All the remaining atoms of the molecule are defined with respect to these three atoms defined here so that when these three atoms move all the molecule moves coherently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442532</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442532"/>
		<updated>2014-09-09T15:36:51Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|500px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442531</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442531"/>
		<updated>2014-09-09T15:30:42Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... conduct a systematic conformational analysis for an ion pair dimer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:Spherical_scan.png|150px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|500px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442530</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442530"/>
		<updated>2014-09-09T15:30:09Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... conduct a systematic conformational analysis for an ion pair dimer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:Spherical_scan.png|150px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|500px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442529</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442529"/>
		<updated>2014-09-09T15:29:47Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... conduct a systematic conformational analysis for an ion pair dimer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:Spherical_scan.png|150px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|300px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442528</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442528"/>
		<updated>2014-09-09T15:29:28Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... conduct a systematic conformational analysis for an ion pair dimer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:Spherical_scan.png|150px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:ScanAngles.png‎|300px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:ScanAngles.png&amp;diff=442527</id>
		<title>File:ScanAngles.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:ScanAngles.png&amp;diff=442527"/>
		<updated>2014-09-09T15:27:02Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Test_IN_OP_top.gif&amp;diff=442526</id>
		<title>File:Test IN OP top.gif</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Test_IN_OP_top.gif&amp;diff=442526"/>
		<updated>2014-09-09T15:27:01Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Test_IN_OP_in_plane.gif&amp;diff=442525</id>
		<title>File:Test IN OP in plane.gif</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Test_IN_OP_in_plane.gif&amp;diff=442525"/>
		<updated>2014-09-09T15:27:00Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442524</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442524"/>
		<updated>2014-09-09T15:22:27Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:Spherical_scan.png|150px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
&lt;br /&gt;
   D2	  	-90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442523</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442523"/>
		<updated>2014-09-09T15:20:32Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:Spherical_scan.png|150px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%nprocshared=8&lt;br /&gt;
%mem=14400MB&lt;br /&gt;
%chk=test_IN_ON_90.chk&lt;br /&gt;
# opt=z-matrix b3lyp/6-31g nosymm geom=connectivity empiricaldispersion=gd3&lt;br /&gt;
&lt;br /&gt;
BMIM&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 X              &lt;br /&gt;
 X                  1    2.00000000&lt;br /&gt;
 X                  1    3.00000000    2            A1&lt;br /&gt;
 X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
 C                  1    1.15771466    2   90.00000000    4   90.00000000    0&lt;br /&gt;
 N                  1    1.17242544    5   71.45544166    2   83.48309458    0&lt;br /&gt;
 N                  1    1.13616026    5   69.80539566    6 -173.48309458    0&lt;br /&gt;
 C                  6    2.20589881    7   36.75204317    5  179.62354220    0&lt;br /&gt;
 C                  7    2.20741318    6   36.76548810    5 -179.76966396    0&lt;br /&gt;
 H                  8    3.24571830    6   41.19810842    7   -0.35958291    0&lt;br /&gt;
 C                  6    1.47006172    5  126.67015792    7  179.44651575    0&lt;br /&gt;
 C                  7    1.48214358    6  161.27267589    8  170.17035599    0&lt;br /&gt;
 H                  8    1.07651940    6  167.56517796    7  179.25571448    0&lt;br /&gt;
 H                  9    1.07678623    6  122.06766763    7  179.41091048    0&lt;br /&gt;
 H                 11    1.08952723    6  109.31735900    7  121.89721467    0&lt;br /&gt;
 H                 11    1.08956200    6  109.42948493    7 -117.41092715    0&lt;br /&gt;
 H                 11    1.08825013    6  109.03687137    7    2.28983614    0&lt;br /&gt;
 C                 12    1.53044333    6  112.70900607    7   88.75485300    0&lt;br /&gt;
 H                 12    1.09089731    6  115.47545821    7  -41.55756898    0&lt;br /&gt;
 H                 12    1.09150376    6   96.58931706    7 -154.92737321    0&lt;br /&gt;
 C                 18    1.53159261   12  114.02466815    7   60.21093562    0&lt;br /&gt;
 H                 18    1.09474130   12  106.71484623    7 -178.13510738    0&lt;br /&gt;
 H                 18    1.09574182   12  109.46847196    7  -63.61295391    0&lt;br /&gt;
 C                 21    1.53133717   18  112.36924430   12  177.24888774    0&lt;br /&gt;
 H                 21    1.09703026   18  109.68946719   12  -61.12025577    0&lt;br /&gt;
 H                 21    1.09729776   18  109.24326164   12   55.39969468    0&lt;br /&gt;
 H                 24    1.09178867   21  111.10805048   18  179.79823172    0&lt;br /&gt;
 H                 24    1.09323755   21  111.08215903   18  -60.23501784    0&lt;br /&gt;
 H                 24    1.09375708   21  111.13297855   18   59.78378948    0&lt;br /&gt;
 C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
 S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
 S                 30    1.72774347   31  122.85100226    1    1.94989600    0&lt;br /&gt;
 N                 30    1.38649628   31  118.69787900   32  179.88857349    0&lt;br /&gt;
 C                 33    1.46198199   30  122.51211282   32  176.69344464    0&lt;br /&gt;
 C                 33    1.46194880   30  122.67895299   34 -179.91918915    0&lt;br /&gt;
 H                 34    1.09727882   33  107.79539191   30 -147.02448390    0&lt;br /&gt;
 H                 34    1.08972480   33  108.19170344   30  -30.07257517    0&lt;br /&gt;
 C                 34    1.53221816   33  112.70644243   30   91.09689577    0&lt;br /&gt;
 H                 35    1.09729025   33  107.78009396   30 -147.24569440    0&lt;br /&gt;
 H                 35    1.08967434   33  108.19965873   30  -30.30969788    0&lt;br /&gt;
 C                 35    1.53224904   33  112.72406370   30   90.88083173    0&lt;br /&gt;
 H                 38    1.09170104   34  108.92193675   33  -62.10201645    0&lt;br /&gt;
 H                 38    1.09523444   34  111.32513550   33   57.95875345    0&lt;br /&gt;
 H                 38    1.09666295   34  110.72033274   33  178.37187932    0&lt;br /&gt;
 H                 41    1.09519819   35  111.31213651   33   57.80156920    0&lt;br /&gt;
 H                 41    1.09171890   35  108.94832172   33  -62.26011562    0&lt;br /&gt;
 H                 41    1.09664056   35  110.70985861   33  178.21143471    0&lt;br /&gt;
&lt;br /&gt;
   B1             5.86611814&lt;br /&gt;
   A1            90.00000000	S	9	 -9.90000&lt;br /&gt;
   D1            90.00000000	S	9	-10.00000&lt;br /&gt;
   D2	  -90.00000000&lt;br /&gt;
&lt;br /&gt;
 1 2 1.5 3 2.0 6 1.0&lt;br /&gt;
 2 5 1.0 7 1.0&lt;br /&gt;
 3 4 1.5 8 1.0&lt;br /&gt;
 4 5 2.0 9 1.0&lt;br /&gt;
 5 10 1.0&lt;br /&gt;
 6&lt;br /&gt;
 7 11 1.0 12 1.0 13 1.0&lt;br /&gt;
 8 14 1.0 15 1.0 16 1.0&lt;br /&gt;
 9&lt;br /&gt;
 10&lt;br /&gt;
 11&lt;br /&gt;
 12&lt;br /&gt;
 13&lt;br /&gt;
 14 17 1.0 18 1.0 19 1.0&lt;br /&gt;
 15&lt;br /&gt;
 16&lt;br /&gt;
 17 20 1.0 21 1.0 22 1.0&lt;br /&gt;
 18&lt;br /&gt;
 19&lt;br /&gt;
 20 23 1.0 24 1.0 25 1.0&lt;br /&gt;
 21&lt;br /&gt;
 22&lt;br /&gt;
 23&lt;br /&gt;
 24&lt;br /&gt;
 25&lt;br /&gt;
 26 27 1.0 28 1.0 29 1.0&lt;br /&gt;
 27&lt;br /&gt;
 28&lt;br /&gt;
 29 30 1.0 31 1.0&lt;br /&gt;
 30 32 1.0 33 1.0 34 1.0&lt;br /&gt;
 31 35 1.0 36 1.0 37 1.0&lt;br /&gt;
 32&lt;br /&gt;
 33&lt;br /&gt;
 34 38 1.0 39 1.0 40 1.0&lt;br /&gt;
 35&lt;br /&gt;
 36&lt;br /&gt;
 37 41 1.0 42 1.0 43 1.0&lt;br /&gt;
 38&lt;br /&gt;
 39&lt;br /&gt;
 40&lt;br /&gt;
 41&lt;br /&gt;
 42&lt;br /&gt;
 43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442392</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442392"/>
		<updated>2014-09-05T15:10:13Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... conduct a systematic conformational analysis for an ion pair dimer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
[[Image:Spherical_scan.png|150px| ]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442391</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442391"/>
		<updated>2014-09-05T15:03:15Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
[[File:spherical_scan.jpg]]This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Spherical_scan.png&amp;diff=442390</id>
		<title>File:Spherical scan.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Spherical_scan.png&amp;diff=442390"/>
		<updated>2014-09-05T15:02:15Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group&amp;diff=442389</id>
		<title>Mod:Hunt Research Group</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group&amp;diff=442389"/>
		<updated>2014-09-05T15:01:28Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* Research Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Hunt Group Wiki==&lt;br /&gt;
&lt;br /&gt;
Back to the main [http://www.ch.ic.ac.uk/hunt web-page]&lt;br /&gt;
===HPC Resources===&lt;br /&gt;
#Computing resources available in the chemistry department [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/computing_resources link]&lt;br /&gt;
#HPC servers and run scripts [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc link]&lt;br /&gt;
#Setting up a connection to HPC if you have a PC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc_connections link] &lt;br /&gt;
#How to fix Windows files under UNIX [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/Windowsfiles link] &lt;br /&gt;
#How to make ssh more comfortable [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/pimpSSH link] &lt;br /&gt;
#How to make qsub more comfortable (gfunc) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/pimpQSUB link] &lt;br /&gt;
#How to set up a SSH keypair [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/SSHkeyfile link] &lt;br /&gt;
#How to use gaussview directly on the HPC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/gview link] &lt;br /&gt;
#How to comfortably search through old BASH commands [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/searchbash link]&lt;br /&gt;
#How to connect to HPC directory on desktop for file transfers [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc_Directory_on_desktop link]&lt;br /&gt;
#How to set up cx2 [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cx2 link]&lt;br /&gt;
&lt;br /&gt;
===Visualisation===&lt;br /&gt;
*&#039;&#039;&#039;ESPs&#039;&#039;&#039;&lt;br /&gt;
#Instructions for visualizing electrostatic potentials (Gaussview)[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/electrostatic_potentials link]&lt;br /&gt;
#Electrostatic Potentials II (Molden) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/electrostatic_potentials_2 link] &lt;br /&gt;
*&#039;&#039;&#039;VMD&#039;&#039;&#039;&lt;br /&gt;
#Beginners guide to VMD: a molecular dynamics visualisation package [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/vmd link]&lt;br /&gt;
#Visualising your Simulation [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/VisualisingyourSimulation link] &lt;br /&gt;
#How to turn a Gaussian optimization into a VMD movie [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/VMDmovie link] &lt;br /&gt;
#How to make VMD trajectory repeated periodically [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/vmd link]&lt;br /&gt;
*&#039;&#039;&#039;JMol&#039;&#039;&#039;&lt;br /&gt;
#Visualising MOs using Jmol [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:basic_jmol_instructions link]&lt;br /&gt;
#Surfaces (Solvent-Accessible and Connolly) in Jmol [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/jmolsurfaces link]&lt;br /&gt;
*&#039;&#039;&#039;EMO Code&#039;&#039;&#039;&lt;br /&gt;
#How to use Ling&#039;s emo plot code[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emoplot link] &lt;br /&gt;
#How to plot EMOs [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emo link]&lt;br /&gt;
&lt;br /&gt;
===Gaussian General===&lt;br /&gt;
#A database of common errors encountered when running Gaussian jobs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/gaussian_errors link]&lt;br /&gt;
# [http://www.ch.ic.ac.uk/hunt/g03_man/index.htm G03 Manual]&lt;br /&gt;
#How to run NBO5.9 on the HPC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/NBO5.9 link] &lt;br /&gt;
#How to include dispersion [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/dispersion link] &lt;br /&gt;
#Basic ONIOM (Mechanical Embedding) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/basiconiom link]&lt;br /&gt;
#M0n and DFT-D [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/DFTD link]&lt;br /&gt;
#IL ONIOM clusters [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/oniomclusers link]&lt;br /&gt;
#Molecular volume calculations [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/molecular_volume link]&lt;br /&gt;
#problems with scf convergence [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/scf_convergence link]&lt;br /&gt;
&lt;br /&gt;
===Setup and Running Ab-Initio MD Simulations===&lt;br /&gt;
#CPMD: Car-Parrinello Molecular Dynamics [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/cpmd link]&lt;br /&gt;
#How to run CPMD to study aqueous solutions [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/cpmd_water link]&lt;br /&gt;
#How to run CP2K [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cp2k_how link] &lt;br /&gt;
#[bmim]Cl using CPMD [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/bmimCl_cpmd  link] &lt;br /&gt;
#[bmim]Cl using CP2K [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/bmimCl_cp2k  link] &lt;br /&gt;
#mman using CPMD and Gaussian [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/mman link] &lt;br /&gt;
#[emim]SCN using CP2K[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emimscn link] &lt;br /&gt;
#CP2K Donts [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cp2k link] &lt;br /&gt;
&lt;br /&gt;
===Setup and Running Classical MD Simulations===&lt;br /&gt;
#DLPOLY a MD simulation package, Installation on an IMac (old needs to be updated) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/dlpoly_install  link]&lt;br /&gt;
#DL_POLY FAQs [http://www.stfc.ac.uk/cse/DL_POLY/ccp1gui/38621.aspx] from DL_POLY webpage.&lt;br /&gt;
#Packmol for generating starting configurations [http://www.ime.unicamp.br/~martinez/packmol/] from Packmol webpage.&lt;br /&gt;
#Getting started: generating a solvated structure and &amp;quot;relaxing&amp;quot; it [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Starting_MD link] &lt;br /&gt;
#local [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/packmol_to_dlpoly_scripts packmol to dlpoly] conversion scripts&lt;br /&gt;
#Getting the Force Field [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Wheretostart link] &lt;br /&gt;
#Choosing an Ensemble [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Ensembles link] &lt;br /&gt;
#Equilibration and production simulations [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/EquilibrationandProduction link] &lt;br /&gt;
#Energy Drift [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/EnergyDrift link] &lt;br /&gt;
#Voids in ILs[https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/voids link] &lt;br /&gt;
#How to equilibrate an MD run[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/equilibration link] &lt;br /&gt;
#Equilibration of [bmim][BF4] and [bmim][NO3][https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/BmimBF4_equilibration link] &lt;br /&gt;
#Summary of discussions with Ruth[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/Aug09QtoRuth link]&lt;br /&gt;
&lt;br /&gt;
===Running QM/MM Simulations in ChemShell===&lt;br /&gt;
#ChemShell official website which contains the manual and a tutorial [http://www.stfc.ac.uk/CSE/randd/ccg/36254.aspx link]&lt;br /&gt;
#Introduction to ChemShell - Copper in water [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_Introduction link]&lt;br /&gt;
#Defining the system: Cu&amp;lt;sup&amp;gt;2+&amp;lt;/sup&amp;gt; and its first 2 solvation shells [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_System_Aqeuous_Cu(II) link] &lt;br /&gt;
#Defining the force field parameters [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_Force_Field_Parameters_Aqueous_Cu(II) link] &lt;br /&gt;
#Single point QM/MM energy calculation [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_SP_Aqeuous_Cu(II) link] &lt;br /&gt;
#QM/MM Optimisation [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_OPT_Aqeuous_Cu(II) link] &lt;br /&gt;
#QM/MM Molecular Dynamics [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_MD_Aqeuous_Cu(II) link]&lt;br /&gt;
&lt;br /&gt;
===Research Notes===&lt;br /&gt;
#Cl- in water [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/wannier_centre link] &lt;br /&gt;
#The use of Legendre time correlation functions to study reorientational dynamics in liquids[https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/legendre  link] &lt;br /&gt;
#Functional for ILs using CPMD [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/IL_cpmd_functional link] &lt;br /&gt;
#Solving the angular part of the Schrödinger equation for a hydrogen atom [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/angular_schrodinger link] (notes by Vincent)&lt;br /&gt;
#Systematic conformational scan for ion-pair dimers [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan link]&lt;br /&gt;
&lt;br /&gt;
===Installing and using other packages===&lt;br /&gt;
#How to install POLYRATE [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/polyrate link] &lt;br /&gt;
#How to install Geomview [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/geomview link] &lt;br /&gt;
#XMGRACE, gfortran, c compilers for Lion [http://hpc.sourceforge.net/]&lt;br /&gt;
&lt;br /&gt;
===Admin Stuff===&lt;br /&gt;
#Not used to writing a wiki, make your test runs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/testing  on this page]&lt;br /&gt;
#How to set-up new macs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/mac_setup link]&lt;br /&gt;
#How to set-up remote desktop [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/mac_remote link]&lt;br /&gt;
#[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/calendar Calendar]&lt;br /&gt;
#Demonstrating in the 3rd year computational chemistry lab [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/compchemlab  Timetable]&lt;br /&gt;
#How to switch the printer HP CP3525dn duplex on and off [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/printing link]&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442388</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442388"/>
		<updated>2014-09-05T14:57:12Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[under development]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442387</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442387"/>
		<updated>2014-09-05T14:55:16Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;4&amp;lt;/sub&amp;gt;Im][C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;C&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;DTC] ion pair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has to be self-referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442386</id>
		<title>Talk:Mod:Hunt Research Group/ion pair scan</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan&amp;diff=442386"/>
		<updated>2014-09-05T14:52:29Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: Created page with &amp;quot;== How to... conduct a systematic conformational analysis for an ion pair dimer == This is a tutorial about a simple procedure to spherical scan of the potential energy surface o...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to... conduct a systematic conformational analysis for an ion pair dimer ==&lt;br /&gt;
This is a tutorial about a simple procedure to spherical scan of the potential energy surface of one molecule sampled by another molecule used as a probe. For this scan would be convenient to have a referiment atom in the centre of the sphere but not often the centre of the sphere is occupied by an atom and Gaussian do not allow us to use dummy atoms as referiments for relaxed angle scan (keyword: modredundant). To do that we have to define a coordinate system with some dummy atoms and operate a Z-matrix scan on the coordinates by using the keyword opt=z-matrix in the route.&lt;br /&gt;
&lt;br /&gt;
Herein, I’ll show step by step what I’ve done to set the PES scan for the [C1C4Im][C2C2DTC] ion pair.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;1 - Set the referiment system of your scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As first step you’ll introduce these four dummy atoms reported below as the first four atoms of your z-matrix.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
&lt;br /&gt;
X&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2            A1&lt;br /&gt;
&lt;br /&gt;
X                  1    3.00000000    2   90.00000000    3            D1    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
These atoms are set to allow us to rotate X3 and X4 in 2 perpendicular planes by modifying A1 and D1 variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;2 – Define your molecules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have to define the molecules involved in the scan. Each molecule has tobe self referred. This means that its atoms are referred to atoms inside the same molecule so that when one atom coordinates are altered all the other atoms referred to it follows that atom. The first three atom declared are an exception, they has to be referred to atoms external to the molecule. These atoms will be the dummy atoms set before.&lt;br /&gt;
&lt;br /&gt;
This is the hard point of the creation of the .com file because you have to set the coordinates of the first three atoms thoughtfully to allow the rotation of the molecule without affecting the coordinates of these atoms during it. This can be checked by rotating the angle in gaussview and seeing if the result is what expected. Hopefully, the procedure described hereafter should work but I do not have occasion to check it onto molecules other than the one displayed.&lt;br /&gt;
&lt;br /&gt;
In order to proceed, we have to distinguish the role of the 2 molecules, one will be our ‘probe’ and the other will be our ‘sample’. The ‘sample’ will rotate on itself whereas the ‘probe’ will move around the ‘sample’&lt;br /&gt;
&lt;br /&gt;
The dummy atoms 1 and 2 must be included in the axis of rotation of the ‘sample’ and 1 will be the ‘centre of inversion’ of the sphere.&lt;br /&gt;
&lt;br /&gt;
The first three atoms of the probe must be set like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C                  1            B1    3  178.99999509    2  -72.98467412    0&lt;br /&gt;
&lt;br /&gt;
S                 30    1.72416943    1   58.52894245    2            D2    0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond of the first atom is set as a variable so that it can vary during the optimization and the dihedral angle of the second atom is also set as a variable, varying the attack angle of the probe. The atom respect to whom the coordinates are set must be respected. The ‘30’ atom is the carbon atom just set in the line before.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;3 – Set the scan&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the z-matrix a white line must be left and then we will set our variables :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
B1             5.86611814&lt;br /&gt;
&lt;br /&gt;
A1            90.00000000    S       9        -9.90000&lt;br /&gt;
&lt;br /&gt;
D1           -90.00000000    S       9       +10.00000&lt;br /&gt;
&lt;br /&gt;
D2           -90.00000000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously your values will be different but the scan amongst the angle A1 should rotate the probe over and under the plane formed by the atoms 1,3,4 and D1 should rotate the probe in the plane formed by 1,2,3. It is important to remember that Gaussian has some issues with the limiting angles therefore is better to scan until ~179 or ~1 to avoid script faults. Remember to set the opt=z-matrix in the script route.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;4 – What can go wrong&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Personally, I suggest to do multiple ‘little’ scans because in the scan fails the output will not be formatted by gaussview as a X, Y, Z table that is useful for further elaboration. For example, I have done eight scans but two have failed because the buthyl chain causes to the script to do not converge.&lt;br /&gt;
In my case I’ve tried to add the keyword in the route INT=ultrafine opt=(z-matrix, tight, maxcycles=250) but this does not solve my problem. I’ve tried to reduce the freedom of the molecule fixing the D2 angle but also that does not deserve to anything. The solution has been to unfreeze the butyl chain. A similar issue can happen also to you and for me the solution has been more freedom carefully given where needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;5 – Further elaboration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After gain your data you have to plot them in a graph. Matlab is a big, heavy and powerful suite of mathematical elaboration scripts that is really useful to produce automatized procedures to output your data as a surface plot by the command surf(). If you would like to try to use this software suite I’ve added a an help page that should help you to plot your scans output.(link available soon) Otherwise you can use a simple plotting software but I think that matlab allows you to have a workspace extremely useful. For example it can produce derivatives of your data spotting out the minimum and maximum of your data.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group&amp;diff=442385</id>
		<title>Mod:Hunt Research Group</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group&amp;diff=442385"/>
		<updated>2014-09-05T14:48:21Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* Research Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Hunt Group Wiki==&lt;br /&gt;
&lt;br /&gt;
Back to the main [http://www.ch.ic.ac.uk/hunt web-page]&lt;br /&gt;
===HPC Resources===&lt;br /&gt;
#Computing resources available in the chemistry department [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/computing_resources link]&lt;br /&gt;
#HPC servers and run scripts [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc link]&lt;br /&gt;
#Setting up a connection to HPC if you have a PC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc_connections link] &lt;br /&gt;
#How to fix Windows files under UNIX [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/Windowsfiles link] &lt;br /&gt;
#How to make ssh more comfortable [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/pimpSSH link] &lt;br /&gt;
#How to make qsub more comfortable (gfunc) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/pimpQSUB link] &lt;br /&gt;
#How to set up a SSH keypair [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/SSHkeyfile link] &lt;br /&gt;
#How to use gaussview directly on the HPC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/gview link] &lt;br /&gt;
#How to comfortably search through old BASH commands [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/searchbash link]&lt;br /&gt;
#How to connect to HPC directory on desktop for file transfers [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc_Directory_on_desktop link]&lt;br /&gt;
#How to set up cx2 [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cx2 link]&lt;br /&gt;
&lt;br /&gt;
===Visualisation===&lt;br /&gt;
*&#039;&#039;&#039;ESPs&#039;&#039;&#039;&lt;br /&gt;
#Instructions for visualizing electrostatic potentials (Gaussview)[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/electrostatic_potentials link]&lt;br /&gt;
#Electrostatic Potentials II (Molden) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/electrostatic_potentials_2 link] &lt;br /&gt;
*&#039;&#039;&#039;VMD&#039;&#039;&#039;&lt;br /&gt;
#Beginners guide to VMD: a molecular dynamics visualisation package [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/vmd link]&lt;br /&gt;
#Visualising your Simulation [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/VisualisingyourSimulation link] &lt;br /&gt;
#How to turn a Gaussian optimization into a VMD movie [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/VMDmovie link] &lt;br /&gt;
#How to make VMD trajectory repeated periodically [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/vmd link]&lt;br /&gt;
*&#039;&#039;&#039;JMol&#039;&#039;&#039;&lt;br /&gt;
#Visualising MOs using Jmol [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:basic_jmol_instructions link]&lt;br /&gt;
#Surfaces (Solvent-Accessible and Connolly) in Jmol [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/jmolsurfaces link]&lt;br /&gt;
*&#039;&#039;&#039;EMO Code&#039;&#039;&#039;&lt;br /&gt;
#How to use Ling&#039;s emo plot code[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emoplot link] &lt;br /&gt;
#How to plot EMOs [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emo link]&lt;br /&gt;
&lt;br /&gt;
===Gaussian General===&lt;br /&gt;
#A database of common errors encountered when running Gaussian jobs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/gaussian_errors link]&lt;br /&gt;
# [http://www.ch.ic.ac.uk/hunt/g03_man/index.htm G03 Manual]&lt;br /&gt;
#How to run NBO5.9 on the HPC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/NBO5.9 link] &lt;br /&gt;
#How to include dispersion [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/dispersion link] &lt;br /&gt;
#Basic ONIOM (Mechanical Embedding) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/basiconiom link]&lt;br /&gt;
#M0n and DFT-D [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/DFTD link]&lt;br /&gt;
#IL ONIOM clusters [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/oniomclusers link]&lt;br /&gt;
#Molecular volume calculations [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/molecular_volume link]&lt;br /&gt;
#problems with scf convergence [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/scf_convergence link]&lt;br /&gt;
&lt;br /&gt;
===Setup and Running Ab-Initio MD Simulations===&lt;br /&gt;
#CPMD: Car-Parrinello Molecular Dynamics [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/cpmd link]&lt;br /&gt;
#How to run CPMD to study aqueous solutions [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/cpmd_water link]&lt;br /&gt;
#How to run CP2K [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cp2k_how link] &lt;br /&gt;
#[bmim]Cl using CPMD [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/bmimCl_cpmd  link] &lt;br /&gt;
#[bmim]Cl using CP2K [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/bmimCl_cp2k  link] &lt;br /&gt;
#mman using CPMD and Gaussian [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/mman link] &lt;br /&gt;
#[emim]SCN using CP2K[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emimscn link] &lt;br /&gt;
#CP2K Donts [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cp2k link] &lt;br /&gt;
&lt;br /&gt;
===Setup and Running Classical MD Simulations===&lt;br /&gt;
#DLPOLY a MD simulation package, Installation on an IMac (old needs to be updated) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/dlpoly_install  link]&lt;br /&gt;
#DL_POLY FAQs [http://www.stfc.ac.uk/cse/DL_POLY/ccp1gui/38621.aspx] from DL_POLY webpage.&lt;br /&gt;
#Packmol for generating starting configurations [http://www.ime.unicamp.br/~martinez/packmol/] from Packmol webpage.&lt;br /&gt;
#Getting started: generating a solvated structure and &amp;quot;relaxing&amp;quot; it [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Starting_MD link] &lt;br /&gt;
#local [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/packmol_to_dlpoly_scripts packmol to dlpoly] conversion scripts&lt;br /&gt;
#Getting the Force Field [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Wheretostart link] &lt;br /&gt;
#Choosing an Ensemble [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Ensembles link] &lt;br /&gt;
#Equilibration and production simulations [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/EquilibrationandProduction link] &lt;br /&gt;
#Energy Drift [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/EnergyDrift link] &lt;br /&gt;
#Voids in ILs[https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/voids link] &lt;br /&gt;
#How to equilibrate an MD run[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/equilibration link] &lt;br /&gt;
#Equilibration of [bmim][BF4] and [bmim][NO3][https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/BmimBF4_equilibration link] &lt;br /&gt;
#Summary of discussions with Ruth[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/Aug09QtoRuth link]&lt;br /&gt;
&lt;br /&gt;
===Running QM/MM Simulations in ChemShell===&lt;br /&gt;
#ChemShell official website which contains the manual and a tutorial [http://www.stfc.ac.uk/CSE/randd/ccg/36254.aspx link]&lt;br /&gt;
#Introduction to ChemShell - Copper in water [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_Introduction link]&lt;br /&gt;
#Defining the system: Cu&amp;lt;sup&amp;gt;2+&amp;lt;/sup&amp;gt; and its first 2 solvation shells [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_System_Aqeuous_Cu(II) link] &lt;br /&gt;
#Defining the force field parameters [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_Force_Field_Parameters_Aqueous_Cu(II) link] &lt;br /&gt;
#Single point QM/MM energy calculation [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_SP_Aqeuous_Cu(II) link] &lt;br /&gt;
#QM/MM Optimisation [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_OPT_Aqeuous_Cu(II) link] &lt;br /&gt;
#QM/MM Molecular Dynamics [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_MD_Aqeuous_Cu(II) link]&lt;br /&gt;
&lt;br /&gt;
===Research Notes===&lt;br /&gt;
#Cl- in water [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/wannier_centre link] &lt;br /&gt;
#The use of Legendre time correlation functions to study reorientational dynamics in liquids[https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/legendre  link] &lt;br /&gt;
#Functional for ILs using CPMD [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/IL_cpmd_functional link] &lt;br /&gt;
#Solving the angular part of the Schrödinger equation for a hydrogen atom [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/angular_schrodinger link] (notes by Vincent)&lt;br /&gt;
#Conformational scan for ion-pair dimers [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ion_pair_scan link]&lt;br /&gt;
&lt;br /&gt;
===Installing and using other packages===&lt;br /&gt;
#How to install POLYRATE [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/polyrate link] &lt;br /&gt;
#How to install Geomview [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/geomview link] &lt;br /&gt;
#XMGRACE, gfortran, c compilers for Lion [http://hpc.sourceforge.net/]&lt;br /&gt;
&lt;br /&gt;
===Admin Stuff===&lt;br /&gt;
#Not used to writing a wiki, make your test runs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/testing  on this page]&lt;br /&gt;
#How to set-up new macs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/mac_setup link]&lt;br /&gt;
#How to set-up remote desktop [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/mac_remote link]&lt;br /&gt;
#[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/calendar Calendar]&lt;br /&gt;
#Demonstrating in the 3rd year computational chemistry lab [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/compchemlab  Timetable]&lt;br /&gt;
#How to switch the printer HP CP3525dn duplex on and off [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/printing link]&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group&amp;diff=442384</id>
		<title>Mod:Hunt Research Group</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group&amp;diff=442384"/>
		<updated>2014-09-05T14:47:14Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* Research Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Hunt Group Wiki==&lt;br /&gt;
&lt;br /&gt;
Back to the main [http://www.ch.ic.ac.uk/hunt web-page]&lt;br /&gt;
===HPC Resources===&lt;br /&gt;
#Computing resources available in the chemistry department [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/computing_resources link]&lt;br /&gt;
#HPC servers and run scripts [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc link]&lt;br /&gt;
#Setting up a connection to HPC if you have a PC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc_connections link] &lt;br /&gt;
#How to fix Windows files under UNIX [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/Windowsfiles link] &lt;br /&gt;
#How to make ssh more comfortable [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/pimpSSH link] &lt;br /&gt;
#How to make qsub more comfortable (gfunc) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/pimpQSUB link] &lt;br /&gt;
#How to set up a SSH keypair [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/SSHkeyfile link] &lt;br /&gt;
#How to use gaussview directly on the HPC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/gview link] &lt;br /&gt;
#How to comfortably search through old BASH commands [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/searchbash link]&lt;br /&gt;
#How to connect to HPC directory on desktop for file transfers [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/hpc_Directory_on_desktop link]&lt;br /&gt;
#How to set up cx2 [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cx2 link]&lt;br /&gt;
&lt;br /&gt;
===Visualisation===&lt;br /&gt;
*&#039;&#039;&#039;ESPs&#039;&#039;&#039;&lt;br /&gt;
#Instructions for visualizing electrostatic potentials (Gaussview)[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/electrostatic_potentials link]&lt;br /&gt;
#Electrostatic Potentials II (Molden) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/electrostatic_potentials_2 link] &lt;br /&gt;
*&#039;&#039;&#039;VMD&#039;&#039;&#039;&lt;br /&gt;
#Beginners guide to VMD: a molecular dynamics visualisation package [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/vmd link]&lt;br /&gt;
#Visualising your Simulation [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/VisualisingyourSimulation link] &lt;br /&gt;
#How to turn a Gaussian optimization into a VMD movie [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/VMDmovie link] &lt;br /&gt;
#How to make VMD trajectory repeated periodically [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/vmd link]&lt;br /&gt;
*&#039;&#039;&#039;JMol&#039;&#039;&#039;&lt;br /&gt;
#Visualising MOs using Jmol [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:basic_jmol_instructions link]&lt;br /&gt;
#Surfaces (Solvent-Accessible and Connolly) in Jmol [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/jmolsurfaces link]&lt;br /&gt;
*&#039;&#039;&#039;EMO Code&#039;&#039;&#039;&lt;br /&gt;
#How to use Ling&#039;s emo plot code[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emoplot link] &lt;br /&gt;
#How to plot EMOs [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emo link]&lt;br /&gt;
&lt;br /&gt;
===Gaussian General===&lt;br /&gt;
#A database of common errors encountered when running Gaussian jobs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/gaussian_errors link]&lt;br /&gt;
# [http://www.ch.ic.ac.uk/hunt/g03_man/index.htm G03 Manual]&lt;br /&gt;
#How to run NBO5.9 on the HPC [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/NBO5.9 link] &lt;br /&gt;
#How to include dispersion [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/dispersion link] &lt;br /&gt;
#Basic ONIOM (Mechanical Embedding) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/basiconiom link]&lt;br /&gt;
#M0n and DFT-D [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/DFTD link]&lt;br /&gt;
#IL ONIOM clusters [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/oniomclusers link]&lt;br /&gt;
#Molecular volume calculations [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Mod:Hunt_Research_Group/molecular_volume link]&lt;br /&gt;
#problems with scf convergence [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/scf_convergence link]&lt;br /&gt;
&lt;br /&gt;
===Setup and Running Ab-Initio MD Simulations===&lt;br /&gt;
#CPMD: Car-Parrinello Molecular Dynamics [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/cpmd link]&lt;br /&gt;
#How to run CPMD to study aqueous solutions [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/cpmd_water link]&lt;br /&gt;
#How to run CP2K [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cp2k_how link] &lt;br /&gt;
#[bmim]Cl using CPMD [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/bmimCl_cpmd  link] &lt;br /&gt;
#[bmim]Cl using CP2K [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/bmimCl_cp2k  link] &lt;br /&gt;
#mman using CPMD and Gaussian [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/mman link] &lt;br /&gt;
#[emim]SCN using CP2K[https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/emimscn link] &lt;br /&gt;
#CP2K Donts [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/cp2k link] &lt;br /&gt;
&lt;br /&gt;
===Setup and Running Classical MD Simulations===&lt;br /&gt;
#DLPOLY a MD simulation package, Installation on an IMac (old needs to be updated) [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/dlpoly_install  link]&lt;br /&gt;
#DL_POLY FAQs [http://www.stfc.ac.uk/cse/DL_POLY/ccp1gui/38621.aspx] from DL_POLY webpage.&lt;br /&gt;
#Packmol for generating starting configurations [http://www.ime.unicamp.br/~martinez/packmol/] from Packmol webpage.&lt;br /&gt;
#Getting started: generating a solvated structure and &amp;quot;relaxing&amp;quot; it [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Starting_MD link] &lt;br /&gt;
#local [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/packmol_to_dlpoly_scripts packmol to dlpoly] conversion scripts&lt;br /&gt;
#Getting the Force Field [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Wheretostart link] &lt;br /&gt;
#Choosing an Ensemble [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/Ensembles link] &lt;br /&gt;
#Equilibration and production simulations [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/EquilibrationandProduction link] &lt;br /&gt;
#Energy Drift [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/EnergyDrift link] &lt;br /&gt;
#Voids in ILs[https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/voids link] &lt;br /&gt;
#How to equilibrate an MD run[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/equilibration link] &lt;br /&gt;
#Equilibration of [bmim][BF4] and [bmim][NO3][https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/BmimBF4_equilibration link] &lt;br /&gt;
#Summary of discussions with Ruth[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/Aug09QtoRuth link]&lt;br /&gt;
&lt;br /&gt;
===Running QM/MM Simulations in ChemShell===&lt;br /&gt;
#ChemShell official website which contains the manual and a tutorial [http://www.stfc.ac.uk/CSE/randd/ccg/36254.aspx link]&lt;br /&gt;
#Introduction to ChemShell - Copper in water [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_Introduction link]&lt;br /&gt;
#Defining the system: Cu&amp;lt;sup&amp;gt;2+&amp;lt;/sup&amp;gt; and its first 2 solvation shells [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_System_Aqeuous_Cu(II) link] &lt;br /&gt;
#Defining the force field parameters [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/ChemShell_Force_Field_Parameters_Aqueous_Cu(II) link] &lt;br /&gt;
#Single point QM/MM energy calculation [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_SP_Aqeuous_Cu(II) link] &lt;br /&gt;
#QM/MM Optimisation [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_OPT_Aqeuous_Cu(II) link] &lt;br /&gt;
#QM/MM Molecular Dynamics [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/QMMM_MD_Aqeuous_Cu(II) link]&lt;br /&gt;
&lt;br /&gt;
===Research Notes===&lt;br /&gt;
#Cl- in water [https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/wannier_centre link] &lt;br /&gt;
#The use of Legendre time correlation functions to study reorientational dynamics in liquids[https://www.ch.ic.ac.uk/wiki/index.php/Talk:Mod:Hunt_Research_Group/legendre  link] &lt;br /&gt;
#Functional for ILs using CPMD [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/IL_cpmd_functional link] &lt;br /&gt;
#Solving the angular part of the Schrödinger equation for a hydrogen atom [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/angular_schrodinger link] (notes by Vincent)&lt;br /&gt;
#Conformational scan for ion-pair dimers [https://wiki.ch.ic.ac.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/angular_schrodinger link]&lt;br /&gt;
&lt;br /&gt;
===Installing and using other packages===&lt;br /&gt;
#How to install POLYRATE [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/polyrate link] &lt;br /&gt;
#How to install Geomview [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/geomview link] &lt;br /&gt;
#XMGRACE, gfortran, c compilers for Lion [http://hpc.sourceforge.net/]&lt;br /&gt;
&lt;br /&gt;
===Admin Stuff===&lt;br /&gt;
#Not used to writing a wiki, make your test runs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/testing  on this page]&lt;br /&gt;
#How to set-up new macs [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/mac_setup link]&lt;br /&gt;
#How to set-up remote desktop [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/mac_remote link]&lt;br /&gt;
#[https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/calendar Calendar]&lt;br /&gt;
#Demonstrating in the 3rd year computational chemistry lab [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/compchemlab  Timetable]&lt;br /&gt;
#How to switch the printer HP CP3525dn duplex on and off [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group/printing link]&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442319</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442319"/>
		<updated>2014-08-04T13:19:40Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=15800&lt;br /&gt;
MAXDISK=400&lt;br /&gt;
WALLT=&amp;quot;499:00:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
GREEN=&#039;\033[0;32m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			save			save the list of the current jobs&lt;br /&gt;
			load			call the list of the jobs saved and highlight in red the ended ones&lt;br /&gt;
			verify.date[mm_dd_yy]&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent&lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${FL}&lt;br /&gt;
	if [[ ${FL} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=499:00:00&lt;br /&gt;
#PBS -l select=1:ncpus=8:mem=15800MB:tmpspace=400GB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;15800MB;499:00:00;d01;400GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;15800MB;499:00:00;d01;400GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;400&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;15800&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;400&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;15800&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $q =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
			    else&lt;br /&gt;
				echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} =~ &#039;save&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			rm ~/$(date +&#039;.%m_%d_%y&#039;) &lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $q =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				echo -e &amp;quot;$line&amp;quot; &amp;gt;&amp;gt; ~/$(date +&#039;.%m_%d_%y&#039;) &lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
			cp ~/$(date +&#039;.%m_%d_%y&#039;) ~/.current&lt;br /&gt;
		elif [[ ${OPTARG} =~ &#039;load&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			v=$(cat ~/.current)&lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $v =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				if [[ ! $q =~ $n ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
				fi&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} =~ &#039;verify&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			v=$(cat ~/${OPTARG#verify})&lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $v =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				if [[ ! $q =~ $n ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
				fi&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} == &#039;edit&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
                        &lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG | while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $q =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
			    else&lt;br /&gt;
				echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
			    fi&lt;br /&gt;
			done&lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}GB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        FL=${1}&lt;br /&gt;
	ID=$(ID ${FL});&lt;br /&gt;
	FNT=${ID}&#039;.com&#039;&lt;br /&gt;
	if [[ -f ${FNT} &amp;amp;&amp;amp; ${#FNT} -gt 4 ]]&lt;br /&gt;
        then&lt;br /&gt;
		FL=${ID}.com&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
	NMFL=${FL%.com}  &lt;br /&gt;
	NMFL=${NMFL##*/}&lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${FL} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
	elif [[ ! ${FL} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
	echo $FL      &lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
		GMEM=$((${MEM} - 50*CORE))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${FL})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${FL})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${FL}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${FL}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}GB/&amp;quot; ${FL##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${FL}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442318</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442318"/>
		<updated>2014-08-04T12:52:57Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=15800&lt;br /&gt;
MAXDISK=400&lt;br /&gt;
WALLT=&amp;quot;499:00:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
GREEN=&#039;\033[0;32m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			save			save the list of the current jobs&lt;br /&gt;
			load			call the list of the jobs saved and highlight in red the ended ones&lt;br /&gt;
			verify.date[mm_dd_yy]&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent&lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${FL}&lt;br /&gt;
	if [[ ${FL} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=499:00:00&lt;br /&gt;
#PBS -l select=1:ncpus=8:mem=15800MB:tmpspace=400GB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;15800MB;499:00:00;d01;400GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;15800MB;499:00:00;d01;400GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;400&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;15800&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;400&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;15800&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $q =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
			    else&lt;br /&gt;
				echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} =~ &#039;save&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			rm ~/$(date +&#039;.%m_%d_%y&#039;) &lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $q =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				echo -e &amp;quot;$line&amp;quot; &amp;gt;&amp;gt; ~/$(date +&#039;.%m_%d_%y&#039;) &lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
			cp ~/$(date +&#039;.%m_%d_%y&#039;) ~/.current&lt;br /&gt;
		elif [[ ${OPTARG} =~ &#039;load&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			v=$(cat ~/.current)&lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $v =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				if [[ ! $q =~ $n ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
				fi&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} =~ &#039;verify&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			v=$(cat ~/${OPTARG#verify})&lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $v =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				if [[ ! $q =~ $n ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
				fi&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} == &#039;edit&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
                        &lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG | while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $q =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
			    else&lt;br /&gt;
				echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}GB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        FL=${1}&lt;br /&gt;
	ID=$(ID ${FL});&lt;br /&gt;
	FNT=${ID}&#039;.com&#039;&lt;br /&gt;
	if [[ -f ${FNT} &amp;amp;&amp;amp; ${#FNT} -gt 4 ]]&lt;br /&gt;
        then&lt;br /&gt;
		FL=${ID}.com&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
	NMFL=${FL%.com}  &lt;br /&gt;
	NMFL=${NMFL##*/}&lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${FL} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
	elif [[ ! ${FL} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
	echo $FL      &lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
		GMEM=$((${MEM} - 50*CORE))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${FL})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${FL})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${FL}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${FL}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}GB/&amp;quot; ${FL##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${FL}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442317</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442317"/>
		<updated>2014-08-04T10:48:15Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=15800&lt;br /&gt;
MAXDISK=400&lt;br /&gt;
WALLT=&amp;quot;499:00:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${FL}&lt;br /&gt;
	if [[ ${FL} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=499:00:00&lt;br /&gt;
#PBS -l select=1:ncpus=8:mem=15800MB:tmpspace=400GB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;15800MB;499:00:00;d01;400GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;15800MB;499:00:00;d01;400GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;400&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;15800&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;400&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;15800&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			rm ~/$(date +&#039;.%m_%d_%y&#039;) &lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $q =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
				echo -e &amp;quot;$line&amp;quot; &amp;gt;&amp;gt; ~/$(date +&#039;.%m_%d_%y&#039;) &lt;br /&gt;
			    else&lt;br /&gt;
				echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} =~ &#039;verify&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			q=$(qstat); &lt;br /&gt;
			v=$(cat ~/${OPTARG#verify})&lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    n=${line%.cx1b*}&lt;br /&gt;
			    n=${n##* | }&lt;br /&gt;
			    if [[ $v =~ $n ]]&lt;br /&gt;
			    then&lt;br /&gt;
				if [[ ! $q =~ $n ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo -e &amp;quot;$RED$line&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					echo -e &amp;quot;$NC$line&amp;quot;&lt;br /&gt;
				fi&lt;br /&gt;
			    fi&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} == &#039;edit&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
                        sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG | while read x; do echo -e $x; done; &lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}GB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        FL=${1}&lt;br /&gt;
	ID=$(ID ${FL});&lt;br /&gt;
	FNT=${ID}&#039;.com&#039;&lt;br /&gt;
	if [[ -f ${FNT} &amp;amp;&amp;amp; ${#FNT} -gt 4 ]]&lt;br /&gt;
        then&lt;br /&gt;
		FL=${ID}.com&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
	NMFL=${FL%.com}  &lt;br /&gt;
	NMFL=${NMFL##*/}&lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${FL} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
	elif [[ ! ${FL} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
	echo $FL      &lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
		GMEM=$((${MEM} - 50*CORE))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${FL})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${FL})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${FL}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${FL}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}GB/&amp;quot; ${FL##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${FL}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442313</id>
		<title>Mod:Hunt Research Group/calendar</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442313"/>
		<updated>2014-07-31T13:36:09Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* Calendar */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
== Calendar ==&lt;br /&gt;
&lt;br /&gt;
*Tricia (Not Done)&lt;br /&gt;
*Abdihakim Hassan (Not Done)&lt;br /&gt;
*Bryan Ward (Not Done)&lt;br /&gt;
*Claire Ashworth (Not Done)&lt;br /&gt;
*Matthew Clough (Done)&lt;br /&gt;
*Precious Ugbomah (Not Done)&lt;br /&gt;
*Richard Matthews (Not Done) &lt;br /&gt;
*Vincent Chen (Not Done)&lt;br /&gt;
*Gabriel Lau (Not Done)&lt;br /&gt;
*Rebecca Rowe (Not Done)&lt;br /&gt;
*Patricia Ho (Done)&lt;br /&gt;
*Giacomo Damilano (Not Done)&lt;br /&gt;
*Richard Fogarty (Not Done)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; width=&amp;quot;1190&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr bgcolor=&amp;quot;#66CCFF&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Mon&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Tues&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Wed&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Thur&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Fri&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sat&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sun&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st June&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&#039;&#039;&#039;(Richard F - paper)&#039;&#039;&#039;&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;br&amp;gt;(Patricia away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Patricia away)&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;br&amp;gt;(Richard F away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Patricia away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Matt - paper)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;LIBLICE conference-Gabriel &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Hakim-presentation practice)&#039;&#039;&#039;&amp;lt;br&amp;gt;LIBLICE conference-Gabriel &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;LIBLICE conference-Gabriel &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;LIBLICE conference-Gabriel &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;LIBLICE conference-Gabriel &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Talk practice)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#FFA500&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&#039;&#039;&#039;End of term&#039;&#039;&#039;&amp;lt;br&amp;gt;Richard F away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;(Richard F away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot; &amp;gt;1st July&amp;lt;br&amp;gt;{{fontcolor|#FFD700|&#039;&#039;&#039;PhD Symposium (Chem.)&#039;&#039;&#039;}}&amp;lt;br&amp;gt;(Richard F away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;(Richard F away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;EUCHEM-Richard&amp;amp;Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;br&amp;gt;Vincent away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;Claire away&amp;lt;br&amp;gt;Vincent away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;Liquid Matter-Gabriel&amp;lt;br&amp;gt;Vincent away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;Liquid Matter-Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan &amp;lt;br&amp;gt; Liquid Matter-Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan &amp;lt;br&amp;gt; Liquid Matter-Gabriel &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;Liquid Matter-Gabriel &amp;lt;br&amp;gt; jacq away &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt; jacq away &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt; jacq away &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt; jacq away &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;31st&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td  bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st August&amp;lt;br&amp;gt;Bryan Away&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;Matthew Away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;25th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;27th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;39th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st September&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;Bryan on hiatus&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st October&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/mac_remote&amp;diff=442312</id>
		<title>Mod:Hunt Research Group/mac remote</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/mac_remote&amp;diff=442312"/>
		<updated>2014-07-31T13:35:52Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
==== set-up system preferences on your office mac ====&lt;br /&gt;
:This only works without a firewall&lt;br /&gt;
:System Preferences -&amp;gt; Sharing -&amp;gt; Remote Management.&lt;br /&gt;
::Allow access for &amp;quot;only these users&amp;quot; and set appropriate limits&lt;br /&gt;
:You can then access the remote mac through the Finder on the sidebar under the Shared browser. &lt;br /&gt;
::This will show you all the machines on your local network that have sharing on.  Click on the mac you want to connect to, don&#039;t worry that is &amp;quot;connects&amp;quot; you only as guest when you use the share screen button this will connect you as a particular user and not guest.&lt;br /&gt;
&lt;br /&gt;
==== screen sharing through a firewall ==== &lt;br /&gt;
:you need a VNC viewer on your home mac&lt;br /&gt;
:: common client is chicken of the VNC (free) http://sourceforge.net/projects/cotvnc/&lt;br /&gt;
: start up a VNC client (and thats all you need to do!)&lt;br /&gt;
:: in Applications &amp;quot;Chicken of the VNC.app&amp;quot;&lt;br /&gt;
:you may need the IP address of your office mac&lt;br /&gt;
:: in which case ssh into the machine&lt;br /&gt;
:: type &amp;quot;/sbin/ifconfig&amp;quot;&lt;br /&gt;
:: in the list that follows you want the number after &amp;quot;inet&amp;quot;&lt;br /&gt;
:so you went to fullscreen and cannot recover supposedly (none of these worked for me)&lt;br /&gt;
::ctrl+alt+cmd+&#039;&lt;br /&gt;
::or ctrl+alt+cmd+shift+&#039;&lt;br /&gt;
::or ctrl+alt+cmd+§&lt;br /&gt;
:so the remote screen is much larger than your current screen, use window zoom and then try to resize&lt;br /&gt;
::the green dot in the mac window will resize any window to the whole screen if you loose the edges (if its not working as in iTunes, hold the option key and then the green button)&lt;br /&gt;
&lt;br /&gt;
==== to start an application remotely using ssh ====&lt;br /&gt;
:use the terminal application&lt;br /&gt;
:ssh in, ie user@mac.ch.ic.ac.uk&lt;br /&gt;
::enter password&lt;br /&gt;
:then cd to Applications and type &amp;quot;open application&amp;quot;&lt;br /&gt;
::the application will then run on the remote mac&lt;br /&gt;
&lt;br /&gt;
==== screen sharing without setting up system pref beforehand ====&lt;br /&gt;
: CAREFUL! only do this if you know about using terminal commands&lt;br /&gt;
: ssh into the remote (office) mac with an admin login&lt;br /&gt;
: enable the remote management via the kickstart utility&lt;br /&gt;
: for help &lt;br /&gt;
:: &amp;lt;code&amp;gt;$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help&amp;lt;/code&amp;gt;&lt;br /&gt;
:options (uninstall/install, deactivate/activate, configure, stop/restart)&lt;br /&gt;
:these then have sub-options&lt;br /&gt;
:: use &amp;quot;-restart -agent&amp;quot; to restart&lt;br /&gt;
::: &amp;quot;-agent&amp;quot; restarts the ARD agent and helper&lt;br /&gt;
::: &amp;quot;-console&amp;quot; restarts the console application&lt;br /&gt;
::: &amp;quot;-menu&amp;quot; restarts the menu extra&lt;br /&gt;
:to set the configure options&lt;br /&gt;
:: use &amp;quot;-configure -access -on&amp;quot; to enable access for all users&lt;br /&gt;
:: use &amp;quot;-configure -access -off&amp;quot; to disable access for all users&lt;br /&gt;
:access privlages (delete files, control and observe, open and quit applications etc)&lt;br /&gt;
:: use &amp;quot;-users admin -privs -all&amp;quot; to enable all access privileges for all admin users&lt;br /&gt;
:: use &amp;quot;-users guest -privs -none&amp;quot; to disable all access privileges for specified user=guest&lt;br /&gt;
:access options&lt;br /&gt;
:: use &amp;quot;-allowAccessFor -specifiedUsers&amp;quot; grant access to users with privileges&lt;br /&gt;
:: use &amp;quot;-clientopts -setvnclegacy -vnclegacy yes&amp;quot; allow VNC legacy password mode&lt;br /&gt;
:: use &amp;quot;-clientopts -setvncpw -vncpw mypasswd&amp;quot; set VNC legacy password, this should be a new password not your login one.&lt;br /&gt;
&lt;br /&gt;
:Activate Remote Desktop Sharing, enable access privileges for all users, restart ARD Agent&lt;br /&gt;
:::&amp;lt;code&amp;gt;$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -privs -all -restart -agent&amp;lt;/code&amp;gt;&lt;br /&gt;
:Activate Remote Desktop Sharing, enable access privileges for the users &amp;quot;admin&amp;quot;, grant full privileges for the users &amp;quot;admin&amp;quot;, restart ARD Agent and Menu extra&lt;br /&gt;
:::&amp;lt;code&amp;gt;$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -privs -all -restart -agent -menu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:turn on the screen sharing&lt;br /&gt;
::&amp;lt;code&amp;gt;$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -privs -all -restart -agent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:when you are done turn off the screen sharing&lt;br /&gt;
::&amp;lt;code&amp;gt;$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/mac_setup&amp;diff=442311</id>
		<title>Mod:Hunt Research Group/mac setup</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/mac_setup&amp;diff=442311"/>
		<updated>2014-07-31T13:35:21Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
==== make a group ====&lt;br /&gt;
::open accounts in system prefs&lt;br /&gt;
::click on the + button&lt;br /&gt;
::choose groups on pulldown menu&lt;br /&gt;
::type in a name and add those users you want to belong to the group&lt;br /&gt;
::in this case call the group &amp;quot;hunt_group&amp;quot;&lt;br /&gt;
::exit&lt;br /&gt;
&lt;br /&gt;
==== set-up the terminal ====&lt;br /&gt;
::create the file &amp;quot;.bash_profile&amp;quot; &lt;br /&gt;
::copy and paste the following into it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#echo &amp;quot;bash_profile&amp;quot;&lt;br /&gt;
. ~/.bashrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::create the file &amp;quot;.bashrc&amp;quot;&lt;br /&gt;
::copy and paste the following into it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# .bashrc&lt;br /&gt;
# WARNING: had to make .bash_profile and added  execute to this file&lt;br /&gt;
#&lt;br /&gt;
#  important stuff&lt;br /&gt;
#&lt;br /&gt;
# tells the computer where to look for personal scripts&lt;br /&gt;
   export PATH=$PATH:/Users/$USER/bin:/usr/local/bin&lt;br /&gt;
#&lt;br /&gt;
# change the prompt&lt;br /&gt;
   export PS1=&amp;quot;[\$USER@\h]\$PWD \$ &amp;quot;&lt;br /&gt;
#&lt;br /&gt;
# control-R lets you search backward through history&lt;br /&gt;
   HISTSIZE=100&lt;br /&gt;
   HISTCONTROL=erasedups&lt;br /&gt;
   HISTIGNORE=&amp;quot;cd:exit&amp;quot;&lt;br /&gt;
   EDITOR=vi&lt;br /&gt;
   export EDITOR&lt;br /&gt;
#&lt;br /&gt;
#  gaussian&lt;br /&gt;
#&lt;br /&gt;
# where to fine the executable&lt;br /&gt;
   export g09root=&amp;quot;/Applications&amp;quot;&lt;br /&gt;
# set the default memory&lt;br /&gt;
   export GAUSS_MEMDEF=&amp;quot;500MB&amp;quot;&lt;br /&gt;
# where to put the LARGE temporary files when running gaussian&lt;br /&gt;
   export GAUSS_SCRDIR=&amp;quot;/Users/$USER/Work/Jobs/tmp&amp;quot;&lt;br /&gt;
# script which sets many variables for gaussian&lt;br /&gt;
   source $g09root/g09/bsd/g09.profile&lt;br /&gt;
#&lt;br /&gt;
#   gaussview&lt;br /&gt;
#&lt;br /&gt;
# where to find gaussview&lt;br /&gt;
   export GV_DIR=&amp;quot;/Applications/gv&amp;quot;&lt;br /&gt;
# libraries &lt;br /&gt;
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GV_DIR}/lib&lt;br /&gt;
# allow start from the comand line in mac terminal&lt;br /&gt;
   alias gv=&amp;quot;open $GV_DIR/gview.app&amp;quot;&lt;br /&gt;
#  &lt;br /&gt;
#  alias definitions            &lt;br /&gt;
#&lt;br /&gt;
   alias home=&amp;quot;cd&amp;quot;&lt;br /&gt;
   alias force=&amp;quot;grep -i &#039;Maximum Force&#039;&amp;quot;&lt;br /&gt;
   alias dist=&amp;quot;grep -i &#039;Maximum Disp&#039;&amp;quot;&lt;br /&gt;
   alias rm=&#039;rm -I&#039;&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::create the file &amp;quot;.login&amp;quot; &lt;br /&gt;
::this is needed because gaussview looks for csh stuff&lt;br /&gt;
::copy and paste the following into it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv g09root /Applications&lt;br /&gt;
source $g09root/g09/bsd/g09.login&lt;br /&gt;
setenv GAUSS_SCRDIR /Users/$USER/Work/Jobs/tmp&lt;br /&gt;
setenv GV_DIR /Applications/gv&lt;br /&gt;
setenv GAUSS_EXEDIR /Applications/g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::of course replace my name with your name (or directory structure)&lt;br /&gt;
::and the directory tmp should exist before you run any jobs.&lt;br /&gt;
&lt;br /&gt;
==== set-up working directories ====&lt;br /&gt;
::make a directory called &amp;quot;work&amp;quot;, keep ALL your files here&lt;br /&gt;
::inside work make a directory called &amp;quot;jobs&amp;quot;, keep all your gaussian jobs here&lt;br /&gt;
::inside work make a directory called &amp;quot;testing&amp;quot; ie full path is /Users/name/work/jobs/testing &lt;br /&gt;
::vi a file &amp;quot;test.com&amp;quot; and copy and paste the following into it&lt;br /&gt;
::ps don&#039;t forget the last line must be blank&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%chk=test.chk&lt;br /&gt;
%mem=500MB&lt;br /&gt;
%nproc=1&lt;br /&gt;
# hf/3-21g geom=connectivity&lt;br /&gt;
&lt;br /&gt;
Title Card Required&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 C&lt;br /&gt;
 H                  1              B1&lt;br /&gt;
 H                  1              B2    2              A1&lt;br /&gt;
 H                  1              B3    3              A2    2              D1&lt;br /&gt;
 H                  1              B4    3              A3    2              D2&lt;br /&gt;
&lt;br /&gt;
   B1             1.07000000&lt;br /&gt;
   B2             1.07000000&lt;br /&gt;
   B3             1.07000000&lt;br /&gt;
   B4             1.07000000&lt;br /&gt;
   A1           109.47120255&lt;br /&gt;
   A2           109.47125080&lt;br /&gt;
   A3           109.47121829&lt;br /&gt;
   D1          -119.99998525&lt;br /&gt;
   D2           120.00000060&lt;br /&gt;
&lt;br /&gt;
 1 2 1.0 3 1.0 4 1.0 5 1.0&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== install gaussian ====&lt;br /&gt;
::insert the CD&lt;br /&gt;
::double click on the .dmg file&lt;br /&gt;
::a CDROM disk icon will appear&lt;br /&gt;
::in a terminal window cd /Volumes/CDROM (or name of CD)&lt;br /&gt;
::read the &amp;quot;readme&amp;quot; file&lt;br /&gt;
::change to the cshell&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
csh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::tell the script where gaussian (G09) is to be installed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    setenv g09root &amp;quot;/Applications&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::now goto the g03root directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    cd $g09root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::read the CD&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /Volumes/CDROM/tar/*.tgz | zcat | tar xvf -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::this will unpack and copy the contents of the CD, you should see a stream of file names, when this stops and the prompt returns&lt;br /&gt;
::ensure that the group permissions are set&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chgrp -R gaussian g09 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::check this has worked, type &amp;quot;ls -al&amp;quot;&lt;br /&gt;
::you should see a list with the following&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
drwxr-x---  154 name  hunt_group   5236  1 Nov  2007 g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::goto the gaussian directory and run the install script&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd g09&lt;br /&gt;
./bsd/install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::eject the disk&lt;br /&gt;
::you are not quite ready to run as the variables g09root, GAUSS_SCRDIR and the g09.login script need to be set in your .bashrc file ... this was done in the terminal instructions above&lt;br /&gt;
:: you may also want to get rid of the pesky error &amp;quot;-bash: ulimit: open files: cannot modify limit: Invalid argument&amp;quot; which shows up because you have asked &amp;quot;source $g09root/g09/bsd/g09.profile&amp;quot; in your .bashrc&lt;br /&gt;
:::goto the direcotry g09/bsd&lt;br /&gt;
:::edit the file g09.profile, goto the end and hash out the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#turned off by tricia to stop error message&lt;br /&gt;
#ulimit -n hard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::now you are ready to run a test job&lt;br /&gt;
:::nohup means don&#039;t stop if you logout&lt;br /&gt;
:::the trailing &amp;amp; means run in the background&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd work/jobs/testing&lt;br /&gt;
nohup g09 test &amp;amp; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::ls to see that the job is running and that test.chk and test.log files are being generated.&lt;br /&gt;
::check that the job finishes ok&lt;br /&gt;
&lt;br /&gt;
==== install gaussview ====&lt;br /&gt;
=====getting ready=====&lt;br /&gt;
::insert the CD&lt;br /&gt;
::double click on the .dmg file&lt;br /&gt;
::a CDROM disk icon will appear&lt;br /&gt;
::in a terminal window cd /Volumes/CDROM (or name of CD)&lt;br /&gt;
::read the &amp;quot;readme&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
=====do the install=====&lt;br /&gt;
::change to the cshell&lt;br /&gt;
::tell the script where the cd is mounted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    csh&lt;br /&gt;
    setenv g09root &amp;quot;/Applications&amp;quot;&lt;br /&gt;
    cd $g09root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::now read and unpack the CD&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /Volumes/CDROM/tar/*.tgz | zcat | tar xvf -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::change the group premisions to the same as those for g09&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chgrp -R gaussian gv &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::eject the disk&lt;br /&gt;
&lt;br /&gt;
::gaussview uses csh, so you need to have a .login if you want to run from the launcher&lt;br /&gt;
::check that you have the following in your .login&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv g09root /Applications&lt;br /&gt;
source $g09root/g09/bsd/g09.login&lt;br /&gt;
setenv GAUSS_SCRDIR /Users/tricia/Work/tmp&lt;br /&gt;
setenv GV_DIR /Applications/gv&lt;br /&gt;
setenv GAUSS_EXEDIR /Applications/g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====set-up quick starting of gaussview=====&lt;br /&gt;
::goto the Applications folder and click on the gv folder&lt;br /&gt;
::drag the gaussview icon into the launcher&lt;br /&gt;
::double click to start gaussview&lt;br /&gt;
::if you get an error saying that it cannot find gaussian directories then&lt;br /&gt;
:::cd to the gv directory&lt;br /&gt;
:::cd into the data directory&lt;br /&gt;
:::edit the gpath.txt file (and give the correct path to the g03 application)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/Applications/g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:::quit gaussview and then restart it, your problem should be fixed&lt;br /&gt;
&lt;br /&gt;
=====set-up preferences=====&lt;br /&gt;
::now we need to set some directories in the preferences of gaussview&lt;br /&gt;
::click on preferences&lt;br /&gt;
::choose the &amp;quot;File?Directory&amp;quot; option&lt;br /&gt;
::under the starting directory, choose Specify, click on the &amp;quot;...&amp;quot; button and pick your work/jobs directory&lt;br /&gt;
::under the scratch directory, choose &amp;quot;Use GAUSS_SCRDIR&amp;quot;&lt;br /&gt;
=====test run a job=====&lt;br /&gt;
::start X11 (this is in Applications/Utilities folder, drag the X11 app to a launcher)&lt;br /&gt;
::type &amp;quot;gv&amp;quot; in the window (and press return)&lt;br /&gt;
::choose &amp;quot;open&amp;quot; and goto your /work/jobs/testing directory, open your test.com file&lt;br /&gt;
::submit it to run (save as test_1.com) so that you don&#039;t overwrite the other test job&lt;br /&gt;
::check that it finishes OK&lt;br /&gt;
::open your test molecule&#039;s com file&lt;br /&gt;
&lt;br /&gt;
==== set-up easy remote connections ====&lt;br /&gt;
::create the file &amp;quot;config&amp;quot; in your home/.ssh directory&lt;br /&gt;
::see heiko&#039;s notes for what to put in it.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/mac_setup&amp;diff=442310</id>
		<title>Mod:Hunt Research Group/mac setup</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/mac_setup&amp;diff=442310"/>
		<updated>2014-07-31T13:33:26Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* set-up the terminal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== make a group ====&lt;br /&gt;
::open accounts in system prefs&lt;br /&gt;
::click on the + button&lt;br /&gt;
::choose groups on pulldown menu&lt;br /&gt;
::type in a name and add those users you want to belong to the group&lt;br /&gt;
::in this case call the group &amp;quot;hunt_group&amp;quot;&lt;br /&gt;
::exit&lt;br /&gt;
&lt;br /&gt;
==== set-up the terminal ====&lt;br /&gt;
::create the file &amp;quot;.bash_profile&amp;quot; &lt;br /&gt;
::copy and paste the following into it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#echo &amp;quot;bash_profile&amp;quot;&lt;br /&gt;
. ~/.bashrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::create the file &amp;quot;.bashrc&amp;quot;&lt;br /&gt;
::copy and paste the following into it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# .bashrc&lt;br /&gt;
# WARNING: had to make .bash_profile and added  execute to this file&lt;br /&gt;
#&lt;br /&gt;
#  important stuff&lt;br /&gt;
#&lt;br /&gt;
# tells the computer where to look for personal scripts&lt;br /&gt;
   export PATH=$PATH:/Users/$USER/bin:/usr/local/bin&lt;br /&gt;
#&lt;br /&gt;
# change the prompt&lt;br /&gt;
   export PS1=&amp;quot;[\$USER@\h]\$PWD \$ &amp;quot;&lt;br /&gt;
#&lt;br /&gt;
# control-R lets you search backward through history&lt;br /&gt;
   HISTSIZE=100&lt;br /&gt;
   HISTCONTROL=erasedups&lt;br /&gt;
   HISTIGNORE=&amp;quot;cd:exit&amp;quot;&lt;br /&gt;
   EDITOR=vi&lt;br /&gt;
   export EDITOR&lt;br /&gt;
#&lt;br /&gt;
#  gaussian&lt;br /&gt;
#&lt;br /&gt;
# where to fine the executable&lt;br /&gt;
   export g09root=&amp;quot;/Applications&amp;quot;&lt;br /&gt;
# set the default memory&lt;br /&gt;
   export GAUSS_MEMDEF=&amp;quot;500MB&amp;quot;&lt;br /&gt;
# where to put the LARGE temporary files when running gaussian&lt;br /&gt;
   export GAUSS_SCRDIR=&amp;quot;/Users/$USER/Work/Jobs/tmp&amp;quot;&lt;br /&gt;
# script which sets many variables for gaussian&lt;br /&gt;
   source $g09root/g09/bsd/g09.profile&lt;br /&gt;
#&lt;br /&gt;
#   gaussview&lt;br /&gt;
#&lt;br /&gt;
# where to find gaussview&lt;br /&gt;
   export GV_DIR=&amp;quot;/Applications/gv&amp;quot;&lt;br /&gt;
# libraries &lt;br /&gt;
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GV_DIR}/lib&lt;br /&gt;
# allow start from the comand line in mac terminal&lt;br /&gt;
   alias gv=&amp;quot;open $GV_DIR/gview.app&amp;quot;&lt;br /&gt;
#  &lt;br /&gt;
#  alias definitions            &lt;br /&gt;
#&lt;br /&gt;
   alias home=&amp;quot;cd&amp;quot;&lt;br /&gt;
   alias force=&amp;quot;grep -i &#039;Maximum Force&#039;&amp;quot;&lt;br /&gt;
   alias dist=&amp;quot;grep -i &#039;Maximum Disp&#039;&amp;quot;&lt;br /&gt;
   alias rm=&#039;rm -I&#039;&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::create the file &amp;quot;.login&amp;quot; &lt;br /&gt;
::this is needed because gaussview looks for csh stuff&lt;br /&gt;
::copy and paste the following into it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv g09root /Applications&lt;br /&gt;
source $g09root/g09/bsd/g09.login&lt;br /&gt;
setenv GAUSS_SCRDIR /Users/$USER/Work/Jobs/tmp&lt;br /&gt;
setenv GV_DIR /Applications/gv&lt;br /&gt;
setenv GAUSS_EXEDIR /Applications/g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::of course replace my name with your name (or directory structure)&lt;br /&gt;
::and the directory tmp should exist before you run any jobs.&lt;br /&gt;
&lt;br /&gt;
==== set-up working directories ====&lt;br /&gt;
::make a directory called &amp;quot;work&amp;quot;, keep ALL your files here&lt;br /&gt;
::inside work make a directory called &amp;quot;jobs&amp;quot;, keep all your gaussian jobs here&lt;br /&gt;
::inside work make a directory called &amp;quot;testing&amp;quot; ie full path is /Users/name/work/jobs/testing &lt;br /&gt;
::vi a file &amp;quot;test.com&amp;quot; and copy and paste the following into it&lt;br /&gt;
::ps don&#039;t forget the last line must be blank&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
%chk=test.chk&lt;br /&gt;
%mem=500MB&lt;br /&gt;
%nproc=1&lt;br /&gt;
# hf/3-21g geom=connectivity&lt;br /&gt;
&lt;br /&gt;
Title Card Required&lt;br /&gt;
&lt;br /&gt;
0 1&lt;br /&gt;
 C&lt;br /&gt;
 H                  1              B1&lt;br /&gt;
 H                  1              B2    2              A1&lt;br /&gt;
 H                  1              B3    3              A2    2              D1&lt;br /&gt;
 H                  1              B4    3              A3    2              D2&lt;br /&gt;
&lt;br /&gt;
   B1             1.07000000&lt;br /&gt;
   B2             1.07000000&lt;br /&gt;
   B3             1.07000000&lt;br /&gt;
   B4             1.07000000&lt;br /&gt;
   A1           109.47120255&lt;br /&gt;
   A2           109.47125080&lt;br /&gt;
   A3           109.47121829&lt;br /&gt;
   D1          -119.99998525&lt;br /&gt;
   D2           120.00000060&lt;br /&gt;
&lt;br /&gt;
 1 2 1.0 3 1.0 4 1.0 5 1.0&lt;br /&gt;
 2&lt;br /&gt;
 3&lt;br /&gt;
 4&lt;br /&gt;
 5&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== install gaussian ====&lt;br /&gt;
::insert the CD&lt;br /&gt;
::double click on the .dmg file&lt;br /&gt;
::a CDROM disk icon will appear&lt;br /&gt;
::in a terminal window cd /Volumes/CDROM (or name of CD)&lt;br /&gt;
::read the &amp;quot;readme&amp;quot; file&lt;br /&gt;
::change to the cshell&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
csh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::tell the script where gaussian (G09) is to be installed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    setenv g09root &amp;quot;/Applications&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::now goto the g03root directory&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    cd $g09root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::read the CD&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /Volumes/CDROM/tar/*.tgz | zcat | tar xvf -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::this will unpack and copy the contents of the CD, you should see a stream of file names, when this stops and the prompt returns&lt;br /&gt;
::ensure that the group permissions are set&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chgrp -R gaussian g09 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::check this has worked, type &amp;quot;ls -al&amp;quot;&lt;br /&gt;
::you should see a list with the following&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
drwxr-x---  154 name  hunt_group   5236  1 Nov  2007 g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::goto the gaussian directory and run the install script&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd g09&lt;br /&gt;
./bsd/install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::eject the disk&lt;br /&gt;
::you are not quite ready to run as the variables g09root, GAUSS_SCRDIR and the g09.login script need to be set in your .bashrc file ... this was done in the terminal instructions above&lt;br /&gt;
:: you may also want to get rid of the pesky error &amp;quot;-bash: ulimit: open files: cannot modify limit: Invalid argument&amp;quot; which shows up because you have asked &amp;quot;source $g09root/g09/bsd/g09.profile&amp;quot; in your .bashrc&lt;br /&gt;
:::goto the direcotry g09/bsd&lt;br /&gt;
:::edit the file g09.profile, goto the end and hash out the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#turned off by tricia to stop error message&lt;br /&gt;
#ulimit -n hard&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::now you are ready to run a test job&lt;br /&gt;
:::nohup means don&#039;t stop if you logout&lt;br /&gt;
:::the trailing &amp;amp; means run in the background&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd work/jobs/testing&lt;br /&gt;
nohup g09 test &amp;amp; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::ls to see that the job is running and that test.chk and test.log files are being generated.&lt;br /&gt;
::check that the job finishes ok&lt;br /&gt;
&lt;br /&gt;
==== install gaussview ====&lt;br /&gt;
=====getting ready=====&lt;br /&gt;
::insert the CD&lt;br /&gt;
::double click on the .dmg file&lt;br /&gt;
::a CDROM disk icon will appear&lt;br /&gt;
::in a terminal window cd /Volumes/CDROM (or name of CD)&lt;br /&gt;
::read the &amp;quot;readme&amp;quot; file&lt;br /&gt;
&lt;br /&gt;
=====do the install=====&lt;br /&gt;
::change to the cshell&lt;br /&gt;
::tell the script where the cd is mounted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    csh&lt;br /&gt;
    setenv g09root &amp;quot;/Applications&amp;quot;&lt;br /&gt;
    cd $g09root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::now read and unpack the CD&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /Volumes/CDROM/tar/*.tgz | zcat | tar xvf -&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::change the group premisions to the same as those for g09&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chgrp -R gaussian gv &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
::eject the disk&lt;br /&gt;
&lt;br /&gt;
::gaussview uses csh, so you need to have a .login if you want to run from the launcher&lt;br /&gt;
::check that you have the following in your .login&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
setenv g09root /Applications&lt;br /&gt;
source $g09root/g09/bsd/g09.login&lt;br /&gt;
setenv GAUSS_SCRDIR /Users/tricia/Work/tmp&lt;br /&gt;
setenv GV_DIR /Applications/gv&lt;br /&gt;
setenv GAUSS_EXEDIR /Applications/g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====set-up quick starting of gaussview=====&lt;br /&gt;
::goto the Applications folder and click on the gv folder&lt;br /&gt;
::drag the gaussview icon into the launcher&lt;br /&gt;
::double click to start gaussview&lt;br /&gt;
::if you get an error saying that it cannot find gaussian directories then&lt;br /&gt;
:::cd to the gv directory&lt;br /&gt;
:::cd into the data directory&lt;br /&gt;
:::edit the gpath.txt file (and give the correct path to the g03 application)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/Applications/g09&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:::quit gaussview and then restart it, your problem should be fixed&lt;br /&gt;
&lt;br /&gt;
=====set-up preferences=====&lt;br /&gt;
::now we need to set some directories in the preferences of gaussview&lt;br /&gt;
::click on preferences&lt;br /&gt;
::choose the &amp;quot;File?Directory&amp;quot; option&lt;br /&gt;
::under the starting directory, choose Specify, click on the &amp;quot;...&amp;quot; button and pick your work/jobs directory&lt;br /&gt;
::under the scratch directory, choose &amp;quot;Use GAUSS_SCRDIR&amp;quot;&lt;br /&gt;
=====test run a job=====&lt;br /&gt;
::start X11 (this is in Applications/Utilities folder, drag the X11 app to a launcher)&lt;br /&gt;
::type &amp;quot;gv&amp;quot; in the window (and press return)&lt;br /&gt;
::choose &amp;quot;open&amp;quot; and goto your /work/jobs/testing directory, open your test.com file&lt;br /&gt;
::submit it to run (save as test_1.com) so that you don&#039;t overwrite the other test job&lt;br /&gt;
::check that it finishes OK&lt;br /&gt;
::open your test molecule&#039;s com file&lt;br /&gt;
&lt;br /&gt;
==== set-up easy remote connections ====&lt;br /&gt;
::create the file &amp;quot;config&amp;quot; in your home/.ssh directory&lt;br /&gt;
::see heiko&#039;s notes for what to put in it.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442309</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442309"/>
		<updated>2014-07-31T13:26:57Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=15800&lt;br /&gt;
MAXDISK=400&lt;br /&gt;
WALLT=&amp;quot;499:00:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${FL}&lt;br /&gt;
	if [[ ${FL} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=499:00:00&lt;br /&gt;
#PBS -l select=1:ncpus=8:mem=15800MB:tmpspace=400GB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;15800MB;499:00:00;d01;400GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;15800MB;499:00:00;d01;400GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;400&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;15800&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;400&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;15800&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    echo $&amp;quot;$line&amp;quot;&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} == &#039;edit&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
                        sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG; &lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}GB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -l select=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        FL=${1}&lt;br /&gt;
	ID=$(ID ${FL});&lt;br /&gt;
	if [[ -f ${ID}&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
		FL=${ID}.com&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	NMFL=${FL%.com}&lt;br /&gt;
	NMFL=${NMFL##*/}        &lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${FL} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
	elif [[ ! ${FL} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${FL}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
		GMEM=$((${MEM} - 50*CORE))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${FL})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${FL})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${FL}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${FL}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${FL}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}GB/&amp;quot; ${FL##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${FL}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442273</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442273"/>
		<updated>2014-07-29T12:12:41Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			while read line&lt;br /&gt;
			do&lt;br /&gt;
			    echo $&amp;quot;$line&amp;quot;&lt;br /&gt;
			done &amp;lt; &amp;quot;$WLOG&amp;quot;&lt;br /&gt;
		elif [[ ${OPTARG} == &#039;edit&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
                        sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG; &lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#Gaussian is greedy !!! &lt;br /&gt;
MEM=$((${MEM} - 50*CORE))&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
	NMFL=${NMFL##*/}        &lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
                GMEM=${MEM}&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442255</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442255"/>
		<updated>2014-07-03T13:32:01Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			cat $WLOG;&lt;br /&gt;
		elif [[ ${OPTARG} == &#039;edit&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
			sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG;&lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
	NMFL=${NMFL##*/}        &lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/$USER/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442254</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442254"/>
		<updated>2014-07-03T13:29:32Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			cat $WLOG;&lt;br /&gt;
		elif [[ ${OPTARG} == &#039;edit&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
			sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG;&lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
	NMFL=${NMFL##*/}        &lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/gd2613/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/gd2613/jobs}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442220</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442220"/>
		<updated>2014-06-27T13:26:14Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			cat $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
			sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG;&lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
	NMFL=${NMFL##*/}        &lt;br /&gt;
	DIR=${1%/*}&lt;br /&gt;
	echo $DIR&lt;br /&gt;
	PD=$(pwd)&lt;br /&gt;
	cd $DIR        &lt;br /&gt;
&lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${NMFL}.chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1##*/}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=$RED${NMFL%.com}$NC ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${NMFL%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/gd2613/jobs/}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/gd2613/jobs/}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
	cd $PD&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442132</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442132"/>
		<updated>2014-05-28T13:23:07Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
WLOGf=&amp;quot;$HOME/bin/.wulog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
FRC=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} [select]&lt;br /&gt;
		select = &lt;br /&gt;
			all&lt;br /&gt;
			work ID (e.g. &#039;7197851&#039;)&lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts fhnsc:d:g:l:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        f)&lt;br /&gt;
                FRC=1;&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		if [[ ${OPTARG} == &#039;all&#039; ]]&lt;br /&gt;
		then&lt;br /&gt;
			cat $WLOG;&lt;br /&gt;
		else&lt;br /&gt;
			sed -n &amp;quot;/${OPTARG}/p&amp;quot; $WLOG;&lt;br /&gt;
		fi&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; ${SFILE}&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
		CD=$(pwd)&lt;br /&gt;
		CD=${CD//\//\\\/}&#039;\/&#039;&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=./&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=$CD${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		if [[ $FRC=1 ]]&lt;br /&gt;
		then&lt;br /&gt;
			out=$(qsub -p 100 -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng);&lt;br /&gt;
		else&lt;br /&gt;
			out=$(qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng);&lt;br /&gt;
		fi&lt;br /&gt;
		cp=&amp;quot;$(pwd)&amp;quot;&lt;br /&gt;
		if [[ -n $out ]]&lt;br /&gt;
		then&lt;br /&gt;
		echo &amp;quot;$(date -u +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/gd2613/jobs/}&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo &amp;quot;$(date -u +&#039;%d/%m - %H:%M&#039;) | $out | $NMFL | ${cp#/work/gd2613/jobs/}&amp;quot; &amp;gt;&amp;gt; $WLOGf&lt;br /&gt;
		fi&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442131</id>
		<title>Mod:Hunt Research Group/calendar</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442131"/>
		<updated>2014-05-27T13:29:19Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Calendar ==&lt;br /&gt;
&lt;br /&gt;
*Tricia (Not Done)&lt;br /&gt;
*Abdihakim Hassan (Not Done)&lt;br /&gt;
*Bryan Ward (Not Done)&lt;br /&gt;
*Claire Ashworth (Not Done)&lt;br /&gt;
*Matthew Clough (Not Done)&lt;br /&gt;
*Precious Ugbomah (Not Done)&lt;br /&gt;
*Richard Matthews (Not Done) &lt;br /&gt;
*Vincent Chen (Not Done)&lt;br /&gt;
*Gabriel Lau (Not Done)&lt;br /&gt;
*Rebecca Rowe (Not Done)&lt;br /&gt;
*Patricia Ho (Not Done)&lt;br /&gt;
*Giacomo Damilano (Not Done)&lt;br /&gt;
*Richard Fogarty (Not Done)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; width=&amp;quot;1190&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr bgcolor=&amp;quot;#66CCFF&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Mon&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Tues&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Wed&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Thur&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Fri&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sat&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sun&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot; &amp;gt;22nd&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt; Tricia away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Precious away &amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;Precious away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Giacomo away&amp;lt;br&amp;gt;Precious away&amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#FFA500&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;Start of term&#039;&#039;&#039;&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;29th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Vincent &amp;amp; Gabriel)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st May&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;5th&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;6th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Kevin)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;13th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Richard)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;19th&amp;lt;br&amp;gt;Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;20th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Precious)&#039;&#039;&#039;&amp;lt;br&amp;gt; Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;27th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Pat)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st June&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&#039;&#039;&#039;(Giacomo)&#039;&#039;&#039;&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Gabriel)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Hakim-presentation practice)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Bryan)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#FFA500&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&#039;&#039;&#039;End of term&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot; &amp;gt;1st July&amp;lt;br&amp;gt;{{fontcolor|#FFD700|&#039;&#039;&#039;PhD Symposium (Chem.)&#039;&#039;&#039;}}&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;EUCHEM-Richard&amp;amp;Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Richard F)&#039;&#039;&#039;&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Matthew)&#039;&#039;&#039;&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&#039;&#039;&#039;(Vincent)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td  bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st August&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;25th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;39th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st September&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st October&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442130</id>
		<title>Mod:Hunt Research Group/calendar</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442130"/>
		<updated>2014-05-27T13:28:49Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Calendar ==&lt;br /&gt;
&lt;br /&gt;
*Tricia (Not Done)&lt;br /&gt;
*Abdihakim Hassan (Not Done)&lt;br /&gt;
*Bryan Ward (Not Done)&lt;br /&gt;
*Claire Ashworth (Not Done)&lt;br /&gt;
*Matthew Clough (Not Done)&lt;br /&gt;
*Precious Ugbomah (Not Done)&lt;br /&gt;
*Richard Matthews (Not Done) &lt;br /&gt;
*Vincent Chen (Not Done)&lt;br /&gt;
*Gabriel Lau (Not Done)&lt;br /&gt;
*Rebecca Rowe (Not Done)&lt;br /&gt;
*Patricia Ho (Not Done)&lt;br /&gt;
*Giacomo Damilano (Not Done)&lt;br /&gt;
*Richard Fogarty (Not Done)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; width=&amp;quot;1190&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr bgcolor=&amp;quot;#66CCFF&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Mon&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Tues&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Wed&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Thur&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Fri&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sat&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sun&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot; &amp;gt;22nd&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt; Tricia away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Precious away &amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;Precious away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Giacomo away&amp;lt;br&amp;gt;Precious away&amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#FFA500&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;Start of term&#039;&#039;&#039;&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;29th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Vincent &amp;amp; Gabriel)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st May&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;5th&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;6th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Kevin)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;13th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Richard)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;19th&amp;lt;br&amp;gt;Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;20th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Precious)&#039;&#039;&#039;&amp;lt;br&amp;gt; Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;27th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Pat)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st June&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&#039;&#039;&#039;(Giacomo)&#039;&#039;&#039;&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away &amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Gabriel)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Hakim-presentation practice)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Bryan)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#FFA500&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&#039;&#039;&#039;End of term&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot; &amp;gt;1st July&amp;lt;br&amp;gt;{{fontcolor|#FFD700|&#039;&#039;&#039;PhD Symposium (Chem.)&#039;&#039;&#039;}}&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;EUCHEM-Richard&amp;amp;Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Richard F)&#039;&#039;&#039;&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Matthew)&#039;&#039;&#039;&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&#039;&#039;&#039;(Vincent)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td  bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st August&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;25th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;39th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st September&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st October&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442129</id>
		<title>Mod:Hunt Research Group/calendar</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/calendar&amp;diff=442129"/>
		<updated>2014-05-27T13:26:55Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Calendar ==&lt;br /&gt;
&lt;br /&gt;
*Tricia (Not Done)&lt;br /&gt;
*Abdihakim Hassan (Not Done)&lt;br /&gt;
*Bryan Ward (Not Done)&lt;br /&gt;
*Claire Ashworth (Not Done)&lt;br /&gt;
*Matthew Clough (Not Done)&lt;br /&gt;
*Precious Ugbomah (Not Done)&lt;br /&gt;
*Richard Matthews (Not Done) &lt;br /&gt;
*Vincent Chen (Not Done)&lt;br /&gt;
*Gabriel Lau (Not Done)&lt;br /&gt;
*Rebecca Rowe (Not Done)&lt;br /&gt;
*Patricia Ho (Not Done)&lt;br /&gt;
*Giacomo Damilano (Not Done)&lt;br /&gt;
*Richard Fogarty (Not Done)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; width=&amp;quot;1190&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr bgcolor=&amp;quot;#66CCFF&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Mon&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Tues&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Wed&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Thur&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot;&amp;gt;Fri&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sat&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;th width=&amp;quot;170px&amp;quot; bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;Sun&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot; &amp;gt;22nd&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt; Tricia away&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Precious away &amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;Precious away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Giacomo away&amp;lt;br&amp;gt;Precious away&amp;lt;br&amp;gt;Gabriel away&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#FFA500&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;Start of term&#039;&#039;&#039;&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;Giacomo away &amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;29th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Vincent &amp;amp; Gabriel)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st May&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;5th&amp;lt;br&amp;gt;&#039;&#039;&#039;College Closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;6th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Kevin)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;13th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Richard)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;19th&amp;lt;br&amp;gt;Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;20th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Precious)&#039;&#039;&#039;&amp;lt;br&amp;gt; Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;Careers course - Vincent, Gabriel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td &amp;gt;27th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Pat)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st June&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&#039;&#039;&#039;(Giacomo)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;CECAM workshop &amp;lt;br&amp;gt; Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Gabriel)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Hakim-presentation practice)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Bryan)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#FFA500&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&#039;&#039;&#039;End of term&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;(Giacomo Away)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot; &amp;gt;1st July&amp;lt;br&amp;gt;{{fontcolor|#FFD700|&#039;&#039;&#039;PhD Symposium (Chem.)&#039;&#039;&#039;}}&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;EUCHEM-Richard&amp;amp;Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Richard F)&#039;&#039;&#039;&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;EUCHEM-Richard &amp;amp; Claire&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&#039;&#039;&#039;(Matthew)&#039;&#039;&#039;&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;Richard away&amp;lt;br&amp;gt;Claire away&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&#039;&#039;&#039;(Vincent)&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;Gaussian workshop - Claire &amp;amp; Bryan&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td  bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st August&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;6th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#339933&amp;quot;&amp;gt;25th&amp;lt;br&amp;gt;&#039;&#039;&#039;College closed&#039;&#039;&#039;&amp;lt;br&amp;gt;&#039;&#039;&#039;Bank holiday&#039;&#039;&#039;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;39th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;31st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st September&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;2nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;3rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;4th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;5th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;6th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;7th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;8th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;9th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;10th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;11th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;12th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;13th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;14th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;15th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;16th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;17th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;18th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;19th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;20th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;21st&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;22nd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;23rd&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;24th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;25th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;26th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;27th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;28th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;29th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;30th&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#4357CFF&amp;quot;&amp;gt;1st October&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td bgcolor=&amp;quot;#CCCCCC&amp;quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442123</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442123"/>
		<updated>2014-05-09T15:44:02Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} &lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts chlnsd:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		cat $WLOG;&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; ${SFILE}&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		out=$(qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng)&lt;br /&gt;
		echo &amp;quot;$(date -u +&#039;%d/%m - %H:%M&#039;) | $NMFL | $out&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
write and quit&lt;br /&gt;
&amp;lt;pre&amp;gt;:wq&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then set the file as executable file&lt;br /&gt;
&amp;lt;pre&amp;gt;chmod +x gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442122</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442122"/>
		<updated>2014-05-08T14:40:46Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} &lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts chlnsd:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		cat $WLOG;&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; ${SFILE}&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores: $CORE; Memory: $MEM; Cue: $CUE; Walltime: $WALLT; Gaussian-version: $GAUSS; Maxdisk: $MAXDISK&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		out=$(qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng)&lt;br /&gt;
		echo &amp;quot;$(date -u +&#039;%d/%m - %H:%M&#039;) | $NMFL | $out&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442121</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442121"/>
		<updated>2014-05-08T14:37:43Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} &lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts chlnsd:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-10&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		cat $WLOG;&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; ${SFILE}&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		out=$(qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng)&lt;br /&gt;
		echo &amp;quot;$(date -u +&#039;%d/%m - %H:%M&#039;) | $NMFL | $out&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442120</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442120"/>
		<updated>2014-05-08T13:41:28Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
WLOG=&amp;quot;$HOME/bin/.wlog&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
QUIET=0&lt;br /&gt;
CORRECTION=1&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-l${NC} &lt;br /&gt;
		prints the log of the jobs sent &lt;br /&gt;
        ${BLUE}-h${NC} &lt;br /&gt;
		help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts chlnsd:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=0;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=1;&lt;br /&gt;
		;;&lt;br /&gt;
	l)&lt;br /&gt;
		cat $WLOG;&lt;br /&gt;
		;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; ${SFILE}&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $QUIET -eq 1 ]]&lt;br /&gt;
        then&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		out=$(qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng)&lt;br /&gt;
		echo &amp;quot;$(date -u +&#039;%d/%m - %H:%M&#039;) | $NMFL | $out&amp;quot; &amp;gt;&amp;gt; $WLOG&lt;br /&gt;
		echo $out&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442004</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442004"/>
		<updated>2014-04-02T18:21:48Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB:tmpspace=400gb&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts chns:d:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
if [[ -n $MAXDISK ]]&lt;br /&gt;
then&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB:tmpspace=${MAXDISK}MB/&amp;quot; ${SFILE}&lt;br /&gt;
else&lt;br /&gt;
	sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
		if [[ -n $MAXDISK ]]&lt;br /&gt;
		then&lt;br /&gt;
                	sed -i &amp;quot;s/maxdisk=.*B/maxdisk=${MAXDISK}MB/&amp;quot; ${1}&lt;br /&gt;
		fi&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442003</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442003"/>
		<updated>2014-04-02T18:09:40Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cueing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WHITESTRIPES=&amp;quot;Preset not charged&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
while getopts chns:d:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442002</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442002"/>
		<updated>2014-04-02T18:09:20Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
WHITESTRIPES=&amp;quot;Preset not charged&amp;quot;;&lt;br /&gt;
while getopts chns:d:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442001</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442001"/>
		<updated>2014-04-02T17:10:59Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use (MB or GB)&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-p${NC} [preset]&lt;br /&gt;
                preset =&lt;br /&gt;
			[0-9]	load a preset&lt;br /&gt;
			show	list the saved preset&lt;br /&gt;
			set	open the editor to set the preset&lt;br /&gt;
        ${BLUE}-d${NC} [max disk]&lt;br /&gt;
                set the maxdisk&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts chns:d:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442000</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=442000"/>
		<updated>2014-04-02T17:04:58Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cueing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Default Variables                                    #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
SFILE=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
PFILE=&amp;quot;$HOME/bin/.presets&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                  Debugging Function                                   #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo &amp;quot;1.PWD	 $PWD&amp;quot;&lt;br /&gt;
	echo &amp;quot;2.#	 $#&amp;quot;&lt;br /&gt;
	echo &amp;quot;3.*	 $*&amp;quot;&lt;br /&gt;
	echo &amp;quot;4.OPTARG	 ${OPTARG}&amp;quot;&lt;br /&gt;
	echo &amp;quot;5.OPTIND	 ${OPTIND}&amp;quot;&lt;br /&gt;
	echo &amp;quot;6.CUE   	 ${CUE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;7.CORE  	 ${CORE}&amp;quot;&lt;br /&gt;
	echo &amp;quot;8.MEM   	 ${MEM}&amp;quot;&lt;br /&gt;
	echo &amp;quot;9.WALLTIME ${WALLT}&amp;quot;&lt;br /&gt;
	echo &amp;quot;10.MAXDISK ${MAXDISK}&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                                   Help output                                         #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use, the memory must be inputed as MB, 16000MB are set as default&lt;br /&gt;
        ${BLUE}-w${NC} [walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bytechunker(){&lt;br /&gt;
	local __resultvar=${1}&lt;br /&gt;
	if [[ ${1} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%MB};&lt;br /&gt;
		elif [[ $1 =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	then&lt;br /&gt;
		local MBYTES=${1%GB};&lt;br /&gt;
		let &amp;quot;MBYTES=MBYTES*1000&amp;quot;;&lt;br /&gt;
	else&lt;br /&gt;
		local MBYTES=${1-&amp;quot;800000&amp;quot;};&lt;br /&gt;
	fi&lt;br /&gt;
	echo $MBYTES;&lt;br /&gt;
	&lt;br /&gt;
    	eval $__resultvar=&amp;quot;&#039;$MBYTES&#039;&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#         Creating/Verifing the existence of some files used by the function            #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${SFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${SFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${PFILE} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;##	 Here is where to list the preset for gaussian calculations&lt;br /&gt;
##	 Each line is a preset and it is written in this way :&lt;br /&gt;
##		 [CUE];[CORES];[MEMORY];[WALLTIME];[GAUSSIAN VERSION];[MAXDISK]&lt;br /&gt;
##	e.g	pqph;8;14400MB;119:59:00;d01;800GB&lt;br /&gt;
##&lt;br /&gt;
##&lt;br /&gt;
##-----------------------------------------------------------------------------&lt;br /&gt;
##&lt;br /&gt;
##	presets starts from next line&lt;br /&gt;
pqph;8;14400MB;119:59:00;d01;800GB&#039; &amp;gt; &amp;quot;${PFILE}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                              Retriving inputted options                               #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while getopts chns:d:g:m:p:q:w: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT -lt $OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		let &amp;quot;OPT=OPTIND - 1&amp;quot;&lt;br /&gt;
	fi&lt;br /&gt;
	&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        d)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MAXDISK=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MAXDISK=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
		;;&lt;br /&gt;
	p)&lt;br /&gt;
		if [[ $OPTARG =~ [0-9] ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=0;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
				if [[ $m == $OPTARG ]]&lt;br /&gt;
				then&lt;br /&gt;
					echo $VAR&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					CUE=${PRESET[0]};&lt;br /&gt;
					CORE=${PRESET[1]};&lt;br /&gt;
				&lt;br /&gt;
                			if [[ ${PRESET[2]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MEM=${PRESET[2]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[2]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
						$MEM=${PRESET[2]%GB}&lt;br /&gt;
                			        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MEM=${PRESET[2]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
					WALLT=${PRESET[3]};&lt;br /&gt;
					GAUSS=${PRESET[4]};&lt;br /&gt;
                			if [[ ${PRESET[5]} =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
		                	then&lt;br /&gt;
        			                MAXDISK=${PRESET[5]%MB};&lt;br /&gt;
			                elif [[ ${PRESET[5]} =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
	        		        then&lt;br /&gt;
                			        MAXDISK=${PRESET[5]%GB};&lt;br /&gt;
        			                let &amp;quot;MAXDISK=MAXDISK*1000&amp;quot;;&lt;br /&gt;
		        	        else&lt;br /&gt;
        			                MAXDISK=${PRESET[5]-&amp;quot;16000&amp;quot;};&lt;br /&gt;
	        	        	fi&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE;&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;show&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			i=1;&lt;br /&gt;
			while read VAR&lt;br /&gt;
			do&lt;br /&gt;
				if [[ $i -gt 9 ]]&lt;br /&gt;
				then&lt;br /&gt;
					IFS=&amp;quot;;&amp;quot; read -ra PRESET &amp;lt;&amp;lt;&amp;lt; &amp;quot;$VAR&amp;quot;&lt;br /&gt;
					let &amp;quot;m=i-9&amp;quot;&lt;br /&gt;
					echo &amp;quot;$m - cue: ${PRESET[0]} cores:${PRESET[1]} memory: ${PRESET[2]} walltime: ${PRESET[3]} gaussian version: ${PRESET[4]} max disk: ${PRESET[5]}&amp;quot;;&lt;br /&gt;
				fi&lt;br /&gt;
				((i++))&lt;br /&gt;
			done &amp;lt; $PFILE&lt;br /&gt;
			exit&lt;br /&gt;
		elif [[ $OPTARG == &amp;quot;set&amp;quot; ]]&lt;br /&gt;
		then&lt;br /&gt;
			vi $PFILE&lt;br /&gt;
			exit &lt;br /&gt;
		fi&lt;br /&gt;
		WHITESTRIPES=&amp;quot;Charged preset : $CUE $CORE $MEM $WALLT $GAUSS $MAXDISK&amp;quot;;&lt;br /&gt;
		;;	&lt;br /&gt;
	h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB};&lt;br /&gt;
                        let &amp;quot;MEM=MEM*1000&amp;quot;;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Correcting the script file                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${SFILE}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${SFILE}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${SFILE}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
#########################################################################################&lt;br /&gt;
#                             Pushing the job to the HPC                                #&lt;br /&gt;
#########################################################################################&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e $YELLOW$WHITESTRIPES$NC&lt;br /&gt;
		echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=441998</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=441998"/>
		<updated>2014-04-01T16:35:20Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cuing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
BIN=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
OPT=0&lt;br /&gt;
&lt;br /&gt;
debug(){&lt;br /&gt;
	echo $PWD&lt;br /&gt;
	echo $#&lt;br /&gt;
	echo $*&lt;br /&gt;
	echo ${OPTARG}&lt;br /&gt;
	echo ${OPTIND}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use, the memory must be inputed as MB, 16000MB are set as default&lt;br /&gt;
        ${BLUE}-w${NC}[walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
while getopts hnsw:g:c:m:q: OPTION&lt;br /&gt;
do&lt;br /&gt;
	if [[ $OPT&amp;lt;$OPTIND ]]&lt;br /&gt;
	then&lt;br /&gt;
		OPT=$OPTIND&lt;br /&gt;
	fi&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        h)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;};&lt;br /&gt;
		;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]];&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB};&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB}*1000;&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;};&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG};&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage;&lt;br /&gt;
                exit;&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
shift $OPT&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${BIN} ]]&lt;br /&gt;
then&lt;br /&gt;
	echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${BIN}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${BIN}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${BIN}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${BIN}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${BIN}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${BIN}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
        &lt;br /&gt;
	if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; is not a com file.&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                $gmem=$(grep -i -c &amp;quot;%mem=.*/&amp;quot; ${1})&lt;br /&gt;
                $gpshar=$(grep -i -c &amp;quot;%nprocshared=.*/&amp;quot; ${1})&lt;br /&gt;
                $gchk=$(grep -i -c &amp;quot;%chk=.*/&amp;quot; ${1}) &lt;br /&gt;
		echo $gmem $gpshar $gchk&lt;br /&gt;
		sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------------------------------------------------------------------------\n\n${NC}&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;qsub -N${NMFL:0:15} -v in=${RED}${1}${NC}  ~/bin/.rng&amp;quot;&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------Are you sure? [y/N]-------------------------------${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
		qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=441995</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=441995"/>
		<updated>2014-03-31T10:46:53Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cuing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cuing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
BIN=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
debug(){&lt;br /&gt;
        echo $PWD&lt;br /&gt;
        echo $#&lt;br /&gt;
        echo $*&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use, the memory must be inputed as MB, 16000MB are set as default&lt;br /&gt;
        ${BLUE}-w${NC}[walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
while getopts “:hq:nw:g:c:m:s” OPTION&lt;br /&gt;
do&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        h)&lt;br /&gt;
                usage&lt;br /&gt;
                exit&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;}&lt;br /&gt;
                ;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;}&lt;br /&gt;
                ;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB}&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB}*1000&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;}&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG}&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG}&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage&lt;br /&gt;
                exit&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${BIN} ]]&lt;br /&gt;
then&lt;br /&gt;
        echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${BIN}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${BIN}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${BIN}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${BIN}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${BIN}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${BIN}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
&lt;br /&gt;
        if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;This is not a com file&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------------------------ \n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------------------------ \n\n${NC}&amp;quot;&lt;br /&gt;
                echo qsub -N${NMFL:0:15} -v in=${1}  ~/bin/.rng&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------Are you sure? [y/N]--------------- ${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
                qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 3 alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=441994</id>
		<title>Mod:Hunt Research Group/pimpQSUB</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Mod:Hunt_Research_Group/pimpQSUB&amp;diff=441994"/>
		<updated>2014-03-31T10:46:11Z</updated>

		<summary type="html">&lt;p&gt;Gd2613: /* How to... speed up your job cuing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Back to the main [https://www.ch.ic.ac.uk/wiki/index.php/Mod:Hunt_Research_Group wiki-page]&lt;br /&gt;
&lt;br /&gt;
== How to... speed up your job cuing ==&lt;br /&gt;
This is a little function that reduce the time spent in sending job to the hpc. It has also some useful auto-correction part that automatically sets your chk, your processors and your memory in the input file if not coherent with the terminal input. Write in the hpc terminal &lt;br /&gt;
&amp;lt;pre&amp;gt;vi ~/bin/gf&amp;lt;/pre&amp;gt;&lt;br /&gt;
and copy and paste this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
DIR=$PWD&lt;br /&gt;
BIN=&amp;quot;$HOME/bin/.rng&amp;quot;&lt;br /&gt;
CUE=&amp;quot;pqph&amp;quot;&lt;br /&gt;
CORE=8&lt;br /&gt;
MEM=16000&lt;br /&gt;
WALLT=&amp;quot;119:59:00&amp;quot;&lt;br /&gt;
SKIP=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
QUIET=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
CORRECTION=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
RED=&#039;\033[0;31m&#039;&lt;br /&gt;
NC=&#039;\033[m&#039;&lt;br /&gt;
YELLOW=&#039;\033[1;33m&#039;&lt;br /&gt;
BLUE=&#039;\033[1;34m&#039;&lt;br /&gt;
debug(){&lt;br /&gt;
        echo $PWD&lt;br /&gt;
        echo $#&lt;br /&gt;
        echo $*&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
usage(){&lt;br /&gt;
    echo -e &amp;quot;gaussian function v1.2&lt;br /&gt;
&lt;br /&gt;
${RED}NAME${NC}&lt;br /&gt;
        gfunc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}SYNOPSIS${NC}&lt;br /&gt;
        gf [jobfilename.com]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
${RED}OPTIONS${NC}&lt;br /&gt;
        ${BLUE}-q${NC} [cue]&lt;br /&gt;
                set the cue for the job, default is pqph&lt;br /&gt;
        ${BLUE}-c${NC} [cores]&lt;br /&gt;
                sets the number of cores, 8 is set as default&lt;br /&gt;
        ${BLUE}-m${NC} [memory]&lt;br /&gt;
                sets the quantity of memory to use, the memory must be inputed as MB, 16000MB are set as default&lt;br /&gt;
        ${BLUE}-w${NC}[walltime]&lt;br /&gt;
                set the walltime&lt;br /&gt;
        ${BLUE}-g${NC} [gaussian version]&lt;br /&gt;
                sets the version of gaussian in use (e.g. d01)&lt;br /&gt;
        ${BLUE}-s${NC} silent&lt;br /&gt;
                send directly the job&lt;br /&gt;
        ${BLUE}-n${NC} no correction&lt;br /&gt;
                no correction of the input file&lt;br /&gt;
        ${BLUE}-h${NC} help&lt;br /&gt;
&lt;br /&gt;
${RED}DESCRIPTION${NC}&lt;br /&gt;
This function sends the jobs to the HPC.&lt;br /&gt;
It also corrects the settings of your file automatically.&lt;br /&gt;
In the input file the checkpoint filename is set equally to the input filename, the number of cores is set coherently to the input as the memory. This automatic correction can be disabled by -n option&lt;br /&gt;
This function relies on a modified version of a script files given me by Claire (thanks Claire) that have to be placed in  ~/bin.&lt;br /&gt;
Next function that is projected to be added is the correction of the input file settings even if they are not written at all in the input file.&lt;br /&gt;
Enjoy!!&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
while getopts “:hq:nw:g:c:m:s” OPTION&lt;br /&gt;
do&lt;br /&gt;
        case $OPTION in&lt;br /&gt;
        h)&lt;br /&gt;
                usage&lt;br /&gt;
                exit&lt;br /&gt;
                ;;&lt;br /&gt;
        q)&lt;br /&gt;
                CUE=${OPTARG-&amp;quot;pqph&amp;quot;}&lt;br /&gt;
                ;;&lt;br /&gt;
        c)&lt;br /&gt;
                CORE=${OPTARG-&amp;quot;8&amp;quot;}&lt;br /&gt;
                ;;&lt;br /&gt;
        m)&lt;br /&gt;
                if [[ $OPTARG =~ .*&amp;quot;MB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%MB}&lt;br /&gt;
                elif [[ $OPTARG =~ .*&amp;quot;GB&amp;quot; ]]&lt;br /&gt;
                then&lt;br /&gt;
                        MEM=${OPTARG%GB}*1000&lt;br /&gt;
                else&lt;br /&gt;
                        MEM=${OPTARG-&amp;quot;16000&amp;quot;}&lt;br /&gt;
                fi&lt;br /&gt;
                ;;&lt;br /&gt;
        n)&lt;br /&gt;
                CORRECTION=&amp;quot;FALSE&amp;quot;&lt;br /&gt;
                ;;&lt;br /&gt;
        g)&lt;br /&gt;
                GAUSS=${OPTARG}&lt;br /&gt;
                ;;&lt;br /&gt;
        w)&lt;br /&gt;
                WALLT=${OPTARG}&lt;br /&gt;
                ;;&lt;br /&gt;
        s)&lt;br /&gt;
                QUIET=&amp;quot;TRUE&amp;quot;&lt;br /&gt;
                ;;&lt;br /&gt;
        ?)&lt;br /&gt;
                usage&lt;br /&gt;
                exit&lt;br /&gt;
                ;;&lt;br /&gt;
        esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
if [[ ! -d ~/bin ]]&lt;br /&gt;
then&lt;br /&gt;
        mkdir ~/bin&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ ! -f ${BIN} ]]&lt;br /&gt;
then&lt;br /&gt;
        echo &#039;#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# submit jobs to the que with this script using the following command:&lt;br /&gt;
# rng4 is this script&lt;br /&gt;
# jobname is a name you will see in the qstat command&lt;br /&gt;
# name is the actual file minus .com etc it is passed into this script as ${in%.com}&lt;br /&gt;
#&lt;br /&gt;
# qsub rng -N jobname -v in=name&lt;br /&gt;
&lt;br /&gt;
# batch processing commands&lt;br /&gt;
#PBS -l walltime=119:59:00&lt;br /&gt;
#PBS -lselect=1:ncpus=8:mem=16000MB&lt;br /&gt;
#PBS -j oe&lt;br /&gt;
#PBS -q pqph&lt;br /&gt;
#PBS -m ae&lt;br /&gt;
&lt;br /&gt;
# load modules&lt;br /&gt;
#&lt;br /&gt;
module load gaussian/g09-d01&lt;br /&gt;
&lt;br /&gt;
# check for a checkpoint file&lt;br /&gt;
#&lt;br /&gt;
# variable PBS_O_WORKDIR=directory from which the job was submited.&lt;br /&gt;
   test -r $PBS_O_WORKDIR/${in%.com}.chk&lt;br /&gt;
   if [ $? -eq 0 ]&lt;br /&gt;
   then&lt;br /&gt;
     echo &amp;quot;located $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
     cp $PBS_O_WORKDIR/${in%.com}.chk $TMPDIR/.&lt;br /&gt;
   else&lt;br /&gt;
     echo &amp;quot;no checkpoint file $PBS_O_WORKDIR/${in%.com}.chk&amp;quot;&lt;br /&gt;
   fi&lt;br /&gt;
#&lt;br /&gt;
# run gaussian&lt;br /&gt;
#&lt;br /&gt;
  g09 $PBS_O_WORKDIR/${in}&lt;br /&gt;
  cp $TMPDIR/${in%.com}.chk /$PBS_O_WORKDIR/.&lt;br /&gt;
  cp $TMPDIR/${in%.com}.wfx /$PBS_O_WORKDIR/.&lt;br /&gt;
#  cp *.chk /$PBS_O_WORKDIR/pbs_${in%.com}.chk&lt;br /&gt;
#  test -r $TMPDIR/fort.7&lt;br /&gt;
#  if [ $? -eq 0 ]&lt;br /&gt;
#  then&lt;br /&gt;
#    cp $TMPDIR/fort.7 /$PBS_O_WORKDIR/${in%.com}.mos&lt;br /&gt;
#  fi&lt;br /&gt;
# exit&#039; &amp;gt; &amp;quot;${BIN}&amp;quot;&lt;br /&gt;
        chmod a+x &amp;quot;${BIN}&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
sed -i &amp;quot;s/#PBS -lselect=1:ncpus=.*/#PBS -lselect=1:ncpus=${CORE}:mem=${MEM}MB/&amp;quot; ${BIN}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -l walltime=.*/#PBS -l walltime=${WALLT}/&amp;quot; ${BIN}&lt;br /&gt;
sed -i &amp;quot;s/#PBS -q .*/#PBS -q ${CUE}/&amp;quot; ${BIN}&lt;br /&gt;
&lt;br /&gt;
if [[ -n $GAUSS ]]&lt;br /&gt;
then&lt;br /&gt;
        sed -i &amp;quot;s/module load gaussian.*/module load gaussian/g09-${GAUSS}/&amp;quot; ${BIN}&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [[ $# -eq 0 ]]&lt;br /&gt;
then&lt;br /&gt;
        usage&lt;br /&gt;
        exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
while [ $# -gt 0 ]&lt;br /&gt;
do&lt;br /&gt;
        NMFL=${1%.com}&lt;br /&gt;
&lt;br /&gt;
        if [[ ! -f ${1} ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;\&amp;quot;${1}\&amp;quot; does not exists&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        elif [[ ! ${1} =~ .*&#039;.com&#039; ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo &amp;quot;This is not a com file&amp;quot;&lt;br /&gt;
                exit&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $CORRECTION ]]&lt;br /&gt;
        then&lt;br /&gt;
                GMEM=$((${MEM} * 9 / 10))&lt;br /&gt;
                sed -i &amp;quot;s/%mem=.*/%mem=${GMEM}MB/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%nprocshared=.*/%nprocshared=${CORE}/&amp;quot; ${1}&lt;br /&gt;
                sed -i &amp;quot;s/%chk=.*chk/%chk=${1%com}chk/&amp;quot; ${1}&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ !$QUIET ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------------------------ \n\n${NC}&amp;quot;&lt;br /&gt;
                more ${1}&lt;br /&gt;
                echo -e &amp;quot;${RED}------------------------------------------------ \n\n${NC}&amp;quot;&lt;br /&gt;
                echo qsub -N${NMFL:0:15} -v in=${1}  ~/bin/.rng&lt;br /&gt;
                echo &amp;quot;Cores : $CORE; Memory : $MEM; Cue : $CUE&amp;quot;&lt;br /&gt;
                echo -e &amp;quot;${RED}--------------Are you sure? [y/N]--------------- ${NC}&amp;quot;&lt;br /&gt;
                read -r -p &amp;quot; &amp;quot; response&lt;br /&gt;
        else&lt;br /&gt;
                response=&amp;quot;y&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]&lt;br /&gt;
        then&lt;br /&gt;
                qsub -N${NMFL:0:15} -v in=${1%.com} ~/bin/.rng&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n $(date -u +&#039;%H:%M&#039;) - Work sent \n${NC}&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                echo -e &amp;quot;${YELLOW}\n Work aborted \n${NC}&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        shift&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve reduced the function name to gf, more similar to gv and shorter.&lt;br /&gt;
A complete guide to the function is printed writing &#039;&#039;&#039;gf&#039;&#039;&#039; or &#039;&#039;&#039;gf ?&#039;&#039;&#039; or &#039;&#039;&#039;gf help&#039;&#039;&#039; in the terminal.&lt;br /&gt;
The old rng file are no more need.&lt;br /&gt;
&lt;br /&gt;
I also suggest you to add this other 2 functions/alias if you want. I found really useful when modding your .bashrc as convulsively as I do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   alias bhrc=&amp;quot;cd ~; cp .bashrc .bashrc.old;vi .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias bhrc.old=&amp;quot;cd ~;cp .bashrc.old .bashrc; loadbh; cd ~-&amp;quot;&lt;br /&gt;
   alias loadbh=&amp;quot;source ~/.bashrc&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bhrc&#039;&#039;&#039; and &#039;&#039;&#039;gfunc&#039;&#039;&#039; have become my favorite commands quite soon!! And &#039;&#039;&#039;bhrc.old&#039;&#039;&#039; is my panic button, a perfect backup plan if you mess up something in the bashrc file.&lt;/div&gt;</summary>
		<author><name>Gd2613</name></author>
	</entry>
</feed>