Support and discussions for Molcas and OpenMolcas users and developers
You are not logged in.
Please note: The forum's URL has changed. The new URL is: https://molcasforum.univie.ac.at. Please update your bookmarks!
You can choose an avatar and change the default style by going to "Profile" → "Personality" or "Display".Pages: 1
Greetings!
I have a script that can loop through molecular geometry present in multiple files. For instance, if I have 2 files, mol1.xyz and mol2.xyz, I can loop through the files using this script
>>foreach imol in (1, 2)
&GATEWAY
Coord = mol$imol.xyz
>>enddo
Now, I wish to further expand the functionality by looping through multiple molecular coordinates present in a single file, as shown below. We can name this mol.xyz
3
Angstrom
O 0.000000 0.000000 0.000000
H 0.758602 0.000000 0.504284
H 0.758602 0.000000 -0.504284
8
Angstrom
O -1.808864 -0.137998 0.000000
C 1.769114 0.136549 0.000000
C 0.588145 -0.434423 0.000000
C -0.695203 0.361447 0.000000
H -0.548852 1.455362 0.000000
H 0.477859 -1.512556 0.000000
H 2.688665 -0.434186 0.000000
H 1.880903 1.213924 0.000000
I was thinking of using the Goto Mark and Label Mark now so that the loop works for all molecules in the input files. I was wondering if I could see some examples of the Label Mark and Goto Mark EMIL commands since there aren't many listed online. It'd great if someone could suggest how I could possibly achieve my desired result here.
Offline
It most likely won't work. Not if you have the geometries in an external file, and even if you write everything inline, you can't use EMIL commands inside an program's input block, just between them. At least with OpenMolcas.
A simple example, simulating a DOWHILE loop:
>>> EXPORT DO_LOOP=1
>>> FOREACH ITER in ( 1 .. $MOLCAS_MAXITER )
>>> IF ( $DO_LOOP=0 ) goto END_LOOP
&SEWARD
&SCF
&SLAPAF
>>> EXPORT DO_LOOP=$EMIL_RETURNCODE
>>> ENDDO
>>> LABEL END_LOOP
Offline
xshatterstarx, according to EMIL specification all environment variables are in uppercase!
So, if I change imol to IMOL, moclas.plx correctly handles your input. Not sure about pymolcas
Offline
Pages: 1