SCALE-RM
scale_ocean_phy_slab.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
12  !-----------------------------------------------------------------------------
13  !
14  !++ used modules
15  !
16  use scale_precision
17  use scale_stdio
18  use scale_prof
19  use scale_debug
21  !-----------------------------------------------------------------------------
22  implicit none
23  private
24  !-----------------------------------------------------------------------------
25  !
26  !++ Public procedure
27  !
28  public :: ocean_phy_slab_setup
29  public :: ocean_phy_slab
30 
31  !-----------------------------------------------------------------------------
32  !
33  !++ Public parameters & variables
34  !
35  !-----------------------------------------------------------------------------
36  !
37  !++ Private procedure
38  !
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private parameters & variables
42  !
43  real(RP), private :: OCEAN_PHY_SLAB_DEPTH = 10.0_rp
44  real(RP), private :: OCEAN_PHY_SLAB_HeatCapacity
45 
46  !-----------------------------------------------------------------------------
47 contains
48  !-----------------------------------------------------------------------------
50  subroutine ocean_phy_slab_setup( OCEAN_TYPE )
51  use scale_process, only: &
53  use scale_const, only: &
54  dwatr => const_dwatr, &
55  cl => const_cl
56  implicit none
57 
58  character(len=*), intent(in) :: ocean_type
59 
60  namelist / param_ocean_phy_slab / &
61  ocean_phy_slab_depth
62 
63  integer :: ierr
64  !---------------------------------------------------------------------------
65 
66  if( io_l ) write(io_fid_log,*)
67  if( io_l ) write(io_fid_log,*) '++++++ Module[SLAB] / Categ[OCEAN PHY] / Origin[SCALElib]'
68 
69  !--- read namelist
70  rewind(io_fid_conf)
71  read(io_fid_conf,nml=param_ocean_phy_slab,iostat=ierr)
72  if( ierr < 0 ) then !--- missing
73  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
74  elseif( ierr > 0 ) then !--- fatal error
75  write(*,*) 'xxx Not appropriate names in namelist PARAM_OCEAN_PHY_SLAB. Check!'
76  call prc_mpistop
77  endif
78  if( io_nml ) write(io_fid_nml,nml=param_ocean_phy_slab)
79 
80  ocean_phy_slab_heatcapacity = dwatr * cl * ocean_phy_slab_depth
81 
82  if( io_l ) write(io_fid_log,*)
83  if( io_l ) write(io_fid_log,*) '*** Slab ocean depth [m] : ', ocean_phy_slab_depth
84  if( io_l ) write(io_fid_log,*) '*** Ocean heat capacity [J/K/m2] : ', ocean_phy_slab_heatcapacity
85 
86  return
87  end subroutine ocean_phy_slab_setup
88 
89  !-----------------------------------------------------------------------------
91  subroutine ocean_phy_slab( &
92  OCEAN_TEMP_t, &
93  OCEAN_TEMP, &
94  OCEAN_SFLX_WH, &
95  OCEAN_SFLX_prec, &
96  OCEAN_SFLX_evap, &
97  dt )
98  use scale_landuse, only: &
100  implicit none
101 
102  real(RP), intent(out) :: ocean_temp_t (ia,ja)
103  real(RP), intent(in) :: ocean_temp (ia,ja)
104  real(RP), intent(in) :: ocean_sflx_wh (ia,ja)
105  real(RP), intent(in) :: ocean_sflx_prec(ia,ja)
106  real(RP), intent(in) :: ocean_sflx_evap(ia,ja)
107  real(DP), intent(in) :: dt
108 
109  integer :: i, j
110  !---------------------------------------------------------------------------
111 
112  if( io_l ) write(io_fid_log,*) '*** Ocean physics step: Slab'
113 
114  do j = js, je
115  do i = is, ie
116  if( landuse_fact_ocean(i,j) > 0.0_rp ) then
117  ocean_temp_t(i,j) = - ocean_sflx_wh(i,j) / ocean_phy_slab_heatcapacity
118  else
119  ocean_temp_t(i,j) = 0.0_rp
120  endif
121  enddo
122  enddo
123 
124  return
125  end subroutine ocean_phy_slab
126 
127 end module scale_ocean_phy_slab
integer, public is
start point of inner domain: x, local
module DEBUG
Definition: scale_debug.F90:13
integer, public je
end point of inner domain: y, local
subroutine, public prc_mpistop
Abort MPI.
real(rp), parameter, public const_dwatr
density of water [kg/m3]
Definition: scale_const.F90:84
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
Definition: scale_const.F90:68
module STDIO
Definition: scale_stdio.F90:12
subroutine, public ocean_phy_slab_setup(OCEAN_TYPE)
Setup.
module grid index
logical, public io_nml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:62
module OCEAN / Physics Slab model
integer, public ia
of whole cells: x, local, with HALO
module LANDUSE
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
integer, public js
start point of inner domain: y, local
module PROCESS
module CONSTANT
Definition: scale_const.F90:14
module profiler
Definition: scale_prof.F90:10
integer, public ie
end point of inner domain: x, local
module PRECISION
subroutine, public ocean_phy_slab(OCEAN_TEMP_t, OCEAN_TEMP, OCEAN_SFLX_WH, OCEAN_SFLX_prec, OCEAN_SFLX_evap, dt)
Slab ocean model.
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
integer, public io_fid_nml
Log file ID (only for output namelist)
Definition: scale_stdio.F90:57
integer, public ja
of whole cells: y, local, with HALO