Index: branches/2014/dev_r4765_CNRS_agrif/NEMOGCM/TOOLS/SIREN/src/filter.f90
===================================================================
--- branches/2014/dev_r4765_CNRS_agrif/NEMOGCM/TOOLS/SIREN/src/filter.f90	(revision 4766)
+++ branches/2014/dev_r4765_CNRS_agrif/NEMOGCM/TOOLS/SIREN/src/filter.f90	(revision 5581)
@@ -6,20 +6,57 @@
 !
 ! DESCRIPTION:
-!> @brief filter manager <br/>
+!> @brief This module is filter manager.
 !>
-!> @details
+!> @details Filtering method to be used is specify inside variable strcuture,
+!>    as array of string character.<br/>
+!>    td_var\%c_filter(1) string character is the filter name choose between:<br/>
+!>       - 'hann'
+!>          - rad < cutoff : @f$ filter=0.5+0.5*COS(\pi*\frac{rad}{cutoff}) @f$
+!>          - rad > cutoff : @f$ filter=0 @f$
+!>       - 'hamming'
+!>          - rad < cutoff : @f$ filter=0.54+0.46*COS(\pi*\frac{rad}{cutoff}) @f$
+!>          - rad > cutoff : @f$ filter=0 @f$               
+!>       - 'blackman'
+!>          - rad < cutoff : @f$ filter=0.42 + 0.5*COS(\pi*\frac{rad}{cutoff}) + 0.08*COS(2\pi*\frac{rad}{cutoff}) @f$
+!>          - rad > cutoff : @f$ filter=0 @f$
+!>       - 'gauss'
+!>          - @f$filter=exp(-(\alpha * rad^2) / (2*cutoff^2))@f$
+!>       - 'butterworth'
+!>          - @f$ filer=1 / (1+(rad^2 / cutoff^2)^{\alpha}) @f$
+!>             .
+!>
+!>       with @f$ rad= \sqrt{(dist-radius)^2} @f$
+!>
+!>    td_var\%c_filter(2) string character is the number of turn to be done<br/>
+!>    td_var\%c_filter(3) string character is the cut-off frequency (count in number of mesh grid)<br/>
+!>    td_var\%c_filter(4) string character is the halo radius (count in number of mesh grid)<br/>
+!>    td_var\%c_filter(5) string character is the alpha parameter (for gauss and butterworth method)<br/>
+!>    
+!>    @note Filter method could be specify for each variable in namelist _namvar_,
+!>    defining string character _cn\_varinfo_. None by default.<br/>
+!>    Filter method parameters are informed inside bracket.
+!>       - @f$\alpha@f$ parameter is added for _gauss_ and _butterworth_ methods
 !> 
+!>    The number of turn is specify using '*' separator.<br/>
+!>    Example:
+!>       - cn_varinfo='varname1:2*hamming(@f$cutoff@f$,@f$radius@f$)', 'varname2:gauss(@f$cutoff@f$,@f$radius@f$,@f$\alpha@f$)'
+!>
+!>    to filter variable value:<br/>
+!> @code
+!>    CALL filter_fill_value( td_var )
+!> @endcode
+!>       - td_var is variable structure
+!>
 !> @author
 !> J.Paul
 ! REVISION HISTORY:
-!> @date Nov, 2013 - Initial Version
+!> @date November, 2013 - Initial Version
 !
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-!> @todo
 !----------------------------------------------------------------------
 MODULE filter
    USE kind                            ! F90 kind parameter
    USE phycst                          ! physical constant
-   USE logger                             ! log file manager
+   USE logger                          ! log file manager
    USE fct                             ! basic usefull function
    use att                             ! attribute manager
@@ -27,5 +64,4 @@
    USE extrap                          ! extrapolation manager
    IMPLICIT NONE
-   PRIVATE
    ! NOTE_avoid_public_variables_if_possible
 
@@ -34,17 +70,25 @@
 
    ! function and subroutine
-   PUBLIC :: filter_fill_value
-
-   PRIVATE :: filter__fill_value_wrapper
-   PRIVATE :: filter__fill_value
-   PRIVATE :: filter__3D_fill_value
-   PRIVATE :: filter__2D_fill_value
-   PRIVATE :: filter__2D
-   PRIVATE :: filter__2D_coef
-   PRIVATE :: filter__2D_hann
-   PRIVATE :: filter__2D_hamming
-   PRIVATE :: filter__2D_blackman
-   PRIVATE :: filter__2D_gauss
-   PRIVATE :: filter__2D_butterworth
+   PUBLIC :: filter_fill_value   !< filter variable value
+
+   PRIVATE :: filter__fill_value_wrapper !
+   PRIVATE :: filter__fill_value         !
+   PRIVATE :: filter__3D_fill_value      ! 
+   PRIVATE :: filter__2D_fill_value      !
+   PRIVATE :: filter__2D                 !
+   PRIVATE :: filter__2D_coef            !
+   PRIVATE :: filter__2D_hann            !
+   PRIVATE :: filter__2D_hamming         !
+   PRIVATE :: filter__2D_blackman        !
+   PRIVATE :: filter__2D_gauss           !
+   PRIVATE :: filter__2D_butterworth     !
+   PRIVATE :: filter__1D_fill_value      !
+   PRIVATE :: filter__1D                 !
+   PRIVATE :: filter__1D_coef            !
+   PRIVATE :: filter__1D_hann            !
+   PRIVATE :: filter__1D_hamming         !
+   PRIVATE :: filter__1D_blackman        !
+   PRIVATE :: filter__1D_gauss           !
+   PRIVATE :: filter__1D_butterworth     !
 
    INTERFACE filter_fill_value
@@ -55,14 +99,15 @@
    !-------------------------------------------------------------------
    !> @brief
-   !> This subroutine filtering variable value.
-   !> 
-   !> @details 
-   !>
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] td_var : variable 
-   !-------------------------------------------------------------------
-   !> @code
+   !> This subroutine filter variable value.
+   !>
+   !> @details
+   !> it checks if filtering method is available,
+   !>  gets parameter value, and launch filter__fill_value 
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !
+   !> @param[inout] td_var variable structure 
+   !-------------------------------------------------------------------
    SUBROUTINE filter__fill_value_wrapper( td_var )
       IMPLICIT NONE
@@ -85,5 +130,5 @@
 
       IF( .NOT. ASSOCIATED(td_var%d_value) )THEN
