int main(int argc, char* argv[]) { #ifdef _MSC_VER _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); #endif if (argc < 4) { fprintf (stdout, "usage: dParcelGenerator [GrammarFile] [scannerClasName] [OutputFileName]\n"); fprintf (stdout, "[GrammarFile] name of the file containing a Yacc like Grammar file\n"); fprintf (stdout, "[ScannerClass] Name of the Scanner Class Generated by dLexGenerator\n"); fprintf (stdout, "[OutputFileName] name of the file cpp output file\n"); exit (0); } const char* const inputRulesFileName = argv[1]; const char* const scannerClassName = argv[2]; const char* const outputFileName = argv[3]; if (!CheckDependency (outputFileName, inputRulesFileName)) { FILE* const rules = fopen (inputRulesFileName, "rb"); if (!rules) { fprintf (stdout, "Rule file \"%s\" not found\n", inputRulesFileName); exit (0); } dString buffer; buffer.LoadFile(rules); fclose (rules); dParserCompiler parcel (buffer, outputFileName, scannerClassName); } return 0; }
boost::shared_ptr<parcel_buffer_type> get_buffer(parcel const & p = parcel(), std::size_t arg_size = 0) { if(!buffer_ || (buffer_ && !buffer_->parcels_decoded_)) { buffer_ = boost::make_shared<parcel_buffer_type>(buffer_type()); } buffer_->data_.reset(); return buffer_; }
/*NP*/ void plot_vis(void) /*************************************************************/ /* PLOT_VIS */ /* John Hart NSSFC KCMO */ /* */ /* Plots the results of storm-relative parcel trajectory. */ /*************************************************************/ { float sfctemp, sfcdwpt, sfcpres, ix1; short x1, y1, x2, y2, ulx, uly, vwid; Parcel pcl; ulx = hov.tlx; uly = hov.bry; vwid = 120; setcliprgn( ulx, uly, ulx + vwid, uly + vwid - 1); setcolor(0); setlinestyle( 1, 1 ); rectangle( 1, ulx, uly, ulx + vwid, uly + vwid - 1); setcolor(1); rectangle( 0, ulx, uly, ulx + vwid, uly + vwid - 1); /* ----- Plot Crosshairs ----- */ setcolor(24); moveto(ulx, uly + (vwid/2)); lineto(ulx + vwid, uly + (vwid/2)); moveto(ulx + (vwid/2), uly); lineto(ulx + (vwid/2), uly + vwid); /* ----- Plot Label ----- */ setcolor(1); /* outgtext( "Storm", hov.brx-145, hov.tly + 125 ); */ outgtext( "Storm Slinky", ulx + 5, uly + vwid-13 ); /* ----- Calculate Parcel Data ----- */ sfctemp = lplvals.temp; sfcdwpt = lplvals.dwpt; sfcpres = lplvals.pres; ix1 = parcel( -1, -1, sfcpres, sfctemp, sfcdwpt, &pcl); /* ----- Plot storm motion ----- */ x1 = ulx + (vwid/2); y1 = uly + (vwid/2); x2 = x1 + (short)ucomp( st_dir, 30); y2 = y1 - (short)vcomp( st_dir, 30); setcolor(31); moveto( x1, y1); lineto( x2, y2); /* ----- Run Visualization Routine ----- */ ix1 = visual1( pcl.lfcpres, pcl.elpres, sfcpres, sfctemp, sfcdwpt, ulx, uly, vwid); setcliprgn(1, 1, xwdth, xhght); }
boost::shared_ptr<parcel_buffer_type> get_buffer(parcel const & p = parcel(), std::size_t arg_size = 0) { if(!buffer_ || (buffer_ && !buffer_->parcels_decoded_)) { boost::system::error_code ec; buffer_ = boost::shared_ptr<parcel_buffer_type>( new parcel_buffer_type( allocator<message::payload_size>(memory_pool_) ) ); buffer_->data_.reserve(arg_size); } return buffer_; }
/*NP*/ void write_file2( char *filename ) /*************************************************************/ /* WRITE_FILE */ /* John Hart NSSFC KCMO */ /* */ /* Writes contents of sndg array into SHARP95 file. */ /*************************************************************/ { short i, j; short idx[7]; float sfctemp, sfcdwpt, sfcpres, j1, j2, ix1; struct _parcel pcl; char st[80]; FILE *fout; idx[1] = getParmIndex("PRES"); idx[2] = getParmIndex("HGHT"); idx[3] = getParmIndex("TEMP"); idx[4] = getParmIndex("DWPT"); idx[5] = getParmIndex("DRCT"); idx[6] = getParmIndex("SPED"); fout = fopen( filename, "wt" ); if (fout==NULL) { printf("Unable to write output file!\n" ); return; } fputs( "%TITLE%\n", fout ); fputs( raobtitle, fout ); fputs( "\n\n", fout ); fprintf( fout, " LEVEL HGHT TEMP DWPT WDIR WSPD\n"); fprintf( fout, "-------------------------------------------------------------------\n"); fputs( "%RAW%\n", fout ); for(i=0; i<numlvl; i++) { for(j=1; j<=5; j++) fprintf( fout, "%8.2f, ", sndg[i][idx[j]]); fprintf( fout, "%8.2f\n", sndg[i][idx[6]]); } fputs( "%END%\n\n", fout ); if ((numlvl<4) || (!qc(i_dwpt(700, I_PRES)))) return; fprintf( fout, "----- Parcel Information-----\n"); /* ----- Calculate Parcel Data ----- */ sfctemp = lplvals.temp; sfcdwpt = lplvals.dwpt; sfcpres = lplvals.pres; strcpy( st, "*** " ); strcat( st, lplvals.desc ); strcat( st, " ***" ); fprintf( fout, "%s\n", st); ix1 = parcel( -1, -1, sfcpres, sfctemp, sfcdwpt, &pcl); fprintf( fout, "LPL: P=%.0f T=%.0fF Td=%.0fF\n", sfcpres, ctof(sfctemp), ctof(sfcdwpt)); fprintf( fout, "CAPE: %6.0f J/kg\n", pcl.bplus); fprintf( fout, "CINH: %6.0f J/kg\n", pcl.bminus); fprintf( fout, "LI: %6.0f C\n", pcl.li5); fprintf( fout, "LI(300mb): %6.0f C\n", pcl.li3); fprintf( fout, "3km Cape: %6.0f J/kg\n", pcl.cape3km); j1 = pcl.bplus; j2 = i_hght(pcl.elpres, I_PRES) - i_hght(pcl.lfcpres, I_PRES); fprintf( fout, "NCAPE: %6.2f m/s2\n\n", j1/j2); fprintf( fout, "LCL: %6.0fmb %6.0fm\n", pcl.lclpres, agl(i_hght(pcl.lclpres, I_PRES))); fprintf( fout, "LFC: %6.0fmb %6.0fm\n", pcl.lfcpres, agl(i_hght(pcl.lfcpres, I_PRES))); fprintf( fout, "EL: %6.0fmb %6.0fm\n", pcl.elpres, agl(i_hght(pcl.elpres, I_PRES))); fprintf( fout, "MPL: %6.0fmb %6.0fm\n", pcl.mplpres, agl(i_hght(pcl.mplpres, I_PRES))); fprintf( fout, "All heights AGL\n\n" ); fprintf( fout, "----- Moisture -----\n" ); strcpy( st, qc2( precip_water( &ix1, -1, -1), " in", 2 )); fprintf( fout, "Precip Water: %s\n", st); strcpy( st, qc2( mean_mixratio( &ix1, -1, -1 ), " g/Kg", 1 )); fprintf( fout, "Mean W: %s\n\n", st); fprintf( fout, "----- Lapse Rates -----\n" ); j1 = delta_t(&ix1); j2 = lapse_rate( &ix1, 700, 500); fprintf( fout, "700-500mb %.0f C %.1f C/km\n", j1, j2); j1 = vert_tot(&ix1); j2 = lapse_rate( &ix1, 850, 500); fprintf( fout, "850-500mb %.0f C %.1f C/km\n", j1, j2); fclose( fout ); }
static void create_buffer_blocks(void *mem_ctx, struct gl_context *ctx, struct gl_shader_program *prog, struct gl_uniform_block **out_blks, unsigned num_blocks, struct hash_table *block_hash, unsigned num_variables, bool create_ubo_blocks) { if (num_blocks == 0) { assert(num_variables == 0); return; } assert(num_variables != 0); /* Allocate storage to hold all of the information related to uniform * blocks that can be queried through the API. */ struct gl_uniform_block *blocks = rzalloc_array(mem_ctx, gl_uniform_block, num_blocks); gl_uniform_buffer_variable *variables = ralloc_array(blocks, gl_uniform_buffer_variable, num_variables); /* Add each variable from each uniform block to the API tracking * structures. */ ubo_visitor parcel(blocks, variables, num_variables, prog); STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_STD140) == unsigned(ubo_packing_std140)); STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_SHARED) == unsigned(ubo_packing_shared)); STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_PACKED) == unsigned(ubo_packing_packed)); STATIC_ASSERT(unsigned(GLSL_INTERFACE_PACKING_STD430) == unsigned(ubo_packing_std430)); unsigned i = 0; struct hash_entry *entry; hash_table_foreach (block_hash, entry) { const struct link_uniform_block_active *const b = (const struct link_uniform_block_active *) entry->data; const glsl_type *block_type = b->type; if ((create_ubo_blocks && !b->is_shader_storage) || (!create_ubo_blocks && b->is_shader_storage)) { if (b->array != NULL) { unsigned binding_offset = 0; char *name = ralloc_strdup(NULL, block_type->without_array()->name); size_t name_length = strlen(name); assert(b->has_instance_name); process_block_array(b->array, &name, name_length, blocks, &parcel, variables, b, &i, &binding_offset, ctx, prog); ralloc_free(name); } else { blocks[i].Name = ralloc_strdup(blocks, block_type->name); blocks[i].Uniforms = &variables[parcel.index]; blocks[i].Binding = (b->has_binding) ? b->binding : 0; blocks[i].UniformBufferSize = 0; blocks[i]._Packing = gl_uniform_block_packing(block_type->interface_packing); blocks[i]._RowMajor = block_type->get_interface_row_major(); parcel.process(block_type, b->has_instance_name ? block_type->name : ""); blocks[i].UniformBufferSize = parcel.buffer_size; /* Check SSBO size is lower than maximum supported size for SSBO */ if (b->is_shader_storage && parcel.buffer_size > ctx->Const.MaxShaderStorageBlockSize) { linker_error(prog, "shader storage block `%s' has size %d, " "which is larger than than the maximum allowed (%d)", block_type->name, parcel.buffer_size, ctx->Const.MaxShaderStorageBlockSize); } blocks[i].NumUniforms = (unsigned)(ptrdiff_t) (&variables[parcel.index] - blocks[i].Uniforms); i++; } } } *out_blks = blocks; assert(parcel.index == num_variables); }
static void create_buffer_blocks(void *mem_ctx, struct gl_context *ctx, struct gl_shader_program *prog, struct gl_uniform_block **out_blks, unsigned num_blocks, struct hash_table *block_hash, unsigned num_variables, bool create_ubo_blocks) { if (num_blocks == 0) { assert(num_variables == 0); return; } assert(num_variables != 0); /* Allocate storage to hold all of the information related to uniform * blocks that can be queried through the API. */ struct gl_uniform_block *blocks = rzalloc_array(mem_ctx, gl_uniform_block, num_blocks); gl_uniform_buffer_variable *variables = ralloc_array(blocks, gl_uniform_buffer_variable, num_variables); /* Add each variable from each uniform block to the API tracking * structures. */ ubo_visitor parcel(blocks, variables, num_variables, prog, ctx->Const.UseSTD430AsDefaultPacking); unsigned i = 0; struct hash_entry *entry; hash_table_foreach (block_hash, entry) { const struct link_uniform_block_active *const b = (const struct link_uniform_block_active *) entry->data; const glsl_type *block_type = b->type; if ((create_ubo_blocks && !b->is_shader_storage) || (!create_ubo_blocks && b->is_shader_storage)) { unsigned binding_offset = 0; if (b->array != NULL) { char *name = ralloc_strdup(NULL, block_type->without_array()->name); size_t name_length = strlen(name); assert(b->has_instance_name); process_block_array(b->array, &name, name_length, blocks, &parcel, variables, b, &i, &binding_offset, ctx, prog, i); ralloc_free(name); } else { process_block_array_leaf(block_type->name, blocks, &parcel, variables, b, &i, &binding_offset, 0, ctx, prog); } } } *out_blks = blocks; assert(parcel.index == num_variables); }
/*NP*/ void plot_storminflow( void ) /*************************************************************/ /* PLOT_STORMINFLOW */ /* John Hart NSSFC KCMO */ /* */ /* Plots various inflow/sr wind vectors. */ /*************************************************************/ { float sfctemp, sfcdwpt, sfcpres, ix1, ix2, ix3, ix4; short x1, y1, x2, y2, x3, y3, i; struct _parcel pcl; setcliprgn( hov.brx-150, hov.tly, hov.brx, hov.tly+150); setcolor(0); setlinestyle( 1, 1 ); rectangle( 1, hov.brx-150, hov.tly, hov.brx, hov.tly+150); setcolor(1); rectangle( 0, hov.brx-150, hov.tly, hov.brx, hov.tly+150); setcolor(1); moveto(hov.brx-150, hov.tly + 75); lineto(hov.brx, hov.tly+75); moveto(hov.brx-75, hov.tly); lineto(hov.brx-75, hov.tly+150); sfctemp = lplvals.temp; sfcdwpt = lplvals.dwpt; sfcpres = lplvals.pres; /* ----- Plot speed rings ----- */ x1 = hov.brx - 75; y1 = hov.tly + 75; setlinestyle( 2, 1 ); setcolor(24); for(i=20; i<=60; i+=20) { ellipse( 0, x1-i, y1-i, x1+i, y1+i); } rectangle( 0, hov.brx-150, hov.tly, hov.brx, hov.tly+150); /* ----- Plot Label ----- */ setcolor(1); outgtext( "SR Wind", hov.brx-135, hov.tly + 3 ); outgtext( "Vectors", hov.brx-135, hov.tly + 15 ); /* ----- Calculate Parcel Data ----- */ ix1 = parcel( -1, -1, sfcpres, sfctemp, sfcdwpt, &pcl); /* ----- Plot 0-2km Inflow Vector ----- */ sr_wind( -1, i_pres(msl(2000)), st_dir, st_spd, &ix1, &ix2, &ix3, &ix4); if(qc(ix3)) { x1 = hov.brx - 75; y1 = hov.tly + 75; x2 = (hov.brx - 75) + (short)ix1; y2 = (hov.tly + 75) - (short)ix2; x3 = x2 + 1; y3 = y2 + 1; setlinestyle( 1, 2 ); setcolor(2); moveto( x1, y1); lineto( x2, y2); outgtext( "L", x3, y3 ); } /* ----- Plot 4-6km Inflow Vector ----- */ sr_wind( i_pres(msl(4000)), i_pres(msl(6000)), st_dir, st_spd, &ix1, &ix2, &ix3, &ix4); if(qc(ix3)) { x1 = hov.brx - 75; y1 = hov.tly + 75; x2 = (hov.brx - 75) + (short)ix1; y2 = (hov.tly + 75) - (short)ix2; x3 = x2 + 1; y3 = y2 + 1; setcolor(6); setlinestyle( 1, 2 ); moveto( x1, y1); lineto( x2, y2); outgtext( "M", x3, y3 ); } /* ----- Plot 9-11km Inflow Vector ----- */ sr_wind( i_pres(msl(9000)), i_pres(msl(11000)), st_dir, st_spd, &ix1, &ix2, &ix3, &ix4); if(qc(ix3)) { x1 = hov.brx - 75; y1 = hov.tly + 75; x2 = (hov.brx - 75) + (short)ix1; y2 = (hov.tly + 75) - (short)ix2; x3 = x2 + 1; y3 = y2 + 1; setcolor(7); setlinestyle( 1, 2 ); moveto( x1, y1); lineto( x2, y2); outgtext( "H", x3, y3 ); } }
/*NP*/ float bndry_ci(float lift, float distance) /*************************************************************/ /* BOUNDARY CONVECTIVE INITIATION */ /* Rich Thompson and John Hart SPC OUN */ /* */ /* Lifts ML parcel to find LFC, then calculates parcel */ /* trajectory relative to a boundary. If parcel stays */ /* within dist_to_bndry long enough to reach the LFC, */ /* then convective initiation is likely */ /* */ /* lift = ascent rate in m/min along boundary */ /* dist_to_bndry = width of ascent zone (m) */ /*************************************************************/ { float ix1, ix2, u, v, pe1, pe2, lfc, height, pres; short oldlplchoice, i, min_lift; Parcel pcl; oldlplchoice = lplvals.flag; /* ----- Begin with ML parcel LFC height (m AGL) */ define_parcel(4,100); ix1 = parcel( -1, -1, lplvals.pres, lplvals.temp, lplvals.dwpt, &pcl); lfc = agl(i_hght(pcl.lfcpres, I_PRES)); /* ----- Calculate minutes of lift needed to reach LFC */ min_lift = (short)(lfc / lift); printf("\nminutes of lift to LFC = %d\n", min_lift); /* if parcel remains within distance (to bndry), continue ascent */ for (i = 0; i < min_lift; i++){ height = i * lift; /* pe1 = i_pres(msl(height)); pe2 = i_pres(msl(height)); restim = dh / uvv; tottim += restim; sr_wind( pe1, pe2, st_dir, st_spd, &u, &v, &ix1, &ix2); du = kt_to_mps(u) * restim; dv = kt_to_mps(v) * restim; tsu -= du; tsv += dv; distance = (float)sqrt((tsu*tsu) + (tsv*tsv)); tangle = angle(tsu, tsv); */ } if (oldlplchoice == 3) pres = mu_layer; else if (oldlplchoice == 4) pres = mml_layer; else if (oldlplchoice == 5) pres = user_level; else pres = mml_layer; define_parcel(oldlplchoice, pres); return min_lift; }
/* NP */ short ww_type(short *wwtype, short *dcp) /********************************************************************/ /* Watch type guidance */ /* A decision tree to help with ww issuance */ /* */ /* Rich Thompson SPC OUN */ /********************************************************************/ { float ix1, ix2, ix3, ix4, lr75, shr6, t500, fzlh, mumixr, lowrh, midrh, low_mid_rh; float mucn, mlcn, mlcp, sbcp, mucp, lr1, lr3, shr6_dir, sr46_dir, sr46_spd, shr6_sr46_diff, mmp; float sig_tor, sig_tor_winter, sighail, wind_dmg, rm_scp, cbsig, dncp, srh1, sblcl, mllcl; float oldlplpres, pres, pbot, ptop, shr8, bot, top, esrh, lm_scp; short oldlplchoice, ww_choice; short pIndex, tIndex, zIndex, tdIndex; short x1, y1, x2, y2, tlx, tly, wid; struct _parcel pcl; char st[40]; tlx = hov.tlx + 409; tly = hov.bry; wid = 119; setcliprgn( tlx+2, tly+2, tlx+wid+24, tly+wid+1); setcolor(0); setlinestyle( 1, 1 ); rectangle( 1,tlx, tly, tlx+wid+27, tly+wid+1); setcolor(1); rectangle( 0, tlx, tly, tlx+wid+27, tly+wid+1); setlinestyle( 1, 1 ); moveto( tlx + 2, tly + 18); lineto(tlx + wid + 27, tly + 18); /* ----- Plot Label ----- */ set_font(6); setcolor(1); outgtext( "Psbl Watch Type", tlx + 20, tly + 3 ); *wwtype = 0; *dcp = 0; oldlplchoice = lplvals.flag; tIndex = getParmIndex("TEMP"); pIndex = getParmIndex("PRES"); zIndex = getParmIndex("HGHT"); tdIndex = getParmIndex("DWPT"); /* 24 Mar 2008 */ /* effective_inflow_layer(100, -250, &pbot, &ptop);*/ /* sb parcel */ define_parcel(1,0); ix1 = parcel(-1, -1, lplvals.pres, lplvals.temp, lplvals.dwpt, &pcl); sbcp = pcl.bplus; sblcl = agl(i_hght(pcl.lclpres, I_PRES)); sig_tor_winter = sigtorn_fixed(st_dir, st_spd); /* ml parcel */ define_parcel(4,100); ix1 = parcel(-1, -1, lplvals.pres, lplvals.temp, lplvals.dwpt, &pcl); mlcn = pcl.bminus; mlcp = pcl.bplus; mllcl = agl(i_hght(pcl.lclpres, I_PRES)); sig_tor = sigtorn_cin(st_dir, st_spd); /* mu parcel */ define_parcel(3,400); mucp = parcel(-1, -1, lplvals.pres, lplvals.temp, lplvals.dwpt, &pcl); mucn = pcl.bminus; dncp = dcape(&ix1, &ix2); /* sighail ingredients */ lr75 = lapse_rate(&ix1, 700, 500); wind_shear(sndg[sfc()][pIndex], i_pres(msl(6000)), &ix1, &ix2, &ix3, &ix4); shr6 = ix4; shr6_dir = ix3; wind_shear(sndg[sfc()][pIndex], i_pres(msl(8000)), &ix1, &ix2, &ix3, &ix4); shr8 = ix4; mumixr = mixratio(lplvals.pres, lplvals.dwpt); t500 = i_temp(500, I_PRES); fzlh = mtof(agl(i_hght(temp_lvl(0, &ix1), I_PRES))); sighail = sig_hail(pcl.bplus, mumixr, lr75, t500, kt_to_mps(shr6), fzlh, pcl.bminus, 0, 0, 25, mlcp); rm_scp = scp(st_dir, st_spd); wind_dmg = damaging_wind(); sr_wind( i_pres(msl(4000)), i_pres(msl(6000)), st_dir, st_spd, &ix1, &ix2, &ix3, &ix4); sr46_dir = ix3; sr46_spd = ix4; shr6_sr46_diff = (shr6_dir - sr46_dir); srh1 = helicity(0, 1000, st_dir, st_spd, &ix1, &ix2); bot = agl(i_hght(p_bot, I_PRES)); top = agl(i_hght(p_top, I_PRES)); esrh = helicity(bot, top, st_dir, st_spd, &ix1, &ix2); lapse_rate(&ix2, sndg[sfc()][pIndex], i_pres(sndg[sfc()][zIndex]+1000)); lr1 = ix2; lapse_rate(&ix2, sndg[sfc()][pIndex], i_pres(sndg[sfc()][zIndex]+3000)); lr3 = ix2; mean_relhum(&ix1, sndg[sfc()][pIndex]-150, sndg[sfc()][pIndex]-350); midrh = ix1; mean_relhum(&ix1, sndg[sfc()][pIndex], sndg[sfc()][pIndex]-150); lowrh = ix1; low_mid_rh = ((lowrh + midrh)/2); mmp = coniglio1(); cbsig = (mlcp * kt_to_mps(shr6)); /* 24 Mar 2008 */ /* all "p_bot" below were changed from "pbot" */ /* Decision tree below is identical to the operational "ww_type" flow chart documentation 9/23/09 RLT */ if ((sig_tor >= 3.0) && (sig_tor_winter >= 3.0) && (srh1 >= 150) && (esrh >= 150) && (sr46_spd >= 15.0) && (shr8 >= 40.0) && (sblcl < 1000) && (mllcl < 1100) && (lr1 >= 5.0) && (bot == 0.0)) { *dcp = 1; *wwtype = 5; ww_choice = 5; /*printf("\n dcp (in PDS) = %d", *dcp);*/ set_font(6); setcolor(7); outgtext( "PDS TOR", tlx + 45, tly + 60 ); } /* else if ((sig_tor_winter >= 4.0) && (sr46_spd >= 15.0) && (shr8 >= 40.0) && (sblcl < 1000) && (lr1 >= 5.0) && (bot == 0.0)) { *dcp = 2; *wwtype = 5; ww_choice = 5; set_font(6); setcolor(7); outgtext( "PDS TOR", tlx + 45, tly + 60 ); } */ else if (((sig_tor >= 3.0) || (sig_tor_winter >= 4.0)) && (bot == 0.0)) { *dcp = 3; *wwtype = 4; ww_choice = 4; /*printf("\n dcp (in TOR) = %d", *dcp);*/ set_font(6); setcolor(2); outgtext( "TOR", tlx + 45, tly + 60 ); } else if (((sig_tor >= 1.0) || (sig_tor_winter >= 1.0)) && ((sr46_spd >= 15.0) || (shr8 >= 40.0)) && (bot == 0.0)) { *dcp = 4; *wwtype = 4; ww_choice = 4; /*printf("\n dcp (in TOR) = %d", *dcp);*/ set_font(6); setcolor(2); outgtext( "TOR", tlx + 45, tly + 60 ); } else if (((sig_tor >= 1.0) || (sig_tor_winter >= 1.0)) && (low_mid_rh >= 60) && (lr1 >= 5.0) && (bot == 0.0)) { *dcp = 5; *wwtype = 4; ww_choice = 4; /*printf("\n dcp (in TOR) = %d", *dcp);*/ set_font(6); setcolor(2); outgtext( "TOR", tlx + 45, tly + 60 ); } else if ((( sig_tor >= 1.0) || (sig_tor_winter >= 1.0)) && (bot == 0.0)) { *dcp = 6; *wwtype = 3; ww_choice = 3; /*printf("\n dcp (in mrgl TOR) = %d", *dcp);*/ set_font(6); setcolor(2); outgtext( "mrgl TOR", tlx + 40, tly + 60 ); } else if (((( sig_tor >= 0.5) && (esrh >= 150)) || ((sig_tor_winter >= 0.5) && (srh1 >= 150))) && (bot == 0.0)) { *dcp = 7; *wwtype = 3; ww_choice = 3; /*printf("\n dcp (in mrgl TOR) = %d", *dcp);*/ set_font(6); setcolor(2); outgtext( "mrgl TOR", tlx + 40, tly + 60 ); } else if ((( sig_tor_winter >= 1.0) || (rm_scp >= 4.0) || (sig_tor >= 1.0)) && (mucn >= -50.0)) { *dcp = 8; *wwtype = 2; ww_choice = 2; /*printf("\n dcp (in SVR) = %d", *dcp);*/ set_font(6); setcolor(6); outgtext( "SVR", tlx + 60, tly + 60 ); } else if ((rm_scp >= 2.0) && ((sighail >= 1.0) || (dncp >= 750)) && (mucn >= -50.0)) { *dcp = 9; *wwtype = 2; ww_choice = 2; /*printf("\n dcp (in SVR) = %d", *dcp);*/ set_font(6); setcolor(6); outgtext( "SVR", tlx + 60, tly + 60 ); } else if ((cbsig >= 30000) && (mmp >= 0.6) && (mucn >= -50.0)) { *dcp = 10; *wwtype = 2; ww_choice = 2; /*printf("\n dcp (in SVR) = %d", *dcp);*/ set_font(6); setcolor(6); outgtext( "SVR", tlx + 60, tly + 60 ); } else if ((mucn >= -75.0) && ((wind_dmg >= 0.5) || (sighail >= 0.5) || (rm_scp >= 0.5))) { *dcp = 11; *wwtype = 1; ww_choice = 1; /*printf("\n dcp (in mrgl SVR) = %d", *dcp);*/ set_font(6); setcolor(26); outgtext( "MRGL SVR", tlx + 40, tly + 60 ); } else { *dcp = 0; /*printf("\n dcp (after logic checks) = %d", *dcp);*/ *wwtype = 0; ww_choice = 0; } if (*wwtype == 0) { set_font(6); setcolor(19); outgtext( "NONE", tlx + 50, tly + 60 ); } //printf("sig_tor=%f sig_tor_winter=%f srh1=%f esrh=%f sr46_spd=%f shr8=%f sblcl=%f\n mllcl=%f lr1=%f bot=%f low_mid_rh=%f rm_scp=%f\n mucn=%f dncp=%f sighail=%f cbsig=%f wind_dmg=%f", // sig_tor,sig_tor_winter,srh1,esrh,sr46_spd,shr8, sblcl, mllcl, lr1, bot, low_mid_rh, rm_scp,mucn, dncp, sighail, cbsig, wind_dmg); /* define_parcel(oldlplchoice, oldlplpres); */ /* set parcel back to user selection */ if (oldlplchoice == 1) pres = 0; else if (oldlplchoice == 2) pres = 0; else if (oldlplchoice == 3) pres = mu_layer; else if (oldlplchoice == 4) pres = mml_layer; else if (oldlplchoice == 5) pres = user_level; else if (oldlplchoice == 6) pres = mu_layer; define_parcel(oldlplchoice, pres); return ww_choice; }