@@ -16,16 +16,17 @@ module aero_wetdep_cam
1616 use cam_history, only: addfld, add_default, horiz_only, outfld
1717 use wetdep, only: wetdep_init
1818
19- use rad_constituents , only: rad_cnst_get_info
19+ use radiative_aerosol , only: rad_aer_get_info
2020
2121 use aerosol_properties_mod, only: aero_name_len
2222 use aerosol_properties_mod, only: aerosol_properties
2323 use modal_aerosol_properties_mod, only: modal_aerosol_properties
2424 use carma_aerosol_properties_mod, only: carma_aerosol_properties
2525
2626 use aerosol_state_mod, only: aerosol_state, ptr2d_t
27- use modal_aerosol_state_mod, only: modal_aerosol_state
28- use carma_aerosol_state_mod, only: carma_aerosol_state
27+ use aerosol_instances_mod, only: aerosol_instances_get_state, &
28+ aerosol_instances_get_props, &
29+ aerosol_instances_get_num_models
2930
3031 use aero_convproc, only: aero_convproc_readnl, aero_convproc_init, aero_convproc_intr
3132 use aero_convproc, only: convproc_do_evaprain_atonce
@@ -172,7 +173,7 @@ subroutine aero_wetdep_init( )
172173 history_chemistry_out= history_chemistry, &
173174 convproc_do_aer_out = convproc_do_aer)
174175
175- call rad_cnst_get_info (0 , nmodes= nmodes, nbins= nbins)
176+ call rad_aer_get_info (0 , nmodes= nmodes, nbins= nbins)
176177
177178 if (nmodes> 0 ) then
178179 aero_props = > modal_aerosol_properties()
@@ -409,26 +410,30 @@ subroutine aero_wetdep_tend( state, dt, dlf, cam_out, ptend, pbuf)
409410 real (r8 ) :: sflxbc(pcols), sflxbcdp(pcols) ! deposition flux
410411
411412 class(aerosol_state), pointer :: aero_state
413+ class(aerosol_properties), pointer :: props_tmp
414+ integer :: iaermod
412415
413416 nullify(aero_state)
414417
415418 if (.not. wetdep_active) return
416419
417420 dcondt_resusp3d(:,:,:) = 0._r8
418421
419- if (nmodes > 0 ) then
420- aero_state = > modal_aerosol_state(state,pbuf )
421- if ( .not. associated (aero_state)) then
422- call endrun(subrname // ' : construction of aero_state modal_aerosol_state object failed ' )
423- end if
424- else if (nbins > 0 ) then
425- aero_state = > carma_aerosol_state(state,pbuf )
426- if ( .not. associated (aero_state)) then
427- call endrun(subrname // ' : construction of aero_state carma_aerosol_state object failed ' )
422+ ! REMOVECAM - get persistent state from factory; under CAM-SIMA states will be passed as scheme inputs
423+ nullify(aero_state )
424+ do iaermod = 1 , aerosol_instances_get_num_models()
425+ props_tmp = > aerosol_instances_get_props(iaermod, 0 )
426+ if ( associated (props_tmp)) then
427+ if (.not. props_tmp % model_is( ' BAM ' ) ) then
428+ aero_state = > aerosol_instances_get_state(iaermod, 0 , state % lchnk )
429+ exit
430+ end if
428431 end if
429- else
430- call endrun(subrname// ' : cannot determine aerosol model' )
431- endif
432+ end do
433+ if (.not. associated (aero_state)) then
434+ call endrun(subrname// ' : no non-BAM aerosol state available for wetdep' )
435+ end if
436+ ! REMOVECAM_END
432437
433438 lchnk = state% lchnk
434439 ncol = state% ncol
@@ -601,7 +606,7 @@ subroutine aero_wetdep_tend( state, dt, dlf, cam_out, ptend, pbuf)
601606 qqcw_in(:ncol,:) = qqcw(mm)% fld(:ncol,:)
602607 end if
603608
604- f_act_conv(:ncol,:) = aero_state% convcld_actfrac( m, l, ncol, pver)
609+ f_act_conv(:ncol,:) = aero_state% convcld_actfrac( aero_props, m, l, ncol, pver)
605610 name = aname
606611 end if
607612
@@ -796,10 +801,7 @@ subroutine aero_wetdep_tend( state, dt, dlf, cam_out, ptend, pbuf)
796801
797802 end do bins_loop
798803
799- if (associated (aero_state)) then
800- deallocate (aero_state)
801- nullify(aero_state)
802- end if
804+ nullify(aero_state)
803805
804806 ! if the user has specified prescribed aerosol dep fluxes then
805807 ! do not set cam_out dep fluxes according to the prognostic aerosols
0 commit comments