Changeset 2215 for palm/trunk


Ignore:
Timestamp:
Apr 28, 2017 12:49:49 PM (8 years ago)
Author:
suehring
Message:

Normalization of spectra output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/spectra_mod.f90

    r2193 r2215  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Normalization of spectra output adjusted
    2323!
    2424! Former revisions:
     
    559559!
    560560!--    Subtract horizontal mean from the array, for which spectra have to be
    561 !--    calculated
     561!--    calculated. Moreover, calculate variance of the respective quantitiy,
     562!--    later used for normalizing spectra output.
    562563       var_d_l(:) = 0.0_wp
    563564       DO  i = nxl, nxr
     
    698699!
    699700!--       Normalize spectra by variance
    700           sum_spec_dum = SUM( sums_spectra(:,n) )
     701          sum_spec_dum = SUM( sums_spectra(1:nx/2,n) )
     702
    701703          IF ( sum_spec_dum /= 0.0_wp )  THEN
    702              sums_spectra(:,n) = sums_spectra(:,n) * var_d(k) / sum_spec_dum
     704             sums_spectra(1:nx/2,n) = sums_spectra(1:nx/2,n) *                 &
     705                                      var_d(k) / sum_spec_dum
    703706          ENDIF
    704707          n = n + 1
     
    839842!
    840843!--       Normalize spectra by variance
    841           sum_spec_dum = SUM( sums_spectra(:,n) )
    842           IF ( SUM(sums_spectra(:,n)) /= 0.0_wp )  THEN
    843              sums_spectra(:,n) = sums_spectra(:,n) *                           &
    844                                  var_d(k) / SUM(sums_spectra(:,n))
     844          sum_spec_dum = SUM( sums_spectra(1:ny/2,n) )
     845          IF ( sum_spec_dum /= 0.0_wp )  THEN
     846             sums_spectra(1:ny/2,n) = sums_spectra(1:ny/2,n) *                 &
     847                                      var_d(k) / sum_spec_dum
    845848          ENDIF
    846849          n = n + 1
Note: See TracChangeset for help on using the changeset viewer.