SCALE-RM
Functions/Subroutines
mod_ocean_driver Module Reference

module OCEAN driver More...

Functions/Subroutines

subroutine, public ocean_driver_setup
 Setup. More...
 
subroutine, public ocean_driver_resume
 Resume. More...
 
subroutine, public ocean_driver
 Ocean step. More...
 
subroutine, public ocean_surface_get
 Get surface boundary from other model. More...
 
subroutine, public ocean_surface_set (countup)
 Put surface boundary to other model. More...
 

Detailed Description

module OCEAN driver

Description
Ocean model driver
Author
Team SCALE

Function/Subroutine Documentation

◆ ocean_driver_setup()

subroutine, public mod_ocean_driver::ocean_driver_setup ( )

Setup.

Definition at line 54 of file mod_ocean_driver.f90.

References scale_stdio::io_fid_log, scale_stdio::io_l, and mod_ocean_phy_driver::ocean_phy_driver_setup().

Referenced by mod_rm_driver::scalerm().

54  use mod_ocean_phy_driver, only: &
56 ! use mod_ocean_frc_nudge, only: &
57 ! OCEAN_FRC_driver_setup
58  implicit none
59  !---------------------------------------------------------------------------
60 
61  if( io_l ) write(io_fid_log,*)
62  if( io_l ) write(io_fid_log,*) '++++++ Module[DRIVER] / Categ[OCEAN] / Origin[SCALE-RM]'
63 
65 
66 ! if( OCEAN_FRC_sw ) call OCEAN_FRC_driver_setup
67 
68  return
module OCEAN / Physics
subroutine, public ocean_phy_driver_setup
Setup.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ocean_driver_resume()

subroutine, public mod_ocean_driver::ocean_driver_resume ( )

Resume.

Definition at line 74 of file mod_ocean_driver.f90.

References scale_stdio::io_fid_log, scale_stdio::io_l, mod_ocean_phy_driver::ocean_phy_driver_resume(), ocean_surface_get(), ocean_surface_set(), mod_ocean_admin::ocean_sw, mod_ocean_vars::ocean_vars_history(), scale_prof::prof_rapend(), and scale_prof::prof_rapstart().

Referenced by mod_rm_driver::resume_state().

74  use mod_ocean_phy_driver, only: &
76 ! use mod_ocean_frc_nudge, only: &
77 ! OCEAN_FRC_driver_resume
78  use mod_ocean_vars, only: &
80  use mod_ocean_admin, only: &
81  ocean_sw
82  implicit none
83  !---------------------------------------------------------------------------
84 
85  if( io_l ) write(io_fid_log,*)
86  if( io_l ) write(io_fid_log,*) '++++++ Module[DRIVER] / Categ[OCEAN] / Origin[SCALE-RM]'
87 
88  !########## Get Surface Boundary from coupler ##########
89  call ocean_surface_get
90 
92 
93 ! if( OCEAN_FRC_sw ) call OCEAN_FRC_driver_resume
94 
95  !########## Set Surface Boundary to coupler ##########
96  call ocean_surface_set( countup=.true. )
97 
98  !########## History & Monitor ##########
99  if ( ocean_sw ) then
100  call prof_rapstart('OCN_History', 1)
101  call ocean_vars_history
102  call prof_rapend ('OCN_History', 1)
103  endif
104 
105  return
logical, public ocean_sw
subroutine, public ocean_vars_history
History output set for ocean variables.
module OCEAN / Physics
subroutine, public ocean_surface_set(countup)
Put surface boundary to other model.
module Ocean admin
module OCEAN Variables
subroutine, public ocean_phy_driver_resume
Resume.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ocean_driver()

subroutine, public mod_ocean_driver::ocean_driver ( )

Ocean step.

Definition at line 111 of file mod_ocean_driver.f90.

References scale_grid_index::ie, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, mod_ocean_phy_driver::ocean_phy_driver(), mod_ocean_vars::ocean_sfc_albedo, mod_ocean_vars::ocean_sfc_albedo_t, mod_ocean_vars::ocean_sfc_temp, mod_ocean_vars::ocean_sfc_temp_t, mod_ocean_vars::ocean_sfc_z0e, mod_ocean_vars::ocean_sfc_z0e_t, mod_ocean_vars::ocean_sfc_z0h, mod_ocean_vars::ocean_sfc_z0h_t, mod_ocean_vars::ocean_sfc_z0m, mod_ocean_vars::ocean_sfc_z0m_t, ocean_surface_get(), ocean_surface_set(), mod_ocean_admin::ocean_sw, mod_ocean_vars::ocean_temp, mod_ocean_vars::ocean_temp_t, mod_ocean_vars::ocean_vars_history(), mod_ocean_vars::ocean_vars_total(), scale_prof::prof_rapend(), scale_prof::prof_rapstart(), and scale_time::time_dtsec_ocean.

Referenced by mod_rm_driver::scalerm().

111  use scale_time, only: &
112  dt => time_dtsec_ocean
113  use mod_ocean_admin, only: &
114  ocean_sw
115  use mod_ocean_vars, only: &
116  ocean_temp, &
117  ocean_sfc_temp, &
119  ocean_sfc_z0m, &
120  ocean_sfc_z0h, &
121  ocean_sfc_z0e, &
122  ocean_temp_t, &
125  ocean_sfc_z0m_t, &
126  ocean_sfc_z0h_t, &
127  ocean_sfc_z0e_t, &
130  use mod_ocean_phy_driver, only: &
132 ! use mod_ocean_forcing, only: &
133 ! OCEAN_forcing
134  implicit none
135 
136  integer :: i, j
137  !---------------------------------------------------------------------------
138 
139  !########## Get Surface Boundary from coupler ##########
140  call prof_rapstart('OCN_SfcExch', 2)
141  call ocean_surface_get
142  call prof_rapend ('OCN_SfcExch', 2)
143 
144  !########## Physics ##########
145  if ( ocean_sw ) then
146  call prof_rapstart('OCN_Physics', 1)
147  call ocean_phy_driver( update_flag = .true. )
148  call prof_rapend ('OCN_Physics', 1)
149  endif
150 
151  !########## Forcing ##########
152 ! if ( OCEAN_FORCE_sw ) then
153 ! call PROF_rapstart('OCN_Forcing', 1)
154 ! call OCEAN_forcing
155 ! call PROF_rapend ('OCN_Forcing', 1)
156 ! endif
157 
158  !########## Update ##########
159  do j = js, je
160  do i = is, ie
161  ocean_temp(i,j) = ocean_temp(i,j) + ocean_temp_t(i,j) * dt
162  ocean_sfc_temp(i,j) = ocean_sfc_temp(i,j) + ocean_sfc_temp_t(i,j) * dt
165  ocean_sfc_z0m(i,j) = ocean_sfc_z0m(i,j) + ocean_sfc_z0m_t(i,j) * dt
166  ocean_sfc_z0h(i,j) = ocean_sfc_z0h(i,j) + ocean_sfc_z0h_t(i,j) * dt
167  ocean_sfc_z0e(i,j) = ocean_sfc_z0e(i,j) + ocean_sfc_z0e_t(i,j) * dt
168  enddo
169  enddo
170 
171  call ocean_vars_total
172 
173  !########## Set Surface Boundary to coupler ##########
174  call prof_rapstart('OCN_SfcExch', 2)
175  call ocean_surface_set( countup=.true. )
176  call prof_rapend ('OCN_SfcExch', 2)
177 
178  !########## reset tendencies ##########
179 !OCL XFILL
180  do j = js, je
181  do i = is, ie
182  ocean_temp_t(i,j) = 0.0_rp
183  ocean_sfc_temp_t(i,j) = 0.0_rp
184  ocean_sfc_albedo_t(i,j,i_lw) = 0.0_rp
185  ocean_sfc_albedo_t(i,j,i_sw) = 0.0_rp
186  ocean_sfc_z0m_t(i,j) = 0.0_rp
187  ocean_sfc_z0h_t(i,j) = 0.0_rp
188  ocean_sfc_z0e_t(i,j) = 0.0_rp
189  enddo
190  enddo
191 
192  !########## History & Monitor ##########
193  call prof_rapstart('OCN_History', 1)
194  call ocean_vars_history
195  call prof_rapend ('OCN_History', 1)
196 
197  return
real(dp), public time_dtsec_ocean
time interval of ocean step [sec]
Definition: scale_time.F90:47
logical, public ocean_sw
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp_t
tendency of OCEAN_SFC_TEMP
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0e_t
tendency of OCEAN_SFC_Z0E
real(rp), dimension(:,:,:), allocatable, public ocean_sfc_albedo
ocean surface albedo (0-1)
real(rp), dimension(:,:,:), allocatable, public ocean_sfc_albedo_t
tendency of OCEAN_SFC_alebdo
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0e
ocean surface roughness length for vapor [m]
real(rp), dimension(:,:), allocatable, public ocean_temp
temperature at uppermost ocean layer [K]
subroutine, public ocean_vars_history
History output set for ocean variables.
module OCEAN / Physics
real(rp), dimension(:,:), allocatable, public ocean_temp_t
tendency of OCEAN_TEMP
integer, parameter, public i_lw
integer, parameter, public i_sw
subroutine, public ocean_surface_set(countup)
Put surface boundary to other model.
subroutine, public ocean_vars_total
Budget monitor for ocean.
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0h_t
tendency of OCEAN_SFC_Z0H
module TIME
Definition: scale_time.F90:15
module Ocean admin
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m
ocean surface roughness length for momentum [m]
subroutine, public ocean_phy_driver(update_flag)
Driver.
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp
ocean surface skin temperature [K]
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m_t
tendency of OCEAN_SFC_Z0M
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0h
ocean surface roughness length for heat [m]
module OCEAN Variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ocean_surface_get()

