Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
36 changes: 19 additions & 17 deletions src/cpl/nuopc/atm_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,25 @@ module atm_import_export
subroutine read_surface_fields_namelists()

use shr_drydep_mod , only : shr_drydep_readnl
use shr_drydep_mod , only : shr_drydep_list => drydep_list
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
use drydep_coupling , only : drydep_coupling_set_nflds, drydep_coupling_set_list

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)
! Mirror the dry deposition field count and species names for physics;
! registry fields dimensioned by the count are allocated later, during
! physics initialization. The list order is the Sl_ddvel coupler index
! contract with the land model.
call drydep_coupling_set_nflds(drydep_nflds)
call drydep_coupling_set_list(shr_drydep_list(1:drydep_nflds))
call shr_megan_readnl(nl_file_name, megan_nflds)
call shr_fire_emis_readnl(nl_file_name, emis_nflds)
call shr_carma_readnl(nl_file_name, carma_fields)
Expand Down Expand Up @@ -647,19 +655,6 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
end if
end if

! dry deposition fluxes from land
call state_getfldptr(importState, 'Fall_flxdst', fldptr2d=fldptr2d, exists=exists, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (exists) then
if ( associated(cam_in%dstflx) ) then
do i = 1, columns_on_task
do n = 1, size(fldptr2d, dim=1)
cam_in%dstflx(i,n) = fldptr2d(n,i) * med2mod_areacor(i)
end do
end do
end if
end if

! MEGAN VOC emis fluxes from land
call state_getfldptr(importState, 'Fall_voc', fldptr2d=fldptr2d, exists=exists, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -693,9 +688,6 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
end if
#endif

#if 0
! Ignoring depvel for now as it has a problematic second dimension (number of dry deposited species)
! and it was determined that it probably will not be used in CAM-SIMA for some time
! dry dep velocities
call state_getfldptr(importState, 'Sl_ddvel', fldptr2d=fldptr2d, exists=exists, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand All @@ -706,7 +698,17 @@ subroutine import_fields( gcomp, cam_in, restart_init, rc)
end do
end do
end if
#endif

! dust emission fluxes from land
call state_getfldptr(importState, 'Fall_flxdst', fldptr2d=fldptr2d, exists=exists, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (exists) then
do i = 1, columns_on_task
do n = 1, size(fldptr2d, dim=1)
cam_in%dstflx(i,n) = fldptr2d(n,i) * med2mod_areacor(i)
end do
end do
end if

#if 0
! Commented out until water isotopes or carbon cycle fluxes are implemented in CAM-SIMA
Expand Down
28 changes: 25 additions & 3 deletions src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<metadata_file>$SRCROOT/src/physics/utils/physics_grid.meta</metadata_file>
<metadata_file>$SRCROOT/src/physics/utils/radiation_namelist.meta</metadata_file>
<metadata_file>$SRCROOT/src/physics/utils/cam_constituents.meta</metadata_file>
<metadata_file>$SRCROOT/src/physics/utils/drydep_coupling.meta</metadata_file>
<metadata_file>$SRCROOT/src/physics/utils/tropopause_climo_read.meta</metadata_file>
<metadata_file>$SRCROOT/src/physics/utils/gravity_wave_drag_ridge_read.meta</metadata_file>
<metadata_file>$SRCROOT/src/data/air_composition.meta</metadata_file>
Expand Down Expand Up @@ -751,14 +752,22 @@

<!-- data_flux_fuel is being intentionally ignored as it will only be needed for the online carbon cycle -->
<!-- data_flux_ocn is being intentionally ignored as it will only be needed for the online carbon cycle -->
<!-- depvel (dry_deposition_velocity_from_coupler) is being intentionally ignored as one of the dimensions is problematic
and it was determined that it probably will not be used in CAM-SIMA for some time -->

<!-- CLM computes and sends Sl_ddvel in cm/s; gas dry deposition
consumes it as-is in the Wesely land-type merge. -->
<variable local_name="depvel"
standard_name="dry_deposition_velocity_from_coupler"
units="cm s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension number_of_dry_deposition_species</dimensions>
<initial_value>0.0_kind_phys</initial_value>
</variable>

<variable local_name="dstflx"
standard_name="surface_upward_dust_fluxes_from_coupler"
units="kg m-2 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<dimensions>horizontal_dimension dust_size_bin_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>dstflx cam_in_dstflx</ic_file_input_names>
</variable>
Expand Down Expand Up @@ -1349,6 +1358,7 @@
<data>surface_albedo_due_to_uv_and_vis_diffuse_from_coupler</data>
<data>surface_albedo_due_to_uv_and_vis_direct_from_coupler</data>
<data>surface_upward_ccpp_constituent_fluxes_from_coupler</data>
<data>dry_deposition_velocity_from_coupler</data>
<data>surface_upward_dust_fluxes_from_coupler</data>
<data>co2_flux_from_land_from_coupler</data>
<data>co2_flux_from_ocean_from_coupler</data>
Expand Down Expand Up @@ -1490,6 +1500,18 @@
<ic_file_input_names>pbuf_VPWP_CLUBB_GW</ic_file_input_names>
</variable>

<!-- Aerosol model properties -->
<variable local_name="ndust"
standard_name="dust_size_bin_dimension"
units="count" type="integer" allocatable="parameter">
<long_name>number of dust size bins used in aerosol model</long_name>
<initial_value>4</initial_value>
<!-- this is not runtime configurable, and
not even easily compile-time configurable, because the assumption that
there are four dust bins is deeply embedded in the microphysics and
coupling to the land model (see dstdry1/2/3/4, dstwet1/2/3/4) -->
Comment thread
cacraigucar marked this conversation as resolved.
</variable>

<!-- Gravity wave variables - need to be kept in the CAM registry -->
<variable local_name="kvt"
standard_name="molecular_kinematic_temperature_conductivity_at_interfaces"
Expand Down
39 changes: 39 additions & 0 deletions src/physics/utils/drydep_coupling.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module drydep_coupling

implicit none
private

public :: drydep_coupling_set_nflds
public :: drydep_coupling_set_list

!> \section arg_table_drydep_coupling Argument Table
!! \htmlinclude drydep_coupling.html
! Number of gas species with land-computed dry deposition velocities
! received through the coupler field Sl_ddvel. The authoritative value
! is owned by shr_drydep_mod (CMEPS) and set by shr_drydep_readnl during
! the NUOPC advertise phase; the cap mirrors it here, before physics
! initialization allocates registry fields dimensioned by it.
integer, public, protected :: n_drydep = 0

! Species names of the drv_flds_in drydep_list, in list order. The list
! order is the Sl_ddvel coupler index contract with the land model, so
! it cannot be reordered or trimmed atm-side. Mirrored by the cap along
! with the count; consumed by gas_drydep_ccpp at init (no metadata
! entry: character arrays are use-associated, not capgen-passed).
character(len=32), allocatable, public, protected :: drydep_list(:)

contains

subroutine drydep_coupling_set_nflds(n_drydep_in)
integer, intent(in) :: n_drydep_in

n_drydep = n_drydep_in
end subroutine drydep_coupling_set_nflds

subroutine drydep_coupling_set_list(drydep_list_in)
character(len=*), intent(in) :: drydep_list_in(:)

drydep_list = drydep_list_in
end subroutine drydep_coupling_set_list

end module drydep_coupling
13 changes: 13 additions & 0 deletions src/physics/utils/drydep_coupling.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ccpp-table-properties]
name = drydep_coupling
type = module

[ccpp-arg-table]
name = drydep_coupling
type = module
[ n_drydep ]
standard_name = number_of_dry_deposition_species
units = count
type = integer
dimensions = ()
protected = True