From d7d022f64f5bf6784d7f8d2654310e982842fae9 Mon Sep 17 00:00:00 2001 From: Shahram Date: Thu, 22 Jul 2021 02:00:36 +0430 Subject: [PATCH] v1.6.8.beta add gfrortran comp. --- soc/Eatools_2Dpoisson.f90 | 3 ++- soc/Eatools_aniso.f90 | 9 +++++++- soc/Eatools_api.f90 | 31 +++++++++++++++------------- soc/Eatools_main.f90 | 4 ++-- soc/Eatools_welc.f90 | 4 ++-- soc/Makefile | 26 ++++++++++++++--------- soc/agr_main.f90 | 2 +- soc/agr_polar.f90 | 12 ++++++++--- soc/gnu_main.f90 | 35 +++++++++++++++++++++++-------- soc/run_path.sh | 43 +++++++++++++++++++++++++-------------- soc/wrl_main.f90 | 2 +- 11 files changed, 112 insertions(+), 59 deletions(-) diff --git a/soc/Eatools_2Dpoisson.f90 b/soc/Eatools_2Dpoisson.f90 index ddc0a2b..9c5038a 100644 --- a/soc/Eatools_2Dpoisson.f90 +++ b/soc/Eatools_2Dpoisson.f90 @@ -41,7 +41,8 @@ SUBROUTINE poisson_2D(vv11,vv22,vv33,phi,phi_poisson,MaxPratio,MinPratio,l) MaxPratio=phi_poisson(l) END IF IF (phi_poisson(l).LE.MinPratio) THEN - MinPratio=phi_poisson(l) + MinPratio=phi_poisson(l) + !write(*,*) MinPratio END IF END IF end SUBROUTINE diff --git a/soc/Eatools_aniso.f90 b/soc/Eatools_aniso.f90 index 04fe208..006917f 100644 --- a/soc/Eatools_aniso.f90 +++ b/soc/Eatools_aniso.f90 @@ -6,12 +6,19 @@ ! SUBROUTINE: fOR 3D MATERIAL , Detection of anisotropy elastic modulus. subroutine anisotropy(ma,mi,Axx) + USE ieee_arithmetic implicit NONE DOUBLE PRECISION :: mi, ma, Axx if (mi > 0) then Axx=ma/mi else - Axx=1d0/0.d0 + !Axx=1d0/0.0d0 + IF (ieee_support_inf(Axx)) THEN + Axx = ieee_value(Axx, ieee_negative_inf) + END IF endif End subroutine + + + diff --git a/soc/Eatools_api.f90 b/soc/Eatools_api.f90 index 126e42b..723ba62 100644 --- a/soc/Eatools_api.f90 +++ b/soc/Eatools_api.f90 @@ -3,20 +3,23 @@ subroutine aip_get_online(mpid) character (len=175), dimension(17) :: char3 character (len=16) :: key,mpid INTEGER :: i -key='32O9CtVDAwGz8UZk' -open(12, file="/home/shahram/Desktop/Cubelast/code/programMY/AAEP/soc/eatools_v1.6.4/db/api.bin") +key='0000000000' open(13, file="aip.py") - do i=1,12 - read(12,"(Z)") char3(i) -enddo -close(12) -write(13,"(A)") '#!/usr/bin/env python3' -write(13,"(3A)")"id_com='",trim(mpid),"'" -write(13,"(3A)") 'api_key= "',key,'"' -do i=2,12 - write(13,"(A)")char3(i) -enddo -close(13) + write(13,"(A)") '#!/usr/bin/env python3' + write(13,"(3A)")"id_com='",trim(mpid),"'" + write(13,"(3A)") 'api_key= "',key,'"' + write(13,"(A)") 'import os' + write(13,"(A)") 'from pymatgen import MPRester, Structure' + write(13,"(A)") 'from pymatgen.analysis.elasticity import ElasticTensor' + write(13,"(A)") 'with MPRester(api_key) as m: ' + write(13,"(A)") ' data = m.get_data(id_com)[0] ' + write(13,"(A)") " elastic_tensor = ElasticTensor.from_voigt(data['elasticity']['elastic_tensor'])" + write(13,"(A)") " print (elastic_tensor[0][0][0][0],elastic_tensor[0][0][1][1],elastic_tensor[0][0][2][2],elastic_tensor[0][0][1][2],elastic_tensor[0][0][2][0],elastic_tensor[0][0][0][1])" + write(13,"(A)") " print (elastic_tensor[1][1][0][0],elastic_tensor[1][1][1][1],elastic_tensor[1][1][2][2],elastic_tensor[1][1][1][2],elastic_tensor[1][1][2][0],elastic_tensor[1][1][0][1])" + write(13,"(A)") " print (elastic_tensor[2][2][0][0],elastic_tensor[2][2][1][1],elastic_tensor[2][2][2][2],elastic_tensor[2][2][1][2],elastic_tensor[2][2][2][0],elastic_tensor[2][2][0][1])" + write(13,"(A)") " print (elastic_tensor[1][2][0][0],elastic_tensor[1][2][1][1],elastic_tensor[1][2][2][2],elastic_tensor[1][2][1][2],elastic_tensor[1][2][2][0],elastic_tensor[1][2][0][1])" + write(13,"(A)") " print (elastic_tensor[2][0][0][0],elastic_tensor[2][0][1][1],elastic_tensor[2][0][2][2],elastic_tensor[2][0][1][2],elastic_tensor[2][0][2][0],elastic_tensor[2][0][0][1])" + write(13,"(A)") " print (elastic_tensor[0][1][0][0],elastic_tensor[0][1][1][1],elastic_tensor[0][1][2][2],elastic_tensor[0][1][1][2],elastic_tensor[0][1][2][0],elastic_tensor[0][1][0][1])" + close(13) End subroutine - diff --git a/soc/Eatools_main.f90 b/soc/Eatools_main.f90 index 5b00014..63eae74 100644 --- a/soc/Eatools_main.f90 +++ b/soc/Eatools_main.f90 @@ -17,7 +17,7 @@ PROGRAM AAEP_main yn_veloc,& !> Being in a database is "Y" order CHARACTER(LEN=25) :: myid !> for databank - REAL :: CLaS,phi_meah,theta_meah,cutmesh + INTEGER :: CLaS,phi_meah,theta_meah,cutmesh DOUBLE PRECISION, PARAMETER :: pi=3.14159265358979323846264338327950D0,ee=0.0001D0 DOUBLE PRECISION, DIMENSION(6,6) :: C1p=0D0,S1=0D0,C=0D0,S=0D0,CP=0D0,C3=0D0,CCo=0d0,Eig3d DOUBLE PRECISION, DIMENSION(10100) :: shear2dmax, Ax,& @@ -392,7 +392,7 @@ PROGRAM AAEP_main WRITE(7,50) C(3,1),C(3,2),C(3,3),C(3,4),C(3,5),C(3,6) WRITE(7,50) C(4,1),C(4,2),C(4,3),C(4,4),C(4,5),C(4,6) WRITE(7,50) C(5,1),C(5,2),C(5,3),C(5,4),C(5,5),C(5,6) - WRITE(7,50) C(6,1),C(6,2),C(6,3),C(6,4),C(6,5),C(6,6) + WRITE(7,50) C(6,1),C(6,2),C(6,3),C(6,4),C(6,5),C(6,6) CLOSE(7) 50 format(6F9.4) CLOSE(5) diff --git a/soc/Eatools_welc.f90 b/soc/Eatools_welc.f90 index f4acaa9..aa8c903 100644 --- a/soc/Eatools_welc.f90 +++ b/soc/Eatools_welc.f90 @@ -18,7 +18,7 @@ SUBROUTINE WELCOME() WRITE(*,'(a)')" |______||_| \__,_||_| \___/ \___/ |_||___/ " WRITE(*,'(a)')" 45 6C 41 74 6F 6F 6C 73 " WRITE(*,'(a)')'========= Shahram Yalameha (c) 2018 ===========' -WRITE(*,'(a)')' v1.6.6 ' +WRITE(*,'(a)')' v1.6.8 ' WRITE(*,'(a)')' From ' WRITE(*,'(a)')' Elastic Tools Project ' WRITE(*,*)' ' @@ -36,7 +36,7 @@ SUBROUTINE WELCOME() WRITE(99,'(a)')" |______||_| \__,_||_| \___/ \___/ |_||___/ " WRITE(99,'(a)')" 45 6C 41 74 6F 6F 6C 73 " WRITE(99,'(a)')'========= Shahram Yalameha (c) 2018 ===========' -WRITE(99,'(a)')' v1.6.6 ' +WRITE(99,'(a)')' v1.6.8 ' WRITE(99,'(a)')' From ' WRITE(99,'(a)')' Elastic Tools Project ' WRITE(99,*)' ' diff --git a/soc/Makefile b/soc/Makefile index c882104..4194d5f 100644 --- a/soc/Makefile +++ b/soc/Makefile @@ -13,14 +13,22 @@ #---------------- compiler ----------------- -FC = ifort + FC = ifort +#FC = gfortran #------------- compiler options ------------ -FOPT = -O2 -FR -mp1 -w -prec_div -pc80 -pad -ip -DINTEL_VML -traceback -assume buffered_io -pthread -I$(MKLROOT)/include -FGEN = -O2 -FR -mp1 -w -prec_div -pc80 -pad -ip -DINTEL_VML -traceback + FOPT = -O2 -FR -mp1 -w -prec_div -pc80 -pad -ip -DINTEL_VML -traceback -assume buffered_io -pthread -I$(MKLROOT)/include # for ifort v19 > + FGEN = -O2 -FR -mp1 -w -prec_div -pc80 -pad -ip -DINTEL_VML -traceback # for ifort v19 > + + #FOPT = -ffree-form -O2 -ffree-line-length-none # for gfortran +# FGEN = -ffree-form -O2 -ffree-line-length-none # for gfortran + #-------------- loader options ------------- -LDFLAGS = $(FOPT) -L$(MKLROOT)/lib/$(MKL_TARGET_ARCH) -pthread -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -qopenmp -lpthread + #LDFLAGS = $(FOPT) -lblas -llapack -lpthread # for gfortran + + + LDFLAGS = $(FOPT) -L$(MKLROOT)/lib/$(MKL_TARGET_ARCH) -pthread -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -qopenmp -lpthread # for ifort v19 > ############################################################################### @@ -33,14 +41,14 @@ EXECNAME1 = dat2wrl.x EXECNAME2 = dat2agr.x EXECNAME3 = dat2gnu.x EXECNAME4 = dens_lapw -EXECNAME4 = dat2html.x + EXEC = $(DESTDIR)$(EXECNAME) EXEC1 = $(DESTDIR)$(EXECNAME1) EXEC2 = $(DESTDIR)$(EXECNAME2) EXEC3 = $(DESTDIR)$(EXECNAME3) EXEC4 = $(DESTDIR)$(EXECNAME4) -EXEC5 = $(DESTDIR)$(EXECNAME4) + OBJS = Eatools_main.o Eatools_2Dyoung.o Eatools_2Dpoisson.o Eatools_2Dshear.o \ Eatools_2DMaxMin.o Eatools_2Danalyz.o Eatools_2D_proelast.o Eatools_2dPL.o \ @@ -55,8 +63,7 @@ OBJS2 = agr_autoset.f90 agr_curvef.f90 agr_main.f90 agr_minmax.f90 \ agr_polar.f90 agr_setplot.f90 agr_start.f90 agr_winend.f90 agr_win.f90 agr_fzero.o OBJS3 = gnu_main.o gnu_subs.o gnu_3dmap.o gnu_copyri.o OBJS4 = rho_main.o rho_mass.o -OBJS5 = html_colorscale.o html_gerdata.o html_scord.o html_strace.o html_elayout.o html_main.o html_setpare.o html_swin.o \ - html_etrace.o html_mincord.o html_stitle.o html_gerdata_velop.o html_gerdata_velog.o + $(EXEC): $(OBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) Makefile @@ -70,8 +77,7 @@ $(EXEC): $(OBJS) $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) Makefile @echo dat2gnu.x Created $(FC) -o $(EXEC4) $(OBJS4) $(FOPT) $(LDFLAGS) @echo dens. Created - $(FC) -o $(EXEC5) $(OBJS5) $(FOPT) $(LDFLAGS) - @echo dat2html.x Created + .SUFFIXES: .o .f90 .f90.o : diff --git a/soc/agr_main.f90 b/soc/agr_main.f90 index ceee597..e6b7150 100644 --- a/soc/agr_main.f90 +++ b/soc/agr_main.f90 @@ -257,7 +257,7 @@ PROGRAM data2D_to_agr !==== open(4,file='2dcut_bulk.dat',err=44) do i=1,361 - READ(4,*) theta2,rho2,rho3 + READ(4,*) theta2,rho2,rho3 if (val=='Box' .OR. val=='box' .OR. val=='bo') then; WRITE(2,'(F11.6,2X,F11.6)')theta2,rho3; endif if (val=='Polar' .OR. val=='polar' .OR. val=='po') then; CALL polar2xy(theta2,rho3,x,y); WRITE(2,'(F12.6,2X,F12.6)')x,y; endif enddo diff --git a/soc/agr_polar.f90 b/soc/agr_polar.f90 index e2eb992..ff86de2 100644 --- a/soc/agr_polar.f90 +++ b/soc/agr_polar.f90 @@ -7,7 +7,13 @@ ! SUBROUTINE: For 3D matereials; convert polat to plane for agr file SUBROUTINE polar2xy(theta,rho,x,y) - REAL(8) :: rho,x,y,theta - x = (rho*(COSD(theta))) - y = (rho*(SIND(theta))) + implicit none + DOUBLE PRECISION, PARAMETER :: pi=3.14159265358979323846264338327950D0 + REAL(8) :: rho,x,y,theta + + x = (rho*( COS(theta*pi/180.0d0) )) + y = (rho*( SIN(theta*pi/180.0d0) )) END SUBROUTINE polar2xy + + + diff --git a/soc/gnu_main.f90 b/soc/gnu_main.f90 index 52f7ad6..87b8c2d 100644 --- a/soc/gnu_main.f90 +++ b/soc/gnu_main.f90 @@ -30,7 +30,7 @@ PROGRAM gnu_conv clor_val = arg_mane(2) ! write(*,*) val,clor_val - IF (val == "-h" .OR. val == "")THEN + IF (val == "-h" .OR. val == "")THEN WRITE(*,*)'Using: dat2gnu.x [ Properties ] [hmap colors] in the DatFile_*** folder' WRITE(*,*)'' call system ("sleep 0.5") @@ -108,27 +108,44 @@ PROGRAM gnu_conv write(*,*)'=======' enddo -else - call ploter(val,clor_val) - endif - OPEN(22,file='.MaMiout') - READ(22,*) MAXyo - READ(22,*) MAXsh - READ(22,*) MAXpo -close(22) + ELSE + CALL ploter(val,clor_val) +Endif + + !WRITE(*,*)MAXyo,MAXsh, MAXpo IF (val=='2d' .OR. val=='2D') then + OPEN(22,file='.MaMiout') + READ(22,*) MAXyo + READ(22,*) MAXsh + READ(22,*) MAXpo + close(22) val='2dpoi'; call twoDplot(val,MAXpo, MAXyo, MAXsh) val='2dyoung'; call twoDplot(val,MAXpo, MAXyo, MAXsh) val='2dshear'; call twoDplot(val,MAXpo, MAXyo, MAXsh) endif IF (val=='2dpoi' .OR. val=='2dpoisson') then + OPEN(22,file='.MaMiout') + READ(22,*) MAXyo + READ(22,*) MAXsh + READ(22,*) MAXpo + close(22) val='2dpoi'; call twoDplot(val,MAXpo, MAXyo, MAXsh) endif IF (val=='2dyoung' .OR. val=='2dyoun') then + OPEN(22,file='.MaMiout') + READ(22,*) MAXyo + READ(22,*) MAXsh + READ(22,*) MAXpo + close(22) val='2dyoung'; call twoDplot(val,MAXpo, MAXyo, MAXsh) endif IF (val=='2dshear' .OR. val=='2dshea') then + OPEN(22,file='.MaMiout') + READ(22,*) MAXyo + READ(22,*) MAXsh + READ(22,*) MAXpo + close(22) val='2dshear'; call twoDplot(val,MAXpo, MAXyo, MAXsh) endif END PROGRAM diff --git a/soc/run_path.sh b/soc/run_path.sh index 478f307..7ea85f3 100755 --- a/soc/run_path.sh +++ b/soc/run_path.sh @@ -1,9 +1,17 @@ #!/bin/bash bold=$(tput bold) normal=$(tput sgr0) -echo "Specify path for db folder:" +echo " > Specify path for db folder:" echo > Go to ${bold}db${normal} folder and run ${bold}pwd${normal}, then copy the path here. read s +echo " > Do you want to use the online database? (y/n) " +read yn +if [ $yn == 'y' ];then + echo " >> Enter AIP KEY:" + read key + else + key=`echo 00000000` + fi sleep 1.5 cat > Eatools_db.f90 << EOF Subroutine databank(id,yesno) @@ -70,23 +78,28 @@ implicit none character (len=175), dimension(17) :: char3 character (len=16) :: key,mpid INTEGER :: i -key='32O9CtVDAwGz8UZk' -open(12, file="$s/api.bin") +key='$key' open(13, file="aip.py") - do i=1,12 - read(12,"(Z)") char3(i) -enddo -close(12) -write(13,"(A)") '#!/usr/bin/env python3' -write(13,"(3A)")"id_com='",trim(mpid),"'" -write(13,"(3A)") 'api_key= "',key,'"' -do i=2,12 - write(13,"(A)")char3(i) -enddo -close(13) + write(13,"(A)") '#!/usr/bin/env python3' + write(13,"(3A)")"id_com='",trim(mpid),"'" + write(13,"(3A)") 'api_key= "',key,'"' + write(13,"(A)") 'import os' + write(13,"(A)") 'from pymatgen import MPRester, Structure' + write(13,"(A)") 'from pymatgen.analysis.elasticity import ElasticTensor' + write(13,"(A)") 'with MPRester(api_key) as m: ' + write(13,"(A)") ' data = m.get_data(id_com)[0] ' + write(13,"(A)") " elastic_tensor = ElasticTensor.from_voigt(data['elasticity']['elastic_tensor'])" + write(13,"(A)") " print (elastic_tensor[0][0][0][0],elastic_tensor[0][0][1][1],elastic_tensor[0][0][2][2],elastic_tensor[0][0][1][2],elastic_tensor[0][0][2][0],elastic_tensor[0][0][0][1])" + write(13,"(A)") " print (elastic_tensor[1][1][0][0],elastic_tensor[1][1][1][1],elastic_tensor[1][1][2][2],elastic_tensor[1][1][1][2],elastic_tensor[1][1][2][0],elastic_tensor[1][1][0][1])" + write(13,"(A)") " print (elastic_tensor[2][2][0][0],elastic_tensor[2][2][1][1],elastic_tensor[2][2][2][2],elastic_tensor[2][2][1][2],elastic_tensor[2][2][2][0],elastic_tensor[2][2][0][1])" + write(13,"(A)") " print (elastic_tensor[1][2][0][0],elastic_tensor[1][2][1][1],elastic_tensor[1][2][2][2],elastic_tensor[1][2][1][2],elastic_tensor[1][2][2][0],elastic_tensor[1][2][0][1])" + write(13,"(A)") " print (elastic_tensor[2][0][0][0],elastic_tensor[2][0][1][1],elastic_tensor[2][0][2][2],elastic_tensor[2][0][1][2],elastic_tensor[2][0][2][0],elastic_tensor[2][0][0][1])" + write(13,"(A)") " print (elastic_tensor[0][1][0][0],elastic_tensor[0][1][1][1],elastic_tensor[0][1][2][2],elastic_tensor[0][1][1][2],elastic_tensor[0][1][2][0],elastic_tensor[0][1][0][1])" + close(13) End subroutine EOF echo - echo ${bold}The path was well documented${normal} + + diff --git a/soc/wrl_main.f90 b/soc/wrl_main.f90 index e2c4961..461f038 100644 --- a/soc/wrl_main.f90 +++ b/soc/wrl_main.f90 @@ -70,7 +70,7 @@ PROGRAM wrl_conv BINver,maxEVaLM1,maxEVaTM1,minEVaTM1,VVG_P,VVP_P,VV_P_PF,VVG_Sf,VVP_Sf,VV_Sf_PF,hardvar ,& VVG_Ss,VVP_Ss,VV_Ss_PF ChARACTER(len=7), dimension(10) :: arg_mane - INTEGER, DIMENSION(190300,4) :: mesh=0 + INTEGER, DIMENSION(190300,4) :: mesh=0 INTEGER :: n_phif, n_thetaf, num_mesh,ii=0,argl,cutmesh character(len=10) :: val='',namepro character(len=1) :: clor_val=" "