diff --git a/bin/spl b/bin/spl
index 7d6e4158a71aa63d389d478fddea810e60155cdd..a2d3b27b72258251cf8e9c3a36ea78e1097deeb3 100755
--- a/bin/spl
+++ b/bin/spl
@@ -1,7 +1,7 @@
 #!/bin/bash
-#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
+#MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
 #MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
-#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt  
+#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.tx
 #MNH_LIC for details. version 1.
 #set -x
 # HP-UX 10
@@ -81,8 +81,11 @@ fi
 #.SH AUTHORS
 #C. Fischer 07/02/95
 #
-#modified by C. Fischer to split fortran 77 (26/04/95)
-#modified by C. Fischer to correct a bug PROGRAM-CONTAINS (16/02/96)
+#Modifications:
+# 26/04/1995 C. Fischer:  to split fortran 77
+# 16/02/1996 C. Fischer:  to correct a bug PROGRAM-CONTAINS
+# 22/06/2022 P. Wautelet: add support for PURE and ELEMENTAL functions and subroutines
+#
 #
 #.SH COPYRIGHT
 #
@@ -153,6 +156,54 @@ awk '
       }
       { if((i_conta) != "open")
         {
+		  { if((substr(u1,1,9)) == "ELEMENTAL")
+            { if((substr(u2,1,10)) == "SUBROUTINE")
+              { split(u3,p_name,"(");
+                l_name=(tolower(p_name[1]));
+                split((l_name),e_name,"$");
+                f_name=(e_name[1]) (e_name[2]) ".f90";
+                print (f_name); i_flag="bof";
+                print "!     ######spl" > (f_name);
+                n_unit=(n_unit) + 0
+              }
+            }
+		  }
+		  { if((substr(u1,1,9)) == "ELEMENTAL")
+            { if((substr(u2,1,8)) == "FUNCTION")
+              { split(u3,p_name,"(");
+                l_name=(tolower(p_name[1]));
+                split((l_name),e_name,"$");
+                f_name=(e_name[1]) (e_name[2]) ".f90";
+                print (f_name); i_flag="bof";
+                print "!     ######spl" > (f_name);
+                n_unit=(n_unit) + 0
+              }
+            }
+		  }
+		  { if((substr(u1,1,4)) == "PURE")
+            { if((substr(u2,1,10)) == "SUBROUTINE")
+              { split(u3,p_name,"(");
+                l_name=(tolower(p_name[1]));
+                split((l_name),e_name,"$");
+                f_name=(e_name[1]) (e_name[2]) ".f90";
+                print (f_name); i_flag="bof";
+                print "!     ######spl" > (f_name);
+                n_unit=(n_unit) + 0
+              }
+            }
+		  }
+		  { if((substr(u1,1,4)) == "PURE")
+            { if((substr(u2,1,8)) == "FUNCTION")
+              { split(u3,p_name,"(");
+                l_name=(tolower(p_name[1]));
+                split((l_name),e_name,"$");
+                f_name=(e_name[1]) (e_name[2]) ".f90";
+                print (f_name); i_flag="bof";
+                print "!     ######spl" > (f_name);
+                n_unit=(n_unit) + 0
+              }
+            }
+		  }
 		  { if((substr(u1,1,9)) == "RECURSIVE")
             { if((substr(u2,1,10)) == "SUBROUTINE")
               { split(u3,p_name,"(");
@@ -200,6 +251,26 @@ awk '
         }
         else
         {
+		  { if((substr(u1,1,9)) == "ELEMENTAL")
+            { if((substr(u2,1,10)) == "SUBROUTINE")
+              { n_unit=(n_unit) + 1 }
+            }
+          }
+		  { if((substr(u1,1,9)) == "ELEMENTAL")
+            { if((substr(u2,1,8)) == "FUNCTION")
+              { n_unit=(n_unit) + 1 }
+            }
+          }
+		  { if((substr(u1,1,4)) == "PURE")
+            { if((substr(u2,1,10)) == "SUBROUTINE")
+              { n_unit=(n_unit) + 1 }
+            }
+          }
+		  { if((substr(u1,1,4)) == "PURE")
+            { if((substr(u2,1,8)) == "FUNCTION")
+              { n_unit=(n_unit) + 1 }
+            }
+          }
 		  { if((substr(u1,1,9)) == "RECURSIVE")
             { if((substr(u2,1,10)) == "SUBROUTINE")
               { n_unit=(n_unit) + 1 }