The mysterious N variable defines the number of atoms in simple cubic silver lattice, with is 180 so I put an array of the size of 180 instead of N. The L_X, L_Y, L_Z are size of lattice.
Corrected code is below but it still gives me wrong values.
PROGRAM SC
integer :: i, j, k
integer...
Yes of course, but I do not now how to write it in fortran. That why i put it on that forum.
I know where most of the mistakes are, but i do not now how to make it work.
U aren't really helping, you just stated the obvious. There is only 180 atoms in sc lattice so there is no need for using 1000 array. There is nothing wrong with REAL declarations.
Also I have no idea what that variable N does in the program. (I have not written that C code, and do not fully...
So far I've got this, but it gives me wrong values
PROGRAM SC
integer :: i, j, k
integer :: n = 0
REAL :: A = 4.08
REAL :: L_X = 20.0
REAL :: L_Y = 20.0
REAL :: L_Z = 15.0
INTEGER :: N
INTEGER :: iMax
INTEGER :: jMax
INTEGER :: kMax
REAL, DIMENSION(180) :: x
REAL...
Hello
Could anyone help me rewrite following C code to Fortran code? It generates coords for sc silver atoms.
#include <stdio.h>
#include <math.h>
int main(void) {
int
i, j, k,
n = 0;
double
A = 4.08,
L_X = 20.0,
L_Y = 20.0,
L_Z = 15.0;
int
iMax = ceil(L_X/A)...