Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/core_atmosphere/diagnostics/Registry_isobaric.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
description="Temperature interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="z_isobaric" type="real" dimensions="nIsoLevelsZ nCells Time" units="m"
description="Height interpolated to isobaric surfaces defined in z_iso_levels"/>
description="Geometric height interpolated to isobaric surfaces defined in z_iso_levels"/>

<var name="meanT_500_300" type="real" dimensions="nCells Time" units="K"
description="Mean temperature in the 300 hPa - 500 hPa layer"/>
Expand All @@ -233,6 +233,9 @@
<var name="dtheta_dt_mp_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="K s^{-1}"
description="Potential temperature heating rate from microphysics interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="dtheta_dt_mix_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="K s^{-1}"
description="Potential temperature heating rate from explicit numerical mixing interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="rh_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="%"
description="Relative humidity interpolated to isobaric surfaces defined in t_iso_levels"/>

Expand All @@ -242,6 +245,15 @@
<var name="rthblten_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="K s^{-1}"
description="Tendency of potential temperature due to pbl processes interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="rthcuten_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="K s^{-1}"
description="Tendency of potential temperature due to cumulus convection interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="rthdynten_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="K s^{-1}"
description="Tendency of potential temperature due to horizontal and vertical advections interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="rthmpten_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="K s^{-1}"
description="Tendency of potential temperature due to cloud microphysics interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="rthratenlw_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="K s^{-1}"
description="Tendency of potential temperature due to long wave radiation interpolated to isobaric surfaces defined in t_iso_levels"/>

Expand All @@ -251,6 +263,9 @@
<var name="qv_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="kg kg^{-1}"
description="Water vapor mixing ratio interpolated to isobaric surfaces defined in t_iso_levels"/>

<var name="ertel_pv_isobaric" type="real" dimensions="nIsoLevelsT nCells Time" units="PVU"
description="Ertel's potential vorticity interpolated to isobaric surfaces defined in t_iso_levels"/>

<!-- u_iso_levels cell variables -->

<var name="uzonal_isobaric" type="real" dimensions="nIsoLevelsU nCells Time" units="m s^{-1}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ subroutine mpas_atm_diag_setup(stream_mgr, configs, structs, clock, dminfo)
call mpas_atm_diag_utils_init(stream_mgr)

call diagnostic_template_setup(configs, structs, clock)
call isobaric_diagnostics_setup(structs, clock)
call cloud_diagnostics_setup(structs, clock)
call convective_diagnostics_setup(structs, clock)
call pv_diagnostics_setup(structs, clock)
call isobaric_diagnostics_setup(structs, clock)
call soundings_setup(configs, structs, clock, dminfo)

end subroutine mpas_atm_diag_setup
Expand Down Expand Up @@ -110,10 +110,10 @@ subroutine mpas_atm_diag_compute()


call diagnostic_template_compute()
call isobaric_diagnostics_compute()
call cloud_diagnostics_compute()
call convective_diagnostics_compute()
call pv_diagnostics_compute()
call isobaric_diagnostics_compute()
call soundings_compute()

end subroutine mpas_atm_diag_compute
Expand Down
118 changes: 107 additions & 11 deletions src/core_atmosphere/diagnostics/mpas_isobaric_diagnostics.F
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ module mpas_isobaric_diagnostics
need_vorticity_50, need_vorticity_100, need_vorticity_200, need_vorticity_250, need_vorticity_500, need_vorticity_700, need_vorticity_850, need_vorticity_925, &
need_t_isobaric, need_z_isobaric, need_meanT_500_300

logical :: need_dtheta_dt_mp_isobaric, &
logical :: need_dtheta_dt_mp_isobaric, need_dtheta_dt_mix_isobaric, &
need_rh_isobaric, &
need_rhod_isobaric, &
need_rthblten_isobaric, need_rthratenlw_isobaric, need_rthratensw_isobaric, &
need_qv_isobaric
need_rthblten_isobaric, need_rthcuten_isobaric, need_rthdynten_isobaric, &
need_rthmpten_isobaric, need_rthratenlw_isobaric, need_rthratensw_isobaric, &
need_qv_isobaric, &
need_ertel_pv_isobaric

logical :: need_uzonal_isobaric, need_umeridional_isobaric, need_w_isobaric, &
need_vorticity_isobaric
Expand Down Expand Up @@ -316,18 +318,28 @@ subroutine isobaric_diagnostics_compute()
need_any_diags = need_any_diags .or. need_meanT_500_300
need_dtheta_dt_mp_isobaric = MPAS_field_will_be_written('dtheta_dt_mp_isobaric')
need_any_diags = need_any_diags .or. need_dtheta_dt_mp_isobaric
need_dtheta_dt_mix_isobaric = MPAS_field_will_be_written('dtheta_dt_mix_isobaric')
need_any_diags = need_any_diags .or. need_dtheta_dt_mix_isobaric
need_rh_isobaric = MPAS_field_will_be_written('rh_isobaric')
need_any_diags = need_any_diags .or. need_rh_isobaric
need_rhod_isobaric = MPAS_field_will_be_written('rhod_isobaric')
need_any_diags = need_any_diags .or. need_rhod_isobaric
need_rthblten_isobaric = MPAS_field_will_be_written('rthblten_isobaric')
need_any_diags = need_any_diags .or. need_rthblten_isobaric
need_rthcuten_isobaric = MPAS_field_will_be_written('rthcuten_isobaric')
need_any_diags = need_any_diags .or. need_rthcuten_isobaric
need_rthdynten_isobaric = MPAS_field_will_be_written('rthdynten_isobaric')
need_any_diags = need_any_diags .or. need_rthdynten_isobaric
need_rthmpten_isobaric = MPAS_field_will_be_written('rthmpten_isobaric')
need_any_diags = need_any_diags .or. need_rthmpten_isobaric
need_rthratenlw_isobaric = MPAS_field_will_be_written('rthratenlw_isobaric')
need_any_diags = need_any_diags .or. need_rthratenlw_isobaric
need_rthratensw_isobaric = MPAS_field_will_be_written('rthratensw_isobaric')
need_any_diags = need_any_diags .or. need_rthratensw_isobaric
need_qv_isobaric = MPAS_field_will_be_written('qv_isobaric')
need_any_diags = need_any_diags .or. need_qv_isobaric
need_ertel_pv_isobaric = MPAS_field_will_be_written('ertel_pv_isobaric')
need_any_diags = need_any_diags .or. need_ertel_pv_isobaric
need_uzonal_isobaric = MPAS_field_will_be_written('uzonal_isobaric')
need_any_diags = need_any_diags .or. need_uzonal_isobaric
need_umeridional_isobaric = MPAS_field_will_be_written('umeridional_isobaric')
Expand Down Expand Up @@ -379,8 +391,9 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)
real (kind=RKIND), dimension(:,:), pointer :: umeridional, uzonal, vvel
real (kind=RKIND), dimension(:,:,:), pointer :: scalars
real (kind=RKIND), dimension(:,:), pointer :: rho
real (kind=RKIND), dimension(:,:), pointer :: dtheta_dt_mp
real (kind=RKIND), dimension(:,:), pointer :: rthblten, rthratenlw, rthratensw
real (kind=RKIND), dimension(:,:), pointer :: dtheta_dt_mp, dtheta_dt_mix
real (kind=RKIND), dimension(:,:), pointer :: rthblten, rthcuten, rthdynten, rthmpten, rthratenlw, rthratensw
real (kind=RKIND), dimension(:,:), pointer :: ertel_pv

real (kind=RKIND), dimension(:), pointer :: t_iso_levels
real (kind=RKIND), dimension(:), pointer :: z_iso_levels
Expand All @@ -389,12 +402,17 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)
real (kind=RKIND), dimension(:,:), pointer :: z_isobaric
real (kind=RKIND), dimension(:), pointer :: meanT_500_300
real (kind=RKIND), dimension(:,:), pointer :: dtheta_dt_mp_isobaric
real (kind=RKIND), dimension(:,:), pointer :: dtheta_dt_mix_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rh_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rhod_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rthblten_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rthcuten_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rthdynten_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rthmpten_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rthratenlw_isobaric
real (kind=RKIND), dimension(:,:), pointer :: rthratensw_isobaric
real (kind=RKIND), dimension(:,:), pointer :: qv_isobaric
real (kind=RKIND), dimension(:,:), pointer :: ertel_pv_isobaric
real (kind=RKIND), dimension(:,:), pointer :: uzonal_isobaric
real (kind=RKIND), dimension(:,:), pointer :: umeridional_isobaric
real (kind=RKIND), dimension(:,:), pointer :: w_isobaric
Expand Down Expand Up @@ -569,9 +587,14 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)

call mpas_pool_get_array(diag, 'rho', rho)
call mpas_pool_get_array(diag, 'dtheta_dt_mp', dtheta_dt_mp)
call mpas_pool_get_array(diag, 'dtheta_dt_mix', dtheta_dt_mix)
call mpas_pool_get_array(tend_physics, 'rthblten', rthblten)
call mpas_pool_get_array(tend_physics, 'rthcuten', rthcuten)
call mpas_pool_get_array(tend_physics, 'rthdynten', rthdynten)
call mpas_pool_get_array(tend_physics, 'rthmpten', rthmpten)
call mpas_pool_get_array(tend_physics, 'rthratenlw', rthratenlw)
call mpas_pool_get_array(tend_physics, 'rthratensw', rthratensw)
call mpas_pool_get_array(diag, 'ertel_pv', ertel_pv)

