From a25afe586ecbe2a5ae319b84b26616b7ff47adfd Mon Sep 17 00:00:00 2001 From: Lucas Nicolle Date: Wed, 3 Dec 2025 15:00:31 +0100 Subject: [PATCH 1/2] patching make_lstar that returned different results for the same inputs --- source/onera_desp_lib.f | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/onera_desp_lib.f b/source/onera_desp_lib.f index 08a968d2..c7c5fe8e 100644 --- a/source/onera_desp_lib.f +++ b/source/onera_desp_lib.f @@ -130,13 +130,14 @@ SUBROUTINE make_lstar1(ntime,kext,options,sysaxes,iyearsat, GOTO 99 endif c + Ilflag=0 CALL calcul_Lstar_opt(t_resol,r_resol,XGeo & ,Lm(isat),Lstar(isat),XJ(isat),BLOCAL(isat),BMIN(isat)) - if (Ilflag_old .eq.1 .and. Lstar(isat).eq. Baddata) then - Ilflag=0 - CALL calcul_Lstar_opt(t_resol,r_resol,xGeo - & ,Lm(isat),Lstar(isat),XJ(isat),BLOCAL(isat),BMIN(isat)) - endif +c if (Ilflag_old .eq.1 .and. Lstar(isat).eq. Baddata) then +c Ilflag=0 +c CALL calcul_Lstar_opt(t_resol,r_resol,xGeo +c & ,Lm(isat),Lstar(isat),XJ(isat),BLOCAL(isat),BMIN(isat)) +c endif Ilflag_old=Ilflag 99 continue From 9d0ba28026e8484343714f22be6f2ce21abe61bd Mon Sep 17 00:00:00 2001 From: Lucas Nicolle Date: Wed, 3 Dec 2025 16:10:16 +0100 Subject: [PATCH 2/2] getting rid of the Ilflag inside the make_lstar1 routine --- source/calcul_Lstar_o.f | 7 ++----- source/onera_desp_lib.f | 12 +----------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/source/calcul_Lstar_o.f b/source/calcul_Lstar_o.f index 99c11dc4..a91275c3 100644 --- a/source/calcul_Lstar_o.f +++ b/source/calcul_Lstar_o.f @@ -80,6 +80,7 @@ SUBROUTINE calcul_Lstar_opt(t_resol,r_resol, common /rconst/rad,pi C C + Ilflag = 0 Nder=Nder_def*r_resol Nreb=Nreb_def Ntet=Ntet_def*t_resol @@ -286,14 +287,10 @@ SUBROUTINE calcul_Lstar_opt(t_resol,r_resol, phi(I) = phi(I-1)+2.D0*pi/Nder Iflag_I = 0 c write(6,*)tet(I) - IF (Ilflag.EQ.0) THEN tetl = tet(I-1) IF (I.GT.2) tetl = 2.D0*tet(I-1)-tet(I-2) tet1 = tetl - ELSE - tetl = tet(I) - tet1 = tetl - ENDIF + c write(6,*)tetl c read(5,*) leI1 = baddata diff --git a/source/onera_desp_lib.f b/source/onera_desp_lib.f index c7c5fe8e..5f010325 100644 --- a/source/onera_desp_lib.f +++ b/source/onera_desp_lib.f @@ -64,7 +64,7 @@ SUBROUTINE make_lstar1(ntime,kext,options,sysaxes,iyearsat, c c Declare internal variables INTEGER*4 isat,iyear,kint,ifail - INTEGER*4 t_resol,r_resol,Ilflag,Ilflag_old + INTEGER*4 t_resol,r_resol REAL*8 mlon,mlon1 REAL*8 xGEO(3),xMAG(3),xSUN(3),rM,MLAT real*8 alti,lati,longi @@ -75,12 +75,9 @@ SUBROUTINE make_lstar1(ntime,kext,options,sysaxes,iyearsat, REAL*8 Lm(ntime_max),Lstar(ntime_max) C COMMON /magmod/k_ext,k_l,kint - COMMON /flag_L/Ilflag DATA xSUN /1.d0,0.d0,0.d0/ integer*4 int_field_select, ext_field_select C - Ilflag=0 - Ilflag_old=Ilflag if (options(3).lt.0 .or. options(3).gt.9) options(3)=0 t_resol=options(3)+1 r_resol=options(4)+1 @@ -130,15 +127,8 @@ SUBROUTINE make_lstar1(ntime,kext,options,sysaxes,iyearsat, GOTO 99 endif c - Ilflag=0 CALL calcul_Lstar_opt(t_resol,r_resol,XGeo & ,Lm(isat),Lstar(isat),XJ(isat),BLOCAL(isat),BMIN(isat)) -c if (Ilflag_old .eq.1 .and. Lstar(isat).eq. Baddata) then -c Ilflag=0 -c CALL calcul_Lstar_opt(t_resol,r_resol,xGeo -c & ,Lm(isat),Lstar(isat),XJ(isat),BLOCAL(isat),BMIN(isat)) -c endif - Ilflag_old=Ilflag 99 continue