diff --git a/src/cpl/nuopc/atm_import_export.F90 b/src/cpl/nuopc/atm_import_export.F90 index 594781ec1..7e764cabe 100644 --- a/src/cpl/nuopc/atm_import_export.F90 +++ b/src/cpl/nuopc/atm_import_export.F90 @@ -57,17 +57,27 @@ 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 order of the fields in Sl_ddvel is shared 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) @@ -647,19 +657,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 @@ -693,9 +690,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 @@ -706,7 +700,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 diff --git a/src/data/registry.xml b/src/data/registry.xml index 6bb132330..1e0c28401 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -22,6 +22,7 @@ $SRCROOT/src/physics/utils/physics_grid.meta $SRCROOT/src/physics/utils/radiation_namelist.meta $SRCROOT/src/physics/utils/cam_constituents.meta + $SRCROOT/src/physics/utils/drydep_coupling.meta $SRCROOT/src/physics/utils/tropopause_climo_read.meta $SRCROOT/src/physics/utils/gravity_wave_drag_ridge_read.meta $SRCROOT/src/data/air_composition.meta @@ -751,14 +752,22 @@ - + + + + horizontal_dimension number_of_dry_deposition_species + 0.0_kind_phys + - horizontal_dimension + horizontal_dimension dust_size_bin_dimension 0.0_kind_phys dstflx cam_in_dstflx @@ -1349,6 +1358,7 @@ surface_albedo_due_to_uv_and_vis_diffuse_from_coupler surface_albedo_due_to_uv_and_vis_direct_from_coupler surface_upward_ccpp_constituent_fluxes_from_coupler + dry_deposition_velocity_from_coupler surface_upward_dust_fluxes_from_coupler co2_flux_from_land_from_coupler co2_flux_from_ocean_from_coupler @@ -1490,6 +1500,18 @@ pbuf_VPWP_CLUBB_GW + + + number of dust size bins used in aerosol model + 4 + + + \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. + ! CMEPS shr_drydep_mod owns this value and sets it in shr_drydep_readnl + ! during the NUOPC advertise phase. + ! + ! We mirror it here before physics initialization allocates the registry + ! fields using it as a dimension. + ! It can only be mirrored via a setter (not USE) since the framework + ! will not recognize it in the argument table otherwise. + integer, public, protected :: n_drydep = 0 + + ! Species names of the drv_flds_in drydep_list, in list order. + ! The list order is shared with the land model passing in Sl_ddvel, so + ! it cannot be reordered or trimmed atm-side. + 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 diff --git a/src/physics/utils/drydep_coupling.meta b/src/physics/utils/drydep_coupling.meta new file mode 100644 index 000000000..ce4190e0f --- /dev/null +++ b/src/physics/utils/drydep_coupling.meta @@ -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