Millepede-II V04-17-03
mille.f90
Go to the documentation of this file.
1
2! Code converted using TO_F90 by Alan Miller
3! Date: 2012-03-03 Time: 17:00:12
4
26
60
61MODULE mpmille
62 USE mpdef
63 IMPLICIT NONE
64 SAVE
65
66 INTEGER(mpi), PARAMETER :: lun=51
67 INTEGER(mpi), PARAMETER :: ndim=10000
68 INTEGER(mpi) :: nr=0
69 INTEGER(mpi) :: icount=0
70 INTEGER(mpi) :: isp
71 REAL(mps) :: glder(ndim)
72 INTEGER(mpi) :: inder(ndim)
73
74END MODULE mpmille
75
89
90SUBROUTINE mille(nlc,derlc,ngl,dergl,label,rmeas,sigma) ! add data
91 USE mpmille
92
93 IMPLICIT NONE
94 INTEGER(mpi) :: i
95 ! -----------------------------------------------------------------
96
97 INTEGER(mpi), INTENT(IN) :: nlc
98 REAL(mps), INTENT(IN) :: derlc(nlc)
99 INTEGER(mpi), INTENT(IN) :: ngl
100 REAL(mps), INTENT(IN) :: dergl(ngl)
101 INTEGER(mpi), INTENT(IN) :: label(ngl)
102 REAL(mps), INTENT(IN) :: rmeas
103 REAL(mps), INTENT(IN) :: sigma
104 ! -----------------------------------------------------------------
105
106 SAVE
107 ! ...
108 IF(sigma <= 0.0) RETURN ! error zero - no measurement
109 IF(nr == 0) THEN
110 nr=1
111 glder(1)=0.0
112 inder(1)=0 ! error counter
113 isp=0
114 END IF
115 IF(nr+nlc+ngl+2 > ndim) THEN
116 icount=icount+1
117 IF(icount <= 10) THEN
118 WRITE(*,*) 'Mille warning: data can not be stored'
119 IF(icount == 10) THEN
120 WRITE(*,*) 'Mille warning: no further printout'
121 END IF
122 END IF
123 inder(1)=inder(1)+1 ! count errors
124 RETURN ! record dimension too small
125 END IF
126 nr=nr+1
127 glder(nr)=rmeas ! measured value
128 inder(nr)=0
129 DO i=1,nlc ! local derivatives
130 IF(derlc(i) /= 0.0) THEN
131 nr=nr+1
132 glder(nr)=derlc(i) ! derivative of local parameter
133 inder(nr)=i ! index of local parameter
134 END IF
135 END DO
136
137 nr=nr+1
138 glder(nr)=sigma ! error of measured value
139 inder(nr)=0
140 DO i=1,ngl ! global derivatives
141 IF(dergl(i) /= 0.0.AND.label(i) > 0) THEN
142 nr=nr+1
143 glder(nr)=dergl(i) ! derivative of global parameter
144 inder(nr)=label(i) ! index of global parameter
145 END IF
146 END DO
147 RETURN
148END SUBROUTINE mille
149
161
162SUBROUTINE millsp(nsp,dergl,label)
163 USE mpmille
164
165 IMPLICIT NONE
166 INTEGER(mpi) :: i
167
168 INTEGER(mpi), INTENT(IN) :: nsp
169 REAL(mps), INTENT(IN) :: dergl(nsp)
170 INTEGER(mpi), INTENT(IN) :: label(nsp)
171
172 IF(nsp <= 0.OR.isp /= 0) RETURN
173 isp=nr
174 IF(nr == 0) THEN
175 nr=1
176 glder(1)=0.0
177 inder(1)=0 ! error counter
178 END IF
179 IF(nr+nsp+2 > ndim) THEN
180 inder(1)=inder(1)+1 ! count errors
181 RETURN ! record dimension too small
182 END IF
183 nr=nr+1 ! zero pair
184 glder(nr)=0.0
185 inder(nr)=0
186 nr=nr+1 ! nsp and zero
187 glder(nr)=-real(nsp,mps)
188 inder(nr)=0
189 DO i=1,nsp
190 nr=nr+1
191 glder(nr)=dergl(i) ! floating-point
192 inder(nr)=label(i) ! integer
193 END DO
194 RETURN
195END SUBROUTINE millsp
196
198SUBROUTINE kille
199 USE mpmille
200
201 IMPLICIT NONE
202
203 nr=0 ! reset
204 RETURN
205END SUBROUTINE kille
206
208SUBROUTINE endle
209 USE mpmille
210
211 IMPLICIT NONE
212 INTEGER(mpi) :: i
213
214 IF(nr > 1) THEN
215 WRITE(lun) nr+nr,(glder(i),i=1,nr),(inder(i),i=1,nr)
216 END IF
217 nr=0 ! reset
218 RETURN
219END SUBROUTINE endle
220
subroutine millsp(nsp, dergl, label)
Add special data.
Definition: mille.f90:163
subroutine kille
Stop record.
Definition: mille.f90:199
subroutine mille(nlc, derlc, ngl, dergl, label, rmeas, sigma)
Add data block to record.
Definition: mille.f90:91
subroutine endle
End-of-record.
Definition: mille.f90:209
Definition of constants.
Definition: mpdef.f90:24
integer, parameter mps
single precision
Definition: mpdef.f90:37
The data transmitted by MILLE calls are collected in two arrays, a real array and an integer array,...
Definition: mille.f90:61
integer(mpi) nr
current record length
Definition: mille.f90:68
integer(mpi), parameter ndim
max.
Definition: mille.f90:67
integer(mpi) icount
number of records exceeding max.
Definition: mille.f90:69
integer(mpi) isp
spcial data flag
Definition: mille.f90:70
integer(mpi), dimension(ndim) inder
integer data record array
Definition: mille.f90:72
integer(mpi), parameter lun
unit
Definition: mille.f90:66
real(mps), dimension(ndim) glder
real data record array
Definition: mille.f90:71