FUNCTION SET_INITIAL_CONDITIONS, UU=UU,VV=VV,WW=WW, xx=xx,yy=yy, zz=zz, A0=A0,pii0=pii0,theta0=theta0, nx=nx, ny=ny, nz=nz, del_x=del_x, del_y=del_y, del_t=del_t x0 = (nx-1)/2.0 & y0 = (ny-1)/2.0 & z0=(nz-1)/2.0 & PI=(22.0/7.0) xx=INDGEN(nx) & yy=INDGEN(ny) & zz=INDGEN(nz) & dd=FLTARR(nx) ;;;;FILL IN XX && YY ARRAYS ; This set the initial conditions for the usable points for i = 0, nx-1 do begin for j = 0, ny-1 do begin UU[i,j,*] = 0.0 VV[i,j,*] = 0.0 WW[i,j,*]= 0.0 endfor endfor ;for i = 0, nx-1 do begin ; for j = 0, ny-1 do begin ; for k = 2, nz-3 do begin ; WW[i,j,k] = 5.0 ; endfor ; endfor ;endfor ; for the cone xcone = (nx-1)/2 ycone = (ny-1)/2 zcone = (nz-1)/4 ; this should put a blob that is in the center of the x-y grid and closer to the "ground" in the z direction for i = 2, nx-3 do begin for j = 2, ny-3 do begin for k = 2, nz-3 do begin distcone = sqrt(((i-1-xcone)^2.0)+((j-1-ycone)^2)+((k-1-zcone)^2)) if distcone le 10.0 then A0[i, j, k] = 5.0*(1+cos((!pi*distcone)/10)) $ ;some thing that will scale this from 0 to 10 with 10 in the center for the cone else A0[i,j, 0] = 0.0 endfor endfor endfor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;Fill the dd array from 10 to 50 centered at 30, with numbers, PG 1348 Tripoli 91 heights=INTARR(nx) & press=FLTARR(nx,ny,nz) heights=INDGEN(nx)*100.00 ;; height in meters p0= 1013.25 ;101325 ; Sea level HPa L0=0.0065 ;Lapse rate K/m T0=288.15 ;288.15 ; sea level temp K g0=9.8 ;gravity m/s M0=0.0289664 ;molar mass of dry air kg/mol R0=8.31447 ;Universal gas const. J/mol.k ;287.058 cp=4.1855 ;specifi heat of air at cont. pres j/g.k k=1.3806503*10^(-23) ;;boltzmans constannt qq=((g0*M0)/(R0*L0)) ;;; Compute Pressure FOR i=0, nx-1 DO BEGIN FOR j=0, ny-1 DO BEGIN FOR k=0, nz-1 DO BEGIN ;press(i)= P0*((1-(L0*heights(i))/T0)^((g0*M0)/R0*L0)) ;press(i)=P0*exp(-(M0*g0*heights(i))/(k*(t0-i))) ;p=p0*exp(-mgh/kT) press(i,j,k)=1013.25*(1- 0.0000225577*heights(i))^5.25588 ENDFOR ENDFOR ENDFOR FOR i=10, 50 DO BEGIN dd(i)=ABS(30-i) ENDFOR r_cp=(R0/cp) FOR i = 2, nx-3 DO BEGIN FOR j = 2, ny-3 DO BEGIN FOR k=2, nz-3 DO BEGIN theta0[i,j,K] =3.0*SIN(2*PI*dd(i)) pii0[i,j,K] = cp*((press(i,j,k)/100)^r_cp) ENDFOR ENDFOR ENDFOR IC={A0:A0,UU:UU,VV:VV, WW:WW, pii0:pii0, theta0:theta0, xx:xx,yy:yy,zz:zz, del_x:del_x, del_y:del_y, del_t:del_t, nx:nx, ny:ny, nz:nz , press:press} PRINT,'>>>>>>>>>> Initial conditions set >>>>>>>>' RETURN,IC END