-
Notifications
You must be signed in to change notification settings - Fork 700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New module firebrand_spotting for WRF-Fire #1540
New module firebrand_spotting for WRF-Fire #1540
Conversation
…ands for WRF-Fire)
@pedro-jm can you give your opinion on this PR too? |
The code releases and moves the firebrands with the atmospheric dynamics simulating their combustion too. If the firebrands end up in the ground the code tracks where do they land. So the user can identify locations that could be affected by fire spotting. In the future this could be extended to ignite fires at certain locations. But that is not currently done so that is why there is not feedback to the fire code. The code is well organized in modules and the bulk of the development is in 2 new modules which is desirable for maintenance. |
Thanks for the clarification, Pedro.
…On Wed, Nov 17, 2021 at 10:58 AM pedro-jm ***@***.***> wrote:
@dudhia <https://github.com/dudhia>
The code releases and moves the firebrands with the atmospheric dynamics
simulating their combustion too. If the firebrands end up in the ground the
code tracks where do they land. So the user can identify locations that
could be affected by fire spotting. In the future this could be extended to
ignite fires at certain locations. But that is not currently done so that
is why there is not feedback to the fire code.
The code is well organized in modules and the bulk of the development is
in 2 new modules which is desirable for maintenance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1540 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77G2LQUKDZFCHTWXPFTUMPUKTANCNFSM5BUXUTUA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@mefrediani @twjuliano @pedro @dudhia
To see if your modified code is working, try to build the code serially (for example, with GNU it would be option 32). |
Hi Dave, |
Keep us in the loop as this is a bit of an infrastructure issue, we do not want you to fix this in the wrong way. Let me know if a google meet would help out (gill@ucar.edu), and we can set something up. |
Hi Dave, I enclosed the following statements within ifdef blocks:
|
@mefrediani Would you do a SHORT test to verify that you are getting the same answers with the serial build and with MPI.
|
@mefrediani @weiwangncar
|
@mefrediani It may also be helpful to add some information about how the capability is activated in the model in the release note section. Thanks. |
@weiwangncar I have a draft (attached) with a detailed description of the module, namelist parameters, and output variables. I will check with my colleagues if they have any reviewing to suggest and follow up with a final version in the coming days. In the meantime, it would be helpful if you could send me instructions on how to prepare this document for you, for example, specific section names, tables, etc. Thank you! |
@mefrediani There are several levels of documentation you can provide. For this PR, you can simply add something like 'this option is activated by namelist X'. If this option can be used with other fire options (or not), it may be useful to state. As for the full documentation, we have a WRF Fire chapter in our User's Guide: https://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.3/users_guide_chap-fire.html, and you can see if your new option can fit somewhere in that chapter. We also have a link to WRF Wildland Fire page: https://www2.mmm.ucar.edu/wrf/users/fire/wrf-fire.html, and at the bottom of the page, there is a link to RAL's Fire page: https://ral.ucar.edu/solutions/products/wrf-fire-wildland-fire-modeling. If your work is in someway related to the work with the RAL projects, feel free to add your document there. Let us know where you think the document fits the best. |
@weiwangncar @dudhia @mefrediani
|
@davegill Do you mean this code breaks bit-for-bit and restart checks even when the option is not used? |
No. This code works fine with the existing regression tests. When using firebrands, THAT code does not give the same MPI values with different core counts, and it does not give the same restart values. |
@davegill, @weiwangncar, @dudhia
I've been investigating the issue with the restart and it looks like the
release-v4.3 commit 2adcfda, i.e., without the firebrand module, doesn't
run when compiled with -d.
I set 12 cpus for this test case, with the namelist set to run with ifire =
0, 2 (i.e. fire model is on in the inner nest), and writing a restart file.
A gnu-openmpi build on casper crashed with the following error:
d02 2020-10-20_21:00:00 module_io.F: in wrf_open_for_write_begin, FileName
= wrfout_d02_2020-10-20_21:00:00
d02 2020-10-20_21:00:00 calling outsub in open_w_dataset
[crhtc38:118794:0:118794] Caught signal 11 (Segmentation fault: Sent by the kernel at address (nil))
/glade/scratch/frediani/WRF-Fire/bittest/builds/casper-WRF-release-gnuopenmpi-d/share/output_wrf.f90:
[ output_wrf_() ]
...
1036 newswitch = switch
1037 p => grid%head_statevars%next
1038 DO WHILE ( ASSOCIATED( p ) )
==> 1039 IF ( p%ProcOrient .NE. 'X' .AND. p%ProcOrient .NE. 'Y' )
THEN
1040 IF ( p%Ndim .EQ. 0 ) THEN
1041 IF
((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch))
THEN
1042 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) )
THEN
Then, after turning Fire off on the namelist (but with some Fire related
fields still in the wrfinput files) it crashes about 400 lines later:
d02 2020-10-20_21:00:00 module_io.F: in wrf_open_for_write_begin, FileName
= wrfout_d02_2020-10-20_21:00:00
d02 2020-10-20_21:00:00 calling outsub in open_w_dataset
[crhtc62:271846:0:271846] Caught signal 11 (Segmentation fault: Sent by the kernel at address (nil))
/glade/scratch/frediani/WRF-Fire/bittest/builds/casper-WRF-release-gnuopenmpi-d/share/output_wrf.f90:
[ output_wrf_() ]
...
1454
1455
1456
==> 1457 DO itrace = PARAM_FIRST_SCALAR , p%num_table(grid%id)
1458 IF
((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams_table(grid%id,itrace)%stream,newswitch))
THEN
1459 dname = p%dname_table( grid%id, itrace )
1460 IF
(p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
I'm not sure how to debug these possible issues in the firebrand module
given that an mpi run with n>1 configured with -d doesn't run in the
unmodified code.
I wonder if this is an issue with this specific case, with WRF-Fire, or
with the Fire-related fields in the wrfinput files which are on the refined
fire grid.
Please let me know how to proceed.
The executables were built here:
/glade/scratch/frediani/WRF-Fire/bittest/builds/casper-WRF-release-gnuopenmpi-d/
The test case is
here: /glade/scratch/frediani/WRF-Fire/bittest/runs/casper-test-release-gnuopenmpi12-d
The various test cases are on the same path, in these folders:
casper-test2-release-gnuopenmpi12-d-namelistNoFire
casper-test3-release-gnuopenmpi12-d-namelistNoRestart
casper-test4-release-gnuopenmpi12-d-namelistNoRestartNoFire
|
@mefrediani @weiwangncar |
@weiwangncar Here's the updated documentation for the PR, user's guide, and web pages. I can also share a google doc with you, if that's easier. Just let me know. WRF documentation - Firebrand Spotting Parameterization - Google Docs.pdf
|
@mefrediani Thanks for sharing the pdf file. We will add the content to the appropriate places on our end. It may be convenient to add some of this documentation to the RAL Wildfire page, so that you can maintain and update easily. I've added your PR description to your PR message (last section). Please check and see if it is ok with you. Remember this will be a permanent record in git-cloned code for everyone to see. |
@weiwangncar @mefrediani |
@davegill @weiwangncar It seems that the bug fix to this issue (#1596) is not on the develop branch yet. I was able to test it out by adding this line to Registry.EM_COMMON: I'll try to wrap up firebrand spotting tests using a different PBL scheme. I see that YSU (pbl=1) has no package variables, so it may work without the nopblscheme work around. I'll let you know how it goes. |
@davegill @weiwangncar @dudhia All tests have passed (latest commit: afc9142, after switching pbl from MYNN to YSU). There were no differences among the serial and MPI builds with 1 and 12 processors. The tests were all done from a restart file. The timestep for these runs was 5s and the outputs were compared after 20s, 40s, and 1 min. I hope you and your families are well. Stay safe. |
@mefrediani @weiwangncar @dudhia
|
@weiwangncar @dudhia |
TYPE: bug fix KEYWORDS: netcdfpar, Error SOURCE: internal DESCRIPTION OF CHANGES: IMPORTANT: Without these mods, every commit since the parallel netcdf4 IO mods will fail the DA build test in the regression test. For example, at least these commits: ``` fed10f4 Adding the WRF-Solar EPS model (#1547) 0bda5e0 Fix 4dvar build failure after commit 8b5bfe5 (#1652) 8b5bfe5 Thompson AA enhancements: BC aerosol, biomass burning emissions, and … (#1616) 9dc68ca After testing with UFS/GFS/FV-3, some tuning knob changes to Thompson-MP and icloud3 (cloud fraction) scheme (#1626) 96fd889 Update HONO, TERP, and CO2 emissions (#1644) 64fb190 SFCLAY=1, add shallow water roughness calculation (#1543) 609c2fc New module firebrand_spotting for WRF-Fire (#1540) 75bfe6d MYNN PBL clouds in photolysis option 4 (TUV) (#1622) f8c4b13 Fix runtime error when using sf_surface_mosaic = 1 with use_wudapt_lcz = 0 (#1638) b511c70 Run-time option for climate GHG for radiation (#1625) 8194c66 Bug fix for configuration option INTEL:HSW/BDW (#1645) 16c9287 bug fixes for radar_rf_opt=2 (#1642) a82ce24 Sync with NoahMP Github version with all NoahMP updates since v4.3 (#1641) 7b642cc Bug fix for TAMDAR T VarBC (#1632) 92fd706 fix WRFDA build for Parallel netcdf-4 IO (#1634) ``` Problem: With PR #1552 "Parallel netcdf-4 IO option" (SHA1 3cd4713), when then code was built without the new parallel NetCDF4 compression, the build log had an `Error`. ``` > grep Error compile.log Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory make[2]: [diffwrf] Error 1 (ignored) make[2]: [diffwrf] Error 1 (ignored) wrf_io.f:117: Error: Can't open included file 'mpif.h' make[2]: [wrf_io.o] Error 1 (ignored) Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory make[2]: [field_routines.o] Error 1 (ignored) make[2]: [libwrfio_nfpar.a] Error 127 (ignored) make[2]: [libwrfio_nfpar.a] Error 1 (ignored) ``` The problem was related to constructing the object files in the io_netcdfpar directory. When the option is not selected at compile time, then we do not care about errors in the directory that will never be used. Solution: If the NETCDFPAR option is not selected at compile time, then SKIP going into the io_netcdfpar directory all together. LIST OF MODIFIED FILES: m Makefile m arch/Config.pl m arch/configure.defaults m configure TESTS CONDUCTED: 1. Without the NETCDFPAR parameter set, the build for the io_netcdfpar directory is bypassed: ``` cd ../io_netcdfpar ; \ echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \ cd ../io_netcdfpar ; \ echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \ ``` 2. When the NETCDFPAR env variable is set, the build includes the io_netcdfpar directory: cd ../io_netcdfpar ; \ make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \ cd ../io_netcdfpar ; \ make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \ ``` 3. Jenkins tests are all PASS.
TYPE: new feature KEYWORDS: fire firebrand spotting Lagrangian transport passive advection burnout SOURCE: Maria Frediani, Tim W. Juliano (NCAR-RAL) DESCRIPTION OF CHANGES: The new module firebrand_spotting for WRF-Fire is a passive Lagrangian transport parameterization to advect firebrands. The Firebrand Spotting parameterization was developed for the WRF-Fire component of the WRF model versions starting at 4.0.1. The parameterization couples to WRF-Fire and uses a Lagrangian particle transport framework to advect firebrands in the innermost nest of the domain. The parameterization runs in the atmospheric model inner domain and does not modify model variables (no feedback to WRF or WRF-Fire). The code comprises two independent modules, one with the physical processes and another with the necessary MPI wrapping routines that were not yet part of the WRF source code. The motivation to separate the MPI routines in an independent module was to enable them to be used in other model parameterizations through a USE statement without importing the firebrand spotting component. The Firebrand Spotting variables are part of Registry.fire and the subroutine is called from start_em.F and solve_em.F, after all the physics parameterizations and relevant halos are completed. When fires are active, the parameterization identifies areas at risk of fire spotting by modeling transport and physical processes of individual firebrands. Firebrands are released at multiple heights from grid points along the fire front with high fire rate-of-spread and denser fuel loads. Particles are transported with the atmospheric flow and consumed by combustion. Firebrands may burnout entirely or land, once they descend below a given height threshold. Particles that land before complete burnout are accumulated in a 2-D field during regular intervals. The likelihood of new fire ignitions due to spotting is computed using the ratio of landed firebrands per grid point to the total number of landed particles within the corresponding time interval between model outputs. The ratios are then scaled by a function of fuel load and moisture content at the corresponding grid points. LIST OF MODIFIED FILES: M Registry/Registry.EM_COMMON M Registry/registry.fire M dyn_em/depend.dyn_em M dyn_em/solve_em.F M dyn_em/start_em.F M main/depend.common M phys/Makefile A phys/module_firebrand_spotting.F A phys/module_firebrand_spotting_mpi.F TESTS CONDUCTED: 1. The module was designed for high-resolution simulations and tested using large-eddy simulation (LES) in the inner nest. Simulations for various case studies in Colorado have been done. 2. All tests have passed (latest commit: afc9142, after switching pbl from MYNN to YSU). There were no differences among the serial and MPI builds with 1 and 12 processors. The tests were all done from a restart file. The time step for these runs was 5s and the outputs were compared after 20s, 40s, and 1 min. 3. Jenkins tests are all passing. RELEASE NOTE: A new module to parameterize firebrand spotting for WRF-Fire is added. This is a passive Lagrangian transport scheme to transport and burnout firebrands generated at the fire front. The scheme is activated when ifire == 2 by setting the namelist option fs_firebrand_gen_lim to an integer greater than zero (default is 0, i.e. scheme is off). It runs with dmpar and serially compiled code and in the inner nest (grid_id == max_dom). It was designed and tested using a mesoscale to LES domain configuration.
TYPE: bug fix KEYWORDS: netcdfpar, Error SOURCE: internal DESCRIPTION OF CHANGES: IMPORTANT: Without these mods, every commit since the parallel netcdf4 IO mods will fail the DA build test in the regression test. For example, at least these commits: ``` fed10f4 Adding the WRF-Solar EPS model (wrf-model#1547) 0bda5e0 Fix 4dvar build failure after commit 8b5bfe5 (wrf-model#1652) 8b5bfe5 Thompson AA enhancements: BC aerosol, biomass burning emissions, and … (wrf-model#1616) 9dc68ca After testing with UFS/GFS/FV-3, some tuning knob changes to Thompson-MP and icloud3 (cloud fraction) scheme (wrf-model#1626) 96fd889 Update HONO, TERP, and CO2 emissions (wrf-model#1644) 64fb190 SFCLAY=1, add shallow water roughness calculation (wrf-model#1543) 609c2fc New module firebrand_spotting for WRF-Fire (wrf-model#1540) 75bfe6d MYNN PBL clouds in photolysis option 4 (TUV) (wrf-model#1622) f8c4b13 Fix runtime error when using sf_surface_mosaic = 1 with use_wudapt_lcz = 0 (wrf-model#1638) b511c70 Run-time option for climate GHG for radiation (wrf-model#1625) 8194c66 Bug fix for configuration option INTEL:HSW/BDW (wrf-model#1645) 16c9287 bug fixes for radar_rf_opt=2 (wrf-model#1642) a82ce24 Sync with NoahMP Github version with all NoahMP updates since v4.3 (wrf-model#1641) 7b642cc Bug fix for TAMDAR T VarBC (wrf-model#1632) 92fd706 fix WRFDA build for Parallel netcdf-4 IO (wrf-model#1634) ``` Problem: With PR wrf-model#1552 "Parallel netcdf-4 IO option" (SHA1 3cd4713), when then code was built without the new parallel NetCDF4 compression, the build log had an `Error`. ``` > grep Error compile.log Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory make[2]: [diffwrf] Error 1 (ignored) make[2]: [diffwrf] Error 1 (ignored) wrf_io.f:117: Error: Can't open included file 'mpif.h' make[2]: [wrf_io.o] Error 1 (ignored) Fatal Error: Cannot open module file ‘wrf_data_ncpar.mod’ for reading at (1): No such file or directory make[2]: [field_routines.o] Error 1 (ignored) make[2]: [libwrfio_nfpar.a] Error 127 (ignored) make[2]: [libwrfio_nfpar.a] Error 1 (ignored) ``` The problem was related to constructing the object files in the io_netcdfpar directory. When the option is not selected at compile time, then we do not care about errors in the directory that will never be used. Solution: If the NETCDFPAR option is not selected at compile time, then SKIP going into the io_netcdfpar directory all together. LIST OF MODIFIED FILES: m Makefile m arch/Config.pl m arch/configure.defaults m configure TESTS CONDUCTED: 1. Without the NETCDFPAR parameter set, the build for the io_netcdfpar directory is bypassed: ``` cd ../io_netcdfpar ; \ echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \ cd ../io_netcdfpar ; \ echo SKIPPING make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.7.3/gnu/9.1.0" \ ``` 2. When the NETCDFPAR env variable is set, the build includes the io_netcdfpar directory: cd ../io_netcdfpar ; \ make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \ cd ../io_netcdfpar ; \ make -i -r NETCDFPARPATH="/glade/u/apps/ch/opt/netcdf/4.8.0/gnu/9.1.0" \ ``` 3. Jenkins tests are all PASS.
TYPE: new feature
KEYWORDS: fire firebrand spotting Lagrangian transport passive advection burnout
SOURCE: Maria Frediani, Tim W. Juliano (NCAR-RAL)
DESCRIPTION OF CHANGES:
The new module firebrand_spotting for WRF-Fire is a passive Lagrangian transport parameterization to
advect firebrands. The Firebrand Spotting parameterization was developed for the WRF-Fire component of the
WRF model versions starting at 4.0.1. The parameterization couples to WRF-Fire and uses a Lagrangian
particle transport framework to advect firebrands in the innermost nest of the domain.
The parameterization runs in the atmospheric model inner domain and does not modify model variables (no
feedback to WRF or WRF-Fire). The code comprises two independent modules, one with the physical
processes and another with the necessary MPI wrapping routines that were not yet part of the WRF source
code. The motivation to separate the MPI routines in an independent module was to enable them to be used in
other model parameterizations through a USE statement without importing the firebrand spotting component.
The Firebrand Spotting variables are part of Registry.fire and the subroutine is called from start_em.F and
solve_em.F, after all the physics parameterizations and relevant halos are completed.
When fires are active, the parameterization identifies areas at risk of fire spotting by modeling transport
and physical processes of individual firebrands. Firebrands are released at multiple heights from grid points
along the fire front with high fire rate-of-spread and denser fuel loads. Particles are transported with the
atmospheric flow and consumed by combustion. Firebrands may burnout entirely or land, once they descend
below a given height threshold. Particles that land before complete burnout are accumulated in a 2-D field
during regular intervals.
The likelihood of new fire ignitions due to spotting is computed using the ratio of landed firebrands per grid
point to the total number of landed particles within the corresponding time interval between model outputs.
The ratios are then scaled by a function of fuel load and moisture content at the corresponding grid points.
LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M Registry/registry.fire
M dyn_em/depend.dyn_em
M dyn_em/solve_em.F
M dyn_em/start_em.F
M main/depend.common
M phys/Makefile
A phys/module_firebrand_spotting.F
A phys/module_firebrand_spotting_mpi.F
TESTS CONDUCTED:
the inner nest. Simulations for various case studies in Colorado have been done.
differences among the serial and MPI builds with 1 and 12 processors. The tests were all done from a restart
file. The time step for these runs was 5s and the outputs were compared after 20s, 40s, and 1 min.
RELEASE NOTE: A new module to parameterize firebrand spotting for WRF-Fire is added. This is a passive Lagrangian transport scheme to transport and burnout firebrands generated at the fire front. The scheme is activated when ifire == 2 by setting the namelist option fs_firebrand_gen_lim to an integer greater than zero (default is 0, i.e. scheme is off). It runs with dmpar and serially compiled code and in the inner nest (grid_id == max_dom). It was designed and tested using a mesoscale to LES domain configuration.