subroutine, public mod_ocean_driver::ocean_surface_get ( )

Get surface boundary from other model.

Definition at line 203 of file mod_ocean_driver.f90.

References mod_ocean_vars::atmos_cossza, mod_ocean_vars::atmos_dens, mod_ocean_vars::atmos_pbl, mod_ocean_vars::atmos_pres, mod_ocean_vars::atmos_qv, mod_ocean_vars::atmos_sfc_pres, mod_ocean_vars::atmos_sflx_lw, mod_ocean_vars::atmos_sflx_prec, mod_ocean_vars::atmos_sflx_sw, mod_ocean_vars::atmos_temp, mod_ocean_vars::atmos_u, mod_ocean_vars::atmos_v, mod_ocean_vars::atmos_w, mod_cpl_vars::cpl_getatm_ocn(), scale_grid_index::ie, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, and mod_ocean_admin::ocean_sw.

Referenced by ocean_driver(), and ocean_driver_resume().

203  use mod_ocean_admin, only: &
204  ocean_sw
205  use mod_ocean_vars, only: &
206  atmos_temp, &
207  atmos_pres, &
208  atmos_w, &
209  atmos_u, &
210  atmos_v, &
211  atmos_dens, &
212  atmos_qv, &
213  atmos_pbl, &
214  atmos_sfc_pres, &
215  atmos_sflx_lw, &
216  atmos_sflx_sw, &
217  atmos_cossza, &
219  use mod_cpl_vars, only: &
221  implicit none
222 
223  real(RP) :: ATMOS_SFLX_rad_dn(IA,JA,2,2)
224  real(RP) :: ATMOS_SFLX_rain (IA,JA)
225  real(RP) :: ATMOS_SFLX_snow (IA,JA)
226 
227  integer :: i, j
228  !---------------------------------------------------------------------------
229 
230  if ( ocean_sw ) then
231  call cpl_getatm_ocn( atmos_temp(:,:), & ! [OUT]
232  atmos_pres(:,:), & ! [OUT]
233  atmos_w(:,:), & ! [OUT]
234  atmos_u(:,:), & ! [OUT]
235  atmos_v(:,:), & ! [OUT]
236  atmos_dens(:,:), & ! [OUT]
237  atmos_qv(:,:), & ! [OUT]
238  atmos_pbl(:,:), & ! [OUT]
239  atmos_sfc_pres(:,:), & ! [OUT]
240  atmos_sflx_rad_dn(:,:,:,:), & ! [OUT]
241  atmos_cossza(:,:), & ! [OUT]
242  atmos_sflx_rain(:,:), & ! [OUT]
243  atmos_sflx_snow(:,:) ) ! [OUT]
244  endif
245 
246 !OCL XFILL
247  do j = js, je
248  do i = is, ie
249  atmos_sflx_sw(i,j) = atmos_sflx_rad_dn(i,j,i_sw,1) + atmos_sflx_rad_dn(i,j,i_sw,2) ! direct+diffuse
250  atmos_sflx_lw(i,j) = atmos_sflx_rad_dn(i,j,i_lw,1) + atmos_sflx_rad_dn(i,j,i_lw,2) ! direct+diffuse
251 
252  atmos_sflx_prec(i,j) = atmos_sflx_rain(i,j) + atmos_sflx_snow(i,j) ! liquid+ice
253  enddo
254  enddo
255 
256  return
logical, public ocean_sw
real(rp), dimension(:,:), allocatable, public atmos_w
real(rp), dimension(:,:), allocatable, public atmos_dens
real(rp), dimension(:,:), allocatable, public atmos_v
real(rp), dimension(:,:), allocatable, public atmos_sflx_lw
integer, parameter, public i_lw
integer, parameter, public i_sw
real(rp), dimension(:,:), allocatable, public atmos_cossza
real(rp), dimension(:,:), allocatable, public atmos_sfc_pres
real(rp), dimension(:,:), allocatable, public atmos_qv
module COUPLER Variables
real(rp), dimension(:,:), allocatable, public atmos_sflx_prec
module Ocean admin
real(rp), dimension(:,:), allocatable, public atmos_temp
real(rp), dimension(:,:), allocatable, public atmos_u
real(rp), dimension(:,:), allocatable, public atmos_sflx_sw
subroutine, public cpl_getatm_ocn(TEMP, PRES, W, U, V, DENS, QV, PBL, SFC_PRES, SFLX_rad_dn, cosSZA, SFLX_rain, SFLX_snow)
real(rp), dimension(:,:), allocatable, public atmos_pbl
real(rp), dimension(:,:), allocatable, public atmos_pres
module OCEAN Variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ocean_surface_set()

