diff -Nru orig/aws/src/awslp.f patched/aws/src/awslp.f
--- orig/aws/src/awslp.f	2024-02-02 18:25:27.000000000 +0100
+++ patched/aws/src/awslp.f	2024-02-05 12:54:11.715218400 +0100
@@ -278,6 +278,7 @@
 C
 C   temporary arrays set for maximum degree 2
 C
+      use omp_lib
       implicit none
       external kldistp,lkern
       double precision kldistp,lkern
@@ -291,8 +292,6 @@
      1       hakt2,thij(3),thi(3),zz(5),lwj,yj,hs2,hs,z,cc,spf,hhomi,
      2       hhommax,az1,hfixmax,hnfix
 
-!$    integer omp_get_thread_num
-!$    external omp_get_thread_num
 
 C   arrays with variable length are organized as
 C   theta(n,dp1)
@@ -491,6 +490,7 @@
 C
 C   temporary arrays set for maximum degree 2
 C
+      use omp_lib
       implicit none
       external kldistp,lkern
       double precision kldistp,lkern
@@ -504,8 +504,6 @@
       double precision bii(15),sij,swj(15),swj2(15),swj0(15),swjy(6),
      1       z1,z2,wj,hakt2,thij(6),thi(6),zz(15),lwj,hs2,hs,z,cc,
      2       wjy,spf,hhomi,hhommax,az1,hfixmax,hnfix
-!$      integer omp_get_thread_num
-!$      external omp_get_thread_num
 C   arrays with variable length are organized as
 C   theta(n1,n2,dp1)
 C   bi(n1,n2,dp2)
@@ -767,6 +765,7 @@
 C
 C   temporary arrays set for maximum degree 2
 C
+      use omp_lib
       implicit none
       external kldistp,lkern
       double precision kldistp,lkern
@@ -780,8 +779,6 @@
       double precision bii(15),sij,swj(15),swj2(15),swj0(15),swjy(6),
      1       z1,z2,wj,hakt2,thij(6),thi(6),zz(15),lwj,hs2,hs,z,cc,
      2       wjy,spf,hhomi,hhommax,az1,hfixmax,hnfix
-!$    integer omp_get_thread_num
-!$    external omp_get_thread_num
 C   arrays with variable length are organized as
 C   theta(n1,n2,dp1)
 C   bi(n1,n2,dp2)
