SCALE-RM
Functions/Subroutines
scale_cpl_phy_sfc_fixed_temp Module Reference

module coupler / surface fixed temp model More...

Functions/Subroutines

subroutine, public cpl_phy_sfc_fixed_temp_setup
 Setup. More...
 
subroutine, public cpl_phy_sfc_fixed_temp (IA, IS, IE, JA, JS, JE, TMPA, PRSA, WA, UA, VA, RHOA, QVA, LH, Z1, PBL, RHOS, PRSS, RFLXD, TMPS, WSTR, QVEF, ALBEDO, Rb, Z0M, Z0H, Z0E, calc_flag, dt, ZMFLX, XMFLX, YMFLX, SHFLX, LHFLX, QVFLX, GFLX, Ustar, Tstar, Qstar, Wstar, RLmo, U10, V10, T2, Q2)
 

Detailed Description

module coupler / surface fixed temp model

Description
Surface fixed temperature model
Author
Team SCALE

Function/Subroutine Documentation

◆ cpl_phy_sfc_fixed_temp_setup()

subroutine, public scale_cpl_phy_sfc_fixed_temp::cpl_phy_sfc_fixed_temp_setup

Setup.

Definition at line 50 of file scale_cpl_phy_sfc_fixed_temp.F90.

50  implicit none
51  !---------------------------------------------------------------------------
52 
53  if ( initialized ) return
54 
55  log_newline
56  log_info("CPL_PHY_SFC_FIXED_TEMP_setup",*) 'Setup'
57 
58  initialized = .true.
59 
60  return

Referenced by mod_land_driver::land_driver_setup(), and mod_ocean_driver::ocean_driver_setup().

Here is the caller graph for this function:

◆ cpl_phy_sfc_fixed_temp()

subroutine, public scale_cpl_phy_sfc_fixed_temp::cpl_phy_sfc_fixed_temp ( integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ia,ja), intent(in)  TMPA,
real(rp), dimension (ia,ja), intent(in)  PRSA,
real(rp), dimension (ia,ja), intent(in)  WA,
real(rp), dimension (ia,ja), intent(in)  UA,
real(rp), dimension (ia,ja), intent(in)  VA,
real(rp), dimension (ia,ja), intent(in)  RHOA,
real(rp), dimension (ia,ja), intent(in)  QVA,
real(rp), dimension (ia,ja), intent(in)  LH,
real(rp), dimension (ia,ja), intent(in)  Z1,
real(rp), dimension (ia,ja), intent(in)  PBL,
real(rp), dimension (ia,ja), intent(in)  RHOS,
real(rp), dimension (ia,ja), intent(in)  PRSS,
real(rp), dimension (ia,ja,n_rad_dir,n_rad_rgn), intent(in)  RFLXD,
real(rp), dimension (ia,ja), intent(in)  TMPS,
real(rp), dimension (ia,ja), intent(in)  WSTR,
real(rp), dimension (ia,ja), intent(in)  QVEF,
real(rp), dimension (ia,ja,n_rad_dir,n_rad_rgn), intent(in)  ALBEDO,
real(rp), dimension (ia,ja), intent(in)  Rb,
real(rp), dimension (ia,ja), intent(in)  Z0M,
real(rp), dimension (ia,ja), intent(in)  Z0H,
real(rp), dimension (ia,ja), intent(in)  Z0E,
logical, dimension(ia,ja), intent(in)  calc_flag,
real(dp), intent(in)  dt,
real(rp), dimension (ia,ja), intent(out)  ZMFLX,
real(rp), dimension (ia,ja), intent(out)  XMFLX,
real(rp), dimension (ia,ja), intent(out)  YMFLX,
real(rp), dimension (ia,ja), intent(out)  SHFLX,
real(rp), dimension (ia,ja), intent(out)  LHFLX,
real(rp), dimension (ia,ja), intent(out)  QVFLX,
real(rp), dimension (ia,ja), intent(out)  GFLX,
real(rp), dimension (ia,ja), intent(out)  Ustar,
real(rp), dimension (ia,ja), intent(out)  Tstar,
real(rp), dimension (ia,ja), intent(out)  Qstar,
real(rp), dimension (ia,ja), intent(out)  Wstar,
real(rp), dimension (ia,ja), intent(out)  RLmo,
real(rp), dimension (ia,ja), intent(out)  U10,
real(rp), dimension (ia,ja), intent(out)  V10,
real(rp), dimension (ia,ja), intent(out)  T2,
real(rp), dimension (ia,ja), intent(out)  Q2 
)

Definition at line 84 of file scale_cpl_phy_sfc_fixed_temp.F90.

84  use scale_const, only: &
85  eps => const_eps, &
86  undef => const_undef, &
87  epsvap => const_epsvap, &
88  pre00 => const_pre00, &
89  rdry => const_rdry, &
90  cpdry => const_cpdry, &
91  rvap => const_rvap, &
92  stb => const_stb
93  use scale_atmos_saturation, only: &
94 ! qsat => ATMOS_SATURATION_pres2qsat_all
95  qsat => atmos_saturation_dens2qsat_all
96  use scale_bulkflux, only: &
97  bulkflux, &
98  bulkflux_diagnose_surface
99  implicit none
100 
101  integer, intent(in) :: IA, IS, IE
102  integer, intent(in) :: JA, JS, JE
103  real(RP), intent(in) :: TMPA (IA,JA) ! temperature at the lowest atmospheric layer [K]
104  real(RP), intent(in) :: PRSA (IA,JA) ! pressure at the lowest atmospheric layer [Pa]
105  real(RP), intent(in) :: WA (IA,JA) ! velocity w at the lowest atmospheric layer [m/s]
106  real(RP), intent(in) :: UA (IA,JA) ! velocity u at the lowest atmospheric layer [m/s]
107  real(RP), intent(in) :: VA (IA,JA) ! velocity v at the lowest atmospheric layer [m/s]
108  real(RP), intent(in) :: RHOA (IA,JA) ! density at the lowest atmospheric layer [kg/m3]
109  real(RP), intent(in) :: QVA (IA,JA) ! ratio of water vapor mass to total mass at the lowest atmospheric layer [kg/kg]
110  real(RP), intent(in) :: LH (IA,JA) ! latent heat at the lowest atmospheric layer [J/kg]
111  real(RP), intent(in) :: Z1 (IA,JA) ! cell center height at the lowest atmospheric layer [m]
112  real(RP), intent(in) :: PBL (IA,JA) ! the top of atmospheric mixing layer [m]
113  real(RP), intent(in) :: RHOS (IA,JA) ! density at the surface [kg/m3]
114  real(RP), intent(in) :: PRSS (IA,JA) ! pressure at the surface [Pa]
115  real(RP), intent(in) :: RFLXD (IA,JA,N_RAD_DIR,N_RAD_RGN) ! downward radiation flux at the surface (direct/diffuse,IR/near-IR/VIS) [J/m2/s]
116  real(RP), intent(in) :: TMPS (IA,JA) ! surface temperature [K]
117  real(RP), intent(in) :: WSTR (IA,JA) ! amount of the water storage [kg/m2]
118  real(RP), intent(in) :: QVEF (IA,JA) ! efficiency of evaporation (0-1)
119  real(RP), intent(in) :: ALBEDO (IA,JA,N_RAD_DIR,N_RAD_RGN) ! surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
120  real(RP), intent(in) :: Rb (IA,JA) ! stomata resistance [1/s]
121  real(RP), intent(in) :: Z0M (IA,JA) ! roughness length for momemtum [m]
122  real(RP), intent(in) :: Z0H (IA,JA) ! roughness length for heat [m]
123  real(RP), intent(in) :: Z0E (IA,JA) ! roughness length for vapor [m]
124  logical, intent(in) :: calc_flag(IA,JA) ! to decide calculate or not
125  real(DP), intent(in) :: dt ! delta time
126 
127  real(RP), intent(out) :: ZMFLX (IA,JA) ! z-momentum flux at the surface [kg/m/s2]
128  real(RP), intent(out) :: XMFLX (IA,JA) ! x-momentum flux at the surface [kg/m/s2]
129  real(RP), intent(out) :: YMFLX (IA,JA) ! y-momentum flux at the surface [kg/m/s2]
130  real(RP), intent(out) :: SHFLX (IA,JA) ! sensible heat flux at the surface [J/m2/s]
131  real(RP), intent(out) :: LHFLX (IA,JA) ! latent heat flux at the surface [J/m2/s]
132  real(RP), intent(out) :: QVFLX (IA,JA) ! water vapor flux at the surface [kg/m2/s]
133  real(RP), intent(out) :: GFLX (IA,JA) ! subsurface heat flux at the surface [J/m2/s]
134  real(RP), intent(out) :: Ustar (IA,JA) ! friction velocity [m/s]
135  real(RP), intent(out) :: Tstar (IA,JA) ! temperature scale [K]
136  real(RP), intent(out) :: Qstar (IA,JA) ! moisture scale [kg/kg]
137  real(RP), intent(out) :: Wstar (IA,JA) ! convective velocity scale [m/s]
138  real(RP), intent(out) :: RLmo (IA,JA) ! inversed Obukhov length [1/m]
139  real(RP), intent(out) :: U10 (IA,JA) ! velocity u at 10m [m/s]
140  real(RP), intent(out) :: V10 (IA,JA) ! velocity v at 10m [m/s]
141  real(RP), intent(out) :: T2 (IA,JA) ! temperature at 2m [K]
142  real(RP), intent(out) :: Q2 (IA,JA) ! water vapor at 2m [kg/kg]
143 
144  real(RP) :: emis ! surface longwave emission [J/m2/s]
145  real(RP) :: LWD ! surface downward longwave radiation flux [J/m2/s]
146  real(RP) :: LWU ! surface upward longwave radiation flux [J/m2/s]
147  real(RP) :: SWD ! surface downward shortwave radiation flux [J/m2/s]
148  real(RP) :: SWU ! surface upward shortwave radiation flux [J/m2/s]
149  real(RP) :: res ! residual
150 
151  real(RP) :: Uabs ! absolute velocity [m/s]
152  real(RP) :: Ra ! Aerodynamic resistance (=1/Ce) [1/s]
153 
154  real(RP) :: QVsat ! saturation water vapor mixing ratio at surface [kg/kg]
155  real(RP) :: QVS(IA,JA) ! water vapor mixing ratio at surface [kg/kg]
156  real(RP) :: Rtot ! total gas constant
157  real(RP) :: qdry ! dry air mass ratio [kg/kg]
158 
159  real(RP) :: FracU10(IA,JA) ! calculation parameter for U10 [1]
160  real(RP) :: FracT2 (IA,JA) ! calculation parameter for T2 [1]
161  real(RP) :: FracQ2 (IA,JA) ! calculation parameter for Q2 [1]
162 
163  real(RP) :: MFLUX
164 
165  integer :: i, j
166  !---------------------------------------------------------------------------
167 
168  log_progress(*) 'coupler / physics / surface / FIXED-TEMP'
169 
170  ! calculate surface flux
171  !$omp parallel do &
172 #ifndef __GFORTRAN__
173  !$omp default(none) &
174  !$omp shared(IS,IE,JS,JE,EPS,UNDEF,Rdry,CPdry,bulkflux,dt, &
175  !$omp calc_flag,TMPA,QVA,QVS,LH,WA,UA,VA,Z1,PBL,PRSA,TMPS,WSTR,PRSS,RHOS,QVEF,Z0M,Z0H,Z0E,ALBEDO,RFLXD,Rb, &
176  !$omp FracU10,FracT2,FracQ2, &
177  !$omp SHFLX,LHFLX,QVFLX,GFLX,ZMFLX,XMFLX,YMFLX,Ustar,Tstar,Qstar,Wstar,RLmo,U10,V10,T2,Q2) &
178 #else
179  !$omp default(shared) &
180 #endif
181  !$omp private(qdry,Rtot,QVsat,Uabs,Ra,res,emis,LWD,LWU,SWD,SWU,MFLUX)
182  do j = js, je
183  do i = is, ie
184  if ( calc_flag(i,j) ) then
185 
186 ! qdry = 1.0_RP - QVA(i,j)
187 ! Rtot = qdry * Rdry + QVA(i,j) * Rvap
188 ! call qsat( TMPS(i,j), PRSS(i,j), qdry, QVsat )
189  call qsat( tmps(i,j), rhos(i,j), qvsat )
190 
191  qvs(i,j) = ( 1.0_rp-qvef(i,j) ) * qva(i,j) &
192  + ( qvef(i,j) ) * qvsat
193 
194  uabs = sqrt( wa(i,j)**2 + ua(i,j)**2 + va(i,j)**2 )
195 
196  call bulkflux( tmpa(i,j), tmps(i,j), & ! [IN]
197  prsa(i,j), prss(i,j), & ! [IN]
198  qva(i,j), qvs(i,j), & ! [IN]
199  uabs, z1(i,j), pbl(i,j), & ! [IN]
200  z0m(i,j), z0h(i,j), z0e(i,j), & ! [IN]
201  ustar(i,j), tstar(i,j), qstar(i,j), & ! [OUT]
202  wstar(i,j), rlmo(i,j), ra, & ! [OUT]
203  fracu10(i,j), fract2(i,j), fracq2(i,j) ) ! [OUT]
204 
205  if ( uabs < eps ) then
206  zmflx(i,j) = 0.0_rp
207  xmflx(i,j) = 0.0_rp
208  ymflx(i,j) = 0.0_rp
209  else
210  mflux = - rhos(i,j) * ustar(i,j)**2
211  zmflx(i,j) = mflux * wa(i,j) / uabs
212  xmflx(i,j) = mflux * ua(i,j) / uabs
213  ymflx(i,j) = mflux * va(i,j) / uabs
214  end if
215  shflx(i,j) = -rhos(i,j) * ustar(i,j) * tstar(i,j) * cpdry
216  qvflx(i,j) = -rhos(i,j) * ustar(i,j) * qstar(i,j) * ra / ( ra+rb(i,j) )
217  qvflx(i,j) = min( qvflx(i,j), wstr(i,j) / real(dt,rp) )
218  lhflx(i,j) = qvflx(i,j) * lh(i,j)
219 
220  emis = ( 1.0_rp-albedo(i,j,i_r_diffuse,i_r_ir) ) * stb * tmps(i,j)**4
221 
222  lwd = rflxd(i,j,i_r_diffuse,i_r_ir)
223  lwu = rflxd(i,j,i_r_diffuse,i_r_ir) * albedo(i,j,i_r_diffuse,i_r_ir) + emis
224  swd = rflxd(i,j,i_r_direct ,i_r_nir) &
225  + rflxd(i,j,i_r_diffuse,i_r_nir) &
226  + rflxd(i,j,i_r_direct ,i_r_vis) &
227  + rflxd(i,j,i_r_diffuse,i_r_vis)
228  swu = rflxd(i,j,i_r_direct ,i_r_nir) * albedo(i,j,i_r_direct ,i_r_nir) &
229  + rflxd(i,j,i_r_diffuse,i_r_nir) * albedo(i,j,i_r_diffuse,i_r_nir) &
230  + rflxd(i,j,i_r_direct ,i_r_vis) * albedo(i,j,i_r_direct ,i_r_vis) &
231  + rflxd(i,j,i_r_diffuse,i_r_vis) * albedo(i,j,i_r_diffuse,i_r_vis)
232 
233  ! calculation for residual
234  res = swd - swu + lwd - lwu - shflx(i,j) - qvflx(i,j) * lh(i,j)
235 
236  ! put residual in ground heat flux (positive for downward)
237  gflx(i,j) = res
238 
239  else ! not calculate surface flux
240  zmflx(i,j) = undef
241  xmflx(i,j) = undef
242  ymflx(i,j) = undef
243  shflx(i,j) = undef
244  lhflx(i,j) = undef
245  qvflx(i,j) = undef
246  gflx(i,j) = undef
247  ustar(i,j) = undef
248  tstar(i,j) = undef
249  qstar(i,j) = undef
250  wstar(i,j) = undef
251  rlmo(i,j) = undef
252  u10(i,j) = undef
253  v10(i,j) = undef
254  t2(i,j) = undef
255  q2(i,j) = undef
256  endif
257  enddo
258  enddo
259 
260  call bulkflux_diagnose_surface( ia, is, ie, ja, js, je, &
261  ua(:,:), va(:,:), & ! (in)
262  tmpa(:,:), qva(:,:), & ! (in)
263  tmps(:,:), qvs(:,:), & ! (in)
264  z1(:,:), z0m(:,:), z0h(:,:), z0e(:,:), & ! (in)
265  u10(:,:), v10(:,:), t2(:,:), q2(:,:), & ! (out)
266  mask = calc_flag(:,:), & ! (in)
267  fracu10 = fracu10(:,:), & ! (in)
268  fract2 = fract2(:,:), & ! (in)
269  fracq2 = fracq2(:,:) ) ! (in)
270 
271  return

References scale_bulkflux::bulkflux, scale_const::const_cpdry, scale_const::const_eps, scale_const::const_epsvap, scale_const::const_pre00, scale_const::const_rdry, scale_const::const_rvap, scale_const::const_stb, scale_const::const_undef, scale_cpl_sfc_index::i_r_diffuse, scale_cpl_sfc_index::i_r_direct, scale_cpl_sfc_index::i_r_ir, scale_cpl_sfc_index::i_r_nir, scale_cpl_sfc_index::i_r_vis, and scale_precision::rp.

Referenced by mod_land_driver::land_driver_calc_tendency(), and mod_ocean_driver::ocean_driver_calc_tendency().

Here is the caller graph for this function:
scale_bulkflux
module Surface bulk flux
Definition: scale_bulkflux.F90:12
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_atmos_saturation
module atmosphere / saturation
Definition: scale_atmos_saturation.F90:12