Changeset 708


Ignore:
Timestamp:
04/26/12 20:47:17 (13 months ago)
Author:
micael
Message:
  • Fixed problem with the xc functional specification in the UPF fileformat.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1.x/src/ps_io.F90

    r604 r708  
    917917    integer :: values(8), i, ir, max_l 
    918918    real(R8) :: xmin, zmesh 
     919    character(4)  :: shortname 
     920    character(20) :: longname 
    919921 
    920922    !Info 
     
    954956    write(unit,'(A5,T24,A)') "NC", "Norm - Conserving pseudopotential" 
    955957    write(unit,'(L5,T24,A)') info%nlcc, "Nonlinear Core Correction" 
    956     write(unit,'(A22,T24,"Exchange-Correlation functional")') trim(ixc_to_espresso(info%ixc)) 
     958    call ixc_to_espresso(info%ixc, longname, shortname) 
     959    write(unit,'(A,T24,A4," Exchange-Correlation functional")') longname, shortname 
    957960    write(unit,'(F17.11,T24,A)') info%z_val, "Z valence" 
    958961    write(unit,'(F17.11,T24,A)') 0.0, "Total energy" 
     
    11101113  end function ixc_description 
    11111114 
    1112   function ixc_to_espresso(ixc) 
     1115  subroutine ixc_to_espresso(ixc, longname, shortname) 
    11131116    !-----------------------------------------------------------------------! 
    11141117    ! Returns a label to identify the xc model compatible with the codes    ! 
    11151118    ! in the Quantum Espresso package.                                      ! 
    11161119    !-----------------------------------------------------------------------! 
    1117     integer, intent(in) :: ixc 
    1118     character(22) :: ixc_to_espresso 
    1119  
     1120    integer,       intent(in)  :: ixc 
     1121    character(4),  intent(out) :: shortname 
     1122    character(20), intent(out) :: longname 
     1123 
     1124    character(4) :: exch, corr, gradx, gradc 
     1125 
     1126    select case (ixc - (ixc/1000)*1000) 
     1127    case (0) 
     1128      exch  = "NOX " 
     1129      gradx = "NOGX" 
     1130    case (XC_LDA_X) 
     1131      exch  = "SLA " 
     1132      gradx = "NOGX" 
     1133    case (XC_GGA_X_B88) 
     1134      exch  = "SLA " 
     1135      gradx = "B88 " 
     1136    case (XC_GGA_X_PW91) 
     1137      exch  = "SLA " 
     1138      gradx = "GGX " 
     1139    case (XC_GGA_X_PBE) 
     1140      exch  = "SLA " 
     1141      gradx = "PBX " 
     1142    case (XC_GGA_X_PBE_SOL) 
     1143      corr  = "PW  " 
     1144      gradc = "PSX " 
     1145    case (XC_GGA_X_PBE_R) 
     1146      exch  = "SLA " 
     1147      gradx = "RPB " 
     1148    case (XC_GGA_X_WC) 
     1149      exch  = "SLA " 
     1150      gradx = "WCX " 
     1151    case (XC_MGGA_X_TPSS) 
     1152      exch  = "SLA " 
     1153      gradx = "TPSS" 
     1154    case default 
     1155      exch  = " " 
     1156      gradx = " " 
     1157    end select 
     1158 
     1159    select case (ixc/1000) 
     1160    case (0) 
     1161      corr  = "NOC " 
     1162      gradc = "NOGC" 
     1163    case (XC_LDA_C_PZ) 
     1164      corr  = "PZ  " 
     1165      gradc = "NOGC" 
     1166    case (XC_LDA_C_VWN) 
     1167      corr  = "VWN " 
     1168      gradc = "NOGC" 
     1169    case (XC_LDA_C_PW) 
     1170      corr  = "PW  " 
     1171      gradc = "NOGC" 
     1172    case (XC_LDA_C_WIGNER) 
     1173      corr  = "WIG " 
     1174      gradc = "NOGC" 
     1175    case (XC_LDA_C_HL) 
     1176      corr  = "HL  " 
     1177      gradc = "NOGC" 
     1178    case (XC_LDA_C_OB_PZ) 
     1179      corr  = "OBZ " 
     1180      gradc = "NOGC" 
     1181    case (XC_LDA_C_OB_PW) 
     1182      corr  = "OBW " 
     1183      gradc = "NOGC" 
     1184    case (XC_LDA_C_GL) 
     1185      corr  = "GL  " 
     1186      gradc = "NOGC" 
     1187    case (XC_GGA_C_PW91) 
     1188      corr  = "PW  " 
     1189      gradc = "GGC " 
     1190    case (XC_GGA_C_PBE) 
     1191      corr  = "PW  " 
     1192      gradc = "PBC " 
     1193    case (XC_GGA_C_P86) 
     1194      corr  = "PZ  " 
     1195      gradc = "P86 " 
     1196    case (XC_GGA_C_PBE_SOL) 
     1197      corr  = "PW  " 
     1198      gradc = "PSC " 
     1199    case (XC_MGGA_C_TPSS) 
     1200      corr  = "PW  " 
     1201      gradc = "TPSS" 
     1202    case default 
     1203      corr  = " " 
     1204      gradc = " " 
     1205    end select 
     1206  
     1207    !Shorname 
    11201208    select case (ixc) 
    1121     case (XC_LDA_X + XC_LDA_C_PZ*1000) 
    1122       ixc_to_espresso = "SLA  PZ  NOGX  NOGC" 
    1123     case (XC_LDA_X + XC_LDA_C_PW*1000) 
    1124       ixc_to_espresso = "SLA  PW  NOGX  NOGC" 
     1209    case (XC_LDA_X) 
     1210      shortname = corr 
    11251211    case (XC_GGA_X_PBE + XC_GGA_C_PBE*1000) 
    1126       ixc_to_espresso = "SLA  PW  PBX  PBC" 
     1212      shortname = "PBE" 
     1213    case (XC_GGA_X_B88 + XC_LDA_C_PZ*1000) 
     1214      shortname = "B88" 
     1215    case (XC_GGA_X_B88 + XC_GGA_C_P86*1000) 
     1216      shortname = "BP" 
     1217    case (XC_GGA_X_WC + XC_GGA_C_PBE*1000) 
     1218      shortname = "WC" 
     1219    case (XC_MGGA_X_TPSS + XC_MGGA_C_TPSS*1000) 
     1220      shortname = "TPSS" 
    11271221    case default 
    1128       ixc_to_espresso = "  " 
    1129     end select 
    1130  
    1131   end function ixc_to_espresso 
     1222      shortname = " " 
     1223    end select 
     1224 
     1225    !Longname 
     1226    write(longname,'(4A5)') exch, corr, gradx, gradc  
     1227 
     1228  end subroutine ixc_to_espresso 
    11321229 
    11331230end module ps_io 
  • trunk/src/ps_io.F90

    r631 r708  
    932932    integer :: values(8), i, ir, max_l 
    933933    real(R8) :: xmin, zmesh 
     934    character(4)  :: shortname 
     935    character(20) :: longname 
    934936 
    935937    call push_sub("upf_save") 
     
    971973    write(unit,'(A5,T24,A)') "NC", "Norm - Conserving pseudopotential" 
    972974    write(unit,'(L5,T24,A)') info%nlcc, "Nonlinear Core Correction" 
    973     write(unit,'(A22,T24,"Exchange-Correlation functional")') trim(ixc_to_espresso(info%ixc)) 
     975    call ixc_to_espresso(info%ixc, longname, shortname) 
     976    write(unit,'(A,T24,A4," Exchange-Correlation functional")') longname, shortname 
    974977    write(unit,'(F17.11,T24,A)') info%z_val, "Z valence" 
    975978    write(unit,'(F17.11,T24,A)') 0.0, "Total energy" 
     
    11311134  end function ixc_description 
    11321135 
    1133   function ixc_to_espresso(ixc) 
     1136  subroutine ixc_to_espresso(ixc, longname, shortname) 
    11341137    !-----------------------------------------------------------------------! 
    11351138    ! Returns a label to identify the xc model compatible with the codes    ! 
    11361139    ! in the Quantum Espresso package.                                      ! 
    11371140    !-----------------------------------------------------------------------! 
    1138     integer, intent(in) :: ixc 
    1139     character(22) :: ixc_to_espresso 
    1140  
     1141    integer,       intent(in)  :: ixc 
     1142    character(4),  intent(out) :: shortname 
     1143    character(20), intent(out) :: longname 
     1144 
     1145    character(4) :: exch, corr, gradx, gradc 
     1146 
     1147    select case (ixc - (ixc/1000)*1000) 
     1148    case (0) 
     1149      exch  = "NOX " 
     1150      gradx = "NOGX" 
     1151    case (XC_LDA_X) 
     1152      exch  = "SLA " 
     1153      gradx = "NOGX" 
     1154    case (XC_GGA_X_B88) 
     1155      exch  = "SLA " 
     1156      gradx = "B88 " 
     1157    case (XC_GGA_X_PW91) 
     1158      exch  = "SLA " 
     1159      gradx = "GGX " 
     1160    case (XC_GGA_X_PBE) 
     1161      exch  = "SLA " 
     1162      gradx = "PBX " 
     1163    case (XC_GGA_X_PBE_SOL) 
     1164      corr  = "PW  " 
     1165      gradc = "PSX " 
     1166    case (XC_GGA_X_PBE_R) 
     1167      exch  = "SLA " 
     1168      gradx = "RPB " 
     1169    case (XC_GGA_X_WC) 
     1170      exch  = "SLA " 
     1171      gradx = "WCX " 
     1172    case (XC_MGGA_X_TPSS) 
     1173      exch  = "SLA " 
     1174      gradx = "TPSS" 
     1175    case default 
     1176      exch  = " " 
     1177      gradx = " " 
     1178    end select 
     1179 
     1180    select case (ixc/1000) 
     1181    case (0) 
     1182      corr  = "NOC " 
     1183      gradc = "NOGC" 
     1184    case (XC_LDA_C_PZ) 
     1185      corr  = "PZ  " 
     1186      gradc = "NOGC" 
     1187    case (XC_LDA_C_VWN) 
     1188      corr  = "VWN " 
     1189      gradc = "NOGC" 
     1190    case (XC_LDA_C_PW) 
     1191      corr  = "PW  " 
     1192      gradc = "NOGC" 
     1193    case (XC_LDA_C_WIGNER) 
     1194      corr  = "WIG " 
     1195      gradc = "NOGC" 
     1196    case (XC_LDA_C_HL) 
     1197      corr  = "HL  " 
     1198      gradc = "NOGC" 
     1199    case (XC_LDA_C_OB_PZ) 
     1200      corr  = "OBZ " 
     1201      gradc = "NOGC" 
     1202    case (XC_LDA_C_OB_PW) 
     1203      corr  = "OBW " 
     1204      gradc = "NOGC" 
     1205    case (XC_LDA_C_GL) 
     1206      corr  = "GL  " 
     1207      gradc = "NOGC" 
     1208    case (XC_GGA_C_PW91) 
     1209      corr  = "PW  " 
     1210      gradc = "GGC " 
     1211    case (XC_GGA_C_PBE) 
     1212      corr  = "PW  " 
     1213      gradc = "PBC " 
     1214    case (XC_GGA_C_P86) 
     1215      corr  = "PZ  " 
     1216      gradc = "P86 " 
     1217    case (XC_GGA_C_PBE_SOL) 
     1218      corr  = "PW  " 
     1219      gradc = "PSC " 
     1220    case (XC_MGGA_C_TPSS) 
     1221      corr  = "PW  " 
     1222      gradc = "TPSS" 
     1223    case default 
     1224      corr  = " " 
     1225      gradc = " " 
     1226    end select 
     1227  
     1228    !Shorname 
    11411229    select case (ixc) 
    1142     case (XC_LDA_X + XC_LDA_C_PZ*1000) 
    1143       ixc_to_espresso = "SLA  PZ  NOGX  NOGC" 
    1144     case (XC_LDA_X + XC_LDA_C_PW*1000) 
    1145       ixc_to_espresso = "SLA  PW  NOGX  NOGC" 
     1230    case (XC_LDA_X) 
     1231      shortname = corr 
    11461232    case (XC_GGA_X_PBE + XC_GGA_C_PBE*1000) 
    1147       ixc_to_espresso = "SLA  PW  PBX  PBC" 
     1233      shortname = "PBE" 
     1234    case (XC_GGA_X_B88 + XC_LDA_C_PZ*1000) 
     1235      shortname = "B88" 
     1236    case (XC_GGA_X_B88 + XC_GGA_C_P86*1000) 
     1237      shortname = "BP" 
     1238    case (XC_GGA_X_WC + XC_GGA_C_PBE*1000) 
     1239      shortname = "WC" 
     1240    case (XC_MGGA_X_TPSS + XC_MGGA_C_TPSS*1000) 
     1241      shortname = "TPSS" 
    11481242    case default 
    1149       ixc_to_espresso = " " 
     1243      shortname = " " 
    11501244    end select 
    11511245 
    1152   end function ixc_to_espresso 
     1246    !Longname 
     1247    write(longname,'(4A5)') exch, corr, gradx, gradc  
     1248 
     1249  end subroutine ixc_to_espresso 
    11531250 
    11541251end module ps_io_m 
Note: See TracChangeset for help on using the changeset viewer.