Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(newtonian_viscosity), | intent(in) | :: | this | |||
class(vector_field), | intent(in) | :: | velocity | The velocity field of the ice for which the velocity is being calculated |
||
real(kind=r8), | intent(in) | :: | temperature | The temperature of the ice for which viscosity is being calculated. |
||
real(kind=r8), | intent(in), | optional | :: | time | The time at which the viscosity is being calculated. If not present then assumed to be same as previous value passed. |
The value of the viscosity
function newtonian_ice_viscosity(this, velocity, temperature, time) &
result(viscosity)
class(newtonian_viscosity), intent(in) :: this
class(vector_field), intent(in) :: velocity
!! The velocity field of the ice for which the velocity is
!! being calculated
real(r8), intent(in) :: temperature
!! The temperature of the ice for which viscosity is being
!! calculated.
real(r8), intent(in), optional :: time
!! The time at which the viscosity is being calculated. If not
!! present then assumed to be same as previous value passed.
class(scalar_field), pointer :: viscosity
!! The value of the viscosity
type(uniform_scalar_field) :: dummy
call velocity%guard_temp()
call dummy%allocate_scalar_field(viscosity)
viscosity = uniform_scalar_field(this%viscosity_value)
call viscosity%set_temp() ! Shouldn't need to call this, but for some
! reason being set as non-temporary when
! assignment subroutine returns.
call velocity%clean_temp()
end function newtonian_ice_viscosity