Index: src/mean_mod.f90
===================================================================
--- src/mean_mod.f90	(revision 16b61a5e2d3b1020be1cff080e479ba26f3f7063)
+++ src/mean_mod.f90	(revision 4c64400c622119505b289ef83be130b0b81b9590)
@@ -29,5 +29,7 @@
     module procedure mean_sp
     module procedure mean_dp
-    module procedure mean_mixed_prec
+    module procedure mean_mixed_dss
+    module procedure mean_mixed_dsd
+
   end interface mean
 
@@ -142,13 +144,13 @@
   end subroutine mean_dp
 
-  subroutine mean_mixed_prec(x_dp,xm,xs,number)
-
-!*****************************************************************************
-!                                                                            *
-!  This subroutine calculates mean and standard deviation of a given element.*
-!                                                                            *
-!      AUTHOR: Andreas Stohl, 25 January 1994                                *
-!                                                                            *
-!      Mixed precision version ESO 2016 (dp input, sp output)                *
+  subroutine mean_mixed_dss(x_dp,xm,xs,number)
+
+!*****************************************************************************
+!                                                                            *
+!  This subroutine calculates mean and standard deviation of a given element.*
+!                                                                            *
+!      AUTHOR: Andreas Stohl, 25 January 1994                                *
+!                                                                            *
+!      Mixed precision version ESO 2016 (dp in, sp out, sp out)              *
 !*****************************************************************************
 !                                                                            *
@@ -192,4 +194,58 @@
     endif
 
-  end subroutine mean_mixed_prec
+  end subroutine mean_mixed_dss
+
+  subroutine mean_mixed_dsd(x_dp,xm,xs_dp,number)
+
+!*****************************************************************************
+!                                                                            *
+!  This subroutine calculates mean and standard deviation of a given element.*
+!                                                                            *
+!      AUTHOR: Andreas Stohl, 25 January 1994                                *
+!                                                                            *
+!      Mixed precision version ESO 2016 (dp in, sp out, dp out)              *
+!*****************************************************************************
+!                                                                            *
+! Variables:                                                                 *
+! x_dp(number)        field of input data                                    *
+! xm                  mean                                                   *
+! xs_dp               standard deviation                                     *
+! number              number of elements of field x_dp                       *
+!                                                                            *
+! Constants:                                                                 *
+! eps                 tiny number                                            *
+!                                                                            *
+!*****************************************************************************
+
+    use par_mod, only: sp,dp
+
+    implicit none
+
+    integer,intent(in) :: number
+    real(dp), intent(in) :: x_dp(number)
+    real(sp), intent(out) ::xm
+    real(dp), intent(out) ::xs_dp
+    real(dp) :: xl,xq,xaux
+    real(dp),parameter :: eps=1.0e-30_dp
+    integer :: i
+
+    xl=0._dp
+    xq=0._dp
+    do i=1,number
+      xl=xl+x_dp(i)
+      xq=xq+x_dp(i)*x_dp(i)
+    end do
+
+    xm=xl/real(number,kind=sp)
+
+    xaux=xq-xl*xl/real(number,kind=dp)
+
+    if (xaux.lt.eps) then
+      xs_dp=0._dp
+    else
+      xs_dp=sqrt(xaux/real(number-1,kind=dp))
+    endif
+
+  end subroutine mean_mixed_dsd
+
 end module mean_mod
