;+ ; NAME: ; vt3d_eflux_terms_local ; PURPOSE: (one line) ; Return temperature in balance with mean absorbed solar flux ; DESCRIPTION: ; Return temperature in balance with mean absorbed solar flux ; CATEGORY: ; Volatile Transport ; CALLING SEQUENCE: ; flux_terms = vt3d_eflux_terms_local(sol_terms,flux_int,emis,freq,therminertia, $ ; is_volatile, mass_volatile, specheat_volatile, gravacc, name_species) ; INPUTS: ; sol_terms : absorbed solar flux, complex or real, erg/cm^2/s: ; complex[n_term+1] or complex[n_loc,n_term+1] ; sol = sol_terms[0] + sol_terms[1]*exp(_i * freq * t) ; + sol_terms[2]*exp(2 *_i freq t) + .. ; ; flux_int : internal hear flux, erg/cm^2/s: float or float[n_loc] ; emis : thermal emissivity, unitless : float or float[n_loc] ; freq : frequency of forcing ; therminertia : thermal inertia, erg cm-2 s-1/2 K-1 : float or float[n_loc] ; is_volatile : 1 if has a volatile, 0 if bare. flag. int or int[n_loc] ; mass_volatile : mass of the volatile slab, g cm^-2 : float or float[n_loc] ; specheat_volatile : specific heat of the volatile slab, erg g^-1 K^-1, scalar ; gravacc : gravitational acceleration, cm s^-2 ; name_species : name of the species. String. "N2", "CO", or "CH4" ; OPTIONAL INPUTS: ; mflux_esc_terms ; escape rate in g cm^-2 s^-1 ; complex[n_term+1] or complex[n_loc,n_term+1] ; defined so that (if _i = sqrt(-1) ) ; mflux_esc = mflux_esc_terms[0] + mflux_esc_terms[1]*exp( _i * freq * t) ; + mflux_esc_terms[2]*exp(2 *_i * freq * t) + .. ; OUTPUTS: ; flux_terms: terms of approximate emitted flux, erg cm^-2 s^-1, s.t. ; flux = flux_terms[0] + flux_terms[1]*exp( _i * freq * t + sqrt( _i * zeta) ) ; + flux_terms[2]*exp(2 *_i * freq * t + sqrt(2 * _i * zeta) ) + .. ; flux_terms is complex[n_term+1] or complex[n_loc,n_term+1] ; OPTIONAL OUTPUTS: ; temp_terms: terms of approximate temperture, K, s.t. ; temp = temp_terms[0] + temp_terms[1]*exp( _i * freq * t + sqrt( _i * zeta) ) ; + temp_terms[2]*exp(2 *_i * freq * t + sqrt(2 * _i * zeta) ) + .. ; temp_terms is complex[n_term+1] or complex[n_loc,n_term+1] ; RESTRICTIONS: ; If defined, mflux_esc_terms must be the same dimensions as sol_terms ; PROCEDURE: ; Young, L. A. 2016, Volatile transport on inhomogeneous surfaces: II. Numerical calculations (VT3D) ; Resubmitted to Icarus. ; Eq 4.2-10 ; MODIFICATION HISTORY: ; Written 2011 Dec 31, by Leslie Young, SwRI ;- function vt3d_eflux_terms_local, sol_terms,flux_int,emis,freq,therminertia, $ is_volatile, mass_volatile, specheat_volatile, gravacc, name_species, mflux_esc_terms, temp_terms=temp_terms _i = complex(0,1) if n_params() lt 11 then mflux_esc_terms = 0. * sol_terms sol_0 = float(extract_last(sol_terms,0,s_dim,n_term)) mflux_esc_0 = float(extract_last(mflux_esc_terms,0,s_dim,n_term)) n_term -= 1 ; first compose into flux terms flux_0 = (sol_0 + flux_int) temp_0 = vt3d_temp_term0_bare(sol_0, flux_int, emis) vp = bz1980_vp(name_species, temp_0, latheat) temp_0 = vt3d_temp_term0_local(sol_0, flux_int, emis, latheat, mflux_esc_0) phi_e = vt3d_dfluxdtemp_emit(emis, temp_0) phi_s = vt3d_dfluxdtemp_substrate(freq, therminertia) phi_v = vt3d_dfluxdtemp_slab(freq, mass_volatile, specheat_volatile) frac_varea = 1. ; if not interacting, fraction covered by voaltiles for each location is 100$ phi_a = vt3d_dfluxdtemp_atm(freq, temp_0, frac_varea, gravacc, name_species, latheat) ; latheat is an output theta_s_over4 = phi_s/phi_e ; thermal parameter / 4, substrate theta_v_over4 = phi_v/phi_e ; thermal parameter / 4, volatile slab theta_a_over4 = phi_a/phi_e ; thermal parameter / 4, atmospheric breathing ; get dimensionality foo = temp_0 * phi_s t_2d = (size(foo, /n_dim) gt 0) or (s_dim eq 2) ; 1 if temp_terms is a 2-D array n_loc = n_elements(foo) ; n_phase = 8*( 1 + n_term) n_phase = 5000L phase = findgen(n_phase) * 2.*!pi/n_phase if t_2d then temp_terms = complexarr(n_loc,n_term+1) else temp_terms = complexarr(n_term+1) if t_2d then temp_terms[*,0] = temp_0 else temp_terms[0] = temp_0 if t_2d then flux_terms = complexarr(n_loc,n_term+1) else flux_terms = complexarr(n_term+1) if t_2d then flux_terms[*,0] = flux_0 else flux_terms[0] = flux_0 for m = 1, n_term do begin sol_m = extract_last(sol_terms,m) mflux_esc_m = extract_last(mflux_esc_terms,m) if t_2d then begin flux_terms[*,m] = (sol_m - latheat*mflux_esc_m) / (1. + sqrt(_i * m) * theta_s_over4 + (_i*m) * (theta_v_over4 + theta_a_over4) * is_volatile) endif else begin flux_terms[m] = (sol_m - latheat*mflux_esc_m) / (1. + sqrt(_i * m) * theta_s_over4 + (_i*m) * (theta_v_over4 + theta_a_over4) * is_volatile) endelse endfor flux = vt3d_solwave(flux_terms, phase) temp = ( (flux / (emis * !phys.sigma)) > 0.)^(0.25) if t_2d then begin for i_loc = 0, n_loc-1 do begin temp_terms[i_loc,*] = sft(phase, temp[i_loc,*], n_term) endfor endif else begin temp_terms = sft(phase, temp, n_term) endelse return, flux_terms end