subroutine fndutsa C Subroutine to find which of 4 UT's (2 in each hemisphere) are closest C to the TGCM UT and use those 2 UT's for the auroral parameters when C conjugacy is assumed for AMIE runs. C fndutsa is only called if iconj=1 C **** If ICONJ=1, find times closest to SECTGCM and C **** substitute values in opposite hemisphere for FLX,KEV include "amie.h" dimension p2sn(2),p1sn(2) do 2501 ih=1,2 SECP = AMAX1(UTSP(1,IH),SECTGCM) SECP = AMIN1(UTSP(2,IH),SECP) DENOMP = UTSP(2,IH) - UTSP(1,IH) P2sn(ih) = (SECP - UTSP(1,IH))/DENOMP 2501 P1sn(ih) = (UTSP(2,IH) - SECP)/DENOMP if (3.*p1sn(1) .gt. p2sn(1)+p1sn(2)+p2sn(2)) then n112 = 1 n1sn = 1 if (2.*p2sn(1) .gt. p1sn(2)+p2sn(2)) then n212 = 2 n2sn = 1 else n2sn = 2 if (2.*p1sn(2) .gt. p2sn(1)+p2sn(2)) then n212 = 1 else n212 = 2 endif endif endif if (3.*p2sn(1) .gt. p1sn(1)+p1sn(2)+p2sn(2)) then n112 = 2 n1sn = 1 if (2.*p1sn(1) .gt. p1sn(2)+p2sn(2)) then n212 = 1 n2sn = 1 else n2sn = 2 if (2.*p1sn(2) .gt. p1sn(1)+p2sn(2)) then n212 = 1 else n212 = 2 endif endif endif if (3.*p1sn(2) .gt. p2sn(2)+p1sn(1)+p2sn(1)) then n112 = 1 n1sn = 2 if (2.*p2sn(2) .gt. p1sn(1)+p2sn(1)) then n212 = 2 n2sn = 2 else n2sn = 1 if (2.*p1sn(1) .gt. p2sn(2)+p2sn(1)) then n212 = 1 else n212 = 2 endif endif endif if (3.*p2sn(2) .gt. p1sn(2)+p1sn(1)+p2sn(1)) then n112 = 2 n1sn = 2 if (2.*p1sn(2) .gt. p1sn(1)+p2sn(1)) then n212 = 1 n2sn = 2 else n2sn = 1 if (2.*p1sn(1) .gt. p1sn(2)+p2sn(1)) then n212 = 1 else n212 = 2 endif endif endif if (utsp(n112,n1sn) .gt. utsp(n212,n2sn)) then isvn112 = n112 isvn1sn = n1sn n1sn = n2sn n112 = n212 n2sn = isvn1sn n212 = isvn112 endif utsa(1,1) = utsasn(n112,n1sn) utsa(1,2) = utsasn(n112,n1sn) utsa(2,1) = utsasn(n212,n2sn) utsa(2,2) = utsasn(n212,n2sn) hpa(1,1) = hpasn(n112,n1sn) hpa(1,2) = hpasn(n112,n1sn) hpa(2,1) = hpasn(n212,n2sn) hpa(2,2) = hpasn(n212,n2sn) do 2502 i=1,73 do 2502 j=1,36 ekeva1(i,j) = ekevasn(i,j,n112,n1sn) eflxa1(i,j) = eflxasn(i,j,n112,n1sn) ekeva2(i,j) = ekevasn(i,j,n212,n2sn) 2502 eflxa2(i,j) = eflxasn(i,j,n212,n2sn) c write (6,"(1x,'n112 n1sn n212 n2sn =',4i3)") n112,n1sn,n212,n2sn c write (6,"(1x,'p1s,n p2s,n utsp1s,n 2s,n utsa1,2 sec='/1x,4f6.2, c | 7f9.0)") p1sn(1),p1sn(2),p2sn(1),p2sn(2),utsp(1,1),utsp(1,2), c | utsp(2,1),utsp(2,2),utsa(1,1),utsa(2,2),sectgcm c do 2503 j=1,36 c write (6,"(1x,'j=',i2,' flx1 kev1 flx2 kev2=')") j c write (6,"(1x,10e12.4)") (eflxa1(i,j),i=1,73) c write (6,"(1x,10e12.4)") (ekeva1(i,j),i=1,73) c write (6,"(1x,10e12.4)") (eflxa2(i,j),i=1,73) c write (6,"(1x,10e12.4)") (ekeva2(i,j),i=1,73) c2503 continue c write (6,"(1x,'(-67.1,-180) keV 1s,n 2s,n 1,2=',6f6.3)") c | ekevasn(1,5,1,1),ekevasn(1,5,1,2), ekevasn(1,5,2,1), c | ekevasn(1,5,2,2),ekeva1(1,5),ekeva2(1,5) c write (6,"(1x,'(+67.1,-180) keV 1s,n 2s,n 1,2=',6f6.3)") c | ekevasn(1,32,1,1),ekevasn(1,32,1,2), ekevasn(1,32,2,1), c | ekevasn(1,32,2,2),ekeva1(1,32),ekeva2(1,32) return end