Previous Thread
Next Thread
Print Thread
#21177 06/09/09 02:40 PM
Joined: Oct 2008
Posts: 55
Zhiguo Offline OP
Forum Member
OP Offline
Forum Member
Joined: Oct 2008
Posts: 55
Hi,
I was reading charmm source code, and got a little confused by the preprocessing construct "IF KEY (key)". Here is the documentation in prefx.f:
C-----------------------------------------------------------------------
C - Allows control line identifiers. For example:
C ##IF PERT (pertprint)
C ...
C ##ELSE (pertprint)
C ...
C ##ENDIF (pertprint)
C This construct checks the identifiers and prints a fatal
C error message if the identifiers do not match.
C-----------------------------------------------------------------------
Does it mean that it will check if PERT is in the keyword list, and will print "pertprint" if "PERT" is not in the list? Thanks!


---------------------------
CHARMM c32b1 driven by
RHEL 2.6.9-22.0.2 on PPC64
Joined: Sep 2003
Posts: 4,883
Likes: 12
Forum Member
Offline
Forum Member
Joined: Sep 2003
Posts: 4,883
Likes: 12
No.
It means that if PERT is in pref.dat the code between ##IF PERT and ##ELSE will be executed, else the code between ##ELSE and ##ENDIF is executed.


Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden
Joined: Oct 2008
Posts: 55
Zhiguo Offline OP
Forum Member
OP Offline
Forum Member
Joined: Oct 2008
Posts: 55
Yeah, I know that is true for "##IF KEY" construct. Then what's the meaning of stuff in the parenthesis, i.e. "pertprint"?


---------------------------
CHARMM c32b1 driven by
RHEL 2.6.9-22.0.2 on PPC64
Joined: Sep 2003
Posts: 4,883
Likes: 12
Forum Member
Offline
Forum Member
Joined: Sep 2003
Posts: 4,883
Likes: 12
Check for programmer errors.


Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden
Joined: Oct 2008
Posts: 55
Zhiguo Offline OP
Forum Member
OP Offline
Forum Member
Joined: Oct 2008
Posts: 55
Found the answer in developer.doc:

match-token :: unique text string in parentheses; must be the
same for each use in an ##IF ... ##ENDIF block


---------------------------
CHARMM c32b1 driven by
RHEL 2.6.9-22.0.2 on PPC64
Joined: Sep 2003
Posts: 4,883
Likes: 12
Forum Member
Offline
Forum Member
Joined: Sep 2003
Posts: 4,883
Likes: 12
ie, to check for programmer errors.


Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Moderated by  lennart, rmv 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Release build 20201027)
Responsive Width:

PHP: 7.3.31-1~deb10u5 Page Time: 0.014s Queries: 26 (0.010s) Memory: 0.7534 MB (Peak: 0.8106 MB) Data Comp: Off Server Time: 2023-12-10 17:56:19 UTC
Valid HTML 5 and Valid CSS