|
|
Joined: Oct 2008
Posts: 55
Forum Member
|
OP
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
|
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
Forum Member
|
OP
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
|
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
Forum Member
|
OP
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
|
Forum Member
Joined: Sep 2003
Posts: 4,883 Likes: 12 |
ie, to check for programmer errors.
Lennart Nilsson Karolinska Institutet Stockholm, Sweden
|
|
|
|
|
|