mld2p4-2:

tests/newslv/Makefile
 tests/newslv/data_input.f90
 tests/newslv/mld_pde3d_newslv.f90
 tests/newslv/ppde3d.f90
 tests/newslv/runs/mld_pde.inp
 tests/newslv/runs/ppde.inp

Rename newslv examples. Not finished yet
stopcriterion
Salvatore Filippone 8 years ago
parent 2a55b749b9
commit ff66cedf9c

@ -5,23 +5,23 @@ MLDLIBDIR=$(MLDDIR)/lib
MLD_LIBS=-L$(MLDLIBDIR) -lpsb_krylov -lmld_prec -lpsb_prec MLD_LIBS=-L$(MLDLIBDIR) -lpsb_krylov -lmld_prec -lpsb_prec
FINCLUDES=$(FMFLAG). $(FMFLAG)$(MLDINCDIR) $(PSBLAS_INCLUDES) $(FIFLAG). FINCLUDES=$(FMFLAG). $(FMFLAG)$(MLDINCDIR) $(PSBLAS_INCLUDES) $(FIFLAG).
PD3DOBJS=ppde3d.o data_input.o mld_d_tlu_solver.o mld_d_tlu_solver_impl.o PD3DOBJS=mld_pde3d_newslv.o data_input.o mld_d_tlu_solver.o mld_d_tlu_solver_impl.o
PSOBJS=spde.o data_input.o PSOBJS=spde.o data_input.o
EXEDIR=./runs EXEDIR=./runs
all: ppde3d all: mld_pde3d_newslv
ppde3d: $(PD3DOBJS) mld_pde3d_newslv: $(PD3DOBJS)
$(FLINK) $(PD3DOBJS) -o ppde3d $(MLD_LIBS) $(PSBLAS_LIBS) $(LDLIBS) $(FLINK) $(PD3DOBJS) -o mld_pde3d_newslv $(MLD_LIBS) $(PSBLAS_LIBS) $(LDLIBS)
/bin/mv ppde3d $(EXEDIR) /bin/mv mld_pde3d_newslv $(EXEDIR)
ppde3d.o mld_d_tlu_solver_impl.o: data_input.o mld_d_tlu_solver.o mld_pde3d_newslv.o mld_d_tlu_solver_impl.o: data_input.o mld_d_tlu_solver.o
clean: clean:
/bin/rm -f $(PD3DOBJS) $(EXEDIR)/ppde3d /bin/rm -f $(PD3DOBJS) $(EXEDIR)/mld_pde3d_newslv
verycleanlib: verycleanlib:
(cd ../..; make veryclean) (cd ../..; make veryclean)

@ -38,12 +38,14 @@
! !
! !
module data_input module data_input
use psb_base_mod, only : psb_spk_, psb_dpk_, psb_ipk_
interface read_data interface read_data
module procedure read_char, read_int,& module procedure read_char, read_int,&
& read_double, read_single,& & read_double, read_single, read_logical,&
& string_read_char, string_read_int,& & string_read_char, string_read_int,&
& string_read_double, string_read_single & string_read_double, string_read_single, &
& string_read_logical
end interface read_data end interface read_data
interface trim_string interface trim_string
module procedure trim_string module procedure trim_string
@ -54,9 +56,19 @@ module data_input
contains contains
subroutine read_logical(val,file,marker)
logical, intent(out) :: val
integer(psb_ipk_), intent(in) :: file
character(len=1), optional, intent(in) :: marker
read(file,'(a)')charbuf
call read_data(val,charbuf,marker)
end subroutine read_logical
subroutine read_char(val,file,marker) subroutine read_char(val,file,marker)
character(len=*), intent(out) :: val character(len=*), intent(out) :: val
integer, intent(in) :: file integer(psb_ipk_), intent(in) :: file
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
read(file,'(a)')charbuf read(file,'(a)')charbuf
@ -65,8 +77,8 @@ contains
end subroutine read_char end subroutine read_char
subroutine read_int(val,file,marker) subroutine read_int(val,file,marker)
integer, intent(out) :: val integer(psb_ipk_), intent(out) :: val
integer, intent(in) :: file integer(psb_ipk_), intent(in) :: file
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
read(file,'(a)')charbuf read(file,'(a)')charbuf
@ -74,9 +86,8 @@ contains
end subroutine read_int end subroutine read_int
subroutine read_single(val,file,marker) subroutine read_single(val,file,marker)
use psb_base_mod
real(psb_spk_), intent(out) :: val real(psb_spk_), intent(out) :: val
integer, intent(in) :: file integer(psb_ipk_), intent(in) :: file
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
read(file,'(a)')charbuf read(file,'(a)')charbuf
@ -84,9 +95,8 @@ contains
end subroutine read_single end subroutine read_single
subroutine read_double(val,file,marker) subroutine read_double(val,file,marker)
use psb_base_mod
real(psb_dpk_), intent(out) :: val real(psb_dpk_), intent(out) :: val
integer, intent(in) :: file integer(psb_ipk_), intent(in) :: file
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
read(file,'(a)')charbuf read(file,'(a)')charbuf
@ -100,7 +110,7 @@ contains
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
character(len=1) :: marker_ character(len=1) :: marker_
character(len=1024) :: charbuf character(len=1024) :: charbuf
integer :: idx integer(psb_ipk_) :: idx
if (present(marker)) then if (present(marker)) then
marker_ = marker marker_ = marker
else else
@ -114,12 +124,12 @@ contains
end subroutine string_read_char end subroutine string_read_char
subroutine string_read_int(val,file,marker) subroutine string_read_int(val,file,marker)
integer, intent(out) :: val integer(psb_ipk_), intent(out) :: val
character(len=*), intent(in) :: file character(len=*), intent(in) :: file
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
character(len=1) :: marker_ character(len=1) :: marker_
character(len=1024) :: charbuf character(len=1024) :: charbuf
integer :: idx integer(psb_ipk_) :: idx
if (present(marker)) then if (present(marker)) then
marker_ = marker marker_ = marker
else else
@ -131,14 +141,14 @@ contains
if (idx == 0) idx = len(charbuf)+1 if (idx == 0) idx = len(charbuf)+1
read(charbuf(1:idx-1),*) val read(charbuf(1:idx-1),*) val
end subroutine string_read_int end subroutine string_read_int
subroutine string_read_single(val,file,marker) subroutine string_read_single(val,file,marker)
use psb_base_mod
real(psb_spk_), intent(out) :: val real(psb_spk_), intent(out) :: val
character(len=*), intent(in) :: file character(len=*), intent(in) :: file
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
character(len=1) :: marker_ character(len=1) :: marker_
character(len=1024) :: charbuf character(len=1024) :: charbuf
integer :: idx integer(psb_ipk_) :: idx
if (present(marker)) then if (present(marker)) then
marker_ = marker marker_ = marker
else else
@ -150,14 +160,14 @@ contains
if (idx == 0) idx = len(charbuf)+1 if (idx == 0) idx = len(charbuf)+1
read(charbuf(1:idx-1),*) val read(charbuf(1:idx-1),*) val
end subroutine string_read_single end subroutine string_read_single
subroutine string_read_double(val,file,marker) subroutine string_read_double(val,file,marker)
use psb_base_mod
real(psb_dpk_), intent(out) :: val real(psb_dpk_), intent(out) :: val
character(len=*), intent(in) :: file character(len=*), intent(in) :: file
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
character(len=1) :: marker_ character(len=1) :: marker_
character(len=1024) :: charbuf character(len=1024) :: charbuf
integer :: idx integer(psb_ipk_) :: idx
if (present(marker)) then if (present(marker)) then
marker_ = marker marker_ = marker
else else
@ -170,12 +180,31 @@ contains
read(charbuf(1:idx-1),*) val read(charbuf(1:idx-1),*) val
end subroutine string_read_double end subroutine string_read_double
subroutine string_read_logical(val,file,marker)
logical, intent(out) :: val
character(len=*), intent(in) :: file
character(len=1), optional, intent(in) :: marker
character(len=1) :: marker_
character(len=1024) :: charbuf
integer(psb_ipk_) :: idx
if (present(marker)) then
marker_ = marker
else
marker_ = def_marker
end if
read(file,'(a)')charbuf
charbuf = adjustl(charbuf)
idx=index(charbuf,marker_)
if (idx == 0) idx = len(charbuf)+1
read(charbuf(1:idx-1),*) val
end subroutine string_read_logical
function trim_string(string,marker) function trim_string(string,marker)
character(len=*), intent(in) :: string character(len=*), intent(in) :: string
character(len=1), optional, intent(in) :: marker character(len=1), optional, intent(in) :: marker
character(len=len(string)) :: trim_string character(len=len(string)) :: trim_string
character(len=1) :: marker_ character(len=1) :: marker_
integer :: idx integer(psb_ipk_) :: idx
if (present(marker)) then if (present(marker)) then
marker_ = marker marker_ = marker
else else

Loading…
Cancel
Save