From 82a3c9c6ac8827352dc2b3eea558ea8bb9972e07 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 26 Dec 2024 12:41:35 -0700 Subject: [PATCH] fix restart problem with nitrogen flux history fields modified: src/physics/cam/cam_diagnostics.F90 modified: src/physics/cam/physpkg.F90 --- src/physics/cam/cam_diagnostics.F90 | 7 ------- src/physics/cam/physpkg.F90 | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90 index 3a01d9536e..d351ec05f8 100644 --- a/src/physics/cam/cam_diagnostics.F90 +++ b/src/physics/cam/cam_diagnostics.F90 @@ -1906,13 +1906,6 @@ subroutine diag_export(cam_out) call outfld('a2x_DSTDRY4', cam_out%dstdry4, pcols, lchnk) end if - if (associated(cam_out%nhx_nitrogen_flx)) then - call outfld('a2x_NHXDEP', cam_out%nhx_nitrogen_flx, pcols, lchnk) - end if - if (associated(cam_out%noy_nitrogen_flx)) then - call outfld('a2x_NOYDEP', cam_out%noy_nitrogen_flx, pcols, lchnk) - end if - end subroutine diag_export !####################################################################### diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90 index ba36670ce8..a9ffeb91e5 100644 --- a/src/physics/cam/physpkg.F90 +++ b/src/physics/cam/physpkg.F90 @@ -1988,6 +1988,14 @@ subroutine tphysac (ztodt, cam_in, & call clybry_fam_set( ncol, lchnk, map2chm, state%q, pbuf ) + ! output these here -- after updates by chem_timestep_tend or export_fields within the current time step + if (associated(cam_out%nhx_nitrogen_flx)) then + call outfld('a2x_NHXDEP', cam_out%nhx_nitrogen_flx, pcols, lchnk) + end if + if (associated(cam_out%noy_nitrogen_flx)) then + call outfld('a2x_NOYDEP', cam_out%noy_nitrogen_flx, pcols, lchnk) + end if + end subroutine tphysac subroutine tphysbc (ztodt, state, &