Skip to content

Commit ae6af7b

Browse files
authored
Merge pull request #247 from andrearosendahl/energy_transport_diag
noresm3_0_021_cam6_4_121: Add energy transport diagnostics Added formulas for calculating different parts of the atmospheric energy transport along with new history fields, so they can be outputted when running NorESM3. Contributors: Andrea Rosendahl @andrearosendahl Reviewers: @gold2718 Purpose of changes: Add optional energy transport diagnostics to CAM Github PR URL: #247 Changes made to build system: None Changes made to the namelist: None Changes to the defaults for the boundary datasets: None Substantial timing or memory changes: None Modified test shows expected fail of NLCOMP (namelist) and BASELINE due to the new history output. Test: ERP_D_Ln9.ne30pg3_ne30pg3_mtn14.NF1850.betzy_gnu.cam-outfrq9s_aero_history
2 parents c4810da + 8f09c8e commit ae6af7b

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

cime_config/testdefs/testmods_dirs/cam/outfrq9s_aero_history/user_nl_cam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ history_aerosol_forcing = .true.
1111
history_aerosol_radiation = .true.
1212
history_aerosol_debug_output = .true.
1313
history_gas = .true.
14+
fincl3 = 'IntHeatTr:I', 'PotEnerTr:I', 'LatHeatTr:I', 'KinEnerTr:I', 'TotEnerTr:I'

src/physics/cam/cam_diagnostics.F90

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ subroutine diag_init_dry(pbuf2d)
308308
call addfld ('ZBOT', horiz_only, 'A', 'm','Lowest model level height')
309309

310310
call addfld ('ATMEINT', horiz_only, 'A', 'J/m2','Vertically integrated total atmospheric energy ')
311+
call addfld ('IntHeatTr', horiz_only, 'A', 'W/m3', 'Meridional transport of internal energy')
312+
call addfld ('PotEnerTr', horiz_only, 'A', 'W/m3', 'Meridional transport of potential energy')
313+
call addfld ('LatHeatTr', horiz_only, 'A', 'W/m3', 'Meridional transport of latent energy')
314+
call addfld ('KinEnerTr', horiz_only, 'A', 'W/m3', 'Meridional transport of kinetic energy')
315+
call addfld ('TotEnerTr', horiz_only, 'A', 'W/m3', 'Meridional transport of total energy')
311316

312317
if (history_amwg) then
313318
call add_default ('PHIS ' , 1, ' ')
@@ -1253,6 +1258,8 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
12531258
real(r8) :: ftem(pcols,pver) ! temporary workspace
12541259
real(r8) :: ftem1(pcols,pver) ! another temporary workspace
12551260
real(r8) :: ftem2(pcols,pver) ! another temporary workspace
1261+
real(r8) :: ftem3(pcols) ! another temporary workspace
1262+
real(r8) :: z3(pcols,pver) ! geo-potential height including surface geopotential
12561263
real(r8) :: p_surf(pcols) ! data interpolated to a pressure surface
12571264
real(r8) :: p_surf_q1(pcols) ! data interpolated to a pressure surface
12581265
real(r8) :: p_surf_q2(pcols) ! data interpolated to a pressure surface
@@ -1415,6 +1422,69 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
14151422
end do
14161423
call outfld ('ATMEINT ', ftem(:ncol,1), ncol, lchnk)
14171424

1425+
! Add energy transport diagnostics
1426+
!
1427+
do k = 1, pver
1428+
z3(:ncol,k) = state%zm(:ncol,k) + state%phis(:ncol)*rga
1429+
end do
1430+
1431+
!! calculate the atmospheric energy transport terms:
1432+
!! internal energy transport Cp*T*v*dp/g
1433+
if (hist_fld_active('IntHeatTr')) then
1434+
ftem(:ncol,:) = (cpair*state%t(:ncol,:)*state%v(:ncol,:))*(state%pdel(:ncol,:)*rga)
1435+
!! vertically integrate
1436+
ftem3(:ncol)=ftem(:ncol,1)
1437+
do k=2,pver
1438+
ftem3(:ncol) = ftem3(:ncol) + ftem(:ncol,k)
1439+
end do
1440+
call outfld ('IntHeatTr', ftem3(:ncol), ncol ,lchnk)
1441+
end if
1442+
1443+
!! latent energy transport Lv*Q*v*dp/g
1444+
if (hist_fld_active('LatHeatTr')) then
1445+
ftem(:ncol,:) = (latvap*state%q(:ncol,:,ixq)*state%v(:ncol,:))*(state%pdel(:ncol,:)*rga)
1446+
!! vertically integrate
1447+
ftem3(:ncol)=ftem(:ncol,1)
1448+
do k=2,pver
1449+
ftem3(:ncol) = ftem3(:ncol) + ftem(:ncol,k)
1450+
end do
1451+
call outfld ('LatHeatTr', ftem3(:ncol) ,ncol ,lchnk )
1452+
end if
1453+
1454+
!! potential energy transport g*z*v*dp/g
1455+
if (hist_fld_active('PotEnerTr')) then
1456+
ftem(:ncol,:) = z3(:ncol,:)*state%v(:ncol,:)*state%pdel(:ncol,:)
1457+
!! vertically integrate
1458+
ftem3(:ncol)=ftem(:ncol,1)
1459+
do k=2,pver
1460+
ftem3(:ncol) = ftem3(:ncol) + ftem(:ncol,k)
1461+
end do
1462+
call outfld ('PotEnerTr',ftem3(:ncol) ,ncol ,lchnk )
1463+
end if
1464+
1465+
!! kinetic energy transport 0.5*(u²+v²)*v*dp/g
1466+
if (hist_fld_active('KinEnerTr')) then
1467+
ftem(:ncol,:) = ((0.5_r8*(state%u(:ncol,:)**2+state%v(:ncol,:)**2))*state%v(:ncol,:))*(state%pdel(:ncol,:)*rga)
1468+
!! vertically integrate
1469+
ftem3(:ncol)=ftem(:ncol,1)
1470+
do k=2,pver
1471+
ftem3(:ncol) = ftem3(:ncol) + ftem(:ncol,k)
1472+
end do
1473+
call outfld ('KinEnerTr',ftem3(:ncol) ,ncol ,lchnk )
1474+
end if
1475+
1476+
!! Total energy transport Cp*T*v*dp/g + Lv*Q*v*dp/g + g*z*v*dp/g + 0.5*(u²+v²)*v*dp/g
1477+
if (hist_fld_active('TotEnerTr')) then
1478+
ftem(:ncol,:) = (cpair*state%t(:ncol,:) + latvap*state%q(:ncol,:,ixq) + gravit*z3(:ncol,:) + &
1479+
(0.5_r8*(state%u(:ncol,:)**2+state%v(:ncol,:)**2)))*state%v(:ncol,:)*(state%pdel(:ncol,:)*rga)
1480+
!! vertically integrate
1481+
ftem3(:ncol)=ftem(:ncol,1)
1482+
do k=2,pver
1483+
ftem3(:ncol) = ftem3(:ncol) + ftem(:ncol,k)
1484+
end do
1485+
call outfld ('TotEnerTr',ftem3(:ncol) ,ncol ,lchnk )
1486+
end if
1487+
14181488
!! Boundary layer atmospheric stability, temperature, water vapor diagnostics
14191489

14201490
if ( hist_fld_active('THE9251000') .or. &

0 commit comments

Comments
 (0)