# *NWChem* workflow *NWChem* [home](https://nwchemgit.github.io/) *NWChem* script [examples](https://nwchemgit.github.io/Sample.html#sample-input-files) *NWChem* [getting started](https://nwchemgit.github.io/Getting-Started.html) --- ## Geometry creation for *NWChem* script - exporting as `.xyz` file and using the same input structure in *NWChem* script - `.xyz` file stores only atom positions - `.xyz` file has basically no limit on system size - `.xyz` file [formatting & wiki](https://www.wikiwand.com/en/XYZ_file_format) - exporting as `.pdb` file and using `Extensions > NWChem...` in *Avogadro* and copying geometry from generated result - `.pdb` file stores atom positions and their connections (bonds) - `.pdb` file is limited to 9,999 atoms - `.pdb` file [formatting](https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/pdbintro.html), [wiki](https://www.wikiwand.com/en/Protein_Data_Bank_(file_format)) --- ### Writing *NWChem* input script Any text editor can be used to edit *NWChem* input scripts. [*Notepad++*](https://notepad-plus-plus.org/) is a better alternative to the default Notepad. [*Visual Studio Code*](https://code.visualstudio.com/) is the recommended option. *NWChem* extension for VS Code to provide syntax highlighting is in the development (with additional features being considered). --- ## The most basic *NWChem* input script structure ``` title "Nitrogen cc-pvdz SCF geometry optimization" # script name geometry # geometry n 0 0 0 n 0 0 1.08 end #every section is closed with "end" basis # atom's "characteristics" library n library cc-pvdz end task scf optimize # command to actually execute task ``` More examples in *NWChem* [documentation](https://nwchemgit.github.io/Sample.html#sample-input-files) --- ## Running *NWChem* ### Running in serial mode (1 core) Will run in the console: ``` nwchem input.nw > input.out ``` Will run in the background: ``` nwchem input.nw >& input.out & ``` ### Running with MPI (multi-core) Will run in the console (2 cores): ``` mpiexec -np 2 -bind-to core nwchem input.nw ``` Will run in the background (2 cores): ``` mpiexec -np 2 -bind-to core nwchem input.nw > output.nw ``` Will run in the console (all available cores): ``` mpiexec -map-by core -bind-to core nwchem input.nw ``` Will run in the background (all available cores): ``` mpiexec -map-by core -bind-to core nwchem input.nw > output.nw ``` --- ## Visualizing results - *NWChem* output file - *Chemcraft* [link](https://www.chemcraftprog.com/) - *VMD* [link](https://www.ks.uiuc.edu/Research/vmd/) - *JMol* [link](http://jmol.sourceforge.net/) (needs Java) - `.cube` file - *Chemcraft* [link](https://www.chemcraftprog.com/) - *OVITO* [link](https://www.ovito.org/) - *JMol* [link](http://jmol.sourceforge.net/) (needs Java) --- ## (Optional) *NWChem* script generation using *scriptmaker.py* Python script used to generate *NWChem* script with file structure suitable for IT4I. *scriptmaker.py* is also capable of generating multiple instances of the same script with varying conditions. When using following conditions **e.g.:** ``` cdft 5 5 charge -1.0 cdft 8 8 charge 0 ``` *NWChem* input scripts with folling conditions will be generated: ``` cdft 5 5 charge -1.0 #cdft 5 5 charge -1.0 cdft 5 5 charge -1.0 #cdft 5 5 charge -1.0 cdft 8 8 charge 0 cdft 8 8 charge 0 #cdft 8 8 charge 0 #cdft 8 8 charge 0 ``` (Script source code can be provided upon request) ## (Optional; made for IT4I) Scripts *foldmaker.sh* and *sweeper.sh* *foldmaker.sh* will generate folder structure according to the input: ``` bash foldmaker.sh <name_of_folders> <number of folders> ``` Folders with following name(s) will be generated: name_of_the_folders1 ' ''' '''''' name_of_the_folders100 *sweeper.sh* will move .cube files to the parent directory and delete files not needed for restarting script. All the important result files will be grouped together. (Script source code can be provided upon request) <!-- -------------------------------------------------------------------------------------------- --> <style> html, body, .ui-content { background-color: #333; color: #ddd; } .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { color: #ddd; } .markdown-body h1, .markdown-body h2 { border-bottom-color: #ffffff69; } .markdown-body h1 .octicon-link, .markdown-body h2 .octicon-link, .markdown-body h3 .octicon-link, .markdown-body h4 .octicon-link, .markdown-body h5 .octicon-link, .markdown-body h6 .octicon-link { color: #fff; } .markdown-body img { background-color: transparent; } .ui-toc-dropdown .nav>.active:focus>a, .ui-toc-dropdown .nav>.active:hover>a, .ui-toc-dropdown .nav>.active>a { color: white; border-left: 2px solid white; } .expand-toggle:hover, .expand-toggle:focus, .back-to-top:hover, .back-to-top:focus, .go-to-bottom:hover, .go-to-bottom:focus { color: white; } .ui-toc-dropdown { background-color: #333; } .ui-toc-label.btn { background-color: #191919; color: white; } .ui-toc-dropdown .nav>li>a:focus, .ui-toc-dropdown .nav>li>a:hover { color: white; border-left: 1px solid white; } .markdown-body blockquote { color: #bcbcbc; } .markdown-body table tr { background-color: #5f5f5f; } .markdown-body table tr:nth-child(2n) { background-color: #4f4f4f; } .markdown-body code, .markdown-body tt { color: #eee; background-color: rgba(230, 230, 230, 0.36); } a, .open-files-container li.selected a { color: #5EB7E0; } </style>