! MAIN pentru GRAFIC
! Un singur apel: "call grafic(...)".
! Creaza fisierul de iesire in sub-directoriul: Exe_Dir\Dat\
!
program Mgrafic
use work
use dfwin, only: getCurrentDirectory  !ifwin

character(132) f_source
logical exist_Dat, created_Dat

!external f
external f_exp, f_mull
external d1,d1_ !, d2,d2_, d3,d3_, d4,d4_
external tan_5_d, cos99, sin99, a6_I, a63
external f_q, q, f_exp15, p3

! Citeste Directoriul curent:
l_exe =getCurrentDirectory(260, Exe_Dir)

! Creaza directoriul "...\Dat\
Dat_Directory =Exe_Dir(:l_exe)//'\Dat\'

inquire(DIRECTORY =Dat_Directory, exist =exist_Dat)

if(.not. exist_Dat) then
!created_Dat =CreateDirectory(Dat_Directory, NULL)
created_Dat =makedirqq(Dat_Directory)
endif

l_Dat =len_trim(Dat_Directory)

! Seek called function:
!f_source ='Main-Grafic.f90'

f_source =Exe_Dir(:l_exe)//'\Main-Grafic.f90'

call F_Expr_Main(f_source, fun_name)		!fun_name ='f_exp'

! Seek function expression:
!f_source ='functie.f90'
f_source =Exe_Dir(:l_exe)//'\functie.f90'
call F_Expr(f_source, trim(fun_name), fun_expression);

!call grafic(f_exp)
call grafic(f_exp15)

!call grafic(p3)

!call grafic(D1);
!call grafic(D1_); 

!call grafic(D2); call grafic(D2_); 
!call grafic(D3); call grafic(D3_); 
!call grafic(D4); call grafic(D4_); 

!call grafic(f_mull)
!call grafic(tan_5_d)
!call grafic(f_exp)

!call grafic(cos99)
!call grafic(sin99)

!call grafic(a6_I)
!call grafic(a63)

!call grafic(f_q)
!call grafic(q)

END
