@@ -26,6 +26,7 @@ program xc_example
2626 xcfun_splash, &
2727 xcfun_new, &
2828 xcfun_set, &
29+ xcfun_get, &
2930 xcfun_eval_setup, &
3031 xcfun_eval, &
3132 xcfun_delete
@@ -46,7 +47,7 @@ program xc_example
4647
4748 integer :: order, ierr, ipoint
4849 integer :: vector_length
49- real (8 ) :: res
50+ real (8 ) :: res, weight
5051
5152 real (8 ), allocatable :: density(:, :, :)
5253
@@ -64,6 +65,13 @@ program xc_example
6465 print * , ' Setting up PBE'
6566 ierr = xcfun_set(fun, ' pbe' , 1.0d0 )
6667 call assert(ierr == 0 , " functional name not recognized" )
68+ ! let's get back the weight of exchange and correlation components
69+ ierr = xcfun_get(fun, ' pbex' , weight)
70+ call assert(ierr == 0 , " functional name not recognized" )
71+ print * , ' PBE exchange weight is ' , weight
72+ ierr = xcfun_get(fun, ' pbec' , weight)
73+ call assert(ierr == 0 , " functional name not recognized" )
74+ print * , ' PBE correlation weight is ' , weight
6775
6876
6977 !- ----------------------------------------------------------------------------
0 commit comments