42 1 IPART ,RNOISE ,IPARTC ,IPARTG ,IGRPART ,
43 2 IPM ,PERTURB ,LSUBMODEL,UNITAB ,IDPERTURB,
44 3 INDEX ,INDEX_ITYP,NPART_SHELL,OFFS,QP_IPERTURB,
55 USE format_mod ,
ONLY : lfield
59#include "implicit_f.inc"
71 TYPE (UNIT_TYPE_),
INTENT(IN) ::UNITAB
73 . RNOISE(NPERTURB,NUMELC+NUMELTG+NUMELS+NUMSPH),
74 . QP_RPERTURB(NPERTURB,4)
77 . perturb(nperturb),offs,
78 . idperturb(nperturb),index(numelc+numeltg+numels+numsph),
79 . index_ityp(numelc+numeltg+numels+numsph),npart_shell,
80 . qp_iperturb(nperturb,6)
83 TYPE (GROUP_) ,
DIMENSION(NGRPART) :: IGRPART
87 INTEGER I,J,K,NUMA,I_METHOD,MAX_PART,
88 . ,NB_RANDOM,I_SEED,DISTRIB(50),
89 . II,NB_INTERV,IGRPRT,N,IOK,SEED,SEED_RANDOM,
90 . ITYP,I_PERTURB_VAR,SIZEY,EMPTY
91 CHARACTER(LEN=NCHARTITLE) :: TITR
92 INTEGER,
DIMENSION(:,:),
ALLOCATABLE :: TAB_PART
93 INTEGER,
DIMENSION(:),
ALLOCATABLE :: A_SEED
94 INTEGER,
DIMENSION(1:8) :: DT_SEED
96 . mean,sd,mean_input,sd_input,max_distrib,temp,min_value,
97 . max_value,minval,maxval,bid
98 my_real,
DIMENSION(:),
ALLOCATABLE :: array
99 CHARACTER*100 CHAR(100)
100 CHARACTER*100 CHAR1(100)
103 CHARACTER(LEN=NCHARFIELD)::CHVAR
108 DATA mess/
'PERTURBATION DEFINITION '/
117 is_available = .false.
122 DO i=1+offs,npart_shell+offs
128 . option_titr = titr)
140 CALL hm_get_intv(
'grpart_ID' ,igrprt ,is_available,lsubmodel)
142 IF (chvar(1:5) ==
'thick' .OR. chvar(1:5) ==
'THICK') i_perturb_var = 1
146 IF(chvar(k:k) /=
' ') empty = 0
150 IF (i_perturb_var /= 1 .AND. empty == 0)
CALL ancmsg(msgid=1194,
158 IF (igrprt /= 0)
THEN
160 IF (igrpart(n)%ID == igrprt)
THEN
180 . c2=
'GROUP OF PART')
182 cpt_part = igrpart(igrprt)%NENTITY
184 max_part =
max(max_part,cpt_part)
187 ALLOCATE(tab_part(nperturb,max_part))
193 DO i = 1+offs,npart_shell+offs
196 index(1:(numelc+numeltg+numels+numsph)) = 0
197 index_ityp(1:numelc+numeltg+numels+numsph) = 0
202 . option_id = idperturb(i),
203 . option_titr = titr)
209 CALL hm_get_floatv(
'F_Mean' ,mean ,is_available, lsubmodel, unitab)
210 CALL hm_get_floatv(
'Deviation' ,sd ,is_available, lsubmodel, unitab)
211 CALL hm_get_floatv(
'Min_cut' ,minval ,is_available, lsubmodel, unitab)
212 CALL hm_get_floatv(
'Max_cut' ,maxval ,is_available, lsubmodel, unitab)
213 CALL hm_get_intv(
'Seed' ,seed ,is_available, lsubmodel)
214 CALL hm_get_intv(
'Idistri' ,i_method,is_available, lsubmodel)
217 IF(i_method == 0) i_method = 2
218 IF(minval == zero .AND. maxval == zero)
THEN
219 IF(i_method == 1)
THEN
220 ELSEIF(i_method == 2)
THEN
229 qp_iperturb(i,1) = idperturb(i)
230 qp_iperturb(i,2) = ityp
231 qp_iperturb(i,3) = seed
232 qp_iperturb(i,4) = i_method
233 qp_rperturb(i,1) = mean
234 qp_rperturb(i,2) = sd
235 qp_rperturb(i,3) = minval
236 qp_rperturb(i,4) = maxval
244 CALL hm_get_intv(
'grpart_ID',igrprt,is_available,lsubmodel)
245 qp_iperturb(i,5) = igrprt
247 IF (chvar(1:5) ==
'thick' .OR. chvar(1:5) ==
'THICK') qp_iperturb(i,6) = 1
250 IF (igrprt /= 0)
THEN
252 IF (igrpart(n)%ID == igrprt)
THEN
264 DO j=1,igrpart(igrprt)%NENTITY
265 cpt_part = cpt_part + 1
266 numa = igrpart(igrprt)%ENTITY(j)
267 tab_part(i,cpt_part) = numa
272 IF(i_method == 2)
THEN
274 . idperturb(i),
'GAUSSIAN',mean_input,sd_input,seed
275 WRITE (iout,
'(10I10)') ipart(4,tab_part(i,1:cpt_part))
278 ELSEIF(i_method == 1)
THEN
280 . idperturb(i),
'RANDOM',seed
281 WRITE (iout,
'(10I10)') ipart(4,tab_part(i,1:cpt_part))
290 IF (ipartc(ii) == tab_part(i,k))
THEN
291 nb_random = nb_random + 1
292 index(nb_random) = ii
293 index_ityp(nb_random) = 3
299 IF(ipartg(ii) == tab_part(i,k))
THEN
300 nb_random = nb_random + 1
301 index(nb_random) = ii
302 index_ityp(nb_random) = 7
309 CALL random_seed(size=i_seed)
310 ALLOCATE(a_seed(1:i_seed))
311 CALL random_seed(get=a_seed)
312 CALL date_and_time(values=dt_seed)
314 seed=dt_seed(8)*dt_seed(7)*dt_seed(6)
315 CALL random_seed(put=a_seed)
319 CALL random_seed(size=i_seed)
320 ALLOCATE(a_seed(1:i_seed))
322 CALL random_seed(put=a_seed)
332 ALLOCATE(array(nb_random+2))
333 CALL random_number(array)
338 IF ( i_method == 2)
THEN
339 DO ii = 1, nb_random+1, 2
340 temp = sd * sqrt(-2.0*log(array(ii))) * cos(2*pi*array(ii+1)) +
343 . sd * sqrt(-2.0*log(array(ii))) * sin(2*pi*array(ii+1)) + mean
347 array(ii) =
max(
min(maxval,array(ii)),minval)
348 max_value =
max(array(ii),max_value)
349 min_value =
min(array(ii),min_value)
351 ELSEIF(i_method == 1)
THEN
353 array(ii) = array(ii)*(maxval-minval)+minval
354 max_value =
max(array(ii),max_value)
355 min_value =
min(array(ii),min_value)
361 IF (index_ityp(ii) == 3)
THEN
362 rnoise(i,index(ii)) = array(ii)
363 ELSEIF (index_ityp(ii) == 7)
THEN
364 rnoise(i,index(ii)+numelc) = array(ii)
369 mean = sum(array)/nb_random
370 sd = sqrt(sum((array - mean)**2)/nb_random)
373 IF(i_method == 2)
THEN
374 max_distrib = one /(sd*sqrt(two * pi))
375 ELSEIF(i_method == 1)
THEN
376 max_distrib = one /(max_value-min_value)
382 IF (minval /= -ep30 .AND. maxval /= ep30)
THEN
386 CALL plot_distrib( array,nb_random, nb_interv,sizey,min_value,
387 . max_value,max_distrib,
'#')
388 IF(i_method == 2)
THEN
389 WRITE (iout,2000) mean,sd
390 ELSEIF(i_method == 1)
THEN
391 WRITE (iout,2050) mean
393 IF(seed_random == 1)
WRITE (iout,2100) seed
396 IF (
ALLOCATED(array))
DEALLOCATE(array)
400 1000
FORMAT(/
' PERTURBATION ID',i10/
401 +
' ---------------'/
402 +
' TYPE . . . . . . . . . . . . . . .',a/
403 +
' INPUT MEAN VALUE . . . . . . . . .',1pg20.13/
404 +
' INPUT STANDARD DEVIATION . . . . .',1pg20.13/
405 +
' INPUT SEED VALUE . . . . . . . . .',i10/
406 +
' SHELL THICKNESSES, PARTS:')
407 1100
FORMAT(/
' PERTURBATION ID',i10/
408 +
' ---------------'/
409 +
' TYPE . . . . . . . . . . . . . . .',a/
410 +
' INPUT SEED VALUE . . . . . . . . .',i10/
411 +
' SHELL THICKNESSES, PARTS:')
414 +
' GENERATED MEAN VALUE . . . . . . .',1pg20.13/
415 +
' GENERATED STANDARD DEVIATION . . .',1pg20.13)
417 +
' GENERATED MEAN VALUE . . . . . . .',1pg20.13)
419 +
' GENERATED SEED VALUE . . . . . . .',i10/)
422 +
' DISTRIBUTION OF SCALE FACTORS APPLIED TO THICKNESSES OF SHELLS')
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)