c------------------------------------------------------------------------------- c Driver program for example #3: c c Create a time series of external and induced coefficients during May 1 of c 1994. Sample coefficients every 3 hrs and get Dst and F10.7 from files. c------------------------------------------------------------------------------- implicit none integer i,j,k,n,m,iutday c begin CM4 declarations ------------------------------------------------------- character*80 path(3) integer unit(3) logical load(3),indx(2),gmut,cord,pred(6),curr,coef integer nhmf(2),nlmf(2),perr,oerr,cerr real*8 ut,mut,theta,phi,alt,dst,f107,bmdl(3,7),jmdl(3,4) real*8 gmdl(1368,5) ! maximum row number is for ionospheric and ! toroidal expansions ! ! column 1: primary magnetospheric ! " 2: induced magnetospheric ! " 3: primary ionospheric ! " 4: induced ionospheric ! " 5: toroidal c end CM4 declarations --------------------------------------------------------- c begin CM4 assignments -------------------------------------------------------- path(1)='../umdl.CM4' ! path for model coefficients path(2)='../Dst_all.wdc' ! path for Dst path(3)='../F107_3mon.plt' ! path for solar flux unit(1)=11 ! logical unit for model coefficients unit(2)=12 ! logical unit for Dst unit(3)=13 ! logical unit for solar flux load(1)=.true. ! set to initially read model coefficients load(2)=.true. ! set to initially read Dst load(3)=.true. ! set to initially read solar flux indx(1)=.true. ! get Dst from file indx(2)=.true. ! get solar flux from file gmut =.true. ! compute MUT from UT cord =.true. ! ... pred(1)=.false. ! don't compute internal B fields pred(2)=.true. ! compute magnetospheric B field pred(3)=.true. ! compute ionospheric B field pred(4)=.true. ! compute toroidal B field for... pred(5)=.true. ! ...Magsat pred(6)=.true. ! ...dawn LT curr =.false. ! no current density J fields computed coef =.true. ! coefficients generated nhmf(1)=0 ! ... nhmf(2)=0 ! ... nlmf(1)=1 ! ... nlmf(2)=1 ! ... theta =90.d0 ! ... phi =0.d0 ! ... alt =0.d0 ! ... perr =1 ! error print flag oerr =6 ! error logical unit cerr =0 ! error flag c end CM4 assignments ---------------------------------------------------------- c begin time series loop ------------------------------------------------------- ut=1994.d0+120.d0/365.d0 ! 1 May 1994 0000 UT do i=1,8 ! 3 hour increments call cm4field (path,unit,load,indx,gmut,cord,pred,curr,coef, 1 nhmf,nlmf,ut,mut,theta,phi,alt,dst,f107,bmdl, 2 jmdl,gmdl,perr,oerr,cerr) if (cerr.gt.49) stop iutday=300*(i-1) write(21,1000) iutday k=0 do n=1,11 do m=0,min(n,6) if (m.eq.0) then k=k+1 write(21,1003) n,m,gmdl(k ,1),gmdl(k,2) else k=k+2 write(21,1004) n,m,gmdl(k-1,1),gmdl(k,1), 1 gmdl(k-1,2),gmdl(k,2) end if end do end do write(22,1001) iutday write(23,1002) iutday k=0 do n=1,60 do m=0,min(n,12) if (m.eq.0) then k=k+1 write(22,1003) n,m,gmdl(k ,3),gmdl(k,4) write(23,1003) n,m,gmdl(k ,5) else k=k+2 write(22,1004) n,m,gmdl(k-1,3),gmdl(k,3), 1 gmdl(k-1,4),gmdl(k,4) write(23,1004) n,m,gmdl(k-1,5),gmdl(k,5) end if end do end do ut=ut+3.42466d-04 ! increment by 3 hrs. end do c end time series loop --------------------------------------------------------- stop 1000 format(' ',/,1x,'Magnetospheric coefficients at 1 May 1994, ',I4,' 1 UT',/,' ',/,2x,'n',2x,'m',11x,'q_pri',11x,'s_pri',11x,'q_ind',11x 2,'s_ind',/,' ') 1001 format(' ',/,1x,'Ionospheric coefficients at 1 May 1994, ',I4,' UT 1',/,' ',/,2x,'n',2x,'m',11x,'c_pri',11x,'d_pri',11x,'c_ind',11x,'d 2_ind',/,' ') 1002 format(' ',/,1x,'Toroidal coefficients at 1 May 1994, ',I4,' UT',/ 1,' ',/,2x,'n',2x,'m',15x,'u',15x,'v',/,' ') 1003 format(2(1x,i2),2(1x,f15.8,16x)) 1004 format(2(1x,i2),4(1x,f15.8)) end include '../cm4field.f'