igmk / pamtra

Passive and Active Microwave TRAnsfer model
GNU General Public License v3.0
20 stars 16 forks source link

Code asymmetry in tmatrix code? #11

Closed MeraX closed 4 years ago

MeraX commented 5 years ago

I am just looking a bit around in the scattering code and I got the feeling, that the spectral backscatter from tmatrix is somehow inconsistent between polarization NN and the others (HH, VV, HV). The code I'm referring to is the following:

        if (radar_pol(i_p) == "NN") then
          !scatter_matrix(A,B;C;D;E) backscattering is M11 of Mueller or Scattering Matrix (A;C=1), in quadrature 2 (E) first 16 (B) is 180deg (upwelling), 2nd 16 (D) 0deg (downwelling). this definition is lokkiing from BELOW, sc
          back_spec(i_p,ir) = 4*pi*ndens_eff*scatter_matrix_part(1,16,1,16,2)
      else if (radar_pol(i_p) == "HH") then
        !1.Vivekanandan, J., Adams, W. M. & Bringi, V. N. Rigorous Approach to Polarimetric Radar Modeling of Hydrometeor Orientation Distributions. Journal of Applied Meteorology 30, 1053–1063 (1991).
        back_spec(i_p,ir) = + scatter_matrix_part(1,16,1,16,2) &
                            - scatter_matrix_part(1,16,2,16,2) & 
                            - scatter_matrix_part(2,16,1,16,2) & 
                            + scatter_matrix_part(2,16,2,16,2) 
      else if (radar_pol(i_p) == "VV") then
        back_spec(i_p,ir) = + scatter_matrix_part(1,16,1,16,2) &
                            + scatter_matrix_part(1,16,2,16,2) & 
                            + scatter_matrix_part(2,16,1,16,2) & 
                            + scatter_matrix_part(2,16,2,16,2) 
      else if (radar_pol(i_p) == "HV") then
        back_spec(i_p,ir) = + scatter_matrix_part(1,16,1,16,2) &
                            - scatter_matrix_part(1,16,2,16,2) & 
                            + scatter_matrix_part(2,16,1,16,2) &
                            - scatter_matrix_part(2,16,2,16,2) 
      else
        ![... error ...]
      end if

https://github.com/igmk/pamtra/blob/master/src/tmatrix.f90#L391

In the NN there is a 4*pi*ndens_eff* prefactor which I don't see for the polarized cases. This seem odd to me. However, this part of the code does not affect the non-spectral Ze, but If somebody wants to do some spectral simulations with tmatrix, he or she should review this piece of code.