Molcas Forum

Support and discussions for Molcas and OpenMolcas users and developers

You are not logged in.

Announcement

Welcome to the Molcas forum.

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".

#1 2023-05-25 14:41:40

xshatterstarx
Member
Registered: 2023-05-25
Posts: 1

About Label Mark and Goto Mark

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

#2 2023-05-25 15:37:11

Ignacio
Administrator
From: Uppsala
Registered: 2015-11-03
Posts: 1,012

Re: About Label Mark and Goto Mark

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

#3 2023-06-07 20:27:59

valera
Administrator
Registered: 2015-11-03
Posts: 124

Re: About Label Mark and Goto Mark

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 smile

Offline

Board footer

Powered by FluxBB 1.5.11

Last refresh: Today 22:54:53