PRO read_moutbv9,lun,z,nl,nn,nf,s,file=kfile ; ; reads the 'mout.bin', the BINARY output file ; of NJB's equilibrium program em.f ; (actual version emindi_lop_ct_v7_standard_test.f) ; ; 03/12/93: hg ; ; 26/01/99: for em_v3.7v9_lw-cal.f ; added anu2,sqmu,cappa,s,h ; ; s/r out: ; write(96)n,xi(n),yi(3,n),yi(2,n),yi(1,n),yi(4,n),delad, ; + bigcin,betdog,cp,beta,hpkm,alpha,delta, ; + rl,dk1(3),dk1(2),dk1(1),dk1(4),dnr, ; + ak,akp,akt,amu,(x(j),j=1,3), ; + fconv,anu1v,anu2v,vconv,vmachv,sqmuv,cappav,sv,hv ; ; ; ouput: ; ; z(*,*,0) ..... local dataset in variable ; z(*,*,1) ..... nonlocal dataset in variable ; z(*,*,2) ..... fudged dataset in variable ; nl ............ nr. of read local meshpoints ; nn ............ nr. of read nonlocal meshpoints ; nf ............ nr. of read nonlocal meshpoints ; if (n_params(0) lt 1) or keyword_set(hlp) then begin print,' usage: read_moutbv9,lun,z,nl,nn,nf,s,file=''mout.bin'' print,' z(*,nva,s), s=0->local, s=1->nonlocal, s>2->fudged (if present)' print,' nva: 0 1 2 3 4 5 6 7 8 9' print,' log(p) log(T) log(r) log(m) sqrt(pt/p) nab_a 1/BIGC betdog cp beta' print,' --------------------------------------------------------------------' print,' nva: 10 11 12 13 14 15 16 17 18 19' print,' hp[km] alpha delta log(rho) 4*nab gra(r) gra(m) gra(4) nab_r log(cap)' print,' --------------------------------------------------------------------' print,' nva: 20 21 22 23 24 25 26 27 28 29' print,' cap_p cap_t cap X(H) X(He) X(He+) Fc/F anu1 anu2 vcon print,' --------------------------------------------------------------------' print,' nva: 30 31 32 33 34 ' print,' vmach sqmu capcon S mutilde' print,' --------------------------------------------------------------------' return endif if keyword_set(kfile) then begin if keyword_set(lun) eq 0 then lun=1 close,lun openr,lun,kfile,/f77_unformatted endif ; nli=4999 nva=35 ; nmesh=0L line=DBLARR(nva) ;z=DBLARR(nli,nva,100) z=DBLARR(nli,nva,18) ; s=0 n=-1 ; to be compatible to PRO read_mout nmeol=0 ; PRINT,'reading local dataset' ; WHILE NOT EOF(lun) DO BEGIN READU,lun,nmesh,line ; ; check if nonlocal dataset starts ; IF nmesh LT nmeol THEN BEGIN IF (s EQ 0) THEN BEGIN PRINT,n+1,' mesh-points of local dataset read' nl=n PRINT,'reading nonlocal dataset' n=-1 ENDIF ELSE BEGIN PRINT,n+1,' mesh-points of nonlocal dataset read' nn=n PRINT,'reading fudged dataset; s=',s n=-1 ENDELSE s=s+1 ENDIF ; ; print,n+1,line[0] z(n+1,*,s)=line ; nmeol=nmesh ; ; increase counter n & check if nmesh exhausts array-dimension (nli) ; IF n LT (nli-1) THEN n=n+1 ELSE $ STOP,'forced stop (exhaust of array)',nli,' records read' ENDWHILE ; IF (s EQ 1) THEN BEGIN PRINT,n+1,' mesh-points of non-local dataset read' nn=n z=z[0:nn,*,*] ENDIF ELSE BEGIN PRINT,n+1,' mesh-points of fudged dataset read' nf=n z=z[0:nf,*,*] ENDELSE ; RETURN END