Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cam6_3_071: Updates to deposition module in share code externals #602

Merged
merged 19 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ externals = Externals.cfg
required = True

[cmeps]
tag = cmeps0.13.65
tag = cmeps0.13.70
protocol = git
repo_url = https://github.com/ESCOMP/CMEPS.git
local_path = components/cmeps
Expand All @@ -36,14 +36,14 @@ externals = Externals_CDEPS.cfg
required = True

[cpl7]
tag = cpl7.0.12
tag = cpl7.0.14
protocol = git
repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps
local_path = components/cpl7
required = True

[share]
tag = share1.0.11
tag = share1.0.12
protocol = git
repo_url = https://github.com/ESCOMP/CESM_share
local_path = share
Expand Down
1 change: 1 addition & 0 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ if ($chem) {
if ($chem =~ /_mam/ and ($dyn =~ /se|fv3|mpas/)) {
add_default($nl, 'drydep_srf_file');
}
add_default($nl, 'dep_data_file');
}

# Initial conditions
Expand Down
3 changes: 3 additions & 0 deletions bld/namelist_files/namelist_defaults_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,9 @@
<depvel_lnd_file>atm/cam/chem/trop_mozart/dvel/regrid_vegetation.nc</depvel_lnd_file>
<depvel_lnd_file aquaplanet="1" >atm/cam/chem/trop_mozart/dvel/regrid_vegetation_all_zero_aquaplanet_1deg_regularGrid_c20170421.nc</depvel_lnd_file>

<!-- effective Henry's coef data for wet and dry deposition -->
<dep_data_file>atm/cam/chem/trop_mozart/dvel/dep_data_c201019.nc</dep_data_file>
cacraigucar marked this conversation as resolved.
Show resolved Hide resolved

<!-- photolysis inputs -->
<xs_coef_file>atm/waccm/phot/effxstex.txt</xs_coef_file>
<xs_short_file>atm/waccm/phot/xs_short_jpl10_c140303.nc</xs_short_file>
Expand Down
7 changes: 7 additions & 0 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7052,6 +7052,13 @@ List of species that undergo dry deposition.
Default: set by build-namelist.
</entry>

<entry id="dep_data_file" type="char*500" input_pathname="abs" category="dry_deposition"
group="drydep_inparm" valid_values="" >
Full pathname of file containing gas phase deposition data including effective
Henry's law coefficients.
Default: set by build-namelist.
</entry>

