PRO read_model_id,init_model,id,modin,flag ; ; Reading scaled models and calculation of geometrical height h [km] ; and pressures Pt (total), Pg (gas). ; All quantities, except h [km], are in cgs units. ; ; INPUT: ; init_model (string) in the form 'C' defines the folder name ; id (integer) - ID number of the model in the folder 'Models/VAL_'+init_model ; OUTPUTS: ; modin - model array DOUBLE(10,103) [h,m,T,vt,nel,rho,Pg,Pt,z,tau] ; flag = 1 when the model is ok, flag = 0 when the model contains NaN id=id<2988>0 tp=-0.03+(id/49)*0.001 mp=0.2+(id mod 49)*0.1 print,'Model T-par, m-par, ID: ',tp,mp,id model_name='Models/VAL_'+init_model+'/MODEL_INP'+string(id,format='(I05)')+'.DAT' modin=dblarr(10,103) g=27398. ; gravitational acceleration [cm/s^2] flag=1 openr,1,model_name for j=0,102 do begin readf,1,dum,m,t,vt,nel,rho,z,tau ; Pressures ptot=g*m pgas=ptot-0.5*rho*vt^2 ; output array modin(1,j)=m modin(2,j)=t modin(3,j)=vt modin(4,j)=nel modin(5,j)=rho modin(6,j)=pgas modin(7,j)=ptot modin(8,j)=z modin(9,j)=tau endfor close,1 ; Geometric height modin[0,*]=(modin[8,102]-7.5e6-modin[8,*])/1.e5 ; Presence of NaNs if total(finite(modin)) ne n_elements(modin) then flag=0 END