opal AT lists.psi.ch
Subject: The OPAL Discussion Forum
List archive
- From: Simon Friederich <sifriede AT uni-mainz.de>
- To: "Snuverink Jochem (PSI)" <jochem.snuverink AT psi.ch>, "Adelmann Andreas (PSI)" <andreas.adelmann AT psi.ch>
- Cc: "opal AT lists.psi.ch" <opal AT lists.psi.ch>
- Subject: Re: [Opal] Arrays and tables
- Date: Sat, 8 Aug 2020 12:37:03 +0200
- Authentication-results: localhost; iprev=pass (ironport-2.zdv.net) smtp.remote-ip=134.93.178.242; spf=pass smtp.mailfrom=uni-mainz.de; dkim=pass header.d=uni-mainz.de header.s=20190702 header.a=rsa-sha256; dmarc=pass header.from=uni-mainz.de
- Ironport-phdr: 9a23:ryTfhxONb3JJjFb4rNgl6mtUPXoX/o7sNwtQ0KIMzox0K/76rsbcNUDSrc9gkEXOFd2Cra4d1ayG7+u4ByQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagYL5+Nha7oAreusUKgIZpN7o8xAbOrnZUYepd2HlmJUiUnxby58ew+IBs/iFNsP8/9MBOTLv3cb0gQbNXEDopPWY15Nb2tRbYVguA+mEcUmQNnRVWBQXO8Qz3UY3wsiv+sep9xTWaMMjrRr06RTiu86FmQwLzhSwZKzA27n3Yis1ojKJavh2hoQB/w5XJa42RLfZyY7/Rcc8fSWdHQ81fVTFOApmkYoUSEeQBM+ZWr47+qVUAoxSxCgujC//uyjJTnHD6wbc33v49HQzI3gEtGc8FvnTOrNXyMacfSf27zKjNzTXEafNdxDfz6JLJch8/vP6DQ6hwccvNxkkvCgjIiU6QqY3rPzOP1+QCrXWU4PR7WOKyjW4nqhh9oj21ycctjInIh5gZxU3a+ihgxos+ONK3RlJhb9G+DJtQqz+VN5FwQs46R2xlpSg3xL0atJO5cyYHy5cqyRHCZvGabYSF4w/vWeieLDtkhH9odr2xihew/Eau1uHwS9e53VhE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m8ch/wCXBLswQHS/7IIMqJ12TgyhOOSWfZneIFFaeXlgaaCAn6OL1VPVDaN OfkPF3xDQLJRX57iktwuhMRz97T2ZHbB2aMuyKJQXZFIjZkXvgHsJGeWj5D9oE2bBZDEm9lmus xL9z6Kxgmi0BRbP0GHjo5MtN0+Jb9TR819qsCM0RRO/L9uvOX7NqrLVoVM5gDTgRH4dGPPfMfP WXk=
- Organization: Institut für Kernphysik, JGU Mainz
Hello Joachem and Andreas, Thank you for your replies. Yes, I've figured out, that I missed "vector" in the array declaration. But I still can't access single elements: ... ==>REAL vector myvector = {1,2,3}; 1 REAL vector myvector = {1,2,3}; ==>VALUE, myvector[0]; 2 VALUE, myvector[0]; Error> Error> *** Parse error detected by function "OpalParser::parseEnd()" Error> *** in line 2 of file "standard input" before token "[": Error> VALUE,MYVECTOR[0]; Error> ^ Error> Syntax error (maybe missing comma or semicolon ? ) I'm I missing something here? Best regards, Simon
Am 07.08.2020 um 15:40 schrieb
Snuverink Jochem (PSI):
Dear Simon,
As Christof wrote in the bug report, the correct syntax is “REAL VECTOR= {}; I am not aware of the option of 2D-arrays.
So perhaps then:
REAL VECTOR volts = {7.5, 8.0, 8.5, 9.0, 9.5}; REAL VECTOR lags = {239.32815,... }; pb1: RFCAVITY, ...., VOLT = volts[0] * 1e-3, LAG = lags[0] * PI / 180, ...;
Note that you can also do:
REAL VECTOR volts = {7.5, 8.0, 8.5, 9.0, 9.5} * 1e-3; // in MV REAL VECTOR lags = {239.32815,... } * PI / 180; // in rads
pb1: RFCAVITY, ...., VOLT = volts[0], LAG = lags[0], ...;
Best wishes, Jochem
From: opal-request AT lists.psi.ch
<opal-request AT lists.psi.ch>
On Behalf Of Adelmann Andreas (PSI)
Dear Simon, indeed it seams that he array feature is broken. Even a one dimensional real array does not work. I will file a bug report. Thanks for reporting!
Cheers A ------
-- ----------------------------------- Dr. Simon Friederich Helmholtz-Institut Mainz Kollaboration B/ACID Johannes Gutenberg-Universität Mainz Staudingerweg 18 55128 Mainz, Deutschland Tel.: +49 (0)6131 39-23160 E-Mail: sifriede AT uni-mainz.de ---------------------------------------- |
- [Opal] Arrays and tables, Simon Friederich, 08/05/2020
- Re: [Opal] Arrays and tables, Adelmann Andreas (PSI), 08/07/2020
- RE: [Opal] Arrays and tables, Snuverink Jochem (PSI), 08/07/2020
- Re: [Opal] Arrays and tables, Simon Friederich, 08/08/2020
- Re: [Opal] Arrays and tables, Adelmann Andreas (PSI), 08/08/2020
- Re: [Opal] Arrays and tables, Simon Friederich, 08/08/2020
- RE: [Opal] Arrays and tables, Snuverink Jochem (PSI), 08/07/2020
- Re: [Opal] Arrays and tables, Adelmann Andreas (PSI), 08/07/2020
Archive powered by MHonArc 2.6.19.