Additional features in EMIL
Hi everyone,
In brief: Is it possible to add comparisons beyond just "=" in forks and also string operations to EMIL? I am asking because of the following case:
I have tried to run a calculation with 16 jobs using Emil loops and forks: 8 jobs are singlets and 8 are triplets in the D2h group with 8 representations. That is a nice case for such a tool. However, it took me quite a while to format the file names for the RASSI calculation as "JOB%03i" and I failed. I could imagine two ways here: 1) (preferred) to use printf (or printf -v if it were bash and not sh) 2) make a fork for files with numbers <10 and >=10 and to construct the filenames manually for cases with one and two digits.
However, neither of the ways worked because printf behaves differently inside Molcas and in plain /bin/sh. It does not properly resolve the variable in the filename and puts literally "$(printf '%03i' $ITER)" instead of it regardless of
"...", $..., or ${!...}. It seems that Emil works properly only for numerical variables but not strings. Operations with strings are not available directly, if I do something with >>SHELL and >>EXEC the result is the same: "JOB$(printf '%03i' $ITER)". I cannot even automatically construct the name line for IphNames for RASSI just using JOB1;JOB2;... because of the same problem with resolving the values of string variables. >>EVAL also works only with numbers. Further, comparisons beyond just "=" (e.g., <10 and >=10) are not available in emil what makes proper forking impossible.
I also tried to start from $ITER=10, but then RASSI does not take my JOB010, ... JOB025 automatically as it obviously assumes them to start from JOB001.
Is there some obvious workaround that I missed? Could it be then put into the manual?
The minimal example for my case is given below:
\>>EVAL ITER=0
foreach SPIN in (1,3)
foreach SYM in (1 .. 8)
&RASSCF
...
\>>EVAL ITER=$ITER+1
\>>export NUM=$(printf '%03i' $ITER)
\>>COPY \$Project.rasscf.h5 JOB\$NUM
enddo
enddo
&RASSI
Nr of JobIphs = 16 all
IPhNames= JOB1;JOB2;JOB3;JOB4;JOB5;JOB6;JOB7;JOB8;JOB9;JOB10;JOB11;JOB12;JOB13;JOB14;JOB15;JOB16