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

adding cyclone setups

parent eb206370
Branches
No related tags found
No related merge requests found
......@@ -58,6 +58,7 @@ set(SOURCES
obl_run_papa_fluxes.f90
obl_run_papa_meteo.f90
obl_run_cbl.f90
obl_run_cyclone.f90
obl_config.f90
vermix_inmom.f90
)
......
......@@ -23,11 +23,13 @@ module obl_config
integer, parameter :: obl_config_papa_fluxes = 1 !< Papa-station (fluxes) setup
integer, parameter :: obl_config_papa_meteo = 2 !< Papa-station (meteo) setup
integer, parameter :: obl_config_cbl = 3 !< CBL setup
integer, parameter :: obl_config_cyclone = 4 !< cyclone setup
character(len = 16), parameter :: obl_config_kato_tag = 'kato'
character(len = 16), parameter :: obl_config_papa_fluxes_tag = 'papa-fluxes'
character(len = 16), parameter :: obl_config_papa_meteo_tag = 'papa-meteo'
character(len = 16), parameter :: obl_config_cbl_tag = 'cbl'
character(len = 16), parameter :: obl_config_cyclone_tag = 'cyclone'
!> @brief model enum def.
integer, parameter :: obl_model_pph = 0 !< pacanowski-philander
......@@ -56,6 +58,8 @@ contains
id = obl_config_papa_meteo
else if (trim(tag) == trim(obl_config_cbl_tag)) then
id = obl_config_cbl
else if (trim(tag) == trim(obl_config_cyclone_tag)) then
id = obl_config_cyclone
end if
end function
......@@ -74,6 +78,8 @@ contains
tag = obl_config_papa_meteo_tag
else if (id == obl_config_cbl) then
tag = obl_config_cbl_tag
else if (id == obl_config_cyclone) then
tag = obl_config_cyclone_tag
end if
end function
......@@ -120,6 +126,7 @@ contains
use obl_run_papa_fluxes, only : set_grid_papa_fluxes => set_grid
use obl_run_papa_meteo, only : set_grid_papa_meteo => set_grid
use obl_run_cbl, only : set_grid_cbl => set_grid
use obl_run_cyclone, only : set_grid_cyclone => set_grid
type (gridDataType), intent(inout) :: grid
integer, intent(in) :: config_id
......@@ -145,6 +152,10 @@ contains
call set_grid_cbl(grid)
return
endif
if (config_id == obl_config_cyclone) then
call set_grid_cyclone(grid)
return
endif
#ifdef USE_CONFIG_PARSER
block
......@@ -181,6 +192,7 @@ contains
use obl_run_papa_fluxes, only : set_time_papa_fluxes => set_time
use obl_run_papa_meteo, only : set_time_papa_meteo => set_time
use obl_run_cbl, only : set_time_cbl => set_time
use obl_run_cyclone, only : set_time_cyclone => set_time
real, intent(out) :: time_begin, time_end, dt
integer, intent(in) :: config_id
......@@ -206,6 +218,10 @@ contains
call set_time_cbl(time_begin, time_end, dt)
return
endif
if (config_id == obl_config_cyclone) then
call set_time_cyclone(time_begin, time_end, dt)
return
endif
#ifdef USE_CONFIG_PARSER
block
......@@ -245,6 +261,7 @@ contains
use obl_run_papa_fluxes, only : set_phys_papa_fluxes => set_phys
use obl_run_papa_meteo, only : set_phys_papa_meteo => set_phys
use obl_run_cbl, only : set_phys_cbl => set_phys
use obl_run_cyclone, only : set_phys_cyclone => set_phys
integer, intent(in) :: config_id
integer, intent(out) :: ierr
......@@ -268,6 +285,10 @@ contains
call set_phys_cbl
return
endif
if (config_id == obl_config_cyclone) then
call set_phys_cyclone
return
endif
#ifdef USE_CONFIG_PARSER
block
......@@ -320,6 +341,7 @@ contains
use obl_run_papa_fluxes, only : set_forcing_papa_fluxes => set_forcing
use obl_run_papa_meteo, only : set_forcing_papa_meteo => set_forcing
use obl_run_cbl, only : set_forcing_cbl => set_forcing
use obl_run_cyclone, only : set_forcing_cyclone => set_forcing
integer, intent(in) :: config_id
integer, intent(out) :: ierr
......@@ -343,6 +365,10 @@ contains
call set_forcing_cbl
return
endif
if (config_id == obl_config_cyclone) then
call set_forcing_cyclone
return
endif
!< assuming that forcing def. is optional
block
......@@ -427,6 +453,7 @@ contains
use obl_run_papa_fluxes, only : set_initial_conditions_papa_fluxes => set_initial_conditions
use obl_run_papa_meteo, only : set_initial_conditions_papa_meteo => set_initial_conditions
use obl_run_cbl, only : set_initial_conditions_cbl => set_initial_conditions
use obl_run_cyclone, only : set_initial_conditions_cyclone => set_initial_conditions
type (gridDataType), intent(in) :: grid
......@@ -452,6 +479,10 @@ contains
call set_initial_conditions_cbl(grid)
return
endif
if (config_id == obl_config_cyclone) then
call set_initial_conditions_cyclone(grid)
return
endif
block
!< *: will fail without configuration file
......
......@@ -56,6 +56,7 @@ program obl_main
! = obl_config_papa_fluxes: Papa-station (fluxes)
! = obl_config_papa_meteo: Papa-station (meteo)
! = obl_config_cbl: convective boundary layer (Willis exp.)
! = obl_config_cyclone: cyclone setup
integer :: obl_model_id ! --- OBL model def.
! = obl_model_pph: pacanowski-philander
......@@ -122,6 +123,7 @@ program obl_main
!< = obl_config_papa_fluxes
!< = obl_config_papa_meteo
!< = obl_config_cbl
!< = obl_config_cyclone
obl_config_id = obl_config_kato
!< default closure = 4, k-epsilon
......@@ -148,7 +150,7 @@ program obl_main
write(*, *) ' --help'
write(*, *) ' print usage options'
write(*, *) ' --config [key] || [filename]'
write(*, *) ' builtin setup [key] = kato (default) || papa-fluxes || papa || cbl'
write(*, *) ' builtin setup [key] = kato (default) || papa-fluxes || papa || cbl || cyclone'
write(*, *) ' use configuration file [filename]'
write(*, *) ' --model [key]'
write(*, *) ' [key] = pph || pph-dyn || k-epsilon (default)'
......
module obl_run_cyclone
!< @brief obl scm cyclone setup
! --------------------------------------------------------------------------------
! TO DO:
! -- ***
! modules used
! --------------------------------------------------------------------------------
! directives list
! --------------------------------------------------------------------------------
implicit none
private
! public interface
! --------------------------------------------------------------------------------
public :: set_phys
public :: set_grid
public :: set_time
public :: set_forcing
public :: set_initial_conditions
! --------------------------------------------------------------------------------
! --------------------------------------------------------------------------------
character(len = 256), parameter :: path = 'cyclone/STARSn28/'
! = 'cyclone/rojo60'
! = 'cyclone/rojo62'
! = 'cyclone/STARSn28'
! --------------------------------------------------------------------------------
contains
! --------------------------------------------------------------------------------
subroutine set_phys
!> @brief phys parameters setup
! ----------------------------------------------------------------------------
use obl_scm
! ----------------------------------------------------------------------------
!< coriolis frequency
!< *: this should be changed
f = 1.116 * 1e-4
!< SW extinction parameters
a_band_ratio = 0.67
a_extinction_coeff = 1.0
b_extinction_coeff = 1.0 / 17.0
!< *: this should be changed
sw_albedo = 0.3
end subroutine set_phys
! --------------------------------------------------------------------------------
subroutine set_grid(grid)
!> @brief grid parameters setup
! ----------------------------------------------------------------------------
use obl_grid
type (gridDataType), intent(inout) :: grid
! ----------------------------------------------------------------------------
!< in: [zpos, height, cz]
call set_uniform_grid(grid, 0.0, 1000.0, 512)
end subroutine set_grid
! --------------------------------------------------------------------------------
subroutine set_time(time_begin, time_end, dt)
!> @brief time parameters setup
! ----------------------------------------------------------------------------
real, intent(out) :: time_begin, time_end, dt
! ----------------------------------------------------------------------------
time_begin = 0.0
time_end = 48.0 * 3600.0
dt = 1.0
end subroutine set_time
! --------------------------------------------------------------------------------
subroutine set_forcing
!> @brief forcing setup
! ----------------------------------------------------------------------------
use obl_fluxes
use obl_tforcing
! ----------------------------------------------------------------------------
!< setting atmospheric forcing
! ----------------------------------------------------------------------------
!< using 'meteo' mode
is_meteo_setup = 1
call set_external_tforcing(Ua, 'meteo-forcing/'//trim(path)//'u-wind.dat')
call set_external_tforcing(Va, 'meteo-forcing/'//trim(path)//'v-wind.dat')
call set_const_tforcing(salin_flux_surf, 0.0)
call set_external_tforcing(Ta, 'meteo-forcing/'//trim(path)//'Tair.dat')
call set_external_tforcing(Pa, 'meteo-forcing/'//trim(path)//'Pair.dat')
call set_external_tforcing(RHa, 'meteo-forcing/'//trim(path)//'Qair.dat')
call set_external_tforcing(sw_flux_surf, 'meteo-forcing/'//trim(path)//'SW-down.dat')
call set_external_tforcing(lw_in_surf, 'meteo-forcing/'//trim(path)//'LW-down.dat')
!< normalize time in external forcing: hrs -> sec
call normalize_time_tforcing(Ua, 3600.0)
call normalize_time_tforcing(Va, 3600.0)
call normalize_time_tforcing(Ta, 3600.0)
call normalize_time_tforcing(Pa, 3600.0)
call normalize_time_tforcing(RHa, 3600.0)
call normalize_time_tforcing(sw_flux_surf, 3600.0)
call normalize_time_tforcing(lw_in_surf, 3600.0)
! ----------------------------------------------------------------------------
!< setting bottom forcing
! ----------------------------------------------------------------------------
call set_const_tforcing(hflux_bot, 0.0)
call set_const_tforcing(salin_flux_bot, 0.0)
call set_const_tforcing(tau_x_bot, 0.0)
call set_const_tforcing(tau_y_bot, 0.0)
! ----------------------------------------------------------------------------
end subroutine set_forcing
! --------------------------------------------------------------------------------
subroutine set_initial_conditions(grid)
!> @brief initial_conditions setup
! ----------------------------------------------------------------------------
use obl_state
use obl_init
use obl_grid
type (gridDataType), intent(in) :: grid
! ----------------------------------------------------------------------------
call set_external_profile(Theta, 'meteo-init/'//trim(path)//'Theta.dat', grid)
call set_external_profile(Salin, 'meteo-init/'//trim(path)//'Salin.dat', grid)
call set_const_profile(U, 0.0, grid)
call set_const_profile(V, 0.0, grid)
end subroutine set_initial_conditions
end module
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment