SHUSCT / SHUBYD_GMCORE_ASC24

MIT License
0 stars 0 forks source link

[Need-Attention-to]About func "filter_run_3d" in file "/src/dynamics/filter_mod.F90" #27

Closed ShoiLyaung closed 5 months ago

ShoiLyaung commented 5 months ago

Function name: filter_run_3d(filter, x, y) image

This function costs steadily 8% time in every "swm_xxxx.exe". Hope you can optimize it.

You can try from here(Line 115-132):

    do k = ks, ke
      do j = js, je
        if (ngrid(j) > 1) then
          n  = ngrid(j)
          hn = (n - 1) / 2
          do i = is, ie
            tmp(i) = sum(wgt(:n,j) * x%d(i-hn:i+hn,j,k))
          end do
          if (present(y)) then
            y%d(:,j,k) = tmp
          else
            x%d(:,j,k) = tmp
          end if
        else if (present(y)) then
          y%d(:,j,k) = x%d(:,j,k)
        end if
      end do
    end do