[Pw_forum] two issues

Shaofeng Wang wangshaofeng at iae.ac.cn
Mon May 9 05:01:16 CEST 2016


Dear Paolo,

First one, I modified the writedyn.f90 as follow,
!
! Copyright (C) 2003-2008 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!

SUBROUTINE writedyn ( )
  !
  USE ions_base, ONLY : nat, tau, ityp, ntyp => nsp, atm, amass
  USE run_info,  ONLY : title
  USE cell_base, ONLY : ibrav, celldm

  USE constants, ONLY : amu_ry
  USE cgcom
  IMPLICIT NONE
  INTEGER :: iudyn, nt, na, nb, i, j
  !
  iudyn = 20
  OPEN(unit=iudyn,file=fildyn,form='formatted',status='unknown')
  !
  !  write the dynamical matrix to file
  !
  WRITE(iudyn,'(a)') title
  WRITE(iudyn,'(a)') title_ph
  WRITE(iudyn,'(i3,i5,i3,6f11.7)') ntyp,nat,ibrav,celldm
  IF (ibrav==0) THEN
     WRITE (iudyn,'("Basis vectors")')
     WRITE (iudyn,'(2x,3f15.9)') ((at(i,j),i=1,3),j=1,3)
  END IF
  DO nt = 1,ntyp
     WRITE(iudyn,*) nt," '",atm(nt),"' ",amu_ry*amass(nt)
  ENDDO
  DO na=1,nat
     WRITE(iudyn,'(2i5,3f15.7)') na,ityp(na),(tau(j,na),j=1,3)
  ENDDO
  WRITE (iudyn, '(/,5x,"Dynamical  Matrix in cartesian axes", &
       &         //,5x,"q = ( ",3f14.9," ) ",/)') 0.0d0,0.0d0,0.0d0
  DO na = 1, nat
     DO nb = 1, nat
        WRITE(iudyn, '(2i3)') na, nb
        WRITE(iudyn,'(3e24.12)') &
             ( (dyn(3*(na-1)+i,3*(nb-1)+j),0.d0,j=1,3),i=1,3)
     ENDDO
  ENDDO
  !
  !   as above, for dielectric tensor and effective charges
  !
  IF (epsil) THEN
     WRITE (iudyn, '(/,5x,"Dielectric Tensor:",/)')
     WRITE (iudyn, '(3e24.12)') ( (epsilon0(i,j) , j=1,3), i=1,3)
     WRITE (iudyn, '(/5x, "Effective Charges E-U: Z_{alpha}{s,beta}",/)')
     DO na = 1,nat
        WRITE (iudyn, '(5x,"atom # ",i4)') na
        WRITE (iudyn, '(3e24.12)') ( (zstar (i,j, na),j=1,3),i=1,3)
     ENDDO
  ENDIF
  CLOSE (unit=iudyn)
  RETURN
END SUBROUTINE writedyn

However, the compilation aborted and showed errors,

writedyn.f90(30): error #6404: This name does not have a type, and must have 
an explicit type.   [AT]
     WRITE (iudyn,'(2x,3f15.9)') ((at(i,j),i=1,3),j=1,3)
-----------------------------------^
compilation aborted for writedyn.f90 (code 1)
make: *** [writedyn.o] Error 1


##########################################
Second one

I calculated ir spectra of a suppercell containing 192 atoms and modified 
the dyn file by adding basis vector as follow,



  5  193  0  1.8897260  0.0000000  0.0000000  0.0000000  0.0000000 
0.0000000
BASIS VECTOR
  11.641772704   0.057943232  -5.329259898
  -0.054351686  15.178251678   0.033811342
   0.014421490   0.010990600  11.425144034
           1  'S  '    29226.3710682135
           2  'Ca '    36528.8623361772
           3  'O  '    14582.5610075711
           4  'H  '    918.681109414803
           5  'As '    68286.8609313373
    1    4      4.3889522      1.3577144      2.2771652
    2    4      4.4134781      0.1131597      3.2143045
    3    4      1.4048759      8.9572752      3.5912175
    4    4      1.4995928      7.7145860      4.5319305
    5    4      1.4478434      1.3388553      3.7048734
    6    4      1.4337157      0.1059566      2.7436537
    7    4      4.3441624      8.9471742      2.3135701
    8    4      4.2672981      7.6984704      1.3592608
    9    4      1.4084926     13.8546851      0.8369199
   10    4      1.3704945     15.0963705     -0.1064776
   11    4      4.3113747      6.3266643     -0.5108992
   12    4      4.2732052      7.5419499     -1.4981497
   13    4      4.2935957     13.8729892     -0.5951485
   14    4      4.3398608     15.1113347      0.3610570
   15    4      1.3811478      6.2764776      0.7601024
   16    4      1.4399069      7.5255257      1.6904406
   17    4     10.1627864      1.4155850     -0.4200913
   18    4     10.1978372      0.1798824      0.5283709
   19    4      7.2600249      9.0046119      0.9213531
   20    4      7.3709815      7.7561246      1.8690066
   21    4      7.4710781      1.2403961      0.8627523
   22    4      7.2303203      0.0183851     -0.0591061
   23    4     10.1643499      8.9931554     -0.3198216
   24    4     10.1720524      7.7532256     -1.2698358
   25    4      7.2597713     13.8710097     -1.8797065
   26    4      7.2058629     15.1293032     -2.8041814
   27    4     10.2087542      6.3205100     -3.1791924
   28    4     10.1263723      7.5646127     -4.1186911
   29    4     10.1122741     13.9010031     -3.2698088
   30    4     10.1610190     15.1403243     -2.3184194
   31    4      7.2149029      6.2371696     -1.9203113
   32    4      7.2092592      7.4451580     -0.9365107
   33    4      4.3246529      1.3291431      7.9470564
   34    4      4.4143937      0.0855659      8.8913646
   35    4      1.4076778      8.9474664      9.3087871
   36    4      1.4866108      7.7043462     10.2510778
   37    4      1.4668136      1.3532267      9.4207885
   38    4      1.3975585      0.1121802      8.4708490
   39    4      4.3652784      8.9619155      8.0405100
   40    4      4.2874748      7.7123235      7.1061206
   41    4      1.3949433     13.8413755      6.5516587
   42    4      1.3390528     15.0949131      5.6273424
   43    4      4.3968932      6.3409638      5.1582571
   44    4      4.2834376      7.6158678      4.2620787
   45    4      4.2999776     13.8672818      5.1153585
   46    4      4.3210331     15.1054495      6.0697778
   47    4      1.4444451      6.2724177      6.4539050
   48    4      1.4921034      7.5128903      7.3972366
   49    4     10.1528229      1.4148518      5.2906087
   50    4     10.2491263      0.1760103      6.2276679
   51    4      7.2270553      8.9825249      6.6259839
   52    4      7.2862914      7.7460793      7.5813230
   53    4      7.3516595      1.3796188      6.6868585
   54    4      7.2503006      0.1239461      5.7633208
   55    4     10.1900614      9.0065224      5.3920546
   56    4     10.1253237      7.7597582      4.4570471
   57    4      7.2563603     13.9336317      3.8269388
   58    4      7.0051639     15.1767736      2.9168342
   59    4     10.3196932      6.3668111      2.5201513
   60    4     10.2566740      7.6214078      1.5896738
   61    4     10.1151995     13.8791117      2.4276087
   62    4     10.1084895     15.1108559      3.3833804
   63    4      7.4541977      6.3812019      3.7335610
   64    4      7.3294509      7.5622889      4.7507735
   65    4      6.7274117      3.1683443      1.3031560
   66    3      0.4895579      4.1560242      3.1696284
   67    3      1.1706410      5.8433988      4.7132746
   68    3      4.6815182      1.0467930      3.1573513
   69    3      3.3501061     11.7804156      1.8377724
   70    3      4.0184639     13.4623965      3.3873807
   71    3      1.6536455      8.6729664      4.4935002
   72    3     -0.4678752      4.1544579      5.4219961
   73    3     -1.1472415      5.8456062      3.8867446
   74    3      1.2213261      1.0538062      2.7985221
   75    3      2.3809365     11.7677509      4.0897032
   76    3      1.6998950     13.4569663      2.5565420
   77    3      4.0543444      8.6552249      1.4293376
   78    3     -0.5373929     11.0429533      2.5675191
   79    3     -1.1957313      9.3477870      1.0295403
   80    3      1.1474429     14.1516744     -0.0580183
   81    3      2.4536888      3.4462908      1.2458686
   82    3      1.7839593      1.7579858     -0.2924891
   83    3      4.0850629      6.5913408     -1.4363464
   84    3      0.4351062     11.0457149      0.3177587
   85    3      1.1216808      9.3703792      1.8651491
   86    3      4.5674891     14.1677466      0.2961121
   87    3      3.4326042      3.4401968     -1.0048966
   88    3      4.1029514      1.7596919      0.5420542
   89    3      1.5867523      6.5649635      1.6704963
   90    3      6.4771332      3.8818894      0.6691317
   91    3      7.2473855      6.0526055      2.0487606
   92    3     10.3638209      1.1372305      0.4964596
   93    3      9.1833696     11.7618211     -0.8131563
   94    3      9.8199688     13.4957388      0.6918022
   95    3      7.5258404      8.7267378      1.8183845
   96    3      5.2311132      4.2525971      3.0642097
   97    3      4.5249296      5.9767535      1.1262103
   98    3      7.0793734      0.9802325      0.0108985
   99    3      8.1987034     11.8041258      1.4324715
  100    3      7.5061498     13.4322483     -0.1581310
  101    3      9.8902025      8.6808622     -1.2048890
  102    3      5.2955623     11.0462798     -0.0970019
  103    3      4.6100819      9.3915737     -1.6668858
  104    3      6.9797143     14.1854337     -2.7623514
  105    3      8.2712529      3.4769284     -1.4201067
  106    3      7.5922277      1.8120980     -2.9910362
  107    3      9.9059731      6.6196730     -4.0586548
  108    3      6.2721814     11.0726228     -2.3447950
  109    3      6.9263979      9.3544644     -0.8291112
  110    3     10.3691049     14.1917231     -2.3718912
  111    3      9.2381587      3.5037079     -3.6747179
  112    3      9.9101195      1.7963525     -2.1560870
  113    3      7.4199961      6.4979726     -0.9985686
  114    3      0.4909826      4.1576081      8.9078624
  115    3      1.1665931      5.8533289     10.4383365
  116    3      4.6112416      1.0375693      8.8372706
  117    3      3.3574277     11.7787565      7.5584650
  118    3      4.0348920     13.4588667      9.1041653
  119    3      1.6717960      8.6574687     10.2043490
  120    3     -0.4821307      4.1737141     11.1539225
  121    3     -1.1500584      5.8538704      9.6013366
  122    3      1.1621169      1.0526801      8.5416379
  123    3      2.3899566     11.7743036      9.8111986
  124    3      1.7150921     13.4635313      8.2747455
  125    3      4.1042654      8.6657827      7.1452277
  126    3     -0.5084031     11.0572023      8.2867280
  127    3     -1.1779798      9.3801625      6.7348168
  128    3      1.1339081     14.1444596      5.6588419
  129    3      2.3907193      3.4234993      7.0044415
  130    3      1.6968935      1.7313066      5.4724373
  131    3      4.0682785      6.6676680      4.2998476
  132    3      0.4689440     11.0681892      6.0407022
  133    3      1.1365940      9.3716378      7.5758068
  134    3      4.5717641     14.1685705      6.0050732
  135    3      3.3048528      3.4293381      4.7340705
  136    3      4.0315611      1.7527458      6.2609646
  137    3      1.7287774      6.5723815      7.3395449
  138    3      6.3361936      4.1813731      6.2691862
  139    3      6.9716649      5.9055672      7.7813283
  140    3     10.4517346      1.1255297      6.1741945
  141    3      9.1903684     11.8065036      4.8931182
  142    3      9.8429134     13.5089633      6.4260223
  143    3      7.4981024      8.6928022      7.5199313
  144    3      5.3454159      4.2084927      8.5052856
  145    3      4.6613827      5.8571855      6.9251789
  146    3      7.0563622      1.0768393      5.8057904
  147    3      8.2068597     11.8152131      7.1372128
  148    3      7.5303716     13.4863166      5.5758770
  149    3      9.9346784      8.7119127      4.4952286
  150    3      5.2969971     11.0818835      5.6217177
  151    3      4.6292781      9.4107602      4.0638604
  152    3      6.9911447     14.2088082      2.9263540
  153    3      8.2348713      3.5006793      4.2957388
  154    3      7.5165371      2.0027228      2.5756424
  155    3     10.1305547      6.6560139      1.6061712
  156    3      6.2760442     11.1004735      3.3753525
  157    3      6.9462267      9.4045740      4.9073028
  158    3     10.3844497     14.1819575      3.3172297
  159    3      9.3070640      3.5950127      2.0888723
  160    3      9.7819176      1.7585730      3.5362102
  161    3      7.5685631      6.6233475      4.6834313
  162    1      0.0153063      4.9995485      4.2964853
  163    1      2.8629715     12.6152455      2.9677252
  164    1     -0.0434430     10.2016542      1.4448086
  165    1      2.9423261      2.6041821      0.1246958
  166    1      8.6793259     12.6229625      0.2885912
  167    1      5.7769014     10.2139776     -1.2333930
  168    1      8.7529986      2.6513878     -2.5575313
  169    1      0.0054357      5.0117068     10.0246390
  170    1      2.8735412     12.6171824      8.6864620
  171    1     -0.0192743     10.2187094      7.1602026
  172    1      2.8551143      2.5894379      5.8652932
  173    1      5.8259786      5.0429118      7.3680350
  174    1      8.6918104     12.6542081      6.0082596
  175    1      5.7878216     10.2472287      4.4913250
  176    1      8.7165572      2.7155621      3.1351759
  177    2      0.0177815      2.5739435      1.4367529
  178    2      2.8684649     10.1800047      0.1096628
  179    2     -0.0503927     12.6179065      4.2975847
  180    2      2.8965842      5.0639646      2.9798441
  181    2      5.8319656      2.5422959     -1.3115598
  182    2      8.6837948     10.1999385     -2.5610348
  183    2      5.7677059     12.6294548      1.6243284
  184    2      8.8365111      5.1502009      0.3219319
  185    2     -0.0125243      2.5755840      7.1777502
  186    2      2.8807220     10.1964404      5.8241023
  187    2     -0.0386870     12.6339799     10.0168754
  188    2      2.9091367      5.0470083      8.7027040
  189    2      5.7514868      2.6301325      4.5747481
  190    2      8.7069048     10.2289693      3.1602921
  191    2      5.7842642     12.6493012      7.3456940
  192    2      8.7352017      5.0931534      6.0270247
  193    5      5.8315803      5.1733060      1.8014128

     Dynamical  Matrix in cartesian axes

     q = (    0.000000000   0.000000000   0.000000000 )

  1  1
......................................

However, I still met a problem

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    task #         0
    from readmat : error #         1
    mismatch in reading file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I compared this file with another file which is prodcued from 24 atoms and 
did not find some style difference.

the only difference is the matrix of 24 atoms is
23 24
    -0.943547524707E-02      0.000000000000E+00      0.200453796187E-05
     0.000000000000E+00      0.106481971918E-01      0.000000000000E+00
     0.200378721078E-05      0.000000000000E+00     -0.143033880915E-01
     0.000000000000E+00     -0.350088401890E-06      0.000000000000E+00
     0.106481912430E-01      0.000000000000E+00     -0.347951664190E-06
     0.000000000000E+00     -0.222694327675E-02      0.000000000000E+00

but the matrix of 193 atoms is

............................
1148
    0.208120384168E-02      0.000000000000E+00      0.760712254762E-03
    0.000000000000E+00      0.797957722953E-03      0.000000000000E+00
    0.491678069045E-03      0.000000000000E+00     -0.886654736348E-03
    0.000000000000E+00      0.564270339093E-03      0.000000000000E+00
    0.154838063489E-02      0.000000000000E+00      0.403915953165E-04
    0.000000000000E+00      0.169955270432E-02      0.000000000000E+00
1149
   -0.166610050444E-02      0.000000000000E+00     -0.317263219959E-03
    0.000000000000E+00      0.126488371446E-02      0.000000000000E+00
   -0.317025826336E-03      0.000000000000E+00      0.308402659476E-02
    0.000000000000E+00      0.719808503412E-04      0.000000000000E+00
    0.142971049473E-02      0.000000000000E+00     -0.236016337323E-03
    0.000000000000E+00     -0.337041607749E-03      0.000000000000E+00

..............................


The first two numbers do not have a space. Is this a bug?

Please help.

Regards,

Shaofeng
--------------------------------------
Shaofeng Wang, Ph.D of Geochemistry
Environmental Molecular Science Group
Institute of Applied Ecology, Chinese Academy of Sciences
Shenyang, 110016, China
wangshaofeng at iae.ac.cn
www.iae.cas.cn 





More information about the users mailing list