Commit bd57b672 authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

python driver: call check ready, do_bottom, do_surface

parent c63415f4
......@@ -102,6 +102,9 @@ fabm.get_bulk_diagnostic_data.restype = None
fabm.get_horizontal_diagnostic_data.argtypes = [ctypes.c_int,ctypes.POINTER(ctypes.POINTER(ctypes.c_double))]
fabm.get_horizontal_diagnostic_data.restype = None
fabm.check_ready.argtypes = []
fabm.check_ready.restype = None
# Routine for retrieving source-sink terms for the interior domain.
fabm.get_rates.argtypes = [numpy.ctypeslib.ndpointer(dtype=ctypes.c_double, ndim=1, flags='CONTIGUOUS')]
fabm.get_rates.restype = None
......@@ -510,6 +513,7 @@ class Model(object):
print 'Value for dependency %s is not set.' % dependency.name
ready = False
assert ready or not stop,'Not all dependencies have been fulfilled.'
fabm.check_ready()
return ready
def printInformation(self):
......
......@@ -161,7 +161,7 @@
call get_couplings(model,coupling_link_list)
end subroutine reinitialize
subroutine check_ready()
subroutine check_ready() bind(c)
!DIR$ ATTRIBUTES DLLEXPORT :: check_ready
call fabm_check_ready(model)
end subroutine check_ready
......@@ -378,7 +378,9 @@
call c_f_pointer(c_loc(pelagic_rates_),pelagic_rates, &
(/size(model%state_variables)+size(model%surface_state_variables)+size(model%bottom_state_variables)/))
pelagic_rates = 0.0_rk
call fabm_do(model,pelagic_rates)
call fabm_do_bottom(model,pelagic_rates(1:size(model%state_variables)),pelagic_rates(size(model%state_variables)+size(model%surface_state_variables)+1:))
call fabm_do_surface(model,pelagic_rates(1:size(model%state_variables)),pelagic_rates(size(model%state_variables)+1:size(model%state_variables)+size(model%surface_state_variables)))
call fabm_do(model,pelagic_rates(1:size(model%state_variables)))
! Compute rate of change in conserved quantities
!call fabm_state_to_conserved_quantities(model,pelagic_rates,conserved_rates)
......
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