Skip to main content
U.S. flag

An official website of the United States government

Here’s how you know

Official government website icon

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

icon-https

Secure .gov websites use HTTPS
A lock ( Lock Locked padlock icon )or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

NIH: National Institute of Diabetes and Digestive and Kidney Diseases NIH: National Institute of Diabetes and Digestive and Kidney Diseases

  next up previous contents index  Xplor-NIH home Documentation

Next: Example: A Simple Loop Up: Control Statements Previous: Control Statements

Example: A Conditional Test

This example either divides or multiplies the symbol $1 by a factor of two, depending on the value of the NOE energy ($NOE). In the first case, 40 steps of minimization are carried out, whereas in the latter case, 100 steps of minimization are carried out. Note that the indentation is arbitrary but can make the input file more readable.
if ($NOE > 10.0) then 
   evaluate ($1=$1/2.0) 
   minimize powell
     nstep=40 
  end
else
   evaluate ($1=$1*2.0)
   minimize powell
     nstep=100 
   end
end if


Xplor-NIH 2025-03-21
  • Privacy Policy
  • Freedom of Information Act
  • Accessibility
  • Disclaimers
  • Copyright
  • Vulnerability Disclosure Policy
  • U.S. Department of Health and Human Services
  • National Institutes of Health