How to create a new ypp interface: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file. 1) Edit the file ypp/modules/mod_YPP.F logical...") |
No edit summary |
||
Line 50: | Line 50: | ||
objs = $(DF_objects) | objs = $(DF_objects) | ||
and then DEFECTS_driver.F | and then DEFECTS_driver.F: | ||
subroutine DEFECTS_driver(en,k) | |||
! | |||
use R_lattice, ONLY:bz_samp | |||
use electrons, ONLY:levels | |||
! | |||
#include<memory.h> | |||
! | |||
type(levels) :: en | |||
type(bz_samp) :: k | |||
end subroutine | |||
Finally "git add defects". | Finally "git add defects". |
Revision as of 21:34, 7 May 2021
Imagine you want to create a new ypp interface, you will want to make some variables to appear in your new input file.
1) Edit the file ypp/modules/mod_YPP.F
logical :: l_defects character(lchlen) :: superc_path
2) Initialize the non logical variable in ypp/modules/YPP_SET_defaults.F
#if defined _YPP_DF ! superc_path='none' ! #endif
3) Edit ypp/interface/INIT_load_ypp.F in order to instruct the code to switch on the flag in the ypp.in input file
#if defined _YPP_DF use YPPm, ONLY:superc_path #endif
#if defined _YPP_DF call it(defs,'SupercPATH', 'Path to the supercell with defect',superc_path) #endif
4) Edit ypp/interface/INIT_ypp.F
#if defined _YPP_DF l_defects = trim(rstr_piece(i1)) == 'dsuperc' #endif
Notice that ‘dsuperc’ has been introduced in options_ypp.c. So if the code “sees” this flag it associates .true. to the logical l_defects.
#if defined _YPP_DF if (l_defects) call initactivate(1,'dsuperc') #endif
#if defined _YPP_DF l_defects=runlevel_is_on('dsuperc') #endif
#if defined _YPP_DF if(l_defects) call initactivate(1,"SupercPATH") #endif
5) Create directory ypp/defects/ and the file .objects:
#if defined _YPP_DF DF_objects = DEFECTS_driver.o #endif objs = $(DF_objects)
and then DEFECTS_driver.F:
subroutine DEFECTS_driver(en,k) ! use R_lattice, ONLY:bz_samp use electrons, ONLY:levels ! #include<memory.h> ! type(levels) :: en type(bz_samp) :: k end subroutine
Finally "git add defects".
YPPDF_LIBS = $(YPP_LIBS) defects YPPDF_LIBS_LD = $(YPP_LIBS_LD) defects