subroutine, public mod_ocean_driver::ocean_surface_set ( logical, intent(in)  countup)

Put surface boundary to other model.

Definition at line 262 of file mod_ocean_driver.f90.

References mod_cpl_vars::cpl_putocn(), mod_ocean_vars::ocean_q2, mod_ocean_vars::ocean_sfc_albedo, mod_ocean_vars::ocean_sfc_temp, mod_ocean_vars::ocean_sfc_z0e, mod_ocean_vars::ocean_sfc_z0h, mod_ocean_vars::ocean_sfc_z0m, mod_ocean_vars::ocean_sflx_evap, mod_ocean_vars::ocean_sflx_lh, mod_ocean_vars::ocean_sflx_mu, mod_ocean_vars::ocean_sflx_mv, mod_ocean_vars::ocean_sflx_mw, mod_ocean_vars::ocean_sflx_sh, mod_ocean_vars::ocean_sflx_wh, mod_ocean_admin::ocean_sw, mod_ocean_vars::ocean_t2, mod_ocean_vars::ocean_u10, and mod_ocean_vars::ocean_v10.

Referenced by mod_mkinit::mkinit(), ocean_driver(), ocean_driver_resume(), and mod_rm_driver::resume_state().

262  use mod_ocean_admin, only: &
263  ocean_sw
264  use mod_ocean_vars, only: &
265  ocean_sfc_temp, &
267  ocean_sfc_z0m, &
268  ocean_sfc_z0h, &
269  ocean_sfc_z0e, &
270  ocean_sflx_mw, &
271  ocean_sflx_mu, &
272  ocean_sflx_mv, &
273  ocean_sflx_sh, &
274  ocean_sflx_lh, &
275  ocean_sflx_wh, &
276  ocean_sflx_evap, &
277  ocean_u10, &
278  ocean_v10, &
279  ocean_t2, &
280  ocean_q2
281  use mod_cpl_vars, only: &
282  cpl_putocn
283  implicit none
284 
285  ! arguments
286  logical, intent(in) :: countup
287  !---------------------------------------------------------------------------
288 
289  if ( ocean_sw ) then
290  call cpl_putocn( ocean_sfc_temp(:,:), & ! [IN]
291  ocean_sfc_albedo(:,:,:), & ! [IN]
292  ocean_sfc_z0m(:,:), & ! [IN]
293  ocean_sfc_z0h(:,:), & ! [IN]
294  ocean_sfc_z0e(:,:), & ! [IN]
295  ocean_sflx_mw(:,:), & ! [IN]
296  ocean_sflx_mu(:,:), & ! [IN]
297  ocean_sflx_mv(:,:), & ! [IN]
298  ocean_sflx_sh(:,:), & ! [IN]
299  ocean_sflx_lh(:,:), & ! [IN]
300  ocean_sflx_wh(:,:), & ! [IN]
301  ocean_sflx_evap(:,:), & ! [IN]
302  ocean_u10(:,:), & ! [IN]
303  ocean_v10(:,:), & ! [IN]
304  ocean_t2(:,:), & ! [IN]
305  ocean_q2(:,:), & ! [IN]
306  countup ) ! [IN]
307  endif
308 
309  return
real(rp), dimension(:,:), allocatable, public ocean_v10
ocean surface velocity v at 10m [m/s]
logical, public ocean_sw
real(rp), dimension(:,:,:), allocatable, public ocean_sfc_albedo
ocean surface albedo (0-1)
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0e
ocean surface roughness length for vapor [m]
real(rp), dimension(:,:), allocatable, public ocean_sflx_wh
ocean surface water heat flux [J/m2/s]
real(rp), dimension(:,:), allocatable, public ocean_sflx_mv
ocean surface v-momentum flux [kg/m2/s]
subroutine, public cpl_putocn(SFC_TEMP, SFC_albedo, SFC_Z0M, SFC_Z0H, SFC_Z0E, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_LH, SFLX_WH, SFLX_evap, U10, V10, T2, Q2, countup)
module COUPLER Variables
module Ocean admin
real(rp), dimension(:,:), allocatable, public ocean_sflx_mw
ocean surface w-momentum flux [kg/m2/s]
real(rp), dimension(:,:), allocatable, public ocean_sflx_mu
ocean surface u-momentum flux [kg/m2/s]
real(rp), dimension(:,:), allocatable, public ocean_q2
ocean surface water vapor at 2m [kg/kg]
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m
ocean surface roughness length for momentum [m]
real(rp), dimension(:,:), allocatable, public ocean_sflx_sh
ocean surface sensible heat flux [J/m2/s]
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp
ocean surface skin temperature [K]
real(rp), dimension(:,:), allocatable, public ocean_sflx_lh
ocean surface latent heat flux [J/m2/s]
real(rp), dimension(:,:), allocatable, public ocean_u10
ocean surface velocity u at 10m [m/s]
real(rp), dimension(:,:), allocatable, public ocean_sflx_evap
ocean surface water vapor flux [kg/m2/s]
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0h
ocean surface roughness length for heat [m]
real(rp), dimension(:,:), allocatable, public ocean_t2
ocean surface temperature at 2m [K]
module OCEAN Variables
Here is the call graph for this function:
Here is the caller graph for this function: