{"id":6906,"date":"2023-06-29T10:01:58","date_gmt":"2023-06-29T09:01:58","guid":{"rendered":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=6906"},"modified":"2025-10-15T10:38:46","modified_gmt":"2025-10-15T09:38:46","slug":"partmc","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/partmc\/","title":{"rendered":"PartMC"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>Particle-resolved Monte Carlo (<a href=\"http:\/\/lagrange.mechse.illinois.edu\/partmc\/\">PartMC<\/a>) code for atmospheric aerosol simulation is mainly modern Fortran, with a few parts still clearly showing their Fortran 77 heritage. Fortran 2003 features are used heavily (especially allocatable array features).<\/p>\n<p>The PartMC suite includes a number of programs, amongst them being:<\/p>\n<ul>\n<li>partmc \u2013 the main partmc command reads .spec files and does the run specified therein.<\/li>\n<li>numeric_diff \u2013 compare two files containing numerical arrays and check whether they are the same as each other, to within the specified tolerance.<\/li>\n<li>urban_plume_process \u2013 the process program which reads NetCDF output files and process them.<\/li>\n<li>test_poisson_sample \u2013 the extract_aero_size program reads NetCDF output files and writes out the aerosol number or mass<\/li>\n<\/ul>\n<p>Version 2.6.1 is installed on the CSF.<\/p>\n<h2>Restrictions on use<\/h2>\n<p>PartMC is open source and free for unlimited use, Licensed under the GNU General Public License version 2 or (at your option) any later version. \u2013 <a href=\"https:\/\/github.com\/compdyn\/partmc\">PartMC<\/a><\/p>\n<h2>Set up procedure<\/h2>\n<p>We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job <abbr title=\"add '#$ -V' to your jobscript\">inherit these settings<\/abbr>.<\/p>\n<p>Load one of the following modulefiles:<\/p>\n<pre>module load apps\/gcc\/partmc\/2.6.1\r\n<\/pre>\n<h2>Running the application<\/h2>\n<p>Please do not run partmc on the login node. Jobs should be submitted to the compute nodes via batch.<\/p>\n<h3>Serial batch job submission<\/h3>\n<p>Ensure that all the files of the scenario has been copied over to the scratch area:<\/p>\n<pre>cp -r \/opt\/apps\/apps\/gcc\/partmc\/2.6.1\/test\/emission ~\/scratch\/\r\n<\/pre>\n<p>Create a batch submission script (which will load the modulefile in the jobscript), for example:<\/p>\n<pre>#!\/bin\/bash --login\r\n#SBATCH -p serial      # (or --partition=) Use the nodes dedicated to serial jobs\r\n#SBATCH -t 1-0         # Wallclock timelimt (1-0 is 1 day, max permitted is 7-0)\r\n\r\n# Choose your required version\r\nmodule purge\r\nmodule load apps\/gcc\/partmc\/2.6.1 tools\/gcc\/gnuplot\/5.2.7\r\n\r\n# Go to your local copy of the emission files\r\ncd ~\/scratch\/emission\r\n\r\n# Run a single test\r\nctest -R bidisperse   # argument is a regexp for test names\r\n\r\n# Run test with visible output or to make plots from the tests.\r\n.\/test_emission_1.sh\r\n.\/test_emission_2.sh\r\n.\/test_emission_3.sh            \r\ngnuplot -persist plot_species.gnuplot \r\n\r\n<\/pre>\n<p>Submit the jobscript using:<\/p>\n<pre>sbatch <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<p>If you need more RAM (memory) to complete the analysis successfully, and you may well do!, please add the flags mentioned at the <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/batch-slurm\/high-memory-jobs-slurm\/\">high-memory jobs<\/a> page for more information.<\/p>\n<p><!-- omitted and to be included in the partmc-mosaic app page, provided it as an example to the user for isr672546\n\n\n<h3>Example of task-array batch job submission<\/h3>\n\n\n\n\n<pre>\r\ncp -r \/opt\/apps\/apps\/gcc\/partmc\/2.6.1\/scenarios\/*_urban_plume* ~\/scratch\/task-array\r\n<\/pre>\n\n\nCreate a batch submission script (which will load the modulefile in the jobscript), for example:\n<\/output><\/output>\n\n\n<pre>!\/bin\/bash --login\r\n#SBATCH -p serial     # Job will use 1 core for each task\r\n#SBATCH -t 4-0        # Wallclock time limit - each task will run for up to 4 days (0 hours)\r\n\r\n#SBATCH -a 1-10     # An array job with 10 \"tasks\", numbered 1...10\r\n                      # (Note: unlike CSF3 \"SGE\" job array, SLURM job arrays can also start at 0)\r\n# Choose your required version and load the module\r\nmodule load apps\/gcc\/partmc-mosaic\/22.0 tools\/gcc\/gnuplot\/5.2.7 \r\n\r\n#exit on error\r\nset -e\r\n\r\n#array for scripts\r\ndeclare -a array\r\narray=(1_run.sh 2_process.sh 3_plot.sh)\r\n\r\necho \"The jobID if needed is : $JOB_ID\"\r\n\r\nI=${SLURM_ARRAY_TASK_ID}\r\necho \"The taskID $I that will be used to access the scenario dir\"\r\n\r\ncd ${I}_urban_plume\/\r\necho \"I am in \"\r\npwd\r\n\r\n\r\n#create the out dir\r\nif [ ! -d \"out\" ]; then\r\n   mkdir out;\r\nelse\r\n   echo \"Dir out exists\"; \r\nfi\r\n\r\n#if (( ${#array[@]}!= 0)); then echo not empty; else echo empty;fi\r\n#check for each script in the array if the script is not empty,\r\n#non-zero, and that the files exist\r\nfor i in ${array[@]}; \r\n    do \r\n\tif [ ! -z \"$i\" ] && [ -e \"$i\" ] && [ -n \"$i\" ]\r\n\tthen\r\n\t   FINDANDREPLACE='s,..\/..\/build\/,,'\r\n           sed -i -e $FINDANDREPLACE \"$i\"\r\n\t   .\/$i\r\n    else \r\n\t   echo \"something is wrong, file ${array[i]} not found\";\r\n\tfi; \r\ndone\r\n\r\ncd ..\/\r\n<\/output><\/pre>\n\n\n--><\/p>\n<h2>Further info<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/compdyn\/partmc\">Github<\/a><\/li>\n<li><a href=\"http:\/\/lagrange.mechse.illinois.edu\/partmc\/partmc-2.6.1\/doc\/html\/index.html\">User Documentation<\/a><\/li>\n<li><a href=\"https:\/\/partmc-hpc.readthedocs.io\/en\/latest\/\">Installation<\/a><\/li>\n<\/ul>\n<h2>Updates<\/h2>\n<p>None.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Particle-resolved Monte Carlo (PartMC) code for atmospheric aerosol simulation is mainly modern Fortran, with a few parts still clearly showing their Fortran 77 heritage. Fortran 2003 features are used heavily (especially allocatable array features). The PartMC suite includes a number of programs, amongst them being: partmc \u2013 the main partmc command reads .spec files and does the run specified therein. numeric_diff \u2013 compare two files containing numerical arrays and check whether they are the.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/partmc\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":86,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6906","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/6906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=6906"}],"version-history":[{"count":20,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/6906\/revisions"}],"predecessor-version":[{"id":11156,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/6906\/revisions\/11156"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/86"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=6906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}