FE-Project
Loading...
Searching...
No Matches
mod_atmos_phy_sfc.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module Atmosphere / Physics / surface process
3!!
4!! @par Description
5!! Module for surface process
6!!
7!! @author Yuta Kawai, Team SCALE
8!!
9!<
10!-------------------------------------------------------------------------------
11#include "scaleFElib.h"
13 !-----------------------------------------------------------------------------
14 !
15 !++ used modules
16 !
17 use scale_precision
18 use scale_prc
19 use scale_io
20 use scale_prof
21 use scale_const, only: &
22 undef8 => const_undef8
23 use scale_atmos_hydrometeor, only: &
24 atmos_hydrometeor_dry
25
26 use scale_mesh_base, only: meshbase
29
33 use scale_element_base, only: &
35
38
39 use scale_model_mesh_manager, only: modelmeshbase
42
43 use mod_atmos_mesh, only: atmosmesh
45
46 !-----------------------------------------------------------------------------
47 implicit none
48 private
49 !-----------------------------------------------------------------------------
50 !
51 !++ Public type & procedure
52 !
53
54 !> Derived type to manage a component of surface process
55 !!
56 type, extends(modelcomponentproc), public :: atmosphysfc
57 class(atmosmesh), pointer :: mesh !< Pointer to a object to manage the mesh with atmospheric component
58
59 integer :: atm_var_container_typeid !< Type ID of variable container for surface process
60
61 integer :: sfcflx_typeid !< Type id of surface scheme
62 type(atmosphysfcvars) :: vars !< An object to manage variables with surface component
63
64 logical :: cpl_sw !< Switch to indicate if the coupler is activated
65 contains
66 procedure, public :: setup => atmosphysfc_setup
67 procedure, public :: set_coupler_flag => atmosphysfc_set_coupler_flag
68 procedure, public :: calc_tendency => atmosphysfc_calc_tendency
69 procedure, public :: update => atmosphysfc_update
70 procedure, public :: finalize => atmosphysfc_finalize
71 end type atmosphysfc
72
73 !-----------------------------------------------------------------------------
74 !++ Public parameters & variables
75 !-----------------------------------------------------------------------------
76
77 integer, parameter :: sfcflx_typeid_const = 1 !< Type ID of constant surface flux scheme
78 integer, parameter :: sfcflx_typeid_simple = 2 !< Type ID of simple bulk surface flux scheme
79
80 !-----------------------------------------------------------------------------
81 !
82 !++ Private procedure
83 !
84
85 private :: cal_tend_from_sfcflx
86 private :: cal_del_flux
87 private :: convert_uv2localorthvec
88 private :: convert_localorth2uvvec
89
90 !-----------------------------------------------------------------------------
91 !
92 !++ Private parameters & variables
93 !
94 !-----------------------------------------------------------------------------
95
96contains
97
98!> Setup an object to manage a component of surface process
99!!
100!! @param model_mesh Object to manage computational mesh of atmospheric model
101!! @param tm_parent_comp Object to mange a temporal scheme in a parent component
102!!
103!OCL SERIAL
104 subroutine atmosphysfc_setup( this, model_mesh, tm_parent_comp )
106
107 use scale_atmos_phy_sf_const, only: &
108 atmos_phy_sf_const_setup
111
112 use mod_atmos_vars, only: atm_vars_container_primary_id
113
114 implicit none
115 class(atmosphysfc), intent(inout) :: this
116 class(modelmeshbase), target, intent(in) :: model_mesh
117 class(time_manager_component), intent(inout) :: tm_parent_comp
118
119 real(dp) :: time_dt = undef8 !< Timestep for surface process
120 character(len=H_SHORT) :: time_dt_unit = 'SEC' !< Unit of timestep
121 character(len=H_MID) :: sfcflx_type = "CONST" !< Type of surface flux scheme
122 integer :: atm_var_container_typeid !< Type ID of variable container for surface process
123 real(rp) :: default_sfc_temp = 300.0_rp !< Default value of surface temperature
124 namelist /param_atmos_phy_sfc/ &
125 time_dt, &
126 time_dt_unit, &
127 sfcflx_type, &
128 atm_var_container_typeid, &
129 default_sfc_temp
130
131 integer :: ierr
132
133 integer :: ldomid
134 class(localmesh2d), pointer :: lcmesh2d
135 integer :: ke
136 !--------------------------------------------------
137
138 if (.not. this%IsActivated()) return
139
140 log_newline
141 log_info("ATMOS_PHY_SFC_setup",*) 'Setup'
142
143 atm_var_container_typeid = atm_vars_container_primary_id
144
145 !--- read namelist
146 rewind(io_fid_conf)
147 read(io_fid_conf,nml=param_atmos_phy_sfc,iostat=ierr)
148 if( ierr < 0 ) then !--- missing
149 log_info("ATMOS_PHY_SFC_setup",*) 'Not found namelist. Default used.'
150 elseif( ierr > 0 ) then !--- fatal error
151 log_error("ATMOS_PHY_SFC_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_SFC. Check!'
152 call prc_abort
153 endif
154 log_nml(param_atmos_phy_sfc)
155
156 this%atm_var_container_typeid = atm_var_container_typeid
157
158 !--- Regist this compoent in the time manager
159
160 call tm_parent_comp%Regist_process( 'ATMOS_PHY_SFC', time_dt, time_dt_unit, & ! (in)
161 this%tm_process_id ) ! (out)
162
163 !- initialize the variables
164 call this%vars%Init( model_mesh, default_sfc_temp )
165
166 !--- Set the type of surface flux scheme
167
168 select case( sfcflx_type )
169 case ('CONST')
170 call atmos_phy_sf_const_setup()
171 this%SFCFLX_TYPEID = sfcflx_typeid_const
172 case ('SIMPLE')
174 this%SFCFLX_TYPEID = sfcflx_typeid_simple
175 case default
176 log_error("ATMOS_PHY_SFC_setup",*) 'Not appropriate names of SFCFLX_TYPE in namelist PARAM_PHY_SFC. Check!'
177 call prc_abort
178 end select
179
180 !--
181 select type(model_mesh)
182 class is (atmosmesh)
183 this%mesh => model_mesh
184 end select
185
186 return
187 end subroutine atmosphysfc_setup
188
189 !> Set switch to indicate if the coupler is activated
190 subroutine atmosphysfc_set_coupler_flag( this, cpl_sw )
191 implicit none
192 class(atmosphysfc), intent(inout) :: this
193 logical, intent(in) :: cpl_sw
194 !--------------------------------------------------
195 this%CPL_sw = cpl_sw
196 return
197 end subroutine atmosphysfc_set_coupler_flag
198
199 !> Calculate tendencies associated with a surface model
200 !!
201 !!
202 !! @param model_mesh Object to manage computational mesh of atmospheric model
203 !! @param prgvars_list Object to mange prognostic variables with atmospheric dynamical core
204 !! @param trcvars_list Object to mange auxiliary variables
205 !! @param forcing_list Object to mange forcing terms
206 !! @param is_update Flag to specify whether the tendencies are updated in this call
207 !!
208!OCL SERIAL
209 subroutine atmosphysfc_calc_tendency( &
210 this, model_mesh, prgvars_list, trcvars_list, &
211 auxvars_list, forcing_list, is_update )
212
213 use scale_tracer, only: &
214 tracer_inq_id
215
216 use mod_atmos_vars, only: &
217 atmosvars_getlocalmeshprgvars, &
218 atmosvars_getlocalmeshphytends, &
219 atmosvars_getlocalmeshphyauxvars, &
220 atmosvars_getlocalmeshqtrc_qv, &
221 atmosvars_getlocalmeshqtrcphytend
222 use mod_atmos_phy_sfc_vars, only: &
224 implicit none
225
226 class(atmosphysfc), intent(inout) :: this
227 class(modelmeshbase), intent(in) :: model_mesh
228 class(modelvarmanager), intent(inout) :: prgvars_list
229 class(modelvarmanager), intent(inout) :: trcvars_list
230 class(modelvarmanager), intent(inout) :: auxvars_list
231 class(modelvarmanager), intent(inout) :: forcing_list
232 logical, intent(in) :: is_update
233
234 class(meshbase), pointer :: mesh
235 class(localmesh3d), pointer :: lcmesh
236
237 class(localmeshfieldbase), pointer :: ddens, momx, momy, momz, drhot, qv
238 class(localmeshfieldbase), pointer :: dens_hyd, pres_hyd
239 class(localmeshfieldbase), pointer :: rtot, cvtot, cptot
240 class(localmeshfieldbase), pointer :: pres, pt
241 class(localmeshfieldbase), pointer :: dens_tp, momx_tp, momy_tp, momz_tp, rhot_tp, rhoh_p, rhoqv_tp
242 class(localmeshfieldbase), pointer :: sflx_mu, sflx_mv, sflx_mw, sflx_sh, sflx_lh, sflx_qv
243 class(localmeshfieldbase), pointer :: sfc_temp
244
245 integer :: n
246 integer :: iq
247 !--------------------------------------------------
248 if (.not. this%IsActivated()) return
249
250 call model_mesh%GetModelMesh( mesh )
251
252 if (is_update) then
253
254 do n=1, mesh%LOCAL_MESH_NUM
255 call prof_rapstart( 'ATM_PHY_SFC_get_localmesh_ptr', 2)
256 call atmosvars_getlocalmeshprgvars( n, &
257 mesh, prgvars_list, auxvars_list, &
258 ddens, momx, momy, momz, drhot, &
259 dens_hyd, pres_hyd, rtot, cvtot, cptot, &
260 lcmesh )
261 call atmosvars_getlocalmeshphytends( n, &
262 mesh, forcing_list, &
263 dens_tp, momx_tp, momy_tp, momz_tp, rhot_tp, &
264 rhoh_p )
265 call atmosvars_getlocalmeshqtrc_qv( n, mesh, trcvars_list, forcing_list, &
266 qv, rhoqv_tp )
267 call atmosvars_getlocalmeshphyauxvars( n, &
268 mesh, auxvars_list, &
269 pres, pt )
270
272 mesh, this%vars%SFCVARS_manager, this%vars%SFCFLX_manager, &
273 sfc_temp, sflx_mu, sflx_mv, sflx_mw, sflx_sh, sflx_lh, sflx_qv )
274 call prof_rapend( 'ATM_PHY_SFC_get_localmesh_ptr', 2)
275
276 call prof_rapstart( 'ATM_PHY_SFC_cal_tend', 2)
277 call cal_tend_from_sfcflx( this, is_update, &
278 dens_tp%val, momx_tp%val, momy_tp%val, momz_tp%val, rhoh_p%val, rhoqv_tp%val, &
279 sflx_mu%val, sflx_mv%val, sflx_mw%val, sflx_sh%val, sflx_lh%val, sflx_qv%val, &
280 ddens%val, momx%val, momy%val, momz%val, drhot%val, qv%val, &
281 dens_hyd%val, pres_hyd%val, &
282 pres%val, pt%val, rtot%val, sfc_temp%val, &
283 model_mesh%DOptrMat(3), model_mesh%SOptrMat(3), model_mesh%LiftOptrMat, &
284 lcmesh, lcmesh%refElem3D, lcmesh%lcmesh2D, lcmesh%lcmesh2D%refElem2D )
285 call prof_rapend( 'ATM_PHY_SFC_cal_tend', 2)
286 end do
287
288 end if
289
290 return
291 end subroutine atmosphysfc_calc_tendency
292
293!> Update variables in a surface model
294!!
295!! @param model_mesh Object to manage computational mesh of atmospheric model
296!! @param prgvars_list Object to mange prognostic variables with atmospheric dynamical core
297!! @param trcvars_list Object to mange auxiliary variables
298!! @param forcing_list Object to mange forcing terms
299!! @param is_update Flag to speicfy whether the tendencies are updated in this call
300!!
301!OCL SERIAL
302 subroutine atmosphysfc_update( this, model_mesh, &
303 prgvars_list, trcvars_list, auxvars_list, forcing_list, &
304 is_update )
305 implicit none
306
307 class(atmosphysfc), intent(inout) :: this
308 class(modelmeshbase), intent(in) :: model_mesh
309 class(modelvarmanager), intent(inout) :: prgvars_list
310 class(modelvarmanager), intent(inout) :: trcvars_list
311 class(modelvarmanager), intent(inout) :: auxvars_list
312 class(modelvarmanager), intent(inout) :: forcing_list
313 logical, intent(in) :: is_update
314 !--------------------------------------------------
315
316 return
317 end subroutine atmosphysfc_update
318
319!> Finalize a component of surface process
320!!
321!OCL SERIAL
322 subroutine atmosphysfc_finalize( this )
323 implicit none
324 class(atmosphysfc), intent(inout) :: this
325
326 !--------------------------------------------------
327 if (.not. this%IsActivated()) return
328
329 call this%vars%Final()
330
331 return
332 end subroutine atmosphysfc_finalize
333
334!- private ------------------------------------------------
335
336 !> Calculate tendencies associated with a surface model
337!OCL SERIAL
338 subroutine cal_tend_from_sfcflx( this, is_update_sflx, &
339 DENS_tp, MOMX_tp, MOMY_tp, MOMZ_tp, RHOH_p, RHOQV_tp, &
340 SFLX_MU, SFLX_MV, SFLX_MW, SFLX_SH, SFLX_LH, SFLX_QV, &
341 DDENS, MOMX, MOMY, MOMZ, DRHOT, &
342 QV, &
343 DENS_hyd, PRES_hyd, PRES, PT, Rtot, &
344 SFC_TEMP, &
345 Dz, Sz, Lift, &
346 lcmesh, elem, lcmesh2D, elem2D )
347
348 use scale_const, only: &
349 rdry => const_rdry, &
350 cpdry => const_cpdry, &
351 cvdry => const_cvdry, &
352 pres00 => const_pre00, &
353 rplanet => const_radius
354 use scale_atmos_hydrometeor, only: &
355 lhv, &
356 i_qv
357 use scale_tracer, only: &
358 tracer_cv, qa
359 use scale_atmos_phy_sf_const, only: &
360 atmos_phy_sf_const_flux
363
364 use scale_sparsemat, only: &
365 sparsemat, &
367 implicit none
368
369 class(atmosphysfc), intent(inout) :: this
370 class(localmesh3d), intent(in) :: lcmesh
371 class(elementbase3d), intent(in) :: elem
372 class(localmesh2d), intent(in) :: lcmesh2d
373 class(elementbase2d), intent(in) :: elem2d
374 logical, intent(in) :: is_update_sflx
375 real(rp), intent(inout) :: dens_tp(elem%np,lcmesh%nea)
376 real(rp), intent(inout) :: momx_tp(elem%np,lcmesh%nea)
377 real(rp), intent(inout) :: momy_tp(elem%np,lcmesh%nea)
378 real(rp), intent(inout) :: momz_tp(elem%np,lcmesh%nea)
379 real(rp), intent(inout) :: rhoh_p (elem%np,lcmesh%nea)
380 real(rp), intent(inout) :: rhoqv_tp(elem%np,lcmesh%nea)
381 real(rp), intent(inout) :: sflx_mu(elem2d%np,lcmesh2d%nea)
382 real(rp), intent(inout) :: sflx_mv(elem2d%np,lcmesh2d%nea)
383 real(rp), intent(inout) :: sflx_mw(elem2d%np,lcmesh2d%nea)
384 real(rp), intent(inout) :: sflx_sh(elem2d%np,lcmesh2d%nea)
385 real(rp), intent(inout) :: sflx_lh(elem2d%np,lcmesh2d%nea)
386 real(rp), intent(inout) :: sflx_qv(elem2d%np,lcmesh2d%nea)
387 real(rp), intent(in) :: ddens(elem%np,lcmesh%nea)
388 real(rp), intent(in) :: momx(elem%np,lcmesh%nea)
389 real(rp), intent(in) :: momy(elem%np,lcmesh%nea)
390 real(rp), intent(in) :: momz(elem%np,lcmesh%nea)
391 real(rp), intent(in) :: drhot(elem%np,lcmesh%nea)
392 real(rp), intent(in) :: qv(elem%np,lcmesh%nea)
393 real(rp), intent(in) :: pres_hyd(elem%np,lcmesh%nea)
394 real(rp), intent(in) :: dens_hyd(elem%np,lcmesh%nea)
395 real(rp), intent(in) :: pres(elem%np,lcmesh%nea)
396 real(rp), intent(in) :: pt(elem%np,lcmesh%nea)
397 real(rp), intent(in) :: rtot(elem%np,lcmesh%nea)
398 real(rp), intent(in) :: sfc_temp(elem2d%np,lcmesh2d%nea)
399 type(sparsemat), intent(in) :: dz, sz, lift
400
401 real(rp) :: atm_w (elem2d%np,lcmesh2d%ne)
402 real(rp) :: atm_u (elem2d%np,lcmesh2d%ne)
403 real(rp) :: atm_v (elem2d%np,lcmesh2d%ne)
404 real(rp) :: atm_temp(elem2d%np,lcmesh2d%ne)
405 real(rp) :: atm_pres(elem2d%np,lcmesh2d%ne)
406 real(rp) :: atm_qv (elem2d%np,lcmesh2d%ne)
407 real(rp) :: dz1 (elem2d%np,lcmesh2d%ne)
408 real(rp) :: z1 (elem2d%np,lcmesh2d%ne)
409 real(rp) :: sfc_pres(elem2d%np,lcmesh2d%ne)
410 real(rp) :: sfc_dens(elem2d%np,lcmesh2d%ne)
411
412 real(rp) :: sflx_qtrc(elem2d%np,lcmesh2d%ne,max(1,qa))
413 real(rp) :: sflx_engi(elem2d%np,lcmesh2d%ne)
414
415 ! dummy
416 real(rp) :: u10(elem2d%np,lcmesh2d%ne)
417 real(rp) :: v10(elem2d%np,lcmesh2d%ne)
418
419 integer :: ke
420 integer :: ke2d
421 integer :: hslicez0, hslicez1
422 integer :: ij
423 integer :: iq
424 real(rp) :: dens
425 real(rp) :: liftdelflx(elem%np)
426 real(rp) :: del_flux(elem%nfptot,lcmesh%ne,5)
427
428 real(rp) :: sflx_mu1, sflx_mv1
429
430 !-------------------------------------------------
431
432 if ( is_update_sflx .and. (.not. this%CPL_sw) ) then
433 !$omp parallel do collapse(2) private( &
434 !$omp ke, hSliceZ0, hsliceZ1, &
435 !$omp dens )
436 do ke2d=lcmesh2d%NeS, lcmesh2d%NeE
437 do ij=1, elem2d%Np
438
439 ke = ke2d
440 hslicez0 = elem%Hslice(ij,1)
441 hslicez1 = elem%Hslice(ij,2)
442
443 dens = dens_hyd(hslicez1,ke) + ddens(hslicez1,ke)
444 atm_u(ij,ke2d) = momx(hslicez1,ke) / dens
445 atm_v(ij,ke2d) = momy(hslicez1,ke) / dens
446 atm_w(ij,ke2d) = 0.0_rp
447 atm_pres(ij,ke2d) = pres(hslicez1,ke)
448! ATM_TEMP(ij,ke2D) = ATM_PRES(ij,ke2D) / ( Rtot(hsliceZ1,ke) * dens )
449
450 atm_qv(ij,ke2d) = qv(hslicez1,ke)
451
452 sfc_dens(ij,ke2d) = dens_hyd(hslicez0,ke) + ddens(hslicez0,ke)
453 sfc_pres(ij,ke2d) = pres(hslicez0,ke)
454 ! Tentative:
455 atm_temp(ij,ke2d) = sfc_pres(ij,ke2d) / ( rtot(hslicez0,ke) * sfc_dens(ij,ke2d) )
456 atm_qv(ij,ke2d) = qv(hslicez0,ke)
457
458 z1(ij,ke2d) = lcmesh%zlev(hslicez1,ke)
459 dz1(ij,ke2d) = z1(ij,ke2d) - lcmesh%zlev(hslicez0,ke)
460 z1(ij,ke2d) = z1(ij,ke2d) + rplanet
461 end do
462 end do
463
464 call convert_uv2localorthvec( &
465 this%mesh%ptr_mesh, lcmesh2d%pos_en(:,:,1), lcmesh2d%pos_en(:,:,2), z1(:,:), elem2d%Np*lcmesh2d%Ne, &
466 atm_u, atm_v ) ! (inout)
467
468 !---
469 select case ( this%SFCFLX_TYPEID )
470 case ( sfcflx_typeid_const )
471 call atmos_phy_sf_const_flux( &
472 elem2d%Np, 1, elem2d%Np, lcmesh2d%NeA, 1, lcmesh2d%Ne, & ! (in)
473 atm_w(:,:), atm_u(:,:), atm_v(:,:), sfc_temp(:,:), & ! (in)
474 dz1(:,:), sfc_dens(:,:), & ! (in)
475 sflx_mw(:,:), sflx_mu(:,:), sflx_mv(:,:), & ! (out)
476 sflx_sh(:,:), sflx_lh(:,:), sflx_qv(:,:), & ! (out)
477 u10(:,:), v10(:,:) ) ! (out)
478 case ( sfcflx_typeid_simple )
480 elem2d%Np, 1, elem2d%Np, lcmesh2d%NeA, 1, lcmesh2d%Ne, & ! (in)
481 atm_w(:,:), atm_u(:,:), atm_v(:,:), atm_temp(:,:), atm_pres(:,:), & ! (in) Note: ATM_PRES is not used
482 atm_qv(:,:), & ! (in)
483 sfc_dens(:,:), sfc_temp(:,:), sfc_pres(:,:), & ! (in)
484 dz1(:,:), & ! (in)
485 sflx_mw(:,:), sflx_mu(:,:), sflx_mv(:,:), & ! (out)
486 sflx_sh(:,:), sflx_lh(:,:), sflx_qv(:,:), & ! (out)
487 u10(:,:), v10(:,:) ) ! (out)
488 end select
489
490 call convert_localorth2uvvec( &
491 this%mesh%ptr_mesh, lcmesh2d%pos_en(:,:,1), lcmesh2d%pos_en(:,:,2), z1(:,:), elem2d%Np*lcmesh2d%Ne, &
492 sflx_mu(:,lcmesh2d%NeS:lcmesh2d%NeE), sflx_mv(:,lcmesh2d%NeS:lcmesh2d%NeE) ) ! (inout)
493
494 end if
495
496 !- Add the tendency due to the surface flux
497
498 call cal_del_flux( del_flux, &
499 sflx_mu, sflx_mv, sflx_mw, sflx_sh, &
500 sflx_qv, &
501 sfc_temp, &
502 lcmesh%normal_fn(:,:,3), &
503 lcmesh, elem, lcmesh2d, elem2d )
504
505 !$omp parallel do private(ke, iq, LiftDelFlx)
506 do ke2d=1, lcmesh2d%Ne
507 ke = ke2d
508
509 call sparsemat_matmul( lift, lcmesh%Fscale(:,ke)*del_flux(:,ke,1), liftdelflx )
510 momx_tp(:,ke) = momx_tp(:,ke) - liftdelflx(:)
511
512 call sparsemat_matmul( lift, lcmesh%Fscale(:,ke)*del_flux(:,ke,2), liftdelflx )
513 momy_tp(:,ke) = momy_tp(:,ke) - liftdelflx(:)
514
515 call sparsemat_matmul( lift, lcmesh%Fscale(:,ke)*del_flux(:,ke,3), liftdelflx )
516 momz_tp(:,ke) = momz_tp(:,ke) - liftdelflx(:)
517
518 call sparsemat_matmul( lift, lcmesh%Fscale(:,ke)*del_flux(:,ke,4), liftdelflx )
519 rhoh_p(:,ke) = rhoh_p(:,ke) - liftdelflx(:)
520
521 if ( .not. atmos_hydrometeor_dry ) then
522 sflx_qtrc(:,ke2d,i_qv) = sflx_qv(:,ke2d)
523 sflx_engi(:,ke2d) = sflx_qv(:,ke2d) * ( tracer_cv(i_qv) * sfc_temp(:,ke2d) + lhv )
524
525 call sparsemat_matmul( lift, lcmesh%Fscale(:,ke)*del_flux(:,ke,5), liftdelflx )
526 rhoqv_tp(:,ke) = rhoqv_tp(:,ke) - liftdelflx(:)
527 dens_tp(:,ke) = dens_tp(:,ke) - liftdelflx(:)
528 end if
529 end do
530
531 return
532 end subroutine cal_tend_from_sfcflx
533
534!OCL SERIAL
535 subroutine cal_del_flux( del_flux, &
536 sflx_mu, sflx_mv, sflx_mw, sflx_sh, &
537 sflx_qv, &
538 SFC_TEMP, &
539 nz, &
540 lmesh, elem, lmesh2D, elem2D )
541
542 use scale_atmos_hydrometeor, only: &
543 lhv, &
544 i_qv
545 use scale_tracer, only: &
546 tracer_cv, qa
547 implicit none
548
549 class(localmesh3d), intent(in) :: lmesh
550 class(elementbase3d), intent(in) :: elem
551 class(localmesh2d), intent(in) :: lmesh2d
552 class(elementbase2d), intent(in) :: elem2d
553 real(rp), intent(out) :: del_flux(elem%nfptot*lmesh%ne,5)
554 real(rp), intent(in) :: sflx_mu(elem2d%np,lmesh2d%nea)
555 real(rp), intent(in) :: sflx_mv(elem2d%np,lmesh2d%nea)
556 real(rp), intent(in) :: sflx_mw(elem2d%np,lmesh2d%nea)
557 real(rp), intent(in) :: sflx_sh(elem2d%np,lmesh2d%nea)
558 real(rp), intent(in) :: sflx_qv(elem2d%np,lmesh2d%nea)
559 real(rp), intent(in) :: sfc_temp(elem2d%np,lmesh2d%nea)
560 real(rp), intent(in) :: nz(elem%nfptot*lmesh%ne)
561
562 integer :: ke2d, p
563 integer :: i
564 !------------------------------------------------------------------------
565
566 !$omp parallel private(i)
567 !$omp workshare
568 del_flux(:,:) = 0.0_rp
569 !$omp end workshare
570
571 !$omp do collapse(2)
572 do ke2d=1, lmesh2d%Ne
573 do p=1, elem2d%Np
574 i = elem%Nfaces_h*elem%Nfp_h + p + (ke2d-1)*elem%NfpTot
575 del_flux(i,1) = sflx_mu(p,ke2d) * nz(i)
576 del_flux(i,2) = sflx_mv(p,ke2d) * nz(i)
577 del_flux(i,3) = sflx_mw(p,ke2d) * nz(i)
578 del_flux(i,4) = sflx_sh(p,ke2d) * nz(i)
579 del_flux(i,5) = sflx_qv(p,ke2d) * nz(i)
580 end do
581 end do
582 !$omp end do
583
584 if ( .not. atmos_hydrometeor_dry ) then
585 !$omp do collapse(2)
586 do ke2d=1, lmesh2d%Ne
587 do p=1, elem2d%Np
588 i = elem%Nfaces_h*elem%Nfp_h + p + (ke2d-1)*elem%NfpTot
589 del_flux(i,4) = del_flux(i,4) &
590 + sflx_qv(p,ke2d) * ( tracer_cv(i_qv) * sfc_temp(p,ke2d) + 0.0_rp * lhv ) * nz(i)
591 end do
592 end do
593 end if
594 !$omp end parallel
595
596 return
597 end subroutine cal_del_flux
598
599!OCL SERIAL
600 subroutine convert_uv2localorthvec( mesh, x1, x2, r, N, & ! (in)
601 u, v ) ! (inout)
602 use scale_cubedsphere_coord_cnv, only: &
605
606 implicit none
607 integer, intent(in) :: n
608 class(meshbase3d), intent(in) :: mesh
609 real(rp), intent(in) :: x1(n)
610 real(rp), intent(in) :: x2(n)
611 real(rp), intent(in) :: r(n)
612 real(rp), intent(inout) :: u(n)
613 real(rp), intent(inout) :: v(n)
614
615 select type(mesh)
616 type is (meshcubedspheredom3d)
618 x1, x2, r, n, & ! (in)
619 u, v ) ! (inout)
620 end select
621 return
622 end subroutine convert_uv2localorthvec
623
624!OCL SERIAL
625 subroutine convert_localorth2uvvec( mesh, x1, x2, r, N, & ! (in)
626 u, v ) ! (inout)
627 use scale_cubedsphere_coord_cnv, only: &
630
631 implicit none
632 integer, intent(in) :: n
633 class(meshbase3d), intent(in) :: mesh
634 real(rp), intent(in) :: x1(n)
635 real(rp), intent(in) :: x2(n)
636 real(rp), intent(in) :: r(n)
637 real(rp), intent(inout) :: u(n)
638 real(rp), intent(inout) :: v(n)
639
640 select type(mesh)
641 type is (meshcubedspheredom3d)
643 x1, x2, r, n, & ! (in)
644 u, v ) ! (inout)
645 end select
646 return
647 end subroutine convert_localorth2uvvec
648end module mod_atmos_phy_sfc
module Atmosphere / Mesh
module Atmosphere / Physics / surface process
subroutine, public atmosphysfcvars_getlocalmeshfields(domid, mesh, svars_list, sflx_list, sfc_temp, sflx_mu, sflx_mv, sflx_mw, sflx_sh, sflx_lh, sflx_qv, lcmesh3d)
Get local mesh fields for surface variables.
module Atmosphere / Physics / surface process
integer, parameter sfcflx_typeid_const
Type ID of constant surface flux scheme.
module Atmosphere / Variables
module atmosphere / physics / surface / simple
subroutine, public atmos_phy_sf_simple_setup
Setup.
subroutine, public atmos_phy_sf_simple_flux(ia, is, ie, ja, js, je, atm_w, atm_u, atm_v, atm_temp, atm_pres, atm_qv, sfc_dens, sfc_temp, sfc_pres, atm_z1, sflx_mw, sflx_mu, sflx_mv, sflx_sh, sflx_lh, sflx_qv, u10, v10)
Calculate surface fluxes with constant bulk coefficients.
Module common / Coordinate conversion with cubed-sphere projection.
module FElib / Element / Base
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Local, Base
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Base
module FElib / Mesh / Cubed-sphere 3D domain
module FElib / Data / base
FElib / model framework / physics process.
FElib / model framework / mesh manager.
FElib / model framework / variable manager.
Module common / sparsemat.
Module common / time.
Derived type to manage a computational mesh (base class)
Derived type to manage a component of surface process.
Derived type to manage variables with a surface component.
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing an arbitrary finite element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type to manage a local computational domain (base type)
Derived type representing a field with local mesh (base type)
Derived type to manage a computational mesh (base type for 2D domain)
Derived type to manage a computational mesh (base type for 3D domain)
Base type to manage a computational mesh.
Derived type to manage a cubed-sphere 3D computational domain.
Derived type representing a field (base type)
Derived type to manage a sparse matrix.