call mpas_pool_get_array(diag, 't_iso_levels', t_iso_levels)
call mpas_pool_get_array(diag, 'z_iso_levels', z_iso_levels)
Expand All @@ -580,12 +603,17 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)
call mpas_pool_get_array(diag, 'z_isobaric', z_isobaric)
call mpas_pool_get_array(diag, 'meanT_500_300', meanT_500_300)
call mpas_pool_get_array(diag, 'dtheta_dt_mp_isobaric', dtheta_dt_mp_isobaric)
call mpas_pool_get_array(diag, 'dtheta_dt_mix_isobaric', dtheta_dt_mix_isobaric)
call mpas_pool_get_array(diag, 'rh_isobaric', rh_isobaric)
call mpas_pool_get_array(diag, 'rhod_isobaric', rhod_isobaric)
call mpas_pool_get_array(diag, 'rthblten_isobaric', rthblten_isobaric)
call mpas_pool_get_array(diag, 'rthcuten_isobaric', rthcuten_isobaric)
call mpas_pool_get_array(diag, 'rthdynten_isobaric', rthdynten_isobaric)
call mpas_pool_get_array(diag, 'rthmpten_isobaric', rthmpten_isobaric)
call mpas_pool_get_array(diag, 'rthratenlw_isobaric', rthratenlw_isobaric)
call mpas_pool_get_array(diag, 'rthratensw_isobaric', rthratensw_isobaric)
call mpas_pool_get_array(diag, 'qv_isobaric', qv_isobaric)
call mpas_pool_get_array(diag, 'ertel_pv_isobaric', ertel_pv_isobaric)
call mpas_pool_get_array(diag, 'uzonal_isobaric', uzonal_isobaric)
call mpas_pool_get_array(diag, 'umeridional_isobaric', umeridional_isobaric)
call mpas_pool_get_array(diag, 'w_isobaric', w_isobaric)
Expand Down Expand Up @@ -675,9 +703,11 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)
if(.not.allocated(dewpoint) ) allocate(dewpoint(nVertLevels,nCells) )

if (need_t_isobaric &
.or. need_dtheta_dt_mp_isobaric .or. need_rh_isobaric .or. need_rhod_isobaric &
.or. need_rthblten_isobaric .or. need_rthratenlw_isobaric .or. need_rthratensw_isobaric &
.or. need_qv_isobaric) then
.or. need_dtheta_dt_mp_isobaric .or. need_dtheta_dt_mix_isobaric &
.or. need_rh_isobaric .or. need_rhod_isobaric &
.or. need_rthblten_isobaric .or. need_rthcuten_isobaric .or. need_rthdynten_isobaric &
.or. need_rthmpten_isobaric .or. need_rthratenlw_isobaric .or. need_rthratensw_isobaric &
.or. need_qv_isobaric .or. need_ertel_pv_isobaric) then
t_iso_levels(:) = era5_pressure_levels
end if

Expand Down Expand Up @@ -1112,11 +1142,12 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)

!!!!!!!!!!! Additional temperature levels for vortex tracking !!!!!!!!!!!
if (need_t_isobaric .or. need_meanT_500_300 &
.or. need_dtheta_dt_mp_isobaric &
.or. need_dtheta_dt_mp_isobaric .or. need_dtheta_dt_mix_isobaric &
.or. need_rh_isobaric &
.or. need_rhod_isobaric &
.or. need_rthblten_isobaric .or. need_rthratenlw_isobaric .or. need_rthratensw_isobaric &
.or. need_qv_isobaric) then
.or. need_rthblten_isobaric .or. need_rthcuten_isobaric .or. need_rthdynten_isobaric &
.or. need_rthmpten_isobaric .or. need_rthratenlw_isobaric .or. need_rthratensw_isobaric &
.or. need_qv_isobaric .or. need_ertel_pv_isobaric) then

allocate(field_in(nCells, nVertLevels))
allocate(press_in(nCells, nVertLevels))
Expand Down Expand Up @@ -1173,6 +1204,19 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)
end do
end if

if (need_dtheta_dt_mix_isobaric) then
do iCell = 1, nCells
do k = 1, nVertLevels
kk = nVertLevels + 1 - k
field_in(iCell,kk) = dtheta_dt_mix(k,iCell)
end do
end do
call interp_tofixed_pressure(nCells, nVertLevels, nIsoLevelsT, press_in, field_in, press_interp, field_interp)
do k = 1, nIsoLevelsT
dtheta_dt_mix_isobaric(k,1:nCells) = field_interp(1:nCells,k)
end do
end if

if (need_rh_isobaric) then
do iCell = 1, nCells
do k = 1, nVertLevels
Expand Down Expand Up @@ -1212,6 +1256,45 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)
end do
end if

if (need_rthcuten_isobaric) then
do iCell = 1, nCells
do k = 1, nVertLevels
kk = nVertLevels + 1 - k
field_in(iCell,kk) = rthcuten(k,iCell)
end do
end do
call interp_tofixed_pressure(nCells, nVertLevels, nIsoLevelsT, press_in, field_in, press_interp, field_interp)
do k = 1, nIsoLevelsT
rthcuten_isobaric(k,1:nCells) = field_interp(1:nCells,k)
end do
end if

if (need_rthdynten_isobaric) then
do iCell = 1, nCells
do k = 1, nVertLevels
kk = nVertLevels + 1 - k
field_in(iCell,kk) = rthdynten(k,iCell)
end do
end do
call interp_tofixed_pressure(nCells, nVertLevels, nIsoLevelsT, press_in, field_in, press_interp, field_interp)
do k = 1, nIsoLevelsT
rthdynten_isobaric(k,1:nCells) = field_interp(1:nCells,k)
end do
end if

if (need_rthmpten_isobaric) then
do iCell = 1, nCells
do k = 1, nVertLevels
kk = nVertLevels + 1 - k
field_in(iCell,kk) = rthmpten(k,iCell)
end do
end do
call interp_tofixed_pressure(nCells, nVertLevels, nIsoLevelsT, press_in, field_in, press_interp, field_interp)
do k = 1, nIsoLevelsT
rthmpten_isobaric(k,1:nCells) = field_interp(1:nCells,k)
end do
end if

if (need_rthratenlw_isobaric) then
do iCell = 1, nCells
do k = 1, nVertLevels
Expand Down Expand Up @@ -1250,6 +1333,19 @@ subroutine interp_diagnostics(mesh, state, time_lev, diag, tend_physics)
qv_isobaric(k,1:nCells) = field_interp(1:nCells,k)
end do
end if

if (need_ertel_pv_isobaric) then
do iCell = 1, nCells
do k = 1, nVertLevels
kk = nVertLevels + 1 - k
field_in(iCell,kk) = ertel_pv(k,iCell)
end do
end do
call interp_tofixed_pressure(nCells, nVertLevels, nIsoLevelsT, press_in, field_in, press_interp, field_interp)
do k = 1, nIsoLevelsT
ertel_pv_isobaric(k,1:nCells) = field_interp(1:nCells,k)
end do
end if


deallocate(field_in)
Expand Down
12 changes: 7 additions & 5 deletions src/core_atmosphere/diagnostics/mpas_pv_diagnostics.F
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module mpas_pv_diagnostics

logical :: need_ertel_pv, need_u_pv, need_v_pv, need_theta_pv, need_vort_pv, need_iLev_DT, &
need_tend_lw, need_tend_sw, need_tend_bl, need_tend_cu, need_tend_mix, need_tend_mp, &
need_tend_diab, need_tend_fric, need_tend_diab_pv, need_tend_fric_pv, need_dtheta_mp
need_tend_diab, need_tend_fric, need_tend_diab_pv, need_tend_fric_pv, need_dtheta_mix


contains
Expand Down Expand Up @@ -91,7 +91,8 @@ subroutine pv_diagnostics_compute()
need_any_budget = .false.


need_ertel_pv = MPAS_field_will_be_written('ertel_pv')
need_ertel_pv = MPAS_field_will_be_written('ertel_pv') &
.or. MPAS_field_will_be_written('ertel_pv_isobaric')
need_any_diags = need_any_diags .or. need_ertel_pv
need_u_pv = MPAS_field_will_be_written('u_pv')
need_any_diags = need_any_diags .or. need_u_pv
Expand Down Expand Up @@ -120,9 +121,10 @@ subroutine pv_diagnostics_compute()
need_tend_mix = MPAS_field_will_be_written('depv_dt_mix')
need_any_diags = need_any_diags .or. need_tend_mix
need_any_budget = need_any_budget .or. need_tend_mix
need_dtheta_mp = MPAS_field_will_be_written('dtheta_dt_mp')
need_any_diags = need_any_diags .or. need_dtheta_mp
need_any_budget = need_any_budget .or. need_dtheta_mp
need_dtheta_mix = MPAS_field_will_be_written('dtheta_dt_mix') &
.or. MPAS_field_will_be_written('dtheta_dt_mix_isobaric')
need_any_diags = need_any_diags .or. need_dtheta_mix
need_any_budget = need_any_budget .or. need_dtheta_mix
need_tend_mp = MPAS_field_will_be_written('depv_dt_mp')
need_any_diags = need_any_diags .or. need_tend_mp
need_any_budget = need_any_budget .or. need_tend_mp
Expand Down