-         CALL logger_error("FILTER FILL VALUE: no table of value "//&
+         CALL logger_error("FILTER FILL VALUE: no array of value "//&
          &  "associted to variable "//TRIM(td_var%c_name) )
       ELSE
@@ -93,5 +138,5 @@
          CASE DEFAULT
          
-            CALL logger_info("FILTER FILL VALUE: no filter selected "//&
+            CALL logger_trace("FILTER FILL VALUE: no filter selected "//&
             &  "for variable "//TRIM(td_var%c_name))
 
@@ -181,5 +226,7 @@
                tl_att=att_init('filter',cl_filter)
                CALL var_move_att(td_var,tl_att)
-               
+               ! clean
+               CALL att_clean(tl_att)
+
                DO jl=1,il_nturn
                   CALL filter__fill_value( td_var, TRIM(cl_method),  & 
@@ -192,21 +239,23 @@
       ENDIF
    END SUBROUTINE filter__fill_value_wrapper
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief
-   !> This subroutine filtering variable value.
+   !> This subroutine filtering variable value, given cut-off frequency
+   !> halo radius and alpha parameter.
    !> 
    !> @details 
-   !>
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] td_var : variable 
-   !> @param[in] cd_name : filter name
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !-------------------------------------------------------------------
-   !> @code
+   !>    First extrabands are added to array of variable value.
+   !>    Then values are extrapolated, before apply filter.
+   !>    Finally extrabands are removed.
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !
+   !> @param[inout] td_var variable 
+   !> @param[in] cd_name   filter name
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @param[in] dd_alpha  filter parameter
+   !-------------------------------------------------------------------
    SUBROUTINE filter__fill_value( td_var, cd_name, &
    &                              dd_cutoff, id_radius, dd_alpha )
@@ -274,28 +323,31 @@
       END WHERE
 
+      ! clean
+      CALL var_clean(tl_mask)
+
       !6-remove extraband
       CALL extrap_del_extrabands(td_var, id_radius, id_radius)
 
    END SUBROUTINE filter__fill_value
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subroutine compute filtered value of 3D table. 
-   !>
-   !> @details
-   !>
-   !> @warning table of value should have been already extrapolated before
+   !-------------------------------------------------------------------
+   !> @brief This subroutine compute filtered value of 3D array. 
+   !>
+   !> @details
+   !>    First compute filter coefficient.
+   !>    Then apply it on each level of variable value.
+   !>
+   !> @warning array of value should have been already extrapolated before
    !> running this subroutine.
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] dd_value : table of value to be filtered 
-   !> @param[in] dd_fill : fill value 
-   !> @param[in] cd_name : filter name
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[inout] dd_value  array of value to be filtered 
+   !> @param[in] dd_fill      fill value 
+   !> @param[in] cd_name      filter name
+   !> @param[in] dd_cutoff    cut-off frequency
+   !> @param[in] id_radius    filter halo radius
+   !> @param[in] dd_alpha     filter parameter
+   !-------------------------------------------------------------------
    SUBROUTINE filter__3D_fill_value( dd_value, dd_fill, cd_name, &
    &                                 dd_cutoff, id_radius, dd_alpha)
@@ -330,24 +382,24 @@
 
    END SUBROUTINE filter__3D_fill_value
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subroutine compute filtered value of 2D table.
-   !
-   !> @details
-   !
-   !> @warning table of value should have been already extrapolated before
+   !-------------------------------------------------------------------
+   !> @brief This subroutine compute filtered value of 2D array.
+   !
+   !> @details
+   !>    First compute filter coefficient.
+   !>    Then apply it on variable value.
+   !>
+   !> @warning array of value should have been already extrapolated before
    !> running this subroutine.
    !>
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] dd_value : table of value to be filtered 
-   !> @param[in] dd_fill : fill value 
-   !> @param[in] cd_name : filter name
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[inout] dd_value  array of value to be filtered 
+   !> @param[in] dd_fill      fill value 
+   !> @param[in] cd_name      filter name
+   !> @param[in] dd_cutoff    cut-off frequency
+   !> @param[in] id_radius    filter halo radius
+   !> @param[in] dd_alpha     filter parameter
+   !-------------------------------------------------------------------
    SUBROUTINE filter__2D_fill_value( dd_value, dd_fill, cd_name, &
    &                                 dd_cutoff, id_radius, dd_alpha)
@@ -376,24 +428,24 @@
 
    END SUBROUTINE filter__2D_fill_value
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subroutine compute filtered value of 1D table.
-   !
-   !> @details
-   !
-   !> @warning table of value should have been already extrapolated before
+   !-------------------------------------------------------------------
+   !> @brief This subroutine compute filtered value of 1D array.
+   !
+   !> @details
+   !>    First compute filter coefficient.
+   !>    Then apply it on variable value.
+   !>
+   !> @warning array of value should have been already extrapolated before
    !> running this subroutine.
    !>
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] dd_value : table of value to be filtered 
-   !> @param[in] dd_fill : fill value 
-   !> @param[in] cd_name : filter name
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[inout] dd_value  array of value to be filtered 
+   !> @param[in] dd_fill      fill value 
+   !> @param[in] cd_name      filter name
+   !> @param[in] dd_cutoff    cut-off frequency
+   !> @param[in] id_radius    filter halo radius
+   !> @param[in] dd_alpha     filter parameter
+   !-------------------------------------------------------------------
    SUBROUTINE filter__1D_fill_value( dd_value, dd_fill, cd_name, &
    &                                 dd_cutoff, id_radius, dd_alpha)
@@ -422,23 +474,19 @@
 
    END SUBROUTINE filter__1D_fill_value
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subroutine 
-   !
-   !> @details
-   !
-   !> @note 
-   !> if fill value are detected in the computing area, 
-   !> no filtering is done.
-   !>
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] dd_value : table of value to be filtered 
-   !> @param[in] dd_fill : fill value 
-   !> @param[in] dd_coef :  filter coefficent table
-   !> @param[in] id_radius : filter halo radius
-   !-------------------------------------------------------------------
-   !> @code
+   !-------------------------------------------------------------------
+   !> @brief This subroutine filtered 2D array of value 
+   !>
+   !> @details
+   !>    loop on first and second dimension, 
+   !>    and apply coefficient 2D array on each point
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !
+   !> @param[inout] dd_value  array of value to be filtered 
+   !> @param[in] dd_fill      fill value 
+   !> @param[in] dd_coef      filter coefficent array
+   !> @param[in] id_radius    filter halo radius
+   !-------------------------------------------------------------------
    SUBROUTINE filter__2D(dd_value, dd_fill, dd_coef, id_radius)
       IMPLICIT NONE