<entry id="rxn_rate_sums" type="char*256(200)" category="cam_chem"
group="rxn_rate_diags_nl" valid_values="" >
Give the user the ability to specify rate families (or groupings) diagnostics based
Expand Down
16 changes: 8 additions & 8 deletions cime_config/config_pes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,14 +1026,14 @@
<pes pesize="any" compset="_CAM\d0%WX">
<comment>none</comment>
<ntasks>
<ntasks_atm>720</ntasks_atm>
<ntasks_lnd>720</ntasks_lnd>
<ntasks_rof>720</ntasks_rof>
<ntasks_ice>720</ntasks_ice>
<ntasks_ocn>720</ntasks_ocn>
<ntasks_glc>720</ntasks_glc>
<ntasks_wav>720</ntasks_wav>
<ntasks_cpl>720</ntasks_cpl>
<ntasks_atm>864</ntasks_atm>
<ntasks_lnd>864</ntasks_lnd>
<ntasks_rof>864</ntasks_rof>
<ntasks_ice>864</ntasks_ice>
<ntasks_ocn>864</ntasks_ocn>
<ntasks_glc>864</ntasks_glc>
<ntasks_wav>864</ntasks_wav>
<ntasks_cpl>864</ntasks_cpl>
</ntasks>
<nthrds>
<nthrds_atm>1</nthrds_atm>
Expand Down
6 changes: 3 additions & 3 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
</test>
<test compset="QPX2000" grid="ne5pg3_ne5pg3_mg37" name="SMS_D_Ln3_Vnuopc" testmods="cam/outfrq3s">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_cam"/>
<machine name="izumi" compiler="nag" category="aux_cam"/>
<machine name="izumi" compiler="nag" category="waccmx"/>
</machines>
<options>
Expand Down Expand Up @@ -2156,7 +2156,7 @@
<option name="wallclock">00:50:00</option>
</options>
</test>
<test compset="FXHIST" grid="f09_f09_mg17" name="SMS_D_Ln9_Vnuopc" testmods="cam/waccmx_weimer">
<test compset="FXHIST" grid="f09_f09_mg17" name="SMS_D_Ln9_Vnuopc_P384x3" testmods="cam/waccmx_weimer">
<machines>
<machine name="cheyenne" compiler="intel" category="waccmx"/>
</machines>
Expand Down Expand Up @@ -2304,7 +2304,7 @@
<test compset="FW4madSD" grid="f19_f19_mg17" name="SMS_P48x1_D_Ln9_Vnuopc" testmods="cam/outfrq9s" supported="false">
<machines>
<machine name="izumi" compiler="nag" category="waccm"/>
<machine name="izumi" compiler="nag" category="aux_cam"/>
<machine name="izumi" compiler="gnu" category="aux_cam"/>
</machines>
<options>
<option name="wallclock">00:40:00</option>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
./xmlchange RUN_STARTDATE=2005-12-31
./xmlchange ROF_NCPL=\$ATM_NCPL
251 changes: 251 additions & 0 deletions doc/ChangeLog

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions src/chemistry/mozart/mo_chemini.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ subroutine chemini &
use mo_photo, only : photo_inti
use mo_lightning, only : lightning_inti
use mo_drydep, only : drydep_inti
use seq_drydep_mod, only : DD_XLND, drydep_method
use mo_imp_sol, only : imp_slv_inti
use mo_exp_sol, only : exp_sol_inti
use spmd_utils, only : iam
Expand Down Expand Up @@ -171,11 +170,7 @@ subroutine chemini &
!-----------------------------------------------------------------------
! ... initialize the dry deposition module
!-----------------------------------------------------------------------
if ( drydep_method == DD_XLND ) then
call drydep_inti(depvel_lnd_file)
else
call endrun('chemini: drydep_method must equal DD_XLND')
endif
call drydep_inti(depvel_lnd_file)

if (masterproc) write(iulog,*) 'chemini: after drydep_inti on node ',iam

Expand Down
10 changes: 5 additions & 5 deletions src/chemistry/mozart/mo_drydep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module mo_drydep
use dyn_grid, only : get_dyn_grid_parm, get_horiz_grid_d
use scamMod, only : single_column

use seq_drydep_mod, only : nddvels => n_drydep, drydep_list, mapping
use shr_drydep_mod, only : nddvels => n_drydep, drydep_list, mapping
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might remove the spaces between only and : here in order to better match the CAM style guide.

use physconst, only : karman

