[CP2K-user] [CP2K:16741] New user

Matthew Ayoola ayoolaimisi at gmail.com
Sat Mar 19 13:51:53 UTC 2022


Hi Thomas,

Thank you so much for coming through and writing the code for me. Please, I 
have been trying to look for an interface to run this fortran 90 code but I 
have not seen any. And I am having a big issue converting the f90 to 
python3. Do you know any website to run f90 online? Or could you convert 
this f90 code to python3 since that is what I am learning to use? Though I 
am currently working on this conversion, I will send it here if I am able 
to get it done, I just want to be sure if you can also help with that while 
I am still on it. 

I will be expecting your reply.

Best regards,
Matthew


PROGRAM si

  INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(14,200),&
                        natom = 8
  REAL(dp) :: a,b,c
  INTEGER  :: i,j,k,na,nb,nc

  CHARACTER(LEN=2), DIMENSION(natom) :: label =&
    (/"Si","Si","Si","Si","Si","Si","Si","Si"/)
  REAL(KIND=dp), DIMENSION(natom,3) :: unit_cell

  a = 5.431_dp
  b = a
  c = a

  unit_cell(1,:) = (/0.000000,0.000000,0.000000/)
  unit_cell(2,:) = (/0.000000,0.500000,0.500000/)
  unit_cell(3,:) = (/0.500000,0.000000,0.500000/)
  unit_cell(4,:) = (/0.500000,0.500000,0.000000/)
  unit_cell(5,:) = (/0.250000,0.250000,0.250000/)
  unit_cell(6,:) = (/0.750000,0.750000,0.250000/)
  unit_cell(7,:) = (/0.750000,0.250000,0.750000/)
  unit_cell(8,:) = (/0.250000,0.750000,0.750000/)

  READ (*,*) na,nb,nc

  WRITE (11,"(I5,/,3(I2,A),F8.4,A)") natom*na*nb*nc,&
    na," x",nb," x",nc," silicon diamond structure,&
    a =",REAL(na,dp)*a," Angstrom"

  DO i=0,na-1
    DO j=0,nb-1
      DO k=0,nc-1
        DO iatom=1,natom
          WRITE (10,"(A2,2X,3F12.6)") label(iatom),&
            (unit_cell(iatom,:) + REAL((/i,j,k/),dp))/REAL((/na,nb,nc/),dp)
          WRITE (11,"(A2,2X,3F12.6)") label(iatom),&
            (unit_cell(iatom,:) + REAL((/i,j,k/),dp))*(/a,b,c/)
        END DO
      END DO
    END DO
  END DO

END PROGRAM si




On Saturday, March 19, 2022 at 5:43:32 AM UTC-4 tkuehne wrote:

> Dear Matthew, 
>
> using the following small program you can generate arbitrary 
> replications of the unit cell of Si in the diamond structure. I.e. 
> entering 2 2 2 should do the job … 
>
> Best, 
> Thomas
>

-- 
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/6bee4ae1-d3a6-4710-8574-883c57d28dcfn%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20220319/05915383/attachment.htm>


More information about the CP2K-user mailing list