@@ -452,5 +500,5 @@
       INTEGER(i4), DIMENSION(2)                :: il_shape
       REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_value
-      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_area
+      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_halo
 
       ! loop indices
@@ -463,39 +511,37 @@
       dl_value(:,:)=dd_value(:,:)
 
-      ALLOCATE(dl_area(2*id_radius+1,2*id_radius+1))
+      ALLOCATE(dl_halo(2*id_radius+1,2*id_radius+1))
 
       DO jj=1+id_radius,il_shape(2)-id_radius
          DO ji=1+id_radius,il_shape(1)-id_radius
 
-            dl_area(:,:)=dd_fill
-            dl_area(:,:)=dl_value(ji-id_radius:ji+id_radius, &
+            dl_halo(:,:)=dd_fill
+            dl_halo(:,:)=dl_value(ji-id_radius:ji+id_radius, &
             &                     jj-id_radius:jj+id_radius)
 
-            IF( ALL(dl_area(:,:)/=dd_fill) )THEN
-               dd_value(ji,jj)=SUM(dl_area(:,:)*dd_coef(:,:))
-            ENDIF
+            dd_value(ji,jj)=SUM(dl_halo(:,:)*dd_coef(:,:))
 
          ENDDO
       ENDDO
 
-      DEALLOCATE(dl_area)
+      DEALLOCATE(dl_halo)
       DEALLOCATE(dl_value)
 
    END SUBROUTINE filter__2D
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subroutine 
-   !
-   !> @details
-   !
+   !-------------------------------------------------------------------
+   !> @brief This subroutine filtered 1D array of value  
+   !
+   !> @details
+   !>    loop on first dimension, 
+   !>    and apply coefficient 1D array on each point
+   !>
    !> @author J.Paul
    !> - Nov, 2013- Initial Version
    !
-   !> @param[inout] dd_value : table of value to be filtered 
-   !> @param[in] dd_fill : fill value 
-   !> @param[in] dd_coef :  filter coefficent table
-   !> @param[in] id_radius : filter halo radius
-   !-------------------------------------------------------------------
-   !> @code
+   !> @param[inout] dd_value  array of value to be filtered 
+   !> @param[in] dd_fill      fill value 
+   !> @param[in] dd_coef      filter coefficent array
+   !> @param[in] id_radius    filter halo radius
+   !-------------------------------------------------------------------
    SUBROUTINE filter__1D(dd_value, dd_fill, dd_coef, id_radius)
       IMPLICIT NONE
@@ -507,5 +553,5 @@
 
       ! local variable
-      INTEGER(i4), DIMENSION(1)                :: il_shape
+      INTEGER(i4), DIMENSION(1)              :: il_shape
       REAL(dp)   , DIMENSION(:), ALLOCATABLE :: dl_value
 
@@ -519,14 +565,8 @@
       DO ji=1+id_radius,il_shape(1)-id_radius
 
+         dl_value(:)=dd_fill
          dl_value(:)=dd_value(ji-id_radius:ji+id_radius)
 
-         IF( ANY(dl_value(:)==dd_fill) )THEN
-            CALL logger_error("FILTER FILL VALUE: fill value detected. "//&
-            &  " can't compute filtered value. "//&
-            &  "you should have extrapolate table before running "//&
-            &  " filter_fill_value")
-         ELSE
-            dd_value(ji)=SUM(dl_value(:)*dd_coef(:))
-         ENDIF
+         dd_value(ji)=SUM(dl_value(:)*dd_coef(:))
 
       ENDDO
@@ -535,5 +575,4 @@
 
    END SUBROUTINE filter__1D
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute filter coefficient. 
@@ -548,16 +587,15 @@
    !> - butterworth
    !> Cut-off frequency could be specify.
-   !> As well as a filter parameter for gauss an butterworth filter
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] cd_name : filter name
-   !> @param[in] dd_cutoff : cut-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter 
-   !> @return table of filter coefficient
-   !-------------------------------------------------------------------
-   !> @code
+   !> As well as a filter parameter for gauss and butterworth filter
+   !
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !
+   !> @param[in] cd_name   filter name
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @param[in] dd_alpha  filter parameter 
+   !> @return array of filter coefficient
+   !-------------------------------------------------------------------
    FUNCTION filter__2D_coef(cd_name, dd_cutoff, id_radius, dd_alpha)
       IMPLICIT NONE
@@ -596,5 +634,4 @@
 
    END FUNCTION filter__2D_coef
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute filter coefficient. 
@@ -612,13 +649,12 @@
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] cd_name : filter name
-   !> @param[in] dd_cutoff : cut-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter 
-   !> @return table of filter coefficient
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[in] cd_name   filter name
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @param[in] dd_alpha  filter parameter 
+   !> @return array of filter coefficient
+   !-------------------------------------------------------------------
    FUNCTION filter__1D_coef(cd_name, dd_cutoff, id_radius, dd_alpha)
       IMPLICIT NONE
@@ -653,5 +689,4 @@
 
    END FUNCTION filter__1D_coef
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for HANN filter.
@@ -660,11 +695,10 @@
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @return table of hann filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @return array of hann filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__1D_hann(dd_cutoff, id_radius)
       IMPLICIT NONE
@@ -695,5 +729,5 @@
             
             IF( dl_rad < dd_cutoff )THEN
-               filter__1D_hann(ji)=0.5 + 0.5*COS(dg_pi*dl_rad/dd_cutoff)
+               filter__1D_hann(ji)=0.5 + 0.5*COS(dp_pi*dl_rad/dd_cutoff)
             ELSE
                filter__1D_hann(ji)=0
@@ -709,5 +743,4 @@
 
    END FUNCTION filter__1D_hann
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for HANN filter.
@@ -716,11 +749,10 @@
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @return table of hann filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @return array of hann filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__2D_hann(dd_cutoff, id_radius)
       IMPLICIT NONE
@@ -755,5 +787,5 @@
                
                IF( dl_rad < dd_cutoff )THEN
-                  filter__2D_hann(ji,jj)=0.5 + 0.5*COS(dg_pi*dl_rad/dd_cutoff)
+                  filter__2D_hann(ji,jj)=0.5 + 0.5*COS(dp_pi*dl_rad/dd_cutoff)
                ELSE
                   filter__2D_hann(ji,jj)=0
@@ -770,5 +802,4 @@
 
    END FUNCTION filter__2D_hann
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for HAMMING filter.
@@ -777,11 +808,10 @@
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @return table of hamming filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @return array of hamming filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__1D_hamming(dd_cutoff, id_radius)
       IMPLICIT NONE
@@ -813,5 +843,5 @@
             IF( dl_rad < dd_cutoff )THEN
                filter__1D_hamming(ji)= 0.54 &
-               &                     + 0.46*COS(dg_pi*dl_rad/dd_cutoff)
+               &                     + 0.46*COS(dp_pi*dl_rad/dd_cutoff)
             ELSE
                filter__1D_hamming(ji)=0
@@ -827,5 +857,4 @@
 
    END FUNCTION filter__1D_hamming
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for HAMMING filter.
@@ -834,11 +863,10 @@
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @return table of hamming filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @return array of hamming filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__2D_hamming(dd_cutoff, id_radius)
       IMPLICIT NONE
@@ -873,5 +901,5 @@
                IF( dl_rad < dd_cutoff )THEN
                   filter__2D_hamming(ji,jj)= 0.54 &
-                  &                        + 0.46*COS(dg_pi*dl_rad/dd_cutoff)
+                  &                        + 0.46*COS(dp_pi*dl_rad/dd_cutoff)
                ELSE
                   filter__2D_hamming(ji,jj)=0
@@ -888,5 +916,4 @@
 
    END FUNCTION filter__2D_hamming
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for BLACKMAN filter.
@@ -895,11 +922,10 @@
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @return table of blackman filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !> - November, 2013- Initial Version
+   !
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @return array of blackman filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__1D_blackman(dd_cutoff, id_radius)
       IMPLICIT NONE
@@ -931,6 +957,6 @@
             IF( dl_rad < dd_cutoff )THEN
                filter__1D_blackman(ji)= 0.42 &
-               &                      + 0.5 *COS(  dg_pi*dl_rad/dd_cutoff) &
-               &                      + 0.08*COS(2*dg_pi*dl_rad/dd_cutoff)
+               &                      + 0.5 *COS(  dp_pi*dl_rad/dd_cutoff) &
+               &                      + 0.08*COS(2*dp_pi*dl_rad/dd_cutoff)
             ELSE
                filter__1D_blackman(ji)=0
