SCALE-RM
mod_ocean_phy_driver.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  use scale_const, only: &
23  i_sw => const_i_sw, &
24  i_lw => const_i_lw
25  !-----------------------------------------------------------------------------
26  implicit none
27  private
28  !-----------------------------------------------------------------------------
29  !
30  !++ Public procedure
31  !
32  public :: ocean_phy_driver_setup
33  public :: ocean_phy_driver_resume
34  public :: ocean_phy_driver
35 
36  !-----------------------------------------------------------------------------
37  !
38  !++ Public parameters & variables
39  !
40  !-----------------------------------------------------------------------------
41  !
42  !++ Private procedure
43  !
44  !-----------------------------------------------------------------------------
45  !
46  !++ Private parameters & variables
47  !
48  !-----------------------------------------------------------------------------
49 contains
50  !-----------------------------------------------------------------------------
52  subroutine ocean_phy_driver_setup
53  use scale_ocean_phy, only: &
55  use scale_ocean_sfc, only: &
57  use mod_ocean_admin, only: &
58  ocean_type, &
59  ocean_sw
60  implicit none
61  !---------------------------------------------------------------------------
62 
63  if( io_l ) write(io_fid_log,*)
64  if( io_l ) write(io_fid_log,*) '++++++ Module[DRIVER] / Categ[OCEAN PHY] / Origin[SCALE-RM]'
65 
66  if ( ocean_sw ) then
67 
68  ! setup library component
71 
72  else
73  if( io_l ) write(io_fid_log,*) '*** this component is never called.'
74  endif
75 
76  return
77  end subroutine ocean_phy_driver_setup
78 
79  !-----------------------------------------------------------------------------
81  subroutine ocean_phy_driver_resume
82  use mod_admin_restart, only: &
84  use mod_ocean_admin, only: &
85  ocean_sw
86  implicit none
87 
88  if ( ocean_sw ) then
89 
90  if ( .NOT. restart_run ) then ! tentative
91  ! run once (only for the diagnostic value)
92  call prof_rapstart('OCN_Physics', 1)
93  call ocean_phy_driver( update_flag = .true. )
94  call prof_rapend ('OCN_Physics', 1)
95  end if
96 
97  end if
98 
99  return
100  end subroutine ocean_phy_driver_resume
101 
102  !-----------------------------------------------------------------------------
104  subroutine ocean_phy_driver( update_flag )
106  hydrometeor_lhv => atmos_hydrometeor_lhv
107  use scale_time, only: &
108  dt => time_dtsec_ocean
109  use scale_rm_statistics, only: &
111  stat_total
112  use scale_history, only: &
113  hist_in
114  use scale_grid_real, only: &
115  real_z1
116  use scale_roughness, only: &
117  roughness
118  use scale_ocean_phy, only: &
119  ocean_phy
120  use scale_ocean_sfc, only: &
121  ocean_sfc, &
123  use mod_ocean_vars, only: &
124  ocean_temp, &
125  ocean_sfc_temp, &
127  ocean_sfc_z0m, &
128  ocean_sfc_z0h, &
129  ocean_sfc_z0e, &
130  ocean_temp_t, &
133  ocean_sfc_z0m_t, &
134  ocean_sfc_z0h_t, &
135  ocean_sfc_z0e_t, &
136  ocean_sflx_mw, &
137  ocean_sflx_mu, &
138  ocean_sflx_mv, &
139  ocean_sflx_sh, &
140  ocean_sflx_lh, &
141  ocean_sflx_wh, &
142  ocean_sflx_evap, &
143  ocean_u10, &
144  ocean_v10, &
145  ocean_t2, &
146  ocean_q2, &
147  atmos_temp, &
148  atmos_pres, &
149  atmos_w, &
150  atmos_u, &
151  atmos_v, &
152  atmos_dens, &
153  atmos_qv, &
154  atmos_pbl, &
155  atmos_sfc_pres, &
156  atmos_sflx_lw, &
157  atmos_sflx_sw, &
158  atmos_cossza, &
160  implicit none
161 
162  logical, intent(in) :: update_flag
163 
164  real(RP) :: lhv(ia,ja) ! latent heat of vaporization [J/kg]
165  real(RP) :: total ! dummy
166 
167  integer :: i, j
168  !---------------------------------------------------------------------------
169 
170  if ( update_flag ) then
171 
172  call roughness( ocean_sfc_z0m_t(:,:), & ! [OUT]
173  ocean_sfc_z0h_t(:,:), & ! [OUT]
174  ocean_sfc_z0e_t(:,:), & ! [OUT]
175  ocean_sfc_z0m(:,:), & ! [IN]
176  ocean_sfc_z0h(:,:), & ! [IN]
177  ocean_sfc_z0e(:,:), & ! [IN]
178  atmos_u(:,:), & ! [IN]
179  atmos_v(:,:), & ! [IN]
180  real_z1(:,:), & ! [IN]
181  dt ) ! [IN]
182 
183  call ocean_sfc_simplealbedo( ocean_sfc_albedo_t(:,:,:), & ! [OUT]
184  ocean_sfc_albedo(:,:,:), & ! [IN]
185  atmos_cossza(:,:), & ! [IN]
186  dt ) ! [IN]
187 
188  call ocean_sfc( ocean_sfc_temp_t(:,:), & ! [OUT]
189  ocean_sflx_mw(:,:), & ! [OUT]
190  ocean_sflx_mu(:,:), & ! [OUT]
191  ocean_sflx_mv(:,:), & ! [OUT]
192  ocean_sflx_sh(:,:), & ! [OUT]
193  ocean_sflx_lh(:,:), & ! [OUT]
194  ocean_sflx_wh(:,:), & ! [OUT]
195  ocean_u10(:,:), & ! [OUT]
196  ocean_v10(:,:), & ! [OUT]
197  ocean_t2(:,:), & ! [OUT]
198  ocean_q2(:,:), & ! [OUT]
199  atmos_temp(:,:), & ! [IN]
200  atmos_pres(:,:), & ! [IN]
201  atmos_w(:,:), & ! [IN]
202  atmos_u(:,:), & ! [IN]
203  atmos_v(:,:), & ! [IN]
204  atmos_dens(:,:), & ! [IN]
205  atmos_qv(:,:), & ! [IN]
206  real_z1(:,:), & ! [IN]
207  atmos_pbl(:,:), & ! [IN]
208  atmos_sfc_pres(:,:), & ! [IN]
209  atmos_sflx_lw(:,:), & ! [IN]
210  atmos_sflx_sw(:,:), & ! [IN]
211  ocean_temp(:,:), & ! [IN]
212  ocean_sfc_temp(:,:), & ! [IN]
213  ocean_sfc_albedo(:,:,i_lw), & ! [IN]
214  ocean_sfc_albedo(:,:,i_sw), & ! [IN]
215  ocean_sfc_z0m(:,:), & ! [IN]
216  ocean_sfc_z0h(:,:), & ! [IN]
217  ocean_sfc_z0e(:,:), & ! [IN]
218  dt ) ! [IN]
219 
220 
221  call hydrometeor_lhv( lhv(:,:), atmos_temp(:,:) )
222 
223 !OCL XFILL
224  do j = js, je
225  do i = is, ie
226  ocean_sflx_evap(i,j) = ocean_sflx_lh(i,j) / lhv(i,j)
227  end do
228  end do
229 
230  call ocean_phy( ocean_temp_t(:,:), & ! [OUT]
231  ocean_temp(:,:), & ! [IN]
232  ocean_sflx_wh(:,:), & ! [IN]
233  atmos_sflx_prec(:,:), & ! [IN]
234  ocean_sflx_evap(:,:), & ! [IN]
235  dt ) ! [IN]
236 
237  call hist_in( ocean_temp_t(:,:), 'OCEAN_TEMP_t', 'tendency of OCEAN_TEMP', 'K' )
238  call hist_in( ocean_sfc_temp_t(:,:), 'OCEAN_SFC_TEMP_t', 'tendency of OCEAN_SFC_TEMP', 'K' )
239  call hist_in( ocean_sfc_albedo_t(:,:,i_lw), 'OCEAN_ALB_LW_t', 'tendency of OCEAN_ALB_LW', '1' )
240  call hist_in( ocean_sfc_albedo_t(:,:,i_sw), 'OCEAN_ALB_SW_t', 'tendency of OCEAN_ALB_SW', '1' )
241  call hist_in( ocean_sfc_z0m_t(:,:), 'OCEAN_SFC_Z0M_t', 'tendency of OCEAN_SFC_Z0M', 'm' )
242  call hist_in( ocean_sfc_z0h_t(:,:), 'OCEAN_SFC_Z0H_t', 'tendency of OCEAN_SFC_Z0H', 'm' )
243  call hist_in( ocean_sfc_z0e_t(:,:), 'OCEAN_SFC_Z0E_t', 'tendency of OCEAN_SFC_Z0E', 'm' )
244 
245  end if
246 
247  if ( statistics_checktotal ) then
248  call stat_total( total, ocean_temp_t(:,:), 'OCEAN_TEMP_t' )
249  call stat_total( total, ocean_sfc_temp_t(:,:), 'OCEAN_SFC_TEMP_t' )
250  call stat_total( total, ocean_sfc_albedo_t(:,:,i_lw), 'OCEAN_ALB_LW_t' )
251  call stat_total( total, ocean_sfc_albedo_t(:,:,i_sw), 'OCEAN_ALB_SW_t' )
252  call stat_total( total, ocean_sfc_z0m_t(:,:), 'OCEAN_SFC_Z0M_t' )
253  call stat_total( total, ocean_sfc_z0h_t(:,:), 'OCEAN_SFC_Z0H_t' )
254  call stat_total( total, ocean_sfc_z0e_t(:,:), 'OCEAN_SFC_Z0E_t' )
255  end if
256 
257  return
258  end subroutine ocean_phy_driver
259 
260 end module mod_ocean_phy_driver
real(rp), dimension(:,:), allocatable, public ocean_v10
ocean surface velocity v at 10m [m/s]
real(dp), public time_dtsec_ocean
time interval of ocean step [sec]
Definition: scale_time.F90:47
integer, public is
start point of inner domain: x, local
module DEBUG
Definition: scale_debug.F90:13
logical, public ocean_sw
real(rp), dimension(:,:), allocatable, public atmos_w
logical, public statistics_checktotal
calc&report variable totals to logfile?
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp_t
tendency of OCEAN_SFC_TEMP
integer, public je
end point of inner domain: y, local
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 atmos_dens
integer, public const_i_lw
long-wave radiation index
Definition: scale_const.F90:95
subroutine, public ocean_sfc_setup(OCEAN_TYPE)
real(rp), dimension(:,:,:), allocatable, public ocean_sfc_albedo_t
tendency of OCEAN_SFC_alebdo
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0e
ocean surface roughness length for vapor [m]
subroutine, public ocean_sfc_simplealbedo(SFC_albedo_t, SFC_albedo, cosSZA, dt)
real(rp), dimension(:,:), allocatable, public ocean_temp
temperature at uppermost ocean layer [K]
real(rp), dimension(:,:), allocatable, public atmos_v
procedure(ocnsfc), pointer, public ocean_sfc
module STDIO
Definition: scale_stdio.F90:12
real(rp), dimension(:,:), allocatable, public ocean_sflx_wh
ocean surface water heat flux [J/m2/s]
module OCEAN / Physics
real(rp), dimension(:,:), allocatable, public atmos_sflx_lw
real(rp), dimension(:,:), allocatable, public ocean_temp_t
tendency of OCEAN_TEMP
module Statistics
module grid index
real(rp), dimension(:,:), allocatable, public atmos_cossza
integer, public ia
of whole cells: x, local, with HALO
real(rp), dimension(:,:), allocatable, public ocean_sflx_mv
ocean surface v-momentum flux [kg/m2/s]
real(rp), dimension(:,:), allocatable, public real_z1
Height of the lowermost grid from surface (cell center) [m].
module GRID (real space)
real(rp), dimension(:,:), allocatable, public atmos_sfc_pres
real(rp), dimension(:,:), allocatable, public atmos_qv
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0h_t
tendency of OCEAN_SFC_Z0H
integer, public js
start point of inner domain: y, local
procedure(rl), pointer, public roughness
module TIME
Definition: scale_time.F90:15
subroutine, public ocean_phy_setup(OCEAN_TYPE)
Setup.
real(rp), dimension(:,:), allocatable, public atmos_sflx_prec
module Ocean admin
module OCEAN / Physics
real(rp), dimension(:,:), allocatable, public atmos_temp
real(rp), dimension(:,:), allocatable, public ocean_sflx_mw
ocean surface w-momentum flux [kg/m2/s]
module administrator for restart
module CONSTANT
Definition: scale_const.F90:14
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]
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
Definition: scale_prof.F90:156
module OCEAN / Surface fluxes
real(rp), dimension(:,:), allocatable, public atmos_u
module profiler
Definition: scale_prof.F90:10
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:,:), allocatable, public atmos_sflx_sw
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m
ocean surface roughness length for momentum [m]
real(rp), dimension(:,:), allocatable, public atmos_pbl
integer, public const_i_sw
short-wave radiation index
Definition: scale_const.F90:96
module PRECISION
real(rp), dimension(:,:), allocatable, public ocean_sflx_sh
ocean surface sensible heat flux [J/m2/s]
module HISTORY
subroutine, public ocean_phy_driver(update_flag)
Driver.
character(len=h_short), public ocean_type
real(rp), dimension(:,:), allocatable, public ocean_sfc_temp
ocean surface skin temperature [K]
module Surface roughness length
logical, public restart_run
Is this run restart?
real(rp), dimension(:,:), allocatable, public ocean_sfc_z0m_t
tendency of OCEAN_SFC_Z0M
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
real(rp), dimension(:,:), allocatable, public atmos_pres
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]
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
Definition: scale_prof.F90:204
real(rp), dimension(:,:), allocatable, public ocean_sflx_evap
ocean surface water vapor flux [kg/m2/s]
procedure(ocn), pointer, public ocean_phy
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
subroutine, public ocean_phy_driver_setup
Setup.
subroutine, public ocean_phy_driver_resume
Resume.
integer, public ja
of whole cells: y, local, with HALO