use infnan, only : nan, assignment(=)
Expand Down Expand Up @@ -251,7 +251,7 @@ subroutine drydep_fromlnd( ocnfrac, icefrac, sfc_temp, pressure_sfc, &
!-------------------------------------------------------------------------------------
! ... assign CO tags to CO
! put this kludge in for now ...
! -- should be able to set all these via the table mapping in seq_drydep_mod
! -- should be able to set all these via the table mapping in shr_drydep_mod
!-------------------------------------------------------------------------------------
if( cohc_ndx>0 .and. co_ndx>0 ) then
dvelocity(:ncol,cohc_ndx) = dvelocity(:ncol,co_ndx)
Expand Down Expand Up @@ -825,8 +825,8 @@ subroutine drydep_xactive( sfc_temp, pressure_sfc, &
! modified by JFL to be used in MOZART-2 (October 2002)
!-------------------------------------------------------------------------------------

use seq_drydep_mod, only: z0, rgso, rgss, ri, rclo, rcls, rlu, rac
use seq_drydep_mod, only: seq_drydep_setHCoeff, foxd, drat
use shr_drydep_mod, only: z0, rgso, rgss, ri, rclo, rcls, rlu, rac
use shr_drydep_mod, only: shr_drydep_setHCoeff, foxd, drat
use physconst, only: tmelt

!-------------------------------------------------------------------------------------
Expand Down Expand Up @@ -969,7 +969,7 @@ subroutine drydep_xactive( sfc_temp, pressure_sfc, &
!-------------------------------------------------------------------------------------
! define species-dependent parameters (temperature dependent)
!-------------------------------------------------------------------------------------
call seq_drydep_setHCoeff( ncol, sfc_temp, heff )
call shr_drydep_setHCoeff( ncol, sfc_temp, heff )

do lt = 1,n_land_type
dep_ra (:,lt,lchnk) = 0._r8
Expand Down
39 changes: 18 additions & 21 deletions src/chemistry/mozart/mo_neu_wetdep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module mo_neu_wetdep
use constituents, only : pcnst
use spmd_utils, only : masterproc
use cam_abortutils, only : endrun
use seq_drydep_mod, only : n_species_table, species_name_table, dheff
use shr_drydep_mod, only : n_species_table, species_name_table, dheff
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might remove the spaces between only and : here in order to better match the CAM style guide.

use gas_wetdep_opts, only : gas_wetdep_method, gas_wetdep_list, gas_wetdep_cnt
!
implicit none
Expand Down Expand Up @@ -214,10 +214,10 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, &
prain, nevapr, cld, cmfdqr, wd_tend, wd_tend_int)
!
use ppgrid, only : pcols, pver
!!DEK
use phys_grid, only : get_area_all_p, get_rlat_all_p
use shr_const_mod, only : SHR_CONST_REARTH,SHR_CONST_G
use cam_history, only : outfld
use shr_const_mod, only : pi => shr_const_pi
!
implicit none
!
Expand All @@ -238,7 +238,7 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, &
!
! local arrays and variables
!
integer :: i,k,l,kk,m,id
integer :: i,k,l,kk,m
real(r8), parameter :: rearth = SHR_CONST_REARTH ! radius earth (m)
real(r8), parameter :: gravit = SHR_CONST_G ! m/s^2
real(r8), dimension(ncol) :: area, wk_out
Expand All @@ -260,14 +260,13 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, &
real(r8), parameter :: ph_inv = 1._r8/ph
real(r8) :: e298, dhr
real(r8), dimension(ncol) :: dk1s,dk2s,wrk
!!DEK
real(r8) :: pi
real(r8) :: lats(pcols)

real(r8), parameter :: rad2deg = 180._r8/pi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gold2718 @cacraigucar @peverwhee I feel like I have seen this particular calculation in multiple places throughout CAM. Would it make sense to add this (and an inverse deg2rad) into physconst so that this parameter doesn't have to be repeated so much?

I should note that we don't have to necessarily do it for this PR, I just think that if we all agree then it would be good to make an issue for it so one of us can tackle it later.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's minor in the sense that the parameter is baked into the code (no run-time cost).
A better solution for cases like this will come when all the dycores use the new physics grid infrastructure which has coordinates in both radians and degrees.


!
! from cam/src/physics/cam/stratiform.F90
!
!!DEK
pi = 4._r8*atan(1.0_r8)

if (.not.do_neu_wetdep) return
!
Expand Down Expand Up @@ -330,7 +329,6 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, &
end do
!
! compute effective Henry's law coefficients
! code taken from models/drv/shr/seq_drydep_mod.F90
!
heff = 0._r8
do k=1,pver
Expand All @@ -342,14 +340,13 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, &
do m=1,gas_wetdep_cnt
!
l = mapping_to_heff(m)
id = 6*(l - 1)
e298 = dheff(id+1)
dhr = dheff(id+2)
e298 = dheff(1,l)
dhr = dheff(2,l)
heff(:,k,m) = e298*exp( dhr*wrk(:) )
test_flag = -99
if( dheff(id+3) /= 0._r8 .and. dheff(id+5) == 0._r8 ) then
e298 = dheff(id+3)
dhr = dheff(id+4)
if( dheff(3,l) /= 0._r8 .and. dheff(5,l) == 0._r8 ) then
e298 = dheff(3,l)
dhr = dheff(4,l)
dk1s(:) = e298*exp( dhr*wrk(:) )
where( heff(:,k,m) /= 0._r8 )
heff(:,k,m) = heff(:,k,m)*(1._r8 + dk1s(:)*ph_inv)
Expand All @@ -363,13 +360,13 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, &
write(iulog, '(a,i4)') 'heff for m=',m
endif
!
if( dheff(id+5) /= 0._r8 ) then
if( dheff(5,l) /= 0._r8 ) then
if( nh3_ndx > 0 .or. co2_ndx > 0 .or. so2_ndx > 0 ) then
e298 = dheff(id+3)
dhr = dheff(id+4)
e298 = dheff(3,l)
dhr = dheff(4,l)
dk1s(:) = e298*exp( dhr*wrk(:) )
e298 = dheff(id+5)
dhr = dheff(id+6)
e298 = dheff(5,l)
dhr = dheff(6,l)
dk2s(:) = e298*exp( dhr*wrk(:) )
if( m == co2_ndx .or. m == so2_ndx ) then
heff(:,k,m) = heff(:,k,m)*(1._r8 + dk1s(:)*ph_inv*(1._r8 + dk2s(:)*ph_inv))
Expand Down Expand Up @@ -424,11 +421,11 @@ subroutine neu_wetdep_tend(lchnk,ncol,mmr,pmid,pdel,zint,tfld,delt, &
dtwr(1:ncol,:,:) = wd_mmr(1:ncol,:,:) - dtwr(1:ncol,:,:)
dtwr(1:ncol,:,:) = dtwr(1:ncol,:,:) / delt

!!DEK polarward of 60S, 60N and <200hPa set to zero!
! polarward of 60S, 60N and <200hPa set to zero!
call get_rlat_all_p(lchnk, pcols, lats )
do k = 1, pver
do i= 1, ncol
if ( abs( lats(i)*180._r8/pi ) > 60._r8 ) then
if ( abs( lats(i)*rad2deg ) > 60._r8 ) then
if ( pmid(i,k) < 20000._r8) then
dtwr(i,k,:) = 0._r8
endif
Expand Down
6 changes: 3 additions & 3 deletions src/control/camsrfexch.F90
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ subroutine hub2atm_alloc( cam_in )
! Allocate space for the surface to atmosphere data type. And initialize
! the values.

use seq_drydep_mod, only: lnd_drydep, n_drydep
use shr_drydep_mod, only: n_drydep
use shr_megan_mod, only: shr_megan_mechcomps_n
use shr_fire_emis_mod,only: shr_fire_emis_mechcomps_n

Expand Down Expand Up @@ -186,7 +186,7 @@ subroutine hub2atm_alloc( cam_in )
endif
end do

if (lnd_drydep .and. n_drydep>0) then
if (n_drydep>0) then
do c = begchunk,endchunk
allocate (cam_in(c)%depvel(pcols,n_drydep), stat=ierror)
if ( ierror /= 0 ) call endrun(sub//': allocation error depvel')
Expand Down Expand Up @@ -243,7 +243,7 @@ subroutine hub2atm_alloc( cam_in )
cam_in(c)%ustar (:) = 0._r8
cam_in(c)%re (:) = 0._r8
cam_in(c)%ssq (:) = 0._r8
if (lnd_drydep .and. n_drydep>0) then
if (n_drydep>0) then
cam_in(c)%depvel (:,:) = 0._r8
endif
if (active_Fall_flxfire .and. shr_fire_emis_mechcomps_n>0) then
Expand Down
2 changes: 1 addition & 1 deletion src/cpl/mct/atm_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ subroutine atm_import( x2a, cam_in, restart_init )
use ppgrid , only: begchunk, endchunk
use shr_const_mod , only: shr_const_stebol
use shr_sys_mod , only: shr_sys_abort
use seq_drydep_mod , only: n_drydep
use shr_drydep_mod , only: n_drydep
use shr_fire_emis_mod , only: shr_fire_emis_mechcomps_n
use co2_cycle , only: c_i, co2_readFlux_ocn, co2_readFlux_fuel
use co2_cycle , only: co2_transport, co2_time_interp_ocn, co2_time_interp_fuel
Expand Down
Loading