Skip to content
Open
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
32 changes: 15 additions & 17 deletions src/cpl/nuopc/atm_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ subroutine read_surface_fields_namelists()
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

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 for physics; registry fields
! dimensioned by it are allocated later, during physics initialization
call drydep_coupling_set_nflds(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 +651,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 +684,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 +694,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
26 changes: 23 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,20 @@

<!-- 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 -->

<variable local_name="depvel"
standard_name="dry_deposition_velocity_from_coupler"
units="m 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 +1356,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 +1498,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) -->
</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
25 changes: 25 additions & 0 deletions src/physics/utils/drydep_coupling.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module drydep_coupling

implicit none
private

public :: drydep_coupling_set_nflds

!> \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

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

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
Loading