Adam's changes
[unres.git] / source / wham / src-M-SAXS / store_parm.F
1               subroutine store_parm(iparm)
2 C
3 C Store parameters of set IPARM
4 C valence angles and the side chains and energy parameters.
5 C
6       implicit none
7       include 'DIMENSIONS'
8       include 'DIMENSIONS.ZSCOPT'
9       include 'DIMENSIONS.FREE'
10       include 'COMMON.IOUNITS'
11       include 'COMMON.CHAIN'
12       include 'COMMON.INTERACT'
13       include 'COMMON.GEO'
14       include 'COMMON.LOCAL'
15       include 'COMMON.TORSION'
16       include 'COMMON.FFIELD'
17       include 'COMMON.NAMES'
18       include 'COMMON.SBRIDGE'
19       include 'COMMON.SCROT'
20       include 'COMMON.SCCOR'
21       include 'COMMON.ALLPARM'
22       integer i,ii,j,k,l,m,mm,iparm,ichir1,ichir2,iblock,iii
23
24 c Store weights
25       ww_all(1,iparm)=wsc
26       ww_all(2,iparm)=wscp
27       ww_all(3,iparm)=welec
28       ww_all(4,iparm)=wcorr
29       ww_all(5,iparm)=wcorr5
30       ww_all(6,iparm)=wcorr6
31       ww_all(7,iparm)=wel_loc
32       ww_all(8,iparm)=wturn3
33       ww_all(9,iparm)=wturn4
34       ww_all(10,iparm)=wturn6
35       ww_all(11,iparm)=wang
36       ww_all(12,iparm)=wscloc
37       ww_all(13,iparm)=wtor
38       ww_all(14,iparm)=wtor_d
39       ww_all(15,iparm)=wstrain
40       ww_all(16,iparm)=wvdwpp
41       ww_all(17,iparm)=wbond
42       ww_all(19,iparm)=wsccor
43       ww_all(22,iparm)=wliptran
44       ww_all(26,iparm)=wsaxs
45 c Store bond parameters
46       vbldp0_all(iparm)=vbldp0
47       akp_all(iparm)=akp
48       do i=1,ntyp
49         nbondterm_all(i,iparm)=nbondterm(i)
50         do j=1,nbondterm(i)
51           vbldsc0_all(j,i,iparm)=vbldsc0(j,i)
52           aksc_all(j,i,iparm)=aksc(j,i)
53           abond0_all(j,i,iparm)=abond0(j,i)
54         enddo
55       enddo
56 c Store bond angle parameters
57 #ifdef CRYST_THETA
58       do i=-ntyp,ntyp
59         a0thet_all(i,iparm)=a0thet(i)
60         do ichir1=-1,1
61         do ichir2=-1,1
62         do j=1,2
63           athet_all(j,i,ichir1,ichir2,iparm)=athet(j,i,ichir1,ichir2)
64           bthet_all(j,i,ichir1,ichir2,iparm)=bthet(j,i,ichir1,ichir2)
65         enddo
66         enddo
67         enddo
68         do j=0,3
69           polthet_all(j,i,iparm)=polthet(j,i)
70         enddo
71         do j=1,3
72           gthet_all(j,i,iparm)=gthet(j,i)
73         enddo
74         theta0_all(i,iparm)=theta0(i)
75         sig0_all(i,iparm)=sig0(i)
76         sigc0_all(i,iparm)=sigc0(i)
77       enddo
78 #else
79       nthetyp_all(iparm)=nthetyp
80       ntheterm_all(iparm)=ntheterm
81       ntheterm2_all(iparm)=ntheterm2
82       ntheterm3_all(iparm)=ntheterm3
83       nsingle_all(iparm)=nsingle
84       ndouble_all(iparm)=ndouble
85       nntheterm_all(iparm)=nntheterm
86       do i=-ntyp,ntyp
87         ithetyp_all(i,iparm)=ithetyp(i)
88       enddo
89       do iblock=1,2
90       do i=-maxthetyp1,maxthetyp1
91         do j=-maxthetyp1,maxthetyp1
92           do k=-maxthetyp1,maxthetyp1
93             aa0thet_all(i,j,k,iblock,iparm)=aa0thet(i,j,k,iblock)
94             do l=1,ntheterm
95               aathet_all(l,i,j,k,iblock,iparm)=aathet(l,i,j,k,iblock)
96             enddo
97             do l=1,ntheterm2
98               do m=1,nsingle
99                 bbthet_all(m,l,i,j,k,iblock,iparm)=
100      & bbthet(m,l,i,j,k,iblock)
101                 ccthet_all(m,l,i,j,k,iblock,iparm)=
102      &ccthet(m,l,i,j,k,iblock)
103                 ddthet_all(m,l,i,j,k,iblock,iparm)=
104      &ddthet(m,l,i,j,k,iblock)
105                 eethet_all(m,l,i,j,k,iblock,iparm)=
106      &eethet(m,l,i,j,k,iblock)
107               enddo
108             enddo
109             do l=1,ntheterm3
110               do m=1,ndouble
111                 do mm=1,ndouble
112                 if (iblock.eq.1) then
113                  ffthet_all1(mm,m,l,i,j,k,iparm)=
114      &   ffthet(mm,m,l,i,j,k,iblock)
115                  ggthet_all1(mm,m,l,i,j,k,iparm)=
116      &ggthet(mm,m,l,i,j,k,iblock)
117                   else
118                  ffthet_all2(mm,m,l,i,j,k,iparm)=
119      &   ffthet(mm,m,l,i,j,k,iblock)
120                  ggthet_all2(mm,m,l,i,j,k,iparm)=
121      &ggthet(mm,m,l,i,j,k,iblock)
122                   endif
123                 enddo
124               enddo
125             enddo
126           enddo
127         enddo
128       enddo
129       enddo
130 #endif
131 #ifdef CRYST_SC
132 c Store the sidechain rotamer parameters
133       do i=-ntyp,ntyp
134        iii=iabs(i)
135 cc       write (iout,*) i,"storeparm1"
136        if (i.eq.0) cycle
137         nlob_all(iii,iparm)=nlob(iii)
138         do j=1,nlob(iii)
139           bsc_all(j,iii,iparm)=bsc(j,iii)
140           do k=1,3
141             censc_all(k,j,i,iparm)=censc(k,j,i)
142           enddo
143           do k=1,3
144             do l=1,3
145               gaussc_all(l,k,j,i,iparm)=gaussc(l,k,j,i)
146             enddo
147           enddo
148         enddo
149       enddo
150 #else
151       do i=1,ntyp
152         do j=1,65
153           sc_parmin_all(j,i,iparm)=sc_parmin(j,i)
154         enddo
155       enddo
156 #endif
157 c Store the torsional parameters
158       do iblock=1,2
159       do i=-ntortyp+1,ntortyp-1
160         do j=-ntortyp+1,ntortyp-1
161           v0_all(i,j,iblock,iparm)=v0(i,j,iblock)
162           nterm_all(i,j,iblock,iparm)=nterm(i,j,iblock)
163           nlor_all(i,j,iblock,iparm)=nlor(i,j,iblock)
164           do k=1,nterm(i,j,iblock)
165             v1_all(k,i,j,iblock,iparm)=v1(k,i,j,iblock)
166             v2_all(k,i,j,iblock,iparm)=v2(k,i,j,iblock)
167           enddo
168           do k=1,nlor(i,j,iblock)
169             vlor1_all(k,i,j,iparm)=vlor1(k,i,j)
170             vlor2_all(k,i,j,iparm)=vlor2(k,i,j)
171             vlor3_all(k,i,j,iparm)=vlor3(k,i,j)
172           enddo
173         enddo
174       enddo
175       enddo  
176 c Store the double torsional parameters
177       do iblock=1,2
178       do i=-ntortyp+1,ntortyp-1
179         do j=-ntortyp+1,ntortyp-1
180           do k=-ntortyp+1,ntortyp-1
181             ntermd1_all(i,j,k,iblock,iparm)=ntermd_1(i,j,k,iblock)
182             ntermd2_all(i,j,k,iblock,iparm)=ntermd_2(i,j,k,iblock)
183             do l=1,ntermd_1(i,j,k,iblock)
184               v1c_all(1,l,i,j,k,iblock,iparm)=v1c(1,l,i,j,k,iblock)
185               v1c_all(2,l,i,j,k,iblock,iparm)=v1c(2,l,i,j,k,iblock)
186               v2c_all(1,l,i,j,k,iblock,iparm)=v2c(1,l,i,j,k,iblock)
187               v2c_all(2,l,i,j,k,iblock,iparm)=v2c(2,l,i,j,k,iblock)
188             enddo
189             do l=1,ntermd_2(i,j,k,iblock)
190               do m=1,ntermd_2(i,j,k,iblock)
191                 v2s_all(l,m,i,j,k,iblock,iparm)=v2s(l,m,i,j,k,iblock)
192               enddo
193             enddo
194           enddo
195         enddo
196       enddo
197       enddo
198 c Store parameters of the cumulants
199 #ifdef NEWCORR
200       do i=-nloctyp+1,nloctyp-1
201         do ii=1,3
202         do j=1,2
203           bnew1_all(ii,j,i,iparm)=bnew1(ii,j,i)
204           bnew2_all(ii,j,i,iparm)=bnew2(ii,j,i)
205         enddo
206         enddo
207         do j=1,2
208           do k=1,3
209             ccnew_all(k,j,i,iparm)=ccnew(k,j,i)
210             ddnew_all(k,j,i,iparm)=ddnew(k,j,i)
211           enddo
212         enddo
213         do ii=1,2
214           do j=1,2
215             do k=1,2
216               eenew_all(k,j,ii,i,iparm)=eenew(k,j,ii,i)
217             enddo
218           enddo
219         enddo 
220         do ii=1,2
221           e0new_all(ii,i,iparm)=e0new(ii,i)
222         enddo
223       enddo
224 #else
225       do i=-nloctyp,nloctyp
226         do j=1,5
227           b_all(j,i,iparm)=b(j,i)
228         enddo
229         do j=1,2
230           do k=1,2
231             ccold_all(k,j,i,iparm)=ccold(k,j,i)
232             ddold_all(k,j,i,iparm)=ddold(k,j,i)
233             eeold_all(k,j,i,iparm)=eeold(k,j,i)
234           enddo
235         enddo
236       enddo
237 #endif
238 c Store the parameters of electrostatic interactions
239       do i=1,2
240         do j=1,2
241           app_all(j,i,iparm)=app(j,i)
242           bpp_all(j,i,iparm)=bpp(j,i)
243           ael6_all(j,i,iparm)=ael6(j,i)
244           ael3_all(j,i,iparm)=ael3(j,i)
245         enddo
246       enddo
247 c Store sidechain parameters
248       do i=1,ntyp
249         do j=1,ntyp
250           aa_aq_all(j,i,iparm)=aa_aq(j,i)
251           bb_aq_all(j,i,iparm)=bb_aq(j,i)
252           aa_lip_all(j,i,iparm)=aa_lip(j,i)
253           bb_lip_all(j,i,iparm)=bb_lip(j,i)
254           r0_all(j,i,iparm)=r0(j,i)
255           sigma_all(j,i,iparm)=sigma(j,i)
256           chi_all(j,i,iparm)=chi(j,i)
257           augm_all(j,i,iparm)=augm(j,i)
258           eps_all(j,i,iparm)=eps(j,i)
259           epslip_all(j,i,iparm)=epslip(j,i)
260         enddo
261       enddo
262       do i=1,ntyp
263         chip_all(i,iparm)=chip(i)
264         alp_all(i,iparm)=alp(i)
265       enddo
266 c Store the SCp parameters
267       do i=1,ntyp
268         do j=1,2
269           aad_all(i,j,iparm)=aad(i,j)
270           bad_all(i,j,iparm)=bad(i,j)
271         enddo
272       enddo
273 c Store disulfide-bond parameters
274       ebr_all(iparm)=ebr
275       d0cm_all(iparm)=d0cm
276       akcm_all(iparm)=akcm
277       akth_all(iparm)=akth
278       akct_all(iparm)=akct
279       v1ss_all(iparm)=v1ss
280       v2ss_all(iparm)=v2ss
281       v3ss_all(iparm)=v3ss
282 c Store SC-backbone correlation parameters
283       do i=-nsccortyp,nsccortyp
284        do j=-nsccortyp,nsccortyp
285
286       nterm_sccor_all(j,i,iparm)=nterm_sccor(j,i)
287 c      do i=1,20
288 c        do j=1,20
289          do l=1,3
290           do k=1,nterm_sccor(j,i)
291             v1sccor_all(k,l,j,i,iparm)=v1sccor(k,l,j,i)
292             v2sccor_all(k,l,j,i,iparm)=v2sccor(k,l,j,i)
293            enddo
294           enddo
295         enddo
296       enddo
297       return
298       end
299 c--------------------------------------------------------------------------
300       subroutine restore_parm(iparm)
301 C
302 C Store parameters of set IPARM
303 C valence angles and the side chains and energy parameters.
304 C
305       implicit none
306       include 'DIMENSIONS'
307       include 'DIMENSIONS.ZSCOPT'
308       include 'DIMENSIONS.FREE'
309       include 'COMMON.IOUNITS'
310       include 'COMMON.CHAIN'
311       include 'COMMON.INTERACT'
312       include 'COMMON.GEO'
313       include 'COMMON.LOCAL'
314       include 'COMMON.TORSION'
315       include 'COMMON.FFIELD'
316       include 'COMMON.NAMES'
317       include 'COMMON.SBRIDGE'
318       include 'COMMON.SCROT'
319       include 'COMMON.SCCOR'
320       include 'COMMON.ALLPARM'
321       integer i,ii,j,k,l,m,mm,iparm,ichir1,ichir2,iblock,iii
322
323 c Restore weights
324       wsc=ww_all(1,iparm)
325       wscp=ww_all(2,iparm)
326       welec=ww_all(3,iparm)
327       wcorr=ww_all(4,iparm)
328       wcorr5=ww_all(5,iparm)
329       wcorr6=ww_all(6,iparm)
330       wel_loc=ww_all(7,iparm)
331       wturn3=ww_all(8,iparm)
332       wturn4=ww_all(9,iparm)
333       wturn6=ww_all(10,iparm)
334       wang=ww_all(11,iparm)
335       wscloc=ww_all(12,iparm)
336       wtor=ww_all(13,iparm)
337       wtor_d=ww_all(14,iparm)
338       wstrain=ww_all(15,iparm)
339       wvdwpp=ww_all(16,iparm)
340       wbond=ww_all(17,iparm)
341       wsccor=ww_all(19,iparm)
342       wliptran=ww_all(22,iparm)
343       wsaxs=ww_all(26,iparm)
344 c Restore bond parameters
345       vbldp0=vbldp0_all(iparm)
346       akp=akp_all(iparm)
347       do i=1,ntyp
348         nbondterm(i)=nbondterm_all(i,iparm)
349         do j=1,nbondterm(i)
350           vbldsc0(j,i)=vbldsc0_all(j,i,iparm)
351           aksc(j,i)=aksc_all(j,i,iparm)
352           abond0(j,i)=abond0_all(j,i,iparm)
353         enddo
354       enddo
355 c Restore bond angle parameters
356 #ifdef CRYST_THETA
357       do i=-ntyp,ntyp
358         a0thet(i)=a0thet_all(i,iparm)
359         do ichir1=-1,1
360         do ichir2=-1,1
361         do j=1,2
362           athet(j,i,ichir1,ichir2)=athet_all(j,i,ichir1,ichir2,iparm)
363           bthet(j,i,ichir1,ichir2)=bthet_all(j,i,ichir1,ichir2,iparm)
364         enddo
365         enddo
366         enddo
367         do j=0,3
368           polthet(j,i)=polthet_all(j,i,iparm)
369         enddo
370         do j=1,3
371           gthet(j,i)=gthet_all(j,i,iparm)
372         enddo
373         theta0(i)=theta0_all(i,iparm)
374         sig0(i)=sig0_all(i,iparm)
375         sigc0(i)=sigc0_all(i,iparm)
376       enddo
377 #else
378       nthetyp=nthetyp_all(iparm)
379       ntheterm=ntheterm_all(iparm)
380       ntheterm2=ntheterm2_all(iparm)
381       ntheterm3=ntheterm3_all(iparm)
382       nsingle=nsingle_all(iparm)
383       ndouble=ndouble_all(iparm)
384       nntheterm=nntheterm_all(iparm)
385       do i=-ntyp,ntyp
386         ithetyp(i)=ithetyp_all(i,iparm)
387       enddo
388       do iblock=1,2
389       do i=-maxthetyp1,maxthetyp1
390         do j=-maxthetyp1,maxthetyp1
391           do k=-maxthetyp1,maxthetyp1
392             aa0thet(i,j,k,iblock)=aa0thet_all(i,j,k,iblock,iparm)
393             do l=1,ntheterm
394               aathet(l,i,j,k,iblock)=aathet_all(l,i,j,k,iblock,iparm)
395             enddo
396             do l=1,ntheterm2
397               do m=1,nsingle
398                 bbthet(m,l,i,j,k,iblock)=
399      &bbthet_all(m,l,i,j,k,iblock,iparm)
400                 ccthet(m,l,i,j,k,iblock)=
401      &ccthet_all(m,l,i,j,k,iblock,iparm)
402                 ddthet(m,l,i,j,k,iblock)=
403      &ddthet_all(m,l,i,j,k,iblock,iparm)
404                 eethet(m,l,i,j,k,iblock)=
405      &eethet_all(m,l,i,j,k,iblock,iparm)
406               enddo
407             enddo
408             do l=1,ntheterm3
409               do m=1,ndouble
410                 do mm=1,ndouble
411                 if (iblock.eq.1) then
412                  ffthet(mm,m,l,i,j,k,iblock)=
413      &ffthet_all1(mm,m,l,i,j,k,iparm)
414                  ggthet(mm,m,l,i,j,k,iblock)=
415      &ggthet_all1(mm,m,l,i,j,k,iparm)
416                 else
417                  ffthet(mm,m,l,i,j,k,iblock)=
418      &ffthet_all2(mm,m,l,i,j,k,iparm)
419                  ggthet(mm,m,l,i,j,k,iblock)=
420      &ggthet_all2(mm,m,l,i,j,k,iparm)
421                 endif
422                 enddo
423               enddo
424             enddo
425           enddo
426         enddo
427       enddo
428       enddo
429 #endif
430 c Restore the sidechain rotamer parameters
431 #ifdef CRYST_SC
432       do i=-ntyp,ntyp
433         if (i.eq.0) cycle
434         iii=iabs(i)
435         nlob(iii)=nlob_all(iii,iparm)
436         do j=1,nlob(iii)
437           bsc(j,iii)=bsc_all(j,iii,iparm)
438           do k=1,3
439             censc(k,j,i)=censc_all(k,j,i,iparm)
440           enddo
441           do k=1,3
442             do l=1,3
443               gaussc(l,k,j,i)=gaussc_all(l,k,j,i,iparm)
444             enddo
445           enddo
446         enddo
447       enddo
448 #else
449       do i=1,ntyp
450         do j=1,65
451           sc_parmin(j,i)=sc_parmin_all(j,i,iparm)
452         enddo
453       enddo
454 #endif
455 c Restore the torsional parameters
456       do iblock=1,2
457       do i=-ntortyp+1,ntortyp-1
458         do j=-ntortyp+1,ntortyp-1
459           v0(i,j,iblock)=v0_all(i,j,iblock,iparm)
460           nterm(i,j,iblock)=nterm_all(i,j,iblock,iparm)
461           nlor(i,j,iblock)=nlor_all(i,j,iblock,iparm)
462           do k=1,nterm(i,j,iblock)
463             v1(k,i,j,iblock)=v1_all(k,i,j,iblock,iparm)
464             v2(k,i,j,iblock)=v2_all(k,i,j,iblock,iparm)
465           enddo
466           do k=1,nlor(i,j,iblock)
467             vlor1(k,i,j)=vlor1_all(k,i,j,iparm)
468             vlor2(k,i,j)=vlor2_all(k,i,j,iparm)
469             vlor3(k,i,j)=vlor3_all(k,i,j,iparm)
470           enddo
471         enddo
472       enddo  
473       enddo
474 c Restore the double torsional parameters
475       do iblock=1,2
476       do i=-ntortyp+1,ntortyp-1
477         do j=-ntortyp+1,ntortyp-1
478           do k=-ntortyp+1,ntortyp-1
479             ntermd_1(i,j,k,iblock)=ntermd1_all(i,j,k,iblock,iparm)
480             ntermd_2(i,j,k,iblock)=ntermd2_all(i,j,k,iblock,iparm)
481             do l=1,ntermd_1(i,j,k,iblock)
482               v1c(1,l,i,j,k,iblock)=v1c_all(1,l,i,j,k,iblock,iparm)
483               v1c(2,l,i,j,k,iblock)=v1c_all(2,l,i,j,k,iblock,iparm)
484               v2c(1,l,i,j,k,iblock)=v2c_all(1,l,i,j,k,iblock,iparm)
485               v2c(2,l,i,j,k,iblock)=v2c_all(2,l,i,j,k,iblock,iparm)
486             enddo
487             do l=1,ntermd_2(i,j,k,iblock)
488               do m=1,ntermd_2(i,j,k,iblock)
489                 v2s(l,m,i,j,k,iblock)=v2s_all(l,m,i,j,k,iblock,iparm)
490               enddo
491             enddo
492           enddo
493         enddo
494       enddo
495       enddo
496 c Restore parameters of the cumulants
497 #ifdef NEWCORR
498       do i=-nloctyp+1,nloctyp-1
499         do ii=1,3
500         do j=1,2
501           bnew1(ii,j,i)=bnew1_all(ii,j,i,iparm)
502           bnew2(ii,j,i)=bnew2_all(ii,j,i,iparm)
503         enddo
504         enddo
505         do j=1,2
506           do k=1,3
507             ccnew(k,j,i)=ccnew_all(k,j,i,iparm)
508             ddnew(k,j,i)=ddnew_all(k,j,i,iparm)
509           enddo
510         enddo
511         do ii=1,2
512           do j=1,2
513             do k=1,2
514               eenew(k,j,ii,i)=eenew_all(k,j,ii,i,iparm)
515             enddo
516           enddo
517         enddo 
518         do ii=1,2
519           e0new(ii,i)=e0new_all(ii,i,iparm)
520         enddo
521       enddo
522 #else
523       do i=-nloctyp,nloctyp
524         do j=1,5
525           b(j,i)=b_all(j,i,iparm)
526         enddo
527         do j=1,2
528           do k=1,2
529             ccold(k,j,i)=ccold_all(k,j,i,iparm)
530             ddold(k,j,i)=ddold_all(k,j,i,iparm)
531             eeold(k,j,i)=eeold_all(k,j,i,iparm)
532           enddo
533         enddo
534       enddo
535 #endif
536 c Restore the parameters of electrostatic interactions
537       do i=1,2
538         do j=1,2
539           app(j,i)=app_all(j,i,iparm)
540           bpp(j,i)=bpp_all(j,i,iparm)
541           ael6(j,i)=ael6_all(j,i,iparm)
542           ael3(j,i)=ael3_all(j,i,iparm)
543         enddo
544       enddo
545 c Restore sidechain parameters
546       do i=1,ntyp
547         do j=1,ntyp
548           aa_aq(j,i)=aa_aq_all(j,i,iparm)
549           bb_aq(j,i)=bb_aq_all(j,i,iparm)
550           aa_lip(j,i)=aa_lip_all(j,i,iparm)
551           bb_lip(j,i)=bb_lip_all(j,i,iparm)
552           r0(j,i)=r0_all(j,i,iparm)
553           sigma(j,i)=sigma_all(j,i,iparm)
554           chi(j,i)=chi_all(j,i,iparm)
555           augm(j,i)=augm_all(j,i,iparm)
556           eps(j,i)=eps_all(j,i,iparm)
557           epslip(j,i)=epslip_all(j,i,iparm)
558         enddo
559       enddo
560       do i=1,ntyp
561         chip(i)=chip_all(i,iparm)
562         alp(i)=alp_all(i,iparm)
563       enddo
564 c Restore the SCp parameters
565       do i=1,ntyp
566         do j=1,2
567           aad(i,j)=aad_all(i,j,iparm)
568           bad(i,j)=bad_all(i,j,iparm)
569         enddo
570       enddo
571 c Restore disulfide-bond parameters
572       ebr=ebr_all(iparm)
573       d0cm=d0cm_all(iparm)
574       akcm=akcm_all(iparm)
575       akth=akth_all(iparm)
576       akct=akct_all(iparm)
577       v1ss=v1ss_all(iparm)
578       v2ss=v2ss_all(iparm)
579       v3ss=v3ss_all(iparm)
580 c Restore SC-backbone correlation parameters
581       do i=-nsccortyp,nsccortyp
582        do j=-nsccortyp,nsccortyp
583
584       nterm_sccor(j,i)=nterm_sccor_all(j,i,iparm)
585         do l=1,3
586            do k=1,nterm_sccor(j,i)
587             v1sccor(k,l,j,i)=v1sccor_all(k,l,j,i,iparm)
588             v2sccor(k,l,j,i)=v2sccor_all(k,l,j,i,iparm)
589            enddo
590           enddo
591         enddo
592       enddo
593       return
594       end