./Core/io/f/tests/tstLibraryIO.f90
1 #include "ScaleDBCF/DBCF.h"
5 origen_libraryheader, &
7 origen_transitionstructure, &
13 use origen_testpaths_m
15 use nemesis_comm
, only: build_types, initialize, finalize, node
21 type(datacontainer) :: options
22 type(stringlist) :: errors,oerrors
23 logical :: loaded,saved
29 if( node() /= 0 )
call finalize
32 call errors % initialize()
33 call io % initialize()
34 call options % initialize()
37 call lib % initialize()
38 loaded = io % load(lib,pwrlib_filepath,options)
39 if( .not. loaded )
then
40 write(*,*)
"couldn't read PWR library {"//trim(pwrlib_filepath)//
"}"
43 saved = io % save(lib,
'pwr.bof',options)
49 call lib % initialize()
50 loaded = io % load(lib,decaylib_filepath,options)
51 if( .not. loaded )
then
52 write(*,*)
"couldn't read decay library {"//trim(decaylib_filepath)//
"}"
55 saved = io % save(lib,
'decay.bof',options)
61 loaded = io % load(lib,
'DOES_NOT_EXIST',options)
62 call options % remove(oerrors,
"ERROR");
70 if(oerrors%size()/=4)
then
71 call errors % push_back(
"didn't get the right number of errors "//&
72 "when trying to load from bogus file");
82 call oerrors % destroy()
85 if( errors%size()>0 )
then
86 write(*,*)
'found errors:'
87 do i=1,errors % size()
88 call errors % at(str,i)
89 write(*,*)i,
". ",trim(str)
94 call options % destroy()
96 call errors % destroy()