c------------------------------------------------------------------------------- c Driver program for example #5: c c Sample current density J fields on regular 5 x 5 degree grids in colatitude c and longitude at their respective source altitudes with user supplied values c of Dst and F10.7 indices. Poloidal J is sampled for Magsat dusk LT at 415 km. c UT time is 1980 and MUT time is noon. c------------------------------------------------------------------------------- implicit none integer i,j,k 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(1) ! note, an array of length one c end CM4 declarations --------------------------------------------------------- c begin CM4 assignments -------------------------------------------------------- path(1)='../umdl.CM4' ! path for model coefficients unit(1)=11 ! logical unit for model coefficients load(1)=.true. ! set to initially read model coefficients indx(1)=.false. ! get Dst from argument indx(2)=.false. ! get solar flux from argument gmut =.false. ! set MUT explicitly cord =.false. ! use geocentric coordinates pred(1)=.false. ! 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)=.false. ! ...dusk LT curr =.true. ! current density J fields computed coef =.false. ! no coefficients generated nhmf(1)=0 ! ... nhmf(2)=0 ! ... nlmf(1)=1 ! ... nlmf(2)=1 ! ... ut =1980.d0 ! Magsat UT (years) mut =12.d0 ! Noon MUT (hrs) alt =415.d0 ! constant altitude dst =-10.d0 ! constant Dst f107 =200.d0 ! constant solar flux perr =1 ! error print flag oerr =6 ! error logical unit cerr =0 ! error flag c end CM4 assignments ---------------------------------------------------------- c begin grid loops ------------------------------------------------------------- do i=0,180,5 theta=dble(i) do j=0,360,5 phi=dble(j) call cm4field (path,unit,load,indx,gmut,cord,pred,curr, 1 coef,nhmf,nlmf,ut,mut,theta,phi,alt,dst, 2 f107,bmdl,jmdl,gmdl,perr,oerr,cerr) ! ^ ! | note that a dummy array ! |____ variable of length one may ! be used for gmdl when ! coef=.false. if (cerr.gt.49) stop write(*,1000) phi,theta,(jmdl(k,1),k=1,3) write(*,1001) (jmdl(k,2),k=1,3) write(*,1002) (jmdl(k,3),k=1,3) write(*,1003) (jmdl(k,4),k=1,3) end do end do c end grid loops --------------------------------------------------------------- stop 1000 format(2(1x,f5.1),' Mag_ind J_xy,Psi ',3e12.5) 1001 format(12x, ' Ion_pri J_xy,Psi ',3e12.5) 1002 format(12x, ' Ion_ind J_xy,Psi ',3e12.5) 1003 format(12x, ' Tor J_xyz ',3e12.5) end include '../cm4field.f'