From dd84fa1b560bef88aa42635025b764a01958418d Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Mon, 5 Aug 2024 06:55:19 -0600 Subject: [PATCH 01/65] phase 2 of gw devel --- src/physics/cam/gw_drag.F90 | 110 ++++++++++++++++++- src/physics/cam/gw_rdg.F90 | 206 ++++++++++++++++++++++++++++++++++++ 2 files changed, 312 insertions(+), 4 deletions(-) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index aeab27a5c6..627ec82e17 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -168,7 +168,9 @@ module gw_drag integer, parameter :: prdg = 16 real(r8), allocatable, dimension(:,:), target :: & - rdg_gbxar + rdg_gbxar, & + rdg_isovar, & + rdg_isowgt ! Meso Beta real(r8), allocatable, dimension(:,:,:), target :: & @@ -648,6 +650,8 @@ subroutine gw_init() ! Get beta ridge data allocate( & rdg_gbxar(pcols,begchunk:endchunk), & + rdg_isovar(pcols,begchunk:endchunk), & + rdg_isowgt(pcols,begchunk:endchunk), & rdg_hwdth(pcols,prdg,begchunk:endchunk), & rdg_clngt(pcols,prdg,begchunk:endchunk), & rdg_mxdis(pcols,prdg,begchunk:endchunk), & @@ -659,6 +663,14 @@ subroutine gw_init() if (.not. found) call endrun(sub//': ERROR: GBXAR not found on topo file') rdg_gbxar = rdg_gbxar * (rearth/1000._r8)*(rearth/1000._r8) ! transform to km^2 + call infld('ISOVAR', fh_topo, dim1name, dim2name, 1, pcols, & + begchunk, endchunk, rdg_isovar, found, gridname='physgrid') + if (.not. found) call endrun(sub//': ERROR: ISOVAR not found on topo file') + + call infld('ISOWGT', fh_topo, dim1name, dim2name, 1, pcols, & + begchunk, endchunk, rdg_isowgt, found, gridname='physgrid') + if (.not. found) call endrun(sub//': ERROR: ISOWGT not found on topo file') + call infld('HWDTH', fh_topo, dim1name, 'nrdg', dim2name, 1, pcols, & 1, prdg, begchunk, endchunk, rdg_hwdth, found, gridname='physgrid') if (.not. found) call endrun(sub//': ERROR: HWDTH not found on topo file') @@ -734,15 +746,39 @@ subroutine gw_init() call addfld('ZMGW', (/ 'lev' /) , 'A' ,'m' , & 'midlayer geopotential heights in GW code ' ) + + call addfld('NIEGW', (/ 'ilev' /) , 'I' ,'1/s' , & + 'interface BV freq in GW code ' ) + call addfld('NMEGW', (/ 'lev' /) , 'I' ,'1/s' , & + 'midlayer BV freq in GW code ' ) + call addfld('RHOIEGW', (/ 'ilev' /) , 'I' ,'kg/m^3' , & + 'interface density in GW code ' ) + call addfld('PINTEGW', (/ 'ilev' /) , 'I' ,'Pa' , & + 'interface density in GW code ' ) + call addfld('TAUM1_DIAG' , (/ 'ilev' /) , 'I' ,'N m-2' , & 'Ridge based momentum flux profile') call addfld('TAU1RDGBETAM' , (/ 'ilev' /) , 'I' ,'N m-2' , & 'Ridge based momentum flux profile') - call addfld('UBM1BETA', (/ 'lev' /) , 'A' ,'s-1' , & + call addfld('UBM1BETA', (/ 'lev' /) , 'A' ,'m s-1' , & 'On-ridge wind profile ' ) - call addfld('UBT1RDGBETA' , (/ 'lev' /) , 'I' ,'m s-1' , & + call addfld('UBT1RDGBETA' , (/ 'lev' /) , 'I' ,'m s-2' , & 'On-ridge wind tendency from ridge 1 ') + call addfld('TAURESIDBETAM' , (/ 'ilev' /) , 'I' ,'N m-2' , & + 'Ridge based momentum flux profile') + call addfld('UBMRESIDBETA', (/ 'lev' /) , 'I' ,'m s-1' , & + 'On-ridge wind profile ' ) + call addfld('UBIRESIDBETA', (/ 'ilev' /) , 'I' ,'m s-1' , & + 'On-ridge wind profile (interface) ' ) + call addfld('SRC_LEVEL_RESIDBETA', horiz_only , 'I' ,'1' , & + 'src level index for ridge residual ' ) + call addfld('TAUORO_RESID', horiz_only , 'I' ,'N m-2' , & + 'Surface mom flux from ridge reisdual ' ) + call addfld('TAUDIAG_RESID' , (/ 'ilev' /) , 'I' ,'N m-2' , & + 'Ridge based momentum flux profile') + + do i = 1, 6 write(cn, '(i1)') i call addfld('TAU'//cn//'RDGBETAY' , (/ 'ilev' /), 'I', 'N m-2', & @@ -1580,6 +1616,12 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) real(r8), pointer :: angll(:,:) ! anisotropy of ridges. real(r8), pointer :: anixy(:,:) + ! sqrt(residual variance) not repr by ridges (assumed isotropic). + real(r8), pointer :: isovar(:) + ! area fraction of res variance + real(r8), pointer :: isowgt(:) + + ! Gamma ridges ! width of ridges. @@ -2257,6 +2299,8 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) mxdis => rdg_mxdis(:ncol,:,lchnk) angll => rdg_angll(:ncol,:,lchnk) anixy => rdg_anixy(:ncol,:,lchnk) + isovar => rdg_isovar(:ncol,lchnk) + isowgt => rdg_isowgt(:ncol,lchnk) where(mxdis < 0._r8) mxdis = 0._r8 @@ -2276,6 +2320,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) nm, ni, rhoi, kvtt, q, dse, & effgw_rdg_beta, effgw_rdg_beta_max, & hwdth, clngt, gbxar, mxdis, angll, anixy, & + isovar, isowgt, & rdg_beta_cd_llb, trpd_leewv_rdg_beta, & ptend, flx_heat) @@ -2306,6 +2351,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) nm, ni, rhoi, kvtt, q, dse, & effgw_rdg_gamma, effgw_rdg_gamma_max, & hwdthg, clngtg, gbxar, mxdisg, angllg, anixyg, & + isovar, isowgt, & rdg_gamma_cd_llb, trpd_leewv_rdg_gamma, & ptend, flx_heat) @@ -2347,11 +2393,12 @@ subroutine gw_rdg_calc( & effgw_rdg, effgw_rdg_max, & hwdth, clngt, gbxar, & mxdis, angll, anixy, & + isovar, isowgt, & rdg_cd_llb, trpd_leewv, & ptend, flx_heat) use coords_1d, only: Coords1D - use gw_rdg, only: gw_rdg_src, gw_rdg_belowpeak, gw_rdg_break_trap, gw_rdg_do_vdiff + use gw_rdg, only: gw_rdg_src, gw_rdg_resid_src, gw_rdg_belowpeak, gw_rdg_break_trap, gw_rdg_do_vdiff use gw_common, only: gw_drag_prof, energy_change character(len=5), intent(in) :: type ! BETA or GAMMA @@ -2385,6 +2432,9 @@ subroutine gw_rdg_calc( & real(r8), intent(in) :: angll(ncol,prdg) ! orientation of ridges. real(r8), intent(in) :: anixy(ncol,prdg) ! Anisotropy parameter. + real(r8), intent(in) :: isovar(ncol) ! sqrt of residual variance + real(r8), intent(in) :: isowgt(ncol) ! area frac of residual variance + real(r8), intent(in) :: rdg_cd_llb ! Drag coefficient for low-level flow logical, intent(in) :: trpd_leewv @@ -2604,6 +2654,58 @@ subroutine gw_rdg_calc( & end do ! end of loop over multiple ridges + ! Add additional GW from residual variance. Assumed isotropic + !kwvrdg = 0.001_r8 / ( hwdth(:,nn) + 0.001_r8 ) ! this cant be done every time step !!! + kwvrdg = 0.001_r8 / ( 100._r8 ) + effgw = 1.0_r8 * isowgt + tauoro = 0._r8 + + call gw_rdg_resid_src(ncol, band_oro, p, & + u, v, t, isovar, kwvrdg, zi, nm, & + src_level, tend_level, tau, ubm, ubi, xv, yv, & + ubmsrc, usrc, vsrc, nsrc, rsrc, m2src, phase_speeds, tauoro ) + + call gw_drag_prof(ncol, band_oro, p, src_level, tend_level, dt, & + t, vramp, & + piln, rhoi, nm, ni, ubm, ubi, xv, yv, & + effgw, phase_speeds, kvtt, q, dse, tau, utgw, vtgw, & + ttgw, qtgw, egwdffi, gwut, dttdf, dttke, & + kwvrdg=kwvrdg, & + satfac_in = 1._r8, lapply_vdiff=gw_rdg_do_vdiff , tau_diag=tau_diag ) + + ! Add the tendencies from isotropic residual to the totals. + do k = 1, pver + ! diagnostics + utrdg(:,k) = utrdg(:,k) + utgw(:,k) + vtrdg(:,k) = vtrdg(:,k) + vtgw(:,k) + ttrdg(:,k) = ttrdg(:,k) + ttgw(:,k) + ! physics tendencies + ptend%u(:ncol,k) = ptend%u(:ncol,k) + utgw(:,k) + ptend%v(:ncol,k) = ptend%v(:ncol,k) + vtgw(:,k) + ptend%s(:ncol,k) = ptend%s(:ncol,k) + ttgw(:,k) + end do + + do m = 1, pcnst + do k = 1, pver + ptend%q(:ncol,k,m) = ptend%q(:ncol,k,m) + qtgw(:,k,m) + end do + end do + + do k = 1, pver+1 + taurx0(:,k) = tau(:,0,k)*xv + taury0(:,k) = tau(:,0,k)*yv + taurx(:,k) = taurx(:,k) + taurx0(:,k) + taury(:,k) = taury(:,k) + taury0(:,k) + end do + + call outfld('TAUDIAG_RESID', tau_diag, ncol, lchnk) + call outfld('TAUORO_RESID', tauoro , ncol, lchnk) + call outfld('TAURESID'//trim(type)//'M', tau(:,0,:), ncol, lchnk) + call outfld('UBMRESID'//trim(type), ubm, ncol, lchnk) + call outfld('UBIRESID'//trim(type), ubi, ncol, lchnk) + call outfld('SRC_LEVEL_RESID'//trim(type), 1._r8*src_level , ncol, lchnk) + ! end of residual variance calc + ! Calculate energy change for output to CAM's energy checker. call energy_change(dt, p, u, v, ptend%u(:ncol,:), & ptend%v(:ncol,:), ptend%s(:ncol,:), de) diff --git a/src/physics/cam/gw_rdg.F90 b/src/physics/cam/gw_rdg.F90 index b5a2a2137f..4c3e1ef745 100644 --- a/src/physics/cam/gw_rdg.F90 +++ b/src/physics/cam/gw_rdg.F90 @@ -19,6 +19,7 @@ module gw_rdg ! Public interface public :: gw_rdg_readnl public :: gw_rdg_src +public :: gw_rdg_resid_src public :: gw_rdg_belowpeak public :: gw_rdg_break_trap public :: gw_rdg_do_vdiff @@ -175,6 +176,211 @@ subroutine gw_rdg_readnl(nlfile) end subroutine gw_rdg_readnl +!========================================================================== +subroutine gw_rdg_resid_src(ncol, band, p, & + u, v, t, mxdis, kwvrdg, zi, nm, & + src_level, tend_level, tau, ubm, ubi, xv, yv, & + ubmsrc, usrc, vsrc, nsrc, rsrc, m2src, c, tauoro ) + use gw_common, only: rair, GWBand + use gw_utils, only: dot_2d, midpoint_interp, get_unit_vector + !----------------------------------------------------------------------- + ! Orographic source for multiple gravity wave drag parameterization. + ! + ! The stress is returned for a single wave with c=0, over orography. + ! For points where the orographic variance is small (including ocean), + ! the returned stress is zero. + !------------------------------Arguments-------------------------------- + ! Column dimension. + integer, intent(in) :: ncol + + ! Band to emit orographic waves in. + ! Regardless, we will only ever emit into l = 0. + type(GWBand), intent(in) :: band + ! Pressure coordinates. + type(Coords1D), intent(in) :: p + + + ! Midpoint zonal/meridional winds. ( m s-1) + real(r8), intent(in) :: u(ncol,pver), v(ncol,pver) + ! Midpoint temperatures. (K) + real(r8), intent(in) :: t(ncol,pver) + ! Height estimate for ridge (m) [anisotropic orography]. + real(r8), intent(in) :: mxdis(ncol) + ! horiz wavenumber [anisotropic orography]. + real(r8), intent(in) :: kwvrdg(ncol) + ! Interface altitudes above ground (m). + real(r8), intent(in) :: zi(ncol,pver+1) + ! Midpoint Brunt-Vaisalla frequencies (s-1). + real(r8), intent(in) :: nm(ncol,pver) + + ! Indices of top gravity wave source level and lowest level where wind + ! tendencies are allowed. + integer, intent(out) :: src_level(ncol) + integer, intent(out) :: tend_level(ncol) + + ! Averages over source region. + real(r8), intent(out) :: nsrc(ncol) ! B-V frequency. + real(r8), intent(out) :: rsrc(ncol) ! Density. + real(r8), intent(out) :: usrc(ncol) ! Zonal wind. + real(r8), intent(out) :: vsrc(ncol) ! Meridional wind. + real(r8), intent(out) :: ubmsrc(ncol) ! On-obstacle wind. + ! normalized wavenumber + real(r8), intent(out) :: m2src(ncol) + + + ! Wave Reynolds stress. + real(r8), intent(out) :: tau(ncol,-band%ngwv:band%ngwv,pver+1) + ! Projection of wind at midpoints and interfaces. + real(r8), intent(out) :: ubm(ncol,pver), ubi(ncol,pver+1) + ! Unit vectors of source wind (zonal and meridional components). + real(r8), intent(out) :: xv(ncol), yv(ncol) + ! Phase speeds. + real(r8), intent(out) :: c(ncol,-band%ngwv:band%ngwv) + ! source level mom. flux + real(r8), intent(out) :: tauoro(ncol) + + !---------------------------Local Storage------------------------------- + ! Column and level indices. + integer :: i, k + + ! Surface streamline displacement height (2*sgh). + real(r8) :: hdsp(ncol) + + ! Difference in interface pressure across source region. + real(r8) :: dpsrc(ncol) + ! Thickness of downslope wind region. + real(r8) :: ddw(ncol) + ! Thickness of linear wave region. + real(r8) :: dwv(ncol) + ! Wind speed in source region. + real(r8) :: wmsrc(ncol) + ! source level mom. flux + !real(r8) :: tauoro(ncol) + + real(r8) :: ragl(ncol) + real(r8) :: Fcrit_res,sghmax + +!-------------------------------------------------------------------------- +! Check that ngwav is equal to zero, otherwise end the job +!-------------------------------------------------------------------------- + if (band%ngwv /= 0) call endrun(' gw_rdg_src :: ERROR - band%ngwv must be zero and it is not') + +!-------------------------------------------------------------------------- +! Average the basic state variables for the wave source over the depth of +! the orographic standard deviation. Here we assume that the appropiate +! values of wind, stability, etc. for determining the wave source are +! averages over the depth of the atmosphere penterated by the typical +! mountain. +! Reduces to the bottom midpoint values when mxdis=0, such as over ocean. +!-------------------------------------------------------------------------- + + Fcrit_res = 1.0_r8 + hdsp = mxdis ! no longer multipied by 2 + where(hdsp < 10._r8) + hdsp = 0._r8 + end where + + src_level = pver+1 + + tau(:,0,:) = 0.0_r8 + + ! Find depth of "source layer" for mountain waves + ! i.e., between ground and mountain top + do k = pver, 1, -1 + do i = 1, ncol + ! Need to have h >= z(k+1) here or code will bomb when h=0. + if ( (hdsp(i) >= zi(i,k+1)) .and. (hdsp(i) < zi(i,k)) ) then + src_level(i) = k + end if + end do + end do + + rsrc = 0._r8 + usrc = 0._r8 + vsrc = 0._r8 + nsrc = 0._r8 + do i = 1, ncol + do k = pver, src_level(i), -1 + rsrc(i) = rsrc(i) + p%mid(i,k) / (rair*t(i,k))* p%del(i,k) + usrc(i) = usrc(i) + u(i,k) * p%del(i,k) + vsrc(i) = vsrc(i) + v(i,k) * p%del(i,k) + nsrc(i) = nsrc(i) + nm(i,k)* p%del(i,k) + end do + end do + + + do i = 1, ncol + dpsrc(i) = p%ifc(i,pver+1) - p%ifc(i,src_level(i)) + end do + + rsrc = rsrc / dpsrc + usrc = usrc / dpsrc + vsrc = vsrc / dpsrc + nsrc = nsrc / dpsrc + + ! Get the unit vector components and magnitude at the surface. + call get_unit_vector(usrc, vsrc, xv, yv, wmsrc ) + + ubmsrc = wmsrc + + ! Project the local wind at midpoints onto the source wind. + do k = 1, pver + ubm(:,k) = dot_2d(u(:,k), v(:,k), xv, yv) + end do + + ! Compute the interface wind projection by averaging the midpoint winds. + ! Use the top level wind at the top interface. + ubi(:,1) = ubm(:,1) + + ubi(:,2:pver) = midpoint_interp(ubm) + + ! The minimum stratification allowing GW behavior + ! should really depend on horizontal scale since + ! + ! m^2 ~ (N/U)^2 - k^2 + ! + + m2src = ( (nsrc/(ubmsrc+0.01_r8))**2 - kwvrdg**2 ) /((nsrc/(ubmsrc+0.01_r8))**2) + + ! Compute the interface wind projection by averaging the midpoint winds. + ! Use the top level wind at the top interface. + ubi(:,1) = ubm(:,1) + ubi(:,2:pver) = midpoint_interp(ubm) + ubi(:,pver+1) = ubm(:,pver) + + + + ! Determine the orographic c=0 source term following McFarlane (1987). + ! Set the source top interface index to pver, if the orographic term is + ! zero. + do i = 1, ncol + if ( ( src_level(i) > 0 ) .and. ( m2src(i) > orom2min ) ) then + sghmax = Fcrit_res * (ubmsrc(i) / nsrc(i))**2 + tauoro(i) = 0.5_r8 * kwvrdg(i) * min(hdsp(i)**2, sghmax) * & + rsrc(i) * nsrc(i) * ubmsrc(i) + else + tauoro(i) = 0._r8 + end if + end do + + do i = 1, ncol + do k=src_level(i),pver+1 + tau(i,0,k) = tauoro(i) + end do + end do + + + ! Allow wind tendencies all the way to the model bottom. + tend_level = pver + + ! No spectrum; phase speed is just 0. + c = 0._r8 + +end subroutine gw_rdg_resid_src + + +!========================================================================== + subroutine gw_rdg_src(ncol, band, p, & u, v, t, mxdis, angxy, anixy, kwvrdg, iso, zi, nm, & src_level, tend_level, bwv_level ,tlb_level , tau, ubm, ubi, xv, yv, & From 176bbd3e22d243f32bfb5c2b7cf23a1e07c62521 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 23 Aug 2024 10:46:21 -0600 Subject: [PATCH 02/65] add template for two namelist variables for gw_drag --- bld/build-namelist | 5 +++++ bld/namelist_files/namelist_defaults_cam.xml | 4 ++++ bld/namelist_files/namelist_definition.xml | 12 +++++++++++ src/physics/cam/gw_drag.F90 | 22 +++++++++++++++----- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index bd91edc9f1..78e3c8c23c 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3795,6 +3795,7 @@ my $do_gw_convect_sh = ($nl->get_value('use_gw_convect_sh') =~ /$TRUE/io); my $do_gw_movmtn_pbl = ($nl->get_value('use_gw_movmtn_pbl') =~ /$TRUE/io); my $do_gw_rdg_beta = ($nl->get_value('use_gw_rdg_beta') =~ /$TRUE/io); my $do_gw_rdg_gamma = ($nl->get_value('use_gw_rdg_gamma') =~ /$TRUE/io); +my $do_gw_rdg_resid = ($nl->get_value('use_gw_rdg_resid') =~ /$TRUE/io); my $do_divstream = ($nl->get_value('gw_rdg_do_divstream') =~ /$TRUE/io); @@ -3872,6 +3873,10 @@ if ($do_gw_rdg_beta) { add_default($nl, 'gw_prndl'); } +if ($do_gw_rdg_resid) { + add_default($nl, 'effgw_rdg_resid'); +} + if ($do_gw_rdg_gamma) { add_default($nl, 'n_rdg_gamma', 'val'=>'-1'); add_default($nl, 'effgw_rdg_gamma', 'val'=>'1.0D0'); diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 308e128304..3374ad09b4 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -836,6 +836,10 @@ 0.5D0 0.5D0 +JULIO +JULIO +JULIO + 0.03D0 diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index e0c4b46778..239c19f986 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1338,6 +1338,12 @@ Whether or not to enable gravity waves from PBL moving mountains source. Default: .false. + +JULIO - need to add comment +Default: .false. + + Gravity wave spectrum dimension (wave numbers are from -pgwv to pgwv). @@ -1441,6 +1447,12 @@ Max efficiency associated with anisotropic OGW. Default: 1.0 + +JULIO - need to add comment and appropriate default +Default: ?????? JULIO + + Drag coefficient for obstacles in low-level flow. diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 627ec82e17..3d50877cbe 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -110,6 +110,11 @@ module gw_drag ! Beres (shallow convection). real(r8) :: effgw_beres_sh = unset_r8 + + ! JULIO - Please put in appropriate comment + logical :: use_gw_rdg_resid = false + read(r8) :: effgw_rdg_resid = unset_r8 + ! Horzontal wavelengths [m]. real(r8), parameter :: wavelength_mid = 1.e5_r8 real(r8), parameter :: wavelength_long = 3.e5_r8 @@ -252,7 +257,9 @@ subroutine gw_drag_readnl(nlfile) rdg_gamma_cd_llb, trpd_leewv_rdg_gamma, bnd_rdggm, & gw_oro_south_fac, gw_limit_tau_without_eff, & gw_lndscl_sgh, gw_prndl, gw_apply_tndmax, gw_qbo_hdepth_scaling, & - gw_top_taper, front_gaussian_width, alpha_gw_movmtn + gw_top_taper, front_gaussian_width, alpha_gw_movmtn, use_gw_rdg_resid, & + effgw_rdg_resid + !---------------------------------------------------------------------- if (use_simple_phys) return @@ -361,6 +368,11 @@ subroutine gw_drag_readnl(nlfile) call mpi_bcast(alpha_gw_movmtn, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: alpha_gw_movmtn") + call mpi_bcast(use_gw_rdg_resid, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: use_gw_rdg_resid") + call mpi_bcast(effgw_rdg_resid, 1, mpi_real8, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: effgw_rdg_resid") + ! Check if fcrit2 was set. call shr_assert(fcrit2 /= unset_r8, & "gw_drag_readnl: fcrit2 must be set via the namelist."// & @@ -746,7 +758,7 @@ subroutine gw_init() call addfld('ZMGW', (/ 'lev' /) , 'A' ,'m' , & 'midlayer geopotential heights in GW code ' ) - + call addfld('NIEGW', (/ 'ilev' /) , 'I' ,'1/s' , & 'interface BV freq in GW code ' ) call addfld('NMEGW', (/ 'lev' /) , 'I' ,'1/s' , & @@ -778,7 +790,7 @@ subroutine gw_init() call addfld('TAUDIAG_RESID' , (/ 'ilev' /) , 'I' ,'N m-2' , & 'Ridge based momentum flux profile') - + do i = 1, 6 write(cn, '(i1)') i call addfld('TAU'//cn//'RDGBETAY' , (/ 'ilev' /), 'I', 'N m-2', & @@ -1621,7 +1633,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) ! area fraction of res variance real(r8), pointer :: isowgt(:) - + ! Gamma ridges ! width of ridges. @@ -2659,7 +2671,7 @@ subroutine gw_rdg_calc( & kwvrdg = 0.001_r8 / ( 100._r8 ) effgw = 1.0_r8 * isowgt tauoro = 0._r8 - + call gw_rdg_resid_src(ncol, band_oro, p, & u, v, t, isovar, kwvrdg, zi, nm, & src_level, tend_level, tau, ubm, ubi, xv, yv, & From 78ada3c3c67ae7d90420813b5485d95da08804cf Mon Sep 17 00:00:00 2001 From: Brian Eaton Date: Mon, 18 Nov 2024 11:59:11 -0500 Subject: [PATCH 03/65] Restore spectral scaling to RRTMGP --- bld/build-namelist | 8 +- doc/ChangeLog | 83 +++++++++++++++ src/physics/rrtmgp/rad_solar_var.F90 | 149 +++++++++++++++++++++++++++ src/physics/rrtmgp/radconstants.F90 | 6 ++ src/physics/rrtmgp/radiation.F90 | 14 +-- 5 files changed, 249 insertions(+), 11 deletions(-) create mode 100644 src/physics/rrtmgp/rad_solar_var.F90 diff --git a/bld/build-namelist b/bld/build-namelist index 66c3574a62..5991cb1a01 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -755,11 +755,9 @@ if ($rad_pkg =~ /rrtmg/ or $chem =~ /waccm/) { # use solar data file as the default for rrtmg and waccm_ma add_default($nl, 'solar_irrad_data_file'); - # This option only used by camrt and rrtmg radiation schemes. - # The solar spectral scaling is done internal to RRTMGP code. - if ($rad_pkg ne 'rrtmgp') { - add_default($nl, 'solar_htng_spctrl_scl', 'val'=>'.true.'); - } + # The solar spectral scaling is done based on the distribution from + # the solar_irrad_data_file. + add_default($nl, 'solar_htng_spctrl_scl', 'val'=>'.true.'); } elsif (!$simple_phys) { diff --git a/doc/ChangeLog b/doc/ChangeLog index fdc0c4aa65..3fd14e7628 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,88 @@ =============================================================== +Tag name: +Originator(s): brianpm, eaton +Date: +One-line Summary: Restore spectral scaling to RRTMGP +Github PR URL: + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + +resolve issue #1193 - Restore spectral scaling to RRTMGP + +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: not evaluated + +Code reviewed by: + +List all files eliminated: none + +List all files added and what they do: + +src/physics/rrtmgp/rad_solar_var.F90 +. compute scale factors for solar irradiance based on input dataset + +List all existing files that have been modified, and describe the changes: + +bld/build-namelist +. change default setting of solar_htng_spctrl_scl to true for rrtmgp + +src/physics/rrtmgp/radconstants.F90 +. add module data band2gpt_sw and set using kdist_sw%get_band_lims_gpoint() + +src/physics/rrtmgp/radiation.F90 +. radiation_init + - add call to rad_solar_var_init +. radiation_tend + - replace code that scales the solar source based on internal RRTMGP + spectral distribution by a scaling based on distribution from the + solar_irrad_data_file. + +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: + +derecho/nvhpc/aux_cam: + +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, i.e., +- what code configurations: +- what platforms/compilers: +- nature of change (roundoff; larger than roundoff but same climate; new + climate): + +If bitwise differences were observed, how did you show they were no worse +than roundoff? + +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: + +MSS location of control simulations used to validate new climate: + +URL for AMWG diagnostics output used to validate new climate: + +=============================================================== +=============================================================== + Tag name: cam6_4_046 Originator(s): sjsprecious Date: 06 November 2024 diff --git a/src/physics/rrtmgp/rad_solar_var.F90 b/src/physics/rrtmgp/rad_solar_var.F90 new file mode 100644 index 0000000000..ab608db7f9 --- /dev/null +++ b/src/physics/rrtmgp/rad_solar_var.F90 @@ -0,0 +1,149 @@ +!------------------------------------------------------------------------------- +! This module uses the solar irradiance data +! to provide a spectral scaling factor +! to approximate the spectral distribution of irradiance +! when the radiation scheme might use a different solar source function +!------------------------------------------------------------------------------- +module rad_solar_var + + use shr_kind_mod , only : r8 => shr_kind_r8 + use radconstants, only : nswbands, get_sw_spectral_boundaries, band2gpt_sw + use solar_irrad_data, only : sol_irrad, we, nbins, has_spectrum, sol_tsi + use solar_irrad_data, only : do_spctrl_scaling + use cam_abortutils, only : endrun + use error_messages, only : alloc_err + + implicit none + save + + private + public :: rad_solar_var_init + public :: get_variability + + real(r8), allocatable :: irrad(:) ! solar irradiance at model timestep in each band + + real(r8), allocatable :: radbinmax(:) + real(r8), allocatable :: radbinmin(:) + +!------------------------------------------------------------------------------- +contains +!------------------------------------------------------------------------------- + + subroutine rad_solar_var_init( ) + + integer :: ierr + integer :: radmax_loc + + if ( do_spctrl_scaling ) then + + if ( .not.has_spectrum ) then + call endrun('rad_solar_var_init: solar input file must have irradiance spectrum') + endif + + allocate (radbinmax(nswbands),stat=ierr) + if (ierr /= 0) then + call endrun('rad_solar_var_init: Error allocating space for radbinmax') + end if + + allocate (radbinmin(nswbands),stat=ierr) + if (ierr /= 0) then + call endrun('rad_solar_var_init: Error allocating space for radbinmin') + end if + + allocate (irrad(nswbands), stat=ierr) + if (ierr /= 0) then + call endrun('rad_solar_var_init: Error allocating space for irrad') + end if + + call get_sw_spectral_boundaries(radbinmin, radbinmax, 'nm') + + ! Make sure that the far-IR is included, even if radiation grid does not + ! extend that far down. 10^5 nm corresponds to a wavenumber of + ! 100 cm^-1. + radmax_loc = maxloc(radbinmax,1) + radbinmax(radmax_loc) = max(100000._r8,radbinmax(radmax_loc)) + + endif + + end subroutine rad_solar_var_init + +!------------------------------------------------------------------------------- +!------------------------------------------------------------------------------- + + subroutine get_variability(toa_flux, sfac) + + ! Arguments + real(r8), intent(in) :: toa_flux(:,:) ! TOA flux to be scaled (columns,gpts) + real(r8), intent(out) :: sfac(:,:) ! scaling factors (columns,gpts) + + ! Local variables + integer :: i, j, istat, gpt_start, gpt_end, ncols + real(r8), allocatable :: scale(:) + character(len=*), parameter :: sub = 'get_variability' + + if (do_spctrl_scaling) then + + ! Determine target irradiance for each band + call integrate_spectrum(nbins, nswbands, we, radbinmin, radbinmax, sol_irrad, irrad) + + ncols = size(toa_flux, 1) + allocate(scale(ncols), stat=istat) + call alloc_err(istat, sub, 'scale', ncols) + + do i = 1, nswbands + gpt_start = band2gpt_sw(1,i) + gpt_end = band2gpt_sw(2,i) + scale = spread(irrad(i), 1, ncols) / sum(toa_flux(:, gpt_start:gpt_end), dim=2) + do j = gpt_start, gpt_end + sfac(:,j) = scale + end do + end do + + else + sfac(:,:) = sol_tsi / spread(sum(toa_flux, 2), 2, size(toa_flux, 2)) + end if + end subroutine get_variability + + +!------------------------------------------------------------------------------- +! private method......... +!------------------------------------------------------------------------------- + + subroutine integrate_spectrum( nsrc, ntrg, src_x, min_trg, max_trg, src, trg ) + + use mo_util, only : rebin + + implicit none + + !--------------------------------------------------------------- + ! ... dummy arguments + !--------------------------------------------------------------- + integer, intent(in) :: nsrc ! dimension source array + integer, intent(in) :: ntrg ! dimension target array + real(r8), intent(in) :: src_x(nsrc+1) ! source coordinates + real(r8), intent(in) :: max_trg(ntrg) ! target coordinates + real(r8), intent(in) :: min_trg(ntrg) ! target coordinates + real(r8), intent(in) :: src(nsrc) ! source array + real(r8), intent(out) :: trg(ntrg) ! target array + + !--------------------------------------------------------------- + ! ... local variables + !--------------------------------------------------------------- + real(r8) :: trg_x(2), targ(1) ! target coordinates + integer :: i + + do i = 1, ntrg + + trg_x(1) = min_trg(i) + trg_x(2) = max_trg(i) + + call rebin( nsrc, 1, src_x, trg_x, src(1:nsrc), targ(:) ) + ! W/m2/nm --> W/m2 + trg( i ) = targ(1)*(trg_x(2)-trg_x(1)) + + enddo + + + end subroutine integrate_spectrum + +end module rad_solar_var diff --git a/src/physics/rrtmgp/radconstants.F90 b/src/physics/rrtmgp/radconstants.F90 index f490b81b7b..3d4b47d09e 100644 --- a/src/physics/rrtmgp/radconstants.F90 +++ b/src/physics/rrtmgp/radconstants.F90 @@ -26,6 +26,9 @@ module radconstants logical :: wavenumber_boundaries_set = .false. +! First and last g-point for each band. +integer, public, protected :: band2gpt_sw(2,nswbands) + integer, public, protected :: nswgpts ! number of SW g-points integer, public, protected :: nlwgpts ! number of LW g-points @@ -104,6 +107,9 @@ subroutine set_wavenumber_bands(kdist_sw, kdist_lw) wavenumber_low_shortwave = values(1,:) wavenumber_high_shortwave = values(2,:) + ! First and last g-point for each SW band: + band2gpt_sw = kdist_sw%get_band_lims_gpoint() + ! Indices into specific bands idx_sw_diag = get_band_index_by_value('sw', 500.0_r8, 'nm') idx_nir_diag = get_band_index_by_value('sw', 1000.0_r8, 'nm') diff --git a/src/physics/rrtmgp/radiation.F90 b/src/physics/rrtmgp/radiation.F90 index bb1667b0ec..58a973a3f0 100644 --- a/src/physics/rrtmgp/radiation.F90 +++ b/src/physics/rrtmgp/radiation.F90 @@ -16,7 +16,6 @@ module radiation pbuf_set_field, pbuf_get_field, pbuf_old_tim_idx use camsrfexch, only: cam_out_t, cam_in_t use physconst, only: cappa, cpair, gravit -use solar_irrad_data, only: sol_tsi use time_manager, only: get_nstep, is_first_step, is_first_restart_step, & get_curr_calday, get_step_size @@ -27,6 +26,7 @@ module radiation use radconstants, only: nradgas, gasnamelength, gaslist, nswbands, nlwbands, & nswgpts, set_wavenumber_bands +use rad_solar_var, only: rad_solar_var_init, get_variability use cloud_rad_props, only: cloud_rad_props_init @@ -495,6 +495,7 @@ subroutine radiation_init(pbuf2d) ! Set the sw/lw band boundaries in radconstants. Also sets ! indicies of specific bands for diagnostic output and COSP input. call set_wavenumber_bands(kdist_sw, kdist_lw) + call rad_solar_var_init() ! The spectral band boundaries need to be set before this init is called. call rrtmgp_inputs_init(ktopcam, ktoprad) @@ -937,8 +938,8 @@ subroutine radiation_tend( & ! TOA solar flux on RRTMGP g-points real(r8), allocatable :: toa_flux(:,:) - ! TSI from RRTMGP data (from sum over g-point representation) - real(r8) :: tsi_ref + ! Scale factors based on spectral distribution from input irradiance dataset + real(r8), allocatable :: sfac(:,:) ! Planck sources for LW. type(ty_source_func_lw) :: sources_lw @@ -1097,6 +1098,7 @@ subroutine radiation_tend( & allocate( & t_sfc(ncol), emis_sfc(nlwbands,ncol), toa_flux(nday,nswgpts), & + sfac(nday,nswgpts), & t_rad(ncol,nlay), pmid_rad(ncol,nlay), pint_rad(ncol,nlay+1), & t_day(nday,nlay), pmid_day(nday,nlay), pint_day(nday,nlay+1), & coszrs_day(nday), alb_dir(nswbands,nday), alb_dif(nswbands,nday), & @@ -1174,8 +1176,8 @@ subroutine radiation_tend( & call stop_on_err(errmsg, sub, 'kdist_sw%gas_optics') ! Scale the solar source - tsi_ref = sum(toa_flux(1,:)) - toa_flux = toa_flux * sol_tsi * eccf / tsi_ref + call get_variability(toa_flux, sfac) + toa_flux = toa_flux * sfac * eccf end if @@ -1303,7 +1305,7 @@ subroutine radiation_tend( & end if ! if (dolw) deallocate( & - t_sfc, emis_sfc, toa_flux, t_rad, pmid_rad, pint_rad, & + t_sfc, emis_sfc, toa_flux, sfac, t_rad, pmid_rad, pint_rad, & t_day, pmid_day, pint_day, coszrs_day, alb_dir, alb_dif) !================! From fa69b875ca03e801463b7f23a2c04bd5f9722aa2 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Wed, 11 Dec 2024 13:56:30 -0700 Subject: [PATCH 04/65] more sane way to control nitrogen deposition to surface models modified: bld/build-namelist modified: bld/namelist_files/namelist_defaults_cam.xml modified: bld/namelist_files/namelist_definition.xml modified: bld/namelist_files/use_cases/1850_cam_lt.xml modified: bld/namelist_files/use_cases/1850_cam_mt.xml modified: bld/namelist_files/use_cases/hist_cam_lt.xml modified: bld/namelist_files/use_cases/hist_cam_mt.xml modified: cime_config/buildnml modified: cime_config/config_component.xml modified: src/chemistry/mozart/chemistry.F90 modified: src/chemistry/mozart/mo_chm_diags.F90 modified: src/chemistry/pp_none/chemistry.F90 modified: src/control/camsrfexch.F90 modified: src/control/runtime_opts.F90 modified: src/cpl/nuopc/atm_import_export.F90 modified: src/cpl/nuopc/atm_stream_ndep.F90 modified: src/physics/cam/cam_diagnostics.F90 modified: src/utils/srf_field_check.F90 --- bld/build-namelist | 8 --- bld/namelist_files/namelist_defaults_cam.xml | 7 ++ bld/namelist_files/namelist_definition.xml | 19 ++--- bld/namelist_files/use_cases/1850_cam_lt.xml | 7 ++ bld/namelist_files/use_cases/1850_cam_mt.xml | 7 ++ bld/namelist_files/use_cases/hist_cam_lt.xml | 7 ++ bld/namelist_files/use_cases/hist_cam_mt.xml | 7 ++ cime_config/buildnml | 12 ---- cime_config/config_component.xml | 73 ------------------- src/chemistry/mozart/chemistry.F90 | 15 ++-- src/chemistry/mozart/mo_chm_diags.F90 | 5 ++ src/chemistry/pp_none/chemistry.F90 | 35 ++++----- src/control/camsrfexch.F90 | 30 ++++---- src/control/runtime_opts.F90 | 2 + src/cpl/nuopc/atm_import_export.F90 | 76 ++++++++------------ src/cpl/nuopc/atm_stream_ndep.F90 | 67 +++++++++-------- src/physics/cam/cam_diagnostics.F90 | 10 +++ src/utils/srf_field_check.F90 | 12 ---- 18 files changed, 170 insertions(+), 229 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 66c3574a62..6dd96595d9 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -509,14 +509,6 @@ if ($phys_mode_flags > 1) { my $simple_phys = 0; if ($adia_mode or $ideal_mode) { $simple_phys = 1; } -# If running either a simple physics or an aquaplanet configuration, the nitrogen -# deposition data is not used. These files are set in buildnml and can't be overridden -# via user_nl_cam. So provide an override here. -if ($simple_phys or $aqua_mode) { - $nl->set_variable_value('ndep_stream_nl', 'stream_ndep_data_filename', '" "'); - $nl->set_variable_value('ndep_stream_nl', 'stream_ndep_mesh_filename', '" "'); -} - # Single column mode my $scam = $cfg->get('scam'); my $scam_iop = $cfg->get('scam_iop'); diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 462570da4a..ab2707290c 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2060,6 +2060,13 @@ atm/cam/dst/dst_source2x2tuned-cam4-06132012.nc atm/cam/dst/dst_source1x1tuned-cam4-06202012.nc + +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +2000 +2000 +1 + .false. .true. diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index bd003c779a..4aaa038224 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -7609,40 +7609,29 @@ Bubble-mediated sea-air transfer. See ocean_emis.F90 for details. Default: FALSE - -List of nitrogen deposition fluxes to be sent from CAM to surface models. -Default: set by build-namelist. - - -Year first to use in nitrogen deposition stream data. Set by case xml variable -CAM_STREAM_NDEP_YEAR_FIRST +Year first to use in nitrogen deposition stream data. Year last to use in nitrogen deposition stream data. -Set by case xml variable CAM_STREAM_NDEP_YEAR_LAST -Model year to align with CAM_STREAM_NDEP_YEAR_FIRST. -Set by case xml variable CAM_STREAM_NDEP_YEAR_ALIGN +Model year to align with stream_ndep_year_first. -NDEP stream data filename. -Set by case xml variable CAM_STREAM_NDEP_DATA_FILENAME. +Nitrogen deposition stream data filename. -NDEP mesh file corresponding to sream_ndep_data_filename. -Set by case xml variable CAM_STREAM_NDEP_MESH_FILENAME. +Grid mesh file corresponding to stream_ndep_data_filename. CYCLICAL 1850 + +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +1850 +1850 +1 + diff --git a/bld/namelist_files/use_cases/1850_cam_mt.xml b/bld/namelist_files/use_cases/1850_cam_mt.xml index 5a535f27be..df05241070 100644 --- a/bld/namelist_files/use_cases/1850_cam_mt.xml +++ b/bld/namelist_files/use_cases/1850_cam_mt.xml @@ -56,4 +56,11 @@ CYCLICAL 1850 + +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +1850 +1850 +1 + diff --git a/bld/namelist_files/use_cases/hist_cam_lt.xml b/bld/namelist_files/use_cases/hist_cam_lt.xml index c436b97c1f..a7cd6c0e9c 100644 --- a/bld/namelist_files/use_cases/hist_cam_lt.xml +++ b/bld/namelist_files/use_cases/hist_cam_lt.xml @@ -42,4 +42,11 @@ INTERP_MISSING_MONTHS SERIAL + +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +1850 +2015 +1850 + diff --git a/bld/namelist_files/use_cases/hist_cam_mt.xml b/bld/namelist_files/use_cases/hist_cam_mt.xml index c100cc6e85..63b6691929 100644 --- a/bld/namelist_files/use_cases/hist_cam_mt.xml +++ b/bld/namelist_files/use_cases/hist_cam_mt.xml @@ -37,4 +37,11 @@ INTERP_MISSING_MONTHS SERIAL + +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +1850 +2015 +1850 + diff --git a/cime_config/buildnml b/cime_config/buildnml index 9c156b66d5..674d1a29ea 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -48,12 +48,6 @@ def buildnml(case, caseroot, compname): RUN_REFTOD = case.get_value("RUN_REFTOD") COMP_INTERFACE = case.get_value("COMP_INTERFACE") - stream_ndep_year_first = case.get_value("CAM_STREAM_NDEP_YEAR_FIRST") - stream_ndep_year_last = case.get_value("CAM_STREAM_NDEP_YEAR_LAST") - stream_ndep_year_align = case.get_value("CAM_STREAM_NDEP_YEAR_ALIGN") - stream_ndep_data_filename = case.get_value("CAM_STREAM_NDEP_DATA_FILENAME") - stream_ndep_mesh_filename = case.get_value("CAM_STREAM_NDEP_MESH_FILENAME") - testsrc = os.path.join(srcroot, "components", "cam") if os.path.exists(testsrc): srcroot = testsrc @@ -173,12 +167,6 @@ def buildnml(case, caseroot, compname): buildnl_opts += ["-inputdata", input_data_list] - CAM_NAMELIST_OPTS += " stream_ndep_year_first=" + stream_ndep_year_first - CAM_NAMELIST_OPTS += " stream_ndep_year_last=" + stream_ndep_year_last - CAM_NAMELIST_OPTS += " stream_ndep_year_align=" + stream_ndep_year_align - CAM_NAMELIST_OPTS += " stream_ndep_data_filename='" + stream_ndep_data_filename.strip() + "'" - CAM_NAMELIST_OPTS += " stream_ndep_mesh_filename='" + stream_ndep_mesh_filename.strip() + "'" - buildnl_opts += ["-namelist", '" &atmexp ' + CAM_NAMELIST_OPTS + '/" '] diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 2ab0a50558..ef718404f5 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -383,79 +383,6 @@ User mods to apply to specific compset matches. - - - - char - 2000 - - 1850 - 2010 - 1850 - 2015 - - run_component_cam - env_run.xml - Nitrogen deposition data year first - - - - char - 2000 - - 2010 - 1850 - 2015 - 2101 - - run_component_cam - env_run.xml - Nitrogen deposition data year last - - - - char - 1 - - 1850 - 2015 - - run_component_cam - env_run.xml - Nitrogen deposition align CAM_STREAM_NDEP_YEAR_FIRST with this model year - - - - - char - UNSET - - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.002_1849-2101_monthly_0.9x1.25_c211216.nc - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc - $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - - run_component_cam - env_run.xml - Nitrogen deposition data filename - - - - char - $DIN_LOC_ROOT/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc - run_component_cam - env_run.xml - Nitrogen deposition mesh filename (corresponding to the CAM_STREAM_NDEP_DATA_FILENAME) - - ========================================= CAM naming conventions diff --git a/src/chemistry/mozart/chemistry.F90 b/src/chemistry/mozart/chemistry.F90 index 085bd2237b..6527b0ccc1 100644 --- a/src/chemistry/mozart/chemistry.F90 +++ b/src/chemistry/mozart/chemistry.F90 @@ -24,6 +24,7 @@ module chemistry use ref_pres, only : ptop_ref use phys_control, only : waccmx_is ! WACCM-X switch query function use phys_control, only : use_hemco ! HEMCO switch logical + use mo_chm_diags, only : chem_has_ndep_flx => chm_prod_ndep_flx implicit none private @@ -46,6 +47,7 @@ module chemistry public :: chem_read_restart public :: chem_init_restart public :: chem_emissions + public :: chem_has_ndep_flx integer, public :: imozart = -1 ! index of 1st constituent @@ -1147,6 +1149,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o) use mo_neu_wetdep, only : neu_wetdep_tend use aerodep_flx, only : aerodep_flx_prescribed use short_lived_species, only : short_lived_species_writeic + use atm_stream_ndep, only : ndep_stream_active implicit none @@ -1265,11 +1268,13 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o) cam_out%precc, cam_out%precl, cam_in%snowhland, ghg_chem, state%latmapback, & drydepflx, wetdepflx, cam_in%cflx, cam_in%fireflx, cam_in%fireztop, & nhx_nitrogen_flx, noy_nitrogen_flx, use_hemco, ptend%q, pbuf ) - if (associated(cam_out%nhx_nitrogen_flx)) then - cam_out%nhx_nitrogen_flx(:ncol) = nhx_nitrogen_flx(:ncol) - endif - if (associated(cam_out%noy_nitrogen_flx)) then - cam_out%noy_nitrogen_flx(:ncol) = noy_nitrogen_flx(:ncol) + if (.not.ndep_stream_active) then + if (associated(cam_out%nhx_nitrogen_flx)) then + cam_out%nhx_nitrogen_flx(:ncol) = nhx_nitrogen_flx(:ncol) + endif + if (associated(cam_out%noy_nitrogen_flx)) then + cam_out%noy_nitrogen_flx(:ncol) = noy_nitrogen_flx(:ncol) + endif endif call t_stopf( 'chemdr' ) diff --git a/src/chemistry/mozart/mo_chm_diags.F90 b/src/chemistry/mozart/mo_chm_diags.F90 index 5650403fee..1a11b2b39d 100644 --- a/src/chemistry/mozart/mo_chm_diags.F90 +++ b/src/chemistry/mozart/mo_chm_diags.F90 @@ -18,6 +18,7 @@ module mo_chm_diags public :: chm_diags_inti public :: chm_diags public :: het_diags + public :: chm_prod_ndep_flx integer :: id_n,id_no,id_no2,id_no3,id_n2o5,id_hno3,id_ho2no2,id_clono2,id_brono2 integer :: id_isopfdn, id_isopfdnc, id_terpfdn !these are dinitrates @@ -55,6 +56,8 @@ module mo_chm_diags real(r8), parameter :: N_molwgt = 14.00674_r8 real(r8), parameter :: S_molwgt = 32.066_r8 + logical, protected :: chm_prod_ndep_flx =.false. + contains subroutine chm_diags_inti @@ -330,6 +333,8 @@ subroutine chm_diags_inti toth_species = (/ id_ch4, id_h2o, id_h2 /) + chm_prod_ndep_flx = any(noy_species>0) .or. any(nhx_species>0) + call addfld( 'NOX', (/ 'lev' /), 'A', 'mol/mol', 'nox (N+NO+NO2)' ) call addfld( 'NOY', (/ 'lev' /), 'A', 'mol/mol', & 'noy = total nitrogen (N+NO+NO2+NO3+2N2O5+HNO3+HO2NO2+ORGNOY+NH4NO3)' ) diff --git a/src/chemistry/pp_none/chemistry.F90 b/src/chemistry/pp_none/chemistry.F90 index 7e67fadb6e..9da9aa0852 100644 --- a/src/chemistry/pp_none/chemistry.F90 +++ b/src/chemistry/pp_none/chemistry.F90 @@ -7,7 +7,7 @@ module chemistry use shr_kind_mod, only: r8 => shr_kind_r8 use physics_types, only: physics_state, physics_ptend use ppgrid, only: begchunk, endchunk, pcols - + implicit none private @@ -27,9 +27,10 @@ module chemistry public :: chem_write_restart public :: chem_read_restart public :: chem_init_restart - public :: chem_readnl ! read chem namelist + public :: chem_readnl ! read chem namelist public :: chem_reset_fluxes public :: chem_emissions + public :: chem_has_ndep_flx interface chem_write_restart module procedure chem_write_restart_bin @@ -40,6 +41,8 @@ module chemistry module procedure chem_read_restart_pio end interface + logical, parameter :: chem_has_ndep_flx = .false. + ! Private data !================================================================================================ @@ -61,10 +64,10 @@ end function chem_is subroutine chem_register use aero_model, only : aero_model_register - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: register advected constituents for parameterized greenhouse gas chemistry - ! + ! !----------------------------------------------------------------------- ! for prescribed aerosols @@ -95,12 +98,12 @@ end function chem_is_active !================================================================================================ function chem_implements_cnst(name) - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: return true if specified constituent is implemented by this package - ! + ! ! Author: B. Eaton - ! + ! !----------------------------------------------------------------------- implicit none !-----------------------------Arguments--------------------------------- @@ -115,11 +118,11 @@ end function chem_implements_cnst !=============================================================================== subroutine chem_init(phys_state, pbuf2d) - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: initialize parameterized greenhouse gas chemistry ! (declare history variables) - ! + ! !----------------------------------------------------------------------- use physics_buffer, only : physics_buffer_desc use aero_model, only : aero_model_init @@ -138,7 +141,7 @@ subroutine chem_timestep_init(phys_state, pbuf2d) use physics_buffer, only : physics_buffer_desc use time_manager, only: get_curr_date, get_perp_date, get_curr_calday, & is_perpetual - type(physics_state), intent(in):: phys_state(begchunk:endchunk) + type(physics_state), intent(in):: phys_state(begchunk:endchunk) type(physics_buffer_desc), pointer :: pbuf2d(:,:) @@ -162,7 +165,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o) type(cam_out_t), intent(in) :: cam_out type(physics_buffer_desc), pointer :: pbuf(:) real(r8), optional, intent(out) :: fh2o(pcols) ! h2o flux to balance source from chemistry - + return end subroutine chem_timestep_tend @@ -215,7 +218,7 @@ subroutine chem_init_restart(File) end subroutine chem_init_restart !================================================================================ subroutine chem_reset_fluxes( fptr, cam_in ) - use camsrfexch, only : cam_in_t + use camsrfexch, only : cam_in_t real(r8), pointer :: fptr(:,:) ! pointer into array data type(cam_in_t), intent(inout) :: cam_in(begchunk:endchunk) @@ -223,7 +226,7 @@ subroutine chem_reset_fluxes( fptr, cam_in ) end subroutine chem_reset_fluxes !================================================================================ subroutine chem_emissions( state, cam_in, pbuf ) - use camsrfexch, only: cam_in_t + use camsrfexch, only: cam_in_t use physics_buffer, only: physics_buffer_desc ! Arguments: diff --git a/src/control/camsrfexch.F90 b/src/control/camsrfexch.F90 index 0357ba3128..8111785cd1 100644 --- a/src/control/camsrfexch.F90 +++ b/src/control/camsrfexch.F90 @@ -9,14 +9,12 @@ module camsrfexch use constituents, only: pcnst use ppgrid, only: pcols, begchunk, endchunk use phys_grid, only: get_ncols_p, phys_grid_initialized - use infnan, only: posinf, assignment(=) + use infnan, only: nan, posinf, assignment(=) use cam_abortutils, only: endrun use cam_logfile, only: iulog use srf_field_check, only: active_Sl_ram1, active_Sl_fv, active_Sl_soilw, & - active_Fall_flxdst1, active_Fall_flxvoc, active_Fall_flxfire, & - active_Faxa_nhx, active_Faxa_noy - - + active_Fall_flxdst1, active_Fall_flxvoc, active_Fall_flxfire + use cam_control_mod, only: aqua_planet, simple_phys implicit none private @@ -100,7 +98,7 @@ module camsrfexch real(r8) :: tref(pcols) ! ref height surface air temp real(r8) :: qref(pcols) ! ref height specific humidity real(r8) :: u10(pcols) ! 10m wind speed - real(r8) :: ugustOut(pcols) ! gustiness added + real(r8) :: ugustOut(pcols) ! gustiness added real(r8) :: u10withGusts(pcols) ! 10m wind speed with gusts added real(r8) :: ts(pcols) ! merged surface temp real(r8) :: sst(pcols) ! sea surface temp @@ -325,14 +323,20 @@ subroutine atm2hub_alloc( cam_out ) cam_out(c)%dstwet4(:) = 0._r8 nullify(cam_out(c)%nhx_nitrogen_flx) - allocate (cam_out(c)%nhx_nitrogen_flx(pcols), stat=ierror) - if ( ierror /= 0 ) call endrun(sub//': allocation error nhx_nitrogen_flx') - cam_out(c)%nhx_nitrogen_flx(:) = 0._r8 - nullify(cam_out(c)%noy_nitrogen_flx) - allocate (cam_out(c)%noy_nitrogen_flx(pcols), stat=ierror) - if ( ierror /= 0 ) call endrun(sub//': allocation error noy_nitrogen_flx') - cam_out(c)%noy_nitrogen_flx(:) = 0._r8 + + if (.not.(simple_phys .or. aqua_planet)) then + + allocate (cam_out(c)%nhx_nitrogen_flx(pcols), stat=ierror) + if ( ierror /= 0 ) call endrun(sub//': allocation error nhx_nitrogen_flx') + cam_out(c)%nhx_nitrogen_flx(:) = nan + + allocate (cam_out(c)%noy_nitrogen_flx(pcols), stat=ierror) + if ( ierror /= 0 ) call endrun(sub//': allocation error noy_nitrogen_flx') + cam_out(c)%noy_nitrogen_flx(:) = nan + + endif + end do end subroutine atm2hub_alloc diff --git a/src/control/runtime_opts.F90 b/src/control/runtime_opts.F90 index 915664cdb9..f7bc2a40ff 100644 --- a/src/control/runtime_opts.F90 +++ b/src/control/runtime_opts.F90 @@ -102,6 +102,7 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon) use cam_budget, only: cam_budget_readnl use phys_grid_ctem, only: phys_grid_ctem_readnl use mo_lightning, only: lightning_readnl + use atm_stream_ndep, only: stream_ndep_readnl !---------------------------Arguments----------------------------------- @@ -205,6 +206,7 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon) call hemco_readnl(nlfilename) call cam_budget_readnl(nlfilename) call phys_grid_ctem_readnl(nlfilename) + call stream_ndep_readnl(nlfilename) end subroutine read_namelist diff --git a/src/cpl/nuopc/atm_import_export.F90 b/src/cpl/nuopc/atm_import_export.F90 index b3e16bee8c..b5b56b8112 100644 --- a/src/cpl/nuopc/atm_import_export.F90 +++ b/src/cpl/nuopc/atm_import_export.F90 @@ -22,10 +22,10 @@ module atm_import_export use srf_field_check , only : set_active_Fall_flxfire use srf_field_check , only : set_active_Fall_fco2_lnd use srf_field_check , only : set_active_Faoo_fco2_ocn - use srf_field_check , only : set_active_Faxa_nhx - use srf_field_check , only : set_active_Faxa_noy - use srf_field_check , only : active_Faxa_nhx, active_Faxa_noy - use atm_stream_ndep , only : stream_ndep_init, stream_ndep_interp, stream_ndep_is_initialized, use_ndep_stream + use atm_stream_ndep , only : stream_ndep_init, stream_ndep_interp, stream_ndep_is_initialized + use atm_stream_ndep , only : ndep_stream_active + use chemistry , only : chem_has_ndep_flx + use cam_control_mod , only : aqua_planet, simple_phys implicit none private ! except @@ -60,7 +60,6 @@ module atm_import_export integer :: drydep_nflds = -huge(1) ! number of dry deposition velocity fields lnd-> atm integer :: megan_nflds = -huge(1) ! number of MEGAN voc fields from lnd-> atm integer :: emis_nflds = -huge(1) ! number of fire emission fields from lnd-> atm - integer, public :: ndep_nflds = -huge(1) ! number of nitrogen deposition fields from atm->lnd/ocn logical :: atm_provides_lightning = .false. ! cld to grnd lightning flash freq (min-1) character(*),parameter :: F01 = "('(cam_import_export) ',a,i8,2x,i8,2x,d21.14)" character(*),parameter :: F02 = "('(cam_import_export) ',a,i8,2x,i8,2x,i8,2x,d21.14)" @@ -79,13 +78,11 @@ subroutine read_surface_fields_namelists() use shr_megan_mod , only : shr_megan_readnl use shr_fire_emis_mod , only : shr_fire_emis_readnl use shr_carma_mod , only : shr_carma_readnl - use shr_ndep_mod , only : shr_ndep_readnl use shr_lightning_coupling_mod, only : shr_lightning_coupling_readnl character(len=*), parameter :: nl_file_name = 'drv_flds_in' ! read mediator fields options - call shr_ndep_readnl(nl_file_name, ndep_nflds) call shr_drydep_readnl(nl_file_name, drydep_nflds) call shr_megan_readnl(nl_file_name, megan_nflds) call shr_fire_emis_readnl(nl_file_name, emis_nflds) @@ -194,16 +191,7 @@ subroutine advertise_fields(gcomp, flds_scalar_name, rc) call fldlist_add(fldsFrAtm_num, fldsFrAtm, 'Sa_co2diag' ) end if - if (ndep_nflds > 0) then - ! The following is when CAM/WACCM computes ndep - call set_active_Faxa_nhx(.true.) - call set_active_Faxa_noy(.true.) - else - ! The following is used for reading in stream data, or for aquaplanet or simple model - ! cases where the ndep fluxes are not used. - call set_active_Faxa_nhx(.false.) - call set_active_Faxa_noy(.false.) - end if + ! Nitrogen deposition fluxes ! Assume that 2 fields are always sent as part of Faxa_ndep call fldlist_add(fldsFrAtm_num, fldsFrAtm, 'Faxa_ndep', ungridded_lbound=1, ungridded_ubound=2) @@ -1121,10 +1109,8 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) call state_getfldptr(exportState, 'Faxa_ndep', fldptr2d=fldptr_ndep, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - if (.not. active_Faxa_nhx .and. .not. active_Faxa_noy) then - ! ndep fields not active (i.e., not computed by WACCM). Either they are not needed, - ! or they are obtained from the ndep input stream. + if (.not. (simple_phys .or. aqua_planet)) then ! The ndep_stream_nl namelist group is read in stream_ndep_init. This sets whether ! or not the stream will be used. @@ -1134,45 +1120,43 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) stream_ndep_is_initialized = .true. end if - if (use_ndep_stream) then + if (ndep_stream_active.or.chem_has_ndep_flx) then + ! Nitrogen dep fluxes are obtained from the ndep input stream if input data is available + ! otherwise computed by chemistry + if (ndep_stream_active) then + + ! get ndep fluxes from the stream + call stream_ndep_interp(cam_out, rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + ! NDEP read from forcing is expected to be in units of gN/m2/sec - but the mediator + ! expects units of kgN/m2/sec + scale_ndep = .001_r8 + + else if (chem_has_ndep_flx) then - ! get ndep fluxes from the stream - call stream_ndep_interp(cam_out, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - ! NDEP read from forcing is expected to be in units of gN/m2/sec - but the mediator - ! expects units of kgN/m2/sec - scale_ndep = .001_r8 + ! Assume chemistry computes ndep fluxes, then its in units of kgN/m2/s - and the mediator expects + ! units of kgN/m2/sec, so the following conversion needs to happen + scale_ndep = 1._r8 - else + end if - ! ndep fluxes not used. Set to zero. + g = 1 do c = begchunk,endchunk do i = 1,get_ncols_p(c) - cam_out(c)%nhx_nitrogen_flx(i) = 0._r8 - cam_out(c)%noy_nitrogen_flx(i) = 0._r8 + fldptr_ndep(1,g) = cam_out(c)%nhx_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g) + fldptr_ndep(2,g) = cam_out(c)%noy_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g) + g = g + 1 end do end do - scale_ndep = 1._r8 - end if + else - else + fldptr_ndep(:,:) = 0._r8 - ! If waccm computes ndep, then its in units of kgN/m2/s - and the mediator expects - ! units of kgN/m2/sec, so the following conversion needs to happen - scale_ndep = 1._r8 + end if end if - g = 1 - do c = begchunk,endchunk - do i = 1,get_ncols_p(c) - fldptr_ndep(1,g) = cam_out(c)%nhx_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g) - fldptr_ndep(2,g) = cam_out(c)%noy_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g) - g = g + 1 - end do - end do - end subroutine export_fields !=============================================================================== diff --git a/src/cpl/nuopc/atm_stream_ndep.F90 b/src/cpl/nuopc/atm_stream_ndep.F90 index a393b27f05..eed6ac619e 100644 --- a/src/cpl/nuopc/atm_stream_ndep.F90 +++ b/src/cpl/nuopc/atm_stream_ndep.F90 @@ -21,52 +21,46 @@ module atm_stream_ndep implicit none private + public :: stream_ndep_readnl ! read runtime options public :: stream_ndep_init ! position datasets for dynamic ndep public :: stream_ndep_interp ! interpolates between two years of ndep file data private :: stream_ndep_check_units ! Check the units and make sure they can be used ! The ndep stream is not needed for aquaplanet or simple model configurations. It - ! is disabled by setting the namelist variable stream_ndep_data_filename to blank. - logical, public, protected :: use_ndep_stream = .true. + ! is disabled by setting the namelist variable stream_ndep_data_filename to 'UNSET' or empty string. + logical, public, protected :: ndep_stream_active = .false. type(shr_strdata_type) :: sdat_ndep ! input data stream logical, public :: stream_ndep_is_initialized = .false. character(len=CS) :: stream_varlist_ndep(2) type(ESMF_Clock) :: model_clock - character(len=*), parameter :: sourcefile = & - __FILE__ + character(len=*), parameter :: sourcefile = __FILE__ + + character(len=CL) :: stream_ndep_data_filename + character(len=CL) :: stream_ndep_mesh_filename + integer :: stream_ndep_year_first ! first year in stream to use + integer :: stream_ndep_year_last ! last year in stream to use + integer :: stream_ndep_year_align ! align stream_year_firstndep with !============================================================================== contains !============================================================================== - subroutine stream_ndep_init(model_mesh, model_clock, rc) - ! - ! Initialize data stream information. + subroutine stream_ndep_readnl(nlfile) ! Uses: - use cam_instance , only: inst_suffix - use shr_nl_mod , only: shr_nl_find_group_name - use dshr_strdata_mod , only: shr_strdata_init_from_inline + use shr_nl_mod, only: shr_nl_find_group_name ! input/output variables - type(ESMF_CLock), intent(in) :: model_clock - type(ESMF_Mesh) , intent(in) :: model_mesh - integer , intent(out) :: rc + character(len=*), intent(in) :: nlfile ! local variables integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag - character(len=CL) :: stream_ndep_data_filename - character(len=CL) :: stream_ndep_mesh_filename - character(len=CL) :: filein ! atm namelist file - integer :: stream_ndep_year_first ! first year in stream to use - integer :: stream_ndep_year_last ! last year in stream to use - integer :: stream_ndep_year_align ! align stream_year_firstndep with integer :: ierr - character(*), parameter :: subName = "('stream_ndep_init')" + character(*), parameter :: subName = "('stream_ndep_readnl')" !----------------------------------------------------------------------- namelist /ndep_stream_nl/ & @@ -76,8 +70,6 @@ subroutine stream_ndep_init(model_mesh, model_clock, rc) stream_ndep_year_last, & stream_ndep_year_align - rc = ESMF_SUCCESS - ! Default values for namelist stream_ndep_data_filename = ' ' stream_ndep_mesh_filename = ' ' @@ -90,10 +82,9 @@ subroutine stream_ndep_init(model_mesh, model_clock, rc) ! Read ndep_stream namelist if (masterproc) then - filein = "atm_in" // trim(inst_suffix) - open( newunit=nu_nml, file=trim(filein), status='old', iostat=nml_error ) + open( newunit=nu_nml, file=trim(nlfile), status='old', iostat=nml_error ) if (nml_error /= 0) then - call endrun(subName//': ERROR opening '//trim(filein)//errMsg(sourcefile, __LINE__)) + call endrun(subName//': ERROR opening '//trim(nlfile)//errMsg(sourcefile, __LINE__)) end if call shr_nl_find_group_name(nu_nml, 'ndep_stream_nl', status=nml_error) if (nml_error == 0) then @@ -101,8 +92,6 @@ subroutine stream_ndep_init(model_mesh, model_clock, rc) if (nml_error /= 0) then call endrun(' ERROR reading ndep_stream_nl namelist'//errMsg(sourcefile, __LINE__)) end if - else - call endrun(' ERROR finding ndep_stream_nl namelist'//errMsg(sourcefile, __LINE__)) end if close(nu_nml) endif @@ -117,9 +106,10 @@ subroutine stream_ndep_init(model_mesh, model_clock, rc) call mpi_bcast(stream_ndep_year_align, 1, mpi_integer, 0, mpicom, ierr) if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: stream_ndep_year_align") + ndep_stream_active = len_trim(stream_ndep_data_filename)>0 .and. stream_ndep_data_filename/='UNSET' + ! Check whether the stream is being used. - if (stream_ndep_data_filename == ' '.or.stream_ndep_data_filename == 'UNSET') then - use_ndep_stream = .false. + if (.not.ndep_stream_active) then if (masterproc) then write(iulog,'(a)') ' ' write(iulog,'(a)') 'NDEP STREAM IS NOT USED.' @@ -140,6 +130,25 @@ subroutine stream_ndep_init(model_mesh, model_clock, rc) write(iulog,'(a)' ) ' ' endif + end subroutine stream_ndep_readnl + + subroutine stream_ndep_init(model_mesh, model_clock, rc) + use dshr_strdata_mod, only: shr_strdata_init_from_inline + + ! input/output variables + type(ESMF_CLock), intent(in) :: model_clock + type(ESMF_Mesh) , intent(in) :: model_mesh + integer , intent(out) :: rc + + ! local variables + character(*), parameter :: subName = "('stream_ndep_init')" + + rc = ESMF_SUCCESS + if (.not.ndep_stream_active) then + return + end if + ! + ! Initialize data stream information. ! Read in units call stream_ndep_check_units(stream_ndep_data_filename) diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90 index 97dad2ba01..3a01d9536e 100644 --- a/src/physics/cam/cam_diagnostics.F90 +++ b/src/physics/cam/cam_diagnostics.F90 @@ -568,6 +568,9 @@ subroutine diag_init_moist(pbuf2d) call addfld('a2x_DSTWET4', horiz_only, 'A', 'kg/m2/s', 'wetdep of dust (bin4)') call addfld('a2x_DSTDRY4', horiz_only, 'A', 'kg/m2/s', 'drydep of dust (bin4)') + call addfld('a2x_NOYDEP', horiz_only, 'A', 'kg/m2/s', 'NOy Deposition Flux') + call addfld('a2x_NHXDEP', horiz_only, 'A', 'kg/m2/s', 'NHx Deposition Flux') + ! defaults if (history_amwg) then call add_default (cnst_name(1), 1, ' ') @@ -1903,6 +1906,13 @@ subroutine diag_export(cam_out) call outfld('a2x_DSTDRY4', cam_out%dstdry4, pcols, lchnk) end if + if (associated(cam_out%nhx_nitrogen_flx)) then + call outfld('a2x_NHXDEP', cam_out%nhx_nitrogen_flx, pcols, lchnk) + end if + if (associated(cam_out%noy_nitrogen_flx)) then + call outfld('a2x_NOYDEP', cam_out%noy_nitrogen_flx, pcols, lchnk) + end if + end subroutine diag_export !####################################################################### diff --git a/src/utils/srf_field_check.F90 b/src/utils/srf_field_check.F90 index d1c0adfbca..a0aa0cb0f5 100644 --- a/src/utils/srf_field_check.F90 +++ b/src/utils/srf_field_check.F90 @@ -29,8 +29,6 @@ module srf_field_check public :: set_active_Fall_flxfire public :: set_active_Fall_fco2_lnd public :: set_active_Faoo_fco2_ocn - public :: set_active_Faxa_nhx - public :: set_active_Faxa_noy !=============================================================================== contains @@ -76,14 +74,4 @@ subroutine set_active_Faoo_fco2_ocn(is_active) active_Faoo_fco2_ocn = is_active end subroutine set_active_Faoo_fco2_ocn - subroutine set_active_Faxa_nhx(is_active) - logical, intent(in) :: is_active - active_Faxa_nhx = is_active - end subroutine set_active_Faxa_nhx - - subroutine set_active_Faxa_noy(is_active) - logical, intent(in) :: is_active - active_Faxa_noy = is_active - end subroutine set_active_Faxa_noy - end module srf_field_check From b70cfeaf6a2e6aa3511cc469a53d8de080b112c3 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 19 Dec 2024 13:24:28 -0700 Subject: [PATCH 05/65] fix some issues in derecho regression tests modified: bld/build-namelist modified: bld/namelist_files/namelist_defaults_cam.xml modified: bld/namelist_files/namelist_definition.xml modified: bld/namelist_files/use_cases/2010_cam6.xml modified: bld/namelist_files/use_cases/sd_cam6.xml modified: bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml modified: src/chemistry/geoschem/chemistry.F90 modified: src/chemistry/pp_terminator/chemistry.F90 modified: src/control/camsrfexch.F90 --- bld/build-namelist | 13 +++++ bld/namelist_files/namelist_defaults_cam.xml | 3 ++ bld/namelist_files/namelist_definition.xml | 6 +++ bld/namelist_files/use_cases/2010_cam6.xml | 4 ++ bld/namelist_files/use_cases/sd_cam6.xml | 6 ++- .../use_cases/waccm_sc_1850_cam6.xml | 7 +++ src/chemistry/geoschem/chemistry.F90 | 31 ++++++------ src/chemistry/pp_terminator/chemistry.F90 | 49 ++++++++++--------- src/control/camsrfexch.F90 | 6 +-- 9 files changed, 84 insertions(+), 41 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 6dd96595d9..22be75b310 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -509,6 +509,19 @@ if ($phys_mode_flags > 1) { my $simple_phys = 0; if ($adia_mode or $ideal_mode) { $simple_phys = 1; } +# Setup default ndep streams only if not simple_phys or aqua_mode and +# the chemistry cannot produce the nitrogen depostion fluxes +if (!($simple_phys or $aqua_mode)) { + my $chem_nitrodep = chem_has_species($cfg, 'NO') and chem_has_species($cfg, 'NH3'); + if (!$chem_nitrodep) { + add_default($nl, 'stream_ndep_data_filename'); + add_default($nl, 'stream_ndep_mesh_filename'); + add_default($nl, 'stream_ndep_year_first'); + add_default($nl, 'stream_ndep_year_last'); + add_default($nl, 'stream_ndep_year_align'); + } +} + # Single column mode my $scam = $cfg->get('scam'); my $scam_iop = $cfg->get('scam_iop'); diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index ab2707290c..501047a1bc 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2063,6 +2063,9 @@ lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +1850 +2015 +1850 2000 2000 1 diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 4aaa038224..185edfa81e 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -7609,6 +7609,12 @@ Bubble-mediated sea-air transfer. See ocean_emis.F90 for details. Default: FALSE + +List of nitrogen deposition fluxes to be sent from CAM to surface models. +Default: set by build-namelist. + + Year first to use in nitrogen deposition stream data. diff --git a/bld/namelist_files/use_cases/2010_cam6.xml b/bld/namelist_files/use_cases/2010_cam6.xml index 239f5436f6..d392d2b76e 100644 --- a/bld/namelist_files/use_cases/2010_cam6.xml +++ b/bld/namelist_files/use_cases/2010_cam6.xml @@ -83,4 +83,8 @@ 'CYCLICAL' 2010 +2010 +2010 +1 + diff --git a/bld/namelist_files/use_cases/sd_cam6.xml b/bld/namelist_files/use_cases/sd_cam6.xml index 146268c62b..9a89255e88 100644 --- a/bld/namelist_files/use_cases/sd_cam6.xml +++ b/bld/namelist_files/use_cases/sd_cam6.xml @@ -28,7 +28,7 @@ 'SERIAL' 'atm/cam/ozone_strataero' - 'ozone_strataero_WACCM_L70_zm5day_18500101-20150103_CMIP6ensAvg_c180923.nc' + 'ozone_strataero_WACCM_L70_zm5day_18500101-20150103_CMIP6ensAvg_c180923.nc' .true. 'CHEM_LBC_FILE' @@ -36,4 +36,8 @@ 'SERIAL' 'CO2','CH4','N2O','CFC11eq','CFC12' + 1850 + 2015 + 1850 + diff --git a/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml index dbc6b0921b..691150a417 100644 --- a/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml @@ -88,4 +88,11 @@ 'UTEND4', 'UTEND5', 'FRONTGF', 'FRONTGFA', 'EKGW', 'QNO', 'QRLNLTE', 'QRL_TOT', 'DUV', 'DVV', 'TTPXMLC' + +lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc +share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc +1850 +1850 +1 + diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index fbb99e4b8f..e46bda2c4e 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -22,7 +22,7 @@ module chemistry #if defined( MODAL_AERO ) use modal_aero_data, only : ntot_amode #endif - + ! GEOS-Chem derived types USE DiagList_Mod, ONLY : DgnList ! Diagnostics list object use GeosChem_History_Mod, ONLY : HistoryConfigObj ! History diagnostic object @@ -59,6 +59,7 @@ module chemistry public :: chem_readnl ! read chem namelist public :: chem_emissions public :: chem_timestep_init + public :: chem_has_ndep_flx ! ! Private routines: @@ -166,6 +167,8 @@ module chemistry ! For dry deposition character(len=shr_kind_cl) :: depvel_lnd_file = 'depvel_lnd_file' + ! for nitrogen deposition fluxes to surface models + logical, parameter :: chem_has_ndep_flx = .false. contains @@ -515,11 +518,11 @@ subroutine chem_register CALL cnst_get_ind('Q', cQ, abort=.True.) CALL cnst_get_ind('H2O', cH2O, abort=.True.) CALL cnst_get_ind('H2SO4', cH2SO4, abort=.True.) - + !------------------------------------------------------------ ! Get mapping between dry deposition species and species set !------------------------------------------------------------ - + nIgnored = 0 if (debug .and. masterproc) write(iulog,'(a,i4,a)') 'chem_register: looping over gas dry deposition list with ', nddvels, ' species' @@ -831,7 +834,7 @@ subroutine chem_readnl(nlfile) ! Now go through the KPP mechanism and add any species not ! implemented by the tracer list in geoschem_config.yml !---------------------------------------------------------- - + IF ( nSpec > nSlsMax ) THEN CALL ENDRUN('chem_readnl: too many species - increase nSlsmax') ENDIF @@ -1022,7 +1025,7 @@ subroutine chem_init(phys_state, pbuf2d) use Time_Mod, only : Accept_External_Date_Time use Ucx_Mod, only : Init_Ucx use Unitconv_Mod, only : MOLES_SPECIES_PER_MOLES_DRY_AIR - use Vdiff_Mod, only : Max_PblHt_For_Vdiff + use Vdiff_Mod, only : Max_PblHt_For_Vdiff TYPE(physics_state), INTENT(IN ) :: phys_state(BEGCHUNK:ENDCHUNK) TYPE(physics_buffer_desc), POINTER, INTENT(INOUT) :: pbuf2d(:,:) @@ -1143,7 +1146,7 @@ subroutine chem_init(phys_state, pbuf2d) ! on State_Grid(BEGCHUNK). ! To go around this, we define all of GEOS-Chem arrays with ! size PCOLS x PVER, which is the largest possible number of - ! grid cells. + ! grid cells. CALL Init_State_Grid( Input_Opt = Input_Opt, & State_Grid = maxGrid, & RC = RC ) @@ -1484,7 +1487,7 @@ subroutine chem_init(phys_state, pbuf2d) ! Init_Drydep ! Thibaud M. Fritz - 04 Mar 2020 !---------------------------------------------------------- - + ALLOCATE(map2GC_dryDep(nddvels), STAT=IERR) IF ( IERR .NE. 0 ) CALL ENDRUN('Failed to allocate map2GC_dryDep') @@ -1754,7 +1757,7 @@ subroutine chem_timestep_init(phys_state, pbuf2d) use mo_flbc, only : flbc_chk use mo_ghg_chem, only : ghg_chem_timestep_init use physics_buffer, only : physics_buffer_desc - + TYPE(physics_state), INTENT(IN):: phys_state(begchunk:endchunk) TYPE(physics_buffer_desc), POINTER :: pbuf2d(:,:) @@ -2019,7 +2022,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8) :: mmr_tend(state%NCOL,PVER,gas_pcnst) REAL(r8) :: wk_out(state%NCOL) LOGICAL :: Found - + CHARACTER(LEN=shr_kind_cl) :: tagName REAL(r8), PARAMETER :: zlnd = 0.01_r8 ! Roughness length for soil [m] @@ -2364,7 +2367,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ENDDO ! Deal with secondary organic aerosols (SOAs). This mapping is using the - ! complex SOA option in GEOS-Chem. + ! complex SOA option in GEOS-Chem. ! MAM uses five volatility bins spanning saturation concentrations from 0.01 ! to 100 ug/m3 (logarithmically). The complex SOA option has four volatility ! bins that 0.1 to 100 ug/m3. We lump the lowest two bins in CESM2 to the @@ -3692,7 +3695,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Compute the surface flux for the non-local mixing, ! (which means getting emissions & drydep from HEMCO) ! and store it in State_Chm%Surface_Flux - ! + ! ! For CESM-GC, Surface_Flux will be equal to the opposite of the ! dry deposition flux since emissions are loaded externally ! ( SurfaceFlux = eflx - dflx = - dflx ) @@ -3739,10 +3742,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) ! Get the species ID from the drydep ID N = State_Chm(BEGCHUNK)%Map_DryDep(ND) IF ( N <= 0 ) CYCLE - + M = map2GCinv(N) IF ( M <= 0 ) CYCLE - + cam_in%cflx(1:nY,M) = cam_in%cflx(1:nY,M) & + State_Chm(LCHNK)%SurfaceFlux(1,1:nY,N) ENDDO @@ -3763,7 +3766,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) new_units = KG_SPECIES_PER_M2, & previous_units = previous_units, & RC = RC ) - + IF ( RC /= GC_SUCCESS ) THEN ErrMsg = 'Error encountered in "Convert_Spc_Units"!' diff --git a/src/chemistry/pp_terminator/chemistry.F90 b/src/chemistry/pp_terminator/chemistry.F90 index 11fbf5e0c9..b1e82d8d65 100644 --- a/src/chemistry/pp_terminator/chemistry.F90 +++ b/src/chemistry/pp_terminator/chemistry.F90 @@ -32,9 +32,10 @@ module chemistry public :: chem_write_restart public :: chem_read_restart public :: chem_init_restart - public :: chem_readnl ! read chem namelist + public :: chem_readnl ! read chem namelist public :: chem_reset_fluxes public :: chem_emissions + public :: chem_has_ndep_flx interface chem_write_restart module procedure chem_write_restart_bin @@ -45,9 +46,11 @@ module chemistry module procedure chem_read_restart_pio end interface + logical, parameter :: chem_has_ndep_flx = .false. + ! Private data integer, parameter :: nspecies = 3 - + integer :: idx_cl =-1 integer :: idx_cl2=-1 @@ -75,10 +78,10 @@ end function chem_is !================================================================================================ subroutine chem_register - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: register advected constituents for parameterized greenhouse gas chemistry - ! + ! !----------------------------------------------------------------------- real(r8), parameter :: cptmp = 666._r8 @@ -86,10 +89,10 @@ subroutine chem_register logical :: camout integer :: i, n - + do i = 1, nspecies camout = trim(species(i)) .eq. 'RHO' - call cnst_add( species(i), adv_mass(i), cptmp, qmin, n, & + call cnst_add( species(i), adv_mass(i), cptmp, qmin, n, & readiv=.true.,mixtype='dry',cam_outfld=camout) indices(i) = n map2chm(n) = i @@ -123,12 +126,12 @@ end function chem_is_active !================================================================================================ function chem_implements_cnst(name) - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: return true if specified constituent is implemented by this package - ! + ! ! Author: B. Eaton - ! + ! !----------------------------------------------------------------------- implicit none !-----------------------------Arguments--------------------------------- @@ -137,7 +140,7 @@ function chem_implements_cnst(name) logical :: chem_implements_cnst ! return value integer :: i - + chem_implements_cnst = .false. do i = 1, nspecies @@ -150,13 +153,13 @@ function chem_implements_cnst(name) end function chem_implements_cnst !=============================================================================== - + subroutine chem_init(phys_state, pbuf2d) - !----------------------------------------------------------------------- - ! + !----------------------------------------------------------------------- + ! ! Purpose: initialize parameterized greenhouse gas chemistry ! (declare history variables) - ! + ! !----------------------------------------------------------------------- use physics_buffer, only: physics_buffer_desc use cam_history, only: addfld, add_default, horiz_only @@ -196,7 +199,7 @@ end subroutine chem_init subroutine chem_timestep_init(phys_state, pbuf2d) use physics_buffer, only: physics_buffer_desc - type(physics_state), intent(in):: phys_state(begchunk:endchunk) + type(physics_state), intent(in):: phys_state(begchunk:endchunk) type(physics_buffer_desc), pointer :: pbuf2d(:,:) end subroutine chem_timestep_init @@ -222,7 +225,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) real(r8), optional, intent(out) :: fh2o(pcols) ! h2o flux to balance source from chemistry real(r8) :: a(pver),b(pver),c(pver),d(pver) - + real(r8) :: k1(pcols) real(r8) :: k2(pcols) @@ -278,7 +281,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o ) l(i,:) = (1._r8 - e(i,:))/det(i,:)/dt elsewhere l(i,:) = 4._r8*k2(i) - endwhere + endwhere cl_f(i,:) = -l(i,:)*(cl(i,:) - det(i,:) + r(i) )*(cl(i,:) + det(i,:) + r(i)) / ( 1._r8 +e(i,:) + dt*l(i,:)*(cl(i,:) + r(i))) cl2_f(i,:) = -cl_f(i,:) / 2._r8 @@ -325,7 +328,7 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) real(r8) :: q_vmr(size(q, 1)) ! volume mixing ratio (ncol) real(r8) :: det(size(q, 1)) real(r8) :: krat(size(q, 1)) - + real(r8) :: k1(size(q, 1)) real(r8) :: k2(size(q, 1)) @@ -347,7 +350,7 @@ subroutine chem_init_cnst(name, latvals, lonvals, mask, q) krat(:) = k1(:) / (4._r8 * k2(:)) h = init_vmr_cl + 2._r8 * init_vmr_cl2 - + det(:) = sqrt(krat(:) * krat(:) + 2._r8 * h * krat(:)) if (trim(name) == trim(species(1)) ) then @@ -412,7 +415,7 @@ subroutine chem_init_restart(File) end subroutine chem_init_restart !================================================================================ subroutine chem_reset_fluxes( fptr, cam_in ) - use camsrfexch, only : cam_in_t + use camsrfexch, only : cam_in_t real(r8), pointer :: fptr(:,:) ! pointer into array data type(cam_in_t), intent(inout) :: cam_in(begchunk:endchunk) @@ -420,7 +423,7 @@ subroutine chem_reset_fluxes( fptr, cam_in ) end subroutine chem_reset_fluxes !================================================================================ subroutine chem_emissions( state, cam_in, pbuf ) - use camsrfexch, only: cam_in_t + use camsrfexch, only: cam_in_t use physics_buffer, only: physics_buffer_desc ! Arguments: diff --git a/src/control/camsrfexch.F90 b/src/control/camsrfexch.F90 index 8111785cd1..1470c46198 100644 --- a/src/control/camsrfexch.F90 +++ b/src/control/camsrfexch.F90 @@ -9,7 +9,7 @@ module camsrfexch use constituents, only: pcnst use ppgrid, only: pcols, begchunk, endchunk use phys_grid, only: get_ncols_p, phys_grid_initialized - use infnan, only: nan, posinf, assignment(=) + use infnan, only: posinf, assignment(=) use cam_abortutils, only: endrun use cam_logfile, only: iulog use srf_field_check, only: active_Sl_ram1, active_Sl_fv, active_Sl_soilw, & @@ -329,11 +329,11 @@ subroutine atm2hub_alloc( cam_out ) allocate (cam_out(c)%nhx_nitrogen_flx(pcols), stat=ierror) if ( ierror /= 0 ) call endrun(sub//': allocation error nhx_nitrogen_flx') - cam_out(c)%nhx_nitrogen_flx(:) = nan + cam_out(c)%nhx_nitrogen_flx(:) = 0._r8 allocate (cam_out(c)%noy_nitrogen_flx(pcols), stat=ierror) if ( ierror /= 0 ) call endrun(sub//': allocation error noy_nitrogen_flx') - cam_out(c)%noy_nitrogen_flx(:) = nan + cam_out(c)%noy_nitrogen_flx(:) = 0._r8 endif From 9e2267cfbbf727d64d6f46118ab19bf5bae07430 Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Fri, 20 Dec 2024 14:36:08 -0700 Subject: [PATCH 06/65] commiting changes with residual orogrpahy. may not be 'perfect' --- bld/namelist_files/namelist_definition.xml | 2 +- src/physics/cam/gw_drag.F90 | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 239c19f986..6f07376438 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1339,7 +1339,7 @@ Default: .false. + group="gw_drag_nl" valid_values="" > JULIO - need to add comment Default: .false. diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 3d50877cbe..a71fac7141 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -111,9 +111,10 @@ module gw_drag real(r8) :: effgw_beres_sh = unset_r8 - ! JULIO - Please put in appropriate comment - logical :: use_gw_rdg_resid = false - read(r8) :: effgw_rdg_resid = unset_r8 + ! Parameters controlling isotropic residual + ! orographic GW. + logical :: use_gw_rdg_resid = .false. + real(r8) :: effgw_rdg_resid = unset_r8 ! Horzontal wavelengths [m]. real(r8), parameter :: wavelength_mid = 1.e5_r8 @@ -2331,6 +2332,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) u, v, t, p, piln, zm, zi, & nm, ni, rhoi, kvtt, q, dse, & effgw_rdg_beta, effgw_rdg_beta_max, & + effgw_rdg_resid, use_gw_rdg_resid, & hwdth, clngt, gbxar, mxdis, angll, anixy, & isovar, isowgt, & rdg_beta_cd_llb, trpd_leewv_rdg_beta, & @@ -2362,6 +2364,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) u, v, t, p, piln, zm, zi, & nm, ni, rhoi, kvtt, q, dse, & effgw_rdg_gamma, effgw_rdg_gamma_max, & + effgw_rdg_resid, use_gw_rdg_resid, & hwdthg, clngtg, gbxar, mxdisg, angllg, anixyg, & isovar, isowgt, & rdg_gamma_cd_llb, trpd_leewv_rdg_gamma, & @@ -2403,6 +2406,7 @@ subroutine gw_rdg_calc( & u, v, t, p, piln, zm, zi, & nm, ni, rhoi, kvtt, q, dse, & effgw_rdg, effgw_rdg_max, & + effgw_rdg_resid, luse_gw_rdg_resid, & hwdth, clngt, gbxar, & mxdis, angll, anixy, & isovar, isowgt, & @@ -2436,6 +2440,8 @@ subroutine gw_rdg_calc( & real(r8), intent(in) :: effgw_rdg ! Tendency efficiency. real(r8), intent(in) :: effgw_rdg_max + real(r8), intent(in) :: effgw_rdg_resid ! Tendency efficiency. + logical, intent(in) :: luse_gw_rdg_resid ! On-Off switch real(r8), intent(in) :: hwdth(ncol,prdg) ! width of ridges. real(r8), intent(in) :: clngt(ncol,prdg) ! length of ridges. real(r8), intent(in) :: gbxar(ncol) ! gridbox area @@ -2666,10 +2672,11 @@ subroutine gw_rdg_calc( & end do ! end of loop over multiple ridges + if (luse_gw_rdg_resid == .true.) then ! Add additional GW from residual variance. Assumed isotropic !kwvrdg = 0.001_r8 / ( hwdth(:,nn) + 0.001_r8 ) ! this cant be done every time step !!! kwvrdg = 0.001_r8 / ( 100._r8 ) - effgw = 1.0_r8 * isowgt + effgw = effgw_rdg_resid * isowgt !1.0_r8 * isowgt tauoro = 0._r8 call gw_rdg_resid_src(ncol, band_oro, p, & @@ -2716,7 +2723,8 @@ subroutine gw_rdg_calc( & call outfld('UBMRESID'//trim(type), ubm, ncol, lchnk) call outfld('UBIRESID'//trim(type), ubi, ncol, lchnk) call outfld('SRC_LEVEL_RESID'//trim(type), 1._r8*src_level , ncol, lchnk) - ! end of residual variance calc + ! end of residual variance calc + end if ! Calculate energy change for output to CAM's energy checker. call energy_change(dt, p, u, v, ptend%u(:ncol,:), & From 3068bad2f9718eee6563d46212eb8b86e8d6456d Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Mon, 23 Dec 2024 11:30:34 -0700 Subject: [PATCH 07/65] minor mods to gw_drag --- src/physics/cam/gw_drag.F90 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index a71fac7141..74274ea0af 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -812,6 +812,12 @@ subroutine gw_init() 'Ridge based momentum flux profile') call register_vector_field('TAUARDGBETAX','TAUARDGBETAY') + call addfld('TAURESIDBETAY' , (/ 'ilev' /) , 'I' ,'N m-2' , & + 'Ridge based momentum flux profile') + call addfld('TAURESIDBETAX' , (/ 'ilev' /) , 'I' ,'N m-2' , & + 'Ridge based momentum flux profile') + call register_vector_field('TAURESIDBETAX','TAURESIDBETAY') + if (history_waccm) then call add_default('TAUARDGBETAX', 1, ' ') call add_default('TAUARDGBETAY ', 1, ' ') @@ -2672,6 +2678,9 @@ subroutine gw_rdg_calc( & end do ! end of loop over multiple ridges + call outfld('TAUARDG'//trim(type)//'X', taurx, ncol, lchnk) + call outfld('TAUARDG'//trim(type)//'Y', taury, ncol, lchnk) + if (luse_gw_rdg_resid == .true.) then ! Add additional GW from residual variance. Assumed isotropic !kwvrdg = 0.001_r8 / ( hwdth(:,nn) + 0.001_r8 ) ! this cant be done every time step !!! @@ -2720,6 +2729,9 @@ subroutine gw_rdg_calc( & call outfld('TAUDIAG_RESID', tau_diag, ncol, lchnk) call outfld('TAUORO_RESID', tauoro , ncol, lchnk) call outfld('TAURESID'//trim(type)//'M', tau(:,0,:), ncol, lchnk) + call outfld('TAURESID'//trim(type)//'X', taurx, ncol, lchnk) + call outfld('TAURESID'//trim(type)//'Y', taury, ncol, lchnk) + call outfld('UBMRESID'//trim(type), ubm, ncol, lchnk) call outfld('UBIRESID'//trim(type), ubi, ncol, lchnk) call outfld('SRC_LEVEL_RESID'//trim(type), 1._r8*src_level , ncol, lchnk) @@ -2731,8 +2743,6 @@ subroutine gw_rdg_calc( & ptend%v(:ncol,:), ptend%s(:ncol,:), de) flx_heat(:ncol) = de - call outfld('TAUARDG'//trim(type)//'X', taurx, ncol, lchnk) - call outfld('TAUARDG'//trim(type)//'Y', taury, ncol, lchnk) if (trim(type) == 'BETA') then fname(1) = 'TAUGWX' From 24e012d6790b73ac78e47821ee970100cbbcd2b3 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 26 Dec 2024 11:03:59 -0700 Subject: [PATCH 08/65] ChangeLog start; code clean up; add ndep diags to reg test modified: cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/user_nl_cam modified: doc/ChangeLog modified: src/utils/srf_field_check.F90 --- .../cam/outfrq9s_Leung_dust/user_nl_cam | 2 +- doc/ChangeLog | 131 ++++++++++++++++++ src/utils/srf_field_check.F90 | 4 - 3 files changed, 132 insertions(+), 5 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/user_nl_cam index 351fe92801..01d1b71f8f 100644 --- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_Leung_dust/user_nl_cam @@ -1,6 +1,6 @@ dust_emis_method = 'Leung_2023' -fincl2 = 'dst_a1SF', 'dst_a2SF', 'dst_a3SF' +fincl2 = 'dst_a1SF', 'dst_a2SF', 'dst_a3SF', 'a2x_NHXDEP','a2x_NOYDEP' mfilt=1,1,1,1,1,1 ndens=1,1,1,1,1,1 diff --git a/doc/ChangeLog b/doc/ChangeLog index 746fead140..b535adc98e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,136 @@ =============================================================== +Tag name: cam6_4_??? +Originator(s): fvitt +Date: +One-line Summary: +Github PR URL: + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + + Change logical determinations on how to set nitrogen deposition fluxes which are sent to + surface models through the NUOPC mediator. This sets the nitrogen deposition fluxes to + prescribed CDEP input stream fluxes if corresponding namelist options are set. Otherwise, + the nitrogen deposition fluxes set to chemistry computed fluxes if the chemistry is capable + of providing the fluxes. (Github issue #1196) + +Describe any changes made to build system: + +Describe any changes made to the namelist: + +List any changes to the defaults for the boundary datasets: + +Describe any substantial timing or memory changes: + +Code reviewed by: + +List all files eliminated: + +List all files added and what they do: + +List all existing files that have been modified, and describe the changes: + +M bld/build-namelist + - change how default ndep_stream namelist options are set + . check if chemistry is capable of producing nitrogen deposition fluxes + . set defaults only if not simple physics nor aqua-planet configuration + +M bld/namelist_files/namelist_defaults_cam.xml + - default ndep_stream namelist settings for perpetual year 2000 configuration + +M bld/namelist_files/namelist_definition.xml + - updates to stream_ndep_* namelist descriptions + +M bld/namelist_files/use_cases/1850_cam_lt.xml +M bld/namelist_files/use_cases/1850_cam_mt.xml +M bld/namelist_files/use_cases/2010_cam6.xml +M bld/namelist_files/use_cases/hist_cam_lt.xml +M bld/namelist_files/use_cases/hist_cam_mt.xml +M bld/namelist_files/use_cases/sd_cam6.xml +M bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml + - stream_ndep_* namelist settings for use cases + +M cime_config/buildnml + - remove the use of CAM_STREAM_NDEP* xml vars to set stream_ndep* namelist options + +M cime_config/config_component.xml + - remove CAM_STREAM_NDEP* xml vars + +M src/chemistry/geoschem/chemistry.F90 +M src/chemistry/pp_none/chemistry.F90 +M src/chemistry/pp_terminator/chemistry.F90 + - add chem_has_ndep_flx flag -- set to .FALSE. for these chem pckgs + +M src/chemistry/mozart/chemistry.F90 + - add chem_has_ndep_flx flag + - add check for prescribed nitrogen depostion fluxes + +M src/chemistry/mozart/mo_chm_diags.F90 + - check for NOy and NHx species in chemistry to determine if + chemistry can produce nitrogen deposition fluxes + +M src/control/camsrfexch.F90 + - allocate cam_out nitro dep flx arrays only if not simple phys and not aqua-planet + +M src/control/runtime_opts.F90 + - invoke stream_ndep_readnl sooner in the initialization phase -- from read_namelist + +M src/cpl/nuopc/atm_import_export.F90 + - set out going ndep fluxes only if not simple physics and not aqua-planet + - set out going ndep fluxes to prescribed ndep stream fields, otherwise, + set chemistry computed fluxes if available. + +M src/cpl/nuopc/atm_stream_ndep.F90 + - add readnl routine -- seperated from init routine which can be invoked from + runtime_opts -- earlier in initialization + - set default use_ndep_stream flag to .false. + +M src/physics/cam/cam_diagnostics.F90 + - add 'a2x_NOYDEP' and 'a2x_NHXDEP' history fields + +M src/utils/srf_field_check.F90 + - removed active_Faxa_nhx and active_Faxa_noy routine flags which were not useful + +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: + +derecho/nvhpc/aux_cam: + +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, i.e., +- what code configurations: +- what platforms/compilers: +- nature of change (roundoff; larger than roundoff but same climate; new + climate): + +If bitwise differences were observed, how did you show they were no worse +than roundoff? + +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: + +MSS location of control simulations used to validate new climate: + +URL for AMWG diagnostics output used to validate new climate: + +=============================================================== +=============================================================== + Tag name: cam6_4_047 Originator(s): jedwards4b, fvitt Date: 19 November 2024 diff --git a/src/utils/srf_field_check.F90 b/src/utils/srf_field_check.F90 index a0aa0cb0f5..97d210bb5e 100644 --- a/src/utils/srf_field_check.F90 +++ b/src/utils/srf_field_check.F90 @@ -17,10 +17,6 @@ module srf_field_check logical, public, protected :: active_Fall_fco2_lnd = .false. logical, public, protected :: active_Faoo_fco2_ocn = .false. - ! output from atm - logical, public, protected :: active_Faxa_nhx = .false. - logical, public, protected :: active_Faxa_noy = .false. - public :: set_active_Sl_ram1 public :: set_active_Sl_fv public :: set_active_Sl_soilw From 82a3c9c6ac8827352dc2b3eea558ea8bb9972e07 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 26 Dec 2024 12:41:35 -0700 Subject: [PATCH 09/65] fix restart problem with nitrogen flux history fields modified: src/physics/cam/cam_diagnostics.F90 modified: src/physics/cam/physpkg.F90 --- src/physics/cam/cam_diagnostics.F90 | 7 ------- src/physics/cam/physpkg.F90 | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90 index 3a01d9536e..d351ec05f8 100644 --- a/src/physics/cam/cam_diagnostics.F90 +++ b/src/physics/cam/cam_diagnostics.F90 @@ -1906,13 +1906,6 @@ subroutine diag_export(cam_out) call outfld('a2x_DSTDRY4', cam_out%dstdry4, pcols, lchnk) end if - if (associated(cam_out%nhx_nitrogen_flx)) then - call outfld('a2x_NHXDEP', cam_out%nhx_nitrogen_flx, pcols, lchnk) - end if - if (associated(cam_out%noy_nitrogen_flx)) then - call outfld('a2x_NOYDEP', cam_out%noy_nitrogen_flx, pcols, lchnk) - end if - end subroutine diag_export !####################################################################### diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90 index ba36670ce8..a9ffeb91e5 100644 --- a/src/physics/cam/physpkg.F90 +++ b/src/physics/cam/physpkg.F90 @@ -1988,6 +1988,14 @@ subroutine tphysac (ztodt, cam_in, & call clybry_fam_set( ncol, lchnk, map2chm, state%q, pbuf ) + ! output these here -- after updates by chem_timestep_tend or export_fields within the current time step + if (associated(cam_out%nhx_nitrogen_flx)) then + call outfld('a2x_NHXDEP', cam_out%nhx_nitrogen_flx, pcols, lchnk) + end if + if (associated(cam_out%noy_nitrogen_flx)) then + call outfld('a2x_NOYDEP', cam_out%noy_nitrogen_flx, pcols, lchnk) + end if + end subroutine tphysac subroutine tphysbc (ztodt, state, & From bba4e59ceeb7d17fe6bac0738e066811aa20996c Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 26 Dec 2024 15:08:14 -0700 Subject: [PATCH 10/65] add addfld calls to cam7 phys modified: src/physics/cam7/physpkg.F90 --- src/physics/cam7/physpkg.F90 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/physics/cam7/physpkg.F90 b/src/physics/cam7/physpkg.F90 index 83d03c46d1..d0e00b4673 100644 --- a/src/physics/cam7/physpkg.F90 +++ b/src/physics/cam7/physpkg.F90 @@ -2470,6 +2470,14 @@ subroutine tphysac (ztodt, cam_in, & call clybry_fam_set( ncol, lchnk, map2chm, state%q, pbuf ) + ! output these here -- after updates by chem_timestep_tend or export_fields within the current time step + if (associated(cam_out%nhx_nitrogen_flx)) then + call outfld('a2x_NHXDEP', cam_out%nhx_nitrogen_flx, pcols, lchnk) + end if + if (associated(cam_out%noy_nitrogen_flx)) then + call outfld('a2x_NOYDEP', cam_out%noy_nitrogen_flx, pcols, lchnk) + end if + end subroutine tphysac subroutine tphysbc (ztodt, state, & From 9066aee7bdef48926fb02b81bed604329c2ff8cf Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 26 Dec 2024 16:23:47 -0700 Subject: [PATCH 11/65] units correction in diagnostics modified: src/cpl/nuopc/atm_import_export.F90 modified: src/cpl/nuopc/atm_stream_ndep.F90 modified: src/physics/cam/cam_diagnostics.F90 --- src/cpl/nuopc/atm_import_export.F90 | 15 +++------------ src/cpl/nuopc/atm_stream_ndep.F90 | 9 +++++++-- src/physics/cam/cam_diagnostics.F90 | 4 ++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/cpl/nuopc/atm_import_export.F90 b/src/cpl/nuopc/atm_import_export.F90 index b5b56b8112..fa2a91d943 100644 --- a/src/cpl/nuopc/atm_import_export.F90 +++ b/src/cpl/nuopc/atm_import_export.F90 @@ -923,7 +923,6 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) integer :: ncols ! Number of columns integer :: nstep logical :: exists - real(r8) :: scale_ndep ! 2d pointers real(r8), pointer :: fldptr_ndep(:,:) real(r8), pointer :: fldptr_bcph(:,:) , fldptr_ocph(:,:) @@ -1121,6 +1120,7 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) end if if (ndep_stream_active.or.chem_has_ndep_flx) then + ! Nitrogen dep fluxes are obtained from the ndep input stream if input data is available ! otherwise computed by chemistry if (ndep_stream_active) then @@ -1128,23 +1128,14 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) ! get ndep fluxes from the stream call stream_ndep_interp(cam_out, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - ! NDEP read from forcing is expected to be in units of gN/m2/sec - but the mediator - ! expects units of kgN/m2/sec - scale_ndep = .001_r8 - - else if (chem_has_ndep_flx) then - - ! Assume chemistry computes ndep fluxes, then its in units of kgN/m2/s - and the mediator expects - ! units of kgN/m2/sec, so the following conversion needs to happen - scale_ndep = 1._r8 end if g = 1 do c = begchunk,endchunk do i = 1,get_ncols_p(c) - fldptr_ndep(1,g) = cam_out(c)%nhx_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g) - fldptr_ndep(2,g) = cam_out(c)%noy_nitrogen_flx(i) * scale_ndep * mod2med_areacor(g) + fldptr_ndep(1,g) = cam_out(c)%nhx_nitrogen_flx(i) * mod2med_areacor(g) + fldptr_ndep(2,g) = cam_out(c)%noy_nitrogen_flx(i) * mod2med_areacor(g) g = g + 1 end do end do diff --git a/src/cpl/nuopc/atm_stream_ndep.F90 b/src/cpl/nuopc/atm_stream_ndep.F90 index eed6ac619e..f54509b269 100644 --- a/src/cpl/nuopc/atm_stream_ndep.F90 +++ b/src/cpl/nuopc/atm_stream_ndep.F90 @@ -246,6 +246,11 @@ subroutine stream_ndep_interp(cam_out, rc) integer :: mcdate ! Current model date (yyyymmdd) real(r8), pointer :: dataptr1d_nhx(:) real(r8), pointer :: dataptr1d_noy(:) + + ! NDEP read from forcing is expected to be in units of gN/m2/sec - but the mediator + ! expects units of kgN/m2/sec + real(r8), parameter :: scale_ndep = .001_r8 + !----------------------------------------------------------------------- ! Advance sdat stream @@ -269,8 +274,8 @@ subroutine stream_ndep_interp(cam_out, rc) g = 1 do c = begchunk,endchunk do i = 1,get_ncols_p(c) - cam_out(c)%nhx_nitrogen_flx(i) = dataptr1d_nhx(g) - cam_out(c)%noy_nitrogen_flx(i) = dataptr1d_noy(g) + cam_out(c)%nhx_nitrogen_flx(i) = dataptr1d_nhx(g) * scale_ndep + cam_out(c)%noy_nitrogen_flx(i) = dataptr1d_noy(g) * scale_ndep g = g + 1 end do end do diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90 index d351ec05f8..6006a6e8c8 100644 --- a/src/physics/cam/cam_diagnostics.F90 +++ b/src/physics/cam/cam_diagnostics.F90 @@ -568,8 +568,8 @@ subroutine diag_init_moist(pbuf2d) call addfld('a2x_DSTWET4', horiz_only, 'A', 'kg/m2/s', 'wetdep of dust (bin4)') call addfld('a2x_DSTDRY4', horiz_only, 'A', 'kg/m2/s', 'drydep of dust (bin4)') - call addfld('a2x_NOYDEP', horiz_only, 'A', 'kg/m2/s', 'NOy Deposition Flux') - call addfld('a2x_NHXDEP', horiz_only, 'A', 'kg/m2/s', 'NHx Deposition Flux') + call addfld('a2x_NOYDEP', horiz_only, 'A', 'kgN/m2/s', 'NOy Deposition Flux') + call addfld('a2x_NHXDEP', horiz_only, 'A', 'kgN/m2/s', 'NHx Deposition Flux') ! defaults if (history_amwg) then From 97fd80156c96244d769593f3ad8b8a8bbb614e82 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Sat, 28 Dec 2024 11:26:00 -0700 Subject: [PATCH 12/65] set fldptr_ndep to zero for no flux cases modified: src/cpl/nuopc/atm_import_export.F90 --- src/cpl/nuopc/atm_import_export.F90 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cpl/nuopc/atm_import_export.F90 b/src/cpl/nuopc/atm_import_export.F90 index fa2a91d943..c5ad5c253d 100644 --- a/src/cpl/nuopc/atm_import_export.F90 +++ b/src/cpl/nuopc/atm_import_export.F90 @@ -1109,6 +1109,8 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) call state_getfldptr(exportState, 'Faxa_ndep', fldptr2d=fldptr_ndep, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return + fldptr_ndep(:,:) = 0._r8 + if (.not. (simple_phys .or. aqua_planet)) then ! The ndep_stream_nl namelist group is read in stream_ndep_init. This sets whether @@ -1140,10 +1142,6 @@ subroutine export_fields( gcomp, model_mesh, model_clock, cam_out, rc) end do end do - else - - fldptr_ndep(:,:) = 0._r8 - end if end if From 31796b2677e6389862948a832f075011f3ca08d2 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Sat, 28 Dec 2024 14:18:58 -0700 Subject: [PATCH 13/65] namelist fixes modified: bld/namelist_files/namelist_defaults_cam.xml modified: bld/namelist_files/use_cases/1850_cam6.xml modified: bld/namelist_files/use_cases/hist_cam6.xml --- bld/namelist_files/namelist_defaults_cam.xml | 3 --- bld/namelist_files/use_cases/1850_cam6.xml | 5 +++++ bld/namelist_files/use_cases/hist_cam6.xml | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 501047a1bc..ab2707290c 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2063,9 +2063,6 @@ lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -1850 -2015 -1850 2000 2000 1 diff --git a/bld/namelist_files/use_cases/1850_cam6.xml b/bld/namelist_files/use_cases/1850_cam6.xml index 7f4cf09a5c..14d0c61526 100644 --- a/bld/namelist_files/use_cases/1850_cam6.xml +++ b/bld/namelist_files/use_cases/1850_cam6.xml @@ -52,6 +52,11 @@ atm/cam/chem/emis/elev/H2O_emission_CH4_oxidationx2_elev_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc +lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc +1850 +1850 +1 + 1850 diff --git a/bld/namelist_files/use_cases/hist_cam6.xml b/bld/namelist_files/use_cases/hist_cam6.xml index ac93a56a62..fff3618c07 100644 --- a/bld/namelist_files/use_cases/hist_cam6.xml +++ b/bld/namelist_files/use_cases/hist_cam6.xml @@ -30,6 +30,10 @@ 'SERIAL' 'CO2','CH4','N2O','CFC11eq','CFC12' + 1850 + 2015 + 1850 + 1850-2000 From 9848f15a3c71ef78ec5f3fd7568adddb23f5644c Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Wed, 8 Jan 2025 14:54:19 -0700 Subject: [PATCH 14/65] use sim_year to determine stream_ndep settings; remove deprecated ndep_list modified: bld/build-namelist modified: bld/namelist_files/namelist_defaults_cam.xml modified: bld/namelist_files/namelist_definition.xml modified: bld/namelist_files/use_cases/1850_cam6.xml modified: bld/namelist_files/use_cases/1850_cam_lt.xml modified: bld/namelist_files/use_cases/1850_cam_mt.xml modified: bld/namelist_files/use_cases/2000_geoschem.xml modified: bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml modified: bld/namelist_files/use_cases/2010_cam6.xml modified: bld/namelist_files/use_cases/2010_geoschem.xml modified: bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml modified: bld/namelist_files/use_cases/hist_cam6.xml modified: bld/namelist_files/use_cases/hist_cam_lt.xml modified: bld/namelist_files/use_cases/hist_cam_mt.xml modified: bld/namelist_files/use_cases/hist_geoschem.xml modified: bld/namelist_files/use_cases/hist_geoschem_nudged.xml modified: bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml modified: bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml modified: bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml modified: bld/namelist_files/use_cases/sd_cam6.xml modified: bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml modified: bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml modified: bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml modified: bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml modified: bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml modified: bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml modified: bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml modified: bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml modified: bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml modified: bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml --- bld/build-namelist | 26 +++++++-------- bld/namelist_files/namelist_defaults_cam.xml | 20 +++++++++--- bld/namelist_files/namelist_definition.xml | 6 ---- bld/namelist_files/use_cases/1850_cam6.xml | 5 --- bld/namelist_files/use_cases/1850_cam_lt.xml | 8 ++--- bld/namelist_files/use_cases/1850_cam_mt.xml | 8 ++--- .../use_cases/2000_geoschem.xml | 3 -- .../use_cases/2000_trop_strat_vbs_cam6.xml | 2 -- bld/namelist_files/use_cases/2010_cam6.xml | 5 ++- .../use_cases/2010_geoschem.xml | 1 - .../use_cases/2010_trop_strat_vbs_cam6.xml | 2 -- bld/namelist_files/use_cases/hist_cam6.xml | 6 +--- bld/namelist_files/use_cases/hist_cam_lt.xml | 8 ++--- bld/namelist_files/use_cases/hist_cam_mt.xml | 8 ++--- .../use_cases/hist_geoschem.xml | 2 -- .../use_cases/hist_geoschem_nudged.xml | 2 -- .../use_cases/hist_trop_strat_nudged_cam6.xml | 2 -- .../use_cases/hist_trop_strat_vbsext_cam6.xml | 12 +++---- .../hist_trop_strat_vbsfire_cam6.xml | 2 -- bld/namelist_files/use_cases/sd_cam6.xml | 4 +-- .../use_cases/sd_trop_strat2_cam6.xml | 32 +++++++++---------- .../use_cases/sd_trop_strat_vbs_cam6.xml | 2 -- .../use_cases/sd_waccm_tsmlt_cam6.xml | 2 -- .../use_cases/waccm_ma_1850_cam6.xml | 2 -- .../use_cases/waccm_ma_hist_cam6.xml | 2 -- .../use_cases/waccm_sc_1850_cam6.xml | 8 ++--- .../use_cases/waccm_tsmlt_1850_cam6.xml | 2 -- .../use_cases/waccm_tsmlt_2000_cam6.xml | 2 -- .../use_cases/waccm_tsmlt_2010_cam6.xml | 2 -- .../use_cases/waccm_tsmlt_hist_cam6.xml | 2 -- 30 files changed, 63 insertions(+), 125 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 22be75b310..7a66796964 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -509,19 +509,6 @@ if ($phys_mode_flags > 1) { my $simple_phys = 0; if ($adia_mode or $ideal_mode) { $simple_phys = 1; } -# Setup default ndep streams only if not simple_phys or aqua_mode and -# the chemistry cannot produce the nitrogen depostion fluxes -if (!($simple_phys or $aqua_mode)) { - my $chem_nitrodep = chem_has_species($cfg, 'NO') and chem_has_species($cfg, 'NH3'); - if (!$chem_nitrodep) { - add_default($nl, 'stream_ndep_data_filename'); - add_default($nl, 'stream_ndep_mesh_filename'); - add_default($nl, 'stream_ndep_year_first'); - add_default($nl, 'stream_ndep_year_last'); - add_default($nl, 'stream_ndep_year_align'); - } -} - # Single column mode my $scam = $cfg->get('scam'); my $scam_iop = $cfg->get('scam_iop'); @@ -710,6 +697,19 @@ if ($sim_year =~ /(\d+)-(\d+)/) { $sim_year_start = $1; } +# Setup default ndep streams only if not simple_phys or aqua_mode and +# the chemistry cannot produce the nitrogen depostion fluxes +if (!($simple_phys or $aqua_mode)) { + my $chem_nitrodep = chem_has_species($cfg, 'NO') and chem_has_species($cfg, 'NH3'); + if (!$chem_nitrodep) { + add_default($nl, 'stream_ndep_mesh_filename'); + add_default($nl, 'stream_ndep_data_filename', 'sim_year'=>$sim_year); + add_default($nl, 'stream_ndep_year_first', 'sim_year'=>$sim_year); + add_default($nl, 'stream_ndep_year_last', 'sim_year'=>$sim_year); + add_default($nl, 'stream_ndep_year_align', 'sim_year'=>$sim_year); + } +} + # Topography add_default($nl, 'use_topo_file'); my $use_topo_file = $nl->get_value('use_topo_file'); diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index ab2707290c..486b3a9fe0 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2061,11 +2061,23 @@ atm/cam/dst/dst_source1x1tuned-cam4-06202012.nc -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -2000 -2000 -1 + +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc + +2000 +1850 +1850 +2010 + +2000 +1850 +2015 +2010 + +1 +1850 .false. diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 185edfa81e..4aaa038224 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -7609,12 +7609,6 @@ Bubble-mediated sea-air transfer. See ocean_emis.F90 for details. Default: FALSE - -List of nitrogen deposition fluxes to be sent from CAM to surface models. -Default: set by build-namelist. - - Year first to use in nitrogen deposition stream data. diff --git a/bld/namelist_files/use_cases/1850_cam6.xml b/bld/namelist_files/use_cases/1850_cam6.xml index 14d0c61526..7f4cf09a5c 100644 --- a/bld/namelist_files/use_cases/1850_cam6.xml +++ b/bld/namelist_files/use_cases/1850_cam6.xml @@ -52,11 +52,6 @@ atm/cam/chem/emis/elev/H2O_emission_CH4_oxidationx2_elev_3DmonthlyL70_1850climoCMIP6piControl001_y21-50avg_c180802.nc -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc -1850 -1850 -1 - 1850 diff --git a/bld/namelist_files/use_cases/1850_cam_lt.xml b/bld/namelist_files/use_cases/1850_cam_lt.xml index fe0fef33e6..d046c8bec7 100644 --- a/bld/namelist_files/use_cases/1850_cam_lt.xml +++ b/bld/namelist_files/use_cases/1850_cam_lt.xml @@ -61,11 +61,7 @@ CYCLICAL 1850 - -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -1850 -1850 -1 + +1850 diff --git a/bld/namelist_files/use_cases/1850_cam_mt.xml b/bld/namelist_files/use_cases/1850_cam_mt.xml index df05241070..68e7ca4a1a 100644 --- a/bld/namelist_files/use_cases/1850_cam_mt.xml +++ b/bld/namelist_files/use_cases/1850_cam_mt.xml @@ -56,11 +56,7 @@ CYCLICAL 1850 - -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -1850 -1850 -1 + +1850 diff --git a/bld/namelist_files/use_cases/2000_geoschem.xml b/bld/namelist_files/use_cases/2000_geoschem.xml index 3d2c5507b5..384d46b42a 100644 --- a/bld/namelist_files/use_cases/2000_geoschem.xml +++ b/bld/namelist_files/use_cases/2000_geoschem.xml @@ -36,9 +36,6 @@ - - - 1,30,365,240,240,480,365,73,30 diff --git a/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml index 47d97d6249..039685230f 100644 --- a/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml +++ b/bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml @@ -131,8 +131,6 @@ 2000 -'noy', 'nhx' - 1,30,365,240,240,480,365,73,30 diff --git a/bld/namelist_files/use_cases/2010_cam6.xml b/bld/namelist_files/use_cases/2010_cam6.xml index d392d2b76e..641a8a8689 100644 --- a/bld/namelist_files/use_cases/2010_cam6.xml +++ b/bld/namelist_files/use_cases/2010_cam6.xml @@ -83,8 +83,7 @@ 'CYCLICAL' 2010 -2010 -2010 -1 + +2010 diff --git a/bld/namelist_files/use_cases/2010_geoschem.xml b/bld/namelist_files/use_cases/2010_geoschem.xml index b1b0f9f2eb..36c6eea697 100644 --- a/bld/namelist_files/use_cases/2010_geoschem.xml +++ b/bld/namelist_files/use_cases/2010_geoschem.xml @@ -34,7 +34,6 @@ - diff --git a/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml index a0b07f3248..7cd77b9b58 100644 --- a/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml +++ b/bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml @@ -322,8 +322,6 @@ 2010 -'noy', 'nhx' - 1,30,365,240,240,480,365,73,30 diff --git a/bld/namelist_files/use_cases/hist_cam6.xml b/bld/namelist_files/use_cases/hist_cam6.xml index fff3618c07..9b79a04132 100644 --- a/bld/namelist_files/use_cases/hist_cam6.xml +++ b/bld/namelist_files/use_cases/hist_cam6.xml @@ -30,11 +30,7 @@ 'SERIAL' 'CO2','CH4','N2O','CFC11eq','CFC12' - 1850 - 2015 - 1850 - - 1850-2000 + 1850-2015 diff --git a/bld/namelist_files/use_cases/hist_cam_lt.xml b/bld/namelist_files/use_cases/hist_cam_lt.xml index a7cd6c0e9c..8f071a149b 100644 --- a/bld/namelist_files/use_cases/hist_cam_lt.xml +++ b/bld/namelist_files/use_cases/hist_cam_lt.xml @@ -42,11 +42,7 @@ INTERP_MISSING_MONTHS SERIAL - -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -1850 -2015 -1850 + +1850-2015 diff --git a/bld/namelist_files/use_cases/hist_cam_mt.xml b/bld/namelist_files/use_cases/hist_cam_mt.xml index 63b6691929..0c8e2e85fb 100644 --- a/bld/namelist_files/use_cases/hist_cam_mt.xml +++ b/bld/namelist_files/use_cases/hist_cam_mt.xml @@ -37,11 +37,7 @@ INTERP_MISSING_MONTHS SERIAL - -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -1850 -2015 -1850 + +1850-2015 diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index 1cfff4a8a9..2b3a158400 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -31,8 +31,6 @@ SERIAL -'noy', 'nhx' - 1,30,365,240,240,480,365,73,30 diff --git a/bld/namelist_files/use_cases/hist_geoschem_nudged.xml b/bld/namelist_files/use_cases/hist_geoschem_nudged.xml index 3c87bcb4fc..51105cd460 100644 --- a/bld/namelist_files/use_cases/hist_geoschem_nudged.xml +++ b/bld/namelist_files/use_cases/hist_geoschem_nudged.xml @@ -31,8 +31,6 @@ SERIAL -'noy', 'nhx' - .true. diff --git a/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml index ff2a92b3ef..026e329d7a 100644 --- a/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml +++ b/bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml @@ -127,8 +127,6 @@ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/emissions_ssp585/emissions-cmip6-ScenarioMIP_IAMC-REMIND-MAGPIE-ssp585-1-1_so4_a2_anthro-res_surface_mol_175001-210101_0.9x1.25_c20190224.nc' -'noy', 'nhx' - .true. 'atm/cam/met/nudging/MERRA2_fv09_32L/' diff --git a/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml index 38e1439ed0..1605081d6d 100644 --- a/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml +++ b/bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml @@ -26,8 +26,6 @@ INTERP_MISSING_MONTHS -'noy', 'nhx' - 1,30,365,240,240,480,365,73,30 @@ -44,9 +42,9 @@ .false. .false. - + - 'CFC11STAR', 'AODDUST', 'AODDUST02', 'T', 'U', 'V', 'O3', 'OH', 'O3S', + 'CFC11STAR', 'AODDUST', 'AODDUST02', 'T', 'U', 'V', 'O3', 'OH', 'O3S', 'NO3', 'HO2', 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', 'CH3CL', 'CLO', 'CO2', 'HCL', 'HO2', 'HOCL', 'H2O', 'PHIS', 'Z3', 'BENZENE', 'C2H2', 'C2H4', 'C2H6', 'C3H8', 'CCL4', 'CFC11', 'CFC113', @@ -85,14 +83,14 @@ 'AODNIRstdn', 'AODUVstdn', 'AODdn_accum', 'AODdn_coarse', 'AODdnDUST01', 'AODdnDUST02', 'AODdnDUST03', 'AODVISstdn', 'AODUVstdn', 'AODNIRstdn', 'AODNIRstdn', 'AODVISdn', 'AODUVdn', 'EXTINCTdn', 'EXTxASYMdn', 'EXTINCTNIRdn', 'EXTINCTUVdn', 'WD_NC4CH2OH', 'WD_NC4CHO', 'WD_NDEP', 'WD_NH3', 'WD_NH4', 'WD_NHDEP', - 'WD_NOA', 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', + 'WD_NOA', 'WD_NTERPOOH', 'WD_ONITR', 'WD_PHENOOH', 'WD_POOH', 'WD_ROOH', 'WD_SO2', 'WD_SOAGbb0', 'WD_SOAGbb1', 'WD_SOAGbb2', 'WD_SOAGbb3', 'WD_SOAGbb4', 'WD_SOAGbg0', 'WD_SOAGbg1', 'WD_SOAGbg2', 'WD_SOAGbg3', 'WD_SOAGbg4', 'WD_SOAGff0', 'WD_SOAGff1', 'WD_SOAGff2', 'WD_SOAGff3', 'WD_SOAGff4', 'WD_SVOCbb','WD_SVOCff', 'WD_TERP2OOH', 'WD_TERPNIT', 'WD_TERPOOH', - 'DF_CO', 'DF_GLYALD', + 'DF_CO', 'DF_GLYALD', 'dry_deposition_NHx_as_N', 'DF_NH3', 'DF_NH4', 'DF_NO', 'DF_NO2', 'DF_NOA', 'DF_NTERPOOH', 'DF_O3', - 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', + 'DF_ONITR', 'DF_PAN', 'DF_PHENOOH', 'DF_POOH', 'DF_ROOH', 'DF_SO2', 'DF_SOAGbb0', 'DF_SOAGbb1', 'DF_SOAGbb2', 'DF_SOAGbb3', 'DF_SOAGbb4', 'DF_SOAGbg0', 'DF_SOAGbg1', 'DF_SOAGbg2', 'DF_SOAGbg3', 'DF_SOAGbg4', 'DF_SOAGff0', 'DF_SOAGff1', 'DF_SOAGff2', 'DF_SOAGff3', 'DF_SOAGff4', 'DF_SVOCbb','DF_SVOCff', 'DF_TERP2OOH', 'DF_TERPNIT', 'DF_TERPOOH', 'DF_TERPROD1', diff --git a/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml b/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml index 7219cf0322..791b6f3737 100644 --- a/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml +++ b/bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml @@ -67,8 +67,6 @@ INTERP_MISSING_MONTHS -'noy', 'nhx' - 1,30,365,240,240,480,365,73,30 diff --git a/bld/namelist_files/use_cases/sd_cam6.xml b/bld/namelist_files/use_cases/sd_cam6.xml index 9a89255e88..2e81857089 100644 --- a/bld/namelist_files/use_cases/sd_cam6.xml +++ b/bld/namelist_files/use_cases/sd_cam6.xml @@ -36,8 +36,6 @@ 'SERIAL' 'CO2','CH4','N2O','CFC11eq','CFC12' - 1850 - 2015 - 1850 + 1850-2015 diff --git a/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml b/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml index 4075ad584c..4d32182f8a 100644 --- a/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml +++ b/bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml @@ -31,8 +31,6 @@ INTERP_MISSING_MONTHS -'noy', 'nhx' - 1, 1 @@ -49,7 +47,7 @@ .false. .false. - + 'CFC11STAR', 'AODDUST', 'AODDUST02', 'T', 'U', 'V', 'O3', 'OH', 'NO3', 'HO2', 'LNO_COL_PROD', 'NO2_CLXF', 'SFNO', 'SFNH3', 'BRO', 'CH3CL', @@ -161,46 +159,46 @@ 'DF_BIGALD4', 'DF_BIGALK', 'DF_BIGENE', 'DF_BZALD', 'DF_C2H2', 'DF_C2H4', 'DF_C2H6', 'DF_C3H6', 'DF_C3H8', 'DF_CRESOL', 'DF_DMS', 'DF_GLYOXAL', 'DF_ISOP', 'DF_MACR', 'DF_MEK', 'DF_MVK', 'DF_N2O5', 'DF_PBZNIT', 'DF_PHENOL', 'DF_TEPOMUC', 'DF_TOLUENE', 'DF_XYLENES', 'DF_XYLOL', - 'WD_BCARY', 'WD_BENZENE', 'WD_BEPOMUC', 'WD_BIGALD1', 'WD_BIGALD2', 'WD_BIGALD3', 'WD_BIGALD4', + 'WD_BCARY', 'WD_BENZENE', 'WD_BEPOMUC', 'WD_BIGALD1', 'WD_BIGALD2', 'WD_BIGALD3', 'WD_BIGALD4', 'WD_BIGALK', 'WD_BIGENE', 'WD_BZALD', - 'WD_C2H2', 'WD_C2H4', 'WD_C2H6', 'WD_C3H6', 'WD_C3H8', 'WD_CO', 'WD_CRESOL', 'WD_DMS', 'WD_GLYOXAL', 'WD_ISOP', + 'WD_C2H2', 'WD_C2H4', 'WD_C2H6', 'WD_C3H6', 'WD_C3H8', 'WD_CO', 'WD_CRESOL', 'WD_DMS', 'WD_GLYOXAL', 'WD_ISOP', 'WD_MEK', 'WD_MPAN', 'WD_N2O5', 'WD_NO', 'WD_NO2', 'WD_PAN', 'WD_PBZNIT', 'WD_PHENOL', 'WD_TEPOMUC','WD_TOLUENE', 'WD_XYLENES', 'WD_XYLOL' 'MEG_APIN','MEG_BPIN','MEG_LIMON','MEG_MYRC', - 'ISOPFDN', 'ISOPFNP', 'ISOPN3B', 'ISOPN2B', 'ISOPN1D', 'ISOPN4D', + 'ISOPFDN', 'ISOPFNP', 'ISOPN3B', 'ISOPN2B', 'ISOPN1D', 'ISOPN4D', 'ISOPNBNO3', 'ISOPNOOHB', 'ISOPNOOHD', 'INHEB','INHED', 'HPALD1','HPALD4','ISOPHFP', - 'MVKN', 'MACRN', 'HMHP', 'NO3CH2CHO', 'HYPERACET', 'HCOCH2OOH', + 'MVKN', 'MACRN', 'HMHP', 'NO3CH2CHO', 'HYPERACET', 'HCOCH2OOH', 'DHPMPAL', 'MVKOOH', 'ISOPOH', 'HPALDB1C','HPALDB4C','ICHE','ISOPFDNC','ISOPFNC', - 'TERPNT', 'TERPNS','TERPNT1', 'TERPNS1', 'TERPNPT', 'TERPNPS', 'TERPNPT1', + 'TERPNT', 'TERPNS','TERPNT1', 'TERPNS1', 'TERPNPT', 'TERPNPS', 'TERPNPT1', 'TERPNPS1', 'TERPFDN', 'SQTN', 'TERPHFN', - 'TERP1OOH', 'TERPDHDP', 'TERPF2', 'TERPF1', 'TERPA', 'TERPA2', 'TERPK', 'TERPAPAN', + 'TERP1OOH', 'TERPDHDP', 'TERPF2', 'TERPF1', 'TERPA', 'TERPA2', 'TERPK', 'TERPAPAN', 'TERPACID', 'TERPA2PAN', 'TERPACID2','TERPACID3','TERPA3PAN','TERPOOHL','TERPA3', 'APIN','BPIN','LIMON','MYRC', 'DF_ISOPFDN', 'DF_ISOPFNP', 'DF_ISOPN3B', 'DF_ISOPN2B', 'DF_ISOPN1D', 'DF_ISOPN4D', 'DF_ISOPNBNO3', 'DF_ISOPNOOHB', 'DF_ISOPNOOHD', - 'DF_INHEB','DF_INHED', + 'DF_INHEB','DF_INHED', 'DF_HPALD1','DF_HPALD4','DF_ISOPHFP','DF_MVKN', 'DF_MACRN', 'DF_HMHP' 'DF_NO3CH2CHO', 'DF_HYPERACET', 'DF_HCOCH2OOH', 'DF_DHPMPAL', 'DF_MVKOOH', 'DF_ISOPOH', 'DF_HPALDB1C','DF_HPALDB4C','DF_ICHE','DF_ISOPFDNC','DF_ISOPFNC', - 'DF_TERPNT', 'DF_TERPNS','DF_TERPNT1', 'DF_TERPNS1', 'DF_TERPNPT', 'DF_TERPNPS', + 'DF_TERPNT', 'DF_TERPNS','DF_TERPNT1', 'DF_TERPNS1', 'DF_TERPNPT', 'DF_TERPNPS', 'DF_TERPNPT1', 'DF_TERPNPS1', 'DF_TERPFDN', 'DF_SQTN', 'DF_TERPHFN', - 'DF_TERP1OOH', 'DF_TERPDHDP', 'DF_TERPF2', 'DF_TERPF1', 'DF_TERPA', - 'DF_TERPA2', 'DF_TERPK', 'DF_TERPAPAN', 'DF_TERPACID', 'DF_TERPA2PAN', + 'DF_TERP1OOH', 'DF_TERPDHDP', 'DF_TERPF2', 'DF_TERPF1', 'DF_TERPA', + 'DF_TERPA2', 'DF_TERPK', 'DF_TERPAPAN', 'DF_TERPACID', 'DF_TERPA2PAN', 'DF_TERPACID2','DF_TERPACID3','DF_TERPA3PAN','DF_TERPOOHL','DF_TERPA3', 'DF_APIN','DF_BPIN','DF_LIMON','DF_MYRC', - 'WD_ISOPFDN', 'WD_ISOPFNP', 'WD_ISOPN3B', 'WD_ISOPN2B', 'WD_ISOPN1D', 'WD_ISOPN4D', + 'WD_ISOPFDN', 'WD_ISOPFNP', 'WD_ISOPN3B', 'WD_ISOPN2B', 'WD_ISOPN1D', 'WD_ISOPN4D', 'WD_ISOPNBNO3', 'WD_ISOPNOOHB', 'WD_ISOPNOOHD', - 'WD_INHEB','WD_INHED', + 'WD_INHEB','WD_INHED', 'WD_HPALD1','WD_HPALD4','WD_ISOPHFP','WD_MVKN', 'WD_MACRN', 'WD_HMHP' 'WD_NO3CH2CHO', 'WD_HYPERACET', 'WD_HCOCH2OOH', 'WD_DHPMPAL', 'WD_MVKOOH', 'WD_ISOPOH', 'WD_HPALDB1C','WD_HPALDB4C','WD_ICHE','WD_ISOPFDNC','WD_ISOPFNC', - 'WD_TERPNT', 'WD_TERPNS','WD_TERPNT1', 'WD_TERPNS1', 'WD_TERPNPT', 'WD_TERPNPS', + 'WD_TERPNT', 'WD_TERPNS','WD_TERPNT1', 'WD_TERPNS1', 'WD_TERPNPT', 'WD_TERPNPS', 'WD_TERPNPT1', 'WD_TERPNPS1', 'WD_TERPFDN', 'WD_SQTN', 'WD_TERPHFN', - 'WD_TERP1OOH', 'WD_TERPDHDP', 'WD_TERPF2', 'WD_TERPF1', 'WD_TERPA', + 'WD_TERP1OOH', 'WD_TERPDHDP', 'WD_TERPF2', 'WD_TERPF1', 'WD_TERPA', 'WD_TERPA2', 'WD_TERPK', 'WD_TERPAPAN','WD_TERPACID','WD_TERPA2PAN', 'WD_TERPACID2','WD_TERPACID3','WD_TERPA3PAN','WD_TERPOOHL','WD_TERPA3', 'WD_APIN','WD_BPIN','WD_LIMON','WD_MYRC' diff --git a/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml b/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml index 2fe99cb0eb..29c41758ca 100644 --- a/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml +++ b/bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml @@ -41,8 +41,6 @@ INTERP_MISSING_MONTHS -'noy', 'nhx' - 1,30,365,240,240,480,365,73,30 diff --git a/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml b/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml index 9da740a7ae..f096415e31 100644 --- a/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml +++ b/bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml @@ -47,8 +47,6 @@ INTERP_MISSING_MONTHS -'noy', 'nhx' - 1, 5, 20, 40, 120, 240, 365, 73, 365 diff --git a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml index 24b55facc2..fbd7423680 100644 --- a/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml @@ -46,8 +46,6 @@ CYCLICAL 1850 -'noy', 'nhx' - 1, 30, 120, 240, 240, 480, 365, 73, 30 diff --git a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml index 042a153fe4..3bc7948bce 100644 --- a/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml @@ -40,8 +40,6 @@ INTERP_MISSING_MONTHS -'noy', 'nhx' - 1, 30, 120, 240, 240, 480, 365, 73, 30 diff --git a/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml index 691150a417..77184615a1 100644 --- a/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml @@ -88,11 +88,7 @@ 'UTEND4', 'UTEND5', 'FRONTGF', 'FRONTGFA', 'EKGW', 'QNO', 'QRLNLTE', 'QRL_TOT', 'DUV', 'DVV', 'TTPXMLC' - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc -share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -1850 -1850 -1 + +1850 diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml index 86e6af3bab..eefbf88163 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml @@ -45,8 +45,6 @@ CYCLICAL 1850 -'noy', 'nhx' - 1, 5, 20, 40, 120, 240, 365, 73, 365 diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml index efc485e990..fa5848ea40 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml @@ -242,8 +242,6 @@ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2000climo_2deg/emissions-cmip6_so4_a2_anthro-res_surface_2000climo_1.9x2.5_c20200422.nc' -'noy', 'nhx' - 1, 5, 20, 40, 120, 240, 365, 73, 365 diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml index fa65883ce1..ee6715c914 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml @@ -142,8 +142,6 @@ 'so4_a2 -> $INPUTDATA_ROOT/atm/cam/chem/emis/CMIP6_emissions_2010climo/emissions-cmip6_so4_a2_anthro-res_surface_2010climo_0.9x1.25_c20180918.nc' -'noy', 'nhx' - 1, 5, 20, 40, 120, 240, 365, 73, 365 diff --git a/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml b/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml index 00fb808a52..623d08bc95 100644 --- a/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml +++ b/bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml @@ -38,8 +38,6 @@ INTERP_MISSING_MONTHS -'noy', 'nhx' - 1, 5, 20, 40, 120, 240, 365, 73, 365 From e106d4ff450bf1e6715f158ea1122c6561749f47 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 9 Jan 2025 08:32:04 -0700 Subject: [PATCH 15/65] update ChangeLog --- doc/ChangeLog | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b535adc98e..5ebbb9ada8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -12,7 +12,8 @@ Purpose of changes (include the issue number and title text for each relevant Gi surface models through the NUOPC mediator. This sets the nitrogen deposition fluxes to prescribed CDEP input stream fluxes if corresponding namelist options are set. Otherwise, the nitrogen deposition fluxes set to chemistry computed fluxes if the chemistry is capable - of providing the fluxes. (Github issue #1196) + of providing the fluxes. Deprecated ndep_list option in drv_flds_in has beed removed. + (Github issue #1196) Describe any changes made to build system: @@ -34,11 +35,13 @@ M bld/build-namelist - change how default ndep_stream namelist options are set . check if chemistry is capable of producing nitrogen deposition fluxes . set defaults only if not simple physics nor aqua-planet configuration + . pass sim_year to add_default to select appriate stream_ndep settings M bld/namelist_files/namelist_defaults_cam.xml - - default ndep_stream namelist settings for perpetual year 2000 configuration + - add default ndep_stream namelist settings M bld/namelist_files/namelist_definition.xml + - remote deprecated ndep_list namelist variable - updates to stream_ndep_* namelist descriptions M bld/namelist_files/use_cases/1850_cam_lt.xml @@ -48,7 +51,30 @@ M bld/namelist_files/use_cases/hist_cam_lt.xml M bld/namelist_files/use_cases/hist_cam_mt.xml M bld/namelist_files/use_cases/sd_cam6.xml M bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml - - stream_ndep_* namelist settings for use cases + - added sim_year + +M bld/namelist_files/use_cases/hist_cam6.xml + - changed sim_year to "1850-2015" + +M bld/namelist_files/use_cases/2000_geoschem.xml +M bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml +M bld/namelist_files/use_cases/2010_geoschem.xml +M bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml +M bld/namelist_files/use_cases/hist_geoschem.xml +M bld/namelist_files/use_cases/hist_geoschem_nudged.xml +M bld/namelist_files/use_cases/hist_trop_strat_nudged_cam6.xml +M bld/namelist_files/use_cases/hist_trop_strat_vbsext_cam6.xml +M bld/namelist_files/use_cases/hist_trop_strat_vbsfire_cam6.xml +M bld/namelist_files/use_cases/sd_trop_strat2_cam6.xml +M bld/namelist_files/use_cases/sd_trop_strat_vbs_cam6.xml +M bld/namelist_files/use_cases/sd_waccm_tsmlt_cam6.xml +M bld/namelist_files/use_cases/waccm_ma_1850_cam6.xml +M bld/namelist_files/use_cases/waccm_ma_hist_cam6.xml +M bld/namelist_files/use_cases/waccm_tsmlt_1850_cam6.xml +M bld/namelist_files/use_cases/waccm_tsmlt_2000_cam6.xml +M bld/namelist_files/use_cases/waccm_tsmlt_2010_cam6.xml +M bld/namelist_files/use_cases/waccm_tsmlt_hist_cam6.xml + - removed deprecated ndep_list M cime_config/buildnml - remove the use of CAM_STREAM_NDEP* xml vars to set stream_ndep* namelist options From 04f41af4f525fe17551fa3394ac1aad969e4f7bc Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Thu, 9 Jan 2025 11:44:48 -0700 Subject: [PATCH 16/65] added vorticity coupling from SE dycore to GW param --- src/dynamics/se/dp_coupling.F90 | 33 ++++++- src/dynamics/se/dyn_comp.F90 | 4 + src/dynamics/se/gravity_waves_sources.F90 | 107 +++++++++++++++++++++- src/physics/cam/gw_common.F90 | 5 +- src/physics/cam/gw_drag.F90 | 27 +++++- src/physics/cam/gw_movmtn.F90 | 69 +++++++++++--- 6 files changed, 221 insertions(+), 24 deletions(-) diff --git a/src/dynamics/se/dp_coupling.F90 b/src/dynamics/se/dp_coupling.F90 index 919b7f3510..e7b9331083 100644 --- a/src/dynamics/se/dp_coupling.F90 +++ b/src/dynamics/se/dp_coupling.F90 @@ -50,7 +50,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) ! dry air mass. use gravity_waves_sources, only: gws_src_fnct - use dyn_comp, only: frontgf_idx, frontga_idx + use dyn_comp, only: frontgf_idx, frontga_idx, vort4gw_idx use phys_control, only: use_gw_front, use_gw_front_igw use hycoef, only: hyai, ps0 use fvm_mapping, only: dyn2phys_vector, dyn2phys_all_vars @@ -84,9 +84,18 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) real (kind=r8), allocatable :: frontga(:,:,:) ! function (frontgf) and angle (frontga) real (kind=r8), allocatable :: frontgf_phys(:,:,:) real (kind=r8), allocatable :: frontga_phys(:,:,:) + + !++jtb 12/31/24 + ! Vorticity + real (kind=r8), allocatable :: vort4gw(:,:,:) ! temp arrays to hold vorticity + real (kind=r8), allocatable :: vort4gw_phys(:,:,:) + + ! Pointers to pbuf real (kind=r8), pointer :: pbuf_frontgf(:,:) real (kind=r8), pointer :: pbuf_frontga(:,:) + !++jtb 12/31/24 + real (kind=r8), pointer :: pbuf_vort4gw(:,:) integer :: ncols, ierr integer :: col_ind, blk_ind(1), m @@ -110,6 +119,10 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) nullify(pbuf_chnk) nullify(pbuf_frontgf) nullify(pbuf_frontga) + !++jtb + nullify(pbuf_vort4gw) + + if (fv_nphys > 0) then nphys = fv_nphys @@ -135,11 +148,14 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (ierr /= 0) call endrun("dp_coupling: Allocate of frontgf failed.") allocate(frontga(nphys_pts,pver,nelemd), stat=ierr) if (ierr /= 0) call endrun("dp_coupling: Allocate of frontga failed.") + !++jtb + allocate(vort4gw(nphys_pts,pver,nelemd), stat=ierr) + if (ierr /= 0) call endrun("dp_coupling: Allocate of vort4gw failed.") end if if (iam < par%nprocs) then if (use_gw_front .or. use_gw_front_igw) then - call gws_src_fnct(elem, tl_f, tl_qdp_np0, frontgf, frontga, nphys) + call gws_src_fnct(elem, tl_f, tl_qdp_np0, frontgf, frontga, vort4gw, nphys) end if if (fv_nphys > 0) then @@ -204,6 +220,8 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (use_gw_front .or. use_gw_front_igw) then frontgf(:,:,:) = 0._r8 frontga(:,:,:) = 0._r8 + !++jtb + vort4gw(:,:,:) = 0._r8 end if endif ! iam < par%nprocs @@ -222,6 +240,8 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (use_gw_front .or. use_gw_front_igw) then allocate(frontgf_phys(pcols, pver, begchunk:endchunk)) allocate(frontga_phys(pcols, pver, begchunk:endchunk)) + !++jtb 12/31/24 + allocate(vort4gw_phys(pcols, pver, begchunk:endchunk)) end if !$omp parallel do num_threads(max_num_threads) private (col_ind, lchnk, icol, ie, blk_ind, ilyr, m) do col_ind = 1, phys_columns_on_task @@ -239,6 +259,8 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (use_gw_front .or. use_gw_front_igw) then frontgf_phys(icol, ilyr, lchnk) = frontgf(blk_ind(1), ilyr, ie) frontga_phys(icol, ilyr, lchnk) = frontga(blk_ind(1), ilyr, ie) + !++jtb 12/31/24 + vort4gw_phys(icol, ilyr, lchnk) = vort4gw(blk_ind(1), ilyr, ie) end if end do @@ -248,22 +270,27 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) end do end do end do + !++jtb 12/31/24 if (use_gw_front .or. use_gw_front_igw) then - !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_frontgf, pbuf_frontga) + !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_frontgf, pbuf_frontga, pbuf_vort4gw) do lchnk = begchunk, endchunk ncols = get_ncols_p(lchnk) pbuf_chnk => pbuf_get_chunk(pbuf2d, lchnk) call pbuf_get_field(pbuf_chnk, frontgf_idx, pbuf_frontgf) call pbuf_get_field(pbuf_chnk, frontga_idx, pbuf_frontga) + call pbuf_get_field(pbuf_chnk, vort4gw_idx, pbuf_vort4gw) do icol = 1, ncols do ilyr = 1, pver pbuf_frontgf(icol, ilyr) = frontgf_phys(icol, ilyr, lchnk) pbuf_frontga(icol, ilyr) = frontga_phys(icol, ilyr, lchnk) + pbuf_vort4gw(icol, ilyr) = vort4gw_phys(icol, ilyr, lchnk) end do end do end do deallocate(frontgf_phys) deallocate(frontga_phys) + !++jtb 12/31/24 + deallocate(vort4gw_phys) end if call t_stopf('dpcopy') diff --git a/src/dynamics/se/dyn_comp.F90 b/src/dynamics/se/dyn_comp.F90 index 586ee06b1f..56f7ee5355 100644 --- a/src/dynamics/se/dyn_comp.F90 +++ b/src/dynamics/se/dyn_comp.F90 @@ -79,6 +79,8 @@ module dyn_comp ! Frontogenesis indices integer, public :: frontgf_idx = -1 integer, public :: frontga_idx = -1 +!++jtb +integer, public :: vort4gw_idx = -1 interface read_dyn_var module procedure read_dyn_field_2d @@ -571,6 +573,8 @@ subroutine dyn_register() frontgf_idx) call pbuf_add_field("FRONTGA", "global", dtype_r8, (/pcols,pver/), & frontga_idx) + call pbuf_add_field("VORT4GW", "global", dtype_r8, (/pcols,pver/), & + vort4gw_idx) end if end subroutine dyn_register diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index a929dfeaf1..2789a7e385 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -6,6 +6,9 @@ module gravity_waves_sources use hybrid_mod, only: hybrid_t use shr_kind_mod, only: r8 => shr_kind_r8 + !++ jtb (added for now, while debugging) + use cam_logfile, only: iulog + implicit none private save @@ -18,6 +21,7 @@ module gravity_waves_sources public :: gws_src_fnct public :: gws_init private :: compute_frontogenesis + private :: compute_vorticity_4gw type (EdgeBuffer_t) :: edge3 type (derivative_t) :: deriv @@ -45,7 +49,7 @@ subroutine gws_init(elem) end subroutine gws_init - subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga,nphys) + subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, vort4gw, nphys) use derivative_mod, only : derivinit use dimensions_mod, only : npsq, nelemd use dof_mod, only : UniquePoints @@ -60,11 +64,21 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga,nphys) real (kind=r8), intent(out) :: frontgf(nphys*nphys,pver,nelemd) real (kind=r8), intent(out) :: frontga(nphys*nphys,pver,nelemd) + !++jtb (12/31/24) + real (kind=r8), intent(out) :: vort4gw(nphys*nphys,pver,nelemd) + !!real (kind=r8) :: vort4gw(nphys*nphys,pver,nelemd) + + ! Local variables type (hybrid_t) :: hybrid integer :: nets, nete, ithr, ncols, ie real(kind=r8), allocatable :: frontgf_thr(:,:,:,:) real(kind=r8), allocatable :: frontga_thr(:,:,:,:) + + !++jtb (12/31/24) + real(kind=r8), allocatable :: vort4gw_thr(:,:,:,:) + + ! This does not need to be a thread private data-structure call derivinit(deriv) @@ -75,25 +89,114 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga,nphys) allocate(frontgf_thr(nphys,nphys,nlev,nets:nete)) allocate(frontga_thr(nphys,nphys,nlev,nets:nete)) + !++jtb (12/31/24) + allocate(vort4gw_thr(nphys,nphys,nlev,nets:nete)) + call compute_frontogenesis(frontgf_thr,frontga_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) + call compute_vorticity_4gw(vort4gw_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) + if (fv_nphys>0) then do ie=nets,nete frontgf(:,:,ie) = RESHAPE(frontgf_thr(:,:,:,ie),(/nphys*nphys,nlev/)) frontga(:,:,ie) = RESHAPE(frontga_thr(:,:,:,ie),(/nphys*nphys,nlev/)) + !++jtb (12/31/24) + vort4gw(:,:,ie) = RESHAPE(vort4gw_thr(:,:,:,ie),(/nphys*nphys,nlev/)) end do else do ie=nets,nete ncols = elem(ie)%idxP%NumUniquePts call UniquePoints(elem(ie)%idxP, nlev, frontgf_thr(:,:,:,ie), frontgf(1:ncols,:,ie)) call UniquePoints(elem(ie)%idxP, nlev, frontga_thr(:,:,:,ie), frontga(1:ncols,:,ie)) + !++jtb (12/31/24) + call UniquePoints(elem(ie)%idxP, nlev, vort4gw_thr(:,:,:,ie), vort4gw(1:ncols,:,ie)) end do end if deallocate(frontga_thr) deallocate(frontgf_thr) + !++ jtb 12/31/24 + deallocate(vort4gw_thr) + !!$OMP END PARALLEL end subroutine gws_src_fnct + !++jtb (12/31/24) + subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nphys) + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! compute vorticity for use in gw params + ! F = ( curl ) [U,V] + ! + ! Original by Peter Lauritzen, Julio Bacmeister*, Dec 2024 + ! Patterned on 'compute_frontogenesis' + ! + ! * corresponding/blame-able + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + use derivative_mod, only: vorticity_sphere + use edge_mod, only: edgevpack, edgevunpack + use bndry_mod, only: bndry_exchange + use dyn_grid, only: hvcoord + use dimensions_mod, only: fv_nphys,ntrac + use fvm_mapping, only: dyn2phys_vector,dyn2phys + + type(hybrid_t), intent(in) :: hybrid + type(element_t), intent(inout), target :: elem(:) + type(derivative_t), intent(in) :: ederiv + integer, intent(in) :: nets,nete,nphys + integer, intent(in) :: tl,tlq + real(r8), intent(out) :: vort4gw(nphys,nphys,nlev,nets:nete) + + ! local + real(r8) :: area_inv(fv_nphys,fv_nphys), tmp(np,np) + !!real(r8) :: vort_tmp(fv_nphys*fv_nphys,nlev) + real(r8) :: vort_gll(np,np,nlev,nets:nete) + integer :: k,kptr,i,j,ie,component,h,nq,m_cnst,n0 + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! First calculate vorticity on GLL grid + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! set timelevel=1 fro velocities + n0=1 + do ie=nets,nete + do k=1,nlev + call vorticity_sphere(elem(ie)%state%v(:,:,:,k,n0),ederiv,elem(ie),vort_gll(:,:,k,ie)) + end do + do k=1,nlev + vort_gll(:,:,k,ie) = vort_gll(:,:,k,ie)*elem(ie)%spheremp(:,:) + end do + ! pack ++jtb no idea what these routines are doing + call edgeVpack(edge3, vort_gll(:,:,:,ie),nlev,0,ie) + enddo + call bndry_exchange(hybrid,edge3,location='compute_vorticity_4gw') + do ie=nets,nete + call edgeVunpack(edge3, vort_gll(:,:,:,ie),nlev,0,ie) + ! apply inverse mass matrix, + do k=1,nlev + vort_gll(:,:,k,ie) = vort_gll(:,:,k,ie)*elem(ie)%rspheremp(:,:) + end do + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! Now regrid from GLL to PhysGrid if necessary + ! otherwise just return vorticity on GLL grid + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + if (fv_nphys>0) then + tmp = 1.0_r8 + area_inv = dyn2phys(tmp,elem(ie)%metdet) + area_inv = 1.0_r8/area_inv + !!! vort_tmp(:,:) = dyn2phys(vort_gll(:,:,:,ie),elem(ie)) !peter replace with scalar mapping !++jtb: Think I did that ... + do k=1,nlev + vort4gw(:,:,k,ie) = dyn2phys( vort_gll(:,:,k,ie) , elem(ie)%metdet , area_inv ) + end do + else + do k=1,nlev + vort4gw(:,:,k,ie) = vort_gll(:,:,k,ie) + end do + end if + enddo + + + end subroutine compute_vorticity_4gw + + subroutine compute_frontogenesis(frontgf,frontga,tl,tlq,elem,ederiv,hybrid,nets,nete,nphys) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! compute frontogenesis function F @@ -170,6 +273,8 @@ subroutine compute_frontogenesis(frontgf,frontga,tl,tlq,elem,ederiv,hybrid,nets, enddo ! pack call edgeVpack(edge3, frontgf_gll(:,:,:,ie),nlev,0,ie) + !++jtb: + ! Why are dims 2*nlev,nlev, not 2*nlev,2*nlev, or nlev,nlev, ???? call edgeVpack(edge3, gradth(:,:,:,:,ie),2*nlev,nlev,ie) enddo call bndry_exchange(hybrid,edge3,location='compute_frontogenesis') diff --git a/src/physics/cam/gw_common.F90 b/src/physics/cam/gw_common.F90 index 04014c8c97..b98d8155b8 100644 --- a/src/physics/cam/gw_common.F90 +++ b/src/physics/cam/gw_common.F90 @@ -132,7 +132,10 @@ function new_GWBand(ngwv, dc, fcrit2, wavelength) result(band) ! Simple assignments. band%ngwv = ngwv band%dc = dc - band%fcrit2 = fcrit2 + !++jtb (12/24/2024) + ! This nonsesnse needs to be straightened out + ! For now just ensure fcrit is always set to 1 + band%fcrit2 = 1.0_r8 ! fcrit2 ! Uniform phase speed reference grid. allocate(band%cref(-ngwv:ngwv)) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 212051bcde..d5192c8e77 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -161,6 +161,9 @@ module gw_drag integer :: ttend_sh_idx = -1 integer :: frontgf_idx = -1 integer :: frontga_idx = -1 + !++jtb + integer :: vort4gw_idx = -1 + integer :: sgh_idx = -1 ! From CLUBB @@ -367,10 +370,12 @@ subroutine gw_drag_readnl(nlfile) call mpi_bcast(effgw_rdg_resid, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: effgw_rdg_resid") + !++ jtb (12/24/2024) + ! This is confusing. Not sure when if ever this was needed. ! Check if fcrit2 was set. - call shr_assert(fcrit2 /= unset_r8, & - "gw_drag_readnl: fcrit2 must be set via the namelist."// & - errMsg(__FILE__, __LINE__)) + !call shr_assert(fcrit2 /= unset_r8, & + ! "gw_drag_readnl: fcrit2 must be set via the namelist."// & + ! errMsg(__FILE__, __LINE__)) ! Check if pgwv was set. call shr_assert(pgwv >= 0, & @@ -911,6 +916,7 @@ subroutine gw_init() frontgf_idx = pbuf_get_index('FRONTGF') frontga_idx = pbuf_get_index('FRONTGA') + vort4gw_idx = pbuf_get_index('VORT4GW') call shr_assert(unset_r8 /= frontgfc, & "gw_init: Frontogenesis enabled, but frontgfc was & @@ -935,6 +941,8 @@ subroutine gw_init() 'Frontogenesis function at gws src level') call addfld ('FRONTGFA', (/ 'lev' /), 'A', 'K^2/M^2/S', & 'Frontogenesis function at gws src level') + call addfld ('VORT4GW', (/ 'lev' /), 'A', '1/S', & + 'Vorticity') if (history_waccm) then call add_default('FRONTGF', 1, ' ') @@ -1596,6 +1604,8 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) ! Frontogenesis real(r8), pointer :: frontgf(:,:) real(r8), pointer :: frontga(:,:) + !++jtb 12/31/24 + real(r8), pointer :: vort4gw(:,:) ! Temperature change due to deep convection. real(r8), pointer :: ttend_dp(:,:) @@ -1785,11 +1795,17 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) call pbuf_get_field(pbuf, upwp_clubb_gw_idx, upwp_clubb_gw) call pbuf_get_field(pbuf, vpwp_clubb_gw_idx, vpwp_clubb_gw) + !++jtb 01/03/25 + ! Vorticity from SE dycore. This needs to be either + ! generalized to other dycores or protected with some + ! endrun if dycore != SE + call pbuf_get_field(pbuf, vort4gw_idx, vort4gw) + xpwp_clubb(:ncol,:) = sqrt( upwp_clubb_gw(:ncol,:)**2 + vpwp_clubb_gw(:ncol,:)**2 ) effgw = 1._r8 call gw_movmtn_src(ncol, lchnk, band_movmtn , movmtn_desc, & - u, v, ttend_dp(:ncol,:), ttend_clubb(:ncol,:), xpwp_clubb(:ncol,:) , & + u, v, ttend_dp(:ncol,:), ttend_clubb(:ncol,:), xpwp_clubb(:ncol,:), vort4gw(:ncol,:), & zm, alpha_gw_movmtn, src_level, tend_level, & tau, ubm, ubi, xv, yv, & phase_speeds, hdepth) @@ -1849,6 +1865,9 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) call outfld('UPWP_CLUBB_GW', upwp_clubb_gw, pcols, lchnk) call outfld('VPWP_CLUBB_GW', vpwp_clubb_gw, pcols, lchnk) + !++jtb 01/03/25 (see comment above) + call outfld ('VORT4GW', vort4gw, pcols, lchnk) + !Deallocate variables that are no longer used: deallocate(tau, gwut, phase_speeds) diff --git a/src/physics/cam/gw_movmtn.F90 b/src/physics/cam/gw_movmtn.F90 index 0408928932..27d04983a2 100644 --- a/src/physics/cam/gw_movmtn.F90 +++ b/src/physics/cam/gw_movmtn.F90 @@ -2,7 +2,7 @@ module gw_movmtn ! ! This module parameterizes gravity waves generated by the obstacle effect produced by -! boundary layer turbulence for convection. +! internal circulations in the atmosphere. ! use gw_utils, only: r8 @@ -35,12 +35,12 @@ module gw_movmtn !========================================================================== subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & - netdt, netdt_shcu, xpwp_shcu, & + netdt, netdt_shcu, xpwp_shcu, vorticity, & zm, alpha_gw_movmtn, src_level, tend_level, tau, ubm, ubi, xv, yv, & c, hdepth) !----------------------------------------------------------------------- ! Flexible driver for gravity wave source from obstacle effects produced -! by boundary layer turbulence or deep convection +! by internal circulations !----------------------------------------------------------------------- use gw_utils, only: get_unit_vector, dot_2d, midpoint_interp use gw_common, only: GWBand, pver, qbo_hdepth_scaling @@ -65,6 +65,8 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & real(r8), intent(in) :: netdt_shcu(:,:) ! Higher order flux from ShCu/PBL. real(r8), intent(in) :: xpwp_shcu(ncol,pver+1) + ! Relative vorticity + real(r8), intent(in) :: vorticity(ncol,pver) ! Midpoint altitudes. real(r8), intent(in) :: zm(ncol,pver) ! tunable parameter controlling proportion of PBL momentum flux emitted as GW @@ -136,10 +138,12 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & ! Index for ground based phase speed bin real(r8) :: c0(ncol,-band%ngwv:band%ngwv) integer :: c_idx(ncol,-band%ngwv:band%ngwv) - ! Flux source from ShCu/PBL + ! GW Flux source from ShCu/PBL real(r8) :: xpwp_src(ncol) + ! Gw Flux source from vorticity + real(r8) :: vort_src(ncol) ! Manual steering level set - integer :: Steer_k + integer :: Steer_k, Steer_k_vort !---------------------------------------------------------------------- ! Initialize tau array @@ -150,18 +154,21 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & tau0 = 0.0_r8 !---------------------------------------------------------------------- - ! Calculate flux source from ShCu/PBL + ! Calculate flux source from ShCu/PBL and set Steering level !---------------------------------------------------------------------- - xpwp_src = shcu_flux_src( xpwp_shcu, ncol, pver+1, alpha_gw_movmtn ) - + ! call shcu_flux_src( xpwp_shcu, ncol, pver+1, alpha_gw_movmtn, xpwp_src, Steer_k ) + + !---------------------------------------------------------------------- + ! Calculate flux source from vorticity + !---------------------------------------------------------------------- + call vorticity_flux_src( vorticity, ncol, pver , alpha_gw_movmtn, xpwp_src, Steer_k ) + !------------------------------------------------------------------------ ! Determine wind and unit vectors approximately at the source (steering level), then ! project winds. !------------------------------------------------------------------------ - ! Winds at 'steering level' - Steer_k = pver-1 - usteer = u(:,Steer_k) !k defined in line21 (at specified altitude) + usteer = u(:,Steer_k) ! vsteer = v(:,Steer_k) steer_level = real(Steer_k,r8) @@ -209,7 +216,7 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & if (use_gw_movmtn_pbl) then boti=pver - topi=Steer_k-10 ! desc%k-5 + topi=Steer_k-10 !++ tuning test 01/05/25 else do k = pver, 1, -1 !start at surface do i = 1, ncol @@ -419,15 +426,19 @@ pure function index_of_nearest(x, grid) result(idx) end function index_of_nearest !!!!!!!!!!!!!!!!!!!!!!!!!!! -pure function shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn ) result(xpwp_src) +subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, steering_level ) !! result(xpwp_src) + !!! use gw_common, only: pver integer, intent(in) :: ncol,pverx real(r8), intent(in) :: xpwp_shcu (ncol,pverx) real(r8), intent(in) :: alpha_gw_movmtn - real(r8) :: xpwp_src(ncol) + real(r8), intent(out) :: xpwp_src(ncol) + integer, intent(out) :: steering_level integer :: k, nlayers + steering_level = (pverx-1) - 5 !++ tuning test 12/30/24 + !----------------------------------- ! Simple average over layers. ! Probably can do better @@ -439,6 +450,34 @@ pure function shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn ) result(x end do xpwp_src(:) = alpha_gw_movmtn * xpwp_src(:)/(1.0_r8*nlayers) -end function shcu_flux_src +end subroutine shcu_flux_src + +!!!!!!!!!!!!!!!!!!!!!!!!!!! +subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_src, steering_level ) !! result(xpwp_src) + !!! use gw_common, only: pver + integer, intent(in) :: ncol,pverx + real(r8), intent(in) :: vorticity (ncol,pverx) + real(r8), intent(in) :: alpha_gw_movmtn + + real(r8), intent(out) :: vort_src(ncol) + integer, intent(out) :: steering_level + + real(r8) :: scale_factor + integer :: k, nlayers + + steering_level = pverx - 10 !++ ????? + scale_factor = 1.e4 ! scales vorticity amp to u'w' in CLUBB + !----------------------------------- + ! Simple average over layers. + ! Probably can do better + !----------------------------------- + nlayers=10 + vort_src(:) =0._r8 + do k = 0, nlayers-1 + vort_src(:) = vort_src(:) + scale_factor * abs( vorticity(:,pverx-k) ) + end do + vort_src(:) = alpha_gw_movmtn * vort_src(:)/(1.0_r8*nlayers) + +end subroutine vorticity_flux_src end module gw_movmtn From b30e9485906eabc06e59d6d4d09eb0e4a8ee7006 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 9 Jan 2025 12:43:11 -0700 Subject: [PATCH 17/65] add sim_year valid values of 2010 and 1850-2015 modified: bld/namelist_files/namelist_definition.xml --- bld/namelist_files/namelist_definition.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 4aaa038224..86f993a93d 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -8763,7 +8763,7 @@ Default: "." + group="camexp" valid_values="1850,2000,2010,1850-2000,1850-2015"> This varible is only used internally by build-namelist to determine appropriate defaults for climatological or transient forcing datasets. Default: set by build-namelist. From f9986872ff98853dc1aab10053315566072fa36a Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Wed, 15 Jan 2025 07:35:01 -0700 Subject: [PATCH 18/65] Latest movmtn mods - vorticity source --- src/dynamics/se/dp_coupling.F90 | 42 +++++++++++++++++------ src/dynamics/se/dyn_comp.F90 | 8 +++-- src/dynamics/se/gravity_waves_sources.F90 | 11 +++--- src/physics/cam/gw_drag.F90 | 8 +++-- src/physics/cam/gw_movmtn.F90 | 2 +- 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/src/dynamics/se/dp_coupling.F90 b/src/dynamics/se/dp_coupling.F90 index e7b9331083..2b339ca80e 100644 --- a/src/dynamics/se/dp_coupling.F90 +++ b/src/dynamics/se/dp_coupling.F90 @@ -51,7 +51,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) use gravity_waves_sources, only: gws_src_fnct use dyn_comp, only: frontgf_idx, frontga_idx, vort4gw_idx - use phys_control, only: use_gw_front, use_gw_front_igw + use phys_control, only: use_gw_front, use_gw_front_igw, use_gw_movmtn_pbl use hycoef, only: hyai, ps0 use fvm_mapping, only: dyn2phys_vector, dyn2phys_all_vars use se_dyn_time_mod, only: timelevel_qdp @@ -85,7 +85,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) real (kind=r8), allocatable :: frontgf_phys(:,:,:) real (kind=r8), allocatable :: frontga_phys(:,:,:) - !++jtb 12/31/24 + !++jtb 01/14/25 ! Vorticity real (kind=r8), allocatable :: vort4gw(:,:,:) ! temp arrays to hold vorticity real (kind=r8), allocatable :: vort4gw_phys(:,:,:) @@ -148,13 +148,16 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (ierr /= 0) call endrun("dp_coupling: Allocate of frontgf failed.") allocate(frontga(nphys_pts,pver,nelemd), stat=ierr) if (ierr /= 0) call endrun("dp_coupling: Allocate of frontga failed.") - !++jtb + end if + if (use_gw_movmtn_pbl) then + !++jtb 01/14/25 allocate(vort4gw(nphys_pts,pver,nelemd), stat=ierr) if (ierr /= 0) call endrun("dp_coupling: Allocate of vort4gw failed.") end if + !++jtb 01/14/25 if (iam < par%nprocs) then - if (use_gw_front .or. use_gw_front_igw) then + if (use_gw_front .or. use_gw_front_igw .or. use_gw_movmtn_pbl ) then call gws_src_fnct(elem, tl_f, tl_qdp_np0, frontgf, frontga, vort4gw, nphys) end if @@ -220,7 +223,9 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (use_gw_front .or. use_gw_front_igw) then frontgf(:,:,:) = 0._r8 frontga(:,:,:) = 0._r8 - !++jtb + end if + if (use_gw_movmtn_pbl) then + !++jtb 01/14/25 vort4gw(:,:,:) = 0._r8 end if @@ -240,7 +245,9 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (use_gw_front .or. use_gw_front_igw) then allocate(frontgf_phys(pcols, pver, begchunk:endchunk)) allocate(frontga_phys(pcols, pver, begchunk:endchunk)) - !++jtb 12/31/24 + end if + if (use_gw_movmtn_pbl) then + !++jtb 01/14/25 allocate(vort4gw_phys(pcols, pver, begchunk:endchunk)) end if !$omp parallel do num_threads(max_num_threads) private (col_ind, lchnk, icol, ie, blk_ind, ilyr, m) @@ -259,7 +266,9 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (use_gw_front .or. use_gw_front_igw) then frontgf_phys(icol, ilyr, lchnk) = frontgf(blk_ind(1), ilyr, ie) frontga_phys(icol, ilyr, lchnk) = frontga(blk_ind(1), ilyr, ie) - !++jtb 12/31/24 + end if + if (use_gw_movmtn_pbl) then + !++jtb 01/14/25 vort4gw_phys(icol, ilyr, lchnk) = vort4gw(blk_ind(1), ilyr, ie) end if end do @@ -270,7 +279,6 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) end do end do end do - !++jtb 12/31/24 if (use_gw_front .or. use_gw_front_igw) then !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_frontgf, pbuf_frontga, pbuf_vort4gw) do lchnk = begchunk, endchunk @@ -278,18 +286,30 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) pbuf_chnk => pbuf_get_chunk(pbuf2d, lchnk) call pbuf_get_field(pbuf_chnk, frontgf_idx, pbuf_frontgf) call pbuf_get_field(pbuf_chnk, frontga_idx, pbuf_frontga) - call pbuf_get_field(pbuf_chnk, vort4gw_idx, pbuf_vort4gw) do icol = 1, ncols do ilyr = 1, pver pbuf_frontgf(icol, ilyr) = frontgf_phys(icol, ilyr, lchnk) pbuf_frontga(icol, ilyr) = frontga_phys(icol, ilyr, lchnk) - pbuf_vort4gw(icol, ilyr) = vort4gw_phys(icol, ilyr, lchnk) end do end do end do deallocate(frontgf_phys) deallocate(frontga_phys) - !++jtb 12/31/24 + end if + !++jtb 01/14/25 + if (use_gw_movmtn_pbl) then + !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_frontgf, pbuf_frontga, pbuf_vort4gw) + do lchnk = begchunk, endchunk + ncols = get_ncols_p(lchnk) + pbuf_chnk => pbuf_get_chunk(pbuf2d, lchnk) + call pbuf_get_field(pbuf_chnk, vort4gw_idx, pbuf_vort4gw) + do icol = 1, ncols + do ilyr = 1, pver + pbuf_vort4gw(icol, ilyr) = vort4gw_phys(icol, ilyr, lchnk) + end do + end do + end do + !++jtb 01/14/25 deallocate(vort4gw_phys) end if diff --git a/src/dynamics/se/dyn_comp.F90 b/src/dynamics/se/dyn_comp.F90 index 56f7ee5355..d5e22f8ce9 100644 --- a/src/dynamics/se/dyn_comp.F90 +++ b/src/dynamics/se/dyn_comp.F90 @@ -10,7 +10,7 @@ module dyn_comp cnst_is_a_water_species use cam_control_mod, only: initial_run use cam_initfiles, only: initial_file_get_id, topo_file_get_id, pertlim -use phys_control, only: use_gw_front, use_gw_front_igw +use phys_control, only: use_gw_front, use_gw_front_igw, use_gw_movmtn_pbl use dyn_grid, only: ini_grid_name, timelevel, hvcoord, edgebuf, & ini_grid_hdim_name @@ -573,6 +573,8 @@ subroutine dyn_register() frontgf_idx) call pbuf_add_field("FRONTGA", "global", dtype_r8, (/pcols,pver/), & frontga_idx) + end if + if (use_gw_movmtn_pbl) then call pbuf_add_field("VORT4GW", "global", dtype_r8, (/pcols,pver/), & vort4gw_idx) end if @@ -879,8 +881,8 @@ subroutine dyn_init(dyn_in, dyn_out) call get_loop_ranges(hybrid, ibeg=nets, iend=nete) call prim_init2(elem, fvm, hybrid, nets, nete, TimeLevel, hvcoord) !$OMP END PARALLEL - - if (use_gw_front .or. use_gw_front_igw) call gws_init(elem) + !++jtb 01/14/25 + if (use_gw_front .or. use_gw_front_igw .or. use_gw_movmtn_pbl) call gws_init(elem) end if ! iam < par%nprocs call addfld ('nu_kmvis', (/ 'lev' /), 'A', '', 'Molecular viscosity Laplacian coefficient' , gridname='GLL') diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index 2789a7e385..2d90b759b2 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -23,7 +23,7 @@ module gravity_waves_sources private :: compute_frontogenesis private :: compute_vorticity_4gw - type (EdgeBuffer_t) :: edge3 + type (EdgeBuffer_t) :: edge3,edge1 type (derivative_t) :: deriv real(r8) :: psurf_ref @@ -44,6 +44,7 @@ subroutine gws_init(elem) ! Set up variables similar to dyn_comp and prim_driver_mod initializations call initEdgeBuffer(par, edge3, elem, 3*nlev,nthreads=1) + call initEdgeBuffer(par, edge1, elem, nlev,nthreads=1) psurf_ref = hypi(plev+1) @@ -66,7 +67,7 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, vort4gw, nphys) !++jtb (12/31/24) real (kind=r8), intent(out) :: vort4gw(nphys*nphys,pver,nelemd) - !!real (kind=r8) :: vort4gw(nphys*nphys,pver,nelemd) + !!real (kind=r8) :: vort4gw(nphys*nphys,pver,nelemd) phl remove ! Local variables @@ -164,11 +165,11 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph vort_gll(:,:,k,ie) = vort_gll(:,:,k,ie)*elem(ie)%spheremp(:,:) end do ! pack ++jtb no idea what these routines are doing - call edgeVpack(edge3, vort_gll(:,:,:,ie),nlev,0,ie) + call edgeVpack(edge1, vort_gll(:,:,:,ie),nlev,0,ie) enddo - call bndry_exchange(hybrid,edge3,location='compute_vorticity_4gw') + call bndry_exchange(hybrid,edge1,location='compute_vorticity_4gw') do ie=nets,nete - call edgeVunpack(edge3, vort_gll(:,:,:,ie),nlev,0,ie) + call edgeVunpack(edge1, vort_gll(:,:,:,ie),nlev,0,ie) ! apply inverse mass matrix, do k=1,nlev vort_gll(:,:,k,ie) = vort_gll(:,:,k,ie)*elem(ie)%rspheremp(:,:) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index d5192c8e77..996b47c5a8 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -1534,7 +1534,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) use gw_front, only: gw_cm_src use gw_convect, only: gw_beres_src use gw_movmtn, only: gw_movmtn_src - + use dycore, only: dycore_is !------------------------------Arguments-------------------------------- type(physics_state), intent(in) :: state ! physics state structure type(physics_buffer_desc), pointer :: pbuf(:) ! Physics buffer @@ -1799,7 +1799,11 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) ! Vorticity from SE dycore. This needs to be either ! generalized to other dycores or protected with some ! endrun if dycore != SE - call pbuf_get_field(pbuf, vort4gw_idx, vort4gw) + if (dycore_is('SE')) then + call pbuf_get_field(pbuf, vort4gw_idx, vort4gw) + else + call endrun( 'gw_drag: vort4gw only with SE') + end if xpwp_clubb(:ncol,:) = sqrt( upwp_clubb_gw(:ncol,:)**2 + vpwp_clubb_gw(:ncol,:)**2 ) diff --git a/src/physics/cam/gw_movmtn.F90 b/src/physics/cam/gw_movmtn.F90 index 27d04983a2..e4854b23c4 100644 --- a/src/physics/cam/gw_movmtn.F90 +++ b/src/physics/cam/gw_movmtn.F90 @@ -465,7 +465,7 @@ subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_sr real(r8) :: scale_factor integer :: k, nlayers - steering_level = pverx - 10 !++ ????? + steering_level = pverx - 20 !++ ????? scale_factor = 1.e4 ! scales vorticity amp to u'w' in CLUBB !----------------------------------- ! Simple average over layers. From 450312bd22f091613c754a761a56dfcd89976561 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Wed, 15 Jan 2025 09:04:39 -0700 Subject: [PATCH 19/65] Add sim_year to geoschem use case files; ChangeLog updates modified: bld/build-namelist modified: bld/namelist_files/use_cases/2010_geoschem.xml modified: bld/namelist_files/use_cases/hist_geoschem.xml modified: bld/namelist_files/use_cases/hist_geoschem_nudged.xml modified: doc/ChangeLog --- bld/build-namelist | 2 +- bld/namelist_files/use_cases/2010_geoschem.xml | 2 ++ bld/namelist_files/use_cases/hist_geoschem.xml | 2 ++ .../use_cases/hist_geoschem_nudged.xml | 2 ++ doc/ChangeLog | 12 ++++++++++-- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 7a66796964..6c14b26bbd 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -701,7 +701,7 @@ if ($sim_year =~ /(\d+)-(\d+)/) { # the chemistry cannot produce the nitrogen depostion fluxes if (!($simple_phys or $aqua_mode)) { my $chem_nitrodep = chem_has_species($cfg, 'NO') and chem_has_species($cfg, 'NH3'); - if (!$chem_nitrodep) { + if ((!$chem_nitrodep) or ($chem =~ /geoschem/)) { add_default($nl, 'stream_ndep_mesh_filename'); add_default($nl, 'stream_ndep_data_filename', 'sim_year'=>$sim_year); add_default($nl, 'stream_ndep_year_first', 'sim_year'=>$sim_year); diff --git a/bld/namelist_files/use_cases/2010_geoschem.xml b/bld/namelist_files/use_cases/2010_geoschem.xml index 36c6eea697..8f50e0321d 100644 --- a/bld/namelist_files/use_cases/2010_geoschem.xml +++ b/bld/namelist_files/use_cases/2010_geoschem.xml @@ -165,4 +165,6 @@ 'so4_a3', +2010 + diff --git a/bld/namelist_files/use_cases/hist_geoschem.xml b/bld/namelist_files/use_cases/hist_geoschem.xml index 2b3a158400..587ec4c1a4 100644 --- a/bld/namelist_files/use_cases/hist_geoschem.xml +++ b/bld/namelist_files/use_cases/hist_geoschem.xml @@ -161,4 +161,6 @@ 'so4_a3', +1850-2015 + diff --git a/bld/namelist_files/use_cases/hist_geoschem_nudged.xml b/bld/namelist_files/use_cases/hist_geoschem_nudged.xml index 51105cd460..6d6e94c6c5 100644 --- a/bld/namelist_files/use_cases/hist_geoschem_nudged.xml +++ b/bld/namelist_files/use_cases/hist_geoschem_nudged.xml @@ -216,4 +216,6 @@ 'so4_a3', +1850-2015 + diff --git a/doc/ChangeLog b/doc/ChangeLog index 5ebbb9ada8..18463609ac 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -12,9 +12,12 @@ Purpose of changes (include the issue number and title text for each relevant Gi surface models through the NUOPC mediator. This sets the nitrogen deposition fluxes to prescribed CDEP input stream fluxes if corresponding namelist options are set. Otherwise, the nitrogen deposition fluxes set to chemistry computed fluxes if the chemistry is capable - of providing the fluxes. Deprecated ndep_list option in drv_flds_in has beed removed. + of providing the fluxes. Deprecated ndep_list option in drv_flds_in has been removed. (Github issue #1196) + Currently there are no SSP scenario type compsets in CESM3 that use CAM atmosphere component. + Therefore, the specifications of the NDEP stream files for the SSP compsets are carried forward. + Describe any changes made to build system: Describe any changes made to the namelist: @@ -56,9 +59,14 @@ M bld/namelist_files/use_cases/waccm_sc_1850_cam6.xml M bld/namelist_files/use_cases/hist_cam6.xml - changed sim_year to "1850-2015" +M bld/namelist_files/use_cases/2010_geoschem.xml +M bld/namelist_files/use_cases/hist_geoschem.xml +M bld/namelist_files/use_cases/hist_geoschem_nudged.xml + - added sim_year + - removed deprecated ndep_list + M bld/namelist_files/use_cases/2000_geoschem.xml M bld/namelist_files/use_cases/2000_trop_strat_vbs_cam6.xml -M bld/namelist_files/use_cases/2010_geoschem.xml M bld/namelist_files/use_cases/2010_trop_strat_vbs_cam6.xml M bld/namelist_files/use_cases/hist_geoschem.xml M bld/namelist_files/use_cases/hist_geoschem_nudged.xml From c819813d8713daa89fd72128164915a02aab1fd3 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 16 Jan 2025 09:13:48 -0700 Subject: [PATCH 20/65] adjust sim_years for co2_cycle file defaults modified: bld/namelist_files/namelist_defaults_cam.xml --- bld/namelist_files/namelist_defaults_cam.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index bf9105db4a..3dfdca36f2 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -690,13 +690,13 @@ atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc -atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_0.9x1.25_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc +atm/cam/ggas/emissions-cmip6_CO2_anthro_surface_175001-201512_fv_1.9x2.5_c20181011.nc ac_CO2_filelist_175001-201512_fv_0.9x1.25_c20181011.txt ac_CO2_filelist_175001-201512_fv_1.9x2.5_c20181011.txt From fa37cb5e0cef6626ba89615ebe23d63ca975a197 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 16 Jan 2025 17:25:35 -0700 Subject: [PATCH 21/65] ChangeLog update --- doc/ChangeLog | 71 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 9 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 71107e68e2..a6428bdc91 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,10 +1,10 @@ =============================================================== -Tag name: cam6_4_??? +Tag name: cam6_4_056 Originator(s): fvitt Date: -One-line Summary: -Github PR URL: +One-line Summary: Nitrogen depostion fluxes to surface models +Github PR URL: https://github.com/ESCOMP/CAM/pull/1216 Purpose of changes (include the issue number and title text for each relevant GitHub issue): @@ -18,19 +18,21 @@ Purpose of changes (include the issue number and title text for each relevant Gi Currently there are no SSP scenario type compsets in CESM3 that use CAM atmosphere component. Therefore, the specifications of the NDEP stream files for the SSP compsets are carried forward. -Describe any changes made to build system: +Describe any changes made to build system: N/A Describe any changes made to the namelist: -List any changes to the defaults for the boundary datasets: + Removed ndep_list drv_flds_in namelist variable -Describe any substantial timing or memory changes: +List any changes to the defaults for the boundary datasets: N/A -Code reviewed by: +Describe any substantial timing or memory changes: N/A -List all files eliminated: +Code reviewed by: brian-eaton, cacraigucar -List all files added and what they do: +List all files eliminated: N/A + +List all files added and what they do: N/A List all existing files that have been modified, and describe the changes: @@ -132,7 +134,58 @@ appropriate machine below. All failed tests must be justified. derecho/intel/aux_cam: + FAIL ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s + DIFF SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h + - pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856 + + FAIL SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie + FAIL SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s + - pre-existing failures due to build-namelist error requiring CLM/CTSM external update + + NLFAIL ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp + NLFAIL ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s + NLFAIL ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s + NLFAIL ERC_D_Ln9.ne16_ne16_mg17.FADIAB.derecho_intel.cam-terminator + NLFAIL ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase + NLFAIL ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase + NLFAIL ERC_D_Ln9.T42_T42_mg17.FDABIP04.derecho_intel.cam-outfrq3s_usecase + NLFAIL ERC_D_Ln9.T42_T42_mg17.FHS94.derecho_intel.cam-outfrq3s_usecase + NLFAIL ERI_D_Ln18.f45_f45_mg37.QPC41850.derecho_intel.cam-co2rmp_usecase + NLFAIL ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPLT.derecho_intel.cam-outfrq3s_cosp + NLFAIL ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPMT.derecho_intel.cam-outfrq9s + NLFAIL ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s + NLFAIL ERS_Ln9.ne0TESTONLYne5x4_ne0TESTONLYne5x4_mg37.FADIAB.derecho_intel.cam-outfrq3s_refined + NLFAIL SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep + NLFAIL SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep + NLFAIL SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase + NLFAIL SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s + NLFAIL SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s + - expected namelist compare failures due to removal of stream_ndep namelist opts + + DIFF ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d + DIFF ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa + DIFF ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h + DIFF ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s + DIFF ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s + DIFF ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s + DIFF ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s + DIFF SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday + DIFF SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s + DIFF SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s + DIFF SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 + DIFF SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase + DIFF SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s + DIFF SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust + DIFF SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d + DIFF SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d + DIFF SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d + DIFF SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s + DIFF SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp + - expected differences due to currections to ndep fluxes + derecho/nvhpc/aux_cam: + FAIL ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default COMPARE_base_rest + - pre-existing failure -- issue #1220 izumi/nag/aux_cam: From 4328f4e7fada667a33b20df7febd5d781a80b255 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Thu, 16 Jan 2025 19:22:20 -0700 Subject: [PATCH 22/65] ChangeLog update --- doc/ChangeLog | 94 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 23 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index a6428bdc91..d9a7a43b73 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,7 @@ Tag name: cam6_4_056 Originator(s): fvitt -Date: +Date: 16 Jan 2025 One-line Summary: Nitrogen depostion fluxes to surface models Github PR URL: https://github.com/ESCOMP/CAM/pull/1216 @@ -184,36 +184,84 @@ derecho/intel/aux_cam: - expected differences due to currections to ndep fluxes derecho/nvhpc/aux_cam: + FAIL ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default COMPARE_base_rest - pre-existing failure -- issue #1220 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, i.e., -- what code configurations: -- what platforms/compilers: -- nature of change (roundoff; larger than roundoff but same climate; new - climate): - -If bitwise differences were observed, how did you show they were no worse -than roundoff? + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s + NLFAIL ERC_D_Ln9.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s + NLFAIL ERC_D_Ln9.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase + NLFAIL ERC_D_Ln9.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase + NLFAIL ERC_D_Ln9.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase + NLFAIL ERC_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac + NLFAIL ERC_D_Ln9.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase + NLFAIL ERI_D_Ln18.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac + NLFAIL ERI_D_Ln18.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 + NLFAIL ERI_D_Ln18.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic + NLFAIL ERI_D_Ln18.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic + NLFAIL ERP_Ln9.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf + NLFAIL ERS_Ln27.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s + NLFAIL ERS_Ln9.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s + NLFAIL PEM_D_Ln9.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s + NLFAIL PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 + NLFAIL PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 + NLFAIL PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 + NLFAIL PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 + NLFAIL PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 + NLFAIL PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 + NLFAIL SMS_D_Ln3.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s + NLFAIL SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem + NLFAIL SMS_D_Ln7.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm + NLFAIL SMS_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam + NLFAIL SMS_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba + NLFAIL SMS_D_Ln9_P1x1.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s + NLFAIL SMS_P48x1_D_Ln3.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase + NLFAIL SUB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s + NLFAIL TMC_D.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac + NLFAIL TMC_D.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 + - expected namelist compare failures due to removal of stream_ndep namelist opts -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: +izumi/gnu/aux_cam: + NLFAIL ERC_D_Ln9.f10_f10_mg37.FADIAB.izumi_gnu.cam-terminator + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_gnu.cam-rad_diag + NLFAIL ERC_D_Ln9.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s + NLFAIL ERC_D_Ln9.ne5_ne5_mg37.QPC4.izumi_gnu.cam-outfrq3s_nudging_ne5_L26 + NLFAIL ERC_D_Ln9.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq3s_ba + NLFAIL ERC_D_Ln9.ne5pg2_ne5pg2_mg37.FADIAB.izumi_gnu.cam-outfrq3s + NLFAIL ERC_D_Ln9.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s + NLFAIL ERI_D_Ln18.T5_T5_mg37.QPC4.izumi_gnu.cam-co2rmp + NLFAIL ERP_D_Ln9.C48_C48_mg17.QPC6.izumi_gnu.cam-outfrq9s + NLFAIL ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPLT.izumi_gnu.cam-outfrq9s + NLFAIL ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPMT.izumi_gnu.cam-outfrq9s + NLFAIL ERP_Ln9.ne5_ne5_mg37.FHS94.izumi_gnu.cam-outfrq9s + NLFAIL ERP_Ln9.ne5_ne5_mg37.QPC5.izumi_gnu.cam-outfrq9s + NLFAIL ERP_Ln9_P24x2.f45_f45_mg37.QPWmaC6.izumi_gnu.cam-outfrq9s_mee_fluxes + NLFAIL PEM_D_Ln9.ne5pg3_ne5pg3_mg37.FADIAB.izumi_gnu.cam-outfrq3s + NLFAIL PLB_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 + NLFAIL PLB_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 + NLFAIL PLB_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 + NLFAIL SCT_D_Ln7.ne3_ne3_mg37.QPC6.izumi_gnu.cam-scm_prep_c6 + NLFAIL SCT_D_Ln7.T42_T42_mg17.QPC4.izumi_gnu.cam-scm_prep + NLFAIL SCT_D_Ln7.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 + NLFAIL SMS_D_Ln3.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc + NLFAIL SMS_D_Ln9.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee + NLFAIL SMS_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac + - expected namelist compare failures due to removal of stream_ndep namelist opts -MSS location of control simulations used to validate new climate: + DIFF SMS_P48x1_D_Ln9.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s + - expected differences due to currections to ndep fluxes -URL for AMWG diagnostics output used to validate new climate: +Summarize any changes to answers: bit-for-bit unchanged =============================================================== =============================================================== From 4fb29df5a7eeff71ce0dbd23af3e22a310647001 Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Wed, 22 Jan 2025 08:36:13 -0700 Subject: [PATCH 23/65] mods to gw movmtn infrastructure --- bld/build-namelist | 3 +- bld/namelist_files/namelist_defaults_cam.xml | 2 + bld/namelist_files/namelist_definition.xml | 10 ++- src/dynamics/se/dp_coupling.F90 | 17 +++-- src/dynamics/se/gravity_waves_sources.F90 | 77 +++++++++++++++----- src/physics/cam/gw_drag.F90 | 20 +++-- src/physics/cam/gw_movmtn.F90 | 49 +++++++------ 7 files changed, 123 insertions(+), 55 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 9a38f49926..4aafedd25f 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3888,6 +3888,7 @@ if ($do_gw_convect_sh) { if ($do_gw_movmtn_pbl) { add_default($nl, 'gw_drag_file_mm'); add_default($nl, 'alpha_gw_movmtn'); + add_default($nl, 'effgw_movmtn_pbl'); } if ($do_gw_rdg_beta) { @@ -3908,7 +3909,7 @@ if ($do_gw_rdg_beta) { } if ($do_gw_rdg_resid) { - add_default($nl, 'effgw_rdg_resid'); + add_default($nl, 'effgw_rdg_resid', 'val'=>'1.0D0'); } if ($do_gw_rdg_gamma) { diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 8edaedf5f4..1f035adabf 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -897,6 +897,8 @@ 0.002d0 0.1d0 0.01d0 + 1.0d0 + 15 diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 24851424cc..a0f5ee38b3 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1434,8 +1434,14 @@ Default: 1.0 -JULIO - need to add comment and appropriate default -Default: ?????? JULIO +Efficiency scaling factor associated with residual non-ridge topo +Default: set by build-namelist. + + + +Efficiency scaling factor associated with residual non-ridge topo +Default: set by build-namelist. 0) then @@ -280,7 +283,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) end do end do if (use_gw_front .or. use_gw_front_igw) then - !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_frontgf, pbuf_frontga, pbuf_vort4gw) + !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_frontgf, pbuf_frontga) do lchnk = begchunk, endchunk ncols = get_ncols_p(lchnk) pbuf_chnk => pbuf_get_chunk(pbuf2d, lchnk) @@ -296,9 +299,9 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) deallocate(frontgf_phys) deallocate(frontga_phys) end if - !++jtb 01/14/25 + !++jtb 01/20/25 if (use_gw_movmtn_pbl) then - !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_frontgf, pbuf_frontga, pbuf_vort4gw) + !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_vort4gw) do lchnk = begchunk, endchunk ncols = get_ncols_p(lchnk) pbuf_chnk => pbuf_get_chunk(pbuf2d, lchnk) diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index 2d90b759b2..e2cc2609dc 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -19,6 +19,7 @@ module gravity_waves_sources !! for use by WACCM (via dp_coupling) public :: gws_src_fnct + public :: gws_src_vort public :: gws_init private :: compute_frontogenesis private :: compute_vorticity_4gw @@ -50,7 +51,7 @@ subroutine gws_init(elem) end subroutine gws_init - subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, vort4gw, nphys) + subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) use derivative_mod, only : derivinit use dimensions_mod, only : npsq, nelemd use dof_mod, only : UniquePoints @@ -65,10 +66,6 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, vort4gw, nphys) real (kind=r8), intent(out) :: frontgf(nphys*nphys,pver,nelemd) real (kind=r8), intent(out) :: frontga(nphys*nphys,pver,nelemd) - !++jtb (12/31/24) - real (kind=r8), intent(out) :: vort4gw(nphys*nphys,pver,nelemd) - !!real (kind=r8) :: vort4gw(nphys*nphys,pver,nelemd) phl remove - ! Local variables type (hybrid_t) :: hybrid @@ -76,10 +73,6 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, vort4gw, nphys) real(kind=r8), allocatable :: frontgf_thr(:,:,:,:) real(kind=r8), allocatable :: frontga_thr(:,:,:,:) - !++jtb (12/31/24) - real(kind=r8), allocatable :: vort4gw_thr(:,:,:,:) - - ! This does not need to be a thread private data-structure call derivinit(deriv) @@ -90,37 +83,85 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, vort4gw, nphys) allocate(frontgf_thr(nphys,nphys,nlev,nets:nete)) allocate(frontga_thr(nphys,nphys,nlev,nets:nete)) - !++jtb (12/31/24) - allocate(vort4gw_thr(nphys,nphys,nlev,nets:nete)) call compute_frontogenesis(frontgf_thr,frontga_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) - call compute_vorticity_4gw(vort4gw_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) if (fv_nphys>0) then do ie=nets,nete frontgf(:,:,ie) = RESHAPE(frontgf_thr(:,:,:,ie),(/nphys*nphys,nlev/)) frontga(:,:,ie) = RESHAPE(frontga_thr(:,:,:,ie),(/nphys*nphys,nlev/)) - !++jtb (12/31/24) - vort4gw(:,:,ie) = RESHAPE(vort4gw_thr(:,:,:,ie),(/nphys*nphys,nlev/)) end do else do ie=nets,nete ncols = elem(ie)%idxP%NumUniquePts call UniquePoints(elem(ie)%idxP, nlev, frontgf_thr(:,:,:,ie), frontgf(1:ncols,:,ie)) call UniquePoints(elem(ie)%idxP, nlev, frontga_thr(:,:,:,ie), frontga(1:ncols,:,ie)) - !++jtb (12/31/24) - call UniquePoints(elem(ie)%idxP, nlev, vort4gw_thr(:,:,:,ie), vort4gw(1:ncols,:,ie)) end do end if deallocate(frontga_thr) deallocate(frontgf_thr) - !++ jtb 12/31/24 - deallocate(vort4gw_thr) !!$OMP END PARALLEL end subroutine gws_src_fnct + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !+++ jtb (01/20/24) + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) + use derivative_mod, only : derivinit + use dimensions_mod, only : npsq, nelemd + use dof_mod, only : UniquePoints + use hybrid_mod, only : config_thread_region, get_loop_ranges + use parallel_mod, only : par + use ppgrid, only : pver + use thread_mod, only : horz_num_threads + use dimensions_mod, only : fv_nphys + implicit none + type (element_t), intent(inout), dimension(:) :: elem + integer, intent(in) :: tl, nphys, tlq + + ! + real (kind=r8), intent(out) :: vort4gw(nphys*nphys,pver,nelemd) + + ! Local variables + type (hybrid_t) :: hybrid + integer :: nets, nete, ithr, ncols, ie + + ! + real(kind=r8), allocatable :: vort4gw_thr(:,:,:,:) + + ! This does not need to be a thread private data-structure + call derivinit(deriv) + !!$OMP PARALLEL NUM_THREADS(horz_num_threads), DEFAULT(SHARED), PRIVATE(nets,nete,hybrid,ie,ncols,frontgf_thr,frontga_thr) +! hybrid = config_thread_region(par,'horizontal') + hybrid = config_thread_region(par,'serial') + call get_loop_ranges(hybrid,ibeg=nets,iend=nete) + + allocate(vort4gw_thr(nphys,nphys,nlev,nets:nete)) + + call compute_vorticity_4gw(vort4gw_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) + + if (fv_nphys>0) then + do ie=nets,nete + vort4gw(:,:,ie) = RESHAPE(vort4gw_thr(:,:,:,ie),(/nphys*nphys,nlev/)) + end do + else + do ie=nets,nete + ncols = elem(ie)%idxP%NumUniquePts + call UniquePoints(elem(ie)%idxP, nlev, vort4gw_thr(:,:,:,ie), vort4gw(1:ncols,:,ie)) + end do + end if + deallocate(vort4gw_thr) + + !!$OMP END PARALLEL + + end subroutine gws_src_vort + + + + + !++jtb (12/31/24) subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nphys) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 996b47c5a8..da6226ec83 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -109,7 +109,8 @@ module gw_drag real(r8) :: effgw_beres_dp = unset_r8 ! Beres (shallow convection). real(r8) :: effgw_beres_sh = unset_r8 - + ! PBL moving mtn + real(r8) :: effgw_movmtn_pbl = unset_r8 ! Parameters controlling isotropic residual ! orographic GW. @@ -257,7 +258,7 @@ subroutine gw_drag_readnl(nlfile) gw_oro_south_fac, gw_limit_tau_without_eff, & gw_lndscl_sgh, gw_prndl, gw_apply_tndmax, gw_qbo_hdepth_scaling, & gw_top_taper, front_gaussian_width, alpha_gw_movmtn, use_gw_rdg_resid, & - effgw_rdg_resid + effgw_rdg_resid, effgw_movmtn_pbl !---------------------------------------------------------------------- @@ -364,6 +365,8 @@ subroutine gw_drag_readnl(nlfile) call mpi_bcast(alpha_gw_movmtn, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: alpha_gw_movmtn") + call mpi_bcast(effgw_movmtn_pbl, 1, mpi_real8, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: alpha_gw_movmtn") call mpi_bcast(use_gw_rdg_resid, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: use_gw_rdg_resid") @@ -916,7 +919,6 @@ subroutine gw_init() frontgf_idx = pbuf_get_index('FRONTGF') frontga_idx = pbuf_get_index('FRONTGA') - vort4gw_idx = pbuf_get_index('VORT4GW') call shr_assert(unset_r8 /= frontgfc, & "gw_init: Frontogenesis enabled, but frontgfc was & @@ -941,8 +943,6 @@ subroutine gw_init() 'Frontogenesis function at gws src level') call addfld ('FRONTGFA', (/ 'lev' /), 'A', 'K^2/M^2/S', & 'Frontogenesis function at gws src level') - call addfld ('VORT4GW', (/ 'lev' /), 'A', '1/S', & - 'Vorticity') if (history_waccm) then call add_default('FRONTGF', 1, ' ') @@ -950,6 +950,14 @@ subroutine gw_init() end if end if + + if (use_gw_movmtn_pbl) then + + vort4gw_idx = pbuf_get_index('VORT4GW') + + call addfld ('VORT4GW', (/ 'lev' /), 'A', '1/S', & + 'Vorticity') + end if if (use_gw_front) then @@ -1807,7 +1815,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) xpwp_clubb(:ncol,:) = sqrt( upwp_clubb_gw(:ncol,:)**2 + vpwp_clubb_gw(:ncol,:)**2 ) - effgw = 1._r8 + effgw = effgw_movmtn_pbl !1._r8 call gw_movmtn_src(ncol, lchnk, band_movmtn , movmtn_desc, & u, v, ttend_dp(:ncol,:), ttend_clubb(:ncol,:), xpwp_clubb(:ncol,:), vort4gw(:ncol,:), & zm, alpha_gw_movmtn, src_level, tend_level, & diff --git a/src/physics/cam/gw_movmtn.F90 b/src/physics/cam/gw_movmtn.F90 index e4854b23c4..d916d58f1a 100644 --- a/src/physics/cam/gw_movmtn.F90 +++ b/src/physics/cam/gw_movmtn.F90 @@ -138,12 +138,12 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & ! Index for ground based phase speed bin real(r8) :: c0(ncol,-band%ngwv:band%ngwv) integer :: c_idx(ncol,-band%ngwv:band%ngwv) - ! GW Flux source from ShCu/PBL + ! GW Flux source real(r8) :: xpwp_src(ncol) - ! Gw Flux source from vorticity - real(r8) :: vort_src(ncol) ! Manual steering level set - integer :: Steer_k, Steer_k_vort + integer :: Steer_k, Launch_k + ! Set source (1=vorticity, 2=PBL mom fluxes) + integer :: source_type !---------------------------------------------------------------------- ! Initialize tau array @@ -153,18 +153,22 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & q0 = 0.0_r8 tau0 = 0.0_r8 - !---------------------------------------------------------------------- - ! Calculate flux source from ShCu/PBL and set Steering level - !---------------------------------------------------------------------- - ! call shcu_flux_src( xpwp_shcu, ncol, pver+1, alpha_gw_movmtn, xpwp_src, Steer_k ) - - !---------------------------------------------------------------------- - ! Calculate flux source from vorticity - !---------------------------------------------------------------------- - call vorticity_flux_src( vorticity, ncol, pver , alpha_gw_movmtn, xpwp_src, Steer_k ) - + source_type=1 + if ( source_type==1 ) then + !---------------------------------------------------------------------- + ! Calculate flux source from vorticity + !---------------------------------------------------------------------- + call vorticity_flux_src( vorticity, ncol, pver , alpha_gw_movmtn, xpwp_src, Steer_k, Launch_k ) + end if + if ( source_type==2 ) then + !---------------------------------------------------------------------- + ! Calculate flux source from ShCu/PBL and set Steering level + !---------------------------------------------------------------------- + call shcu_flux_src( xpwp_shcu, ncol, pver+1, alpha_gw_movmtn, xpwp_src, Steer_k, Launch_k ) + end if + !------------------------------------------------------------------------ - ! Determine wind and unit vectors approximately at the source (steering level), then + ! Determine wind and unit vectors at the steering level) then ! project winds. !------------------------------------------------------------------------ @@ -216,7 +220,7 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & if (use_gw_movmtn_pbl) then boti=pver - topi=Steer_k-10 !++ tuning test 01/05/25 + topi=Launch_k ! set in source subr else do k = pver, 1, -1 !start at surface do i = 1, ncol @@ -426,18 +430,19 @@ pure function index_of_nearest(x, grid) result(idx) end function index_of_nearest !!!!!!!!!!!!!!!!!!!!!!!!!!! -subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, steering_level ) !! result(xpwp_src) +subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, steering_level, launch_level ) !! result(xpwp_src) !!! use gw_common, only: pver integer, intent(in) :: ncol,pverx real(r8), intent(in) :: xpwp_shcu (ncol,pverx) real(r8), intent(in) :: alpha_gw_movmtn real(r8), intent(out) :: xpwp_src(ncol) - integer, intent(out) :: steering_level + integer, intent(out) :: steering_level, launch_level integer :: k, nlayers steering_level = (pverx-1) - 5 !++ tuning test 12/30/24 + launch_level = steering_level -10 !++ tuning test 01/05/25 !----------------------------------- ! Simple average over layers. @@ -453,19 +458,21 @@ subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, st end subroutine shcu_flux_src !!!!!!!!!!!!!!!!!!!!!!!!!!! -subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_src, steering_level ) !! result(xpwp_src) +subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_src, steering_level, launch_level ) !! result(xpwp_src) !!! use gw_common, only: pver integer, intent(in) :: ncol,pverx real(r8), intent(in) :: vorticity (ncol,pverx) real(r8), intent(in) :: alpha_gw_movmtn real(r8), intent(out) :: vort_src(ncol) - integer, intent(out) :: steering_level + integer, intent(out) :: steering_level, launch_level real(r8) :: scale_factor integer :: k, nlayers - steering_level = pverx - 20 !++ ????? + steering_level = pverx - 20 !++ ????? + launch_level = steering_level -10 !++ tuning test 01/05/25 + scale_factor = 1.e4 ! scales vorticity amp to u'w' in CLUBB !----------------------------------- ! Simple average over layers. From f3ec18b254f22e0857e526c7531289e34bfd5e2e Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Wed, 22 Jan 2025 14:27:32 -0700 Subject: [PATCH 24/65] Update ChangeLog with Derecho test results. --- doc/ChangeLog | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 94e658a8da..ee510b8425 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -50,8 +50,29 @@ 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_D_Ln9.ne30pg3_ne30pg3_mg17.QPLT.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) +ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPMT.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) +SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) +- expected NLCOMP (solar_htng_spctrl_scl) and baseline answer changes due to restored RRTMGP spectral scaling. + + +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 + +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.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) + - pre-existing failure -- issue #1220 + izumi/nag/aux_cam: izumi/gnu/aux_cam: From 25bbadc8691d3b4d8ca27b710f8b696baa1aa314 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Wed, 22 Jan 2025 14:28:36 -0700 Subject: [PATCH 25/65] Fix spacing in ChangeLog. --- doc/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index ee510b8425..59f325cefd 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -57,12 +57,12 @@ ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overal 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) SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) -- expected NLCOMP (solar_htng_spctrl_scl) and baseline answer changes due to restored RRTMGP spectral scaling. + - expected NLCOMP (solar_htng_spctrl_scl) and baseline answer changes due to restored RRTMGP spectral scaling. 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 + - 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) From c08de27e0c47fd3b23175abb687ba770675aa3e8 Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 10:15:08 -0700 Subject: [PATCH 26/65] issue 1212 bug fix (cloud frac ice+liquid) --- src/physics/cam/nucleate_ice_cam.F90 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/physics/cam/nucleate_ice_cam.F90 b/src/physics/cam/nucleate_ice_cam.F90 index bd0a8b6636..07f4ccc91e 100644 --- a/src/physics/cam/nucleate_ice_cam.F90 +++ b/src/physics/cam/nucleate_ice_cam.F90 @@ -69,7 +69,7 @@ module nucleate_ice_cam naai_hom_idx = -1 integer :: & - ast_idx = -1 + aist_idx = -1 integer :: & qsatfac_idx = -1 @@ -360,7 +360,7 @@ subroutine nucleate_ice_cam_init(mincld_in, bulk_scale_in, pbuf2d, aero_props) mincld) ! get indices for fields in the physics buffer - ast_idx = pbuf_get_index('AST') + aist_idx = pbuf_get_index('AIST') end subroutine nucleate_ice_cam_init @@ -400,8 +400,7 @@ subroutine nucleate_ice_cam_calc( & real(r8), pointer :: pmid(:,:) ! pressure at layer midpoints (pa) real(r8), pointer :: aer_mmr(:,:) ! aerosol mass mixing ratio - - real(r8), pointer :: ast(:,:) + real(r8), pointer :: aist(:,:) real(r8) :: icecldf(pcols,pver) ! ice cloud fraction real(r8), pointer :: qsatfac(:,:) ! Subgrid cloud water saturation scaling factor. @@ -509,9 +508,9 @@ subroutine nucleate_ice_cam_calc( & end if itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - - icecldf(:ncol,:pver) = ast(:ncol,:pver) + call pbuf_get_field(pbuf, aist_idx, aist, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + !icecldf(:ncol,:pver) = ast(:ncol,:pver) + icecldf(:ncol,:pver) = aist(:ncol,:pver) ! naai and naai_hom are the outputs from this parameterization call pbuf_get_field(pbuf, naai_idx, naai) From bc4d5e73c42f531728e2553ab0d71b3e1842028c Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 10:31:53 -0700 Subject: [PATCH 27/65] fix Exner bug in CLUBB interface and change CLUBB namelist --- bld/namelist_files/namelist_defaults_cam.xml | 2 +- doc/ChangeLog | 13 +++++++++++++ src/physics/cam/clubb_intr.F90 | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 3dfdca36f2..0c13c3fc11 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2214,7 +2214,7 @@ .true. .false. .false. - .true. + .false. .true. .true. .true. diff --git a/doc/ChangeLog b/doc/ChangeLog index d9a7a43b73..a1e009e0ac 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,16 @@ +One-line Summary: Fix Exner bug in CLUBB interface and change CLUBB namelist + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + +The computation of the Exner function in the CLUBB interface code currently passes an incorrect version to the PBL utilities. The PBL utilities expect the "Stull" definition of the Exner function rather than the traditional "atmospheric" Exner function. +(Github issue 1222) + +The CLUBB group has recommended a namelist change to address this issue. +(Github issue 1208) + + +Expect baseline failures for all applications using CLUBB. + =============================================================== Tag name: cam6_4_056 diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index a9f25f0256..705afefba5 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -4700,8 +4700,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & ! --------------------------------------------------------------------------------- ! do i=1,ncol do k=1,pver - !use local exner since state%exner is not a proper exner - th(i,k) = state1%t(i,k)*inv_exner_clubb(i,k) + !subroutine pblind expects "Stull" definition of Exner + th(i,k) = state1%t(i,k)*state1%exner(i,k) !thv should have condensate loading to be consistent with earlier def's in this module thv(i,k) = th(i,k)*(1.0_r8+zvir*state1%q(i,k,ixq) - state1%q(i,k,ixcldliq)) enddo From c6b96bb9e1b51ec89796b56459a6b8d1655b1d91 Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 10:43:20 -0700 Subject: [PATCH 28/65] update changelog --- doc/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index d9a7a43b73..5a58558dfe 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +One-line Summary: cloud frac bug in nucleate_ice_cam.F90 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + +ice cloud fraction not set correctly (set to ice+liquid but should only be ice). (Github issue #1212) + =============================================================== Tag name: cam6_4_056 From 3d57be8d9655cb2a03b41609af324f9755a595e9 Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 10:57:37 -0700 Subject: [PATCH 29/65] fix heating depth bug --- src/physics/cam/gw_convect.F90 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/physics/cam/gw_convect.F90 b/src/physics/cam/gw_convect.F90 index 09ca64a016..56fdc7eebd 100644 --- a/src/physics/cam/gw_convect.F90 +++ b/src/physics/cam/gw_convect.F90 @@ -161,7 +161,7 @@ subroutine gw_beres_src(ncol, band, desc, u, v, & do k = pver, 1, -1 do i = 1, ncol if (boti(i) == 0) then - ! Detect if we are outside the maximum range (where z = 20 km). + ! Detect if we are outside the top of range (where z = 20 km). if (zm(i,k) >= 20000._r8) then boti(i) = k topi(i) = k @@ -169,17 +169,20 @@ subroutine gw_beres_src(ncol, band, desc, u, v, & ! First spot where heating rate is positive. if (netdt(i,k) > 0.0_r8) boti(i) = k end if - else if (topi(i) == 0) then - ! Detect if we are outside the maximum range (z = 20 km). - if (zm(i,k) >= 20000._r8) then - topi(i) = k - else - ! First spot where heating rate is no longer positive. - if (.not. (netdt(i,k) > 0.0_r8)) topi(i) = k - end if end if end do - ! When all done, exit. + ! When all done, exit + if (all(boti /= 0)) exit + end do + + do k = 1, pver + do i = 1, ncol + if (topi(i) == 0) then + ! First spot where heating rate is positive. + if ((netdt(i,k) > 0.0_r8) .AND. (zm(i,k) <= 20000._r8)) topi(i) = k + end if + end do + ! When all done, exit if (all(topi /= 0)) exit end do From 0411085cb4453728c34da15c8187fa6407e0200c Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 23 Jan 2025 10:59:08 -0700 Subject: [PATCH 30/65] Remove commented out line --- src/physics/cam/nucleate_ice_cam.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/physics/cam/nucleate_ice_cam.F90 b/src/physics/cam/nucleate_ice_cam.F90 index 07f4ccc91e..3edd3f616a 100644 --- a/src/physics/cam/nucleate_ice_cam.F90 +++ b/src/physics/cam/nucleate_ice_cam.F90 @@ -509,7 +509,6 @@ subroutine nucleate_ice_cam_calc( & itim_old = pbuf_old_tim_idx() call pbuf_get_field(pbuf, aist_idx, aist, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - !icecldf(:ncol,:pver) = ast(:ncol,:pver) icecldf(:ncol,:pver) = aist(:ncol,:pver) ! naai and naai_hom are the outputs from this parameterization From 0683024c9084ffc6cd4101ad5d6403854aa47cfd Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 11:16:26 -0700 Subject: [PATCH 31/65] update Changelog --- doc/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index d9a7a43b73..59890737cf 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,12 @@ +One-line Summary: fix heating depth bug for gravity wave parameterization + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + +Gravity wave scheme fails to catch the right maximum latent heating rate and convective top from the ZM scheme. +This PR fixes that isuue. +(Github issue #1229) + +Expect baseline differences for CAM7 and WACCM tests =============================================================== Tag name: cam6_4_056 From f6dd61e6eea924083d677a1895158816209f740c Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 11:34:11 -0700 Subject: [PATCH 32/65] conserve dry mixing ratios in gw and vertical diffusion code --- src/physics/cam/gw_drag.F90 | 5 +---- src/physics/cam/vertical_diffusion.F90 | 6 ------ 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 798ad63059..6b81ab239d 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -1451,7 +1451,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) ! Interface for multiple gravity wave drag parameterization. !----------------------------------------------------------------------- - use physics_types, only: physics_state_copy, set_dry_to_wet + use physics_types, only: physics_state_copy use constituents, only: cnst_type use physics_buffer, only: physics_buffer_desc, pbuf_get_field use camsrfexch, only: cam_in_t @@ -1628,9 +1628,6 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) ! Make local copy of input state. call physics_state_copy(state, state1) - ! constituents are all treated as wet mmr - call set_dry_to_wet(state1, convert_cnst_type='dry') - lchnk = state1%lchnk ncol = state1%ncol diff --git a/src/physics/cam/vertical_diffusion.F90 b/src/physics/cam/vertical_diffusion.F90 index e2d571a4de..c5518f94fc 100644 --- a/src/physics/cam/vertical_diffusion.F90 +++ b/src/physics/cam/vertical_diffusion.F90 @@ -709,7 +709,6 @@ subroutine vertical_diffusion_tend( & !---------------------------------------------------- ! use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_set_field use physics_types, only : physics_state, physics_ptend, physics_ptend_init - use physics_types, only : set_dry_to_wet, set_wet_to_dry use camsrfexch, only : cam_in_t use cam_history, only : outfld @@ -904,9 +903,6 @@ subroutine vertical_diffusion_tend( & ! Main Computation Begins ! ! ----------------------- ! - ! Assume 'wet' mixing ratios in diffusion code. - call set_dry_to_wet(state, convert_cnst_type='dry') - rztodt = 1._r8 / ztodt lchnk = state%lchnk ncol = state%ncol @@ -1375,8 +1371,6 @@ subroutine vertical_diffusion_tend( & ptend%q(:ncol,:pver,m) = ptend%q(:ncol,:pver,m)*state%pdel(:ncol,:pver)/state%pdeldry(:ncol,:pver) endif end do - ! convert wet mmr back to dry before conservation check - call set_wet_to_dry(state, convert_cnst_type='dry') if (.not. do_pbl_diags) then slten(:ncol,:) = ( sl(:ncol,:) - sl_prePBL(:ncol,:) ) * rztodt From c624dc1dd90316c0ce2e5399e38573d0fae53ec1 Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 11:36:08 -0700 Subject: [PATCH 33/65] update Changelog --- doc/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index d9a7a43b73..1cab89d68b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +One-line Summary: Preserve constant dry mixing ratios in gw and vertical diffusion code + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + + Keith Lindsay's modifications for preservation for dry constant mixing ratios. (Github issue #1233) =============================================================== Tag name: cam6_4_056 From a03a186a06b1c28872318b2aed9bdf9983488b79 Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 11:38:10 -0700 Subject: [PATCH 34/65] fix English --- doc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 1cab89d68b..f7b3b88edc 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,7 @@ One-line Summary: Preserve constant dry mixing ratios in gw and vertical diffusi Purpose of changes (include the issue number and title text for each relevant GitHub issue): - Keith Lindsay's modifications for preservation for dry constant mixing ratios. (Github issue #1233) + Keith Lindsay's modifications for preservation of dry constant mixing ratios. (Github issue #1233) =============================================================== Tag name: cam6_4_056 From 6c905d028dcc0b6ed1247b575a76606391dfe73c Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 23 Jan 2025 11:39:20 -0700 Subject: [PATCH 35/65] update changlog --- doc/ChangeLog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f7b3b88edc..0d85fca8a5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,9 @@ One-line Summary: Preserve constant dry mixing ratios in gw and vertical diffusi Purpose of changes (include the issue number and title text for each relevant GitHub issue): - Keith Lindsay's modifications for preservation of dry constant mixing ratios. (Github issue #1233) +Keith Lindsay's modifications for preservation of dry constant mixing ratios. (Github issue #1233) + +Expect baseline failures in all regression tests using CAM physics =============================================================== Tag name: cam6_4_056 From 2e7db439b25515655eaa31eac217c3c60ac6b051 Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Thu, 23 Jan 2025 16:56:30 -0700 Subject: [PATCH 36/65] added movtn_source to nml --- bld/build-namelist | 1 + bld/namelist_files/namelist_defaults_cam.xml | 1 + bld/namelist_files/namelist_definition.xml | 6 ++++++ src/physics/cam/gw_drag.F90 | 9 ++++++--- src/physics/cam/gw_movmtn.F90 | 6 ++++-- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 4aafedd25f..ba9117b01c 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3889,6 +3889,7 @@ if ($do_gw_movmtn_pbl) { add_default($nl, 'gw_drag_file_mm'); add_default($nl, 'alpha_gw_movmtn'); add_default($nl, 'effgw_movmtn_pbl'); + add_default($nl, 'movmtn_source'); } if ($do_gw_rdg_beta) { diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 1f035adabf..6c9c816b23 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -898,6 +898,7 @@ 0.1d0 0.01d0 1.0d0 + 1 diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index a0f5ee38b3..75e8a8e83b 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1444,6 +1444,12 @@ Efficiency scaling factor associated with residual non-ridge topo Default: set by build-namelist. + +Integer code for movmtn source: 1=vorticity, 2=upwp +Default: set by build-namelist. + + Drag coefficient for obstacles in low-level flow. diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index da6226ec83..9cd2edaaf1 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -111,6 +111,7 @@ module gw_drag real(r8) :: effgw_beres_sh = unset_r8 ! PBL moving mtn real(r8) :: effgw_movmtn_pbl = unset_r8 + integer :: movmtn_source = -1 ! Parameters controlling isotropic residual ! orographic GW. @@ -258,7 +259,7 @@ subroutine gw_drag_readnl(nlfile) gw_oro_south_fac, gw_limit_tau_without_eff, & gw_lndscl_sgh, gw_prndl, gw_apply_tndmax, gw_qbo_hdepth_scaling, & gw_top_taper, front_gaussian_width, alpha_gw_movmtn, use_gw_rdg_resid, & - effgw_rdg_resid, effgw_movmtn_pbl + effgw_rdg_resid, effgw_movmtn_pbl, movmtn_source !---------------------------------------------------------------------- @@ -366,7 +367,9 @@ subroutine gw_drag_readnl(nlfile) call mpi_bcast(alpha_gw_movmtn, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: alpha_gw_movmtn") call mpi_bcast(effgw_movmtn_pbl, 1, mpi_real8, mstrid, mpicom, ierr) - if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: alpha_gw_movmtn") + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: effgw_movmtn_pbl") + call mpi_bcast(movmtn_source, 1, mpi_integer, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: movmtn_source") call mpi_bcast(use_gw_rdg_resid, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: use_gw_rdg_resid") @@ -1818,7 +1821,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) effgw = effgw_movmtn_pbl !1._r8 call gw_movmtn_src(ncol, lchnk, band_movmtn , movmtn_desc, & u, v, ttend_dp(:ncol,:), ttend_clubb(:ncol,:), xpwp_clubb(:ncol,:), vort4gw(:ncol,:), & - zm, alpha_gw_movmtn, src_level, tend_level, & + zm, alpha_gw_movmtn, movmtn_source, src_level, tend_level, & tau, ubm, ubi, xv, yv, & phase_speeds, hdepth) !------------------------------------------------------------- diff --git a/src/physics/cam/gw_movmtn.F90 b/src/physics/cam/gw_movmtn.F90 index d916d58f1a..44687e2f46 100644 --- a/src/physics/cam/gw_movmtn.F90 +++ b/src/physics/cam/gw_movmtn.F90 @@ -36,7 +36,7 @@ module gw_movmtn subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & netdt, netdt_shcu, xpwp_shcu, vorticity, & - zm, alpha_gw_movmtn, src_level, tend_level, tau, ubm, ubi, xv, yv, & + zm, alpha_gw_movmtn, movmtn_source, src_level, tend_level, tau, ubm, ubi, xv, yv, & c, hdepth) !----------------------------------------------------------------------- ! Flexible driver for gravity wave source from obstacle effects produced @@ -71,6 +71,8 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & real(r8), intent(in) :: zm(ncol,pver) ! tunable parameter controlling proportion of PBL momentum flux emitted as GW real(r8), intent(in) :: alpha_gw_movmtn + ! code for source of gw: 1=vorticity, 2=upwp + integer, intent(in) :: movmtn_source ! Indices of top gravity wave source level and lowest level where wind ! tendencies are allowed. @@ -153,7 +155,7 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & q0 = 0.0_r8 tau0 = 0.0_r8 - source_type=1 + source_type=movmtn_source if ( source_type==1 ) then !---------------------------------------------------------------------- ! Calculate flux source from vorticity From 18255876caa4091df3c79e94360600489599908d Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Tue, 28 Jan 2025 15:41:28 -0700 Subject: [PATCH 37/65] adding more namelist params for movmtn --- bld/build-namelist | 2 + bld/namelist_files/namelist_defaults_cam.xml | 2 + bld/namelist_files/namelist_definition.xml | 12 ++++++ src/physics/cam/gw_drag.F90 | 38 +++++++++++++++++-- src/physics/cam/gw_movmtn.F90 | 39 +++++++++++++------- 5 files changed, 77 insertions(+), 16 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index ba9117b01c..98f7e1a3d8 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3890,6 +3890,8 @@ if ($do_gw_movmtn_pbl) { add_default($nl, 'alpha_gw_movmtn'); add_default($nl, 'effgw_movmtn_pbl'); add_default($nl, 'movmtn_source'); + add_default($nl, 'movmtn_psteer'); + add_default($nl, 'movmtn_plaunch'); } if ($do_gw_rdg_beta) { diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 6c9c816b23..e60686465b 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -898,6 +898,8 @@ 0.1d0 0.01d0 1.0d0 + 65000.0d0 + 32500.0d0 1 diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 75e8a8e83b..6fc69fdeff 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1444,6 +1444,18 @@ Efficiency scaling factor associated with residual non-ridge topo Default: set by build-namelist. + +Global steering level (Pa) for moving mtns. If neg do something else +Default: set by build-namelist. + + + +Global launch level (Pa) for moving mtns. If neg do something else +Default: set by build-namelist. + + Integer code for movmtn source: 1=vorticity, 2=upwp diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 9cd2edaaf1..7ede7395aa 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -111,7 +111,11 @@ module gw_drag real(r8) :: effgw_beres_sh = unset_r8 ! PBL moving mtn real(r8) :: effgw_movmtn_pbl = unset_r8 - integer :: movmtn_source = -1 + integer :: movmtn_source = -1 + integer :: movmtn_ksteer = -1 + integer :: movmtn_klaunch = -1 + real(r8) :: movmtn_psteer = unset_r8 ! 65000.0_r8 + real(r8) :: movmtn_plaunch = unset_r8 ! 32500.0_r8 ! Parameters controlling isotropic residual ! orographic GW. @@ -259,7 +263,8 @@ subroutine gw_drag_readnl(nlfile) gw_oro_south_fac, gw_limit_tau_without_eff, & gw_lndscl_sgh, gw_prndl, gw_apply_tndmax, gw_qbo_hdepth_scaling, & gw_top_taper, front_gaussian_width, alpha_gw_movmtn, use_gw_rdg_resid, & - effgw_rdg_resid, effgw_movmtn_pbl, movmtn_source + effgw_rdg_resid, effgw_movmtn_pbl, movmtn_source, movmtn_psteer, & + movmtn_plaunch !---------------------------------------------------------------------- @@ -370,6 +375,10 @@ subroutine gw_drag_readnl(nlfile) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: effgw_movmtn_pbl") call mpi_bcast(movmtn_source, 1, mpi_integer, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: movmtn_source") + call mpi_bcast(movmtn_psteer, 1, mpi_real8, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: movmtn_psteer") + call mpi_bcast(movmtn_plaunch, 1, mpi_real8, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: movmtn_plaunch") call mpi_bcast(use_gw_rdg_resid, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: use_gw_rdg_resid") @@ -954,6 +963,29 @@ subroutine gw_init() end if + if (use_gw_movmtn_pbl) then + do k = 1, pver + ! Find steering level + if ( (pref_edge(k+1) >= movmtn_psteer).and.(pref_edge(k) < movmtn_psteer) ) then + movmtn_ksteer = k + end if + end do + do k = 1, pver + ! Find launch level + if ( (pref_edge(k+1) >= movmtn_plaunch).and.(pref_edge(k) < movmtn_plaunch ) ) then + movmtn_klaunch = k + end if + end do + + if (masterproc) then + write (iulog,*) 'MOVMTN K_STEER =', movmtn_ksteer + write (iulog,*) 'MOVMTN K_LAUNCH =', movmtn_klaunch + write (iulog,*) 'K_STEER hardw =', pver - 20 !++ ????? + write (iulog,*) 'K_LAUNCH hardw =', pver - 20 - 10 !++ ????? + write(iulog,*) ' ' + end if + + end if if (use_gw_movmtn_pbl) then vort4gw_idx = pbuf_get_index('VORT4GW') @@ -1821,7 +1853,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) effgw = effgw_movmtn_pbl !1._r8 call gw_movmtn_src(ncol, lchnk, band_movmtn , movmtn_desc, & u, v, ttend_dp(:ncol,:), ttend_clubb(:ncol,:), xpwp_clubb(:ncol,:), vort4gw(:ncol,:), & - zm, alpha_gw_movmtn, movmtn_source, src_level, tend_level, & + zm, alpha_gw_movmtn, movmtn_source, movmtn_ksteer, movmtn_klaunch, src_level, tend_level, & tau, ubm, ubi, xv, yv, & phase_speeds, hdepth) !------------------------------------------------------------- diff --git a/src/physics/cam/gw_movmtn.F90 b/src/physics/cam/gw_movmtn.F90 index 44687e2f46..15232e3f20 100644 --- a/src/physics/cam/gw_movmtn.F90 +++ b/src/physics/cam/gw_movmtn.F90 @@ -36,7 +36,8 @@ module gw_movmtn subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & netdt, netdt_shcu, xpwp_shcu, vorticity, & - zm, alpha_gw_movmtn, movmtn_source, src_level, tend_level, tau, ubm, ubi, xv, yv, & + zm, alpha_gw_movmtn, movmtn_source, ksteer_in, klaunch_in, & + src_level, tend_level, tau, ubm, ubi, xv, yv, & c, hdepth) !----------------------------------------------------------------------- ! Flexible driver for gravity wave source from obstacle effects produced @@ -73,6 +74,8 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & real(r8), intent(in) :: alpha_gw_movmtn ! code for source of gw: 1=vorticity, 2=upwp integer, intent(in) :: movmtn_source + ! Steering level and launch level inputs + integer, intent(in) :: ksteer_in, klaunch_in ! Indices of top gravity wave source level and lowest level where wind ! tendencies are allowed. @@ -143,7 +146,7 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & ! GW Flux source real(r8) :: xpwp_src(ncol) ! Manual steering level set - integer :: Steer_k, Launch_k + integer :: Steer_k(ncol), Launch_k(ncol) ! Set source (1=vorticity, 2=PBL mom fluxes) integer :: source_type @@ -168,16 +171,26 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & !---------------------------------------------------------------------- call shcu_flux_src( xpwp_shcu, ncol, pver+1, alpha_gw_movmtn, xpwp_src, Steer_k, Launch_k ) end if + + !------------------------------------------------- + ! Override steering and launch levels if inputs>0 + !------------------------------------------------- + if (klaunch_in > 0) then + Launch_k(:ncol) = klaunch_in + end if + if (ksteer_in > 0) then + Steer_k(:ncol) = ksteer_in + end if !------------------------------------------------------------------------ ! Determine wind and unit vectors at the steering level) then ! project winds. !------------------------------------------------------------------------ - - usteer = u(:,Steer_k) ! - vsteer = v(:,Steer_k) - steer_level = real(Steer_k,r8) - + do i=1,ncol + usteer(i) = u(i, Steer_k(i) ) ! + vsteer(i) = v(i, Steer_k(i) ) + steer_level(i) = real(Steer_k(i),r8) + end do ! all GW calculations on a plane, which in our case is the wind at source level -> ubi is wind in this plane ! Get the unit vector components and magnitude at the source level. call get_unit_vector(usteer, vsteer, xv_steer, yv_steer, umag_steer) @@ -439,12 +452,12 @@ subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, st real(r8), intent(in) :: alpha_gw_movmtn real(r8), intent(out) :: xpwp_src(ncol) - integer, intent(out) :: steering_level, launch_level + integer, intent(out) :: steering_level(ncol), launch_level(ncol) integer :: k, nlayers - steering_level = (pverx-1) - 5 !++ tuning test 12/30/24 - launch_level = steering_level -10 !++ tuning test 01/05/25 + steering_level(:ncol) = (pverx-1) - 5 !++ tuning test 12/30/24 + launch_level(:ncol) = steering_level -10 !++ tuning test 01/05/25 !----------------------------------- ! Simple average over layers. @@ -467,13 +480,13 @@ subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_sr real(r8), intent(in) :: alpha_gw_movmtn real(r8), intent(out) :: vort_src(ncol) - integer, intent(out) :: steering_level, launch_level + integer, intent(out) :: steering_level(ncol), launch_level(ncol) real(r8) :: scale_factor integer :: k, nlayers - steering_level = pverx - 20 !++ ????? - launch_level = steering_level -10 !++ tuning test 01/05/25 + steering_level(:ncol) = pverx - 20 !++ ????? + launch_level(:ncol) = steering_level -10 !++ tuning test 01/05/25 scale_factor = 1.e4 ! scales vorticity amp to u'w' in CLUBB !----------------------------------- From ea056d28415bbfdde11ac0d58f8f0a773d8622c4 Mon Sep 17 00:00:00 2001 From: Julio Bacmeister Date: Tue, 28 Jan 2025 22:17:40 -0700 Subject: [PATCH 38/65] first stage of clean up for PR --- bld/build-namelist | 2 +- bld/namelist_files/namelist_defaults_cam.xml | 2 ++ bld/namelist_files/namelist_definition.xml | 5 +++-- src/dynamics/se/gravity_waves_sources.F90 | 16 ++-------------- src/physics/cam/gw_drag.F90 | 14 ++------------ src/physics/cam/gw_movmtn.F90 | 9 +++------ 6 files changed, 13 insertions(+), 35 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 98f7e1a3d8..48a3542887 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3912,7 +3912,7 @@ if ($do_gw_rdg_beta) { } if ($do_gw_rdg_resid) { - add_default($nl, 'effgw_rdg_resid', 'val'=>'1.0D0'); + add_default($nl, 'effgw_rdg_resid' ); } if ($do_gw_rdg_gamma) { diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index e60686465b..56391c7850 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -827,6 +827,8 @@ 0.0625D0 +1.0D0 + 1.0D0 0.5D0 0.5D0 diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 6fc69fdeff..cc9b4eef03 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1325,8 +1325,9 @@ Default: .false. -JULIO - need to add comment -Default: .false. +Whether or not to enable gravity waves from residual(non-ridge) +orography +Default: set by build-namelist. shr_kind_r8 - - !++ jtb (added for now, while debugging) use cam_logfile, only: iulog implicit none @@ -105,8 +103,6 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) end subroutine gws_src_fnct - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !+++ jtb (01/20/24) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) use derivative_mod, only : derivinit @@ -133,8 +129,7 @@ subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) ! This does not need to be a thread private data-structure call derivinit(deriv) - !!$OMP PARALLEL NUM_THREADS(horz_num_threads), DEFAULT(SHARED), PRIVATE(nets,nete,hybrid,ie,ncols,frontgf_thr,frontga_thr) -! hybrid = config_thread_region(par,'horizontal') + !!$OMP PARALLEL NUM_THREADS(horz_num_threads), DEFAULT(SHARED), PRIVATE(nets,nete,hybrid,ie,ncols,vort4gw_thr) hybrid = config_thread_region(par,'serial') call get_loop_ranges(hybrid,ibeg=nets,iend=nete) @@ -158,11 +153,6 @@ subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) end subroutine gws_src_vort - - - - - !++jtb (12/31/24) subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nphys) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! compute vorticity for use in gw params @@ -205,7 +195,7 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph do k=1,nlev vort_gll(:,:,k,ie) = vort_gll(:,:,k,ie)*elem(ie)%spheremp(:,:) end do - ! pack ++jtb no idea what these routines are doing + ! pack call edgeVpack(edge1, vort_gll(:,:,:,ie),nlev,0,ie) enddo call bndry_exchange(hybrid,edge1,location='compute_vorticity_4gw') @@ -315,8 +305,6 @@ subroutine compute_frontogenesis(frontgf,frontga,tl,tlq,elem,ederiv,hybrid,nets, enddo ! pack call edgeVpack(edge3, frontgf_gll(:,:,:,ie),nlev,0,ie) - !++jtb: - ! Why are dims 2*nlev,nlev, not 2*nlev,2*nlev, or nlev,nlev, ???? call edgeVpack(edge3, gradth(:,:,:,:,ie),2*nlev,nlev,ie) enddo call bndry_exchange(hybrid,edge3,location='compute_frontogenesis') diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 7ede7395aa..db0f72fd8f 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -167,7 +167,7 @@ module gw_drag integer :: ttend_sh_idx = -1 integer :: frontgf_idx = -1 integer :: frontga_idx = -1 - !++jtb + ! integer :: vort4gw_idx = -1 integer :: sgh_idx = -1 @@ -385,12 +385,6 @@ subroutine gw_drag_readnl(nlfile) call mpi_bcast(effgw_rdg_resid, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: effgw_rdg_resid") - !++ jtb (12/24/2024) - ! This is confusing. Not sure when if ever this was needed. - ! Check if fcrit2 was set. - !call shr_assert(fcrit2 /= unset_r8, & - ! "gw_drag_readnl: fcrit2 must be set via the namelist."// & - ! errMsg(__FILE__, __LINE__)) ! Check if pgwv was set. call shr_assert(pgwv >= 0, & @@ -1647,7 +1641,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) ! Frontogenesis real(r8), pointer :: frontgf(:,:) real(r8), pointer :: frontga(:,:) - !++jtb 12/31/24 + ! Vorticity source real(r8), pointer :: vort4gw(:,:) ! Temperature change due to deep convection. @@ -1838,7 +1832,6 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) call pbuf_get_field(pbuf, upwp_clubb_gw_idx, upwp_clubb_gw) call pbuf_get_field(pbuf, vpwp_clubb_gw_idx, vpwp_clubb_gw) - !++jtb 01/03/25 ! Vorticity from SE dycore. This needs to be either ! generalized to other dycores or protected with some ! endrun if dycore != SE @@ -1911,8 +1904,6 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) call outfld('WPTHLP_CLUBB_GW', wpthlp_clubb_gw, pcols, lchnk) call outfld('UPWP_CLUBB_GW', upwp_clubb_gw, pcols, lchnk) call outfld('VPWP_CLUBB_GW', vpwp_clubb_gw, pcols, lchnk) - - !++jtb 01/03/25 (see comment above) call outfld ('VORT4GW', vort4gw, pcols, lchnk) !Deallocate variables that are no longer used: @@ -2756,7 +2747,6 @@ subroutine gw_rdg_calc( & if (luse_gw_rdg_resid == .true.) then ! Add additional GW from residual variance. Assumed isotropic - !kwvrdg = 0.001_r8 / ( hwdth(:,nn) + 0.001_r8 ) ! this cant be done every time step !!! kwvrdg = 0.001_r8 / ( 100._r8 ) effgw = effgw_rdg_resid * isowgt !1.0_r8 * isowgt tauoro = 0._r8 diff --git a/src/physics/cam/gw_movmtn.F90 b/src/physics/cam/gw_movmtn.F90 index 15232e3f20..aa04879664 100644 --- a/src/physics/cam/gw_movmtn.F90 +++ b/src/physics/cam/gw_movmtn.F90 @@ -164,8 +164,7 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & ! Calculate flux source from vorticity !---------------------------------------------------------------------- call vorticity_flux_src( vorticity, ncol, pver , alpha_gw_movmtn, xpwp_src, Steer_k, Launch_k ) - end if - if ( source_type==2 ) then + else if ( source_type==2 ) then !---------------------------------------------------------------------- ! Calculate flux source from ShCu/PBL and set Steering level !---------------------------------------------------------------------- @@ -446,7 +445,6 @@ end function index_of_nearest !!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, steering_level, launch_level ) !! result(xpwp_src) - !!! use gw_common, only: pver integer, intent(in) :: ncol,pverx real(r8), intent(in) :: xpwp_shcu (ncol,pverx) real(r8), intent(in) :: alpha_gw_movmtn @@ -474,7 +472,6 @@ end subroutine shcu_flux_src !!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_src, steering_level, launch_level ) !! result(xpwp_src) - !!! use gw_common, only: pver integer, intent(in) :: ncol,pverx real(r8), intent(in) :: vorticity (ncol,pverx) real(r8), intent(in) :: alpha_gw_movmtn @@ -485,8 +482,8 @@ subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_sr real(r8) :: scale_factor integer :: k, nlayers - steering_level(:ncol) = pverx - 20 !++ ????? - launch_level(:ncol) = steering_level -10 !++ tuning test 01/05/25 + steering_level(:ncol) = pverx - 20 + launch_level(:ncol) = steering_level -10 scale_factor = 1.e4 ! scales vorticity amp to u'w' in CLUBB !----------------------------------- From 552bd2326dd80701c9b0a6493a7fa21e6c9af76e Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Wed, 29 Jan 2025 13:38:53 -0700 Subject: [PATCH 39/65] Finalize ChangeLog. --- doc/ChangeLog | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 59f325cefd..606ff6bfbe 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,10 +1,10 @@ =============================================================== -Tag name: -Originator(s): brianpm, eaton -Date: +Tag name: cam6_4_057 +Originator(s): brianpm, eaton, nusbaume +Date: Jan 29 2025 One-line Summary: Restore spectral scaling to RRTMGP -Github PR URL: +Github PR URL: https://github.com/ESCOMP/CAM/pull/1194 Purpose of changes (include the issue number and title text for each relevant GitHub issue): @@ -18,7 +18,7 @@ List any changes to the defaults for the boundary datasets: none Describe any substantial timing or memory changes: not evaluated -Code reviewed by: +Code reviewed by: peverwhee List all files eliminated: none @@ -73,10 +73,16 @@ derecho/nvhpc/aux_cam: ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) - pre-existing failure -- issue #1220 -izumi/nag/aux_cam: +izumi/nag/aux_cam: ALL PASS izumi/gnu/aux_cam: +ERP_D_Ln9.ne3pg3_ne3pg3_mg37.FLTHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) +ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPLT.izumi_gnu.cam-outfrq9s (Overall: DIFF) +ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPMT.izumi_gnu.cam-outfrq9s (Overall: DIFF) +SMS_Ld5.f09_f09_mg17.PC6.izumi_gnu.cam-cam6_port_f09_rrtmgp (Overall: DIFF) + - expected NLCOMP (solar_htng_spctrl_scl) and baseline answer changes due to restored RRTMGP spectral scaling. + CAM tag used for the baseline comparison tests if different than previous tag: From a0e078cb3eff767024ae7ecfc124debeff9358cf Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 27 Jan 2025 15:44:07 -0500 Subject: [PATCH 40/65] Switch to correct tape for tphysac/tphysbc snapshot Signed-off-by: Haipeng Lin --- src/physics/cam/cam_snapshot.F90 | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/physics/cam/cam_snapshot.F90 b/src/physics/cam/cam_snapshot.F90 index 7e7d83e9ef..da79aeb517 100644 --- a/src/physics/cam/cam_snapshot.F90 +++ b/src/physics/cam/cam_snapshot.F90 @@ -115,18 +115,53 @@ subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_ou lchnk = state%lchnk + call cam_history_snapshot_activate('tphysbc_flx_heat', file_num) call outfld('tphysbc_flx_heat', flx_heat, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_flx_heat') + + call cam_history_snapshot_activate('tphysbc_cmfmc', file_num) call outfld('tphysbc_cmfmc', cmfmc, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_cmfmc') + + call cam_history_snapshot_activate('tphysbc_cmfcme', file_num) call outfld('tphysbc_cmfcme', cmfcme, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_cmfcme') + + call cam_history_snapshot_activate('tphysbc_zdu', file_num) call outfld('tphysbc_zdu', zdu, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_zdu') + + call cam_history_snapshot_activate('tphysbc_rliq', file_num) call outfld('tphysbc_rliq', rliq, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_rliq') + + call cam_history_snapshot_activate('tphysbc_rice', file_num) call outfld('tphysbc_rice', rice, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_rice') + + call cam_history_snapshot_activate('tphysbc_dlf', file_num) call outfld('tphysbc_dlf', dlf, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_dlf') + + call cam_history_snapshot_activate('tphysbc_dlf2', file_num) call outfld('tphysbc_dlf2', dlf2, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_dlf2') + + call cam_history_snapshot_activate('tphysbc_rliq2', file_num) call outfld('tphysbc_rliq2', rliq2, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_rliq2') + + call cam_history_snapshot_activate('tphysbc_det_s', file_num) call outfld('tphysbc_det_s', det_s, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_det_s') + + call cam_history_snapshot_activate('tphysbc_det_ice', file_num) call outfld('tphysbc_det_ice', det_ice, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_det_ice') + + call cam_history_snapshot_activate('tphysbc_net_flx', file_num) call outfld('tphysbc_net_flx', net_flx, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysbc_net_flx') call cam_snapshot_all_outfld(file_num, state, tend, cam_in, cam_out, pbuf) @@ -163,10 +198,22 @@ subroutine cam_snapshot_all_outfld_tphysac(file_num, state, tend, cam_in, cam_ou lchnk = state%lchnk + call cam_history_snapshot_activate('tphysac_fh2o', file_num) call outfld('tphysac_fh2o', fh2o, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysac_fh2o') + + call cam_history_snapshot_activate('tphysac_surfric', file_num) call outfld('tphysac_surfric', surfric, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysac_surfric') + + call cam_history_snapshot_activate('tphysac_obklen', file_num) call outfld('tphysac_obklen', obklen, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysac_obklen') + + call cam_history_snapshot_activate('tphysac_flx_heat', file_num) call outfld('tphysac_flx_heat', flx_heat, pcols, lchnk) + call cam_history_snapshot_deactivate('tphysac_flx_heat') + call cam_snapshot_all_outfld(file_num, state, tend, cam_in, cam_out, pbuf) From 5f7ac9cc01a2af7daed5c482844f939ecb853618 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 29 Jan 2025 16:26:00 -0700 Subject: [PATCH 41/65] Remove comments and move check for use_gw_movmtn_pbl using the SE dycore to build-namelist --- bld/build-namelist | 8 +++++++ src/dynamics/se/dp_coupling.F90 | 14 ++---------- src/dynamics/se/dyn_comp.F90 | 2 -- src/dynamics/se/gravity_waves_sources.F90 | 26 +++++++++++------------ src/physics/cam/gw_drag.F90 | 18 +++++----------- 5 files changed, 27 insertions(+), 41 deletions(-) diff --git a/bld/build-namelist b/bld/build-namelist index 48a3542887..cfeca8b66d 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3772,6 +3772,14 @@ if (!$simple_phys) { add_default($nl, 'use_gw_movmtn_pbl', 'val'=>'.true.'); } + my $use_gw_movmtn_pbl = $nl->get_value('use_gw_movmtn_pbl'); + if ($use_gw_movmtn_pbl =~ /$TRUE/io) { + if ( ! ($dyn =~ /se/) ) { + die "$ProgName - ERROR: use_gw_movmtn_pbl is only available with the SE dycore \n"; + + } + } + add_default($nl, 'use_gw_rdg_gamma' , 'val'=>'.false.'); add_default($nl, 'use_gw_front_igw' , 'val'=>'.false.'); add_default($nl, 'use_gw_convect_sh', 'val'=>'.false.'); diff --git a/src/dynamics/se/dp_coupling.F90 b/src/dynamics/se/dp_coupling.F90 index 536828f843..41e24f18f0 100644 --- a/src/dynamics/se/dp_coupling.F90 +++ b/src/dynamics/se/dp_coupling.F90 @@ -85,16 +85,14 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) real (kind=r8), allocatable :: frontgf_phys(:,:,:) real (kind=r8), allocatable :: frontga_phys(:,:,:) - !++jtb 01/14/25 ! Vorticity real (kind=r8), allocatable :: vort4gw(:,:,:) ! temp arrays to hold vorticity real (kind=r8), allocatable :: vort4gw_phys(:,:,:) - + ! Pointers to pbuf real (kind=r8), pointer :: pbuf_frontgf(:,:) real (kind=r8), pointer :: pbuf_frontga(:,:) - !++jtb 12/31/24 real (kind=r8), pointer :: pbuf_vort4gw(:,:) integer :: ncols, ierr @@ -119,10 +117,9 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) nullify(pbuf_chnk) nullify(pbuf_frontgf) nullify(pbuf_frontga) - !++jtb nullify(pbuf_vort4gw) - + if (fv_nphys > 0) then nphys = fv_nphys @@ -150,12 +147,10 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) if (ierr /= 0) call endrun("dp_coupling: Allocate of frontga failed.") end if if (use_gw_movmtn_pbl) then - !++jtb 01/14/25 allocate(vort4gw(nphys_pts,pver,nelemd), stat=ierr) if (ierr /= 0) call endrun("dp_coupling: Allocate of vort4gw failed.") end if - !++jtb 01/20/25 if (iam < par%nprocs) then if (use_gw_front .or. use_gw_front_igw ) then call gws_src_fnct(elem, tl_f, tl_qdp_np0, frontgf, frontga, nphys) @@ -228,7 +223,6 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) frontga(:,:,:) = 0._r8 end if if (use_gw_movmtn_pbl) then - !++jtb 01/14/25 vort4gw(:,:,:) = 0._r8 end if @@ -250,7 +244,6 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) allocate(frontga_phys(pcols, pver, begchunk:endchunk)) end if if (use_gw_movmtn_pbl) then - !++jtb 01/14/25 allocate(vort4gw_phys(pcols, pver, begchunk:endchunk)) end if !$omp parallel do num_threads(max_num_threads) private (col_ind, lchnk, icol, ie, blk_ind, ilyr, m) @@ -271,7 +264,6 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) frontga_phys(icol, ilyr, lchnk) = frontga(blk_ind(1), ilyr, ie) end if if (use_gw_movmtn_pbl) then - !++jtb 01/14/25 vort4gw_phys(icol, ilyr, lchnk) = vort4gw(blk_ind(1), ilyr, ie) end if end do @@ -299,7 +291,6 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) deallocate(frontgf_phys) deallocate(frontga_phys) end if - !++jtb 01/20/25 if (use_gw_movmtn_pbl) then !$omp parallel do num_threads(max_num_threads) private (lchnk, ncols, icol, ilyr, pbuf_chnk, pbuf_vort4gw) do lchnk = begchunk, endchunk @@ -312,7 +303,6 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out) end do end do end do - !++jtb 01/14/25 deallocate(vort4gw_phys) end if diff --git a/src/dynamics/se/dyn_comp.F90 b/src/dynamics/se/dyn_comp.F90 index d5e22f8ce9..37aab5931a 100644 --- a/src/dynamics/se/dyn_comp.F90 +++ b/src/dynamics/se/dyn_comp.F90 @@ -79,7 +79,6 @@ module dyn_comp ! Frontogenesis indices integer, public :: frontgf_idx = -1 integer, public :: frontga_idx = -1 -!++jtb integer, public :: vort4gw_idx = -1 interface read_dyn_var @@ -881,7 +880,6 @@ subroutine dyn_init(dyn_in, dyn_out) call get_loop_ranges(hybrid, ibeg=nets, iend=nete) call prim_init2(elem, fvm, hybrid, nets, nete, TimeLevel, hvcoord) !$OMP END PARALLEL - !++jtb 01/14/25 if (use_gw_front .or. use_gw_front_igw .or. use_gw_movmtn_pbl) call gws_init(elem) end if ! iam < par%nprocs diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index 2d9cd366d9..e978beb38d 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -70,7 +70,7 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) integer :: nets, nete, ithr, ncols, ie real(kind=r8), allocatable :: frontgf_thr(:,:,:,:) real(kind=r8), allocatable :: frontga_thr(:,:,:,:) - + ! This does not need to be a thread private data-structure call derivinit(deriv) @@ -81,9 +81,9 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) allocate(frontgf_thr(nphys,nphys,nlev,nets:nete)) allocate(frontga_thr(nphys,nphys,nlev,nets:nete)) - + call compute_frontogenesis(frontgf_thr,frontga_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) - + if (fv_nphys>0) then do ie=nets,nete frontgf(:,:,ie) = RESHAPE(frontgf_thr(:,:,:,ie),(/nphys*nphys,nlev/)) @@ -98,7 +98,7 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) end if deallocate(frontga_thr) deallocate(frontgf_thr) - + !!$OMP END PARALLEL end subroutine gws_src_fnct @@ -134,9 +134,9 @@ subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) call get_loop_ranges(hybrid,ibeg=nets,iend=nete) allocate(vort4gw_thr(nphys,nphys,nlev,nets:nete)) - + call compute_vorticity_4gw(vort4gw_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) - + if (fv_nphys>0) then do ie=nets,nete vort4gw(:,:,ie) = RESHAPE(vort4gw_thr(:,:,:,ie),(/nphys*nphys,nlev/)) @@ -148,20 +148,20 @@ subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) end do end if deallocate(vort4gw_thr) - + !!$OMP END PARALLEL end subroutine gws_src_vort subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nphys) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! compute vorticity for use in gw params + ! compute vorticity for use in gw params ! F = ( curl ) [U,V] ! ! Original by Peter Lauritzen, Julio Bacmeister*, Dec 2024 ! Patterned on 'compute_frontogenesis' ! - ! * corresponding/blame-able + ! * corresponding/blame-able !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! use derivative_mod, only: vorticity_sphere use edge_mod, only: edgevpack, edgevunpack @@ -176,10 +176,9 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph integer, intent(in) :: nets,nete,nphys integer, intent(in) :: tl,tlq real(r8), intent(out) :: vort4gw(nphys,nphys,nlev,nets:nete) - + ! local real(r8) :: area_inv(fv_nphys,fv_nphys), tmp(np,np) - !!real(r8) :: vort_tmp(fv_nphys*fv_nphys,nlev) real(r8) :: vort_gll(np,np,nlev,nets:nete) integer :: k,kptr,i,j,ie,component,h,nq,m_cnst,n0 @@ -195,7 +194,7 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph do k=1,nlev vort_gll(:,:,k,ie) = vort_gll(:,:,k,ie)*elem(ie)%spheremp(:,:) end do - ! pack + ! pack call edgeVpack(edge1, vort_gll(:,:,:,ie),nlev,0,ie) enddo call bndry_exchange(hybrid,edge1,location='compute_vorticity_4gw') @@ -214,7 +213,6 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph tmp = 1.0_r8 area_inv = dyn2phys(tmp,elem(ie)%metdet) area_inv = 1.0_r8/area_inv - !!! vort_tmp(:,:) = dyn2phys(vort_gll(:,:,:,ie),elem(ie)) !peter replace with scalar mapping !++jtb: Think I did that ... do k=1,nlev vort4gw(:,:,k,ie) = dyn2phys( vort_gll(:,:,k,ie) , elem(ie)%metdet , area_inv ) end do @@ -228,7 +226,7 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph end subroutine compute_vorticity_4gw - + subroutine compute_frontogenesis(frontgf,frontga,tl,tlq,elem,ederiv,hybrid,nets,nete,nphys) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! compute frontogenesis function F diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index db0f72fd8f..f45959a327 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -169,7 +169,7 @@ module gw_drag integer :: frontga_idx = -1 ! integer :: vort4gw_idx = -1 - + integer :: sgh_idx = -1 ! From CLUBB @@ -956,7 +956,7 @@ subroutine gw_init() end if end if - + if (use_gw_movmtn_pbl) then do k = 1, pver ! Find steering level @@ -975,7 +975,7 @@ subroutine gw_init() write (iulog,*) 'MOVMTN K_STEER =', movmtn_ksteer write (iulog,*) 'MOVMTN K_LAUNCH =', movmtn_klaunch write (iulog,*) 'K_STEER hardw =', pver - 20 !++ ????? - write (iulog,*) 'K_LAUNCH hardw =', pver - 20 - 10 !++ ????? + write (iulog,*) 'K_LAUNCH hardw =', pver - 20 - 10 !++ ????? write(iulog,*) ' ' end if @@ -1831,15 +1831,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) call pbuf_get_field(pbuf, wpthlp_clubb_gw_idx, wpthlp_clubb_gw) call pbuf_get_field(pbuf, upwp_clubb_gw_idx, upwp_clubb_gw) call pbuf_get_field(pbuf, vpwp_clubb_gw_idx, vpwp_clubb_gw) - - ! Vorticity from SE dycore. This needs to be either - ! generalized to other dycores or protected with some - ! endrun if dycore != SE - if (dycore_is('SE')) then - call pbuf_get_field(pbuf, vort4gw_idx, vort4gw) - else - call endrun( 'gw_drag: vort4gw only with SE') - end if + call pbuf_get_field(pbuf, vort4gw_idx, vort4gw) xpwp_clubb(:ncol,:) = sqrt( upwp_clubb_gw(:ncol,:)**2 + vpwp_clubb_gw(:ncol,:)**2 ) @@ -2511,7 +2503,7 @@ subroutine gw_rdg_calc( & real(r8), intent(in) :: effgw_rdg ! Tendency efficiency. real(r8), intent(in) :: effgw_rdg_max real(r8), intent(in) :: effgw_rdg_resid ! Tendency efficiency. - logical, intent(in) :: luse_gw_rdg_resid ! On-Off switch + logical, intent(in) :: luse_gw_rdg_resid ! On-Off switch real(r8), intent(in) :: hwdth(ncol,prdg) ! width of ridges. real(r8), intent(in) :: clngt(ncol,prdg) ! length of ridges. real(r8), intent(in) :: gbxar(ncol) ! gridbox area From 88084c5636a7a5000426f4b0e0958a6611bb0988 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 29 Jan 2025 17:27:27 -0700 Subject: [PATCH 42/65] fix gnu compilation error --- src/physics/cam/gw_drag.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index f45959a327..d9e5299c1e 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -2737,7 +2737,7 @@ subroutine gw_rdg_calc( & call outfld('TAUARDG'//trim(type)//'X', taurx, ncol, lchnk) call outfld('TAUARDG'//trim(type)//'Y', taury, ncol, lchnk) - if (luse_gw_rdg_resid == .true.) then + if (luse_gw_rdg_resid) then ! Add additional GW from residual variance. Assumed isotropic kwvrdg = 0.001_r8 / ( 100._r8 ) effgw = effgw_rdg_resid * isowgt !1.0_r8 * isowgt From 4f8b8f33668acece0e9509e92f6e01d60d935a7a Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Fri, 31 Jan 2025 10:06:11 -0700 Subject: [PATCH 43/65] Fill-out initial ChangeLog entry. --- doc/ChangeLog | 78 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8d3dae3994..9e4f148389 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,16 +1,88 @@ +=============================================================== + +Tag name: cam6_4_058 +Originator(s): PeterHjortLauritzen, adamrher, bstephens82, jimmielin, nusbaume +Date: Jan 31 2025 One-line Summary: Fix Exner bug in CLUBB interface and change CLUBB namelist +Github PR URL: https://github.com/ESCOMP/CAM/pull/1231 Purpose of changes (include the issue number and title text for each relevant GitHub issue): -The computation of the Exner function in the CLUBB interface code currently passes an incorrect version to the PBL utilities. The PBL utilities expect the "Stull" definition of the Exner function rather than the traditional "atmospheric" Exner function. -(Github issue 1222) +The computation of the Exner function in the CLUBB interface code currently passes an incorrect version to the PBL utilities. +The PBL utilities expect the "Stull" definition of the Exner function rather than the traditional "atmospheric" Exner function. +(Github issue #1222) The CLUBB group has recommended a namelist change to address this issue. -(Github issue 1208) +(Github issue #1208) + +Snapshots of tphysbc/tphysac subroutine-level variables are always in the "after" state for both tapes +(Github issue #1241) + +Describe any changes made to build system: none + +Describe any changes made to the namelist: + +M bld/namelist_files/namelist_defaults_cam.xml + - Turn off 'clubb_l_min_wp2_from_corr_wx' option in CLUBB + +List any changes to the defaults for the boundary datasets: none + +Describe any substantial timing or memory changes: not evaluated + +Code reviewed by: cacraigucar +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: + +M src/physics/cam/cam_snapshot.F90 + - Switch to correct tape for tphysac/tphysbc snapshot + +M src/physics/cam/clubb_intr.F90 + - Replace CLUBB exner with "Stull" Exner, which is what is actually expected. + +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. Expect baseline failures for all applications using CLUBB. +derecho/intel/aux_cam: + +derecho/nvhpc/aux_cam: + +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, i.e., +- what code configurations: +- what platforms/compilers: +- nature of change (roundoff; larger than roundoff but same climate; new + climate): + +If bitwise differences were observed, how did you show they were no worse +than roundoff? + +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: + +MSS location of control simulations used to validate new climate: + +URL for AMWG diagnostics output used to validate new climate: + +=============================================================== =============================================================== Tag name: cam6_4_057 From 89b3664d5a2bed25918ef40ee0c387e570c498c4 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 31 Jan 2025 12:50:32 -0700 Subject: [PATCH 44/65] cleanup --- CODE_OF_CONDUCT.md | 84 ---------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 10dc362beb..0000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,84 +0,0 @@ -# Contributor Code of Conduct -_The Contributor Code of Conduct is for participants in our software projects and community._ - -## Our Pledge -We, as contributors, creators, stewards, and maintainers (participants), of the Community Atmosphere Model (CAM) pledge to make participation in our software, system or hardware project and community a safe, productive, welcoming and inclusive experience for everyone. -All participants are required to abide by this Code of Conduct. -This includes respectful treatment of everyone regardless of age, body size, disability, ethnicity, gender identity or expression, level of experience, nationality, political affiliation, veteran status, pregnancy, genetic information, physical appearance, race, religion, or sexual orientation, as well as any other characteristic protected under applicable US federal or state law. - -## Our Standards -Examples of behaviors that contribute to a positive environment include: - -* All participants are treated with respect and consideration, valuing a diversity of views and opinions -* Be considerate, respectful, and collaborative -* Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism -* Acknowledging the contributions of others -* Avoid personal attacks directed toward other participants -* Be mindful of your surroundings and of your fellow participants -* Alert UCAR staff and suppliers/vendors if you notice a dangerous situation or someone in distress -* Respect the rules and policies of the project and venue - -Examples of unacceptable behavior include, but are not limited to: - -* Harassment, intimidation, or discrimination in any form -* Physical, verbal, or written abuse by anyone to anyone, including repeated use of pronouns other than those requested -* Unwelcome sexual attention or advances -* Personal attacks directed at other guests, members, participants, etc. -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Alarming, intimidating, threatening, or hostile comments or conduct -* Inappropriate use of nudity and/or sexual images -* Threatening or stalking anyone, including a participant -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Scope -This Code of Conduct applies to all spaces managed by the Project whether they be physical, online or face-to-face. -This includes project code, code repository, associated web pages, documentation, mailing lists, project websites and wiki pages, issue tracker, meetings, telecons, events, project social media accounts, and any other forums created by the project team which the community uses for communication. -In addition, violations of this Code of Conduct outside these spaces may affect a person's ability to participate within them. -Representation of a project may be further defined and clarified by project maintainers. - -## Community Responsibilities -Everyone in the community is empowered to respond to people who are showing unacceptable behavior. -They can talk to them privately or publicly. -Anyone requested to stop unacceptable behavior is expected to comply immediately. -If the behavior continues concerns may be brought to the project administrators or to any other party listed in the [Reporting](#reporting) section below. - -## Project Administrator Responsibilities -Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model appropriate behavior and provide support when people in the community point out inappropriate behavior. -Project administrator(s) are normally the ones that would be tasked to carry out the actions in the [Consequences](#consequences) section below. - -Project administrators are also expected to keep this Code of Conduct updated with the main one housed at UCAR, as listed below in the [Attribution](#attribution) section. - -## Reporting -Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action as outlined in the [Consequences](#consequences) section below. -However, making a report to a project administrator is not considered an 'official report' to UCAR. - -Instances of unacceptable behavior may also be reported directly to UCAR pursuant to [UCAR's Harassment Reporting and Complaint Procedure](https://www2.fin.ucar.edu/procedures/hr/harassment-reporting-and-complaint-procedure), or anonymously through [UCAR's EthicsPoint Hotline](https://www2.fin.ucar.edu/ethics/anonymous-reporting). - -Complaints received by UCAR will be handled pursuant to the procedures outlined in UCAR's Harassment Reporting and Complaint Procedure. -Complaints to UCAR will be held as confidential as practicable under the circumstances, and retaliation against a person who initiates a complaint or an inquiry about inappropriate behavior will not be tolerated. - -Any Contributor can use these reporting methods even if they are not directly affiliated with UCAR. -The Frequently Asked Questions (FAQ) page for reporting is [here](https://www2.fin.ucar.edu/procedures/hr/reporting-faqs). - -## Consequences -Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the circumstances. -Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits, email, issues, and other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently any contributor for other behaviors that are deemed inappropriate, threatening, offensive, or harmful. -Project administrators also have the right to report violations to UCAR HR and/or UCAR's Office of Diversity, Equity and Inclusion (ODEI), as well as a participant's home institution and/or law enforcement. -In the event an incident is reported to UCAR, UCAR will follow its Harassment Reporting and Complaint Procedure. - -## Process for Changes -All UCAR managed projects are required to adopt this Contributor Code of Conduct. -Adoption is assumed even if not expressly stated in the repository. -Projects should fill in sections where prompted with project-specific information, including, project name and adoption date. - -Projects that adopt this Code of Conduct need to stay up to date with UCAR's Contributor Code of Conduct, linked with a DOI in the [Attribution](#attribution) section below. -Projects can make limited substantive changes to the Code of Conduct, however, the changes must be limited in scope and may not contradict the UCAR Contributor Code of Conduct. - -## Attribution -This Code of Conduct was originally adapted from the [Contributor Covenant](http://contributor-covenant.org/version/1/4), version 1.4. -We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of Conduct. -The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR. -The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR website at https://doi.org/10.5065/6w2c-a132. -The date that it was adopted by this project was 2020-04-08 and replaces the previous version. -When responding to complaints, UCAR HR and ODEI will do so based on the latest published version. -Therefore, any project-specific changes should follow the [Process for Changes](#process-for-changes) section above. From 8f3b0b3d69c306cb5bb298a2cf4fe38109dbd05c Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Fri, 31 Jan 2025 15:04:53 -0700 Subject: [PATCH 45/65] Add derecho test results to ChangeLog. --- doc/ChangeLog | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9e4f148389..810bc638dc 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -48,12 +48,23 @@ 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. -Expect baseline failures for all applications using CLUBB. +NLCOMP and baseline failures for all applications using CLUBB. derecho/intel/aux_cam: +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 + +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.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) + - pre-existing failure -- issue #1220 + izumi/nag/aux_cam: izumi/gnu/aux_cam: @@ -151,12 +162,12 @@ SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) 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 + - pre-existing failures due to build-namelist error requiring CLM/CTSM external update derecho/nvhpc/aux_cam: ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) - - pre-existing failure -- issue #1220 + - pre-existing failure -- issue #1220 izumi/nag/aux_cam: ALL PASS From 65baa7110ee4b7a474ec8fa31438958cfb4098ef Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 31 Jan 2025 15:36:28 -0700 Subject: [PATCH 46/65] update topo file --- bld/namelist_files/namelist_defaults_cam.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 56391c7850..37fb05f87d 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -332,7 +332,7 @@ atm/cam/topo/se/ne3pg3_gmted2010_modis_bedmachine_nc0540_Laplace1000_noleak_20230209.nc atm/cam/topo/se/ne5pg3_nc3000_Co360_Fi001_MulG_PF_nullRR_Nsw064_20170516.nc atm/cam/topo/se/ne16pg3_nc3000_Co120_Fi001_PF_nullRR_Nsw084_20171012.nc -atm/cam/topo/se/ne30pg3_gmted2010_modis_bedmachine_nc3000_Laplace0100_noleak_20240117.nc +atm/cam/topo/se/ne30pg3_gmted2010_modis_bedmachine_nc3000_Laplace0100_noleak_20240720.nc atm/cam/topo/se/ne60pg3_nc3000_Co030_Fi001_PF_nullRR_Nsw021_20171012.nc atm/cam/topo/se/ne120pg3_nc3000_Co015_Fi001_PF_nullRR_Nsw010_20171014.nc atm/cam/topo/se/ne240pg3_nc3000_Co008_Fi001_PF_nullRR_Nsw005_20171015.nc From 4da5455ae9807cd1b0b828d61639fbeeb88373cf Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 31 Jan 2025 15:48:54 -0700 Subject: [PATCH 47/65] temporary fix for topo --- src/physics/cam/gw_drag.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index d9e5299c1e..8cbf923f54 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -689,7 +689,8 @@ subroutine gw_init() call infld('ISOWGT', fh_topo, dim1name, dim2name, 1, pcols, & begchunk, endchunk, rdg_isowgt, found, gridname='physgrid') - if (.not. found) call endrun(sub//': ERROR: ISOWGT not found on topo file') + ! ++jtb - Temporary fix until topo files contain this variable + if (.not. found) rdg_isowgt(:,:) = 0._r8 call infld('HWDTH', fh_topo, dim1name, 'nrdg', dim2name, 1, pcols, & 1, prdg, begchunk, endchunk, rdg_hwdth, found, gridname='physgrid') From dd33c5b046a95c14e8259990745f64e7a884a4fb Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 31 Jan 2025 17:04:24 -0700 Subject: [PATCH 48/65] Workaround for one more missing variable in topo files --- src/physics/cam/gw_drag.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 8cbf923f54..443425d1bb 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -685,10 +685,13 @@ subroutine gw_init() call infld('ISOVAR', fh_topo, dim1name, dim2name, 1, pcols, & begchunk, endchunk, rdg_isovar, found, gridname='physgrid') - if (.not. found) call endrun(sub//': ERROR: ISOVAR not found on topo file') +! if (.not. found) call endrun(sub//': ERROR: ISOVAR not found on topo file') + ! ++jtb - Temporary fix until topo files contain this variable + if (.not. found) rdg_isovar(:,:) = 0._r8 call infld('ISOWGT', fh_topo, dim1name, dim2name, 1, pcols, & begchunk, endchunk, rdg_isowgt, found, gridname='physgrid') +! if (.not. found) call endrun(sub//': ERROR: ISOWGT not found on topo file') ! ++jtb - Temporary fix until topo files contain this variable if (.not. found) rdg_isowgt(:,:) = 0._r8 From f7f373187bb180ee7a0a0e431f6e7ec46f6efea0 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Tue, 4 Feb 2025 09:39:16 -0700 Subject: [PATCH 49/65] Update ChangeLog with Izumi test results. --- doc/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 810bc638dc..2623d3b047 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -67,8 +67,12 @@ ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Ov izumi/nag/aux_cam: +All non-CAM6/CAM7 tests pass (CAM6 and CAM7 differences expected) + izumi/gnu/aux_cam: +All non-CAM6/CAM7 tests pass (CAM6 and CAM7 differences expected) + CAM tag used for the baseline comparison tests if different than previous tag: From 33c62b9c300a3c74b13e9702697653662b471421 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 4 Feb 2025 10:07:29 -0700 Subject: [PATCH 50/65] preliminary Changelog --- doc/ChangeLog | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index a3106459b0..2eea2275ba 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,9 +1,70 @@ +=============================================================== + +Tag name: cam6_4_059 +Originator(s): adamrher, PeterHjortLauritzen, cacraig +Date: Feb 4, 2025 One-line Summary: cloud frac bug in nucleate_ice_cam.F90 +Github PR URL: Purpose of changes (include the issue number and title text for each relevant GitHub issue): + - ice cloud fraction not set correctly (set to ice+liquid but should only be ice). (Github issue #1212) + +Describe any changes made to build system: N/A + +Describe any changes made to the namelist: N/A -ice cloud fraction not set correctly (set to ice+liquid but should only be ice). (Github issue #1212) +List any changes to the defaults for the boundary datasets: N/A +Describe any substantial timing or memory changes: N/A + +Code reviewed by: cacraig + +List all files eliminated: N/A + +List all files added and what they do: N/A + +List all existing files that have been modified, and describe the changes: +M src/physics/cam/nucleate_ice_cam.F90 + - Fix ice cloud fraction + +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: + +derecho/nvhpc/aux_cam: + +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, i.e., +- what code configurations: +- what platforms/compilers: +- nature of change (roundoff; larger than roundoff but same climate; new + climate): + +If bitwise differences were observed, how did you show they were no worse +than roundoff? + +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: + +MSS location of control simulations used to validate new climate: + +URL for AMWG diagnostics output used to validate new climate: + +=============================================================== =============================================================== Tag name: cam6_4_058 From a69d0532c2d8bb41e5cf5c79a79a11b37300ef0b Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 4 Feb 2025 11:21:15 -0700 Subject: [PATCH 51/65] Fix failing restart test --- src/dynamics/se/gravity_waves_sources.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index e978beb38d..b04d34e016 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -186,7 +186,7 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph ! First calculate vorticity on GLL grid !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! set timelevel=1 fro velocities - n0=1 + n0=tl do ie=nets,nete do k=1,nlev call vorticity_sphere(elem(ie)%state%v(:,:,:,k,n0),ederiv,elem(ie),vort_gll(:,:,k,ie)) From 668c9a33e2250bee356d0da2ee8a4912c4c9086d Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 4 Feb 2025 13:24:17 -0700 Subject: [PATCH 52/65] Address first round of review comments --- bld/namelist_files/namelist_definition.xml | 2 +- src/dynamics/se/gravity_waves_sources.F90 | 22 ++- src/physics/cam/gw_drag.F90 | 4 +- src/physics/cam/gw_movmtn.F90 | 22 +-- src/physics/cam/gw_rdg.F90 | 174 ++++++++++----------- 5 files changed, 114 insertions(+), 110 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index cc9b4eef03..3add902e29 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1325,7 +1325,7 @@ Default: .false. -Whether or not to enable gravity waves from residual(non-ridge) +Whether or not to enable gravity waves from residual (non-ridge) orography Default: set by build-namelist. diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index b04d34e016..d5cda08dce 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -5,7 +5,6 @@ module gravity_waves_sources use element_mod, only: element_t use hybrid_mod, only: hybrid_t use shr_kind_mod, only: r8 => shr_kind_r8 - use cam_logfile, only: iulog implicit none private @@ -51,13 +50,15 @@ end subroutine gws_init subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) use derivative_mod, only : derivinit - use dimensions_mod, only : npsq, nelemd + use dimensions_mod, only : nelemd use dof_mod, only : UniquePoints use hybrid_mod, only : config_thread_region, get_loop_ranges use parallel_mod, only : par use ppgrid, only : pver use thread_mod, only : horz_num_threads use dimensions_mod, only : fv_nphys + use cam_abortutils, only : handle_allocate_error + implicit none type (element_t), intent(inout), dimension(:) :: elem integer, intent(in) :: tl, nphys, tlq @@ -75,12 +76,15 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) ! This does not need to be a thread private data-structure call derivinit(deriv) !!$OMP PARALLEL NUM_THREADS(horz_num_threads), DEFAULT(SHARED), PRIVATE(nets,nete,hybrid,ie,ncols,frontgf_thr,frontga_thr) -! hybrid = config_thread_region(par,'horizontal') hybrid = config_thread_region(par,'serial') call get_loop_ranges(hybrid,ibeg=nets,iend=nete) allocate(frontgf_thr(nphys,nphys,nlev,nets:nete)) + call handle_allocate_error(ierr, 'gws_src_fnct', 'frontgf_thr') + allocate(frontga_thr(nphys,nphys,nlev,nets:nete)) + call handle_allocate_error(ierr, 'gws_src_fnct', 'frontga_thr') + call compute_frontogenesis(frontgf_thr,frontga_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) @@ -106,13 +110,15 @@ end subroutine gws_src_fnct !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) use derivative_mod, only : derivinit - use dimensions_mod, only : npsq, nelemd + use dimensions_mod, only : nelemd use dof_mod, only : UniquePoints use hybrid_mod, only : config_thread_region, get_loop_ranges use parallel_mod, only : par use ppgrid, only : pver use thread_mod, only : horz_num_threads use dimensions_mod, only : fv_nphys + use cam_abortutils, only : handle_allocate_error + implicit none type (element_t), intent(inout), dimension(:) :: elem integer, intent(in) :: tl, nphys, tlq @@ -133,7 +139,8 @@ subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) hybrid = config_thread_region(par,'serial') call get_loop_ranges(hybrid,ibeg=nets,iend=nete) - allocate(vort4gw_thr(nphys,nphys,nlev,nets:nete)) + allocate(vort4gw_thr(nphys,nphys,nlev,nets:nete), stat=ierr) + call handle_allocate_error(ierr, 'gws_src_vort', 'vort4gw_thr') call compute_vorticity_4gw(vort4gw_thr,tl,tlq,elem,deriv,hybrid,nets,nete,nphys) @@ -166,9 +173,8 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph use derivative_mod, only: vorticity_sphere use edge_mod, only: edgevpack, edgevunpack use bndry_mod, only: bndry_exchange - use dyn_grid, only: hvcoord - use dimensions_mod, only: fv_nphys,ntrac - use fvm_mapping, only: dyn2phys_vector,dyn2phys + use dimensions_mod, only: fv_nphys + use fvm_mapping, only: dyn2phys type(hybrid_t), intent(in) :: hybrid type(element_t), intent(inout), target :: elem(:) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 443425d1bb..2c4f30afc3 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -2744,7 +2744,7 @@ subroutine gw_rdg_calc( & if (luse_gw_rdg_resid) then ! Add additional GW from residual variance. Assumed isotropic kwvrdg = 0.001_r8 / ( 100._r8 ) - effgw = effgw_rdg_resid * isowgt !1.0_r8 * isowgt + effgw = effgw_rdg_resid * isowgt tauoro = 0._r8 call gw_rdg_resid_src(ncol, band_oro, p, & @@ -2793,7 +2793,7 @@ subroutine gw_rdg_calc( & call outfld('UBMRESID'//trim(type), ubm, ncol, lchnk) call outfld('UBIRESID'//trim(type), ubi, ncol, lchnk) - call outfld('SRC_LEVEL_RESID'//trim(type), 1._r8*src_level , ncol, lchnk) + call outfld('SRC_LEVEL_RESID'//trim(type), real(src_level, r8) , ncol, lchnk) ! end of residual variance calc end if diff --git a/src/physics/cam/gw_movmtn.F90 b/src/physics/cam/gw_movmtn.F90 index aa04879664..142b833eaa 100644 --- a/src/physics/cam/gw_movmtn.F90 +++ b/src/physics/cam/gw_movmtn.F90 @@ -41,7 +41,7 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & c, hdepth) !----------------------------------------------------------------------- ! Flexible driver for gravity wave source from obstacle effects produced -! by internal circulations +! by internal circulations !----------------------------------------------------------------------- use gw_utils, only: get_unit_vector, dot_2d, midpoint_interp use gw_common, only: GWBand, pver, qbo_hdepth_scaling @@ -180,13 +180,13 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & if (ksteer_in > 0) then Steer_k(:ncol) = ksteer_in end if - + !------------------------------------------------------------------------ ! Determine wind and unit vectors at the steering level) then ! project winds. !------------------------------------------------------------------------ do i=1,ncol - usteer(i) = u(i, Steer_k(i) ) ! + usteer(i) = u(i, Steer_k(i) ) vsteer(i) = v(i, Steer_k(i) ) steer_level(i) = real(Steer_k(i),r8) end do @@ -234,7 +234,7 @@ subroutine gw_movmtn_src(ncol,lchnk, band, desc, u, v, & if (use_gw_movmtn_pbl) then boti=pver - topi=Launch_k ! set in source subr + topi=Launch_k ! set in source subr else do k = pver, 1, -1 !start at surface do i = 1, ncol @@ -444,7 +444,7 @@ pure function index_of_nearest(x, grid) result(idx) end function index_of_nearest !!!!!!!!!!!!!!!!!!!!!!!!!!! -subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, steering_level, launch_level ) !! result(xpwp_src) +subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, steering_level, launch_level ) integer, intent(in) :: ncol,pverx real(r8), intent(in) :: xpwp_shcu (ncol,pverx) real(r8), intent(in) :: alpha_gw_movmtn @@ -471,7 +471,7 @@ subroutine shcu_flux_src (xpwp_shcu , ncol, pverx, alpha_gw_movmtn, xpwp_src, st end subroutine shcu_flux_src !!!!!!!!!!!!!!!!!!!!!!!!!!! -subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_src, steering_level, launch_level ) !! result(xpwp_src) +subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_src, steering_level, launch_level ) integer, intent(in) :: ncol,pverx real(r8), intent(in) :: vorticity (ncol,pverx) real(r8), intent(in) :: alpha_gw_movmtn @@ -479,13 +479,13 @@ subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_sr real(r8), intent(out) :: vort_src(ncol) integer, intent(out) :: steering_level(ncol), launch_level(ncol) - real(r8) :: scale_factor + real(r8) :: scale_factor integer :: k, nlayers - steering_level(:ncol) = pverx - 20 - launch_level(:ncol) = steering_level -10 + steering_level(:ncol) = pverx - 20 + launch_level(:ncol) = steering_level -10 - scale_factor = 1.e4 ! scales vorticity amp to u'w' in CLUBB + scale_factor = 1.e4 ! scales vorticity amp to u'w' in CLUBB !----------------------------------- ! Simple average over layers. ! Probably can do better @@ -495,7 +495,7 @@ subroutine vorticity_flux_src (vorticity , ncol, pverx, alpha_gw_movmtn, vort_sr do k = 0, nlayers-1 vort_src(:) = vort_src(:) + scale_factor * abs( vorticity(:,pverx-k) ) end do - vort_src(:) = alpha_gw_movmtn * vort_src(:)/(1.0_r8*nlayers) + vort_src(:) = alpha_gw_movmtn * vort_src(:)/nlayers end subroutine vorticity_flux_src diff --git a/src/physics/cam/gw_rdg.F90 b/src/physics/cam/gw_rdg.F90 index 4c3e1ef745..b6e046a4c1 100644 --- a/src/physics/cam/gw_rdg.F90 +++ b/src/physics/cam/gw_rdg.F90 @@ -52,7 +52,7 @@ module gw_rdg -! NOTE: Critical inverse Froude number Fr_c is +! NOTE: Critical inverse Froude number Fr_c is ! 1./(SQRT(2.)~0.707 in SM2000 ! (should be <= 1) real(r8), protected :: Fr_c @@ -93,10 +93,10 @@ subroutine gw_rdg_readnl(nlfile) logical :: gw_rdg_do_divstream, gw_rdg_do_smooth_regimes, gw_rdg_do_adjust_tauoro, & gw_rdg_do_backward_compat - + real(r8) :: gw_rdg_C_BetaMax_DS, gw_rdg_C_GammaMax, & gw_rdg_Frx0, gw_rdg_Frx1, gw_rdg_C_BetaMax_SM, gw_rdg_Fr_c, & - gw_rdg_orohmin, gw_rdg_orovmin, gw_rdg_orostratmin, gw_rdg_orom2min + gw_rdg_orohmin, gw_rdg_orovmin, gw_rdg_orostratmin, gw_rdg_orom2min namelist /gw_rdg_nl/ gw_rdg_do_divstream, gw_rdg_C_BetaMax_DS, gw_rdg_C_GammaMax, & gw_rdg_Frx0, gw_rdg_Frx1, gw_rdg_C_BetaMax_SM, gw_rdg_Fr_c, & @@ -120,7 +120,7 @@ subroutine gw_rdg_readnl(nlfile) call freeunit(unitn) ! Set the local variables - do_divstream = gw_rdg_do_divstream + do_divstream = gw_rdg_do_divstream C_BetaMax_DS = gw_rdg_C_BetaMax_DS C_GammaMax = gw_rdg_C_GammaMax Frx0 = gw_rdg_Frx0 @@ -179,7 +179,7 @@ end subroutine gw_rdg_readnl !========================================================================== subroutine gw_rdg_resid_src(ncol, band, p, & u, v, t, mxdis, kwvrdg, zi, nm, & - src_level, tend_level, tau, ubm, ubi, xv, yv, & + src_level, tend_level, tau, ubm, ubi, xv, yv, & ubmsrc, usrc, vsrc, nsrc, rsrc, m2src, c, tauoro ) use gw_common, only: rair, GWBand use gw_utils, only: dot_2d, midpoint_interp, get_unit_vector @@ -254,12 +254,10 @@ subroutine gw_rdg_resid_src(ncol, band, p, & real(r8) :: dwv(ncol) ! Wind speed in source region. real(r8) :: wmsrc(ncol) - ! source level mom. flux - !real(r8) :: tauoro(ncol) real(r8) :: ragl(ncol) real(r8) :: Fcrit_res,sghmax - + !-------------------------------------------------------------------------- ! Check that ngwav is equal to zero, otherwise end the job !-------------------------------------------------------------------------- @@ -279,7 +277,7 @@ subroutine gw_rdg_resid_src(ncol, band, p, & where(hdsp < 10._r8) hdsp = 0._r8 end where - + src_level = pver+1 tau(:,0,:) = 0.0_r8 @@ -290,13 +288,13 @@ subroutine gw_rdg_resid_src(ncol, band, p, & do i = 1, ncol ! Need to have h >= z(k+1) here or code will bomb when h=0. if ( (hdsp(i) >= zi(i,k+1)) .and. (hdsp(i) < zi(i,k)) ) then - src_level(i) = k + src_level(i) = k end if end do end do rsrc = 0._r8 - usrc = 0._r8 + usrc = 0._r8 vsrc = 0._r8 nsrc = 0._r8 do i = 1, ncol @@ -322,7 +320,7 @@ subroutine gw_rdg_resid_src(ncol, band, p, & call get_unit_vector(usrc, vsrc, xv, yv, wmsrc ) ubmsrc = wmsrc - + ! Project the local wind at midpoints onto the source wind. do k = 1, pver ubm(:,k) = dot_2d(u(:,k), v(:,k), xv, yv) @@ -339,7 +337,7 @@ subroutine gw_rdg_resid_src(ncol, band, p, & ! ! m^2 ~ (N/U)^2 - k^2 ! - + m2src = ( (nsrc/(ubmsrc+0.01_r8))**2 - kwvrdg**2 ) /((nsrc/(ubmsrc+0.01_r8))**2) ! Compute the interface wind projection by averaging the midpoint winds. @@ -357,7 +355,7 @@ subroutine gw_rdg_resid_src(ncol, band, p, & if ( ( src_level(i) > 0 ) .and. ( m2src(i) > orom2min ) ) then sghmax = Fcrit_res * (ubmsrc(i) / nsrc(i))**2 tauoro(i) = 0.5_r8 * kwvrdg(i) * min(hdsp(i)**2, sghmax) * & - rsrc(i) * nsrc(i) * ubmsrc(i) + rsrc(i) * nsrc(i) * ubmsrc(i) else tauoro(i) = 0._r8 end if @@ -369,7 +367,7 @@ subroutine gw_rdg_resid_src(ncol, band, p, & end do end do - + ! Allow wind tendencies all the way to the model bottom. tend_level = pver @@ -383,7 +381,7 @@ end subroutine gw_rdg_resid_src subroutine gw_rdg_src(ncol, band, p, & u, v, t, mxdis, angxy, anixy, kwvrdg, iso, zi, nm, & - src_level, tend_level, bwv_level ,tlb_level , tau, ubm, ubi, xv, yv, & + src_level, tend_level, bwv_level ,tlb_level , tau, ubm, ubi, xv, yv, & ubmsrc, usrc, vsrc, nsrc, rsrc, m2src, tlb, bwv, Fr1, Fr2, Frx, c) use gw_common, only: rair, GWBand use gw_utils, only: dot_2d, midpoint_interp @@ -470,8 +468,8 @@ subroutine gw_rdg_src(ncol, band, p, & ! Wind speed in source region. real(r8) :: wmsrc(ncol) - real(r8) :: ragl(ncol) - + real(r8) :: ragl(ncol) + !-------------------------------------------------------------------------- ! Check that ngwav is equal to zero, otherwise end the job !-------------------------------------------------------------------------- @@ -499,13 +497,13 @@ subroutine gw_rdg_src(ncol, band, p, & do i = 1, ncol ! Need to have h >= z(k+1) here or code will bomb when h=0. if ( (hdsp(i) >= zi(i,k+1)) .and. (hdsp(i) < zi(i,k)) ) then - src_level(i) = k + src_level(i) = k end if end do end do rsrc = 0._r8 - usrc = 0._r8 + usrc = 0._r8 vsrc = 0._r8 nsrc = 0._r8 do i = 1, ncol @@ -535,7 +533,7 @@ subroutine gw_rdg_src(ncol, band, p, & ragl = angxy * pii/180._r8 - ! protect from wierd "bad" angles + ! protect from wierd "bad" angles ! that may occur if hdsp is zero where( hdsp <= orohmin ) ragl = 0._r8 @@ -547,7 +545,7 @@ subroutine gw_rdg_src(ncol, band, p, & ! Kluge in possible "isotropic" obstacle. where( ( iso == 1 ) .and. (wmsrc > orovmin) ) - xv = usrc/wmsrc + xv = usrc/wmsrc yv = vsrc/wmsrc end where @@ -563,7 +561,7 @@ subroutine gw_rdg_src(ncol, band, p, & ubm(:,k) = sign( ubmsrc*0._r8+1._r8 , ubmsrc ) * ubm(:,k) end do - ! Sean says just use 1._r8 as + ! Sean says just use 1._r8 as ! first argument xv = sign( ubmsrc*0._r8+1._r8 , ubmsrc ) * xv yv = sign( ubmsrc*0._r8+1._r8 , ubmsrc ) * yv @@ -572,7 +570,7 @@ subroutine gw_rdg_src(ncol, band, p, & ! against zero ubmsrc = abs(ubmsrc) ubmsrc = max( 0.01_r8 , ubmsrc ) - + ! The minimum stratification allowing GW behavior ! should really depend on horizontal scale since @@ -580,9 +578,9 @@ subroutine gw_rdg_src(ncol, band, p, & ! m^2 ~ (N/U)^2 - k^2 ! ! Should also think about parameterizing - ! trapped lee-waves. + ! trapped lee-waves. + - ! This needs to be made constistent with later ! treatment of nonhydrostatic effects. m2src = ( (nsrc/(ubmsrc+0.01_r8))**2 - kwvrdg**2 ) /((nsrc/(ubmsrc+0.01_r8))**2) @@ -593,9 +591,9 @@ subroutine gw_rdg_src(ncol, band, p, & ! will modified later if wave breaking or trapping are ! diagnosed ! - ! ^ + ! ^ ! | *** linear propagation *** - ! (H) -------- mountain top ------------- | *** or wave breaking **** + ! (H) -------- mountain top ------------- | *** or wave breaking **** ! | *** regimes ************* ! (BWV)------ bottom of linear waves ---- | ! : | @@ -603,7 +601,7 @@ subroutine gw_rdg_src(ncol, band, p, & ! : | ! (TLB)--- top of flow diversion layer--- ' ! : - ! **** flow diversion ***** + ! **** flow diversion ***** ! : !============================================ @@ -612,17 +610,17 @@ subroutine gw_rdg_src(ncol, band, p, & !-------------------------------------------- ! High-drag downslope wind regime exists ! between bottom of linear waves and top of - ! flow diversion. Linear waves can only + ! flow diversion. Linear waves can only ! attain vertical displacment of f1*U/N. So, ! bottom of linear waves is given by ! - ! BWV = H - Fr1*U/N + ! BWV = H - Fr1*U/N ! - ! Downslope wind layer begins at BWV and + ! Downslope wind layer begins at BWV and ! extends below it until some maximum high ! drag obstacle height Fr2*U/N is attained ! (where Fr2 >= f1). Below downslope wind - ! there is flow diversion, so top of + ! there is flow diversion, so top of ! diversion layer (TLB) is equivalent to ! bottom of downslope wind layer and is; ! @@ -637,27 +635,27 @@ subroutine gw_rdg_src(ncol, band, p, & if ( do_divstream ) then !------------------------------------------------ - ! Calculate Fr2(Frx) for DS2017 + ! Calculate Fr2(Frx) for DS2017 !------------------------------------------------ where(Frx <= Frx0) Fr2(:) = Fr1(:) + Fr1(:)* C_GammaMax * anixy(:) elsewhere((Frx > Frx0).and.(Frx <= Frx1) ) Fr2(:) = Fr1(:) + Fr1(:)* C_GammaMax * anixy(:) & - * (Frx1 - Frx(:))/(Frx1-Frx0) - elsewhere(Frx > Frx1) + * (Frx1 - Frx(:))/(Frx1-Frx0) + elsewhere(Frx > Frx1) Fr2(:)=Fr1(:) endwhere else - !------------------------------------------ + !------------------------------------------ ! Regime distinctions entirely carried by ! amplification of taudsw (next subr) !------------------------------------------ Fr2(:)=Fr1(:) - end if + end if + - - where( m2src > orom2min ) + where( m2src > orom2min ) ddw = Fr2 * ( abs(ubmsrc) )/nsrc elsewhere ddw = 0._r8 @@ -681,7 +679,7 @@ subroutine gw_rdg_src(ncol, band, p, & ! Find *BOTTOM* of linear wave layer (BWV) !where ( nsrc > orostratmin ) - where( m2src > orom2min ) + where( m2src > orom2min ) dwv = Fr1 * ( abs(ubmsrc) )/nsrc elsewhere dwv = -9.999e9_r8 ! if weak strat - no waves @@ -713,7 +711,7 @@ subroutine gw_rdg_src(ncol, band, p, & ! No spectrum; phase speed is just 0. c = 0._r8 - where( m2src < orom2min ) + where( m2src < orom2min ) tlb = mxdis tlb_level = src_level endwhere @@ -726,8 +724,8 @@ end subroutine gw_rdg_src subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & t, mxdis, anixy, kwvrdg, zi, nm, ni, rhoi, & - src_level , tau, & - ubmsrc, nsrc, rsrc, m2src,tlb,bwv,Fr1,Fr2,Frx, & + src_level , tau, & + ubmsrc, nsrc, rsrc, m2src,tlb,bwv,Fr1,Fr2,Frx, & tauoro,taudsw, hdspwv,hdspdw ) use gw_common, only: GWBand @@ -810,16 +808,16 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & end do do i = 1, ncol - if ( m2src(i) > orom2min ) then + if ( m2src(i) > orom2min ) then hdspwv(i) = min( mxdis(i) , Fr1(i) * ubsrcx(i) / nsrc(i) ) else hdspwv(i) = 0._r8 end if end do - + if (do_divstream) then do i = 1, ncol - if ( m2src(i) > orom2min ) then + if ( m2src(i) > orom2min ) then hdspdw(i) = min( mxdis(i) , Fr2(i) * ubsrcx(i) / nsrc(i) ) else hdspdw(i) = 0._r8 @@ -828,8 +826,8 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & else do i = 1, ncol ! Needed only to mark where a DSW occurs - if ( m2src(i) > orom2min ) then - hdspdw(i) = mxdis(i) + if ( m2src(i) > orom2min ) then + hdspdw(i) = mxdis(i) else hdspdw(i) = 0._r8 end if @@ -843,14 +841,14 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & ! Determine the orographic c=0 source term following McFarlane (1987). ! Set the source top interface index to pver, if the orographic term is ! zero. - ! + ! ! This formula is basically from ! ! tau(src) = rho * u' * w' - ! where + ! where ! u' ~ N*h' and w' ~ U*h'/b (b="breite") ! - ! and 1/b has been replaced with k (kwvrdg) + ! and 1/b has been replaced with k (kwvrdg) ! do i = 1, ncol if ( ( src_level(i) > 0 ) .and. ( m2src(i) > orom2min ) ) then @@ -886,7 +884,7 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & ! Amplify DSW between Frx=1. and Frx=Frx1 do i = 1,ncol dswamp=0._r8 - BetaMax = C_BetaMax_DS * anixy(i) + BetaMax = C_BetaMax_DS * anixy(i) if ( (Frx(i)>1._r8).and.(Frx(i)<=Frx1)) then dswamp = (Frx(i)-1._r8)*(Frx1-Frx(i))/(0.25_r8*(Frx1-1._r8)**2) end if @@ -897,30 +895,30 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & ! Scinocca&McFarlane !-------------------- do i = 1, ncol - BetaMax = C_BetaMax_SM * anixy(i) + BetaMax = C_BetaMax_SM * anixy(i) if ( (Frx(i) >=1._r8) .and. (Frx(i) < 1.5_r8) ) then dswamp = 2._r8 * BetaMax * (Frx(i) -1._r8) else if ( ( Frx(i) >= 1.5_r8 ) .and. (Frx(i) < 3._r8 ) ) then - dswamp = ( 1._r8 + BetaMax - (0.666_r8**2) ) * ( 0.666_r8*(3._r8 - Frx(i) ))**2 & + dswamp = ( 1._r8 + BetaMax - (0.666_r8**2) ) * ( 0.666_r8*(3._r8 - Frx(i) ))**2 & + ( 1._r8 / Frx(i) )**2 -1._r8 else - dswamp = 0._r8 + dswamp = 0._r8 end if if ( (Frx(i) >=1._r8) .and. (Frx(i) < 3._r8) ) then taudsw(i) = (1._r8 + dswamp )*taulin(i) - tauoro(i) else - taudsw(i) = 0._r8 + taudsw(i) = 0._r8 endif ! This code defines "taudsw" as SUM of freely-propagating ! DSW enhancement. Different than in SM2000 - taudsw(i) = taudsw(i) + tauoro(i) + taudsw(i) = taudsw(i) + tauoro(i) end do !---------------------------------------------------- end if - + do i = 1, ncol - if ( m2src(i) > orom2min ) then + if ( m2src(i) > orom2min ) then where ( ( zi(i,:) < mxdis(i) ) .and. ( zi(i,:) >= bwv(i) ) ) tau(i,0,:) = tauoro(i) else where ( ( zi(i,:) < bwv(i) ) .and. ( zi(i,:) >= tlb(i) ) ) @@ -934,7 +932,7 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & tau(i,0,:) = taudsw(i) + & Coeff_LB(i) * kwvrdg(i) * rsrc(i) * 0.5_r8 * (ubsrcx(i)**2) * ( tlb(i) - zi(i,:) ) endwhere - + if (do_smooth_regimes) then ! This blocks accounts for case where both mxdis and tlb fall ! between adjacent edges @@ -945,7 +943,7 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & tau(i,0,k) = tauoro(i) end if end do - end if + end if else !---------------------------------------------- ! This block allows low-level dynamics to occur @@ -964,11 +962,11 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & k=src_level(i) if ( ni(i,k) > orostratmin ) then tausat = (Fr_c**2) * kwvrdg(i) * rhoi(i,k) * ubsrcx(i)**3 / & - (1._r8*ni(i,k)) + (1._r8*ni(i,k)) else tausat = 0._r8 - endif - tau(i,0,src_level(i)) = min( tauoro(i), tausat ) + endif + tau(i,0,src_level(i)) = min( tauoro(i), tausat ) end do @@ -976,18 +974,18 @@ subroutine gw_rdg_belowpeak(ncol, band, rdg_cd_llb, & ! Final clean-up. Do nothing if obstacle less than orohmin do i = 1, ncol if ( mxdis(i) < orohmin ) then - tau(i,0,:) = 0._r8 + tau(i,0,:) = 0._r8 tauoro(i) = 0._r8 taudsw(i) = 0._r8 - endif + endif end do - ! Disable vertical propagation if Scorer param is + ! Disable vertical propagation if Scorer param is ! too small. do i = 1, ncol if ( m2src(i) <= orom2min ) then src_level(i)=1 - endif + endif end do @@ -996,10 +994,10 @@ end subroutine gw_rdg_belowpeak !========================================================================== subroutine gw_rdg_break_trap(ncol, band, & - zi, nm, ni, ubm, ubi, rhoi, kwvrdg, bwv, tlb, wbr, & - src_level, tlb_level, & + zi, nm, ni, ubm, ubi, rhoi, kwvrdg, bwv, tlb, wbr, & + src_level, tlb_level, & hdspwv, hdspdw, mxdis, & - tauoro, taudsw, tau, & + tauoro, taudsw, tau, & ldo_trapped_waves, wdth_kwv_scale_in ) use gw_common, only: GWBand !----------------------------------------------------------------------- @@ -1099,7 +1097,7 @@ subroutine gw_rdg_break_trap(ncol, band, & endwhere end do - ! Take square root of m**2 and + ! Take square root of m**2 and ! do vertical integral to find ! WKB phase. !----------------------------- @@ -1107,8 +1105,8 @@ subroutine gw_rdg_break_trap(ncol, band, & phswkb(:,:)=0 do k=pver,1,-1 where( zi(:,k) > tlb(:) ) - delz(:) = min( zi(:,k)-zi(:,k+1) , zi(:,k)-tlb(:) ) - phswkb(:,k) = phswkb(:,k+1) + m2(:,k)*delz(:) + delz(:) = min( zi(:,k)-zi(:,k+1) , zi(:,k)-tlb(:) ) + phswkb(:,k) = phswkb(:,k+1) + m2(:,k)*delz(:) endwhere end do @@ -1119,9 +1117,9 @@ subroutine gw_rdg_break_trap(ncol, band, & wbrx(:)=0._r8 if (do_smooth_regimes) then do k=pver,1,-1 - where( (phswkb(:,k+1)<1.5_r8*pii).and.(phswkb(:,k)>=1.5_r8*pii) & + where( (phswkb(:,k+1)<1.5_r8*pii).and.(phswkb(:,k)>=1.5_r8*pii) & .and.(hdspdw(:)>hdspwv(:)) ) - wbr(:) = zi(:,k) + wbr(:) = zi(:,k) ! Extrapolation to make regime ! transitions smoother wbrx(:) = zi(:,k) - ( phswkb(:,k) - 1.5_r8*pii ) & @@ -1131,7 +1129,7 @@ subroutine gw_rdg_break_trap(ncol, band, & end do else do k=pver,1,-1 - where( (phswkb(:,k+1)<1.5_r8*pii).and.(phswkb(:,k)>=1.5_r8*pii) & + where( (phswkb(:,k+1)<1.5_r8*pii).and.(phswkb(:,k)>=1.5_r8*pii) & .and.(hdspdw(:)>hdspwv(:)) ) wbr(:) = zi(:,k) src_level(:) = k @@ -1142,12 +1140,12 @@ subroutine gw_rdg_break_trap(ncol, band, & ! Adjust tauoro at new source levels if needed. ! This is problematic if Fr_c<1.0. Not sure why. !---------------------------------------------------------- - if (do_adjust_tauoro) then + if (do_adjust_tauoro) then do i = 1,ncol if (wbr(i) > 0._r8 ) then - tausat(i) = (Fr_c**2) * kwvrdg(i) * rhoi( i, src_level(i) ) & + tausat(i) = (Fr_c**2) * kwvrdg(i) * rhoi( i, src_level(i) ) & * abs(ubi(i , src_level(i) ))**3 & - / ni( i , src_level(i) ) + / ni( i , src_level(i) ) tauoro(i) = min( tauoro(i), tausat(i) ) end if end do @@ -1160,9 +1158,9 @@ subroutine gw_rdg_break_trap(ncol, band, & tau(i,0,k) = tauoro(i) + (taudsw(i)-tauoro(i)) * & ( wbrx(i) - zi(i,k) ) / & ( wbrx(i) - tlb(i) ) - tau(i,0,k) = max( tau(i,0,k), tauoro(i) ) + tau(i,0,k) = max( tau(i,0,k), tauoro(i) ) endif - end do + end do end do else ! Following is for backwards B4B compatibility with earlier versions @@ -1175,7 +1173,7 @@ subroutine gw_rdg_break_trap(ncol, band, & ( wbr(i) - zi(i,k) ) / & ( wbr(i) - tlb(i) ) endif - end do + end do end do else do i = 1, ncol @@ -1185,13 +1183,13 @@ subroutine gw_rdg_break_trap(ncol, band, & ( wbr(i) - zi(i,k) ) / & ( wbr(i) - tlb(i) ) endif - end do + end do end do end if end if - - if (lldo_trapped_waves) then - + + if (lldo_trapped_waves) then + ! Identify top edge of layer in which Scorer param drops below 0 ! - approximately the "turning level" !---------------------------------------------------------- From 2c4796d295eea04480f4c17f1aba8dd30dfdbe38 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 4 Feb 2025 14:34:47 -0700 Subject: [PATCH 53/65] Fix typos --- src/dynamics/se/gravity_waves_sources.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index d5cda08dce..3d80bc9201 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -68,7 +68,7 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) ! Local variables type (hybrid_t) :: hybrid - integer :: nets, nete, ithr, ncols, ie + integer :: nets, nete, ithr, ncols, ie, ierr real(kind=r8), allocatable :: frontgf_thr(:,:,:,:) real(kind=r8), allocatable :: frontga_thr(:,:,:,:) @@ -79,10 +79,10 @@ subroutine gws_src_fnct(elem, tl, tlq, frontgf, frontga, nphys) hybrid = config_thread_region(par,'serial') call get_loop_ranges(hybrid,ibeg=nets,iend=nete) - allocate(frontgf_thr(nphys,nphys,nlev,nets:nete)) + allocate(frontgf_thr(nphys,nphys,nlev,nets:nete), stat=ierr) call handle_allocate_error(ierr, 'gws_src_fnct', 'frontgf_thr') - allocate(frontga_thr(nphys,nphys,nlev,nets:nete)) + allocate(frontga_thr(nphys,nphys,nlev,nets:nete), stat=ierr) call handle_allocate_error(ierr, 'gws_src_fnct', 'frontga_thr') @@ -128,7 +128,7 @@ subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) ! Local variables type (hybrid_t) :: hybrid - integer :: nets, nete, ithr, ncols, ie + integer :: nets, nete, ithr, ncols, ie, ierr ! real(kind=r8), allocatable :: vort4gw_thr(:,:,:,:) From 6e90910323bae98bec3e110c815ad95098898856 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 4 Feb 2025 15:08:22 -0700 Subject: [PATCH 54/65] Update ChangeLog --- doc/ChangeLog | 91 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 2eea2275ba..2756a2d1db 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -4,7 +4,7 @@ Tag name: cam6_4_059 Originator(s): adamrher, PeterHjortLauritzen, cacraig Date: Feb 4, 2025 One-line Summary: cloud frac bug in nucleate_ice_cam.F90 -Github PR URL: +Github PR URL: issue 1212 bug fix (cloud frac ice+liquid): https://github.com/ESCOMP/CAM/pull/1230 Purpose of changes (include the issue number and title text for each relevant GitHub issue): - ice cloud fraction not set correctly (set to ice+liquid but should only be ice). (Github issue #1212) @@ -33,36 +33,77 @@ 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) + 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 + + 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 + + ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: + ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details: + ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details: + ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details: + ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL) details: + SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: + SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL) details: + SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details: + SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: DIFF) details: + SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details: + SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs (Overall: DIFF) details: + SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem (Overall: DIFF) details: + SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + - Changes expected due to bug fix derecho/nvhpc/aux_cam: + ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) details: + - Changes expected due to bug fix izumi/nag/aux_cam: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERI_D_Ln18.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details: + ERP_Ln9.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF) details: + SMS_P48x1_D_Ln3.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details: + - Changes expected due to bug fix izumi/gnu/aux_cam: - -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): - -If bitwise differences were observed, how did you show they were no worse -than roundoff? - -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: - -MSS location of control simulations used to validate new climate: - -URL for AMWG diagnostics output used to validate new climate: + ERP_D_Ln9.C48_C48_mg17.QPC6.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + 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: + SCT_D_Ln7.ne3_ne3_mg37.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details: + SCT_D_Ln7.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details: + - Changes expected due to bug fix =============================================================== =============================================================== From 9f93b9e0692a2b6cc2c5c22c753ba0a5625b60c8 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 4 Feb 2025 16:37:34 -0700 Subject: [PATCH 55/65] Fix compiler issue --- src/physics/cam/gw_drag.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index 2c4f30afc3..c403a25366 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -114,8 +114,8 @@ module gw_drag integer :: movmtn_source = -1 integer :: movmtn_ksteer = -1 integer :: movmtn_klaunch = -1 - real(r8) :: movmtn_psteer = unset_r8 ! 65000.0_r8 - real(r8) :: movmtn_plaunch = unset_r8 ! 32500.0_r8 + real(r8) :: movmtn_psteer = unset_r8 + real(r8) :: movmtn_plaunch = unset_r8 ! Parameters controlling isotropic residual ! orographic GW. @@ -167,7 +167,7 @@ module gw_drag integer :: ttend_sh_idx = -1 integer :: frontgf_idx = -1 integer :: frontga_idx = -1 - ! + integer :: vort4gw_idx = -1 integer :: sgh_idx = -1 @@ -988,7 +988,7 @@ subroutine gw_init() vort4gw_idx = pbuf_get_index('VORT4GW') - call addfld ('VORT4GW', (/ 'lev' /), 'A', '1/S', & + call addfld ('VORT4GW', (/ 'lev' /), 'A', 's-1', & 'Vorticity') end if @@ -1839,7 +1839,7 @@ subroutine gw_tend(state, pbuf, dt, ptend, cam_in, flx_heat) xpwp_clubb(:ncol,:) = sqrt( upwp_clubb_gw(:ncol,:)**2 + vpwp_clubb_gw(:ncol,:)**2 ) - effgw = effgw_movmtn_pbl !1._r8 + effgw = effgw_movmtn_pbl call gw_movmtn_src(ncol, lchnk, band_movmtn , movmtn_desc, & u, v, ttend_dp(:ncol,:), ttend_clubb(:ncol,:), xpwp_clubb(:ncol,:), vort4gw(:ncol,:), & zm, alpha_gw_movmtn, movmtn_source, movmtn_ksteer, movmtn_klaunch, src_level, tend_level, & From 0644bcb144eb7e9b917c878e38f684e2e63b1539 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 5 Feb 2025 12:53:36 -0700 Subject: [PATCH 56/65] Update ChangeLog for cam6_4_060 --- doc/ChangeLog | 142 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index da654bea5e..21dbbd5774 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,10 +1,148 @@ +=============================================================== + +Tag name: cam6_4_060 +Originator(s): klindsay, PeterHjortLauritzen, cacraig +Date: Feb 5, 2025 One-line Summary: Preserve constant dry mixing ratios in gw and vertical diffusion code +Github PR URL: Preserve constant dry mixing ratios in gw_drag and vertical diffusion code (https://github.com/ESCOMP/CAM/pull/1234) + Purpose of changes (include the issue number and title text for each relevant GitHub issue): + - Keith Lindsay's modifications for preservation of dry constant mixing ratios. (Github issue #1233) -Keith Lindsay's modifications for preservation of dry constant mixing ratios. (Github issue #1233) +Describe any changes made to build system: N/A -Expect baseline failures in all regression tests using CAM physics +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: cacraig + +List all files eliminated: N/A + +List all files added and what they do: N/A + +List all existing files that have been modified, and describe the changes: +M src/physics/cam/gw_drag.F90 +M src/physics/cam/vertical_diffusion.F90 + - changes to preserve dry mixing ratios + +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) + 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 + + 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 + + ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: + ERC_D_Ln9.f19_f19_mg17.QPMOZ.derecho_intel.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.ne16_ne16_mg17.QPC5HIST.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: + ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details: + ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details: + ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details: + SCT_D_Ln7.ne3_ne3_mg37.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details: + SCT_D_Ln7.T42_T42_mg17.QPC5.derecho_intel.cam-scm_prep (Overall: DIFF) details: + SMS_D_Ld2.f19_f19_mg17.QPC5HIST.derecho_intel.cam-volc_usecase (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.QPC5M7.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details: + SMS_D_Ln9.T42_T42.FSCAMARM97.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: DIFF) details: + SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details: + SMS_Ln9.f19_f19.F2000climo.derecho_intel.cam-silhs (Overall: DIFF) details: + SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + - expect answer changes for most regression tests + +derecho/nvhpc/aux_cam: + ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) details: + - expect answer changes for most regression tests + +izumi/nag/aux_cam: + ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF) details: + ERI_D_Ln18.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details: + ERI_D_Ln18.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details: + ERP_Ln9.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details: + PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details: + PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details: + PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details: + PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details: + PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details: + PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details: + SMS_D_Ln3.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details: + SMS_D_Ln7.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF) details: + SMS_P48x1_D_Ln3.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details: + SUB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + TMC_D.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details: + TMC_D.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details: + - expect answer changes for most regression tests + +izumi/gnu/aux_cam: + ERC_D_Ln9.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_gnu.cam-outfrq3s_unicon (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPSPCAMM.izumi_gnu.cam-outfrq3s (Overall: DIFF) details: + ERP_D_Ln9.C48_C48_mg17.QPC6.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.FLTHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne5_ne5_mg37.QPC5.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: + PLB_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal0 (Overall: DIFF) details: + PLB_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal1 (Overall: DIFF) details: + PLB_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-ttrac_loadbal3 (Overall: DIFF) details: + SCT_D_Ln7.ne3_ne3_mg37.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details: + SCT_D_Ln7.T42_T42_mg17.QPC6.izumi_gnu.cam-scm_prep_c6 (Overall: DIFF) details: + SMS_D_Ln3.f10_f10_mg37.QPMOZ.izumi_gnu.cam-outfrq3s_chemproc (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF) details: + SMS_D_Ln9.ne5pg3_ne5pg3_mg37.QPC5.izumi_gnu.cam-outfrq3s_ttrac (Overall: DIFF) details: + SMS_P48x1_D_Ln9.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + - expect answer changes for most regression tests + +=============================================================== =============================================================== Tag name: cam6_4_059 From 85efadc398591d1fa4215b7b1f5f43d967ecf18a Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 5 Feb 2025 14:56:44 -0700 Subject: [PATCH 57/65] Change scope of variable from inout to in --- src/dynamics/se/gravity_waves_sources.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dynamics/se/gravity_waves_sources.F90 b/src/dynamics/se/gravity_waves_sources.F90 index 3d80bc9201..abdbaf1315 100644 --- a/src/dynamics/se/gravity_waves_sources.F90 +++ b/src/dynamics/se/gravity_waves_sources.F90 @@ -120,7 +120,7 @@ subroutine gws_src_vort(elem, tl, tlq, vort4gw, nphys) use cam_abortutils, only : handle_allocate_error implicit none - type (element_t), intent(inout), dimension(:) :: elem + type (element_t), intent(in), dimension(:) :: elem integer, intent(in) :: tl, nphys, tlq ! @@ -177,7 +177,7 @@ subroutine compute_vorticity_4gw(vort4gw,tl,tlq,elem,ederiv,hybrid,nets,nete,nph use fvm_mapping, only: dyn2phys type(hybrid_t), intent(in) :: hybrid - type(element_t), intent(inout), target :: elem(:) + type(element_t), intent(in) :: elem(:) type(derivative_t), intent(in) :: ederiv integer, intent(in) :: nets,nete,nphys integer, intent(in) :: tl,tlq From c67f137bca223253d8a06df6e5b3fb5207897d9f Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 5 Feb 2025 16:48:58 -0700 Subject: [PATCH 58/65] Address final reviewer comments --- bld/namelist_files/namelist_defaults_cam.xml | 4 --- bld/namelist_files/namelist_definition.xml | 6 ++-- src/physics/cam/gw_common.F90 | 35 ++++++++++---------- src/physics/cam/gw_drag.F90 | 14 ++------ src/physics/cam/gw_rdg.F90 | 1 + 5 files changed, 24 insertions(+), 36 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 37fb05f87d..cec2a5793f 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -837,10 +837,6 @@ 0.5D0 0.5D0 -JULIO -JULIO -JULIO - 0.03D0 diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 3add902e29..8a5194d653 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -1441,19 +1441,19 @@ Default: set by build-namelist. -Efficiency scaling factor associated with residual non-ridge topo +Efficiency scaling factor for moving mountain source Default: set by build-namelist. -Global steering level (Pa) for moving mtns. If neg do something else +Global steering level (Pa) for moving mtns. If negative steering level, it will be provided by future code Default: set by build-namelist. -Global launch level (Pa) for moving mtns. If neg do something else +Global launch level (Pa) for moving mtns. If negative launch level, it will be provided by future code Default: set by build-namelist. diff --git a/src/physics/cam/gw_common.F90 b/src/physics/cam/gw_common.F90 index b98d8155b8..a9897cb140 100644 --- a/src/physics/cam/gw_common.F90 +++ b/src/physics/cam/gw_common.F90 @@ -132,8 +132,7 @@ function new_GWBand(ngwv, dc, fcrit2, wavelength) result(band) ! Simple assignments. band%ngwv = ngwv band%dc = dc - !++jtb (12/24/2024) - ! This nonsesnse needs to be straightened out + ! For now just ensure fcrit is always set to 1 band%fcrit2 = 1.0_r8 ! fcrit2 @@ -150,7 +149,7 @@ end function new_GWBand !========================================================================== subroutine gw_common_init(pver_in, & - tau_0_ubc_in, ktop_in, gravit_in, rair_in, alpha_in, & + tau_0_ubc_in, ktop_in, gravit_in, rair_in, alpha_in, & prndl_in, qbo_hdepth_scaling_in, errstring) integer, intent(in) :: pver_in @@ -359,8 +358,8 @@ subroutine gw_drag_prof(ncol, band, p, src_level, tend_level, dt, & real(r8), intent(in), optional :: & kwvrdg(ncol) - ! Factor for saturation calculation. Here backwards - ! compatibility. I believe it should be 1.0 (jtb). + ! Factor for saturation calculation. Here backwards + ! compatibility. I believe it should be 1.0 (jtb). ! Looks like it has been 2.0 for a while in CAM. real(r8), intent(in), optional :: & satfac_in @@ -428,7 +427,7 @@ subroutine gw_drag_prof(ncol, band, p, src_level, tend_level, dt, & lapply_effgw = .TRUE. endif - + ! Lowest levels that loops need to iterate over. kbot_tend = maxval(tend_level) kbot_src = maxval(src_level) @@ -460,9 +459,9 @@ subroutine gw_drag_prof(ncol, band, p, src_level, tend_level, dt, & !------------------------------------------------------------------------ ! Loop from bottom to top to get stress profiles. - ! do k = kbot_src-1, ktop, -1 !++jtb I think this is right - do k = kbot_src, ktop, -1 !++ but this is in model now - + ! do k = kbot_src-1, ktop, -1 !++jtb I think this is right + do k = kbot_src, ktop, -1 !++ but this is in model now + ! Determine the diffusivity for each column. d = dback + kvtt(:,k) @@ -555,8 +554,8 @@ subroutine gw_drag_prof(ncol, band, p, src_level, tend_level, dt, & ! Write out pre-adjustment tau profile for diagnostc purposes. ! Current implementation only makes sense for orographic waves. - ! Fix later. - if (PRESENT(tau_diag)) then + ! Fix later. + if (PRESENT(tau_diag)) then tau_diag(:,:) = tau(:,0,:) end if @@ -595,11 +594,11 @@ subroutine gw_drag_prof(ncol, band, p, src_level, tend_level, dt, & ubtl = min(ubtl, umcfac * abs(c(:,l)-ubm(:,k)) / dt) if (.not. lapply_effgw) ubtl = min(ubtl, tndmax) - + where (k <= tend_level) ! Save tendency for each wave (for later computation of kzz). - ! sign function returns magnitude of ubtl with sign of c-ubm + ! sign function returns magnitude of ubtl with sign of c-ubm ! Renders ubt/ubm check for mountain waves unecessary gwut(:,k,l) = sign(ubtl, c(:,l)-ubm(:,k)) ubt(:,k) = ubt(:,k) + gwut(:,k,l) @@ -623,7 +622,7 @@ subroutine gw_drag_prof(ncol, band, p, src_level, tend_level, dt, & else ubt_lim_ratio = 1._r8 end if - + do l = -band%ngwv, band%ngwv gwut(:,k,l) = ubt_lim_ratio*gwut(:,k,l) ! Redetermine the effective stress on the interface below from the @@ -637,11 +636,11 @@ subroutine gw_drag_prof(ncol, band, p, src_level, tend_level, dt, & !-------------------------------------------------- where( abs(gwut(:,k,l)) < 1.e-15_r8 ) gwut(:,k,l) = 0._r8 - endwhere + endwhere where (k <= tend_level) - tau(:,l,k+1) = tau(:,l,k) + & - abs(gwut(:,k,l)) * p%del(:,k) / gravit + tau(:,l,k+1) = tau(:,l,k) + & + abs(gwut(:,k,l)) * p%del(:,k) / gravit end where end do @@ -869,7 +868,7 @@ subroutine momentum_fixer(tend_level, p, um_flux, vm_flux, utgw, vtgw) vtgw(:,k) = vtgw(:,k) + dv end where end do - + end subroutine momentum_fixer !========================================================================== diff --git a/src/physics/cam/gw_drag.F90 b/src/physics/cam/gw_drag.F90 index c403a25366..41d25db460 100644 --- a/src/physics/cam/gw_drag.F90 +++ b/src/physics/cam/gw_drag.F90 @@ -167,7 +167,7 @@ module gw_drag integer :: ttend_sh_idx = -1 integer :: frontgf_idx = -1 integer :: frontga_idx = -1 - + integer :: vort4gw_idx = -1 integer :: sgh_idx = -1 @@ -778,7 +778,7 @@ subroutine gw_init() call addfld('RHOIEGW', (/ 'ilev' /) , 'I' ,'kg/m^3' , & 'interface density in GW code ' ) call addfld('PINTEGW', (/ 'ilev' /) , 'I' ,'Pa' , & - 'interface density in GW code ' ) + 'interface air pressure in GW code ' ) call addfld('TAUM1_DIAG' , (/ 'ilev' /) , 'I' ,'N m-2' , & 'Ridge based momentum flux profile') @@ -798,7 +798,7 @@ subroutine gw_init() call addfld('SRC_LEVEL_RESIDBETA', horiz_only , 'I' ,'1' , & 'src level index for ridge residual ' ) call addfld('TAUORO_RESID', horiz_only , 'I' ,'N m-2' , & - 'Surface mom flux from ridge reisdual ' ) + 'Surface momentum flux from ridge residual ' ) call addfld('TAUDIAG_RESID' , (/ 'ilev' /) , 'I' ,'N m-2' , & 'Ridge based momentum flux profile') @@ -975,14 +975,6 @@ subroutine gw_init() end if end do - if (masterproc) then - write (iulog,*) 'MOVMTN K_STEER =', movmtn_ksteer - write (iulog,*) 'MOVMTN K_LAUNCH =', movmtn_klaunch - write (iulog,*) 'K_STEER hardw =', pver - 20 !++ ????? - write (iulog,*) 'K_LAUNCH hardw =', pver - 20 - 10 !++ ????? - write(iulog,*) ' ' - end if - end if if (use_gw_movmtn_pbl) then diff --git a/src/physics/cam/gw_rdg.F90 b/src/physics/cam/gw_rdg.F90 index b6e046a4c1..4e91db565a 100644 --- a/src/physics/cam/gw_rdg.F90 +++ b/src/physics/cam/gw_rdg.F90 @@ -349,6 +349,7 @@ subroutine gw_rdg_resid_src(ncol, band, p, & ! Determine the orographic c=0 source term following McFarlane (1987). + ! (DOI: https://doi.org/10.1175/1520-0469(1987)044<1775:TEOOEG>2.0.CO;2) ! Set the source top interface index to pver, if the orographic term is ! zero. do i = 1, ncol From 2f2991d16081a6391bb2cc24f1d3f1722bef7d04 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 6 Feb 2025 10:39:07 -0700 Subject: [PATCH 59/65] Fix bug for WACCM tests --- src/physics/cam/gw_convect.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/physics/cam/gw_convect.F90 b/src/physics/cam/gw_convect.F90 index 56fdc7eebd..311865b499 100644 --- a/src/physics/cam/gw_convect.F90 +++ b/src/physics/cam/gw_convect.F90 @@ -179,7 +179,7 @@ subroutine gw_beres_src(ncol, band, desc, u, v, & do i = 1, ncol if (topi(i) == 0) then ! First spot where heating rate is positive. - if ((netdt(i,k) > 0.0_r8) .AND. (zm(i,k) <= 20000._r8)) topi(i) = k + if ((netdt(i,k) > 0.0_r8) .AND. (zm(i,k) <= 20000._r8)) topi(i) = k-1 end if end do ! When all done, exit @@ -286,7 +286,7 @@ subroutine gw_beres_src(ncol, band, desc, u, v, & ! Adjust for critical level filtering. tau0(Umini(i):Umaxi(i)) = 0.0_r8 - + tau(i,:,topi(i)+1) = tau0 end if ! heating depth above min and not at the pole From 527f32387bfc43de917af8238d3adbfddc2da916 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 6 Feb 2025 14:46:05 -0700 Subject: [PATCH 60/65] Update ChangeLog for cam6_4_061 --- doc/ChangeLog | 131 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 127 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 34f280f5b8..cddab13e46 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,12 +1,135 @@ + +=============================================================== + +Tag name: cam6_4_061 +Originator(s): liyptardis, PeterHjortLauritzen, cacraig +Date: Feb 6, 2025 + One-line Summary: fix heating depth bug for gravity wave parameterization +Github PR URL: https://github.com/ESCOMP/CAM/pull/1232 Purpose of changes (include the issue number and title text for each relevant GitHub issue): + - Gravity wave scheme fails to catch the right maximum latent heating rate and convective top from the ZM scheme. + This PR fixes that isuue. (Github issue #1229) + +Describe any changes made to build system: N/A + +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: nusbaume, liyptardis + +List all files eliminated: N/A + +List all files added and what they do: N/A + +List all existing files that have been modified, and describe the changes: +M src/physics/cam/gw_convect.F90 + - fix heating depth + +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) + 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 -Gravity wave scheme fails to catch the right maximum latent heating rate and convective top from the ZM scheme. -This PR fixes that isuue. -(Github issue #1229) + 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 -Expect baseline differences for CAM7 and WACCM tests + ERC_D_Ln9.f19_f19_mg17.QPX2000.derecho_intel.cam-outfrq3s (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPLT.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPMT.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details: + ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details: + ERP_Lh12.f19_f19_mg17.FW4madSD.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details: + SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: + SMS_D_Ln9.ne16_ne16_mg17.QPX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne16pg3_ne16pg3_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details: + SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details: + SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + - Expect baseline differences + +derecho/nvhpc/aux_cam: + ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) + - pre-existing failure -- issue #1220 + +izumi/nag/aux_cam: + ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-carma_sea_salt (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_cosp (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_subcol (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QSPCAMS.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.mpasa480z32_mpasa480.FHS94.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details: + ERC_D_Ln9.ne16_ne16_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details: + ERC_D_Ln9.ne16pg3_ne16pg3_mg17.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details: + ERC_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-outfrq3s_ttrac (Overall: DIFF) details: + ERC_D_Ln9.T5_T5_mg37.QPC4.izumi_nag.cam-outfrq3s_usecase (Overall: DIFF) details: + ERI_D_Ln18.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details: + ERI_D_Ln18.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details: + ERI_D_Ln18.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: DIFF) details: + ERI_D_Ln18.ne5pg3_ne5pg3_mg37.FADIAB.izumi_nag.cam-outfrq3s_bwic (Overall: DIFF) details: + ERP_Ln9.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details: + ERS_Ln27.ne5pg3_ne5pg3_mg37.FKESSLER.izumi_nag.cam-outfrq9s (Overall: DIFF) details: + ERS_Ln9.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq9s (Overall: DIFF) details: + PEM_D_Ln9.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details: + PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details: + PLB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details: + PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal0 (Overall: DIFF) details: + PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal1 (Overall: DIFF) details: + PLB_D_Ln9.ne5_ne5_mg37.QPC5.izumi_nag.cam-ttrac_loadbal3 (Overall: DIFF) details: + SMS_D_Ld2.f45_f45_mg37.PC5.izumi_nag.cam-outfrq24h_port (Overall: DIFF) details: + SMS_D_Ln3.ne5pg3_ne5pg3_mg37.QPX2000.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + SMS_D_Ln6.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details: + SMS_D_Ln7.T42_T42_mg17.QPSCAMC5.izumi_nag.cam-scmarm (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-rad_diag_mam (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF) details: + SMS_D_Ln9_P1x1.ne5_ne5_mg37.FADIAB.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + SMS_P48x1_D_Ln3.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details: + SUB_D_Ln9.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + TMC_D.f10_f10_mg37.QPC5.izumi_nag.cam-outfrq3s_eoyttrac (Overall: DIFF) details: + TMC_D.T5_T5_mg37.QPC5.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details: + - Expect baseline differences + + +izumi/gnu/aux_cam: + ERC_D_Ln9.f10_f10_mg37.QPC4.izumi_gnu.cam-outfrq3s_diags (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.FLTHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPLT.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPMT.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9_P24x2.f45_f45_mg37.QPWmaC6.izumi_gnu.cam-outfrq9s_mee_fluxes (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.QPWmaC4.izumi_gnu.cam-outfrq9s_apmee (Overall: DIFF) details: + SMS_P48x1_D_Ln9.f19_f19_mg17.FW4madSD.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + - Expect baseline differences + +=============================================================== =============================================================== Tag name: cam6_4_060 From 56c909d2d54c287b1aca156518dfae0c58208365 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 7 Feb 2025 12:04:09 -0700 Subject: [PATCH 61/65] Update ChangeLog for cam6_4_062 --- doc/ChangeLog | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index cddab13e46..b7ccd3b6e8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,109 @@ =============================================================== +Tag name: cam6_4_062 +Originator(s): juliob, cacraig, PeterHjortLauritzen +Date: Feb 7, 2025 +One-line Summary: Phase 2 of GW development +Github PR URL: https://github.com/ESCOMP/CAM/pull/1117 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + - Continuing development of gravity wave parameterization (//github.com/ESCOMP/CAM/issues/1115) + - Added vorticity calculation to SE dycore. Vorticity is passed to the gravity wave (GW) scheme in + model physics to provide a possible source for ‘moving mountain’ GW, i.e., low-phase speed GW forced + by atmospheric circulations. This provides another forcing option, in addition to boundary layer + momentum flux implemented earlier. Vorticity anomalies as sources for GW have been proposed by other + researchers in published papers. + +Describe any changes made to build system: N/A + +Describe any changes made to the namelist: + - Added the following namelist options + - use_gw_rdg_resid + - effgw_movmtn_pbl + - movmtn_source + - movmtn_psteer + - movmtn_plaunch + - effgw_rdg_resid + +List any changes to the defaults for the boundary datasets: N/A + +Describe any substantial timing or memory changes: N/A + +Code reviewed by: nusbaume, PeterHjortLauritzen + +List all files eliminated: N/A + +List all files added and what they do: N/A + +List all existing files that have been modified, and describe the changes: +M bld/build-namelist +M bld/namelist_files/namelist_defaults_cam.xml +M bld/namelist_files/namelist_definition.xml + - added new GW namelist settings (see above) + +M src/dynamics/se/dp_coupling.F90 +M src/dynamics/se/dyn_comp.F90 +M src/dynamics/se/gravity_waves_sources.F90 +M src/physics/cam/gw_common.F90 +M src/physics/cam/gw_drag.F90 +M src/physics/cam/gw_movmtn.F90 +M src/physics/cam/gw_rdg.F90 + - See description listed above + +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) + 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 + + 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_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPLT.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPMT.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details: + SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + - Answer changes expected for CAM7 runs + +derecho/nvhpc/aux_cam: + ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) + - pre-existing failure -- issue #1220 + +izumi/nag/aux_cam: All BFB + +izumi/gnu/aux_cam: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.FLTHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPLT.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPMT.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + - Answer changes expected for CAM7 runs + +Summarize any changes to answers, i.e., +- what code configurations: All CAM7 +- what platforms/compilers: All +- nature of change (roundoff; larger than roundoff but same climate; new + climate): new climate when GW namelists are set + +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., + - Simulations were made by Julio Bacmeister and were presented at AMWG + - Dave Lawrence presented results to the SCC at their January meeting + +=============================================================== + +=============================================================== + Tag name: cam6_4_061 Originator(s): liyptardis, PeterHjortLauritzen, cacraig Date: Feb 6, 2025 From de302e6e535752059cdee637074c00e5a2d9fef5 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 7 Feb 2025 14:38:05 -0700 Subject: [PATCH 62/65] Update namelist settings --- bld/namelist_files/namelist_defaults_cam.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index e4ee34e115..d0c27f677b 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2164,7 +2164,7 @@ 0.1 0.5 4.2 - 4.25 + 4.5 0.0 1.0 0.1 @@ -2528,7 +2528,7 @@ 0.55D0 0.22D0 0.70D0 -1.30D0 +2.30D0 0.8D0 0.8D0 0.8D0 @@ -2563,7 +2563,7 @@ 0.9D0 -Zender_2003 +Leung_2023 atm @@ -2572,7 +2572,7 @@ 1.62D0 0.90D0 1.00D0 -0.75D0 +1.50D0 1.10D0 1.2D0 0.60D0 From a1b5274f6fa8f600aad45db77a150f8a6c37aa07 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 7 Feb 2025 15:24:03 -0700 Subject: [PATCH 63/65] Address review comments --- bld/namelist_files/namelist_defaults_cam.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index d0c27f677b..8ab86672a1 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2529,6 +2529,7 @@ 0.22D0 0.70D0 2.30D0 +2.30D0 0.8D0 0.8D0 0.8D0 @@ -2563,7 +2564,8 @@ 0.9D0 -Leung_2023 + Zender_2003 + Leung_2023 atm From 2f2d047a2efdbe928e49467ca5053d4772f9e05a Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 7 Feb 2025 15:58:48 -0700 Subject: [PATCH 64/65] Change all dust_emis_fact which are cam7 to new default --- bld/namelist_files/namelist_defaults_cam.xml | 38 ++++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 8ab86672a1..c7239134ba 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2516,13 +2516,13 @@ 0.45D0 0.45D0 0.35D0 -1.30D0 +2.30D0 0.30D0 -0.30D0 +2.30D0 0.45D0 -0.45D0 +2.30D0 0.45D0 -0.45D0 +2.30D0 0.45D0 0.55D0 @@ -2531,37 +2531,37 @@ 2.30D0 2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.8D0 -0.8D0 +2.30D0 0.70D0 -0.70D0 +2.300D0 0.13D0 0.26D0 -0.26D0 +2.30D0 0.7D0 -0.7D0 +2.30D0 0.24D0 -0.24D0 +2.30D0 0.9D0 -0.9D0 +2.30D0 Zender_2003 From 0a7aac56098847710b15165cfc73dd54cd7a642b Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Sun, 9 Feb 2025 21:35:02 -0700 Subject: [PATCH 65/65] Update ChangeLog for cam6_4_063 --- doc/ChangeLog | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index b7ccd3b6e8..570d28ad94 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,73 @@ =============================================================== +Tag name: cam6_4_063 +Originator(s): cacraig, PeterHjortLauritzen +Date: Feb 9, 2025 +One-line Summary: Update namelist settings for beta06 +Github PR URL: https://github.com/ESCOMP/CAM/pull/1252 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + - Namelist changes for CAM7: https://github.com/ESCOMP/CAM/issues/1251 + - Need new dust-related namelist settings on by default: https://github.com/ESCOMP/CAM/1249 + +Describe any changes made to build system: N/A + +Describe any changes made to the namelist: + - Change namelist settings for seasalt_emis_scale, clubb_c8, dust_emis_method and dust_emis_fact + +List any changes to the defaults for the boundary datasets: N/A + +Describe any substantial timing or memory changes: N/A + +Code reviewed by: PeterHjortLauritzen, adamrher, ekluzek + +List all files eliminated: N/A + +List all files added and what they do: N/A + +List all existing files that have been modified, and describe the changes: +M bld/namelist_files/namelist_defaults_cam.xml + - Change namelist settings for seasalt_emis_scale, clubb_c8, dust_emis_method and dust_emis_fact + +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) + 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 + + 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_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPLT.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.QPMT.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ld3.ne30pg3_ne30pg3_mg17.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details: + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details: + - All CAM7 runs will have answer changes (NLCOMP differences for these runs as well) + +derecho/nvhpc/aux_cam: + ERS_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) + - pre-existing failure -- issue #1220 + +izumi/nag/aux_cam: All BFB + +izumi/gnu/aux_cam: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.FLTHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPLT.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPMT.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + - All CAM7 runs will have answer changes (NLCOMP differences for these runs as well) + +=============================================================== + +=============================================================== + Tag name: cam6_4_062 Originator(s): juliob, cacraig, PeterHjortLauritzen Date: Feb 7, 2025