CAM icon indicating copy to clipboard operation
CAM copied to clipboard

Aerosol convective wet removal bugs

Open fvitt opened this issue 1 year ago • 2 comments

Issue Type

Other (please describe below)

Issue Description

Aerosol convective removal code refactor / clean up efforts have uncovered a few bugs.

In subroutine subroutine ma_precpevap_convproc in modal_aero_convproc.F90, the inclusion of tendency due to precip evaporation in the overall tendency from convection needs to occur after the tendencies have accumulated to larger modes. This is, this line:

            dcondt(m,k) = dcondt(m,k) + dcondt_prevap(m,k)

needs to be moved to after the calls to accumulate_to_larger_mode.

Other bugs relate to the application of tendencies of cloud-borne aerosols due to resuspension in aero_model.F90 when convproc_do_evaprain_atonce is TRUE. There is an indexing error in the application of dcondt_resusp3d and the lspec loop should not interate beyond the number of species in each mode. The fixes are as follows:

diff --git a/src/chemistry/modal_aero/aero_model.F90 b/src/chemistry/modal_aero/aero_model.F90
index 43ef5caa..6e30aefb 100644
--- a/src/chemistry/modal_aero/aero_model.F90
+++ b/src/chemistry/modal_aero/aero_model.F90
@@ -1614,37 +1614,37 @@ contains
     if (convproc_do_aer) then
        call t_startf('ma_convproc')
        call ma_convproc_intr( state, ptend, pbuf, dt,                &
             nsrflx_mzaer2cnvpr, qsrflx_mzaer2cnvpr, aerdepwetis, &
             dcondt_resusp3d)
 
        if (convproc_do_evaprain_atonce) then
           do m = 1, ntot_amode ! main loop over aerosol modes
              do lphase = strt_loop,end_loop, stride_loop
                 ! loop over interstitial (1) and cloud-borne (2) forms
-                do lspec = 0, nspec_amode(m)+1 ! loop over number + chem constituents + water
+                do lspec = 0, nspec_amode(m) ! loop over number + chem constituents
                    if (lspec == 0) then ! number
                       if (lphase == 1) then
                          mm = numptr_amode(m)
                       else
                          mm = numptrcw_amode(m)
                       endif
                    else if (lspec <= nspec_amode(m)) then ! non-water mass
                       if (lphase == 1) then
                          mm = lmassptr_amode(lspec,m)
                       else
                          mm = lmassptrcw_amode(lspec,m)
                       endif
                    endif
                    if (lphase == 2) then
                       fldcw => qqcw_get_field(pbuf, mm,lchnk)
-                      fldcw(:ncol,:) = fldcw(:ncol,:) + dcondt_resusp3d(mm,:ncol,:)*dt
+                      fldcw(:ncol,:) = fldcw(:ncol,:) + dcondt_resusp3d(mm+pcnst,:ncol,:)*dt
                    end if
                 end do ! loop over number + chem constituents + water
              end do  ! lphase
           end do   ! m aerosol modes
        end if
 
        call t_stopf('ma_convproc')
     endif

Will this change answers?

Yes

Will you be implementing this yourself?

Yes

fvitt avatar May 03 '24 02:05 fvitt

I'm happy to test the impact of this bug fix, as I'm curious the impacts. Has anyone looked at that?

adamrher avatar May 03 '24 02:05 adamrher

I'm happy to test the impact of this bug fix, as I'm curious the impacts. Has anyone looked at that?

@tilmes is testing fixes. Please coordinate with her.

fvitt avatar May 03 '24 14:05 fvitt