Skip to content

Commit 6635f52

Browse files
committed
Changed ntime_max to ntime on most routines to allow variable-length arrays.
1 parent 95d806f commit 6635f52

7 files changed

Lines changed: 98 additions & 98 deletions

File tree

source/AE8_AP8.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
! whatf -> which kind of flux, 1=differential 2=E range 3=integral (long integer)
5252
! Nene -> Number of energy channels to compute
5353
! energy -> energy (MeV) at which fluxes must be computed (double array [2,25])
54-
! iyear,idoy,UT -> times when flux are to be computed (not usefull if imput position is not in GSE, GSM, SM,GEI) (respectively long array(ntime_max), long array(ntime_max), double array(ntime_max))
54+
! iyear,idoy,UT -> times when flux are to be computed (not usefull if imput position is not in GSE, GSM, SM,GEI) (respectively long array(ntime), long array(ntime), double array(ntime))
5555
! xIN1 -> first coordinate in the chosen system (double array [ntime_max])
5656
! xIN2 -> second coordinate in the chosen system (double array [ntime_max])
5757
! xIN3 -> third coordinate in the chosen system (double array [ntime_max])
@@ -82,10 +82,10 @@ SUBROUTINE fly_in_nasa_aeap1(ntime,sysaxes,whichm,whatf,nene,
8282
INTEGER*4 nene_max
8383
PARAMETER (nene_max=25)
8484
INTEGER*4 ntime,sysaxes,whichm,whatf,Nene
85-
INTEGER*4 iyear(ntime_max),idoy(ntime_max)
85+
INTEGER*4 iyear(ntime),idoy(ntime)
8686
REAL*8 energy(2,nene_max)
87-
REAL*8 UT(ntime_max)
88-
real*8 xIN1(ntime_max),xIN2(ntime_max),xIN3(ntime_max)
87+
REAL*8 UT(ntime)
88+
real*8 xIN1(ntime),xIN2(ntime),xIN3(ntime)
8989
c Declare internal variables
9090
INTEGER*4 k_ext,k_l,isat,kint
9191
INTEGER*4 t_resol,r_resol,Ilflag
@@ -94,8 +94,8 @@ SUBROUTINE fly_in_nasa_aeap1(ntime,sysaxes,whichm,whatf,nene,
9494
REAL*8 xGSM(3),xSM(3),xGEI(3),xGSE(3)
9595
real*8 alti,lati,longi,UT_dip,psi,tilt
9696
REAL*8 ERA,AQUAD,BQUAD
97-
REAL*8 BLOCAL(ntime_max),BMIN(ntime_max),XJ(ntime_max)
98-
REAL*8 Lm(ntime_max),Lstar(ntime_max),BBo(ntime_max)
97+
REAL*8 BLOCAL(ntime),BMIN(ntime),XJ(ntime)
98+
REAL*8 Lm(ntime),Lstar(ntime),BBo(ntime)
9999
c
100100
c Declare output variables
101101
REAL*8 flux(ntime_max,nene_max)

source/AFRL_CRRES_models.f

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
! whatf -> which kind of flux, 1=differential 2=E range 3=integral (long integer)
4242
! Nene -> Number of energy channels to compute
4343
! energy -> energy (MeV) at which fluxes must be computed (double array [2,25])
44-
! iyear,idoy,UT -> times when flux are to be computed (not usefull if imput position is not in GSE, GSM, SM,GEI) (respectively long array(ntime_max), long array(ntime_max), double array(ntime_max))
44+
! iyear,idoy,UT -> times when flux are to be computed (not usefull if imput position is not in GSE, GSM, SM,GEI) (respectively long array(ntime), long array(ntime), double array(ntime))
4545
! xIN1 -> first coordinate in the chosen system (double array [ntime_max])
4646
! xIN2 -> second coordinate in the chosen system (double array [ntime_max])
4747
! xIN3 -> third coordinate in the chosen system (double array [ntime_max])
@@ -65,10 +65,10 @@ SUBROUTINE fly_in_afrl_crres1(ntime,sysaxes,whichm,whatf,nene,
6565
INTEGER*4 nene_max
6666
PARAMETER (nene_max=25)
6767
INTEGER*4 ntime,sysaxes,whichm,whatf,nene
68-
INTEGER*4 iyear(ntime_max),idoy(ntime_max)
68+
INTEGER*4 iyear(ntime),idoy(ntime)
6969
REAL*8 energy(2,nene_max)
70-
REAL*8 UT(ntime_max)
71-
real*8 xIN1(ntime_max),xIN2(ntime_max),xIN3(ntime_max)
70+
REAL*8 UT(ntime)
71+
real*8 xIN1(ntime),xIN2(ntime),xIN3(ntime)
7272
c Declare internal variables
7373
INTEGER*4 k_ext,k_l,isat,kint
7474
INTEGER*4 t_resol,r_resol,Ilflag
@@ -78,9 +78,9 @@ SUBROUTINE fly_in_afrl_crres1(ntime,sysaxes,whichm,whatf,nene,
7878
REAL*8 xGSM(3),xSM(3),xGEI(3),xGSE(3)
7979
real*8 alti,lati,longi,psi,tilt
8080
REAL*8 ERA,AQUAD,BQUAD
81-
REAL*8 BLOCAL(ntime_max),BMIN(ntime_max),XJ(ntime_max)
82-
REAL*8 Lm(ntime_max),Lstar(ntime_max),BBo(ntime_max)
83-
REAL*8 Ap15(ntime_max)
81+
REAL*8 BLOCAL(ntime),BMIN(ntime),XJ(ntime)
82+
REAL*8 Lm(ntime),Lstar(ntime),BBo(ntime)
83+
REAL*8 Ap15(ntime)
8484
c
8585
c Declare output variables
8686
REAL*8 flux(ntime_max,nene_max)
@@ -186,8 +186,8 @@ SUBROUTINE get_crres_flux(ntmax,whichm,whatf,nene,
186186
c
187187
INTEGER*4 Ne,Nl,Nbb0,ind
188188
c
189-
REAL*8 energy(2,25)
190-
REAL*8 flux(ntime_max,25),BBo(ntime_max),L(ntime_max)
189+
REAL*8 energy(2,nene)
190+
REAL*8 flux(ntime_max,nene),BBo(ntime_max),L(ntime_max)
191191
REAL*8 Ap15(ntime_max)
192192
REAL*8 pente,cste,Flux1,Flux2
193193
c
@@ -209,7 +209,7 @@ SUBROUTINE get_crres_flux(ntmax,whichm,whatf,nene,
209209
c
210210
c init
211211
DO i=1,ntmax
212-
do ieny=1,25
212+
do ieny=1,nene
213213
Flux(i,ieny) = baddata
214214
enddo
215215
enddo

source/CoordTrans.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,8 +2818,8 @@ SUBROUTINE coord_trans_vec1(ntime,sysaxesIN,sysaxesOUT,
28182818
INCLUDE 'variables.inc'
28192819

28202820
INTEGER*4 nmax,i,ntime, sysaxesIN, sysaxesOUT
2821-
INTEGER*4 iyear(ntime_max),idoy(ntime_max),y,d
2822-
REAL*8 secs(ntime_max),xINV(3,ntime_max),xOUTV(3,ntime_max)
2821+
INTEGER*4 iyear(ntime),idoy(ntime),y,d
2822+
REAL*8 secs(ntime),xINV(3,ntime),xOUTV(3,ntime)
28232823
! local vars
28242824
REAL*8 xIN(3),xOUT(3),s
28252825

source/LAndI2Lstar.f

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20518,11 +20518,11 @@ SUBROUTINE LAndI2Lstar1(ntime,kext,options,sysaxes,iyearsat,
2051820518
c declare inputs
2051920519
INTEGER*4 kext,k_ext,k_l,options(5)
2052020520
INTEGER*4 ntime,sysaxes
20521-
INTEGER*4 iyearsat(ntime_max)
20522-
integer*4 idoy(ntime_max)
20523-
real*8 UT(ntime_max)
20524-
real*8 xIN1(ntime_max),xIN2(ntime_max),xIN3(ntime_max)
20525-
real*8 maginput(25,ntime_max)
20521+
INTEGER*4 iyearsat(ntime)
20522+
integer*4 idoy(ntime)
20523+
real*8 UT(ntime)
20524+
real*8 xIN1(ntime),xIN2(ntime),xIN3(ntime)
20525+
real*8 maginput(25,ntime)
2052620526
c 1: Kp
2052720527
c 2: Dst
2052820528
c 3: dens
@@ -20538,9 +20538,9 @@ SUBROUTINE LAndI2Lstar1(ntime,kext,options,sysaxes,iyearsat,
2053820538
INTEGER*4 option1,isat
2053920539
c
2054020540
c Declare output variables
20541-
REAL*8 BLOCAL(ntime_max),BMIN(ntime_max),XJ(ntime_max)
20542-
REAL*8 MLT(ntime_max)
20543-
REAL*8 Lm(ntime_max),Lstar(ntime_max)
20541+
REAL*8 BLOCAL(ntime),BMIN(ntime),XJ(ntime)
20542+
REAL*8 MLT(ntime)
20543+
REAL*8 Lm(ntime),Lstar(ntime)
2054420544
C
2054520545
c This method to compute L* is only available for IGRF + Olson-Pfitzer quiet
2054620546
if (options(5) .ne. 0) options(5)=0 ! force internal field to be IGRF
@@ -20602,12 +20602,12 @@ SUBROUTINE LAndI2Lstar_shell_splitting1(ntime,Nipa,kext,options,
2060220602
INTEGER*4 kext,k_ext,k_l,options(5),Nalp,Nipa
2060320603
PARAMETER (Nalp=25)
2060420604
INTEGER*4 ntime,sysaxes
20605-
INTEGER*4 iyearsat(ntime_max)
20606-
integer*4 idoy(ntime_max)
20607-
real*8 UT(ntime_max)
20608-
real*8 xIN1(ntime_max),xIN2(ntime_max),xIN3(ntime_max)
20605+
INTEGER*4 iyearsat(ntime)
20606+
integer*4 idoy(ntime)
20607+
real*8 UT(ntime)
20608+
real*8 xIN1(ntime),xIN2(ntime),xIN3(ntime)
2060920609
real*8 alpha(Nalp)
20610-
real*8 maginput(25,ntime_max)
20610+
real*8 maginput(25,ntime)
2061120611
c 1: Kp
2061220612
c 2: Dst
2061320613
c 3: dens
@@ -20621,16 +20621,16 @@ SUBROUTINE LAndI2Lstar_shell_splitting1(ntime,Nipa,kext,options,
2062120621
c
2062220622
c Declare internal variables
2062320623
INTEGER*4 option1,isat,IPA,ntime_tmp,sysaxesOUT,sysaxesIN
20624-
REAL*8 BLOCAL_tmp(ntime_max),BMIN_tmp(ntime_max)
20625-
REAL*8 XJ_tmp(ntime_max),MLT_tmp(ntime_max)
20626-
REAL*8 Lm_tmp(ntime_max),Lstar_tmp(ntime_max)
20624+
REAL*8 BLOCAL_tmp(ntime),BMIN_tmp(ntime)
20625+
REAL*8 XJ_tmp(ntime),MLT_tmp(ntime)
20626+
REAL*8 Lm_tmp(ntime),Lstar_tmp(ntime)
2062720627
REAL*8 xIN(3),xOUT(3),BL,BMIR,xGEO(3)
2062820628
REAL*8 maginput_tmp(25)
2062920629
INTEGER*4 imagin
2063020630
c
2063120631
c Declare output variables
20632-
REAL*8 BLOCAL(ntime_max,Nalp),BMIN(ntime_max)
20633-
REAL*8 XJ(ntime_max,Nalp),MLT(ntime_max)
20632+
REAL*8 BLOCAL(ntime_max,Nalp),BMIN(ntime)
20633+
REAL*8 XJ(ntime_max,Nalp),MLT(ntime)
2063420634
REAL*8 Lm(ntime_max,Nalp),Lstar(ntime_max,Nalp)
2063520635
C
2063620636
c This method to compute L* is only available for IGRF + Olson-Pfitzer quiet
@@ -20741,9 +20741,9 @@ SUBROUTINE EmpiricalLstar1(ntime,kext,options,iyearsat,idoy,
2074120741
c declare inputs
2074220742
INTEGER*4 kext,options(5)
2074320743
INTEGER*4 ntime
20744-
INTEGER*4 iyearsat(ntime_max)
20745-
integer*4 idoy(ntime_max)
20746-
real*8 maginput(25,ntime_max)
20744+
INTEGER*4 iyearsat(ntime)
20745+
integer*4 idoy(ntime)
20746+
real*8 maginput(25,ntime)
2074720747
c 1: Kp
2074820748
c 2: Dst
2074920749
c 3: dens
@@ -20755,7 +20755,7 @@ SUBROUTINE EmpiricalLstar1(ntime,kext,options,iyearsat,idoy,
2075520755
c 9: G2
2075620756
c 10: G3
2075720757
c
20758-
REAL*8 XJ(ntime_max),Lm(ntime_max)
20758+
REAL*8 XJ(ntime),Lm(ntime)
2075920759
c
2076020760
c Declare internal variables
2076120761
INTEGER*4 isat,DayIndexL,DayIndexR,i,iflag,kint
@@ -20774,7 +20774,7 @@ SUBROUTINE EmpiricalLstar1(ntime,kext,options,iyearsat,idoy,
2077420774
common /rconst/rad,pi
2077520775
c
2077620776
c Declare output variables
20777-
REAL*8 Lstar(ntime_max)
20777+
REAL*8 Lstar(ntime)
2077820778
C
2077920779
COMMON/LAndI2LstarCom/Lmax,Imax,Lupper,Iupper,Lm4,A0,A1,A2,A3,A4,
2078020780
&Lm5,A50,A51,A52,A53,A54,A55

source/get_bderivs.f

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ SUBROUTINE GET_Bderivs(ntime,kext,options,sysaxes,dX,
6161
C computes derivatives of B (vector and magnitude)
6262
C inputs: ntime through maginput have the usual meaning, except dX
6363
C REAL*8 dX is the step size, in RE for the numerical derivatives (recommend 1E-3?)
64-
C real*8 Bgeo(3,ntime_max) - components of B in GEO, nT
65-
C real*8 Bmag(ntime_max) - magnitude of B in nT
66-
C real*8 gradBmag(3,ntime_max) - gradient of Bmag in GEO, nT/RE
67-
C real*8 diffB(3,3,ntime_max) - derivatives of Bgeo in GEO, nT/RE
64+
C real*8 Bgeo(3,ntime) - components of B in GEO, nT
65+
C real*8 Bmag(ntime) - magnitude of B in nT
66+
C real*8 gradBmag(3,ntime) - gradient of Bmag in GEO, nT/RE
67+
C real*8 diffB(3,3,ntime) - derivatives of Bgeo in GEO, nT/RE
6868
C diffB(i,j,t) = dB_i/dx_j for point t (t=1 to ntime)
6969
7070
IMPLICIT NONE
@@ -77,17 +77,17 @@ SUBROUTINE GET_Bderivs(ntime,kext,options,sysaxes,dX,
7777
INTEGER*4 ntime,kext,options(5)
7878
INTEGER*4 sysaxes
7979
REAL*8 dX
80-
INTEGER*4 iyearsat(ntime_max)
81-
integer*4 idoy(ntime_max)
82-
real*8 UT(ntime_max)
83-
real*8 xIN1(ntime_max),xIN2(ntime_max),xIN3(ntime_max)
84-
real*8 maginput(25,ntime_max)
80+
INTEGER*4 iyearsat(ntime)
81+
integer*4 idoy(ntime)
82+
real*8 UT(ntime)
83+
real*8 xIN1(ntime),xIN2(ntime),xIN3(ntime)
84+
real*8 maginput(25,ntime)
8585
8686
c declare outputs
87-
real*8 Bgeo(3,ntime_max) ! components of B in GEO, nT
88-
real*8 Bmag(ntime_max) ! magnitude of B in nT
89-
real*8 gradBmag(3,ntime_max) ! gradient of Bmag in GEO, nT/RE
90-
real*8 diffB(3,3,ntime_max) ! derivatives of Bgeo in GEO, nT/RE
87+
real*8 Bgeo(3,ntime) ! components of B in GEO, nT
88+
real*8 Bmag(ntime) ! magnitude of B in nT
89+
real*8 gradBmag(3,ntime) ! gradient of Bmag in GEO, nT/RE
90+
real*8 diffB(3,3,ntime) ! derivatives of Bgeo in GEO, nT/RE
9191
9292
c declare internal variables
9393
integer*4 isat
@@ -177,20 +177,20 @@ SUBROUTINE compute_grad_curv_curl(ntime,Bgeo,Bmag,gradBmag,diffB,
177177
C all coordinates are in GEO reference frame
178178
C inputs:
179179
integer*4 ntime ! number of points
180-
real*8 Bgeo(3,ntime_max) ! components of B in GEO, nT
181-
real*8 Bmag(ntime_max) ! magnitude of B in nT
182-
real*8 gradBmag(3,ntime_max) ! gradient of Bmag in GEO, nT/RE
183-
real*8 diffB(3,3,ntime_max) ! derivatives of Bgeo in GEO, nT/RE
180+
real*8 Bgeo(3,ntime) ! components of B in GEO, nT
181+
real*8 Bmag(ntime) ! magnitude of B in nT
182+
real*8 gradBmag(3,ntime) ! gradient of Bmag in GEO, nT/RE
183+
real*8 diffB(3,3,ntime) ! derivatives of Bgeo in GEO, nT/RE
184184
c diffB(i,j,t) = dB_i/dx_j for point t (t=1 to ntime)
185185
c outputs:
186-
real*8 grad_par(ntime_max) ! gradient of Bmag along B nT/RE
187-
real*8 grad_perp(3,ntime_max) ! gradient of Bmag perpendicular to B nT/RE
188-
real*8 grad_drift(3,ntime_max) ! (bhat x grad_perp)/B, 1/RE (part of gradient drift velocity)
189-
real*8 curvature(3,ntime_max) ! (bhat dot grad)bhat, 1/RE (part of curvature force)
190-
real*8 Rcurv(ntime_max) ! 1/|curvature| RE (radius of curvature)
191-
real*8 curv_drift(3,ntime_max) ! (bhat x curvature), 1/RE (part of curvature drift)
192-
real*8 curlB(3,ntime_max) ! curl of B (nT/RE) (part of electrostatic current term)
193-
real*8 divB(ntime_max) ! divergence of B (nT/RE) (should be zero!)
186+
real*8 grad_par(ntime) ! gradient of Bmag along B nT/RE
187+
real*8 grad_perp(3,ntime) ! gradient of Bmag perpendicular to B nT/RE
188+
real*8 grad_drift(3,ntime) ! (bhat x grad_perp)/B, 1/RE (part of gradient drift velocity)
189+
real*8 curvature(3,ntime) ! (bhat dot grad)bhat, 1/RE (part of curvature force)
190+
real*8 Rcurv(ntime) ! 1/|curvature| RE (radius of curvature)
191+
real*8 curv_drift(3,ntime) ! (bhat x curvature), 1/RE (part of curvature drift)
192+
real*8 curlB(3,ntime) ! curl of B (nT/RE) (part of electrostatic current term)
193+
real*8 divB(ntime) ! divergence of B (nT/RE) (should be zero!)
194194
195195
196196
c internal variables

source/get_hemi.f

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,22 @@ SUBROUTINE GET_HEMI1(kext,options,sysaxes,iyearsat,idoy,UT,
9191
9292
SUBROUTINE GET_HEMI_MULTI(ntime,kext,options,sysaxes,iyearsat,
9393
& idoy,UT,xIN1,xIN2,xIN3,maginput,xHEMI)
94-
c calls get_hemi1 multiple times (ntime, <= ntime_max)
94+
c calls get_hemi1 multiple times (ntime, <= ntime)
9595
IMPLICIT NONE
9696
INCLUDE 'variables.inc'
9797
INCLUDE 'ntime_max.inc' ! include file created by make, defines ntime_max
9898
9999
c declare inputs
100100
INTEGER*4 ntime,kext,options(5)
101101
INTEGER*4 sysaxes
102-
INTEGER*4 iyearsat(ntime_max)
103-
integer*4 idoy(ntime_max)
104-
real*8 UT(ntime_max)
105-
real*8 xIN1(ntime_max),xIN2(ntime_max),xIN3(ntime_max)
106-
real*8 maginput(25,ntime_max)
102+
INTEGER*4 iyearsat(ntime)
103+
integer*4 idoy(ntime)
104+
real*8 UT(ntime)
105+
real*8 xIN1(ntime),xIN2(ntime),xIN3(ntime)
106+
real*8 maginput(25,ntime)
107107
108108
c declare outputs
109-
integer*4 xHEMI(ntime_max)
109+
integer*4 xHEMI(ntime)
110110
111111
c declare internal variables
112112
integer*4 isat

0 commit comments

Comments
 (0)