Skip to content
Snippets Groups Projects
Commit 42fa7fef authored by Evgeny Mortikov's avatar Evgeny Mortikov
Browse files

time dependent forcing implementation update

parent 204f95ff
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@ module obl_math
public :: is_finite
! --------------------------------------------------------------------------------
contains
! --------------------------------------------------------------------------------
......
......@@ -28,18 +28,18 @@ module obl_tforcing
contains
! --------------------------------------------------------------------------------
subroutine set_const_tforcing(tforcing, fvalue_const)
subroutine set_const_tforcing(tforcing, fconst)
!> @brief setting const forcing
! ----------------------------------------------------------------------------
type (timeForcingDataType), intent(inout) :: tforcing
type (timeForcingDataType), intent(out) :: tforcing
real, intent(in) :: fvalue_const
real, intent(in) :: fconst
real, dimension(1) :: tval, fval
! ----------------------------------------------------------------------------
tval(1) = 0.0
fval(1) = fvalue_const
fval(1) = fconst
call set_generic_tforcing(tforcing, tval, fval, 1)
......@@ -49,7 +49,7 @@ module obl_tforcing
subroutine set_external_tforcing(tforcing, filename)
!> @brief setting forcing using file data
! ----------------------------------------------------------------------------
type (timeForcingDataType), intent(inout) :: tforcing
type (timeForcingDataType), intent(out) :: tforcing
character(*), intent(in) :: filename
......@@ -78,7 +78,9 @@ module obl_tforcing
close(io)
if (num > 0) then
allocate(tval(num), fval(num))
endif
! --- read input data
open(newunit = io, file = filename, iostat = status, status = 'old')
......@@ -115,10 +117,10 @@ module obl_tforcing
if (num > 0) then
allocate(tforcing%time(num), tforcing%fvalue(num))
endif
tforcing%time(:) = tval(1:num)
tforcing%fvalue(:) = fval(1:num)
endif
end subroutine set_generic_tforcing
......@@ -138,6 +140,7 @@ module obl_tforcing
end subroutine get_value_tforcing
! --------------------------------------------------------------------------------
subroutine deallocate_tforcing(tforcing)
!> @brief free time forcing data
! ----------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment