Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding 3D temperature to history output #1075

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,9 @@
<var name="pressure" type="real" dimensions="nVertLevels nCells Time" units="Pa"
description="Pressure"/>

<var name="temperature_k" type="real" dimensions="nVertLevels nCells Time" units="K"
description="Temperature"/>

<var name="pressure_base" type="real" dimensions="nVertLevels nCells Time" units="Pa"
description="Base state pressure"/>

Expand Down
3 changes: 3 additions & 0 deletions src/core_atmosphere/mpas_atm_core.F
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ subroutine atm_compute_output_diagnostics(state, time_lev, diag, mesh)
integer, pointer :: nCells, nVertLevels, index_qv
real (kind=RKIND), dimension(:,:), pointer :: theta, rho, theta_m, rho_zz, zz
real (kind=RKIND), dimension(:,:), pointer :: pressure_base, pressure_p, pressure
real (kind=RKIND), dimension(:,:), pointer :: temperature_k
real (kind=RKIND), dimension(:,:,:), pointer :: scalars

call mpas_pool_get_dimension(mesh, 'nCells', nCells)
Expand All @@ -852,6 +853,7 @@ subroutine atm_compute_output_diagnostics(state, time_lev, diag, mesh)
call mpas_pool_get_array(diag, 'pressure_p', pressure_p)
call mpas_pool_get_array(diag, 'pressure_base', pressure_base)
call mpas_pool_get_array(diag, 'pressure', pressure)
call mpas_pool_get_array(diag, 'temperature_k', temperature_k)

call mpas_pool_get_array(mesh, 'zz', zz)

Expand All @@ -860,6 +862,7 @@ subroutine atm_compute_output_diagnostics(state, time_lev, diag, mesh)
theta(k,iCell) = theta_m(k,iCell) / (1._RKIND + rvord * scalars(index_qv,k,iCell))
rho(k,iCell) = rho_zz(k,iCell) * zz(k,iCell)
pressure(k,iCell) = pressure_base(k,iCell) + pressure_p(k,iCell)
temperature_k(k,iCell) = theta(k,iCell)/(100000./pressure(k,iCell))**0.286
end do
end do

Expand Down