INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

array of dot positions

array of dot positions

(OP)
Hello,
I am new to fortran. I have a task to do.
I have code for making grid of positions (X and Y coordinates) with two DO loops:
PROGRAM Dot_Coordinates
IMPLICIT NONE
INTEGER :: IMAX,IMIN,JMAX,JMIN, NN, MM, I, J, K, A1, M
INTEGER, DIMENSION (500) :: XX,YY
OPEN(11,FILE='Dot_Positions.dat',STATUS='UNKNOWN')
A1=1D0
IMAX=3 ! imax =3....
IMIN=-(2*IMAX-1)
IMAX=2*IMAX
JMAX=3 ! Jmax = 3
JMIN=-(2*JMAX-1)
JMAX=2*JMAX
K=1
DO 52 I=1,IMAX
MM=IMIN+2*(I-1)
DO 52 J=1,JMAX
NN=JMIN+2*(J-1)
XX(K)=MM*A1
YY(K)=NN*A1
WRITE(11,*) XX(K),YY(K)
K=K+1
52 CONTINUE
END PROGRAM Dot_Coordinates

When I open this file in OriginPro and plot it it give 36 dots in corner of squares.
I have to change this code the way that dot coordinates are not in corners of squares, but in corners of rhombus.
Picture is in attachment. Red dot is centre of coordinate system (0,0), and angles of rhombus are alpha=60 and beta=120 degree (its made of two equilateral triangles).

RE: array of dot positions

Hi,

So what's the business case for this exersize? It certainly sounds to me like a classroom problem.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: array of dot positions

(OP)
Dots are positions of atoms in face centered cubic crystal structure, but in certain directions.
Part of code that I copy/paste is [100] direction, and one I need is [111] direction.
But I already did it myself.
Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close