Closed AlfredMayhew closed 4 years ago
Hi Alfie, nice to meet you.
On the first point, could you provide more detail? What errors do you get, and at what stage? During the python conversion, compilation, or at runtime? I'm not aware of any specific line-length limit (though my memory may fail me here). It may be that you're hitting your Fortran compiler's line-length limit, so if you can provide your compiler version that might be useful.
On the second point, this is controlled by maxSpecLength
as defined at https://github.com/AtChem/AtChem2/blob/d01a5d904513aa36c8b023de15d70bdd41033cbb/src/dataStructures.f90#L74 . That value should be OK to lift without incident - please let me know if it does trigger any incorrect behaviour.
Sam
Hi Sam, thanks for your response.
I think the error is due to truncation by the fortran compiler. I'm running on Ubuntu with gfortran, GNU Fortran (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0. I've copied the output from the terminal below for reference:
- facsimile mechanism file: model/test.fac
- fortran mechanism directory [ default = ./model/configuration/ ]:
- mcm data files directory [ default = ./mcm/ ]:
call mech_converter.py /home/alfie/AtChem2 (copy)/model Running fix_fac_file on /home/alfie/AtChem2 (copy)/model/test.fac /home/alfie/AtChem2 (copy)/model/test.fac: file read in 82 items 1 corrections made - now removing old Reading input file looping over inputted RO2s adding RO2 to model/configuration/mechanism.ro2
make sharedlib gfortran -c model/configuration/mechanism.f90 -ffree-form -fimplicit-none -Wall -Wpedantic -Wno-unused-dummy-argument -fcheck=all -fPIC -shared -o model/configuration/mechanism.o -Jobj model/configuration/mechanism.f90:24:132:
00000000000000000000000000000000000000000000000000000000000000000000001 !% 1.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 : ABCDEFGHIJKLMNOPQRSTUVWXYZ = B ; 1 Error: Line truncated at (1) [-Werror=line-truncation] f951: some warnings being treated as errors Makefile:145: recipe for target 'sharedlib' failed make: *** [sharedlib] Error 1
With regards to the maxSpecLength, I changed the value to 50, but the output species only has 15 characters. I tried reducing it to 5, and the species outputted with 5 characters, but it doesn't seem to want to go above 15.
Thanks for your help, Alfie
Hi Alfie,
Ok, the printing itself is being controlled by the output format - see https://github.com/AtChem/AtChem2/blob/d01a5d904513aa36c8b023de15d70bdd41033cbb/src/outputFunctions.f90#L359 for example - '100A15' means it can print up to 100 columns of 15-character strings. So if you increase that (and look through that file to see other places where that's used) that should fix your issue.
If you also change the 15
in https://github.com/AtChem/AtChem2/blob/d01a5d904513aa36c8b023de15d70bdd41033cbb/src/outputFunctions.f90#L368 to match, then the column values will continue to line up with the column headers, if you want that to continue.
On the compilation, please try adding the -ffree-line-length-none
argument to FSHAREDFLAGS
on line 70 of the Makefile.
If that fix works for you, I'd certainly appreciate that being raised as a Pull Request 😄
Thanks very much, that seems to solve all the issues. I also adjusted to 100 part of the 100A15 phrase as I was running into issues with the grouping of species into sets of 100 in the output file. I will put the pull request through soon.
Thanks again for all your help, it will certainly make my workflow easier and speed up my running time for the models.
Alfie
Hi, I have run into some problems with the truncation of lines in AtChem2. The two instances are described below:
A limit of ~125 characters on rates defined under the "Generic Rate Coefficients" and "Complex reactions", a similar limit applies when the rates are defined lower in the file, before a reaction definition. Clearly 125 characters is quite large, but I have found myself wanting to use definitions longer than this and have to split the definition into smaller chunks, which makes the mechanism file quite long.
More significant is the limit of ~10 characters on species names in output files. I think the names are carried through the calculations fine, it is just when they are outputted that the end of the species name gets trimmed off. This leads to two species such as "ABCDEFGHIJONE" and "ABCDEFGHIJTWO" both being represented in the output files as "ABCDEFGHIJ". This is not such an issue if implementing mechanism files straight from the MCM (as the species generally have quite short names), but I have found it quite easy to reach this 10 character limit.
I would be grateful if somebody could point me to the code setting these limits so I could increase them for my own purposes, even if it is not deemed necessary for an update (files from the MCM do not run into these issues).
Thanks, Alfie