|
14 | 14 | # Usage: bash postprocessing_E3SM_data_for_AR_analysis.sh |
15 | 15 | # |
16 | 16 | # Author: Jill Zhang, |
17 | | -# Based on Paul Ullrich et al. 2021: TempestExtremes v2.1: a community framework for feature detection, tracking, and analysis in large datasets |
| 17 | +# Based on Paul Ullrich et al. 2021: TempestExtremes v2.1: a community framework for feature detection, tracking, and analysis in large datasets, and |
| 18 | +# Reed et al. 2023: Evaluating the Simulation of CONUS Precipitation by Storm Type in E3SM. |
18 | 19 | # Date: July 2025 |
19 | 20 | # Version: 1.0 |
20 | 21 | #=============================================================================== |
@@ -230,7 +231,151 @@ StitchNodes \ |
230 | 231 | --out "${result_dir}cyclones_stitch_${file_name}.dat" \ |
231 | 232 | --threshold "wind,>=,17.5,6;lat,<=,40.0,6;lat,>=,-40.0,6" |
232 | 233 |
|
233 | | -echo " TC detection and tracking completed" |
| 234 | +# Calculate TC radial wind profiles and outer circulation size |
| 235 | +echo " Calculating TC radial wind profiles and circulation size..." |
| 236 | +echo " Radial bins: 0.5° for ne30, 0.125° for ne120" |
| 237 | + |
| 238 | +# Set radial bin size based on resolution |
| 239 | +if [ ${res} -eq 120 ]; then |
| 240 | + radial_bin="0.125" |
| 241 | +else |
| 242 | + radial_bin="0.5" |
| 243 | +fi |
| 244 | + |
| 245 | +NodeFileEditor \ |
| 246 | + --in_connect "${result_dir}connect_CSne${res}_v2.dat" \ |
| 247 | + --in_data_list "${result_dir}inputfile_${file_name}.txt" \ |
| 248 | + --in_nodefile "${result_dir}cyclones_stitch_${file_name}.dat" \ |
| 249 | + --out_nodefile "${result_dir}cyclones_radprof_${file_name}.dat" \ |
| 250 | + --in_fmt "lon,lat,slp,wind" \ |
| 251 | + --calculate "rprof=radial_wind_profile(U10,V10,159,${radial_bin});rsize=lastwhere(rprof,>,8)" \ |
| 252 | + --out_fmt "lon,lat,rsize,rprof" |
| 253 | + |
| 254 | +echo " TC radial wind profile calculation completed" |
| 255 | + |
| 256 | +# Create TC mask files for precipitation identification |
| 257 | +echo " Creating TC mask files..." |
| 258 | +echo " Binary mask: 1 within TC circulation radius, 0 elsewhere" |
| 259 | + |
| 260 | +# Create output directory for TC masks |
| 261 | +mkdir -p "${result_dir}TC_masks" |
| 262 | + |
| 263 | +# Generate TC mask file list |
| 264 | +rm -f "${result_dir}tc_mask_files_out.txt" |
| 265 | +for f in $(eval echo "${drc_in}/${caseid}.${atm_name}.h2.*{${start}..${end}}*.nc"); do |
| 266 | + if [ -f "$f" ]; then |
| 267 | + g=$(basename "$f") |
| 268 | + date_part="${g#${caseid}.${atm_name}.h2.}" |
| 269 | + date_part="${date_part%.nc}" |
| 270 | + tc_mask_file="${result_dir}TC_masks/${caseid}.${atm_name}.h2.${date_part}.TC_mask.nc" |
| 271 | + echo "${tc_mask_file}" >> "${result_dir}tc_mask_files_out.txt" |
| 272 | + fi |
| 273 | +done |
| 274 | + |
| 275 | +NodeFileFilter \ |
| 276 | + --in_connect "${result_dir}connect_CSne${res}_v2.dat" \ |
| 277 | + --in_nodefile "${result_dir}cyclones_radprof_${file_name}.dat" \ |
| 278 | + --in_fmt "lon,lat,rsize,rprof" \ |
| 279 | + --in_data_list "${result_dir}inputfile_${file_name}.txt" \ |
| 280 | + --out_data_list "${result_dir}tc_mask_files_out.txt" \ |
| 281 | + --bydist "rsize" \ |
| 282 | + --maskvar "stormmask" |
| 283 | + |
| 284 | +echo " TC mask creation completed" |
| 285 | + |
| 286 | +#=============================================================================== |
| 287 | +# STEP 2B: EXTRATROPICAL CYCLONE DETECTION AND TRACKING |
| 288 | +#=============================================================================== |
| 289 | + |
| 290 | +echo "Step 2B: Detecting extratropical cyclones..." |
| 291 | +echo " Method: Sea level pressure minima with closed contour criteria" |
| 292 | +echo " SLP decrease: 200 Pa within 6° radius" |
| 293 | +echo " Warm-core check: T200/T500 average to eliminate TCs" |
| 294 | +echo " Merge distance: 6°" |
| 295 | + |
| 296 | +# Resolution-dependent parameters for ETC warm-core check |
| 297 | +if [ ${res} -eq 120 ]; then |
| 298 | + echo " Using ne120 parameters..." |
| 299 | + DetectNodes \ |
| 300 | + --in_data_list "${result_dir}inputfile_${file_name}.txt" \ |
| 301 | + --out "${result_dir}etc_out.dat" \ |
| 302 | + --timefilter "6hr" \ |
| 303 | + --in_connect "${result_dir}connect_CSne${res}_v2.dat" \ |
| 304 | + --closedcontourcmd "PSL,200.0,6.0,0" \ |
| 305 | + --noclosedcontourcmd "_AVG(T200,T500),-0.6,4,0.30" \ |
| 306 | + --mergedist 6.0 \ |
| 307 | + --searchbymin PSL \ |
| 308 | + --outputcmd "PSL,min,0" |
| 309 | +elif [ ${res} -eq 30 ]; then |
| 310 | + echo " Using ne30 parameters..." |
| 311 | + DetectNodes \ |
| 312 | + --in_data_list "${result_dir}inputfile_${file_name}.txt" \ |
| 313 | + --out "${result_dir}etc_out.dat" \ |
| 314 | + --timefilter "6hr" \ |
| 315 | + --in_connect "${result_dir}connect_CSne${res}_v2.dat" \ |
| 316 | + --closedcontourcmd "PSL,200.0,6.0,0" \ |
| 317 | + --noclosedcontourcmd "_AVG(T200,T500),-0.6,4,1.0" \ |
| 318 | + --mergedist 6.0 \ |
| 319 | + --searchbymin PSL \ |
| 320 | + --outputcmd "PSL,min,0" |
| 321 | +else |
| 322 | + echo " ERROR: Grid resolution ${res} not supported for ETC detection!" |
| 323 | + echo " Supported resolutions: 30 (ne30), 120 (ne120)" |
| 324 | + exit 1 |
| 325 | +fi |
| 326 | + |
| 327 | +# Concatenate ETC detection results |
| 328 | +echo " Concatenating ETC detection files..." |
| 329 | +cat "${result_dir}"etc_out.dat0*.dat > "${result_dir}etc_candidates_${file_name}.txt" |
| 330 | + |
| 331 | +# Create ETC tracks |
| 332 | +echo " Creating ETC tracks..." |
| 333 | +echo " Duration: >= 60 hours, Max gap: 18 hours" |
| 334 | +echo " Min trajectory distance: 12°" |
| 335 | +echo " Range: 6°" |
| 336 | + |
| 337 | +StitchNodes \ |
| 338 | + --in_connect "${result_dir}connect_CSne${res}_v2.dat" \ |
| 339 | + --in_fmt "lon,lat,slp" \ |
| 340 | + --range 6.0 \ |
| 341 | + --mintime "60h" \ |
| 342 | + --maxgap 18 \ |
| 343 | + --in "${result_dir}etc_candidates_${file_name}.txt" \ |
| 344 | + --out "${result_dir}etc_tracks_${file_name}.dat" \ |
| 345 | + --min_endpoint_dist 12.0 |
| 346 | + |
| 347 | +echo " ETC tracking completed" |
| 348 | + |
| 349 | +# Create ETC mask files |
| 350 | +echo " Creating ETC mask files..." |
| 351 | +echo " Binary mask: 1 within 6° of ETC center, 0 elsewhere" |
| 352 | + |
| 353 | +# Create output directory for ETC masks |
| 354 | +mkdir -p "${result_dir}ETC_masks" |
| 355 | + |
| 356 | +# Generate ETC mask file list |
| 357 | +rm -f "${result_dir}etc_mask_files_out.txt" |
| 358 | +for f in $(eval echo "${drc_in}/${caseid}.${atm_name}.h2.*{${start}..${end}}*.nc"); do |
| 359 | + if [ -f "$f" ]; then |
| 360 | + g=$(basename "$f") |
| 361 | + date_part="${g#${caseid}.${atm_name}.h2.}" |
| 362 | + date_part="${date_part%.nc}" |
| 363 | + etc_mask_file="${result_dir}ETC_masks/${caseid}.${atm_name}.h2.${date_part}.ETC_mask.nc" |
| 364 | + echo "${etc_mask_file}" >> "${result_dir}etc_mask_files_out.txt" |
| 365 | + fi |
| 366 | +done |
| 367 | + |
| 368 | +NodeFileFilter \ |
| 369 | + --in_connect "${result_dir}connect_CSne${res}_v2.dat" \ |
| 370 | + --in_nodefile "${result_dir}etc_tracks_${file_name}.dat" \ |
| 371 | + --in_fmt "lon,lat,slp" \ |
| 372 | + --in_data_list "${result_dir}inputfile_${file_name}.txt" \ |
| 373 | + --out_data_list "${result_dir}etc_mask_files_out.txt" \ |
| 374 | + --bydist 6.0 \ |
| 375 | + --maskvar "stormmask" |
| 376 | + |
| 377 | +echo " ETC mask creation completed" |
| 378 | +echo " ETC detection, tracking, and masking completed" |
234 | 379 |
|
235 | 380 | #=============================================================================== |
236 | 381 | # STEP 3: FILTER ARs TO REMOVE TC INFLUENCE |
@@ -280,6 +425,10 @@ echo " Unfiltered ARs: ${result_dir}ARtag_nofilt/" |
280 | 425 | echo " TC-filtered ARs: ${result_dir}ARtag_filt/" |
281 | 426 | echo " AR-tagged TVQ/PRECT: ${result_dir}TVQ_PRECT_ARtag/" |
282 | 427 | echo " TC tracks: ${result_dir}cyclones_stitch_${file_name}.dat" |
| 428 | +echo " TC radial profiles: ${result_dir}cyclones_radprof_${file_name}.dat" |
| 429 | +echo " TC masks: ${result_dir}TC_masks/" |
| 430 | +echo " ETC tracks: ${result_dir}etc_tracks_${file_name}.dat" |
| 431 | +echo " ETC masks: ${result_dir}ETC_masks/" |
283 | 432 | echo "==============================================================================" |
284 | 433 |
|
285 | 434 | # Optional cleanup (uncomment if needed) |
|
0 commit comments