From 44ebf7a3f1f25c90b5dc0fdea489bf9e98ba5d79 Mon Sep 17 00:00:00 2001
From: gnikit <giannis.nikiteas@gmail.com>
Date: Mon, 13 Jun 2022 05:15:03 +0100
Subject: [PATCH] Removed `M_PI` variable

Fortran moules are public by default so limiting the number of
unecessary variables is important as to not populate the global scope.
---
 api/GenApi.py            | 1 -
 tutorials/fortran/t2.f90 | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/api/GenApi.py b/api/GenApi.py
index 18e000c5ad..6d76db6a80 100644
--- a/api/GenApi.py
+++ b/api/GenApi.py
@@ -1403,7 +1403,6 @@ module gmsh
     integer, parameter :: {2}_API_VERSION_MINOR = {5}
     integer, parameter :: {2}_API_VERSION_PATCH = {6}
     character(len=100), parameter :: {2}_API_VERSION = "{4}.{5}.{6}"
-    real(c_double), parameter::M_PI = 3.14159265358979323846d0
 
     interface
 """
diff --git a/tutorials/fortran/t2.f90 b/tutorials/fortran/t2.f90
index 90dc7fdf5d..d898ca260d 100644
--- a/tutorials/fortran/t2.f90
+++ b/tutorials/fortran/t2.f90
@@ -98,7 +98,7 @@ program main
 
     call gmshModelGeoTranslate(t, 2_8, -0.02d0, 0d0, 0d0, ierr)
 
-    call gmshModelGeoRotate(t, 2_8, 0d0, 0.3d0, 0d0, 0d0, 0d0, 1d0, -M_PI / 4d0, ierr)
+    call gmshModelGeoRotate(t, 2_8, 0d0, 0.3d0, 0d0, 0d0, 0d0, 1d0, -acos(1.0) / 4d0, ierr)
 
     call gmshModelGeoCopy(iv, 2_8, ov, ov_n, ierr)
 
-- 
GitLab