From bec05e29ecafe62b83a223799b7c4ea4d3d932da Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Fri, 28 Jun 2024 10:30:17 -0600 Subject: [PATCH 01/29] Initial refactors for simple lu-decomp abstraction. --- src/physics/cam/diffusion_solver.F90 | 60 ++++++------ src/physics/cam/new_decomp.f90 | 137 +++++++++++++++++++++++++++ 2 files changed, 169 insertions(+), 28 deletions(-) create mode 100644 src/physics/cam/new_decomp.f90 diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index e4b0e9b2c8..e296032bfe 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -308,6 +308,10 @@ end function vd_lu_qdecomp integer :: i, k, m ! Longitude, level, constituent indices logical :: lqtst(pcols) ! Adjust vertical profiles + real(r8) :: ddse(ncol,pver) ! Change in dry static energy [ J/kg ] + real(r8) :: dttemp(ncol,pver) ! change in temporary temperature array + real(r8) :: du(ncol,pver) ! change in wind + real(r8) :: dv(ncol,pver) ! change in wind ! LU decomposition information. type(TriDiagDecomp) :: decomp @@ -570,13 +574,16 @@ end function vd_lu_qdecomp tau_damp_rate(:,k) = tau_damp_rate(:,k) + dragblj(:ncol,k) end do - decomp = fin_vol_lu_decomp(ztodt, p, & - coef_q=tau_damp_rate, coef_q_diff=kvm(:ncol,:)*dpidz_sq) - - call decomp%left_div(u(:ncol,:)) - call decomp%left_div(v(:ncol,:)) - call decomp%finalize() - + du = u(:ncol,:) + dv = v(:ncol,:) + call new_fin_vol_lu_decomp(ztodt, p, u(:ncol,:), du, ncol, pver, & + coef_q=tau_damp_rate, & + coef_q_diff=kvm(:ncol,:)*dpidz_sq) + call new_fin_vol_lu_decomp(ztodt, p, v(:ncol,:), dv, ncol, pver, & + coef_q=tau_damp_rate, & + coef_q_diff=kvm(:ncol,:)*dpidz_sq) + u(:ncol,:) = u(:ncol,:) + du + v(:ncol,:) = v(:ncol,:) + dv ! ---------------------------------------------------------------------- ! ! Calculate 'total' ( tautotx ) and 'tms' ( tautmsx ) stresses that ! ! have been actually added into the atmosphere at the current time step. ! @@ -741,17 +748,16 @@ end function vd_lu_qdecomp ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. - decomp = fin_vol_lu_decomp(ztodt, p, & - coef_q_diff=kvh(:ncol,:)*dpidz_sq, & - upper_bndry=interface_boundary) - if (.not. use_spcam) then - call decomp%left_div(dse(:ncol,:), & - l_cond=BoundaryData(dse_top(:ncol))) + ddse = dse(:ncol,:) + call new_fin_vol_lu_decomp(ztdot, p, dse(:ncol,:), ddse, & + ncol, pver, & + coef_q_diff=kvh(:ncol,:)*dpidz_sq, & + upper_bndry=interface_boundary, & + l_cond=BoundaryData(dse_top(:ncol))) + dse(:nol,:) = dse(:ncol,:) + ddse endif - call decomp%finalize() - ! Calculate flux at top interface ! Modification : Why molecular diffusion does not work for dry static energy in all layers ? @@ -759,16 +765,16 @@ end function vd_lu_qdecomp topflx(:ncol) = - kvh(:ncol,1) * tmpi2(:ncol,1) / (ztodt*gravit) * & ( dse(:ncol,1) - dse_top(:ncol) ) - decomp = fin_vol_lu_decomp(ztodt, p, & - coef_q_diff=kvt(:ncol,:)*dpidz_sq, & - coef_q_weight=cpairv(:ncol,:)) - ttemp0 = t(:ncol,:) ttemp = ttemp0 ! upper boundary is zero flux for extended model if (.not. use_spcam) then - call decomp%left_div(ttemp) + dttemp = ttemp + call new_fin_vol_lu_decomp(ztdot, p, ttemp, dttemp, ncol, pver, & + coef_q_diff=kvt(:ncol,:)*dpidz_sq & + coef_q_weight=cpairv(:ncol,:)) + ttemp = ttemp + dttemp end if call decomp%finalize() @@ -791,17 +797,15 @@ end function vd_lu_qdecomp ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. - decomp = fin_vol_lu_decomp(ztodt, p, & - coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & - upper_bndry=interface_boundary) - if (.not. use_spcam) then - call decomp%left_div(dse(:ncol,:), & - l_cond=BoundaryData(dse_top(:ncol))) + ddse = dse(:ncol,:) + call new_fin_vol_lu_decomp(ztdot, p, dse(:ncol,:), ddse, ncol, pver, & + coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & + upper_bndry=interface_boundary, & + l_cond=BoundaryData(dse_top(:ncol))) + dse(:ncol,:) = dse(:ncol,:) + ddse end if - call decomp%finalize() - ! Calculate flux at top interface ! Modification : Why molecular diffusion does not work for dry static energy in all layers ? diff --git a/src/physics/cam/new_decomp.f90 b/src/physics/cam/new_decomp.f90 new file mode 100644 index 0000000000..7dab890dc2 --- /dev/null +++ b/src/physics/cam/new_decomp.f90 @@ -0,0 +1,137 @@ +module new_decomp + +implicit none +private +save + +public :: new_fin_vol_lu_decomp + + +contains +! Designed to solve the equation: +! +! w * dq/dt = d/dp (D q' - v q) + c q +! +! where q is a grid-cell average, and p is the vertical coordinate +! (presumably pressure). +! +! In this function, coef_q_weight == w, coef_q_diff == D, +! coef_q_adv == v, and coef_q == c. All these are optional; omitting a +! coefficient is equivalent to setting the entire array to 0. +! +! coef_q_diff and coef_q_adv are defined at the level interfaces, while +! coef_q and coef_q_weight are grid-cell averages. + +function new_fin_vol_lu_decomp(dt, p, u, du, ncols, pver, & + coef_q, coef_q_diff, coef_q_adv, coef_q_weight, & + upper_bndry, lower_bndry, graft_decomp, & + l_cond, r_cond) + + use linear_1d_operators, only: & + zero_operator, & + diagonal_operator, & + diffusion_operator, & + advection_operator, & + BoundaryType + + ! ---------------------- ! + ! Input-Output Arguments ! + ! ---------------------- ! + + ! Time step. + real(r8), intent(in) :: dt + ! Grid spacings. + type(Coords1D), intent(in) :: p + + ! Matrix to decomp from. + real(r8), intent(in) :: u(ncols,pver) + ! Matrix to decomp into. + real(r8), intent(out) :: du(ncols,pver) + integer, intent(in) :: ncols + integer, intent(in) :: pver + + ! Coefficients for diffusion and advection. + ! + ! The sizes must be consistent among all the coefficients that are + ! actually present, i.e. coef_q_diff and coef_q_adv should be one level + ! bigger than coef_q and coef_q_weight, and have the same column number. + real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q(:,:) + real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q_diff(:,:) + real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q_adv(:,:) + real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q_weight(:,:) + + ! Boundary conditions (optional, default to 0 flux through boundary). + class(BoundaryType), target, intent(in), optional :: & + upper_bndry, lower_bndry + + ! Decomposition to graft onto. If this is provided, you can pass in + ! smaller coefficients. + type(TriDiagDecomp), intent(in), optional :: graft_decomp + + ! Objects representing boundary conditions. + class(BoundaryCond), intent(in), optional :: l_cond, r_cond + + ! Output decomposition. + type(TriDiagDecomp) :: decomp + + ! --------------- ! + ! Local Variables ! + ! --------------- ! + + ! Operator objects. + type(TriDiagOp) :: add_term + type(TriDiagOp) :: net_operator + + ! ----------------------- ! + ! Main Computation Begins ! + ! ----------------------- ! + + ! A diffusion term is probably present, so start with that. Otherwise + ! start with an operator of all 0s. + + du = u + if (present(coef_q_diff)) then + net_operator = diffusion_operator(p, coef_q_diff, & + upper_bndry, lower_bndry) + else + net_operator = zero_operator(p%n, p%d) + end if + + ! Constant term (damping). + if (present(coef_q)) then + add_term = diagonal_operator(coef_q) + call net_operator%add(add_term) + end if + + ! Effective advection. + if (present(coef_q_adv)) then + add_term = advection_operator(p, coef_q_adv, & + upper_bndry, lower_bndry) + call net_operator%add(add_term) + end if + + ! We want I-dt*(w^-1)*A for a single time step, implicit method, where + ! A is the right-hand-side operator (i.e. what net_operator is now). + if (present(coef_q_weight)) then + call net_operator%lmult_as_diag(-dt/coef_q_weight) + else + call net_operator%lmult_as_diag(-dt) + end if + call net_operator%add_to_diag(1._r8) + + ! Decompose, grafting on an optional input decomp. The graft is a way to + ! avoid re-calculating the ending (bottom) levels when the coefficients + ! have only changed at the beginning (top), e.g. for different + ! constituents in the molecular diffusion. + decomp = TriDiagDecomp(net_operator, graft_decomp=graft_decomp) + + ! Ensure local objects are deallocated. + call net_operator%finalize() + call add_term%finalize() + + call decomp%left_div(du(:ncols, :), l_cond, r_cond) + call decomp%finalize() + du = u - du +end function fin_vol_lu_decomp + +end module new_decomp \ No newline at end of file From 5ebc0482ffdc0ed2fcd5c781c5793e6171564bee Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 16 Sep 2024 07:42:53 -0600 Subject: [PATCH 02/29] Migrating solve steps to new_decomp. --- src/physics/cam/diffusion_solver.F90 | 21 +- src/physics/cam/eddy_diff_cam.F90 | 4 +- src/physics/cam/new_decomp.f90 | 411 +++++++++++++++++++-------- 3 files changed, 308 insertions(+), 128 deletions(-) diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index e296032bfe..61f499a2e2 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -160,12 +160,13 @@ subroutine compute_vdiff( lchnk , use coords_1d, only: Coords1D use linear_1d_operators, only : BoundaryType, BoundaryFixedLayer, & BoundaryData, BoundaryFlux, TriDiagDecomp - use vdiff_lu_solver, only : fin_vol_lu_decomp + use new_decomp, only : fin_vol_solve use beljaars_drag_cam, only : do_beljaars ! FIXME: This should not be needed use air_composition, only: rairv - use phys_control, only : phys_getopts + use phys_control, only : phys_getopts + use vdiff_lu_solver, only : fin_vol_lu_decomp ! Modification : Ideally, we should diffuse 'liquid-ice static energy' (sl), not the dry static energy. ! Also, vertical diffusion of cloud droplet number concentration and aerosol number @@ -576,10 +577,10 @@ end function vd_lu_qdecomp du = u(:ncol,:) dv = v(:ncol,:) - call new_fin_vol_lu_decomp(ztodt, p, u(:ncol,:), du, ncol, pver, & + du = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & coef_q=tau_damp_rate, & coef_q_diff=kvm(:ncol,:)*dpidz_sq) - call new_fin_vol_lu_decomp(ztodt, p, v(:ncol,:), dv, ncol, pver, & + dv = fin_vol_solve(ztodt, p, v(:ncol,:), ncol, pver, & coef_q=tau_damp_rate, & coef_q_diff=kvm(:ncol,:)*dpidz_sq) u(:ncol,:) = u(:ncol,:) + du @@ -750,12 +751,12 @@ end function vd_lu_qdecomp ! condition is defined directly on the top interface. if (.not. use_spcam) then ddse = dse(:ncol,:) - call new_fin_vol_lu_decomp(ztdot, p, dse(:ncol,:), ddse, & + ddse = fin_vol_solve(ztodt, p, dse(:ncol,:), & ncol, pver, & coef_q_diff=kvh(:ncol,:)*dpidz_sq, & upper_bndry=interface_boundary, & l_cond=BoundaryData(dse_top(:ncol))) - dse(:nol,:) = dse(:ncol,:) + ddse + dse(:ncol,:) = dse(:ncol,:) + ddse endif ! Calculate flux at top interface @@ -771,13 +772,12 @@ end function vd_lu_qdecomp ! upper boundary is zero flux for extended model if (.not. use_spcam) then dttemp = ttemp - call new_fin_vol_lu_decomp(ztdot, p, ttemp, dttemp, ncol, pver, & - coef_q_diff=kvt(:ncol,:)*dpidz_sq & + dttemp = fin_vol_solve(ztodt, p, ttemp, ncol, pver, & + coef_q_diff=kvt(:ncol,:)*dpidz_sq, & coef_q_weight=cpairv(:ncol,:)) ttemp = ttemp + dttemp end if - call decomp%finalize() !------------------------------------- ! Update dry static energy @@ -798,8 +798,7 @@ end function vd_lu_qdecomp ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. if (.not. use_spcam) then - ddse = dse(:ncol,:) - call new_fin_vol_lu_decomp(ztdot, p, dse(:ncol,:), ddse, ncol, pver, & + ddse = fin_vol_solve(ztodt, p, dse(:ncol,:), ncol, pver, & coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & upper_bndry=interface_boundary, & l_cond=BoundaryData(dse_top(:ncol))) diff --git a/src/physics/cam/eddy_diff_cam.F90 b/src/physics/cam/eddy_diff_cam.F90 index f8660e35f1..b817a3dce8 100644 --- a/src/physics/cam/eddy_diff_cam.F90 +++ b/src/physics/cam/eddy_diff_cam.F90 @@ -805,8 +805,8 @@ subroutine compute_eddy_diff( pbuf, lchnk , zero , fieldlist_wet, fieldlist_molec, & ufd , vfd , qtfd , slfd , & jnk1d , jnk1d , jnk2d , jnk1d , errstring , & - tauresx , tauresy , 0 , cpairv(:,:,lchnk), zero, & - .false., .false. ) + tauresx , tauresy , 0 , cpairv(:,:,lchnk), zero, & + .false., .false.) call handle_errmsg(errstring, subname="compute_vdiff", & extra_msg="compute_vdiff called from eddy_diff_cam") diff --git a/src/physics/cam/new_decomp.f90 b/src/physics/cam/new_decomp.f90 index 7dab890dc2..92c418f693 100644 --- a/src/physics/cam/new_decomp.f90 +++ b/src/physics/cam/new_decomp.f90 @@ -4,10 +4,195 @@ module new_decomp private save -public :: new_fin_vol_lu_decomp - +public :: fin_vol_solve +public :: vd_lu_solve contains + +function vd_lu_solve( & + pcols , pver , ncol ,u, fixed_ubc , cnst_fixed_ubflx, mw, & + kv , kq_scal, mw_facm , dpidz_sq , p, & + interface_boundary, molec_boundary, & + tint , ztodt , nbot_molec , & + lchnk , t, alphath, waccmx_mode, ubc_mmr, ubc_flux) & + result(du) + + use coords_1d, only: Coords1D + use linear_1d_operators, only: BoundaryType, & + TriDiagDecomp, & + BoundaryData, & + BoundaryFlux + use vdiff_lu_solver, only: fin_vol_lu_decomp + use shr_kind_mod, only: r8 => shr_kind_r8 + use air_composition, only: mbarv + use physconst, only: mwdry, gravit + + integer, intent(in) :: pcols + integer, intent(in) :: pver + integer, intent(in) :: ncol ! Number of atmospheric columns + integer, intent(in) :: u(pcols, pver) + integer, intent(in) :: nbot_molec + + logical, intent(in) :: fixed_ubc ! Fixed upper boundary condition flag + logical, intent(in) :: cnst_fixed_ubflx + real(r8), intent(in) :: kv(pcols,pver+1) ! Eddy diffusivity + real(r8), intent(in) :: kq_scal(pcols,pver+1) ! Molecular diffusivity ( kq_fac*sqrt(T)*m_d/rho ) + real(r8), intent(in) :: mw ! Molecular weight for this constituent + real(r8), intent(in) :: mw_facm(pcols,pver+1) ! composition dependent sqrt(1/M_q + 1/M_d) for this constituent + real(r8), intent(in) :: dpidz_sq(ncol,pver+1) ! (g*rho)**2 (square of vertical derivative of pint) + type(Coords1D), intent(in) :: p ! Pressure coordinates + type(BoundaryType), intent(in) :: interface_boundary ! Boundary on grid edge. + type(BoundaryType), intent(in) :: molec_boundary ! Boundary at edge of molec_diff region. + real(r8), intent(in) :: tint(pcols,pver+1) ! Interface temperature [ K ] + real(r8), intent(in) :: ztodt ! 2 delta-t [ s ] + + integer, intent(in) :: lchnk ! Chunk number + real(r8), intent(in) :: t(pcols,pver) ! temperature + logical, intent(in), optional :: waccmx_mode ! running waccmx + real(r8), intent(in), optional :: alphath + real(r8), intent(in), optional :: ubc_mmr(pcols) ! Upper boundary mixing ratios [ kg/kg ] + real(r8), intent(in), optional :: ubc_flux(pcols)! Upper boundary flux [ kg/s/m^2 ] + + real(r8) :: du(pcols, pver) + + ! LU decomposition information for solver. + type(TriDiagDecomp) :: decomp + + ! --------------- ! + ! Local Variables ! + ! --------------- ! + + ! Level index. + integer :: k + + ! Molecular diffusivity for constituent. + real(r8) :: kmq(ncol,nbot_molec+1) + + ! Term for drift due to molecular separation: (m_i/m - 1) / p + real(r8) :: mw_term(ncol,nbot_molec+1) + + ! Diffusion coefficient. + real(r8) :: diff_coef(ncol,nbot_molec+1) + ! Advection velocity. + real(r8) :: advect_v(ncol,nbot_molec+1) + + ! 1/mbar * d(mbar)/dp + real(r8) :: gradm(ncol,nbot_molec+1) + + ! alphaTh/T * dT/dp, for now alphaTh is non-zero only for H. + real(r8) :: gradt(ncol,nbot_molec+1) + + ! mbarv at interface + real(r8) :: mbarvi(ncol) + + ! ----------------------- ! + ! Main Computation Begins ! + ! ----------------------- ! + + ! --------------------------------------------------------------------- ! + ! Determine superdiagonal (ca(k)) and subdiagonal (cc(k)) coeffs of the ! + ! tridiagonal diffusion matrix. The diagonal elements (cb=1+ca+cc) are ! + ! a combination of ca and cc; they are not required by the solver. ! + !---------------------------------------------------------------------- ! + + kmq = 0._r8 + mw_term = 0._r8 + gradm = 0._r8 + gradt = 0._r8 + + ! Compute difference between scale heights of constituent and dry air + + if ( waccmx_mode ) then + + ! Top level first. + k = 1 + mbarvi = .75_r8*mbarv(:ncol,k,lchnk)+0.5_r8*mbarv(:ncol,k+1,lchnk) & + -.25_r8*mbarv(:ncol,k+2,lchnk) + mw_term(:,k) = (mw/mbarvi - 1._r8) / p%ifc(:,k) + gradm(:,k) = (mbarv(:ncol,k,lchnk)-mbarvi)/ & + (p%mid(:,k)-p%ifc(:,k))/ & + (mbarv(:ncol,k,lchnk)+mbarvi)*2._r8 + + if (alphath /= 0._r8) then + gradt(:,k) = alphath*(t(:ncol,k)-tint(:ncol,k))/ & + (p%mid(:ncol,k)-p%ifc(:ncol,k))/ & + (t(:ncol,k)+tint(:ncol,k))*2._r8 + end if + + ! Interior of molecular diffusion region. + do k = 2, nbot_molec + mbarvi = 0.5_r8 * (mbarv(:ncol,k-1,lchnk)+mbarv(:ncol,k,lchnk)) + mw_term(:,k) = (mw/mbarvi - 1._r8) / p%ifc(:,k) + gradm(:,k) = (mbarv(:ncol,k,lchnk)-mbarv(:ncol,k-1,lchnk)) * & + p%rdst(:,k-1)/mbarvi + enddo + + if (alphath /= 0._r8) then + do k = 2, nbot_molec + gradt(:,k) = alphath*(t(:ncol,k)-t(:ncol,k-1)) & + *p%rdst(:,k-1)/tint(:ncol,k) + end do + end if + + ! Leave nbot_molec+1 terms as zero, because molecular diffusion is + ! small at the lower boundary. + + else + + do k = 1, nbot_molec + mw_term(:,k) = (mw/mwdry - 1._r8) / p%ifc(:ncol,k) + enddo + + endif + + !-------------------- ! + ! Molecular diffusion ! + !-------------------- ! + + ! Start with non-molecular portion of diffusion. + + ! Molecular diffusion coefficient. + do k = 1, nbot_molec + kmq(:,k) = kq_scal(:ncol,k) * mw_facm(:ncol,k) + end do + + diff_coef = kv(:ncol,:nbot_molec+1) + kmq + + ! "Drift" terms. + advect_v = kmq*mw_term + if ( waccmx_mode ) then + advect_v = advect_v - kmq*gradt - & + (kv(:ncol,:nbot_molec+1) + kmq)*gradm + end if + + ! Convert from z to pressure representation. + diff_coef = dpidz_sq(:,:nbot_molec+1) * diff_coef + advect_v = dpidz_sq(:,:nbot_molec+1) * advect_v + + if( fixed_ubc ) then + decomp = fin_vol_lu_decomp(ztodt, p, & + coef_q_diff=diff_coef, coef_q_adv=advect_v, & + upper_bndry=interface_boundary, & + lower_bndry=molec_boundary) + else + decomp = fin_vol_lu_decomp(ztodt, p, & + coef_q_diff=diff_coef, coef_q_adv=advect_v, & + lower_bndry=molec_boundary) + end if + + if (cnst_fixed_ubflx) then + call decomp%left_div(du(:ncol,:), & + l_cond=BoundaryFlux( & + -gravit*ubc_flux(:ncol), ztodt, & + p%del(:,1))) + else + call decomp%left_div(du(:ncol,:), & + l_cond=BoundaryData(ubc_mmr(:ncol))) + end if + du = du - u + +end function vd_lu_solve + ! Designed to solve the equation: ! ! w * dq/dt = d/dp (D q' - v q) + c q @@ -22,116 +207,112 @@ module new_decomp ! coef_q_diff and coef_q_adv are defined at the level interfaces, while ! coef_q and coef_q_weight are grid-cell averages. -function new_fin_vol_lu_decomp(dt, p, u, du, ncols, pver, & - coef_q, coef_q_diff, coef_q_adv, coef_q_weight, & - upper_bndry, lower_bndry, graft_decomp, & - l_cond, r_cond) - - use linear_1d_operators, only: & - zero_operator, & - diagonal_operator, & - diffusion_operator, & - advection_operator, & - BoundaryType - - ! ---------------------- ! - ! Input-Output Arguments ! - ! ---------------------- ! - - ! Time step. - real(r8), intent(in) :: dt - ! Grid spacings. - type(Coords1D), intent(in) :: p - - ! Matrix to decomp from. - real(r8), intent(in) :: u(ncols,pver) - ! Matrix to decomp into. - real(r8), intent(out) :: du(ncols,pver) - integer, intent(in) :: ncols - integer, intent(in) :: pver - - ! Coefficients for diffusion and advection. - ! - ! The sizes must be consistent among all the coefficients that are - ! actually present, i.e. coef_q_diff and coef_q_adv should be one level - ! bigger than coef_q and coef_q_weight, and have the same column number. - real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q(:,:) - real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q_diff(:,:) - real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q_adv(:,:) - real(r8), USE_CONTIGUOUS intent(in), optional :: coef_q_weight(:,:) - - ! Boundary conditions (optional, default to 0 flux through boundary). - class(BoundaryType), target, intent(in), optional :: & - upper_bndry, lower_bndry - - ! Decomposition to graft onto. If this is provided, you can pass in - ! smaller coefficients. - type(TriDiagDecomp), intent(in), optional :: graft_decomp - - ! Objects representing boundary conditions. - class(BoundaryCond), intent(in), optional :: l_cond, r_cond - - ! Output decomposition. - type(TriDiagDecomp) :: decomp - - ! --------------- ! - ! Local Variables ! - ! --------------- ! - - ! Operator objects. - type(TriDiagOp) :: add_term - type(TriDiagOp) :: net_operator - - ! ----------------------- ! - ! Main Computation Begins ! - ! ----------------------- ! - - ! A diffusion term is probably present, so start with that. Otherwise - ! start with an operator of all 0s. - - du = u - if (present(coef_q_diff)) then - net_operator = diffusion_operator(p, coef_q_diff, & - upper_bndry, lower_bndry) - else - net_operator = zero_operator(p%n, p%d) - end if - - ! Constant term (damping). - if (present(coef_q)) then - add_term = diagonal_operator(coef_q) - call net_operator%add(add_term) - end if - - ! Effective advection. - if (present(coef_q_adv)) then - add_term = advection_operator(p, coef_q_adv, & - upper_bndry, lower_bndry) - call net_operator%add(add_term) - end if - - ! We want I-dt*(w^-1)*A for a single time step, implicit method, where - ! A is the right-hand-side operator (i.e. what net_operator is now). - if (present(coef_q_weight)) then - call net_operator%lmult_as_diag(-dt/coef_q_weight) - else - call net_operator%lmult_as_diag(-dt) - end if - call net_operator%add_to_diag(1._r8) - - ! Decompose, grafting on an optional input decomp. The graft is a way to - ! avoid re-calculating the ending (bottom) levels when the coefficients - ! have only changed at the beginning (top), e.g. for different - ! constituents in the molecular diffusion. - decomp = TriDiagDecomp(net_operator, graft_decomp=graft_decomp) - - ! Ensure local objects are deallocated. - call net_operator%finalize() - call add_term%finalize() - - call decomp%left_div(du(:ncols, :), l_cond, r_cond) - call decomp%finalize() - du = u - du -end function fin_vol_lu_decomp - -end module new_decomp \ No newline at end of file +function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & + coef_q_weight, upper_bndry, lower_bndry, l_cond, r_cond) result(du) + + use linear_1d_operators, only: & + zero_operator, & + diagonal_operator, & + diffusion_operator, & + advection_operator, & + BoundaryType, & + TriDiagDecomp, & + TriDiagOp, & + BoundaryCond, & + operator(+) + use shr_kind_mod, only: r8 => shr_kind_r8 + use coords_1d, only: Coords1D + + ! ---------------------- ! + ! Input-Output Arguments ! + ! ---------------------- ! + + ! Time step. + real(r8), intent(in) :: dt + ! Grid spacings. + type(Coords1D), intent(in) :: p + + ! Matrix to decomp from. + real(r8), intent(in) :: u(ncols,pver) + integer, intent(in) :: ncols + integer, intent(in) :: pver + + ! Coefficients for diffusion and advection. + ! + ! The sizes must be consistent among all the coefficients that are + ! actually present, i.e. coef_q_diff and coef_q_adv should be one level + ! bigger than coef_q and coef_q_weight, and have the same column number. + real(r8), contiguous, intent(in), optional :: coef_q(:,:), & + coef_q_diff(:,:), coef_q_adv(:,:), coef_q_weight(:,:) + + ! Boundary conditions (optional, default to 0 flux through boundary). + class(BoundaryType), target, intent(in), optional :: & + upper_bndry, lower_bndry + + ! Objects representing boundary conditions. + class(BoundaryCond), intent(in), optional :: l_cond, r_cond + + real(r8) :: du(ncols,pver) + + ! decomposition. + type(TriDiagDecomp) :: decomp + + ! --------------- ! + ! Local Variables ! + ! --------------- ! + + ! Operator objects. + type(TriDiagOp) :: add_term + type(TriDiagOp) :: net_operator + + ! ----------------------- ! + ! Main Computation Begins ! + ! ----------------------- ! + + ! A diffusion term is probably present, so start with that. Otherwise + ! start with an operator of all 0s. + + if (present(coef_q_diff)) then + net_operator = diffusion_operator(p, coef_q_diff, & + upper_bndry, lower_bndry) + else + net_operator = zero_operator(p%n, p%d) + end if + + ! Constant term (damping). + if (present(coef_q)) then + add_term = diagonal_operator(coef_q) + call net_operator%add(add_term) + end if + + ! Effective advection. + if (present(coef_q_adv)) then + add_term = advection_operator(p, coef_q_adv, & + upper_bndry, lower_bndry) + call net_operator%add(add_term) + end if + + ! We want I-dt*(w^-1)*A for a single time step, implicit method, where + ! A is the right-hand-side operator (i.e. what net_operator is now). + if (present(coef_q_weight)) then + call net_operator%lmult_as_diag(-dt/coef_q_weight) + else + call net_operator%lmult_as_diag(-dt) + end if + call net_operator%add_to_diag(1._r8) + + ! Decompose + decomp = TriDiagDecomp(net_operator) + + ! Ensure local objects are deallocated. + call net_operator%finalize() + call add_term%finalize() + + ! call decomp%left_div(du(:ncols, :), l_cond, r_cond) + call decomp%left_div(du(:ncols, :), l_cond=l_cond) + call decomp%finalize() + du = u - du + +end function fin_vol_solve + +end module new_decomp From beb169f964ccef4e7a29a093cb7a6bd099118aff Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Wed, 18 Sep 2024 11:17:40 -0600 Subject: [PATCH 03/29] Updating pes for izumi and removing initialization of tendency. --- cime_config/config_pes.xml | 16 ++++++++-------- src/physics/cam/diffusion_solver.F90 | 4 ---- src/physics/cam/new_decomp.f90 | 6 ++++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml index 7b50ec52f3..0bffdcdb02 100644 --- a/cime_config/config_pes.xml +++ b/cime_config/config_pes.xml @@ -164,14 +164,14 @@ -4 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 0 diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index 61f499a2e2..3e2fe07493 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -575,8 +575,6 @@ end function vd_lu_qdecomp tau_damp_rate(:,k) = tau_damp_rate(:,k) + dragblj(:ncol,k) end do - du = u(:ncol,:) - dv = v(:ncol,:) du = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & coef_q=tau_damp_rate, & coef_q_diff=kvm(:ncol,:)*dpidz_sq) @@ -750,7 +748,6 @@ end function vd_lu_qdecomp ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. if (.not. use_spcam) then - ddse = dse(:ncol,:) ddse = fin_vol_solve(ztodt, p, dse(:ncol,:), & ncol, pver, & coef_q_diff=kvh(:ncol,:)*dpidz_sq, & @@ -771,7 +768,6 @@ end function vd_lu_qdecomp ! upper boundary is zero flux for extended model if (.not. use_spcam) then - dttemp = ttemp dttemp = fin_vol_solve(ztodt, p, ttemp, ncol, pver, & coef_q_diff=kvt(:ncol,:)*dpidz_sq, & coef_q_weight=cpairv(:ncol,:)) diff --git a/src/physics/cam/new_decomp.f90 b/src/physics/cam/new_decomp.f90 index 92c418f693..b0827890b9 100644 --- a/src/physics/cam/new_decomp.f90 +++ b/src/physics/cam/new_decomp.f90 @@ -180,6 +180,7 @@ function vd_lu_solve( & lower_bndry=molec_boundary) end if + du = u if (cnst_fixed_ubflx) then call decomp%left_div(du(:ncol,:), & l_cond=BoundaryFlux( & @@ -233,9 +234,10 @@ function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & type(Coords1D), intent(in) :: p ! Matrix to decomp from. - real(r8), intent(in) :: u(ncols,pver) + ! real(r8), intent(in) :: u(ncols,pver) integer, intent(in) :: ncols integer, intent(in) :: pver + real(r8), intent(in) :: u(ncols,pver) ! Coefficients for diffusion and advection. ! @@ -307,7 +309,7 @@ function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & ! Ensure local objects are deallocated. call net_operator%finalize() call add_term%finalize() - + du = u ! call decomp%left_div(du(:ncols, :), l_cond, r_cond) call decomp%left_div(du(:ncols, :), l_cond=l_cond) call decomp%finalize() From 9d08f1d59bc05ad7b615a4bc7af8a00fc5b7f547 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Wed, 18 Sep 2024 16:22:09 -0600 Subject: [PATCH 04/29] Fix out of order operations. --- src/physics/cam/new_decomp.f90 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/physics/cam/new_decomp.f90 b/src/physics/cam/new_decomp.f90 index b0827890b9..2ca237c3ff 100644 --- a/src/physics/cam/new_decomp.f90 +++ b/src/physics/cam/new_decomp.f90 @@ -305,15 +305,17 @@ function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & ! Decompose decomp = TriDiagDecomp(net_operator) - + du = u + call decomp%left_div(du(:ncols, :), l_cond=l_cond) + du = du - u ! Ensure local objects are deallocated. call net_operator%finalize() call add_term%finalize() - du = u + ! du = u ! call decomp%left_div(du(:ncols, :), l_cond, r_cond) - call decomp%left_div(du(:ncols, :), l_cond=l_cond) + ! call decomp%left_div(du(:ncols, :), l_cond=l_cond) call decomp%finalize() - du = u - du + ! du = u - du end function fin_vol_solve From b5d2816fe7d9f7ca1bc024e63580f54d3da8be90 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Tue, 24 Sep 2024 07:36:58 -0600 Subject: [PATCH 05/29] Updating solver design to return solution directly instead of tendency to avoid numerical differences. Allocating proper matrix dimensions and adding l_cond,r_cond parameters back to left_div. --- src/physics/cam/diffusion_solver.F90 | 83 +++++++++++++++++++++------- src/physics/cam/new_decomp.f90 | 23 ++++---- 2 files changed, 73 insertions(+), 33 deletions(-) diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index 3e2fe07493..263fdc946d 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -311,8 +311,8 @@ end function vd_lu_qdecomp logical :: lqtst(pcols) ! Adjust vertical profiles real(r8) :: ddse(ncol,pver) ! Change in dry static energy [ J/kg ] real(r8) :: dttemp(ncol,pver) ! change in temporary temperature array - real(r8) :: du(ncol,pver) ! change in wind - real(r8) :: dv(ncol,pver) ! change in wind + real(r8) :: du(pcols,pver) ! change in wind + real(r8) :: dv(pcols,pver) ! change in wind ! LU decomposition information. type(TriDiagDecomp) :: decomp @@ -575,14 +575,33 @@ end function vd_lu_qdecomp tau_damp_rate(:,k) = tau_damp_rate(:,k) + dragblj(:ncol,k) end do - du = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & + !du = 0._r8 + !dv = 0._r8 + !du(:ncol,:) = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & + ! coef_q=tau_damp_rate, & + ! coef_q_diff=kvm(:ncol,:)*dpidz_sq) + v(:ncol,:) = fin_vol_solve(ztodt, p, v(:ncol,:), ncol, pver, & coef_q=tau_damp_rate, & coef_q_diff=kvm(:ncol,:)*dpidz_sq) - dv = fin_vol_solve(ztodt, p, v(:ncol,:), ncol, pver, & + !u(:ncol,:) = u(:ncol,:) + du(:ncol,:) + !v(:ncol,:) = v(:ncol,:) + dv(:ncol,:) + + !decomp = fin_vol_lu_decomp(ztodt, p, & + ! coef_q=tau_damp_rate, coef_q_diff=kvm(:ncol,:)*dpidz_sq) + + !call decomp%left_div(u(:ncol,:)) + !call decomp%left_div(v(:ncol,:)) + !call decomp%finalize() + + + !du = 0._r8 + u(:ncol,:) = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & coef_q=tau_damp_rate, & coef_q_diff=kvm(:ncol,:)*dpidz_sq) - u(:ncol,:) = u(:ncol,:) + du - v(:ncol,:) = v(:ncol,:) + dv + !u(:ncol,:) = u(:ncol,:) + du(:ncol,:) + + + ! ---------------------------------------------------------------------- ! ! Calculate 'total' ( tautotx ) and 'tms' ( tautmsx ) stresses that ! ! have been actually added into the atmosphere at the current time step. ! @@ -747,15 +766,23 @@ end function vd_lu_qdecomp ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. + ! decomp = fin_vol_lu_decomp(ztodt, p, & + ! coef_q_diff=kvh(:ncol,:)*dpidz_sq, & + ! upper_bndry=interface_boundary) + if (.not. use_spcam) then - ddse = fin_vol_solve(ztodt, p, dse(:ncol,:), & - ncol, pver, & - coef_q_diff=kvh(:ncol,:)*dpidz_sq, & - upper_bndry=interface_boundary, & - l_cond=BoundaryData(dse_top(:ncol))) - dse(:ncol,:) = dse(:ncol,:) + ddse + dse(:ncol,:) = fin_vol_solve(ztodt, p, dse(:ncol,:), & + ncol, pver, & + coef_q_diff=kvh(:ncol,:)*dpidz_sq, & + upper_bndry=interface_boundary, & + l_cond=BoundaryData(dse_top(:ncol))) + !dse(:ncol,:) = dse(:ncol,:) + ddse + ! call decomp%left_div(dse(:ncol,:), & + ! l_cond=BoundaryData(dse_top(:ncol))) endif + ! call decomp%finalize() + ! Calculate flux at top interface ! Modification : Why molecular diffusion does not work for dry static energy in all layers ? @@ -763,17 +790,23 @@ end function vd_lu_qdecomp topflx(:ncol) = - kvh(:ncol,1) * tmpi2(:ncol,1) / (ztodt*gravit) * & ( dse(:ncol,1) - dse_top(:ncol) ) + ! decomp = fin_vol_lu_decomp(ztodt, p, & + ! coef_q_diff=kvt(:ncol,:)*dpidz_sq, & + ! coef_q_weight=cpairv(:ncol,:)) + ttemp0 = t(:ncol,:) ttemp = ttemp0 ! upper boundary is zero flux for extended model if (.not. use_spcam) then - dttemp = fin_vol_solve(ztodt, p, ttemp, ncol, pver, & - coef_q_diff=kvt(:ncol,:)*dpidz_sq, & - coef_q_weight=cpairv(:ncol,:)) - ttemp = ttemp + dttemp + ttemp = fin_vol_solve(ztodt, p, ttemp, ncol, pver, & + coef_q_diff=kvt(:ncol,:)*dpidz_sq, & + coef_q_weight=cpairv(:ncol,:)) + !ttemp = ttemp + dttemp + ! call decomp%left_div(ttemp) end if + ! call decomp%finalize() !------------------------------------- ! Update dry static energy @@ -791,16 +824,24 @@ end function vd_lu_qdecomp kv_total(:ncol,:) = kvh(:ncol,:) end if + ! decomp = fin_vol_lu_decomp(ztodt, p, & + ! coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & + ! upper_bndry=interface_boundary) + ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. if (.not. use_spcam) then - ddse = fin_vol_solve(ztodt, p, dse(:ncol,:), ncol, pver, & - coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & - upper_bndry=interface_boundary, & - l_cond=BoundaryData(dse_top(:ncol))) - dse(:ncol,:) = dse(:ncol,:) + ddse + dse(:ncol,:) = fin_vol_solve(ztodt, p, dse(:ncol,:), ncol, pver, & + coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & + upper_bndry=interface_boundary, & + l_cond=BoundaryData(dse_top(:ncol))) + !dse(:ncol,:) = dse(:ncol,:) + ddse + ! call decomp%left_div(dse(:ncol,:), & + ! l_cond=BoundaryData(dse_top(:ncol))) end if + ! call decomp%finalize() + ! Calculate flux at top interface ! Modification : Why molecular diffusion does not work for dry static energy in all layers ? diff --git a/src/physics/cam/new_decomp.f90 b/src/physics/cam/new_decomp.f90 index 2ca237c3ff..1418e46acc 100644 --- a/src/physics/cam/new_decomp.f90 +++ b/src/physics/cam/new_decomp.f90 @@ -208,8 +208,8 @@ end function vd_lu_solve ! coef_q_diff and coef_q_adv are defined at the level interfaces, while ! coef_q and coef_q_weight are grid-cell averages. -function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & - coef_q_weight, upper_bndry, lower_bndry, l_cond, r_cond) result(du) +function fin_vol_solve(dt, p, toSolve, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & + coef_q_weight, upper_bndry, lower_bndry, l_cond, r_cond) result(solution) use linear_1d_operators, only: & zero_operator, & @@ -237,7 +237,7 @@ function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & ! real(r8), intent(in) :: u(ncols,pver) integer, intent(in) :: ncols integer, intent(in) :: pver - real(r8), intent(in) :: u(ncols,pver) + real(r8), intent(in) :: toSolve(ncols,pver) ! Coefficients for diffusion and advection. ! @@ -254,7 +254,7 @@ function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & ! Objects representing boundary conditions. class(BoundaryCond), intent(in), optional :: l_cond, r_cond - real(r8) :: du(ncols,pver) + real(r8) :: solution(ncols,pver) ! decomposition. type(TriDiagDecomp) :: decomp @@ -305,17 +305,16 @@ function fin_vol_solve(dt, p, u, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & ! Decompose decomp = TriDiagDecomp(net_operator) - du = u - call decomp%left_div(du(:ncols, :), l_cond=l_cond) - du = du - u - ! Ensure local objects are deallocated. + solution = toSolve + call net_operator%finalize() call add_term%finalize() - ! du = u - ! call decomp%left_div(du(:ncols, :), l_cond, r_cond) - ! call decomp%left_div(du(:ncols, :), l_cond=l_cond) + + call decomp%left_div(solution(:ncols, :), l_cond=l_cond, r_cond=r_cond) + !tendency = tendency - toSolve + + ! Ensure local objects are deallocated. call decomp%finalize() - ! du = u - du end function fin_vol_solve From cab5938c588a532471a4f7a365da9649dda119b0 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:28:45 -0600 Subject: [PATCH 06/29] Removing files moved to atmos_phys --- src/utils/coords_1d.F90 | 151 ---- src/utils/linear_1d_operators.F90 | 1180 ----------------------------- 2 files changed, 1331 deletions(-) delete mode 100644 src/utils/coords_1d.F90 delete mode 100644 src/utils/linear_1d_operators.F90 diff --git a/src/utils/coords_1d.F90 b/src/utils/coords_1d.F90 deleted file mode 100644 index c854cecabb..0000000000 --- a/src/utils/coords_1d.F90 +++ /dev/null @@ -1,151 +0,0 @@ -module coords_1d - -! This module defines the Coords1D type, which is intended to to cache -! commonly used information derived from a collection of sets of 1-D -! coordinates. - -use shr_kind_mod, only: r8 => shr_kind_r8 - -implicit none -private -save - -public :: Coords1D - -type :: Coords1D - ! Number of sets of coordinates in the object. - integer :: n = 0 - ! Number of coordinates in each set. - integer :: d = 0 - - ! All fields below will be allocated with first dimension "n". - ! The second dimension is d+1 for ifc, d for mid, del, and rdel, and - ! d-1 for dst and rdst. - - ! Cell interface coordinates. - real(r8), allocatable :: ifc(:,:) - ! Coordinates at cell mid-points. - real(r8), allocatable :: mid(:,:) - ! Width of cells. - real(r8), allocatable :: del(:,:) - ! Distance between cell midpoints. - real(r8), allocatable :: dst(:,:) - ! Reciprocals: 1/del and 1/dst. - real(r8), allocatable :: rdel(:,:) - real(r8), allocatable :: rdst(:,:) - contains - procedure :: section - procedure :: finalize -end type Coords1D - -interface Coords1D - module procedure new_Coords1D_from_fields - module procedure new_Coords1D_from_int -end interface - -contains - -! Constructor to create an object from existing data. -function new_Coords1D_from_fields(ifc, mid, del, dst, & - rdel, rdst) result(coords) - real(r8), USE_CONTIGUOUS intent(in) :: ifc(:,:) - real(r8), USE_CONTIGUOUS intent(in) :: mid(:,:) - real(r8), USE_CONTIGUOUS intent(in) :: del(:,:) - real(r8), USE_CONTIGUOUS intent(in) :: dst(:,:) - real(r8), USE_CONTIGUOUS intent(in) :: rdel(:,:) - real(r8), USE_CONTIGUOUS intent(in) :: rdst(:,:) - type(Coords1D) :: coords - - coords = allocate_coords(size(ifc, 1), size(ifc, 2) - 1) - - coords%ifc = ifc - coords%mid = mid - coords%del = del - coords%dst = dst - coords%rdel = rdel - coords%rdst = rdst - -end function new_Coords1D_from_fields - -! Constructor if you only have interface coordinates; derives all the other -! fields. -function new_Coords1D_from_int(ifc) result(coords) - real(r8), USE_CONTIGUOUS intent(in) :: ifc(:,:) - type(Coords1D) :: coords - - coords = allocate_coords(size(ifc, 1), size(ifc, 2) - 1) - - coords%ifc = ifc - coords%mid = 0.5_r8 * (ifc(:,:coords%d)+ifc(:,2:)) - coords%del = coords%ifc(:,2:) - coords%ifc(:,:coords%d) - coords%dst = coords%mid(:,2:) - coords%mid(:,:coords%d-1) - coords%rdel = 1._r8/coords%del - coords%rdst = 1._r8/coords%dst - -end function new_Coords1D_from_int - -! Create a new Coords1D object that is a subsection of some other object, -! e.g. if you want only the first m coordinates, use d_bnds=[1, m]. -! -! Originally this used pointers, but it was found to actually be cheaper -! in practice just to make a copy, especially since pointers can impede -! optimization. -function section(self, n_bnds, d_bnds) - class(Coords1D), intent(in) :: self - integer, intent(in) :: n_bnds(2), d_bnds(2) - type(Coords1D) :: section - - section = allocate_coords(n_bnds(2)-n_bnds(1)+1, d_bnds(2)-d_bnds(1)+1) - - section%ifc = self%ifc(n_bnds(1):n_bnds(2),d_bnds(1):d_bnds(2)+1) - section%mid = self%mid(n_bnds(1):n_bnds(2),d_bnds(1):d_bnds(2)) - section%del = self%del(n_bnds(1):n_bnds(2),d_bnds(1):d_bnds(2)) - section%dst = self%dst(n_bnds(1):n_bnds(2),d_bnds(1):d_bnds(2)-1) - section%rdel = self%rdel(n_bnds(1):n_bnds(2),d_bnds(1):d_bnds(2)) - section%rdst = self%rdst(n_bnds(1):n_bnds(2),d_bnds(1):d_bnds(2)-1) - -end function section - -! Quick utility to get allocate each array with the correct size. -function allocate_coords(n, d) result(coords) - integer, intent(in) :: n, d - type(Coords1D) :: coords - - coords%n = n - coords%d = d - - allocate(coords%ifc(coords%n,coords%d+1)) - allocate(coords%mid(coords%n,coords%d)) - allocate(coords%del(coords%n,coords%d)) - allocate(coords%dst(coords%n,coords%d-1)) - allocate(coords%rdel(coords%n,coords%d)) - allocate(coords%rdst(coords%n,coords%d-1)) - -end function allocate_coords - -! Deallocate and reset to initial state. -subroutine finalize(self) - class(Coords1D), intent(inout) :: self - - self%n = 0 - self%d = 0 - - call guarded_deallocate(self%ifc) - call guarded_deallocate(self%mid) - call guarded_deallocate(self%del) - call guarded_deallocate(self%dst) - call guarded_deallocate(self%rdel) - call guarded_deallocate(self%rdst) - -contains - - subroutine guarded_deallocate(array) - real(r8), allocatable :: array(:,:) - - if (allocated(array)) deallocate(array) - - end subroutine guarded_deallocate - -end subroutine finalize - -end module coords_1d diff --git a/src/utils/linear_1d_operators.F90 b/src/utils/linear_1d_operators.F90 deleted file mode 100644 index f0b6211d49..0000000000 --- a/src/utils/linear_1d_operators.F90 +++ /dev/null @@ -1,1180 +0,0 @@ -module linear_1d_operators - -! This module provides the type "TriDiagOp" to represent operators on a 1D -! grid as tridiagonal matrices, and related types to represent boundary -! conditions. -! -! The focus is on solving diffusion equations with a finite volume method -! in one dimension, but other utility operators are provided, e.g. a second -! order approximation to the first derivative. -! -! In order to allow vectorization to occur, as well as to avoid unnecessary -! copying/reshaping of data in CAM, TriDiagOp actually represents a -! collection of independent operators that can be applied to collections of -! independent data; the innermost index is over independent systems (e.g. -! CAM columns). -! -! A simple example: -! ! First derivative operator -! op = first_derivative(coords) -! ! Convert data to its derivative (extrapolate at boundaries). -! call op%apply(data) -! -! With explicit boundary conditions: -! op = first_derivative(coords, & -! l_bndry=BoundaryFixedFlux(), & -! r_bndry=BoundaryFixedLayer(layer_distance)) -! call op%apply(data, & -! l_cond=BoundaryFlux(flux, dt, thickness), & -! r_cond=BoundaryData(boundary)) -! -! Implicit solution example: -! ! Construct diffusion matrix. -! op = diffusion_operator(coords, d) -! call op%lmult_as_diag(-dt) -! call op%add_to_diag(1._r8) -! ! Decompose in order to invert the operation. -! decomp = TriDiagDecomp(op) -! ! Diffuse data for one time step (fixed flux boundaries). -! call decomp%left_div(data) - -use shr_kind_mod, only: r8 => shr_kind_r8 -use shr_log_mod, only: errMsg => shr_log_errMsg -use shr_sys_mod, only: shr_sys_abort -use coords_1d, only: Coords1D - -implicit none -private -save - -! Main type. -public :: TriDiagOp -public :: operator(+) -public :: operator(-) - -! Decomposition used for inversion (left division). -public :: TriDiagDecomp - -! Multiplies by 0. -public :: zero_operator - -! Construct identity. -public :: identity_operator - -! Produce a TriDiagOp that is simply a diagonal matrix. -public :: diagonal_operator - -! For solving the diffusion-advection equation with implicit Euler. -public :: diffusion_operator -public :: advection_operator - -! Derivatives accurate to second order on a non-uniform grid. -public :: first_derivative -public :: second_derivative - -! Boundary condition types. -public :: BoundaryType -public :: BoundaryZero -public :: BoundaryFirstOrder -public :: BoundaryExtrapolate -public :: BoundaryFixedLayer -public :: BoundaryFixedFlux - -! Boundary data types. -public :: BoundaryCond -public :: BoundaryNoData -public :: BoundaryData -public :: BoundaryFlux - -! TriDiagOp represents operators that can work between nearest neighbors, -! with some extra logic at the boundaries. The implementation is a -! tridiagonal matrix plus boundary info. -type :: TriDiagOp - private - ! The number of independent systems. - integer, public :: nsys - ! The size of the matrix (number of grid cells). - integer, public :: ncel - ! Super-, sub-, and regular diagonals. - real(r8), allocatable :: spr(:,:) - real(r8), allocatable :: sub(:,:) - real(r8), allocatable :: diag(:,:) - ! Buffers to hold boundary data; Details depend on the type of boundary - ! being used. - real(r8), allocatable :: left_bound(:) - real(r8), allocatable :: right_bound(:) - contains - ! Applies the operator to a set of data. - procedure :: apply => apply_tridiag - ! Given the off-diagonal elements, fills in the diagonal so that the - ! operator will have the constant function as an eigenvector with - ! eigenvalue 0. This is used internally as a utility for construction of - ! derivative operators. - procedure :: deriv_diag => make_tridiag_deriv_diag - ! Add/substract another tridiagonal from this one in-place (without - ! creating a temporary object). - procedure :: add => add_in_place_tridiag_ops - procedure :: subtract => subtract_in_place_tridiag_ops - ! Add input vector or scalar to the diagonal. - procedure :: scalar_add_tridiag - procedure :: diagonal_add_tridiag - generic :: add_to_diag => scalar_add_tridiag, diagonal_add_tridiag - ! Treat input vector (or scalar) as if it was the diagonal of an - ! operator, and multiply this operator on the left by that value. - procedure :: scalar_lmult_tridiag - procedure :: diagonal_lmult_tridiag - generic :: lmult_as_diag => & - scalar_lmult_tridiag, diagonal_lmult_tridiag - ! Deallocate and reset. - procedure :: finalize => tridiag_finalize -end type TriDiagOp - -interface operator(+) - module procedure add_tridiag_ops -end interface operator(+) - -interface operator(-) - module procedure subtract_tridiag_ops -end interface operator(-) - -interface TriDiagOp - module procedure new_TriDiagOp -end interface TriDiagOp - -! -! Boundary condition types for the operators. -! -! Note that BoundaryFixedLayer and BoundaryFixedFlux are the only options -! supported for backwards operation (i.e. decomp%left_div). The others are -! meant for direct application only (e.g. to find a derivative). -! -! BoundaryZero means that the operator fixes boundaries to 0. -! BoundaryFirstOrder means a one-sided approximation for the first -! derivative. -! BoundaryExtrapolate means that a second order approximation will be used, -! even at the boundaries. Boundary points do this by using their next- -! nearest neighbor to extrapolate. -! BoundaryFixedLayer means that there's an extra layer outside of the given -! grid, which must be specified when applying/inverting the operator. -! BoundaryFixedFlux is intended to provide a fixed-flux condition for -! typical advection/diffusion operators. It tweaks the edge condition -! to work on an input current rather than a value. -! -! The different types were originally implemented through polymorphism, but -! PGI required this to be done via enum instead. -integer, parameter :: zero_bndry = 0 -integer, parameter :: first_order_bndry = 1 -integer, parameter :: extrapolate_bndry = 2 -integer, parameter :: fixed_layer_bndry = 3 -integer, parameter :: fixed_flux_bndry = 4 - -type :: BoundaryType - private - integer :: bndry_type = fixed_flux_bndry - real(r8), allocatable :: edge_width(:) - contains - procedure :: make_left - procedure :: make_right - procedure :: finalize => boundary_type_finalize -end type BoundaryType - -abstract interface - subroutine deriv_seed(del_minus, del_plus, sub, spr) - import :: r8 - real(r8), USE_CONTIGUOUS intent(in) :: del_minus(:) - real(r8), USE_CONTIGUOUS intent(in) :: del_plus(:) - real(r8), USE_CONTIGUOUS intent(out) :: sub(:) - real(r8), USE_CONTIGUOUS intent(out) :: spr(:) - end subroutine deriv_seed -end interface - -interface BoundaryZero - module procedure new_BoundaryZero -end interface BoundaryZero - -interface BoundaryFirstOrder - module procedure new_BoundaryFirstOrder -end interface BoundaryFirstOrder - -interface BoundaryExtrapolate - module procedure new_BoundaryExtrapolate -end interface BoundaryExtrapolate - -interface BoundaryFixedLayer - module procedure new_BoundaryFixedLayer -end interface BoundaryFixedLayer - -interface BoundaryFixedFlux - module procedure new_BoundaryFixedFlux -end interface BoundaryFixedFlux - -! -! Data for boundary conditions themselves. -! -! "No data" conditions perform extrapolation, if BoundaryExtrapolate was -! the boundary type used to construct the operator. -! -! "Data" conditions contain extra data, which effectively extends the -! system with an extra cell. -! -! "Flux" conditions contain prescribed fluxes. -! -! The condition you can use depends on the boundary type from above that -! was used in the operator's construction. For BoundaryFixedLayer use -! BoundaryData. For BoundaryFixedFlux use BoundaryFlux. For everything -! else, use BoundaryNoData. - -! The switches using this enumeration used to be unnecessary due to use of -! polymorphism, but this had to be backed off due to insufficient PGI -! support for type extension. -integer, parameter :: no_data_cond = 0 -integer, parameter :: data_cond = 1 -integer, parameter :: flux_cond = 2 - -type :: BoundaryCond - private - integer :: cond_type = no_data_cond - real(r8), allocatable :: edge_data(:) - contains - procedure :: apply_left - procedure :: apply_right - procedure :: finalize => boundary_cond_finalize -end type BoundaryCond - -! Constructors for different types of BoundaryCond. -interface BoundaryNoData - module procedure new_BoundaryNoData -end interface BoundaryNoData - -interface BoundaryData - module procedure new_BoundaryData -end interface BoundaryData - -interface BoundaryFlux - module procedure new_BoundaryFlux -end interface BoundaryFlux - -! Opaque type to hold a tridiagonal matrix decomposition. -! -! Method used is similar to Richtmyer and Morton (1967,pp 198-201), but -! the order of iteration is reversed, leading to A and C being swapped, and -! some differences in the indexing. -type :: TriDiagDecomp - private - integer :: nsys = 0 - integer :: ncel = 0 - ! These correspond to A_k, E_k, and 1 / (B_k - A_k * E_{k+1}) - real(r8), allocatable :: ca(:,:) - real(r8), allocatable :: ze(:,:) - real(r8), allocatable :: dnom(:,:) -contains - procedure :: left_div => decomp_left_div - procedure :: finalize => decomp_finalize -end type TriDiagDecomp - -interface TriDiagDecomp - module procedure new_TriDiagDecomp -end interface TriDiagDecomp - -contains - -! Operator that sets to 0. -function zero_operator(nsys, ncel) result(op) - ! Sizes for operator. - integer, intent(in) :: nsys, ncel - - type(TriDiagOp) :: op - - op = TriDiagOp(nsys, ncel) - - op%spr = 0._r8 - op%sub = 0._r8 - op%diag = 0._r8 - op%left_bound = 0._r8 - op%right_bound = 0._r8 - -end function zero_operator - -! Operator that does nothing. -function identity_operator(nsys, ncel) result(op) - ! Sizes for operator. - integer, intent(in) :: nsys, ncel - - type(TriDiagOp) :: op - - op = TriDiagOp(nsys, ncel) - - op%spr = 0._r8 - op%sub = 0._r8 - op%diag = 1._r8 - op%left_bound = 0._r8 - op%right_bound = 0._r8 - -end function identity_operator - -! Create an operator that just does an element-wise product by some data. -function diagonal_operator(diag) result(op) - ! Data to multiply by. - real(r8), USE_CONTIGUOUS intent(in) :: diag(:,:) - - type(TriDiagOp) :: op - - op = TriDiagOp(size(diag, 1), size(diag, 2)) - - op%spr = 0._r8 - op%sub = 0._r8 - op%diag = diag - op%left_bound = 0._r8 - op%right_bound = 0._r8 - -end function diagonal_operator - -! Diffusion matrix operator constructor. Given grid coordinates, a set of -! diffusion coefficients, and boundaries, creates a matrix corresponding -! to a finite volume representation of the operation: -! -! d/dx (d_coef * d/dx) -! -! This differs from what you would get from combining the first and second -! derivative operations, which would be more appropriate for a finite -! difference scheme that does not use grid cell averages. -function diffusion_operator(coords, d_coef, l_bndry, r_bndry) & - result(op) - ! Grid cell locations. - type(Coords1D), intent(in) :: coords - ! Diffusion coefficient defined on interfaces. - real(r8), USE_CONTIGUOUS intent(in) :: d_coef(:,:) - ! Objects representing the kind of boundary on each side. - class(BoundaryType), target, intent(in), optional :: l_bndry, r_bndry - ! Output operator. - type(TriDiagOp) :: op - - ! Selectors to implement default boundary. - class(BoundaryType), pointer :: l_bndry_loc, r_bndry_loc - ! Fixed flux is default, no allocation/deallocation needed. - type(BoundaryType), target :: bndry_default - - ! Level index. - integer :: k - - if (present(l_bndry)) then - l_bndry_loc => l_bndry - else - l_bndry_loc => bndry_default - end if - - if (present(r_bndry)) then - r_bndry_loc => r_bndry - else - r_bndry_loc => bndry_default - end if - - ! Allocate the operator. - op = TriDiagOp(coords%n, coords%d) - - ! d_coef over the distance to the next cell gives you the matrix term for - ! flux of material between cells. Dividing by cell thickness translates - ! this to a tendency on the concentration. Hence the basic pattern is - ! d_coef*rdst*rdel. - ! - ! Boundary conditions for a fixed layer simply extend this by calculating - ! the distance to the midpoint of the extra edge layer. - - select case (l_bndry_loc%bndry_type) - case (fixed_layer_bndry) - op%left_bound = 2._r8*d_coef(:,1)*coords%rdel(:,1) / & - (l_bndry_loc%edge_width+coords%del(:,1)) - case default - op%left_bound = 0._r8 - end select - - do k = 1, coords%d-1 - op%spr(:,k) = d_coef(:,k+1)*coords%rdst(:,k)*coords%rdel(:,k) - op%sub(:,k) = d_coef(:,k+1)*coords%rdst(:,k)*coords%rdel(:,k+1) - end do - - select case (r_bndry_loc%bndry_type) - case (fixed_layer_bndry) - op%right_bound = 2._r8*d_coef(:,coords%d+1)*coords%rdel(:,coords%d) / & - (r_bndry_loc%edge_width+coords%del(:,coords%d)) - case default - op%right_bound = 0._r8 - end select - - ! Above, we found all off-diagonals. Now get the diagonal. - call op%deriv_diag() - -end function diffusion_operator - -! Advection matrix operator constructor. Similar to diffusion_operator, it -! constructs an operator A corresponding to: -! -! A y = d/dx (-v_coef * y) -! -! Again, this is targeted at representing this operator acting on grid-cell -! averages in a finite volume scheme, rather than a literal representation. -function advection_operator(coords, v_coef, l_bndry, r_bndry) & - result(op) - ! Grid cell locations. - type(Coords1D), intent(in) :: coords - ! Advection coefficient (effective velocity). - real(r8), USE_CONTIGUOUS intent(in) :: v_coef(:,:) - ! Objects representing the kind of boundary on each side. - class(BoundaryType), target, intent(in), optional :: l_bndry, r_bndry - ! Output operator. - type(TriDiagOp) :: op - - ! Selectors to implement default boundary. - class(BoundaryType), pointer :: l_bndry_loc, r_bndry_loc - ! Fixed flux is default, no allocation/deallocation needed. - type(BoundaryType), target :: bndry_default - - ! Negative derivative of v. - real(r8) :: v_deriv(coords%n,coords%d) - - if (present(l_bndry)) then - l_bndry_loc => l_bndry - else - l_bndry_loc => bndry_default - end if - - if (present(r_bndry)) then - r_bndry_loc => r_bndry - else - r_bndry_loc => bndry_default - end if - - ! Allocate the operator. - op = TriDiagOp(coords%n, coords%d) - - ! Construct the operator in two stages using the product rule. First - ! create (-v * d/dx), then -dv/dx, and add the two. - ! - ! For the first part, we want to interpolate to interfaces (weighted - ! average involving del/2*dst), multiply by -v to get flux, then divide - ! by cell thickness, which gives a concentration tendency: - ! - ! (del/(2*dst))*(-v_coef)/del - ! - ! Simplifying gives -v_coef*rdst*0.5, as seen below. - - select case (l_bndry_loc%bndry_type) - case (fixed_layer_bndry) - op%left_bound = v_coef(:,1) / & - (l_bndry_loc%edge_width+coords%del(:,1)) - case default - op%left_bound = 0._r8 - end select - - op%sub = v_coef(:,2:coords%d)*coords%rdst*0.5_r8 - op%spr = -op%sub - - select case (r_bndry_loc%bndry_type) - case (fixed_layer_bndry) - op%right_bound = v_coef(:,coords%d+1) / & - (r_bndry_loc%edge_width+coords%del(:,coords%d)) - case default - op%right_bound = 0._r8 - end select - - ! Above, we found all off-diagonals. Now get the diagonal. This must be - ! done at this specific point, since the other half of the operator is - ! not "derivative-like" in the sense of yielding 0 for a constant input. - call op%deriv_diag() - - ! The second half of the operator simply involves taking a first-order - ! derivative of v. Since v is on the interfaces, just use: - ! (v(k+1) - v(k))*rdel(k) - v_deriv(:,1) = v_coef(:,2)*coords%rdel(:,1) - - select case (l_bndry_loc%bndry_type) - case (fixed_layer_bndry) - v_deriv(:,1) = v_deriv(:,1) - v_coef(:,1)*coords%rdel(:,1) - end select - - v_deriv(:,2:coords%d-1) = (v_coef(:,3:coords%d) - & - v_coef(:,2:coords%d-1))*coords%rdel(:,2:coords%d-1) - - v_deriv(:,coords%d) = -v_coef(:,coords%d)*coords%rdel(:,coords%d) - - select case (r_bndry_loc%bndry_type) - case (fixed_layer_bndry) - v_deriv(:,coords%d) = v_deriv(:,coords%d) & - + v_coef(:,coords%d+1)*coords%del(:,coords%d) - end select - - ! Combine the two pieces. - op%diag = op%diag - v_deriv - -end function advection_operator - -! Second order approximation to the first and second derivatives on a non- -! uniform grid. -! -! Both operators are constructed with the same method, except for a "seed" -! function that takes local distances between points to create the -! off-diagonal terms. -function first_derivative(grid_spacing, l_bndry, r_bndry) result(op) - ! Distances between points. - real(r8), USE_CONTIGUOUS intent(in) :: grid_spacing(:,:) - ! Boundary conditions. - class(BoundaryType), intent(in), optional :: l_bndry, r_bndry - ! Output operator. - type(TriDiagOp) :: op - - op = deriv_op_from_seed(grid_spacing, first_derivative_seed, & - l_bndry, r_bndry) - -end function first_derivative - -subroutine first_derivative_seed(del_minus, del_plus, sub, spr) - ! Distances to next and previous point. - real(r8), USE_CONTIGUOUS intent(in) :: del_minus(:) - real(r8), USE_CONTIGUOUS intent(in) :: del_plus(:) - ! Off-diagonal matrix terms. - real(r8), USE_CONTIGUOUS intent(out) :: sub(:) - real(r8), USE_CONTIGUOUS intent(out) :: spr(:) - - real(r8) :: del_sum(size(del_plus)) - - del_sum = del_plus + del_minus - - sub = - del_plus / (del_minus*del_sum) - spr = del_minus / (del_plus*del_sum) - -end subroutine first_derivative_seed - -function second_derivative(grid_spacing, l_bndry, r_bndry) result(op) - ! Distances between points. - real(r8), USE_CONTIGUOUS intent(in) :: grid_spacing(:,:) - ! Boundary conditions. - class(BoundaryType), intent(in), optional :: l_bndry, r_bndry - ! Output operator. - type(TriDiagOp) :: op - - op = deriv_op_from_seed(grid_spacing, second_derivative_seed, & - l_bndry, r_bndry) - -end function second_derivative - -subroutine second_derivative_seed(del_minus, del_plus, sub, spr) - ! Distances to next and previous point. - real(r8), USE_CONTIGUOUS intent(in) :: del_minus(:) - real(r8), USE_CONTIGUOUS intent(in) :: del_plus(:) - ! Off-diagonal matrix terms. - real(r8), USE_CONTIGUOUS intent(out) :: sub(:) - real(r8), USE_CONTIGUOUS intent(out) :: spr(:) - - real(r8) :: del_sum(size(del_plus)) - - del_sum = del_plus + del_minus - - sub = 2._r8 / (del_minus*del_sum) - spr = 2._r8 / (del_plus*del_sum) - -end subroutine second_derivative_seed - -! Brains behind the first/second derivative functions. -function deriv_op_from_seed(grid_spacing, seed, l_bndry, r_bndry) result(op) - ! Distances between points. - real(r8), USE_CONTIGUOUS intent(in) :: grid_spacing(:,:) - ! Function to locally construct matrix elements. - procedure(deriv_seed) :: seed - ! Boundary conditions. - class(BoundaryType), target, intent(in), optional :: l_bndry, r_bndry - ! Output operator. - type(TriDiagOp) :: op - - ! Selectors to implement default boundary. - class(BoundaryType), pointer :: l_bndry_loc, r_bndry_loc - ! Fixed flux is default, no allocation/deallocation needed. - type(BoundaryType), target :: bndry_default - - integer :: k - - if (present(l_bndry)) then - l_bndry_loc => l_bndry - else - l_bndry_loc => bndry_default - end if - - if (present(r_bndry)) then - r_bndry_loc => r_bndry - else - r_bndry_loc => bndry_default - end if - - ! Number of grid points is one greater than the spacing. - op = TriDiagOp(size(grid_spacing, 1), size(grid_spacing, 2) + 1) - - ! Left boundary condition. - call l_bndry_loc%make_left(grid_spacing, seed, & - op%left_bound, op%spr(:,1)) - - do k = 2, op%ncel-1 - call seed(grid_spacing(:,k-1), grid_spacing(:,k), & - op%sub(:,k-1), op%spr(:,k)) - end do - - ! Right boundary condition. - call r_bndry_loc%make_right(grid_spacing, seed, & - op%sub(:,op%ncel-1), op%right_bound) - - ! Above, we found all off-diagonals. Now get the diagonal. - call op%deriv_diag() - -end function deriv_op_from_seed - -! Boundary constructors. Most simply set an internal flag, but -! BoundaryFixedLayer accepts an argument representing the distance to the -! location where the extra layer is defined. - -function new_BoundaryZero() result(new_bndry) - type(BoundaryType) :: new_bndry - - new_bndry%bndry_type = zero_bndry - -end function new_BoundaryZero - -function new_BoundaryFirstOrder() result(new_bndry) - type(BoundaryType) :: new_bndry - - new_bndry%bndry_type = first_order_bndry - -end function new_BoundaryFirstOrder - -function new_BoundaryExtrapolate() result(new_bndry) - type(BoundaryType) :: new_bndry - - new_bndry%bndry_type = extrapolate_bndry - -end function new_BoundaryExtrapolate - -function new_BoundaryFixedLayer(width) result(new_bndry) - real(r8), USE_CONTIGUOUS intent(in) :: width(:) - type(BoundaryType) :: new_bndry - - new_bndry%bndry_type = fixed_layer_bndry - new_bndry%edge_width = width - -end function new_BoundaryFixedLayer - -function new_BoundaryFixedFlux() result(new_bndry) - type(BoundaryType) :: new_bndry - - new_bndry%bndry_type = fixed_flux_bndry - -end function new_BoundaryFixedFlux - -! The make_left and make_right methods implement the boundary conditions -! using an input seed. - -subroutine make_left(self, grid_spacing, seed, term1, term2) - class(BoundaryType), intent(in) :: self - real(r8), USE_CONTIGUOUS intent(in) :: grid_spacing(:,:) - procedure(deriv_seed) :: seed - real(r8), USE_CONTIGUOUS intent(out) :: term1(:) - real(r8), USE_CONTIGUOUS intent(out) :: term2(:) - - real(r8) :: del_plus(size(term1)), del_minus(size(term1)) - - select case (self%bndry_type) - case (zero_bndry) - term1 = 0._r8 - term2 = 0._r8 - case (first_order_bndry) - ! To calculate to first order, just use a really huge del_minus (i.e. - ! pretend that there's a point so far away it doesn't matter). - del_plus = grid_spacing(:,1) - del_minus = del_plus * 4._r8 / epsilon(1._r8) - call seed(del_minus, del_plus, term1, term2) - case (extrapolate_bndry) - ! To extrapolate from the boundary, use distance from the nearest - ! neighbor (as usual) and the second nearest neighbor (with a negative - ! sign, since we are using two points on the same side). - del_plus = grid_spacing(:,1) - del_minus = - (grid_spacing(:,1) + grid_spacing(:,2)) - call seed(del_minus, del_plus, term1, term2) - case (fixed_layer_bndry) - ! Use edge value to extend the grid. - del_plus = grid_spacing(:,1) - del_minus = self%edge_width - call seed(del_minus, del_plus, term1, term2) - case (fixed_flux_bndry) - ! Treat grid as uniform, but then zero out the contribution from data - ! on one side (since it will be prescribed). - del_plus = grid_spacing(:,1) - del_minus = del_plus - call seed(del_minus, del_plus, term1, term2) - term1 = 0._r8 - case default - call shr_sys_abort("Invalid boundary type at "// & - errMsg(__FILE__, __LINE__)) - end select - -end subroutine make_left - -subroutine make_right(self, grid_spacing, seed, term1, term2) - class(BoundaryType), intent(in) :: self - real(r8), USE_CONTIGUOUS intent(in) :: grid_spacing(:,:) - procedure(deriv_seed) :: seed - real(r8), USE_CONTIGUOUS intent(out) :: term1(:) - real(r8), USE_CONTIGUOUS intent(out) :: term2(:) - - real(r8) :: del_plus(size(term1)), del_minus(size(term1)) - - select case (self%bndry_type) - case (zero_bndry) - term1 = 0._r8 - term2 = 0._r8 - case (first_order_bndry) - ! Use huge del_plus, analogous to how left boundary works. - del_minus = grid_spacing(:,size(grid_spacing, 2)) - del_plus = del_minus * 4._r8 / epsilon(1._r8) - call seed(del_minus, del_plus, term1, term2) - case (extrapolate_bndry) - ! Same strategy as left boundary, but reversed. - del_plus = - (grid_spacing(:,size(grid_spacing, 2) - 1) + & - grid_spacing(:,size(grid_spacing, 2))) - del_minus = grid_spacing(:,size(grid_spacing, 2)) - call seed(del_minus, del_plus, term1, term2) - case (fixed_layer_bndry) - ! Use edge value to extend the grid. - del_plus = self%edge_width - del_minus = grid_spacing(:,size(grid_spacing, 2)) - call seed(del_minus, del_plus, term1, term2) - case (fixed_flux_bndry) - ! Uniform grid, but with edge zeroed. - del_plus = grid_spacing(:,size(grid_spacing, 2)) - del_minus = del_plus - call seed(del_minus, del_plus, term1, term2) - term2 = 0._r8 - case default - call shr_sys_abort("Invalid boundary type at "// & - errMsg(__FILE__, __LINE__)) - end select - -end subroutine make_right - -subroutine boundary_type_finalize(self) - class(BoundaryType), intent(inout) :: self - - self%bndry_type = fixed_flux_bndry - if (allocated(self%edge_width)) deallocate(self%edge_width) - -end subroutine boundary_type_finalize - -! Constructor for TriDiagOp; this just sets the size and allocates -! arrays. -type(TriDiagOp) function new_TriDiagOp(nsys, ncel) - - integer, intent(in) :: nsys, ncel - - new_TriDiagOp%nsys = nsys - new_TriDiagOp%ncel = ncel - - allocate(new_TriDiagOp%spr(nsys,ncel-1), & - new_TriDiagOp%sub(nsys,ncel-1), & - new_TriDiagOp%diag(nsys,ncel), & - new_TriDiagOp%left_bound(nsys), & - new_TriDiagOp%right_bound(nsys)) - -end function new_TriDiagOp - -! Deallocator for TriDiagOp. -subroutine tridiag_finalize(self) - class(TriDiagOp), intent(inout) :: self - - self%nsys = 0 - self%ncel = 0 - - if (allocated(self%spr)) deallocate(self%spr) - if (allocated(self%sub)) deallocate(self%sub) - if (allocated(self%diag)) deallocate(self%diag) - if (allocated(self%left_bound)) deallocate(self%left_bound) - if (allocated(self%right_bound)) deallocate(self%right_bound) - -end subroutine tridiag_finalize - -! Boundary condition constructors. - -function new_BoundaryNoData() result(new_cond) - type(BoundaryCond) :: new_cond - - new_cond%cond_type = no_data_cond - ! No edge data, so leave it unallocated. - -end function new_BoundaryNoData - -function new_BoundaryData(data) result(new_cond) - real(r8), USE_CONTIGUOUS intent(in) :: data(:) - type(BoundaryCond) :: new_cond - - new_cond%cond_type = data_cond - new_cond%edge_data = data - -end function new_BoundaryData - -function new_BoundaryFlux(flux, dt, spacing) result(new_cond) - real(r8), USE_CONTIGUOUS intent(in) :: flux(:) - real(r8), intent(in) :: dt - real(r8), USE_CONTIGUOUS intent(in) :: spacing(:) - type(BoundaryCond) :: new_cond - - new_cond%cond_type = flux_cond - new_cond%edge_data = flux*dt/spacing - -end function new_BoundaryFlux - -! Application of input data. -! -! When no data is input, assume that any bound term is applied to the -! third element in from the edge for extrapolation. Boundary conditions -! that don't need any edge data at all can then simply set the boundary -! terms to 0. - -function apply_left(self, bound_term, array) result(delta_edge) - class(BoundaryCond), intent(in) :: self - real(r8), USE_CONTIGUOUS intent(in) :: bound_term(:) - real(r8), USE_CONTIGUOUS intent(in) :: array(:,:) - real(r8) :: delta_edge(size(array, 1)) - - select case (self%cond_type) - case (no_data_cond) - delta_edge = bound_term*array(:,3) - case (data_cond) - delta_edge = bound_term*self%edge_data - case (flux_cond) - delta_edge = self%edge_data - case default - call shr_sys_abort("Invalid boundary condition at "// & - errMsg(__FILE__, __LINE__)) - end select - -end function apply_left - -function apply_right(self, bound_term, array) result(delta_edge) - class(BoundaryCond), intent(in) :: self - real(r8), USE_CONTIGUOUS intent(in) :: bound_term(:) - real(r8), USE_CONTIGUOUS intent(in) :: array(:,:) - real(r8) :: delta_edge(size(array, 1)) - - select case (self%cond_type) - case (no_data_cond) - delta_edge = bound_term*array(:,size(array, 2)-2) - case (data_cond) - delta_edge = bound_term*self%edge_data - case (flux_cond) - delta_edge = self%edge_data - case default - call shr_sys_abort("Invalid boundary condition at "// & - errMsg(__FILE__, __LINE__)) - end select - -end function apply_right - -subroutine boundary_cond_finalize(self) - class(BoundaryCond), intent(inout) :: self - - self%cond_type = no_data_cond - if (allocated(self%edge_data)) deallocate(self%edge_data) - -end subroutine boundary_cond_finalize - -! Apply an operator and return the new data. -function apply_tridiag(self, array, l_cond, r_cond) result(output) - ! Operator to apply. - class(TriDiagOp), intent(in) :: self - ! Data to act on. - real(r8), USE_CONTIGUOUS intent(in) :: array(:,:) - ! Objects representing boundary conditions. - class(BoundaryCond), target, intent(in), optional :: l_cond, r_cond - ! Function result. - real(r8) :: output(size(array, 1), size(array, 2)) - - ! Local objects to implement default. - class(BoundaryCond), pointer :: l_cond_loc, r_cond_loc - ! Default state is no data, no allocation/deallocation needed. - type(BoundaryCond), target :: cond_default - - ! Level index. - integer :: k - - if (present(l_cond)) then - l_cond_loc => l_cond - else - l_cond_loc => cond_default - end if - - if (present(r_cond)) then - r_cond_loc => r_cond - else - r_cond_loc => cond_default - end if - - ! Left boundary. - output(:,1) = self%diag(:,1)*array(:,1) + & - self%spr(:,1)*array(:,2) + & - l_cond_loc%apply_left(self%left_bound, array) - - do k = 2, self%ncel-1 - output(:,k) = & - self%sub(:,k-1)*array(:,k-1) + & - self%diag(:,k)*array(:,k ) + & - self%spr(:,k)*array(:,k+1) - end do - - ! Right boundary. - output(:,self%ncel) = & - self%sub(:,self%ncel-1)*array(:,self%ncel-1) + & - self%diag(:,self%ncel)*array(:,self%ncel) + & - r_cond_loc%apply_right(self%right_bound, array) - -end function apply_tridiag - -! Fill in the diagonal for a TriDiagOp for a derivative operator, where -! the off diagonal elements are already filled in. -subroutine make_tridiag_deriv_diag(self) - - class(TriDiagOp), intent(inout) :: self - - ! If a derivative operator operates on a constant function, it must - ! return 0 everywhere. To force this, make sure that all rows add to - ! zero in the matrix. - self%diag(:,:self%ncel-1) = - self%spr - self%diag(:,self%ncel) = - self%right_bound - self%diag(:,1) = self%diag(:,1) - self%left_bound - self%diag(:,2:) = self%diag(:,2:) - self%sub - -end subroutine make_tridiag_deriv_diag - -! Sum two TriDiagOp objects into a new one; this is just the addition of -! all the entries. -function add_tridiag_ops(op1, op2) result(new_op) - - type(TriDiagOp), intent(in) :: op1, op2 - type(TriDiagOp) :: new_op - - new_op = op1 - - call new_op%add(op2) - -end function add_tridiag_ops - -subroutine add_in_place_tridiag_ops(self, other) - - class(TriDiagOp), intent(inout) :: self - class(TriDiagOp), intent(in) :: other - - self%spr = self%spr + other%spr - self%sub = self%sub + other%sub - self%diag = self%diag + other%diag - - self%left_bound = self%left_bound + other%left_bound - self%right_bound = self%right_bound + other%right_bound - -end subroutine add_in_place_tridiag_ops - -! Subtract two TriDiagOp objects. -function subtract_tridiag_ops(op1, op2) result(new_op) - - type(TriDiagOp), intent(in) :: op1, op2 - type(TriDiagOp) :: new_op - - new_op = op1 - - call new_op%subtract(op2) - -end function subtract_tridiag_ops - -! Subtract two TriDiagOp objects. -subroutine subtract_in_place_tridiag_ops(self, other) - - class(TriDiagOp), intent(inout) :: self - class(TriDiagOp), intent(in) :: other - - self%spr = self%spr - other%spr - self%sub = self%sub - other%sub - self%diag = self%diag - other%diag - - self%left_bound = self%left_bound - other%left_bound - self%right_bound = self%right_bound - other%right_bound - -end subroutine subtract_in_place_tridiag_ops - -! Equivalent to adding a multiple of the identity. -subroutine scalar_add_tridiag(self, constant) - - class(TriDiagOp), intent(inout) :: self - real(r8), intent(in) :: constant - - self%diag = self%diag + constant - -end subroutine scalar_add_tridiag - -! Equivalent to adding the diagonal operator constructed from diag_array. -subroutine diagonal_add_tridiag(self, diag_array) - - class(TriDiagOp), intent(inout) :: self - real(r8), USE_CONTIGUOUS intent(in) :: diag_array(:,:) - - self%diag = self%diag + diag_array - -end subroutine diagonal_add_tridiag - -! Multiply a scalar by an array. -subroutine scalar_lmult_tridiag(self, constant) - - class(TriDiagOp), intent(inout) :: self - real(r8), intent(in) :: constant - - self%spr = self%spr * constant - self%sub = self%sub * constant - self%diag = self%diag * constant - - self%left_bound = self%left_bound * constant - self%right_bound = self%right_bound * constant - -end subroutine scalar_lmult_tridiag - -! Multiply in an array as if it contained the entries of a diagonal matrix -! being multiplied from the left. -subroutine diagonal_lmult_tridiag(self, diag_array) - - class(TriDiagOp), intent(inout) :: self - real(r8), USE_CONTIGUOUS intent(in) :: diag_array(:,:) - - self%spr = self%spr * diag_array(:,:self%ncel-1) - self%sub = self%sub * diag_array(:,2:) - self%diag = self%diag * diag_array(:,:) - - self%left_bound = self%left_bound * diag_array(:,1) - self%right_bound = self%right_bound * diag_array(:,self%ncel) - -end subroutine diagonal_lmult_tridiag - -! Decomposition constructor -! -! The equation to be solved later (with left_div) is: -! - A(k)*q(k+1) + B(k)*q(k) - C(k)*q(k-1) = D(k) -! -! The solution (effectively via LU decomposition) has the form: -! E(k) = C(k) / (B(k) - A(k)*E(k+1)) -! F(k) = (D(k) + A(k)*F(k+1)) / (B(k) - A(k)*E(k+1)) -! q(k) = E(k) * q(k-1) + F(k) -! -! Unlike Richtmyer and Morton, E and F are defined by iterating backward -! down to level 1, and then q iterates forward. -! -! E can be calculated and stored now, without knowing D. -! To calculate F later, we store A and the denominator. -function new_TriDiagDecomp(op, graft_decomp) result(decomp) - type(TriDiagOp), intent(in) :: op - type(TriDiagDecomp), intent(in), optional :: graft_decomp - - type(TriDiagDecomp) :: decomp - - integer :: k - - if (present(graft_decomp)) then - decomp%nsys = graft_decomp%nsys - decomp%ncel = graft_decomp%ncel - else - decomp%nsys = op%nsys - decomp%ncel = op%ncel - end if - - ! Simple allocation with no error checking. - allocate(decomp%ca(decomp%nsys,decomp%ncel)) - allocate(decomp%dnom(decomp%nsys,decomp%ncel)) - allocate(decomp%ze(decomp%nsys,decomp%ncel)) - - ! decomp%ca is simply the negative of the tridiagonal's superdiagonal. - decomp%ca(:,:op%ncel-1) = -op%spr - decomp%ca(:,op%ncel) = -op%right_bound - - if (present(graft_decomp)) then - ! Copy in graft_decomp beyond op%ncel. - decomp%ca(:,op%ncel+1:) = graft_decomp%ca(:,op%ncel+1:) - decomp%dnom(:,op%ncel+1:) = graft_decomp%dnom(:,op%ncel+1:) - decomp%ze(:,op%ncel+1:) = graft_decomp%ze(:,op%ncel+1:) - ! Fill in dnom edge value. - decomp%dnom(:,op%ncel) = 1._r8 / (op%diag(:,op%ncel) - & - decomp%ca(:,op%ncel)*decomp%ze(:,op%ncel+1)) - else - ! If no grafting, the edge value of dnom comes from the diagonal. - decomp%dnom(:,op%ncel) = 1._r8 / op%diag(:,op%ncel) - end if - - do k = op%ncel - 1, 1, -1 - decomp%ze(:,k+1) = - op%sub(:,k) * decomp%dnom(:,k+1) - decomp%dnom(:,k) = 1._r8 / & - (op%diag(:,k) - decomp%ca(:,k)*decomp%ze(:,k+1)) - end do - - ! Don't multiply edge level by denom, because we want to leave it up to - ! the BoundaryCond object to decide what this means in left_div. - decomp%ze(:,1) = -op%left_bound - -end function new_TriDiagDecomp - -! Left-division (multiplication by inverse) using a decomposed operator. -! -! See the comment above for the constructor for a quick explanation of the -! intermediate variables. The "q" argument is "D(k)" on input and "q(k)" on -! output. -subroutine decomp_left_div(decomp, q, l_cond, r_cond) - - ! Decomposed matrix. - class(TriDiagDecomp), intent(in) :: decomp - ! Data to left-divide by the matrix. - real(r8), USE_CONTIGUOUS intent(inout) :: q(:,:) - ! Objects representing boundary conditions. - class(BoundaryCond), intent(in), optional :: l_cond, r_cond - - ! "F" from the equation above. - real(r8) :: zf(decomp%nsys,decomp%ncel) - - ! Level index. - integer :: k - - ! Include boundary conditions. - if (present(l_cond)) then - q(:,1) = q(:,1) + l_cond%apply_left(decomp%ze(:,1), q) - end if - - if (present(r_cond)) then - q(:,decomp%ncel) = q(:,decomp%ncel) + & - r_cond%apply_right(decomp%ca(:,decomp%ncel), q) - end if - - zf(:,decomp%ncel) = q(:,decomp%ncel) * decomp%dnom(:,decomp%ncel) - - do k = decomp%ncel - 1, 1, -1 - zf(:,k) = (q(:,k) + decomp%ca(:,k)*zf(:,k+1)) * decomp%dnom(:,k) - end do - - ! Perform back substitution - - q(:,1) = zf(:,1) - - do k = 2, decomp%ncel - q(:,k) = zf(:,k) + decomp%ze(:,k)*q(:,k-1) - end do - -end subroutine decomp_left_div - -! Decomposition deallocation. -subroutine decomp_finalize(decomp) - class(TriDiagDecomp), intent(inout) :: decomp - - decomp%nsys = 0 - decomp%ncel = 0 - - if (allocated(decomp%ca)) deallocate(decomp%ca) - if (allocated(decomp%dnom)) deallocate(decomp%dnom) - if (allocated(decomp%ze)) deallocate(decomp%ze) - -end subroutine decomp_finalize - -end module linear_1d_operators From 836d5d866ece200ec1df751f1301245b1f9d184f Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:37:07 -0600 Subject: [PATCH 07/29] Updating build path for non-ccppized modules. --- bld/configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bld/configure b/bld/configure index 707fe16e74..3293305aa3 100755 --- a/bld/configure +++ b/bld/configure @@ -2330,6 +2330,8 @@ sub write_filepath # be overridden by modules from directories that occur earlier # in the list of filepaths. print $fh "$camsrcdir/src/physics/cam\n"; + print $fh "$camsrcdir/src/atmos_phys/to_be_ccppized/utilities\n"; + print $fh "$camsrcdir/src/atmos_phys/to_be_ccppized/physics/cam\n"; #Add the CCPP'ized subdirectories print $fh "$camsrcdir/src/atmos_phys/zhang_mcfarlane\n"; From 37b4ee10b9437dc40681b87312d5df4aca5dbb94 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:40:15 -0600 Subject: [PATCH 08/29] Updating atmos_phys ref. --- .gitmodules | 6 +++--- src/atmos_phys | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index b74aac6f02..fba4df3d37 100644 --- a/.gitmodules +++ b/.gitmodules @@ -35,10 +35,10 @@ [submodule "atmos_phys"] path = src/atmos_phys - url = https://github.com/ESCOMP/atmospheric_physics - fxtag = atmos_phys0_04_001 + url = https://github.com/mwaxmonsky/atmospheric_physics + fxtag = 8b1bd8676e3c7b8fb7547b4df1270320d74f6aab fxrequired = AlwaysRequired - fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics + fxDONOTUSEurl = https://github.com/mwaxmonsky/atmospheric_physics [submodule "fv3"] path = src/dynamics/fv3 diff --git a/src/atmos_phys b/src/atmos_phys index d9d0e5d9bf..8b1bd8676e 160000 --- a/src/atmos_phys +++ b/src/atmos_phys @@ -1 +1 @@ -Subproject commit d9d0e5d9bf96e5386ccb264bf123f8007db5821d +Subproject commit 8b1bd8676e3c7b8fb7547b4df1270320d74f6aab From 46ebe286dd5a6f40ef2819279c4c3c5e941ba0b8 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:41:52 -0600 Subject: [PATCH 09/29] Undoing changes not needed. --- src/physics/cam/eddy_diff_cam.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/physics/cam/eddy_diff_cam.F90 b/src/physics/cam/eddy_diff_cam.F90 index b7055f323d..1742bf5038 100644 --- a/src/physics/cam/eddy_diff_cam.F90 +++ b/src/physics/cam/eddy_diff_cam.F90 @@ -801,8 +801,8 @@ subroutine compute_eddy_diff( pbuf, lchnk , zero , fieldlist_wet, fieldlist_molec, & ufd , vfd , qtfd , slfd , & jnk1d , jnk1d , jnk2d , jnk1d , errstring , & - tauresx , tauresy , 0 , cpairv(:,:,lchnk), zero, & - .false., .false.) + tauresx , tauresy , 0 , cpairv(:,:,lchnk), zero, & + .false., .false. ) call handle_errmsg(errstring, subname="compute_vdiff", & extra_msg="compute_vdiff called from eddy_diff_cam") From 538065c95652e30812b9d37ec6e1c10cd1ccea70 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:48:16 -0600 Subject: [PATCH 10/29] Removing reference to new decomp and using solver from atmos_phys. --- src/physics/cam/diffusion_solver.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index 263fdc946d..8ad7ef7809 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -160,7 +160,7 @@ subroutine compute_vdiff( lchnk , use coords_1d, only: Coords1D use linear_1d_operators, only : BoundaryType, BoundaryFixedLayer, & BoundaryData, BoundaryFlux, TriDiagDecomp - use new_decomp, only : fin_vol_solve + use vertical_diffusion_solver, only : fin_vol_solve use beljaars_drag_cam, only : do_beljaars ! FIXME: This should not be needed use air_composition, only: rairv From fe8a469b55d9d4eca90a597ede8f5bde07153716 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:53:46 -0600 Subject: [PATCH 11/29] Removing commented out code and new solver source file moved to atmos_phys. --- src/physics/cam/diffusion_solver.F90 | 41 +--- src/physics/cam/new_decomp.f90 | 321 --------------------------- 2 files changed, 2 insertions(+), 360 deletions(-) delete mode 100644 src/physics/cam/new_decomp.f90 diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index 8ad7ef7809..e418e32631 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -160,13 +160,13 @@ subroutine compute_vdiff( lchnk , use coords_1d, only: Coords1D use linear_1d_operators, only : BoundaryType, BoundaryFixedLayer, & BoundaryData, BoundaryFlux, TriDiagDecomp - use vertical_diffusion_solver, only : fin_vol_solve + use vdiff_lu_solver, only : fin_vol_lu_decomp + use vertical_diffusion_solver, only : fin_vol_solve use beljaars_drag_cam, only : do_beljaars ! FIXME: This should not be needed use air_composition, only: rairv use phys_control, only : phys_getopts - use vdiff_lu_solver, only : fin_vol_lu_decomp ! Modification : Ideally, we should diffuse 'liquid-ice static energy' (sl), not the dry static energy. ! Also, vertical diffusion of cloud droplet number concentration and aerosol number @@ -309,10 +309,6 @@ end function vd_lu_qdecomp integer :: i, k, m ! Longitude, level, constituent indices logical :: lqtst(pcols) ! Adjust vertical profiles - real(r8) :: ddse(ncol,pver) ! Change in dry static energy [ J/kg ] - real(r8) :: dttemp(ncol,pver) ! change in temporary temperature array - real(r8) :: du(pcols,pver) ! change in wind - real(r8) :: dv(pcols,pver) ! change in wind ! LU decomposition information. type(TriDiagDecomp) :: decomp @@ -575,30 +571,13 @@ end function vd_lu_qdecomp tau_damp_rate(:,k) = tau_damp_rate(:,k) + dragblj(:ncol,k) end do - !du = 0._r8 - !dv = 0._r8 - !du(:ncol,:) = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & - ! coef_q=tau_damp_rate, & - ! coef_q_diff=kvm(:ncol,:)*dpidz_sq) v(:ncol,:) = fin_vol_solve(ztodt, p, v(:ncol,:), ncol, pver, & coef_q=tau_damp_rate, & coef_q_diff=kvm(:ncol,:)*dpidz_sq) - !u(:ncol,:) = u(:ncol,:) + du(:ncol,:) - !v(:ncol,:) = v(:ncol,:) + dv(:ncol,:) - - !decomp = fin_vol_lu_decomp(ztodt, p, & - ! coef_q=tau_damp_rate, coef_q_diff=kvm(:ncol,:)*dpidz_sq) - - !call decomp%left_div(u(:ncol,:)) - !call decomp%left_div(v(:ncol,:)) - !call decomp%finalize() - - !du = 0._r8 u(:ncol,:) = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & coef_q=tau_damp_rate, & coef_q_diff=kvm(:ncol,:)*dpidz_sq) - !u(:ncol,:) = u(:ncol,:) + du(:ncol,:) @@ -790,10 +769,6 @@ end function vd_lu_qdecomp topflx(:ncol) = - kvh(:ncol,1) * tmpi2(:ncol,1) / (ztodt*gravit) * & ( dse(:ncol,1) - dse_top(:ncol) ) - ! decomp = fin_vol_lu_decomp(ztodt, p, & - ! coef_q_diff=kvt(:ncol,:)*dpidz_sq, & - ! coef_q_weight=cpairv(:ncol,:)) - ttemp0 = t(:ncol,:) ttemp = ttemp0 @@ -802,11 +777,8 @@ end function vd_lu_qdecomp ttemp = fin_vol_solve(ztodt, p, ttemp, ncol, pver, & coef_q_diff=kvt(:ncol,:)*dpidz_sq, & coef_q_weight=cpairv(:ncol,:)) - !ttemp = ttemp + dttemp - ! call decomp%left_div(ttemp) end if - ! call decomp%finalize() !------------------------------------- ! Update dry static energy @@ -824,10 +796,6 @@ end function vd_lu_qdecomp kv_total(:ncol,:) = kvh(:ncol,:) end if - ! decomp = fin_vol_lu_decomp(ztodt, p, & - ! coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & - ! upper_bndry=interface_boundary) - ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. if (.not. use_spcam) then @@ -835,13 +803,8 @@ end function vd_lu_qdecomp coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & upper_bndry=interface_boundary, & l_cond=BoundaryData(dse_top(:ncol))) - !dse(:ncol,:) = dse(:ncol,:) + ddse - ! call decomp%left_div(dse(:ncol,:), & - ! l_cond=BoundaryData(dse_top(:ncol))) end if - ! call decomp%finalize() - ! Calculate flux at top interface ! Modification : Why molecular diffusion does not work for dry static energy in all layers ? diff --git a/src/physics/cam/new_decomp.f90 b/src/physics/cam/new_decomp.f90 deleted file mode 100644 index 1418e46acc..0000000000 --- a/src/physics/cam/new_decomp.f90 +++ /dev/null @@ -1,321 +0,0 @@ -module new_decomp - -implicit none -private -save - -public :: fin_vol_solve -public :: vd_lu_solve - -contains - -function vd_lu_solve( & - pcols , pver , ncol ,u, fixed_ubc , cnst_fixed_ubflx, mw, & - kv , kq_scal, mw_facm , dpidz_sq , p, & - interface_boundary, molec_boundary, & - tint , ztodt , nbot_molec , & - lchnk , t, alphath, waccmx_mode, ubc_mmr, ubc_flux) & - result(du) - - use coords_1d, only: Coords1D - use linear_1d_operators, only: BoundaryType, & - TriDiagDecomp, & - BoundaryData, & - BoundaryFlux - use vdiff_lu_solver, only: fin_vol_lu_decomp - use shr_kind_mod, only: r8 => shr_kind_r8 - use air_composition, only: mbarv - use physconst, only: mwdry, gravit - - integer, intent(in) :: pcols - integer, intent(in) :: pver - integer, intent(in) :: ncol ! Number of atmospheric columns - integer, intent(in) :: u(pcols, pver) - integer, intent(in) :: nbot_molec - - logical, intent(in) :: fixed_ubc ! Fixed upper boundary condition flag - logical, intent(in) :: cnst_fixed_ubflx - real(r8), intent(in) :: kv(pcols,pver+1) ! Eddy diffusivity - real(r8), intent(in) :: kq_scal(pcols,pver+1) ! Molecular diffusivity ( kq_fac*sqrt(T)*m_d/rho ) - real(r8), intent(in) :: mw ! Molecular weight for this constituent - real(r8), intent(in) :: mw_facm(pcols,pver+1) ! composition dependent sqrt(1/M_q + 1/M_d) for this constituent - real(r8), intent(in) :: dpidz_sq(ncol,pver+1) ! (g*rho)**2 (square of vertical derivative of pint) - type(Coords1D), intent(in) :: p ! Pressure coordinates - type(BoundaryType), intent(in) :: interface_boundary ! Boundary on grid edge. - type(BoundaryType), intent(in) :: molec_boundary ! Boundary at edge of molec_diff region. - real(r8), intent(in) :: tint(pcols,pver+1) ! Interface temperature [ K ] - real(r8), intent(in) :: ztodt ! 2 delta-t [ s ] - - integer, intent(in) :: lchnk ! Chunk number - real(r8), intent(in) :: t(pcols,pver) ! temperature - logical, intent(in), optional :: waccmx_mode ! running waccmx - real(r8), intent(in), optional :: alphath - real(r8), intent(in), optional :: ubc_mmr(pcols) ! Upper boundary mixing ratios [ kg/kg ] - real(r8), intent(in), optional :: ubc_flux(pcols)! Upper boundary flux [ kg/s/m^2 ] - - real(r8) :: du(pcols, pver) - - ! LU decomposition information for solver. - type(TriDiagDecomp) :: decomp - - ! --------------- ! - ! Local Variables ! - ! --------------- ! - - ! Level index. - integer :: k - - ! Molecular diffusivity for constituent. - real(r8) :: kmq(ncol,nbot_molec+1) - - ! Term for drift due to molecular separation: (m_i/m - 1) / p - real(r8) :: mw_term(ncol,nbot_molec+1) - - ! Diffusion coefficient. - real(r8) :: diff_coef(ncol,nbot_molec+1) - ! Advection velocity. - real(r8) :: advect_v(ncol,nbot_molec+1) - - ! 1/mbar * d(mbar)/dp - real(r8) :: gradm(ncol,nbot_molec+1) - - ! alphaTh/T * dT/dp, for now alphaTh is non-zero only for H. - real(r8) :: gradt(ncol,nbot_molec+1) - - ! mbarv at interface - real(r8) :: mbarvi(ncol) - - ! ----------------------- ! - ! Main Computation Begins ! - ! ----------------------- ! - - ! --------------------------------------------------------------------- ! - ! Determine superdiagonal (ca(k)) and subdiagonal (cc(k)) coeffs of the ! - ! tridiagonal diffusion matrix. The diagonal elements (cb=1+ca+cc) are ! - ! a combination of ca and cc; they are not required by the solver. ! - !---------------------------------------------------------------------- ! - - kmq = 0._r8 - mw_term = 0._r8 - gradm = 0._r8 - gradt = 0._r8 - - ! Compute difference between scale heights of constituent and dry air - - if ( waccmx_mode ) then - - ! Top level first. - k = 1 - mbarvi = .75_r8*mbarv(:ncol,k,lchnk)+0.5_r8*mbarv(:ncol,k+1,lchnk) & - -.25_r8*mbarv(:ncol,k+2,lchnk) - mw_term(:,k) = (mw/mbarvi - 1._r8) / p%ifc(:,k) - gradm(:,k) = (mbarv(:ncol,k,lchnk)-mbarvi)/ & - (p%mid(:,k)-p%ifc(:,k))/ & - (mbarv(:ncol,k,lchnk)+mbarvi)*2._r8 - - if (alphath /= 0._r8) then - gradt(:,k) = alphath*(t(:ncol,k)-tint(:ncol,k))/ & - (p%mid(:ncol,k)-p%ifc(:ncol,k))/ & - (t(:ncol,k)+tint(:ncol,k))*2._r8 - end if - - ! Interior of molecular diffusion region. - do k = 2, nbot_molec - mbarvi = 0.5_r8 * (mbarv(:ncol,k-1,lchnk)+mbarv(:ncol,k,lchnk)) - mw_term(:,k) = (mw/mbarvi - 1._r8) / p%ifc(:,k) - gradm(:,k) = (mbarv(:ncol,k,lchnk)-mbarv(:ncol,k-1,lchnk)) * & - p%rdst(:,k-1)/mbarvi - enddo - - if (alphath /= 0._r8) then - do k = 2, nbot_molec - gradt(:,k) = alphath*(t(:ncol,k)-t(:ncol,k-1)) & - *p%rdst(:,k-1)/tint(:ncol,k) - end do - end if - - ! Leave nbot_molec+1 terms as zero, because molecular diffusion is - ! small at the lower boundary. - - else - - do k = 1, nbot_molec - mw_term(:,k) = (mw/mwdry - 1._r8) / p%ifc(:ncol,k) - enddo - - endif - - !-------------------- ! - ! Molecular diffusion ! - !-------------------- ! - - ! Start with non-molecular portion of diffusion. - - ! Molecular diffusion coefficient. - do k = 1, nbot_molec - kmq(:,k) = kq_scal(:ncol,k) * mw_facm(:ncol,k) - end do - - diff_coef = kv(:ncol,:nbot_molec+1) + kmq - - ! "Drift" terms. - advect_v = kmq*mw_term - if ( waccmx_mode ) then - advect_v = advect_v - kmq*gradt - & - (kv(:ncol,:nbot_molec+1) + kmq)*gradm - end if - - ! Convert from z to pressure representation. - diff_coef = dpidz_sq(:,:nbot_molec+1) * diff_coef - advect_v = dpidz_sq(:,:nbot_molec+1) * advect_v - - if( fixed_ubc ) then - decomp = fin_vol_lu_decomp(ztodt, p, & - coef_q_diff=diff_coef, coef_q_adv=advect_v, & - upper_bndry=interface_boundary, & - lower_bndry=molec_boundary) - else - decomp = fin_vol_lu_decomp(ztodt, p, & - coef_q_diff=diff_coef, coef_q_adv=advect_v, & - lower_bndry=molec_boundary) - end if - - du = u - if (cnst_fixed_ubflx) then - call decomp%left_div(du(:ncol,:), & - l_cond=BoundaryFlux( & - -gravit*ubc_flux(:ncol), ztodt, & - p%del(:,1))) - else - call decomp%left_div(du(:ncol,:), & - l_cond=BoundaryData(ubc_mmr(:ncol))) - end if - du = du - u - -end function vd_lu_solve - -! Designed to solve the equation: -! -! w * dq/dt = d/dp (D q' - v q) + c q -! -! where q is a grid-cell average, and p is the vertical coordinate -! (presumably pressure). -! -! In this function, coef_q_weight == w, coef_q_diff == D, -! coef_q_adv == v, and coef_q == c. All these are optional; omitting a -! coefficient is equivalent to setting the entire array to 0. -! -! coef_q_diff and coef_q_adv are defined at the level interfaces, while -! coef_q and coef_q_weight are grid-cell averages. - -function fin_vol_solve(dt, p, toSolve, ncols, pver, coef_q, coef_q_diff, coef_q_adv, & - coef_q_weight, upper_bndry, lower_bndry, l_cond, r_cond) result(solution) - - use linear_1d_operators, only: & - zero_operator, & - diagonal_operator, & - diffusion_operator, & - advection_operator, & - BoundaryType, & - TriDiagDecomp, & - TriDiagOp, & - BoundaryCond, & - operator(+) - use shr_kind_mod, only: r8 => shr_kind_r8 - use coords_1d, only: Coords1D - - ! ---------------------- ! - ! Input-Output Arguments ! - ! ---------------------- ! - - ! Time step. - real(r8), intent(in) :: dt - ! Grid spacings. - type(Coords1D), intent(in) :: p - - ! Matrix to decomp from. - ! real(r8), intent(in) :: u(ncols,pver) - integer, intent(in) :: ncols - integer, intent(in) :: pver - real(r8), intent(in) :: toSolve(ncols,pver) - - ! Coefficients for diffusion and advection. - ! - ! The sizes must be consistent among all the coefficients that are - ! actually present, i.e. coef_q_diff and coef_q_adv should be one level - ! bigger than coef_q and coef_q_weight, and have the same column number. - real(r8), contiguous, intent(in), optional :: coef_q(:,:), & - coef_q_diff(:,:), coef_q_adv(:,:), coef_q_weight(:,:) - - ! Boundary conditions (optional, default to 0 flux through boundary). - class(BoundaryType), target, intent(in), optional :: & - upper_bndry, lower_bndry - - ! Objects representing boundary conditions. - class(BoundaryCond), intent(in), optional :: l_cond, r_cond - - real(r8) :: solution(ncols,pver) - - ! decomposition. - type(TriDiagDecomp) :: decomp - - ! --------------- ! - ! Local Variables ! - ! --------------- ! - - ! Operator objects. - type(TriDiagOp) :: add_term - type(TriDiagOp) :: net_operator - - ! ----------------------- ! - ! Main Computation Begins ! - ! ----------------------- ! - - ! A diffusion term is probably present, so start with that. Otherwise - ! start with an operator of all 0s. - - if (present(coef_q_diff)) then - net_operator = diffusion_operator(p, coef_q_diff, & - upper_bndry, lower_bndry) - else - net_operator = zero_operator(p%n, p%d) - end if - - ! Constant term (damping). - if (present(coef_q)) then - add_term = diagonal_operator(coef_q) - call net_operator%add(add_term) - end if - - ! Effective advection. - if (present(coef_q_adv)) then - add_term = advection_operator(p, coef_q_adv, & - upper_bndry, lower_bndry) - call net_operator%add(add_term) - end if - - ! We want I-dt*(w^-1)*A for a single time step, implicit method, where - ! A is the right-hand-side operator (i.e. what net_operator is now). - if (present(coef_q_weight)) then - call net_operator%lmult_as_diag(-dt/coef_q_weight) - else - call net_operator%lmult_as_diag(-dt) - end if - call net_operator%add_to_diag(1._r8) - - ! Decompose - decomp = TriDiagDecomp(net_operator) - solution = toSolve - - call net_operator%finalize() - call add_term%finalize() - - call decomp%left_div(solution(:ncols, :), l_cond=l_cond, r_cond=r_cond) - !tendency = tendency - toSolve - - ! Ensure local objects are deallocated. - call decomp%finalize() - -end function fin_vol_solve - -end module new_decomp From d9d49711fb542c0501a7f38b89e6ed35a8c2313d Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:54:45 -0600 Subject: [PATCH 12/29] Undoing format change. --- src/physics/cam/diffusion_solver.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index e418e32631..63f4b5d216 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -166,7 +166,7 @@ subroutine compute_vdiff( lchnk , ! FIXME: This should not be needed use air_composition, only: rairv - use phys_control, only : phys_getopts + use phys_control, only : phys_getopts ! Modification : Ideally, we should diffuse 'liquid-ice static energy' (sl), not the dry static energy. ! Also, vertical diffusion of cloud droplet number concentration and aerosol number From 2dbe8f62ea60f2a653f3c0be40e97f4ee94cbf01 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 07:56:41 -0600 Subject: [PATCH 13/29] Removing more commented out code. --- src/physics/cam/diffusion_solver.F90 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index 63f4b5d216..b7dd1fc867 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -745,9 +745,6 @@ end function vd_lu_qdecomp ! Boundary layer thickness of "0._r8" signifies that the boundary ! condition is defined directly on the top interface. - ! decomp = fin_vol_lu_decomp(ztodt, p, & - ! coef_q_diff=kvh(:ncol,:)*dpidz_sq, & - ! upper_bndry=interface_boundary) if (.not. use_spcam) then dse(:ncol,:) = fin_vol_solve(ztodt, p, dse(:ncol,:), & @@ -755,13 +752,8 @@ end function vd_lu_qdecomp coef_q_diff=kvh(:ncol,:)*dpidz_sq, & upper_bndry=interface_boundary, & l_cond=BoundaryData(dse_top(:ncol))) - !dse(:ncol,:) = dse(:ncol,:) + ddse - ! call decomp%left_div(dse(:ncol,:), & - ! l_cond=BoundaryData(dse_top(:ncol))) endif - ! call decomp%finalize() - ! Calculate flux at top interface ! Modification : Why molecular diffusion does not work for dry static energy in all layers ? From 04eb0d22774f3022150cd80775447bd1d59f020b Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 11:32:05 -0600 Subject: [PATCH 14/29] Updating atmos_phys with merged version from main. --- .gitmodules | 2 +- src/atmos_phys | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3fb5f26d4b..8f14308de1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,7 +36,7 @@ [submodule "atmos_phys"] path = src/atmos_phys url = https://github.com/mwaxmonsky/atmospheric_physics - fxtag = 8b1bd8676e3c7b8fb7547b4df1270320d74f6aab + fxtag = 2b03bea15d533e4d983ec910a0d09f1111167e6b fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/mwaxmonsky/atmospheric_physics diff --git a/src/atmos_phys b/src/atmos_phys index 8b1bd8676e..2b03bea15d 160000 --- a/src/atmos_phys +++ b/src/atmos_phys @@ -1 +1 @@ -Subproject commit 8b1bd8676e3c7b8fb7547b4df1270320d74f6aab +Subproject commit 2b03bea15d533e4d983ec910a0d09f1111167e6b From 69194ca6e0bbf38b74627ef11df038dcc5f5dd26 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Mon, 21 Oct 2024 18:18:00 -0600 Subject: [PATCH 15/29] Updating to flattened atmos_phys to_be_ccppized folder. --- .gitmodules | 2 +- bld/configure | 3 +-- src/atmos_phys | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 8f14308de1..dccfcc9537 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,7 +36,7 @@ [submodule "atmos_phys"] path = src/atmos_phys url = https://github.com/mwaxmonsky/atmospheric_physics - fxtag = 2b03bea15d533e4d983ec910a0d09f1111167e6b + fxtag = a1e05a5e8e30d36d2b36866a84568a791c37d679 fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/mwaxmonsky/atmospheric_physics diff --git a/bld/configure b/bld/configure index 219a18a196..df41ff1ea7 100755 --- a/bld/configure +++ b/bld/configure @@ -2332,8 +2332,7 @@ sub write_filepath # be overridden by modules from directories that occur earlier # in the list of filepaths. print $fh "$camsrcdir/src/physics/cam\n"; - print $fh "$camsrcdir/src/atmos_phys/to_be_ccppized/utilities\n"; - print $fh "$camsrcdir/src/atmos_phys/to_be_ccppized/physics/cam\n"; + print $fh "$camsrcdir/src/atmos_phys/to_be_ccppized\n"; #Add the CCPP'ized subdirectories print $fh "$camsrcdir/src/atmos_phys/schemes/tropopause_find\n"; diff --git a/src/atmos_phys b/src/atmos_phys index 2b03bea15d..a1e05a5e8e 160000 --- a/src/atmos_phys +++ b/src/atmos_phys @@ -1 +1 @@ -Subproject commit 2b03bea15d533e4d983ec910a0d09f1111167e6b +Subproject commit a1e05a5e8e30d36d2b36866a84568a791c37d679 From ec5fe1ea1746477b46eedfbc8d885429a9120d7f Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Thu, 24 Oct 2024 19:44:50 -0600 Subject: [PATCH 16/29] Updating atmos_phys to top of development branch. --- .gitmodules | 6 +++--- src/atmos_phys | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index dccfcc9537..f5bff7c5a2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -35,10 +35,10 @@ [submodule "atmos_phys"] path = src/atmos_phys - url = https://github.com/mwaxmonsky/atmospheric_physics - fxtag = a1e05a5e8e30d36d2b36866a84568a791c37d679 + url = https://github.com/ESCOMP/atmospheric_physics + fxtag = c6ed2caae61dee8ba798011fa3eace583f3db917 fxrequired = AlwaysRequired - fxDONOTUSEurl = https://github.com/mwaxmonsky/atmospheric_physics + fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics [submodule "fv3"] path = src/dynamics/fv3 diff --git a/src/atmos_phys b/src/atmos_phys index a1e05a5e8e..c6ed2caae6 160000 --- a/src/atmos_phys +++ b/src/atmos_phys @@ -1 +1 @@ -Subproject commit a1e05a5e8e30d36d2b36866a84568a791c37d679 +Subproject commit c6ed2caae61dee8ba798011fa3eace583f3db917 From 6561e2cb32a19d3365b7809b66aa8843c9924c4c Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Fri, 25 Oct 2024 06:21:27 -0600 Subject: [PATCH 17/29] Whitespace fixes. --- src/physics/cam/diffusion_solver.F90 | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/physics/cam/diffusion_solver.F90 b/src/physics/cam/diffusion_solver.F90 index b7dd1fc867..94fc4bc395 100644 --- a/src/physics/cam/diffusion_solver.F90 +++ b/src/physics/cam/diffusion_solver.F90 @@ -572,12 +572,12 @@ end function vd_lu_qdecomp end do v(:ncol,:) = fin_vol_solve(ztodt, p, v(:ncol,:), ncol, pver, & - coef_q=tau_damp_rate, & - coef_q_diff=kvm(:ncol,:)*dpidz_sq) + coef_q=tau_damp_rate, & + coef_q_diff=kvm(:ncol,:)*dpidz_sq) u(:ncol,:) = fin_vol_solve(ztodt, p, u(:ncol,:), ncol, pver, & - coef_q=tau_damp_rate, & - coef_q_diff=kvm(:ncol,:)*dpidz_sq) + coef_q=tau_damp_rate, & + coef_q_diff=kvm(:ncol,:)*dpidz_sq) @@ -747,10 +747,9 @@ end function vd_lu_qdecomp ! condition is defined directly on the top interface. if (.not. use_spcam) then - dse(:ncol,:) = fin_vol_solve(ztodt, p, dse(:ncol,:), & - ncol, pver, & - coef_q_diff=kvh(:ncol,:)*dpidz_sq, & - upper_bndry=interface_boundary, & + dse(:ncol,:) = fin_vol_solve(ztodt, p, dse(:ncol,:), ncol, pver, & + coef_q_diff=kvh(:ncol,:)*dpidz_sq, & + upper_bndry=interface_boundary, & l_cond=BoundaryData(dse_top(:ncol))) endif @@ -767,8 +766,8 @@ end function vd_lu_qdecomp ! upper boundary is zero flux for extended model if (.not. use_spcam) then ttemp = fin_vol_solve(ztodt, p, ttemp, ncol, pver, & - coef_q_diff=kvt(:ncol,:)*dpidz_sq, & - coef_q_weight=cpairv(:ncol,:)) + coef_q_diff=kvt(:ncol,:)*dpidz_sq, & + coef_q_weight=cpairv(:ncol,:)) end if @@ -792,9 +791,9 @@ end function vd_lu_qdecomp ! condition is defined directly on the top interface. if (.not. use_spcam) then dse(:ncol,:) = fin_vol_solve(ztodt, p, dse(:ncol,:), ncol, pver, & - coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & - upper_bndry=interface_boundary, & - l_cond=BoundaryData(dse_top(:ncol))) + coef_q_diff=kv_total(:ncol,:)*dpidz_sq, & + upper_bndry=interface_boundary, & + l_cond=BoundaryData(dse_top(:ncol))) end if ! Calculate flux at top interface From 542a99b6c9e7e1a633d34e317b572f1222a7c188 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Fri, 25 Oct 2024 06:22:06 -0600 Subject: [PATCH 18/29] Removing whitespace. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f5bff7c5a2..64e5ceedff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,7 +36,7 @@ [submodule "atmos_phys"] path = src/atmos_phys url = https://github.com/ESCOMP/atmospheric_physics - fxtag = c6ed2caae61dee8ba798011fa3eace583f3db917 + fxtag = c6ed2caae61dee8ba798011fa3eace583f3db917 fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics From 3cdeb2b3e438adb2ce6688e393235ce760344f08 Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Fri, 25 Oct 2024 15:32:32 -0600 Subject: [PATCH 19/29] Updating atmos_phys to official release tag. --- .gitmodules | 2 +- src/atmos_phys | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 64e5ceedff..4208e3447c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,7 +36,7 @@ [submodule "atmos_phys"] path = src/atmos_phys url = https://github.com/ESCOMP/atmospheric_physics - fxtag = c6ed2caae61dee8ba798011fa3eace583f3db917 + fxtag = atmos_phys0_06_000 fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics diff --git a/src/atmos_phys b/src/atmos_phys index c6ed2caae6..67927f1511 160000 --- a/src/atmos_phys +++ b/src/atmos_phys @@ -1 +1 @@ -Subproject commit c6ed2caae61dee8ba798011fa3eace583f3db917 +Subproject commit 67927f15113eb9c5d4a57f2276d67b8ad88c5149 From 4adb65b2de579543c60fdc257988727771053dbf Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Wed, 30 Oct 2024 08:28:11 -0600 Subject: [PATCH 20/29] Updating ChangeLog --- doc/ChangeLog | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8294c223f2..8873394692 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,110 @@ =============================================================== +Tag name: cam6_4_044 +Originator(s): mwaxmonsky +Date: 10/25/2024 +One-line Summary: Start refactoring of vertical diffusion to be CCPPized +Github PR URL: https://github.com/ESCOMP/CAM/pull/1176 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): +Start refactoring of vertical diffusion to be CCPPized and outsources solve phase of non-graft decomp solves to atmospheric physics solver. + +Describe any changes made to build system: +- Adds the to_be_ccppized directory in atmospheric_physics to source search path + +Describe any changes made to the namelist: N/A + +List any changes to the defaults for the boundary datasets: N/A + +Describe any substantial timing or memory changes: N/A + +Code reviewed by: + +List all files eliminated: +D src/utils/coords_1d.F90 +D src/utils/linear_1d_operators.F90 +- Files were moved to atmospheric_physics + +List all files added and what they do: N/A + +List all existing files that have been modified, and describe the changes: +M .gitmodules +M bld/configure +M src/atmos_phys +- Update atmospheric_physics reference and added new atmospheric_physics directory to search path + +M cime_config/config_pes.xml +- Decreasing NTHRDS from 2 to 1 to force single threaded execution as multithreaded execution enables the -smp flag which breaks under OpenMP when running the SE dycore, similar to #1087 + +M src/physics/cam/diffusion_solver.F90 +- Uses new CCPPized interface for decomp that was moved to atmospheric_physics repo to single solve step. + +If there were any failures reported from running test_driver.sh on any test +platform, and checkin with these failures has been OK'd by the gatekeeper, +then copy the lines from the td.*.status files for the failed tests to the +appropriate machine below. All failed tests must be justified. + +derecho/intel/aux_cam: + +ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) +ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) +SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) +SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) +- expected diffs due to changes in cam7 configuration/tuning + +ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details: +- pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856 + +SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) +SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) +- pre-existing failures due to build-namelist error requiring CLM/CTSM external update. + +derecho/nvhpc/aux_cam: + +ERS_Ln9_G4-a100-openacc.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_mg3_default (Overall: DIFF) +- expected diff due to changing seasalt_emis_scale for cam7 + +izumi/nag/aux_cam: + +DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details: + - pre-existing failure -- issue #670 + +izumi/gnu/aux_cam: + +ERP_D_Ln9.ne3pg3_ne3pg3_mg37.FLTHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: +ERP_Ln9_P24x2.f45_f45_mg37.QPWmaC6.izumi_gnu.cam-outfrq9s_mee_fluxes (Overall: DIFF) details: +ERS_Ln9_P24x1.mpasa480_mpasa480.F2000climo.izumi_gnu.cam-outfrq9s_mpasa480 (Overall: DIFF) details: +- new tests are missing baselines + +CAM tag used for the baseline comparison tests if different than previous +tag: + +Summarize any changes to answers, i.e., +- what code configurations: +- what platforms/compilers: +- nature of change (roundoff; larger than roundoff but same climate; new + climate): +N/A + +If bitwise differences were observed, how did you show they were no worse +than roundoff? +N/A + +If this tag changes climate describe the run(s) done to evaluate the new +climate in enough detail that it(they) could be reproduced, i.e., +- source tag (all code used must be in the repository): +- platform/compilers: +- configure commandline: +- build-namelist command (or complete namelist): +- MSS location of output: +N/A + +MSS location of control simulations used to validate new climate: N/A + +URL for AMWG diagnostics output used to validate new climate: N/A + +=============================================================== + Tag name: cam6_4_043 Originator(s): eaton Date: 25 Oct 2024 From 69253cd69e94eca51f8a3b6b648f9f5c1187bebd Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Thu, 31 Oct 2024 16:30:07 -0600 Subject: [PATCH 21/29] Updating error list. --- doc/ChangeLog | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8873394692..f057fb3b2c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -46,23 +46,15 @@ appropriate machine below. All failed tests must be justified. derecho/intel/aux_cam: -ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) -ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) -SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) -SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) -- expected diffs due to changes in cam7 configuration/tuning - ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details: +SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: FAIL) details: - pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856 SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) - pre-existing failures due to build-namelist error requiring CLM/CTSM external update. -derecho/nvhpc/aux_cam: - -ERS_Ln9_G4-a100-openacc.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_mg3_default (Overall: DIFF) -- expected diff due to changing seasalt_emis_scale for cam7 +derecho/nvhpc/aux_cam: None izumi/nag/aux_cam: From 6229b1a6c648667e301e02ed31d7c070bf2f97c3 Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Mon, 4 Nov 2024 12:28:40 -0500 Subject: [PATCH 22/29] limit t_sfc to valid temperature range --- src/physics/rrtmgp/rrtmgp_inputs.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/physics/rrtmgp/rrtmgp_inputs.F90 b/src/physics/rrtmgp/rrtmgp_inputs.F90 index 4f73ae9029..191b6ff8a0 100644 --- a/src/physics/rrtmgp/rrtmgp_inputs.F90 +++ b/src/physics/rrtmgp/rrtmgp_inputs.F90 @@ -178,6 +178,8 @@ subroutine rrtmgp_set_state( & tref_max = kdist_sw%get_temp_max() t_rad = merge(t_rad, tref_min, t_rad > tref_min) t_rad = merge(t_rad, tref_max, t_rad < tref_max) + t_sfc = merge(t_sfc, tref_min, t_sfc > tref_min) + t_sfc = merge(t_sfc, tref_max, t_sfc < tref_max) ! Construct arrays containing only daylight columns do i = 1, nday From 2faddca881378cb71585cc8cbb33db204c5a557f Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Mon, 4 Nov 2024 20:48:52 -0500 Subject: [PATCH 23/29] start ChangeLog --- doc/ChangeLog | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8294c223f2..a0e2bf114f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,74 @@ =============================================================== +Tag name: cam6_4_044 +Originator(s): eaton +Date: +One-line Summary: limit surface T to valid range for RRTMGP +Github PR URL: https://github.com/ESCOMP/CAM/pull/1184 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + +. Jim Edwards reported that regression testing of cesm3_0_alpha05a using + the cam6_4_043 tag was encountering failures due to the following error: + + radiation_tend: ERROR: kdist_lw%gas_optics: gas_optics(): array tsfc has values outside range + + t_sfc is computed using input LW surface fluxes from the surface models via: + + t_sfc = sqrt(sqrt(cam_in%lwup(:ncol)/stebol)) + + To work around this problem we have added limiters to keep t_sfc in the + valid range for RRTMGP. Temperatures above the surface are already being + limited to be in RRTMGP's valid range before being passed to the gas + optics code. + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: peverwhee, brianpm + +List all files eliminated: none + +List all files added and what they do: none + +List all existing files that have been modified, and describe the changes: + +src/physics/rrtmgp/rrtmgp_inputs.F90 +. limit t_sfc to valid temperature range + +If there were any failures reported from running test_driver.sh on any test +platform, and checkin with these failures has been OK'd by the gatekeeper, +then copy the lines from the td.*.status files for the failed tests to the +appropriate machine below. All failed tests must be justified. + +derecho/intel/aux_cam: + +ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) +- pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856 + +SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) +SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) +- pre-existing failures due to build-namelist error requiring CLM/CTSM external update. + +derecho/nvhpc/aux_cam: All PASS + +izumi/nag/aux_cam: + +izumi/gnu/aux_cam: + +CAM tag used for the baseline comparison tests if different than previous +tag: + +Summarize any changes to answers: BFB + +=============================================================== +=============================================================== + Tag name: cam6_4_043 Originator(s): eaton Date: 25 Oct 2024 From 06d61e861f4aac4a9a29d46f38dbcc52a3c75d28 Mon Sep 17 00:00:00 2001 From: Courtney Peverley Date: Mon, 4 Nov 2024 21:40:32 -0700 Subject: [PATCH 24/29] finalize changelog --- doc/ChangeLog | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index a0e2bf114f..0dc0a989f8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,7 @@ Tag name: cam6_4_044 Originator(s): eaton -Date: +Date: 04 November 2024 One-line Summary: limit surface T to valid range for RRTMGP Github PR URL: https://github.com/ESCOMP/CAM/pull/1184 @@ -59,10 +59,14 @@ derecho/nvhpc/aux_cam: All PASS izumi/nag/aux_cam: -izumi/gnu/aux_cam: +DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details: + - pre-existing failure -- issue #670 + +izumi/gnu/aux_cam: All PASS CAM tag used for the baseline comparison tests if different than previous -tag: +tag: cam6_4_043_newnodes_gnu and cam6_4_043_newnodes_nag on izumi + - baselines changed due to node updates between cam6_4_043 and cam6_4_044 Summarize any changes to answers: BFB From 7f6e33ea2af031060db9a40b2a16e6f152639675 Mon Sep 17 00:00:00 2001 From: Jian Sun Date: Tue, 5 Nov 2024 22:43:42 -0700 Subject: [PATCH 25/29] update GPU tests with new xml options --- .gitmodules | 6 ++--- cime_config/testdefs/testlist_cam.xml | 4 +-- .../cam/outfrq9s_gpu_default/shell_commands | 12 +++++++++ .../cam/outfrq9s_gpu_default/user_nl_cam | 4 +++ .../cam/outfrq9s_gpu_default/user_nl_clm | 26 +++++++++++++++++++ .../cam/outfrq9s_gpu_pcols760/shell_commands | 12 +++++++++ .../cam/outfrq9s_gpu_pcols760/user_nl_cam | 4 +++ .../cam/outfrq9s_gpu_pcols760/user_nl_clm | 26 +++++++++++++++++++ 8 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_cam create mode 100644 cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_cam create mode 100644 cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_clm diff --git a/.gitmodules b/.gitmodules index 224ee10052..c1256c91ff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -144,21 +144,21 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.7 +fxtag = ccs_config_cesm1.0.8 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git [submodule "cime"] path = cime url = https://github.com/ESMCI/cime -fxtag = cime6.1.29 +fxtag = cime6.1.41 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps1.0.16 +fxtag = cmeps1.0.22 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index 941bfc6331..c95f004d25 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -1489,7 +1489,7 @@ - + @@ -1498,7 +1498,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/shell_commands new file mode 100644 index 0000000000..eb3720c75f --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/shell_commands @@ -0,0 +1,12 @@ +./xmlchange NTASKS=128 +./xmlchange NTHRDS=1 +./xmlchange ROOTPE='0' +./xmlchange ROF_NCPL=`./xmlquery --value ATM_NCPL` +./xmlchange GLC_NCPL=`./xmlquery --value ATM_NCPL` +./xmlchange CAM_CONFIG_OPTS=' -microphys mg3 -rad rrtmg' --append +./xmlchange TIMER_DETAIL='6' +./xmlchange TIMER_LEVEL='999' +./xmlchange GPU_TYPE=a100 +./xmlchange OPENACC_GPU_OFFLOAD=TRUE +./xmlchange OVERSUBSCRIBE_GPU=TRUE +./xmlchange NGPUS_PER_NODE=4 \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_cam new file mode 100644 index 0000000000..8482082dce --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_cam @@ -0,0 +1,4 @@ +mfilt=1,1,1,1,1,1 +ndens=1,1,1,1,1,1 +nhtfrq=9,9,9,9,9,9 +inithist='ENDOFRUN' diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_clm new file mode 100644 index 0000000000..12d5a36d2b --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default/user_nl_clm @@ -0,0 +1,26 @@ +!---------------------------------------------------------------------------------- +! Users should add all user specific namelist changes below in the form of +! namelist_var = new_namelist_value +! +! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options +! are set in the CLM_NAMELIST_OPTS env variable. +! +! EXCEPTIONS: +! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting +! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting +! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting +! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting +! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting +! Set irrigate by the CLM_BLDNML_OPTS -irrig setting +! Set dtime with L_NCPL option +! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options +! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases +! (includes $inst_string for multi-ensemble cases) +! Set glc_grid with CISM_GRID option +! Set glc_smb with GLC_SMB option +! Set maxpatch_glcmec with GLC_NEC option +! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable +!---------------------------------------------------------------------------------- +hist_nhtfrq = 9 +hist_mfilt = 1 +hist_ndens = 1 diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/shell_commands new file mode 100644 index 0000000000..fa18f065fb --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/shell_commands @@ -0,0 +1,12 @@ +./xmlchange NTASKS=64 +./xmlchange NTHRDS=1 +./xmlchange ROOTPE='0' +./xmlchange ROF_NCPL=`./xmlquery --value ATM_NCPL` +./xmlchange GLC_NCPL=`./xmlquery --value ATM_NCPL` +./xmlchange CAM_CONFIG_OPTS=' -microphys mg3 -rad rrtmg -pcols 760 ' --append +./xmlchange TIMER_DETAIL='6' +./xmlchange TIMER_LEVEL='999' +./xmlchange GPU_TYPE=a100 +./xmlchange OPENACC_GPU_OFFLOAD=TRUE +./xmlchange OVERSUBSCRIBE_GPU=TRUE +./xmlchange NGPUS_PER_NODE=4 diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_cam new file mode 100644 index 0000000000..8482082dce --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_cam @@ -0,0 +1,4 @@ +mfilt=1,1,1,1,1,1 +ndens=1,1,1,1,1,1 +nhtfrq=9,9,9,9,9,9 +inithist='ENDOFRUN' diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_clm b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_clm new file mode 100644 index 0000000000..12d5a36d2b --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760/user_nl_clm @@ -0,0 +1,26 @@ +!---------------------------------------------------------------------------------- +! Users should add all user specific namelist changes below in the form of +! namelist_var = new_namelist_value +! +! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options +! are set in the CLM_NAMELIST_OPTS env variable. +! +! EXCEPTIONS: +! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting +! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting +! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting +! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting +! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting +! Set irrigate by the CLM_BLDNML_OPTS -irrig setting +! Set dtime with L_NCPL option +! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options +! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases +! (includes $inst_string for multi-ensemble cases) +! Set glc_grid with CISM_GRID option +! Set glc_smb with GLC_SMB option +! Set maxpatch_glcmec with GLC_NEC option +! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable +!---------------------------------------------------------------------------------- +hist_nhtfrq = 9 +hist_mfilt = 1 +hist_ndens = 1 From 1492847bdd17f5c8c62f275697ae357f3fbe72c6 Mon Sep 17 00:00:00 2001 From: Jian Sun Date: Wed, 6 Nov 2024 09:46:35 -0700 Subject: [PATCH 26/29] update ChangeLog draft --- doc/ChangeLog | 237 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0dc0a989f8..93261f40db 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,242 @@ =============================================================== +Tag name: cam6_4_0xx +Originator(s): sjsprecious +Date: 04 November 2024 +One-line Summary: update GPU regression tests with new XML options +Github PR URL: https://github.com/ESCOMP/CAM/pull/1186 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + +. As discussed in https://github.com/ESMCI/cime/pull/4687, it is better remove the GPU options from the Python workflow in CIME and use XML files instead to configure a GPU test for CESM. + + The following tags should be brought into CAM together to make the new GPU workflow function properly: + - cmeps1.0.22 or newer + - ccs_config_cesm1.0.8 or newer + - cime6.1.33 or newer + + Once those new tags are merged in, the GPU test definition here (https://github.com/ESCOMP/CAM/blob/cam_development/cime_config/testdefs/testlist_cam.xml#L1493-L1510) needs to be updated accordingly. + +Describe any changes made to build system: none + +Describe any changes made to the namelist: none + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: none + +Code reviewed by: YYY + +List all files eliminated: none + +List all files added and what they do: + +. The following files are added to perform a GPU regresesion test with PCOLS=16 and two GPU nodes on Derecho + - cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_default + - shell_commands + - user_nl_cam + - user_nl_clm + +. The following files are added to perform a GPU regresesion test with PCOLS=760 and one GPU node on Derecho + - cime_config/testdefs/testmods_dirs/cam/outfrq9s_gpu_pcols760 + - shell_commands + - user_nl_cam + - user_nl_clm + +List all existing files that have been modified, and describe the changes: + +.gitmodules +. update the tags for the external components + +cime_config/testdefs/testlist_cam.xml +. update the GPU regression tests to use the right setups + +If there were any failures reported from running test_driver.sh on any test +platform, and checkin with these failures has been OK'd by the gatekeeper, +then copy the lines from the td.*.status files for the failed tests to the +appropriate machine below. All failed tests must be justified. + +derecho/intel/aux_cam: There is a difference in the namelist comparison and FIELDLIST field, otherwise bit-for-bit. + + ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: + FAIL ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp NLCOMP + FAIL ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s (Overall: DIFF) details: + FAIL ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s NLCOMP + FAIL ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: DIFF) details: + FAIL ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s NLCOMP + FAIL ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERC_D_Ln9.ne16_ne16_mg17.FADIAB.derecho_intel.cam-terminator (Overall: NLFAIL) details: + FAIL ERC_D_Ln9.ne16_ne16_mg17.FADIAB.derecho_intel.cam-terminator NLCOMP + ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: + FAIL ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase NLCOMP + FAIL ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details: + FAIL ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase NLCOMP + FAIL ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERC_D_Ln9.T42_T42_mg17.FDABIP04.derecho_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details: + FAIL ERC_D_Ln9.T42_T42_mg17.FDABIP04.derecho_intel.cam-outfrq3s_usecase NLCOMP + ERC_D_Ln9.T42_T42_mg17.FHS94.derecho_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details: + FAIL ERC_D_Ln9.T42_T42_mg17.FHS94.derecho_intel.cam-outfrq3s_usecase NLCOMP + ERI_D_Ln18.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase (Overall: DIFF) details: + FAIL ERI_D_Ln18.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase NLCOMP + FAIL ERI_D_Ln18.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details: + FAIL ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s NLCOMP + ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details: + FAIL ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d NLCOMP + FAIL ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: NLFAIL) details: + FAIL ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa NLCOMP + ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + FAIL ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h NLCOMP + FAIL ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: DIFF) details: + FAIL ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 NLCOMP + FAIL ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details: + FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s COMPARE_base_rest + FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERS_Ln9.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERS_Ln9.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERS_Ln9.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s NLCOMP + FAIL ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + ERS_Ln9.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.derecho_intel.cam-outfrq3s_refined (Overall: NLFAIL) details: + FAIL ERS_Ln9.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.derecho_intel.cam-outfrq3s_refined NLCOMP + ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details: + FAIL ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 NLCOMP + FAIL ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details: + FAIL SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep NLCOMP + FAIL SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details: + FAIL SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep NLCOMP + FAIL SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase (Overall: DIFF) details: + FAIL SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase NLCOMP + FAIL SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ld5.f19_f19_mg17.PC4.derecho_intel.cam-cam4_port5d (Overall: NLFAIL) details: + FAIL SMS_D_Ld5.f19_f19_mg17.PC4.derecho_intel.cam-cam4_port5d NLCOMP + SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details: + FAIL SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday NLCOMP + FAIL SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details: + FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 NLCOMP + FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) details: + FAIL SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie SETUP + SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: + FAIL SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase NLCOMP + FAIL SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details: + FAIL SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s NLCOMP + SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) details: + FAIL SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s SETUP + SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: NLFAIL) details: + FAIL SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust NLCOMP + SMS_D_Ln9.T42_T42.FSCAMARM97.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + FAIL SMS_D_Ln9.T42_T42.FSCAMARM97.derecho_intel.cam-outfrq9s NLCOMP + FAIL SMS_D_Ln9.T42_T42.FSCAMARM97.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + FAIL SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d NLCOMP + FAIL SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + FAIL SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d NLCOMP + FAIL SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + FAIL SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d NLCOMP + FAIL SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ld5.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 (Overall: NLFAIL) details: + FAIL SMS_Ld5.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 NLCOMP + SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + FAIL SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h NLCOMP + FAIL SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: DIFF) details: + FAIL SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging NLCOMP + FAIL SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details: + FAIL SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s NLCOMP + FAIL SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs (Overall: DIFF) details: + FAIL SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs NLCOMP + FAIL SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem (Overall: DIFF) details: + FAIL SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem NLCOMP + FAIL SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + FAIL SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp NLCOMP + FAIL SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) + +derecho/nvhpc/aux_cam: The baseline is generated successfully. + +izumi/nag/aux_cam: I do not know how to run on Izumi + +izumi/gnu/aux_cam: I do not know how to run on Izumi + +CAM tag used for the baseline comparison tests if different than previous +tag: cam6_4_044 + +Summarize any changes to answers: BFB + +=============================================================== + +=============================================================== + Tag name: cam6_4_044 Originator(s): eaton Date: 04 November 2024 From 89655a4ffe6a44feccc576c65615f5826600861e Mon Sep 17 00:00:00 2001 From: Jian Sun Date: Wed, 6 Nov 2024 11:02:21 -0700 Subject: [PATCH 27/29] update change log --- doc/ChangeLog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 93261f40db..1988c5dfe8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,12 +2,14 @@ Tag name: cam6_4_0xx Originator(s): sjsprecious -Date: 04 November 2024 +Date: 06 November 2024 One-line Summary: update GPU regression tests with new XML options Github PR URL: https://github.com/ESCOMP/CAM/pull/1186 Purpose of changes (include the issue number and title text for each relevant GitHub issue): +. GitHub issue: https://github.com/ESCOMP/CAM/issues/1165 + . As discussed in https://github.com/ESMCI/cime/pull/4687, it is better remove the GPU options from the Python workflow in CIME and use XML files instead to configure a GPU test for CESM. The following tags should be brought into CAM together to make the new GPU workflow function properly: @@ -25,7 +27,7 @@ List any changes to the defaults for the boundary datasets: none Describe any substantial timing or memory changes: none -Code reviewed by: YYY +Code reviewed by: peverwhee List all files eliminated: none From 25a94e31f6397e3f25148370cc018e9285ff190c Mon Sep 17 00:00:00 2001 From: Michael Waxmonsky Date: Thu, 7 Nov 2024 09:08:19 -0700 Subject: [PATCH 28/29] Updating Changelog to reflect latest test runs. --- doc/ChangeLog | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 53fe24d705..0efd5aaa8a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -54,19 +54,14 @@ SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) - pre-existing failures due to build-namelist error requiring CLM/CTSM external update. -derecho/nvhpc/aux_cam: None +derecho/nvhpc/aux_cam: All PASS izumi/nag/aux_cam: DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details: - pre-existing failure -- issue #670 -izumi/gnu/aux_cam: - -ERP_D_Ln9.ne3pg3_ne3pg3_mg37.FLTHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: -ERP_Ln9_P24x2.f45_f45_mg37.QPWmaC6.izumi_gnu.cam-outfrq9s_mee_fluxes (Overall: DIFF) details: -ERS_Ln9_P24x1.mpasa480_mpasa480.F2000climo.izumi_gnu.cam-outfrq9s_mpasa480 (Overall: DIFF) details: -- new tests are missing baselines +izumi/gnu/aux_cam: All PASS CAM tag used for the baseline comparison tests if different than previous tag: From 9a14ae3ea237e8b36beaa6ca74ef23d4302a0080 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Fri, 8 Nov 2024 15:17:05 -0700 Subject: [PATCH 29/29] Finalize ChangeLog and update submodules. --- ccs_config | 2 +- cime | 2 +- components/cmeps | 2 +- doc/ChangeLog | 196 +++++++---------------------------------------- 4 files changed, 30 insertions(+), 172 deletions(-) diff --git a/ccs_config b/ccs_config index e4ac80ef14..775e9f7900 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit e4ac80ef142954e582b4065222145352f22cd3a4 +Subproject commit 775e9f790044c3632e70e2beda9d66db34558b7b diff --git a/cime b/cime index 2776043f0d..1236c0fede 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit 2776043f0d20d2bc1094afeb48e0cc242b0b0407 +Subproject commit 1236c0feded460aef3e5bdba18e4b850f1997346 diff --git a/components/cmeps b/components/cmeps index 5b7d76978e..1355710f04 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit 5b7d76978e2fdc661ec2de4ba9834b985decadc6 +Subproject commit 1355710f04fa6286a13e8056e35c6736e7250e3d diff --git a/doc/ChangeLog b/doc/ChangeLog index 550759daf7..fdc0c4aa65 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -58,182 +58,41 @@ platform, and checkin with these failures has been OK'd by the gatekeeper, then copy the lines from the td.*.status files for the failed tests to the appropriate machine below. All failed tests must be justified. -derecho/intel/aux_cam: There is a difference in the namelist comparison and FIELDLIST field, otherwise bit-for-bit. +derecho/intel/aux_cam: - ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: - FAIL ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp NLCOMP - FAIL ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s (Overall: DIFF) details: - FAIL ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s NLCOMP - FAIL ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: DIFF) details: - FAIL ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s NLCOMP - FAIL ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERC_D_Ln9.ne16_ne16_mg17.FADIAB.derecho_intel.cam-terminator (Overall: NLFAIL) details: - FAIL ERC_D_Ln9.ne16_ne16_mg17.FADIAB.derecho_intel.cam-terminator NLCOMP - ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: - FAIL ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase NLCOMP - FAIL ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details: - FAIL ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase NLCOMP - FAIL ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERC_D_Ln9.T42_T42_mg17.FDABIP04.derecho_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details: - FAIL ERC_D_Ln9.T42_T42_mg17.FDABIP04.derecho_intel.cam-outfrq3s_usecase NLCOMP - ERC_D_Ln9.T42_T42_mg17.FHS94.derecho_intel.cam-outfrq3s_usecase (Overall: NLFAIL) details: - FAIL ERC_D_Ln9.T42_T42_mg17.FHS94.derecho_intel.cam-outfrq3s_usecase NLCOMP - ERI_D_Ln18.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase (Overall: DIFF) details: - FAIL ERI_D_Ln18.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase NLCOMP - FAIL ERI_D_Ln18.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details: - FAIL ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s NLCOMP - ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details: - FAIL ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d NLCOMP - FAIL ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: NLFAIL) details: - FAIL ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa NLCOMP - ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: DIFF) details: - FAIL ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h NLCOMP - FAIL ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: DIFF) details: - FAIL ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 NLCOMP - FAIL ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details: - FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s COMPARE_base_rest - FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERS_Ln9.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERS_Ln9.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERS_Ln9.f19_f19_mg17.FSPCAMS.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s NLCOMP - FAIL ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - ERS_Ln9.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.derecho_intel.cam-outfrq3s_refined (Overall: NLFAIL) details: - FAIL ERS_Ln9.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.derecho_intel.cam-outfrq3s_refined NLCOMP - ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details: - FAIL ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 NLCOMP - FAIL ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details: - FAIL SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep NLCOMP - FAIL SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details: - FAIL SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep NLCOMP - FAIL SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase (Overall: DIFF) details: - FAIL SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase NLCOMP - FAIL SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ld5.f19_f19_mg17.PC4.derecho_intel.cam-cam4_port5d (Overall: NLFAIL) details: - FAIL SMS_D_Ld5.f19_f19_mg17.PC4.derecho_intel.cam-cam4_port5d NLCOMP - SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details: - FAIL SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday NLCOMP - FAIL SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details: - FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 NLCOMP - FAIL SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) details: - FAIL SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie SETUP - SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: - FAIL SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase NLCOMP - FAIL SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details: - FAIL SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s NLCOMP - SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) details: - FAIL SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s SETUP - SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: NLFAIL) details: - FAIL SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust NLCOMP - SMS_D_Ln9.T42_T42.FSCAMARM97.derecho_intel.cam-outfrq9s (Overall: DIFF) details: - FAIL SMS_D_Ln9.T42_T42.FSCAMARM97.derecho_intel.cam-outfrq9s NLCOMP - FAIL SMS_D_Ln9.T42_T42.FSCAMARM97.derecho_intel.cam-outfrq9s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details: - FAIL SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d NLCOMP - FAIL SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: - FAIL SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d NLCOMP - FAIL SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: - FAIL SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d NLCOMP - FAIL SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ld5.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 (Overall: NLFAIL) details: - FAIL SMS_Ld5.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 NLCOMP - SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details: - FAIL SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h NLCOMP - FAIL SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: DIFF) details: - FAIL SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging NLCOMP - FAIL SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details: - FAIL SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s NLCOMP - FAIL SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs (Overall: DIFF) details: - FAIL SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs NLCOMP - FAIL SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem (Overall: DIFF) details: - FAIL SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem NLCOMP - FAIL SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) - SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: - FAIL SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp NLCOMP - FAIL SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp BASELINE /glade/campaign/cesm/community/amwg/cam_baselines/cam6_4_044_intel: FIELDLIST field lists differ (otherwise bit-for-bit) +All tests had differences in the namelist comparision and FIELDLIST field, +otherwise, unless listed below, they were bit-for-bit. -derecho/nvhpc/aux_cam: The baseline is generated successfully. +SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) +SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) + - pre-existing failures due to build-namelist error requiring CLM/CTSM external update. + +ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) +SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) + - pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856 + +derecho/nvhpc/aux_cam: -izumi/nag/aux_cam: I do not know how to run on Izumi +A new baseline was generated successfully, and a second test +with that new baseline passed as expected. -izumi/gnu/aux_cam: I do not know how to run on Izumi +izumi/nag/aux_cam: + +All tests had differences in the namelist comparision and FIELDLIST field, +otherwise, unless listed below, they were bit-for-bit. + +DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) + - pre-existing failure -- issue #670 + +izumi/gnu/aux_cam: + +All tests had differences in the namelist comparision and FIELDLIST field, +otherwise they were all bit-for-bit. CAM tag used for the baseline comparison tests if different than previous tag: cam6_4_045 -Summarize any changes to answers: BFB +Summarize any changes to answers: BFB except name anf field list changes. =============================================================== @@ -330,7 +189,6 @@ URL for AMWG diagnostics output used to validate new climate: N/A =============================================================== =============================================================== ->>>>>>> upstream/cam_development Tag name: cam6_4_044 Originator(s): eaton Date: 04 November 2024