Beginner Tutorial
First:
Download KRC or check which version you have
Contents |
Download KRC or check which Version you have
Download KRC or check which version you have
To start using KRC, be sure you have already downloaded the latest version (Download latest version here). If you already have KRC, but do not know if you have the latest version, you can check which version you have here.
Once you have the latest version, it is time to start using KRC.
Getting Started
To start using KRC, you must first start the Davinci Interface. To learn more about Davinci visit the DavinciWiki
Type the following
> davinci dv>
Now, you can start using KRC.
Type the following:
dv> krc()
This command will bring up a the KRC Main Menu:
This runs the full krc binary mode with the following inputs IMPORTANT: This interface supports only KRC > v2.3.2 lat = latitude **Required** lon = east longitude (default = 0) body = name of the body (Default = "Mars") bodytype = kind of body - "planet", "minor", "comet" (Default = "planet") hour = hour of day for data to return (default=-32768, all hours) ls = ls for data to return (default=-32768, all seasons) INERTIA = thermal inertia of upper layers (default from 2ppd TES) Mat1 = material of upper layers, sets COND, DENSITY, SPEC_HEAT (Default="basalt") Por1 = porosity of upper layers, affects DENSITY (Default=0.4) INERTIA2 = thermal inertia of lower layers (Default from 2ppd TES) Mat2 = material of lower layers, sets COND2, DENS2, SpHeat2 (Default="Mat1") Por2 = porosity of lower layers, affects DENS2 (Default=Por1) thick = top layer thickness (default=0, no layering) TDEEP = set bottom layer temperature (default TDEEP=0, IB=0, insulating) JBARE = force frost free at specified season (default JBARE=0, no forcing) SLOPE = surface slope in degrees (default = 0) ALBEDO = albedo (default from lat,lon 2ppd TES) TAUD = dust visible opacity (default TAUD= 0.30) ELEV = elevation km (default from lat,lon 2ppd MOLA) SLOAZI = slope azimuth in degrees east from north (default = 0) DELLS = ~delta Ls desired (sets DELJUL automatically, Default = 1) DELJUL = delta julian date to increment by (Default = 1.9083) DJUL = if LKEY="T", starting Ls (Default = 0.1) or start julian date offset from J2000 LKEY = use Ls DJUL input rather than jullian date (Default ="T") JDISK = start "season" to output (Default = 721) N5 = number of "seasons" to run (Default = 1080) N24 = number of outputs per day (Default = 96) LkofT = use temperature dependant properties (Default = "T") TPREDICT = use forward prediction of temperatures for speed (Default ="T") stability = check for model stability (Default = 0) outusage = displays the bin52 file type usage KRC-ONE like option: T = sets a one-point like mode where a TI is returned for the specified conditions. This can be an array. These values are from the standard KRC input file. Defaults from above are used in place of the master.inp file values. Enter for more usage Read TEXT file: 61 lines Real Value Parameters (Values from default input file) ############################################################################ ALBEDO = .25 EMISS = 1.00 INERTIA = 200.0 COND2 = 2.77 DENS2 = 928.0 PERIOD = 1.0275 SPEC_HEAT= 647. DENSITY = 1600. CABR = 0.11 AMW = 43.5 ABRPHA = -0.00 PTOTAL = 546.0 FANON = .055 TATM = 200. TDEEP = 180.0 SpHeat2 = 1711. TAUD = 0.3 DUSTA = .90 TAURAT = 0.5 TWILI = 0.0 ARC2 = 0.5 ARC3 = -0.00 SLOPE = 0.0 SLOAZI = 90. TFROST = 146.0 CFROST = 589944. AFROST = .65 FEMIS = 0.95 AF1 = 0.54 AF2 = 0.0009 FROEXT = 50. FD32 = 0.0 RLAY = 1.2000 FLAY = .1800 CONVF = 2.0000 DEPTH = 0.0 DRSET = 0.0 DDT = .0020 GGT = 0.1 DTMAX = 0.1 DJUL = -1222.69 DELJUL = 17.174822 SOLARDEC= 00.0 DAU = 1.465 LsubS = .0 SOLCON = 1368. GRAV = 3.727 AtmCp = 735.9 ConUp0 = 0.038640 ConUp1 = -0.002145 ConUp2 = 0.002347 ConUp3 = -0.000750 ConLo0 = 2.766722 ConLo1 = -1.298966 ConLo2 = 0.629224 ConLo3 = -0.527291 SphUp0 = 646.6275 SphUp1 = 246.6678 SphUp2 = -49.8216 SphUp3 = 7.9520 SphLo0 = 1710.648 SphLo1 = 721.8740 SphLo2 = 57.44873 SphLo3 = 24.37532 Enter for more Integer Value Parameters (Values from default input file) ############################################################################ N1 = 20 N2 = 384 N3 = 15 N4 = 19 N5 = 120 N24 = 24 IB = 0 IC = 7 NRSET = 3 NMHA = 24 NRUN = 0 JDISK = 81 IDOWN = 0 FlxP14 = 45 FlxP15 = 65 KPREF = 1 K4OUT = 52 JBARE = 0 Notif = 20 IDISK2 = 0 end = 0 Boolean Parameters (Values from default input file) ############################################################################ LP1 = F LP2 = T LP3 = F LP4 = F LP5 = F LP6 = F LPGLOB = F LVFA = F LVFT = F LkofT = F LPORB = T LKEY = F LSC = F spare = F LOCAL = T Prt76 = F LPTAVE = F Prt78 = F Prt79 = F L_ONE = F Found Default File: $DV_SCRIPT_FILES/krc_support/porb_defaults/Mars_Mars.porb.hdf Enter for more K4OUT = 52. This interface only supports bin52 output which encapsulates most of the other file formats NOTE: Recommended parameter changes are listed in the first section. Please use these paramters with caution. They are meant for advanced users. N1 (the number of layers, Default=29) is calculated in the function evalN1_krc() This function relies on various parameters including FLAY, RLAY, length of the year to calculate the minimum number of layers required to reach seasonal skindepth stability N2 (the number of calculations per day, Default=288) is calculated in the functin evalN2_krc() This function relies varous parameters including FLAY, N24, PERIOD The default model iterates for 2 years before outputing a full year (N5-JDISK) of data at 1/360th year intervals (DELJUL), starting at DJUL=0 (in Ls), JDISK=721, DELJUL=1.9083 from 24.0/N24 to 24 by 24.0/N24 (15 minutes with N24=96). First layer is set at FLAY=0.18 skin depths. Each successive layer is increased by a factor of RLAY=1.2. ALBEDO and TAUD can be dynamic if input as 2 x n x 1 arrays. Ls = column 1 and ALBEDO/TAUD = column 2 See the helplist distributed with KRC for variable meanings and default values. C.Edwards + S.Piqueux 2/13
This menu offers quick guides to the basic input parameters
The next step is to generate simple runs with KRC.
Simple Runs
See the helplist distributed with KRC for variable meanings and default values.
Try designating a specific location to run the KRC model. Use the landing site of the Curiosity Rover within Gale Crater.
Latitude: 4.5o S Longitude: 137.4o E
KRC takes positive values for Northern latitudes and negative values for Southern latitudes. But KRC only takes positive values for longitude. Therefore, Western longitudes must be subtracted from 360o to be input as positive Eastern longitude values.
See the Helplist, Input Parameter Glossary. or use the KRC Main Menu to learn input parameter variable names and definitions.
dv> krc(lat=-4.5,lon=137.4)
dv> krc(lat = -4.5, lon = 137.4)
You should see the following output. If you do not see this message, check the previous line and try again.
Found Default File: $DV_SCRIPT_FILES/krc_support/porb_defaults/Mars_Mars.porb.hdf ./nfs/software/davinci_install/share/davinci//library/script_files/krc_support/ti_map2ppd_v4.vicar: VICAR bsq image: 720x360x1, 32 bits ./nfs/software/davinci_install/share/davinci//library/script_files/krc_support/albedo_2ppd.vicar: VICAR bsq image: 720x360x1, 32 bits ./nfs/software/davinci_install/share/davinci//library/script_files/krc_support/mola_2ppd.vicar: VICAR bsq image: 720x360x1, 32 bits Running KRC model with: Output: Every ~1.000 Ls (1.9083 JD) for 360 seasons starting at 0.10 Ls For 96 times per day, every 15 local minutes Running model WITH NO temperature prediction because DELJUL < 3.0779 For a Surface With: 29 Layers with uniform material properties and 384 daily model time steps and T-dependant material properties and an insulating bottom edge condition With Observation Parameters: LATITUDE: -4.50 LONGITUDE: 137.40 ELEVATION: -3.606km^ SLOPE/AZIMUTH: 0.00/0.00deg ALBEDO: 0.228^ OPACITY: 0.300 HOUR: All LS: All Upper Material: INERTIA: 230.00 CONDUCTIVITY: 0.0502* DENSITY: 1770.00* SPECIFIC HEAT: 595.55 POROSITY: 0.40 * = derived value unless overwritten by user ^ = from TES 2ppd map unless overwritten by user & = ajusted for max authorized value struct, 14 elements tsurf: 96x1x360 array of double, bsq format [276,480 bytes] tbol: 96x1x360 array of double, bsq format [276,480 bytes] tatm: 96x1x360 array of double, bsq format [276,480 bytes] down_ir: 96x1x360 array of double, bsq format [276,480 bytes] down_vis: 96x1x360 array of double, bsq format [276,480 bytes] time: 96x1x1 array of float, bsq format [384 bytes] ls: 1x1x360 array of double, bsq format [2,880 bytes] lat: -4.500000000 elev: -3.605580091 layer: struct, 8 elements thickness: 28x2x1 array of double, bsq format [448 bytes] center: 28x2x1 array of double, bsq format [448 bytes] top: 28x2x1 array of double, bsq format [448 bytes] center_mass: 28x1x1 array of double, bsq format [224 bytes] mass_burden: 28x1x1 array of double, bsq format [224 bytes] thermal_scales: 28x1x1 array of double, bsq format [224 bytes] tmax: 28x1x360 array of double, bsq format [80,640 bytes] tmin: 28x1x360 array of double, bsq format [80,640 bytes] anc: struct, 11 elements krccom: struct, 5 elements... JDate: 1x1x360 array of double, bsq format [2,880 bytes] ref_pressure: 1x1x360 array of double, bsq format [2,880 bytes] taud: 1x1x360 array of double, bsq format [2,880 bytes] total_frost: 1x1x360 array of double, bsq format [2,880 bytes] avg_heat_flow: 1x1x360 array of double, bsq format [2,880 bytes] frost_alb: 1x1x360 array of double, bsq format [2,880 bytes] frost: 1x1x360 array of double, bsq format [2,880 bytes] tatm_predict: 1x1x360 array of double, bsq format [2,880 bytes] delta_t_rms: 1x1x360 array of double, bsq format [2,880 bytes] converge_days: 1x1x360 array of double, bsq format [2,880 bytes] version: "v3.2.1" alb: 0.2282352895 body: "Mars"
This output creates a multi-element structure consisting of model outputs as well as input parameters. Some of these outputs (i.e. Kinetic Surface Temperature, tsurf, Bolometeric Temperature, tbol, and Atmospheric Temperature, tatm, are three dimensional elements where the first dimension contains the values for all hours of a single day, and the third dimension contains all values for all LS of a single year.
Now, add some more input parameters into the model. The following line is an example of possible variables that might be included in a simple run.
dv> krc(lat = -4.5, lon = 137.4, ELEV = -4.4, SLOPE = 1.2, SLOAZI = 43)
Elevation is in units of kilometers, slope and azimuth (SLOAZI) are both in degrees. The output should be similar to the previous Run, but with the new specific parameters.
Plot model Parameters
We will also plot the output from the previous run. You must declare this run as a variable to plot the output. For example, use KRC_Out.
First, plot Kinetic Surface Temperature as a function of hours for a given season of the year. The seasons are contained in the element "ls". There are 360 values for possible season indicators. Keep in mind ls[1,1,90] is not LS of 90, it is index 90 of ls. LS 90 = ls[1,1,105]
dv> KRC_Out = krc(lat = -4.5, lon = 137.4, ELEV = -4.4, SLOPE = 1.2, SLOAZI = 43) dv> pplot(KRC_Out.tsurf[,,105], Xaxis = KRC_Out.time, xlabel = "Hour", ylabel = "Kinetic Surface Temperature (K)", plot_title = "Diurnal Temperature", "Daily Temp"]
Next, plot Kinetic Surface Temperature as a function of season for a given hour of the day. The given hour of the day is defined by the
dv> pplot(KRC_Out.tsurf[52,,], Xaxis = KRC_Out.ls, xlabel = "Seasonal Indicator", ylabel = "Kinetic Surface Temperature (K)", plot_title = "Seasonal Temperature", "Seasonal Temp")
Now, plot several times of day on the same plot throughout an entire year.
dv> pplot({KRC_Out.tsurf[24,,],KRC_Out.tsurf[48,,],KRC_Out.tsurf[72,,]},{"Hour = 6 AM", "Hour = 12 PM", "Hour = 6 PM"}, xaxis = gale.ls, xlabel = "Hour", ylabel = "Kinetic Surface Temperature (K)", plot_title = "Diurnal Temperatures Changes at Specific Times", key = "top left")
Now, plot all seasons over an entire day. This will show how daily temperatures change over the course of a year.
dv> pplot(KRC_Out.tsurf[,,], Xaxis = KRC_Out.ls, xlabel = "Seasonal Indicator", ylabel = "Kinetic Surface Temperature (K)", plot_title = " Temperature", "Seasonal Temp")