@@ -946,18 +972,16 @@
 
    END FUNCTION filter__1D_blackman
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for BLACKMAN filter.
-   !
-   !> @details
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @return table of blackman filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !>
+   !> @details
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !>
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @return array of blackman filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__2D_blackman(dd_cutoff, id_radius)
       IMPLICIT NONE
@@ -992,6 +1016,6 @@
                IF( dl_rad < dd_cutoff )THEN
                   filter__2D_blackman(ji,jj)= 0.42 &
-                  &                         + 0.5 *COS(  dg_pi*dl_rad/dd_cutoff) &
-                  &                         + 0.08*COS(2*dg_pi*dl_rad/dd_cutoff)
+                  &                         + 0.5 *COS(  dp_pi*dl_rad/dd_cutoff) &
+                  &                         + 0.08*COS(2*dp_pi*dl_rad/dd_cutoff)
                ELSE
                   filter__2D_blackman(ji,jj)=0
@@ -1008,19 +1032,17 @@
 
    END FUNCTION filter__2D_blackman
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for GAUSS filter.
-   !
-   !> @details
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !> @return table of gauss filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !>
+   !> @details
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !>
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @param[in] dd_alpha  filter parameter
+   !> @return array of gauss filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__1D_gauss(dd_cutoff, id_radius, dd_alpha)
       IMPLICIT NONE
@@ -1062,19 +1084,17 @@
 
    END FUNCTION filter__1D_gauss
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for GAUSS filter.
-   !
-   !> @details
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !> @return table of gauss filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !>
+   !> @details
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !>
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @param[in] dd_alpha  filter parameter
+   !> @return array of gauss filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__2D_gauss(dd_cutoff, id_radius, dd_alpha)
       IMPLICIT NONE
@@ -1120,19 +1140,17 @@
 
    END FUNCTION filter__2D_gauss
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for BUTTERWORTH filter.
-   !
-   !> @details
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !> @return table of butterworth filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !>
+   !> @details
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !>
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @param[in] dd_alpha  filter parameter
+   !> @return array of butterworth filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__1D_butterworth(dd_cutoff, id_radius, dd_alpha)
       IMPLICIT NONE
@@ -1174,19 +1192,17 @@
 
    END FUNCTION filter__1D_butterworth
-   !> @endcode
    !-------------------------------------------------------------------
    !> @brief This function compute coefficient for BUTTERWORTH filter.
-   !
-   !> @details
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] dd_cutoff : cuto-off frequency
-   !> @param[in] id_radius : filter halo radius
-   !> @param[in] dd_alpha : filter parameter
-   !> @return table of butterworth filter coefficient 
-   !-------------------------------------------------------------------
-   !> @code
+   !>
+   !> @details
+   !>
+   !> @author J.Paul
+   !> - November, 2013- Initial Version
+   !>
+   !> @param[in] dd_cutoff cut-off frequency
+   !> @param[in] id_radius filter halo radius
+   !> @param[in] dd_alpha  filter parameter
+   !> @return array of butterworth filter coefficient 
+   !-------------------------------------------------------------------
    FUNCTION filter__2D_butterworth(dd_cutoff,  id_radius, dd_alpha)
       IMPLICIT NONE
@@ -1232,46 +1248,4 @@
 
    END FUNCTION filter__2D_butterworth
-   !> @endcode
-!   !-------------------------------------------------------------------
-!   !> @brief This function 
-!   !
-!   !> @details
-!   !
-!   !> @author J.Paul
-!   !> - Nov, 2013- Initial Version
-!   !
-!   !> @param[in] 
-!   !-------------------------------------------------------------------
-!   !> @code
-!   FUNCTION filter_()
-!      IMPLICIT NONE
-!      ! Argument      
-!      ! function
-!      ! local variable
-!      ! loop indices
-!      !----------------------------------------------------------------
-!
-!   END FUNCTION filter_
-!   !> @endcode
-!   !-------------------------------------------------------------------
-!   !> @brief This subroutine 
-!   !
-!   !> @details
-!   !
-!   !> @author J.Paul
-!   !> - Nov, 2013- Initial Version
-!   !
-!   !> @param[in] 
-!   !-------------------------------------------------------------------
-!   !> @code
-!   SUBROUTINE filter_()
-!      IMPLICIT NONE
-!      ! Argument      
-!      ! local variable
-!      ! loop indices
-!      !----------------------------------------------------------------
-!
-!   END SUBROUTINE filter_
-!   !> @endcode
 END MODULE filter
 
