Skip to content
Snippets Groups Projects
Commit 8a4dc041 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 22/06/2022: spl script: add support for PURE and ELEMENTAL functions and subroutines

parent 02d1a540
No related branches found
No related tags found
No related merge requests found
#!/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 }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment