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

adding time-dependent forcing partial support

parent a52279f3
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,11 @@ program obl_main
! turbulence closure parameters
type(pacanowskiParamType) :: param_pacanowski
! surface forcing
type(timeForcingDataType) :: sensible_hflux_surf, latent_hflux_surf
type(timeForcingDataType) :: salin_flux_surf
!type(timeForcingDataType) :: tau_x_surf, tau_y_surf
real :: t !< time, [s]
integer :: nt !< number of time steps
integer :: nf !< number of time steps for forcing
......@@ -65,6 +70,7 @@ program obl_main
real, allocatable :: Flux_sal_surf(:), Flux_sal_bot(:) !< salt fluxes, [PSU*m/s] ???
real, allocatable :: Times_flux_Sal_surf(:), Times_flux_Sal_bot(:)
real, allocatable :: Tau_x_surf(:), Tau_y_surf(:), Tau_x_bot(:), Tau_y_bot(:) !< [N/m**2]
real, allocatable :: flux_u_surf(:), flux_u_bot(:) !< [(m/s)**2]
real, allocatable :: Times_flux_u_surf(:), Times_flux_u_bot(:)
real, allocatable :: flux_v_surf(:), flux_v_bot(:) !< [(m/s)**2]
......@@ -77,6 +83,8 @@ program obl_main
integer, parameter :: output_mode = 1 ! 1 -- netcdf, 2 -- ascii, 3 -- tecplot
integer, parameter :: obl_setup = 1 ! 1 - Kato-Phillips, 2 - Papa station
real :: Rho_dyn_surf, Rho_dyn_bot !< density dynamic, [kg / m**3]
real :: mld !< mixed layer depth, [m]
......@@ -245,15 +253,46 @@ program obl_main
call U_init(U, nz)
call V_init(V, nz)
!initialization of TKE & eps in case of k-epsilon closure
if (closure_mode.eq.3 .or. closure_mode.eq.4) then
call TKE_init(TKE, nz)
call eps_init(eps, nz, z)
endif
! set atmospheric forcing
if (obl_setup == 1) then
call set_const_tforcing(sensible_hflux_surf, 0.0)
call set_const_tforcing(latent_hflux_surf, 0.0)
call set_const_tforcing(salin_flux_surf, 0.0)
!call set_const_tforcing(tau_x_surf, 0.1)
!call set_const_tforcing(tau_y_surf, 0.0)
endif
if (obl_setup == 2) then
call set_external_tforcing(sensible_hflux_surf, 'PAPA_06_2017/sensible_hflux.txt')
call set_external_tforcing(latent_hflux_surf, 'PAPA_06_2017/latent_hflux.txt')
call set_const_tforcing(salin_flux_surf, 0.0)
!call set_external_tforcing(tau_x_surf, 'PAPA_06_2017/tau_x.txt')
!call set_external_tforcing(tau_y_surf, 'PAPA_06_2017/tau_y.txt')
endif
!set boundary conditions
call set_Flux_heat_surf (Flux_heat_surf, Times_flux_heat_surf, nf, df)
call set_Flux_heat_bot (Flux_heat_bot, Times_flux_heat_bot, nf, df)
call set_Flux_sal_surf (Flux_sal_surf, Times_flux_sal_surf, nf, df)
call set_Flux_sal_bot (Flux_sal_bot, Times_flux_sal_bot, nf, df)
call set_Tau_x_surf(Tau_x_surf, flux_u_surf, Times_flux_u_surf, nf, df)
call set_Tau_y_surf(Tau_y_surf, flux_v_surf, Times_flux_v_surf, nf, df)
call set_Flux_heat_bot (Flux_heat_bot, Times_flux_heat_bot, nf, df)
call set_Flux_sal_bot (Flux_sal_bot, Times_flux_sal_bot, nf, df)
call set_Tau_x_bot(Tau_x_bot, flux_u_bot, Times_flux_u_bot, nf, df)
call set_Tau_y_bot(Tau_y_bot, flux_v_bot, Times_flux_v_bot, nf, df)
call set_f_Heat_right (f_Heat_right, nz)
call set_f_Sal_right (f_Sal_right, nz)
call set_f_u_right (f_v_right, V, nz)
......@@ -273,12 +312,6 @@ program obl_main
N2_0 = 0.0004
!initialization of TKE & eps in case of k-epsilon closure
if (closure_mode.eq.3 .or. closure_mode.eq.4) then
call TKE_init(TKE, nz)
call eps_init(eps, nz, z)
endif
i=1
do while (time_current < time_end )
......@@ -463,6 +496,15 @@ program obl_main
deallocate(Km_TKE)
deallocate(Km_eps)
!> removing time-dependent forcing data
call deallocate_tforcing(sensible_hflux_surf)
call deallocate_tforcing(latent_hflux_surf)
call deallocate_tforcing(salin_flux_surf)
!call deallocate_tforcing(tau_x_surf)
!call deallocate_tforcing(tau_y_surf)
!> removing time slice data
call output_cleanup
......
......@@ -12,8 +12,8 @@ module obl_tforcing
! public interface
! --------------------------------------------------------------------------------
public :: set_const_tforcing, set_external_tforcing, set_generic_tforcing
public :: get_value_tforcing
public :: deallocate_tforcing
! --------------------------------------------------------------------------------
!> @brief time forcing datatype
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment