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

removing redundant code

parent 1e39db2b
No related branches found
No related tags found
No related merge requests found
......@@ -101,166 +101,4 @@ module obl_init
endif
end subroutine
subroutine Theta_init (Theta, Theta_dev, nz, dz)
!subroutine Theta_init (Theta, nz, dz)
!< @brief set initial conditions for temperature
use obl_state_eq
integer, intent(in) :: nz !< number of z-steps
real, intent(out) :: Theta(nz) !< Theta [K]
real, intent(out) :: Theta_dev(nz) !< Theta [K] - Theta_ref
real, intent(in) :: dz(nz) !< z-step [m]
real :: Theta_start !< temporary (for input from file)
integer :: k !< counter
integer :: status, num !< for file input
integer :: init_Theta !< how to set tau: 1 - const || 2 - function || 3 - file
init_Theta = 2
!open (222, file= 'Kato-Phillips/Theta_start.txt', status ='old')
!open (222, file= 'PAPA_06_2017/Theta_PAPA.txt', status ='old')
status = 0
num = 0
if (init_Theta.eq.1) then
do k = 1, nz
Theta(k) = 300.0 !Theta_start;
Theta_dev(k) = Theta(k) - Theta_ref
end do
else if (init_Theta.eq.2) then
do k = 1, nz
Theta(k) = 300.0 + 0.3 * (k-1) * dz(k)
!Theta(k) = Theta(k) - Theta_ref
Theta_dev(k) = Theta(k) - Theta_ref
end do
else if (init_Theta.eq.3) then
do while (status.eq.0)
read (222, *, iostat = status) Theta_start
num = num + 1
Theta(num) = Theta_start
Theta_dev(num) = Theta(num) - Theta_ref
if (num >= nz) then
exit
endif
end do
endif
close (222)
end subroutine
subroutine Salin_init (Salin, Salin_dev, nz, dz)
!< @brief set initial conditions for salinity
use obl_state_eq
integer, intent(in) :: nz !< number of z-steps
real, intent(out) :: Salin(nz) !< Salinity [PSU]
real, intent(out) :: Salin_dev(nz) !< Salinity [PSU]
real, intent(in) :: dz(nz) !< z-step [m]
real :: Salin_start !< temporary (for input from file)
integer :: k !< counter
integer :: status, num !< for file input
integer :: init_Salin !< how to set: 1 - const || 2 - function || 3 - file
init_Salin = 1
!open (777, file= 'Kato-Phillips/Salin_start.txt', status ='old') !Salin_PAPA.txt
!open (777, file= 'PAPA_06_2017/Salin_PAPA.txt', status ='old') !Salin_PAPA.txt
status = 0
num = 0
if (init_Salin.eq.1) then
do k = 1, nz
Salin(k) = 35.0;
Salin_dev(k) = Salin(k) - Salin_ref
end do
else if (init_Salin.eq.2) then
read (777, *, iostat = status) Salin_start
do k = 1, nz
Salin(k) = Salin_start
Salin_dev(k) = Salin(k) - Salin_ref
end do
else if (init_Salin.eq.3) then
do while (status.eq.0)
read (777, *, iostat = status) Salin_start
num = num + 1
Salin(num) = Salin_start
Salin_dev(num) = Salin(num) - Salin_ref
if (num >= nz) then
exit
endif
end do
endif
close (777)
end subroutine
subroutine U_init (U, nz)
!< @brief set initial conditions for U-velocity
integer, intent(in) :: nz !< number of z-steps
real, intent(out) :: U(nz) !< U-velocity [m/s]
real :: U_start !< temporary (for input from file)
integer :: k !< counter
integer :: status, num !< for file input
integer :: init_U !< how to set: 1 - const || 2 - function || 3 - file
init_U = 1
!open (888, file= 'Kato-Phillips/U_start.txt', status ='old')
status = 0
num = 0
if (init_U.eq.1) then
do k = 1, nz
U(k) = 0.0 !0.1 papa
end do
else if (init_U.eq.2) then
do k = 1, nz
U(k) = U_start
end do
else if (init_U.eq.3) then
do while (status.eq.0)
read (888, *, iostat = status) U_start
num = num + 1
U(num) = U_start
if (num >= nz) then
exit
endif
end do
endif
close (888)
end subroutine
subroutine V_init (V, nz)
!< @brief set initial conditions for V-velocity
integer, intent(in) :: nz !< number of z-steps
real, intent(out) :: V(nz) !< V-velocity [m/s]
real :: V_start !< temporary (for input from file)
integer :: k !< counter
integer :: status, num !< for file input
integer :: init_V !< how to set: 1 - const || 2 - function || 3 - file
init_V = 1
!open (999, file= 'Kato-Phillips/V_start.txt', status ='old')
status = 0
num = 0
if (init_V.eq.1) then
do k = 1, nz
V(k) = 0.0 !0.1 papa
end do
else if (init_V.eq.2) then
do k = 1, nz
V(k) = V_start
end do
else if (init_V.eq.3) then
do while (status.eq.0)
read (999, *, iostat = status) V_start
num = num + 1
V(num) = V_start
if (num >= nz) then
exit
endif
end do
endif
close (999)
end subroutine
end module
......@@ -335,14 +335,15 @@ program obl_main
call set_const_tforcing(tau_y_bot, 0.0)
! ----------------------------------------------------------------------------
!< setting reference data
! ----------------------------------------------------------------------------
N2_0 = 0.00044
! ----------------------------------------------------------------------------
status = 0
num = 0
N2_0 = 0.0004
i=1
do while (time_current < time_end )
! ----------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment