;+ ; NAME: ; vt3d_zgrid ; PURPOSE: (one line) ; Return depths and layer widths for volatile transport ; DESCRIPTION: ; Return depths and layer widths for volatile transport ; CATEGORY: ; Volatile Transport ; CALLING SEQUENCE: ; z = vt3d_zgrid(skindepth,z_delta,n_z,nsurf=nsurf,fsurf=fsurf,ntop=ntop, $ ; dtop=dtop,nbot=nbot,dbot=dbot,fbot=fbot,hp96=hp96,sm92=sm92) ; INPUTS: ; skindepth - cm. A scalar or 1-D array of length n_loc ; skin depth = sqrt(k/(rho c omega)), where ; k = thermal conductivity ; rho = density ; c = specific heat ; omega = 2 pi/period = frequency ; OPTIONAL INPUT PARAMETERS: ; none ; KEYWORD INPUT PARAMETERS: ; nsurf = 1 or 0. Number of "surface" layers, with the ; grid point defined at the top of the layer (z=0). ; DEFAULT 1 ; fsurf = if positive, there is a surface layer with width ; fsurf * dtop * skindepth. DEFAULT 0.5 ; ntop = number of layers in the top region DEFAULT 4 ; dtop = width of layers in the top region, normalized ; by the skin depth (so that width = dtop * skindepth) ; DEFAULT 0.25 ; nbot = number of layers in the bottom region DEFAULT 20 ; dbot = width of the first layer in the bottom region, normalized. ; DEFAULT fbot * dtop ; fbot = fractional growth of the width of successive layers ; DEFAULT 1.13 ; hp96 - set all parameters to mimic Hansen and Paige 1996 ; nsurf=0, fsurf=0.0, ntop=3, dtop=0.25, nbot=57, fbot=1.13 ; sm92 - set all parameters to mimic Spencer and Moore 1992 ; nsurf=1, fsurf=0.5, ntop=60, dtop=0.1, nbot=0, fbot=1.00 ; KEYWORD OUTPUT PARAMETERS: ; none ; OUTPUTS: ; n_z - number of layers (nsurf + ntop + nbot) ; z - cm. depth of grid points (z <= 0) ; 1-D, length n_z, if skindepgth is a scalar, ; 2-D, [n_loc, n_z] if skindepth is an array ; z_delta - cm. width of layers, same dim. as z ; COMMON BLOCKS: ; None ; SIDE EFFECTS: ; RESTRICTIONS: ; nsurf = 0 or 1 ; PROCEDURE: ; Young, L. A. 2016, Volatile transport on inhomogeneous surfaces: II. Numerical calculations (VT3D) ; Resubmitted to Icarus. ; Section 3.3 ; MODIFICATION HISTORY: ; Written 2011 Feb 6, by Leslie Young, SwRI ;- function vt3d_zgrid, skindepth,z_delta,n_z,$ nsurf=nsurf, fsurf=fsurf,ntop=ntop,dtop=dtop,nbot=nbot,dbot=dbot,fbot=fbot,$ zgrid_type=zgrid_type, $ hp96=hp96,sm92=sm92,high=high,medium=medium,low=low zgrid_type = '' if keyword_set(hp96) then zgrid_type = 'hp96' if keyword_set(sm92) then zgrid_type = 'sm92' if keyword_set(high) then zgrid_type = 'high' if keyword_set(medium) then zgrid_type = 'medium' if keyword_set(low) then zgrid_type = 'low' case zgrid_type of ; hp96 - set all parameters to mimic Hansen and Paige 1996 'hp96': begin & nsurf=1 & fsurf=0.5 & ntop= 3 & dtop=0.25 & nbot=57 & fbot=1.13 & dbot=fbot*dtop & end ; sm92 - set all parameters to mimic Spencer and Moore 1992 'sm92': begin & nsurf=1 & fsurf=0.5 & ntop=60 & dtop=0.1 & nbot=0 & fbot=1.00 & dbot=dtop & end ; high - set all parameters to make a high-accuracy even grid 'high': begin & nsurf=1 & fsurf=0.5 & ntop=87 & dtop=1/8.8 & nbot=0 & fbot=1.00 & dbot=dtop & end ; medium - set all parameters to make a medium-accuracy even grid 'medium': begin & nsurf=1 & fsurf=0.5 & ntop=18 & dtop=1/2.5 & nbot=0 & fbot=1.00 & dbot=dtop & end ; low - set all parameters to make a low-accuracy even grid 'low': begin & nsurf=1 & fsurf=0.5 & ntop=3 & dtop=1/0.4 & nbot=0 & fbot=1.00 & dbot=dtop & end else: end if n_elements(nsurf) eq 0 then nsurf = 1 if not keyword_set(fsurf) then fsurf = 0.5 if n_elements(ntop) eq 0 then ntop = 4 ; ntop cannot be zero if not keyword_set(dtop) then dtop = 0.25 if n_elements(nbot) eq 0 then nbot = 10 if not keyword_set(fbot) then fbot = 1.13 if not keyword_set(dbot) then dbot = dtop * fbot n_z = nsurf + ntop + nbot dlayer = fltarr(n_z) layer = fltarr(n_z) ; grid point layertop = fltarr(n_z+1) ; top of layer i = 0 layertop[0] = 0. ; Surface as the 0th layer, if requested ; and first of the top layers if nsurf gt 0 then begin dlayer[i] = fsurf * dtop layer[i] = 0. layertop[i+1] = layer[i] - dlayer[i] ; print, i, layertop[i],layer[i],layertop[i+1], dlayer[i] , ' surface', for='(I3,4F9.4,A-10)' i += 1 endif ; upper portion, ntop layers of width dtop ; with grid point in the middle of the layer while i lt nsurf+ntop do begin dlayer[i] = dtop layer[i] = layertop[i] - (dlayer[i])/2. layertop[i+1] = layer[i] - dlayer[i]/2. ; print, i, layertop[i],layer[i],layertop[i+1],dlayer[i], ' top', for='(I3,4F9.4,A-10)' i += 1 endwhile ; lower portion, nbot layers of width increasing ; by fbot each layer ; with grid point in the middle of the layer if i lt n_z then begin dlayer[i] = dbot layer[i] = layertop[i] - (dlayer[i])/2. layertop[i+1] = layer[i] - dlayer[i]/2. ; print, i, layertop[i],layer[i],layertop[i+1],dlayer[i], ' bot', for='(I3,4F9.4,A-10)' i += 1 endif while i lt n_z do begin dlayer[i] = dlayer[i-1] * fbot layer[i] = layertop[i] - (dlayer[i])/2. layertop[i+1] = layer[i] - dlayer[i]/2. ; print, i, layertop[i],layer[i],layertop[i+1],dlayer[i], ' bot', for='(I3,4F9.4,A-10)' i += 1 endwhile z_delta = skindepth # dlayer return, skindepth # layer end