Skip to content

Commit

Permalink
Merge branch 'ew-develop' into 'ew-main' for v2.3 release (PR#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdicker1 committed Aug 1, 2024
2 parents 3b3fd65 + 25be110 commit 2625f37
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ required = True
[mpas]
local_path = src/dynamics/mpas/dycore
protocol = git
repo_url = https://github.com/EarthWorksOrg/MPAS-Model.git
repo_url = https://github.com/MPAS-Dev/MPAS-Model.git
sparse = ../.mpas_sparse_checkout
tag = release-mpasa-ew2.2
hash = ff76a231
required = True

[geoschem]
Expand All @@ -90,7 +90,7 @@ externals = Externals_HCO.cfg
local_path = src/physics/rrtmgp/ext
protocol = git
repo_url = https://github.com/EarthWorksOrg/rte-rrtmgp.git
tag = v1.7_ew_release_2.2
tag = v1.7_ew_release_2.3
required = True

[rrtmgp-data]
Expand Down
4 changes: 2 additions & 2 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -3747,7 +3747,7 @@ if (!$simple_phys) {
}

if ($waccm_phys or
(!$simple_phys and $cfg->get('nlev') >= 60)) {
(!$simple_phys and $cfg->get('nlev') >= 60) and $dyn !~ /mpas/) {
# Spectral gravity waves are part of WACCM physics, and also drive the
# QBO in the high vertical resolution configuration.
add_default($nl, 'use_gw_front' , 'val'=>'.true.');
Expand All @@ -3770,7 +3770,7 @@ if ($waccm_phys or
}
add_default($nl, 'gw_qbo_hdepth_scaling', 'val'=>$hdepth_scaling);
add_default($nl, 'gw_top_taper');
} elsif ($phys =~ /cam_dev/) {
} elsif ($phys =~ /cam_dev/ and $dyn !~ /mpas/) {
# cam_dev settings for nlev<60 (Other cam_dev set above)
add_default($nl, 'use_gw_front' , 'val'=>'.true.');
add_default($nl, 'use_gw_convect_dp', 'val'=>'.true.');
Expand Down
24 changes: 12 additions & 12 deletions bld/namelist_files/namelist_defaults_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,19 @@
<ncdata hgrid="mpasa120" nlev="70" waccm_phys="1">atm/waccm/ic/mpasa120km.waccm_fulltopo_c220818.nc</ncdata>

<ncdata hgrid="mpasa480" nlev="32" ic_ymd="20000101" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa480_L32_CFSR_c211013.nc</ncdata>
<ncdata hgrid="mpasa480" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa480_L32_CFSR_c240508.nc</ncdata>
<!-- <ncdata hgrid="mpasa480" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa480_L32_CFSR_c240508.nc</ncdata> -->
<ncdata hgrid="mpasa120" nlev="32" ic_ymd="20000101" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa120_L32_CFSR_c210426.nc</ncdata>
<ncdata hgrid="mpasa120" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa120_L32_CFSR_c240508.nc</ncdata>
<!-- <ncdata hgrid="mpasa120" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa120_L32_CFSR_c240508.nc</ncdata> -->
<!-- Next 4 entries are EarthWorks specific, real-data ICs -->
<ncdata hgrid="mpasa60" nlev="32" ic_ymd="20000101" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa60_L32_CFSR_c210518.nc</ncdata>
<ncdata hgrid="mpasa60" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa60_L32_CFSR_c240508.nc</ncdata>
<!-- <ncdata hgrid="mpasa60" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa60_L32_CFSR_c240508.nc</ncdata> -->
<ncdata hgrid="mpasa30" nlev="32" ic_ymd="20000101" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa30_L32_CFSR_230302.nc</ncdata>
<ncdata hgrid="mpasa60" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa30_L32_CFSR_c240508.nc</ncdata>
<!-- <ncdata hgrid="mpasa60" nlev="32" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa30_L32_CFSR_c240508.nc</ncdata> -->
<!-- Next 4 entries are EarthWorks specific, 58 vertical levels -->
<ncdata hgrid="mpasa120" nlev="58" ic_ymd="20000101">atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa120_L58_c230901.nc</ncdata>
<ncdata hgrid="mpasa120" nlev="58" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa120_L58_CFSR_c240508.nc</ncdata>
<!-- <ncdata hgrid="mpasa120" nlev="58" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa120_L58_CFSR_c240508.nc</ncdata> -->
<ncdata hgrid="mpasa15" nlev="58" ic_ymd="20000101">atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa15_L58_c230316.nc</ncdata>
<ncdata hgrid="mpasa15" nlev="58" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa15_L58_CFSR_c240508.nc</ncdata>
<!-- <ncdata hgrid="mpasa15" nlev="58" ic_ymd="20000101" phys="cam_dev" >atm/cam/inic/mpas/cami_01-01-2000_00Z_mpasa15_L58_CFSR_c240508.nc</ncdata> -->

<!-- Topography -->
<bnd_topo hgrid="256x512" >atm/cam/topo/topo-from-cami_0000-01-01_256x512_L26_c030918.nc</bnd_topo>
Expand Down Expand Up @@ -357,19 +357,19 @@
<bnd_topo hgrid="ne0np4.ARCTICGRIS.ne30x8" >atm/cam/topo/se/ne30x8_ARCTICGRIS_nc3000_Co060_Fi001_MulG_PF_RR_Nsw042_c200428.nc</bnd_topo>

<bnd_topo hgrid="mpasa480" >atm/cam/topo/mpas_480_nc3000_Co240_Fi001_MulG_PF_Nsw170.nc</bnd_topo>
<bnd_topo hgrid="mpasa480" phys="cam_dev" >atm/cam/topo/mpas/mpasa480_gmted2010_modis_bedmachine_nc3000_Laplace0400_noleak_20240507.nc</bnd_topo>
<!-- <bnd_topo hgrid="mpasa480" phys="cam_dev" >atm/cam/topo/mpas/mpasa480_gmted2010_modis_bedmachine_nc3000_Laplace0400_noleak_20240507.nc</bnd_topo> -->
<bnd_topo hgrid="mpasa120" >atm/cam/topo/mpas/mpas_120_nc3000_Co060_Fi001_MulG_PF_Nsw042_c200921.nc</bnd_topo>
<bnd_topo hgrid="mpasa120" phys="cam_dev" >atm/cam/topo/mpas/mpasa120_gmted2010_modis_bedmachine_nc3000_Laplace0100_noleak_20240507.nc</bnd_topo>
<!-- <bnd_topo hgrid="mpasa120" phys="cam_dev" >atm/cam/topo/mpas/mpasa120_gmted2010_modis_bedmachine_nc3000_Laplace0100_noleak_20240507.nc</bnd_topo> -->
<!-- Next 3 entires are EarthWorks specific, for real-data cases not in ESCOMP/CAM -->
<bnd_topo hgrid="mpasa60" >atm/cam/topo/mpas_60_nc3000_Co030_Fi001_MulG_PF_Nsw021.nc</bnd_topo>
<bnd_topo hgrid="mpasa60" phys="cam_dev" >atm/cam/topo/mpas/mpasa60_gmted2010_modis_bedmachine_nc3000_Laplace0050_noleak_20240507.nc</bnd_topo>
<!-- <bnd_topo hgrid="mpasa60" phys="cam_dev" >atm/cam/topo/mpas/mpasa60_gmted2010_modis_bedmachine_nc3000_Laplace0050_noleak_20240507.nc</bnd_topo> -->
<bnd_topo hgrid="mpasa30" >atm/cam/topo/mpas_30_nc3000_Co015_Fi001_MulG_PF_Nsw011.nc</bnd_topo>
<bnd_topo hgrid="mpasa30" phys="cam_dev" >atm/cam/topo/mpas/mpasa30_gmted2010_modis_bedmachine_nc3000_Laplace0025_noleak_20240507.nc</bnd_topo>
<!-- <bnd_topo hgrid="mpasa30" phys="cam_dev" >atm/cam/topo/mpas/mpasa30_gmted2010_modis_bedmachine_nc3000_Laplace0025_noleak_20240507.nc</bnd_topo> -->
<bnd_topo hgrid="mpasa15" >atm/cam/topo/mpas_15_nc3500_c20230315.nc</bnd_topo>
<bnd_topo hgrid="mpasa15" phys="cam_dev" >atm/cam/topo/mpas/mpasa15_gmted2010_modis_bedmachine_nc3000_Laplace0013_noleak_20240507.nc</bnd_topo>
<!-- <bnd_topo hgrid="mpasa15" phys="cam_dev" >atm/cam/topo/mpas/mpasa15_gmted2010_modis_bedmachine_nc3000_Laplace0013_noleak_20240507.nc</bnd_topo> -->
<!-- Corresponds to cami_01-01-2000_00Z_mpasa120_L58_c230901.nc file -->
<bnd_topo hgrid="mpasa120" nlev="58" >atm/cam/topo/mpasa120_gmted2010_modis_bedmachine_nc3000_Laplace0100_20220728.nc</bnd_topo>
<bnd_topo hgrid="mpasa120" nlev="58" phys="cam_dev" >atm/cam/topo/mpas/mpasa120_gmted2010_modis_bedmachine_nc3000_Laplace0100_noleak_20240507.nc</bnd_topo>
<!-- <bnd_topo hgrid="mpasa120" nlev="58" phys="cam_dev" >atm/cam/topo/mpas/mpasa120_gmted2010_modis_bedmachine_nc3000_Laplace0100_noleak_20240507.nc</bnd_topo> -->

<!-- Scale Dry Air Mass: 0=> no scaling / +nnn=>scale to nnn Pressure -->
<scale_dry_air_mass > 0.0D0 </scale_dry_air_mass>
Expand Down
39 changes: 39 additions & 0 deletions src/physics/rrtmgp/radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,13 @@ subroutine radiation_tend( &

! Compute the gas optics (stored in atm_optics_sw).
! toa_flux is the reference solar source from RRTMGP data.
!$acc data copyin(kdist_sw,pmid_day,pint_day,t_day,gas_concs_sw) &
!$acc copy(atm_optics_sw) &
!$acc copyout(toa_flux)
errmsg = kdist_sw%gas_optics( &
pmid_day, pint_day, t_day, gas_concs_sw, atm_optics_sw, &
toa_flux)
!$acc end data
call stop_on_err(errmsg, sub, 'kdist_sw%gas_optics')

! Scale the solar source
Expand All @@ -1174,6 +1178,17 @@ subroutine radiation_tend( &

if (nday > 0) then

!! ADDED by SS as part of RRTMGP data optimization
!$acc data copyin(atm_optics_sw, toa_flux, &
!$acc aer_sw, cloud_sw, &
!$acc aer_sw%tau, aer_sw%ssa, aer_sw%g, &
!$acc atm_optics_sw%tau, &
!$acc atm_optics_sw%ssa, atm_optics_sw%g, &
!$acc cloud_sw%tau, cloud_sw%ssa, cloud_sw%g, &
!$acc alb_dir, alb_dif,coszrs_day) &
!$acc copy(fswc, fswc%flux_net,fswc%flux_up,fswc%flux_dn, &
!$acc fsw, fsw%flux_net, fsw%flux_up, fsw%flux_dn)

! Increment the gas optics (in atm_optics_sw) by the aerosol optics in aer_sw.
errmsg = aer_sw%increment(atm_optics_sw)
call stop_on_err(errmsg, sub, 'aer_sw%increment')
Expand All @@ -1193,6 +1208,7 @@ subroutine radiation_tend( &
atm_optics_sw, top_at_1, coszrs_day, toa_flux, &
alb_dir, alb_dif, fsw)
call stop_on_err(errmsg, sub, 'all-sky rte_sw')
!$acc end data

end if

Expand Down Expand Up @@ -1249,14 +1265,36 @@ subroutine radiation_tend( &
call rrtmgp_set_gases_lw(icall, state, pbuf, nlay, gas_concs_lw)

! Compute the gas optics and Planck sources.
!$acc data copyin(kdist_lw,pmid_rad,pint_rad,t_rad,t_sfc, &
!$acc gas_concs_lw) &
!$acc copy(atm_optics_lw, &
!$acc atm_optics_lw%tau, sources_lw, &
!$acc sources_lw%lay_source, sources_lw%sfc_source, &
!$acc sources_lw%lev_source_inc, sources_lw%lev_source_dec, &
!$acc sources_lw%sfc_source_jac)
errmsg = kdist_lw%gas_optics( &
pmid_rad, pint_rad, t_rad, t_sfc, gas_concs_lw, &
atm_optics_lw, sources_lw)
call stop_on_err(errmsg, sub, 'kdist_lw%gas_optics')
!$acc end data

! Set LW aerosol optical properties in the aer_lw object.
call rrtmgp_set_aer_lw(icall, state, pbuf, aer_lw)

!! Added by SS as part of RRTMGP data optimization
!$acc data copyin(atm_optics_lw, aer_lw, cloud_lw, &
!$acc aer_lw%tau, &
!$acc atm_optics_lw%tau, &
!$acc cloud_lw%tau, &
!$acc sources_lw, &
!$acc sources_lw%lay_source, sources_lw%sfc_source, &
!$acc sources_lw%lev_source_inc, sources_lw%lev_source_dec, &
!$acc sources_lw%sfc_source_Jac, &
!$acc emis_sfc) &
!$acc copy(flwc, flwc%flux_net,flwc%flux_up,flwc%flux_dn, &
!$acc flw, flw%flux_net, flw%flux_up, flw%flux_dn)


! Increment the gas optics by the aerosol optics.
errmsg = aer_lw%increment(atm_optics_lw)
call stop_on_err(errmsg, sub, 'aer_lw%increment')
Expand All @@ -1272,6 +1310,7 @@ subroutine radiation_tend( &
! Compute all-sky LW fluxes
errmsg = rte_lw(atm_optics_lw, top_at_1, sources_lw, emis_sfc, flw)
call stop_on_err(errmsg, sub, 'all-sky rte_lw')
!$acc end data

! Transform RRTMGP outputs to CAM outputs and compute heating rates.
call set_lw_diags()
Expand Down

0 comments on commit 2625f37

Please sign in to comment.