Commit 01c09f35 authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

use initialize instead of do_not_initialize in fabm_create_model

parent f4915833
......@@ -22,14 +22,19 @@ module fabm_config
contains
function fabm_create_model(path, do_not_initialize, parameters, unit) result(model)
function fabm_create_model(path, initialize, parameters, unit) result(model)
character(len=*), optional, intent(in) :: path
logical, optional, intent(in) :: do_not_initialize
logical, optional, intent(in) :: initialize
type (type_property_dictionary), optional, intent(in) :: parameters
integer, optional, intent(in) :: unit
class (type_fabm_model), pointer :: model
logical :: initialize_
initialize_ = .true.
if (present(initialize)) initialize_ = initialize
allocate(model)
call configure(model, path, do_not_initialize, parameters, unit)
call configure(model, path, do_not_initialize=.not. initialize, parameters=parameters, unit=unit)
end function
! For backward compatibility (20191115):
......@@ -39,6 +44,7 @@ contains
logical, optional, intent(in) :: do_not_initialize
type (type_property_dictionary), optional, intent(in) :: parameters
integer, optional, intent(in) :: unit
call configure(model, path, do_not_initialize, parameters, unit)
end subroutine
......
......@@ -300,10 +300,10 @@ case (1)
! Unit testing with built-in model
allocate(model)
allocate(test_model)
call model%root%add_child(test_model,'test_model','test model',configunit=-1)
call model%root%add_child(test_model, 'test_model', 'test model', configunit=-1)
case (2)
! Test with user-provided fabm.yaml
model => fabm_create_model(do_not_initialize=.true.)
model => fabm_create_model(initialize=.false.)
end select
call report_test_result()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment