-
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
SFCLAY=1, add shallow water roughness calculation #1543
SFCLAY=1, add shallow water roughness calculation #1543
Conversation
Compiled successfully.
Compiled successfully.
Compiled successfully. Function is within the sfclayrev module, but can be imported into another sfclay scheme easily.
Making this negative helps with error-checking.
An issue was found when shalwater_depth was used to overwrite WATER_DEPTH within real.exe. If shalwater_depth was assigned at this point, then it could be overwritten when running WRF and that may be confusing to follow / give users unexpected results. Thus, making is so WATER_DEPTH = 0.0 if there is no bathymetry data and then assigning the shalwater_depth value in WRF makes it so that it only exists in one part of the code
The initialization of water_depth is moved to the sfclayrev_init subroutine so that it is only called once. If a lake model is selected, then water_depth is overwritten by lake_depth on lake cells. Deleted comments and initials for finding touched files.
Need @davegill to help identify regtest failures - likely NMM compilation. |
@phawbeck If you'd like to try to compile NMM, instructions are available from |
@phawbeck |
Perfect - I will go ahead and try to compile NMM and see what the issues are. Thanks! |
That is correct - setting shalwater_rough = 1 tells WRF you want to run with this parameterization, then shalwater_depth = [some number greater than 0] will define the water depth over all water cells as this value. If you have shalwater_depth set to a value less than or equal to 0.0 and you have bathymetry data, then it will use the bathymetry data. |
@phawbeck |
Hi - I am just checking to see what the status of this is. I noticed that the checks now say they have passed, but I was not able to compile NMM on my initial attempt but I can give it another go if needed. Thanks a lot! |
@phawbeck Not sure why it says the checks have passed. If no change has been made to the code since you submitted it a while back, it shouldn't. But we sometimes the automatic tests go haywire... |
@phawbeck No need to work on making the code to compile NMM. We will drop NMM support in 4.4. |
@weiwangncar great - thanks a lot! So is there anything else I should do about this? Or am I good to just sit and wait :-) |
@phawbeck Basically, yes. But I do have a question: it seems that you have access to a bathymetry dataset. Can that be shared with the community? What is the resolution of the data? |
@phawbeck @weiwangncar @dudhia
|
some of this was addressed as README.namelist is updated even though not
listed in the PR.
…On Tue, Sep 14, 2021 at 12:03 PM Dave Gill ***@***.***> wrote:
@phawbeck <https://github.com/phawbeck> @weiwangncar
<https://github.com/weiwangncar> @dudhia <https://github.com/dudhia>
1. We probably need mods to share/module_check_a_mundo.F so that only
the sfclay=1 tries to use these options. Do we want a stop, or a message
that this is not being used? Opinions Wei and Jimy?
2. Since there are new namelist vars, let's put some descriptions in
test/em_real/examples.namelist and run/README.namelist.
3. How does the namelist option for depth work? Is it an on/off flag,
or do you set a depth?
4. Outside the scope of this PR ... what is the status of getting the
bathymetry into the WPS static data tar files?
5. Would you add the DOI to the publication (I moved the reference to
the RELEASE NOTES section).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1543 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIZ77DBLVN44SJS32ZHVFDUB6E5ZANCNFSM5CM3UNMA>
.
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>.
|
@phawbeck We've got the data. No PR is needed for that. But to use that data, a section in WPS/geogrid/GEOGRID.TBL is needed which tells geogrid program where the data is and how the data is interpolated. That is the section we are interested. |
@weiwangncar ahh got it! See attached! (I had to add ".txt" to the end for GitHub to allow it to upload) |
@phawbeck This is it! Thanks. We will make WPS PR to add this. |
Restarts were unable to run with shallow water roughness due to the bathymetry flag not existing in the restart files. Adding to the output files simply for book keeping.
@davegill I just ran a restart from an old simulation with the shallow water roughness scheme and it failed because the bathymetry_flag is only assigned to the input files. I added it to restarts and outputs, recompiled, and ran the same test and it passed. I will work on the other tests in the coming days. |
@phawbeck |
@davegill I ran the compile tests both with and without the "-d" option for GNU (32, 33, and 34). Comparing those ran with "-d", the return from diffwrf showed only column headers. The same result was shown for compiling without "-d" between each option. The restart tests, however, are showing the files are different. I ran the test again turning off the shallow water roughness scheme and even that is showing that the files are different. Maybe this is something specific to my setup and having some physics options on that shouldn't be. |
@phawbeck @weiwangncar |
@phawbeck @weiwangncar
Then the commands to run are:
The diffwrf command should just give the column headers
|
@davegill - I just finished running the test you asked for (shalwater_rough = 1) here: The output from diffwrf was just the headers, as expected:
|
@weiwangncar @dudhia
This is ready for a review. |
I added '3. The code passed bit-for-bit check and restart test.' in the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code has passed bit-for-bit and restart tests.
@weiwangncar @davegill - I forgot about this comment from a while back. I got the go-ahead to change the name from |
@phawbeck Apparently I forgot about the variable name change too. Since you got an 'OK' from your collaborators, could you make the change, please? Thanks! |
Changing the name of shalwater_rough to shalwater_z0 to be more understandable / easier to find.
I've updated the name to |
@weiwangncar |
@phawbeck |
@phawbeck I've updated the PR message to reflect the name change. Please check though. |
@weiwangncar Thanks a lot! Looks good to me. |
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: shallow water, roughness, bathymetry SOURCE: Patrick Hawbecker, Pedro A. Jiménez, and Jimy Dudhia (NCAR) DESCRIPTION OF CHANGES: This incorporates the shallow water drag module into the revised M-O surface layer scheme for over-water roughness calculation. The new scheme is meant to incorporate the effects of roughness increasing over shallower waters (between 10 and 100 m deep), mostly near coastlines. In order to include the shallow water roughness parameterization from Jiménez and Dudhia (2018) into the revised M-O surface layer scheme, a bathymetry dataset was downloaded and converted to the WPS tiled format, new variables and flags for the bathymetry data and which scheme is to be used over the ocean are added, and the source code is included into a module with module_sf_sfclayrev.F. The bathymetry data is open source from GEBCO Compilation Group (2021) GEBCO 2021 Grid ([doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f](https://www.gebco.net/data_and_products/gridded_bathymetry_data/)). Several checks are included to ensure users without the bathymetry data can still run with this new scheme using a namelist-defined variable (shalwater_depth) to designate the bathymetry over all water cells. If users have bathymetry data, they can run with this scheme (shalwater_z0 = 1; shalwater_depth <=0) or overwrite the bathymetry data with a user-defined value (shalwater_depth > 0). LIST OF MODIFIED FILES: M Registry/Registry.EM_COMMON M dyn_em/module_first_rk_step_part1.F M dyn_em/module_initialize_real.F M dyn_em/nest_init_utils.F M dyn_em/start_em.F M phys/module_physics_init.F M phys/module_sf_sfclayrev.F M phys/module_surface_driver.F M run/README.namelist M share/module_check_a_mundo.F M share/module_optional_input.F M test/em_real/namelist.examples TESTS CONDUCTED: Tests were conducted in 2 phases: within (1) real.exe and (2) wrf.exe. 1. Real.exe tests conducted: ![image](https://user-images.githubusercontent.com/39134281/129966384-83301f5d-49b4-470b-82f8-e44ee1538a9c.png) For the case producing a warning (no bathymetry, shalwater_z0 = 1.0, shalwater_depth <= 0.0), the following warning is presented in rsl.error.* files: ``` Warning: No bathymetry data found for shallow water roughness model. Warning: shalwater_depth must be greater than 0.0 for WRF to run. ``` The tests all performed as expected producing the following results for the WATER_DEPTH variable: ![image](https://user-images.githubusercontent.com/39134281/129966726-d81f993a-5485-423d-a490-00709526a289.png) With incorrect namelist settings (use shallow water roughness drag, sfclay scheme other than revised MO): ``` --- ERROR: The shallow water roughness drag only works with sfclay_physics = 1 Turn off the shallow water option, or change the surface layer scheme -------------- FATAL CALLED --------------- FATAL CALLED FROM FILE: <stdin> LINE: 2513 NOTE: 1 namelist settings are wrong. Please check and reset these options ``` 2. The tests performed for wrf.exe are as follows: ![image](https://user-images.githubusercontent.com/39134281/129966669-ac2450a7-e5c1-4d2b-a21f-e9608340f9ae.png) The depth = 0.0 case produces the following error message: ``` No bathymetry data detected and shalwater_depth not greater than 0.0. Re-run WPS to get bathymetry data or set shalwater_depth > 0.0 ``` The remaining cases produce WATER_DEPTH fields as follows: ![image](https://user-images.githubusercontent.com/39134281/129966955-0e94e669-c1dc-4a37-b5ee-47e822dbbdf5.png) After running these cases for 36 hours and discarding the first 12 hours as model-spinup. The averaged field (output every 2 hours) for ZNT and wind speed can be seen to show the expected impacts from the new scheme. When the true bathymetry is used, ZNT is higher for depths between 10 and 100 m (green lines). However, when a constant shalwater_depth is used, the value is set over the whole domain and ZNT is increased (in this case) over all water cells. Additionally, when shalwater_depth is set to a valid number, it will overwrite the bathymetry data within wrf.exe and produce the same result as if you did not have bathymetry data. ![image](https://user-images.githubusercontent.com/39134281/129967047-69d08ca6-75f0-44bd-a0ff-cf32f5f0bbeb.png) ![image](https://user-images.githubusercontent.com/39134281/129967070-67a8a058-a797-4f9d-b281-b12e3d4b6b1d.png) Additionally, in order to remain consistent with the lake model (sf_lake_physics > 0) we allow water_depth to be overwritten by lake_depth if sf_lake_physics > 0: ![image](https://user-images.githubusercontent.com/39134281/129967310-e847078f-51f2-4047-944d-bdcabca92e00.png) 3. The code passed bit-for-bit check and restart test. RELEASE NOTE: The shallow-water roughness scheme from Jiménez and Dudhia (2018) is included for offshore roughness adjustment in water depths between 10 and 100 m. The bathymetry data is open source from GEBCO Compilation Group. Please acknowledge the following in presentations and publications: GEBCO Compilation Group (2021) GEBCO 2021 Grid (doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f). Jiménez, P. A., & Dudhia, J. (2018). On the need to modify the sea surface roughness formulation over shallow waters. Journal of Applied Meteorology and Climatology, 57(5), 1101-1110, DOI: [10.1175/JAMC-D-17-0137.1 ](https://doi.org/10.1175/JAMC-D-17-0137.1)
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: shallow water, roughness, bathymetry
SOURCE: Patrick Hawbecker, Pedro A. Jiménez, and Jimy Dudhia (NCAR)
DESCRIPTION OF CHANGES:
This incorporates the shallow water drag module into the revised M-O surface layer scheme for over-water roughness calculation.
The new scheme is meant to incorporate the effects of roughness increasing over shallower waters (less than 100 m deep), mostly near coastlines. In order to include the shallow water roughness parameterization from Jiménez and Dudhia (2018) into the revised M-O surface layer scheme, a bathymetry dataset was downloaded and converted to the WPS tiled format, new variables and flags for the bathymetry data and which scheme is to be used over the ocean are added, and the source code is included into a module with module_sf_sfclayrev.F.
The bathymetry data is open source from GEBCO Compilation Group (2021) GEBCO 2021 Grid (doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f). Several checks are included to ensure users without the bathymetry data can still run with this new scheme using a namelist-defined variable (shalwater_depth) to designate the bathymetry over all water cells. If users have bathymetry data, they can run with this scheme (shalwater_z0 = 1; shalwater_depth <=0) or overwrite the bathymetry data with a user-defined value (shalwater_depth > 0).
LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M dyn_em/module_first_rk_step_part1.F
M dyn_em/module_initialize_real.F
M dyn_em/nest_init_utils.F
M dyn_em/start_em.F
M phys/module_physics_init.F
M phys/module_sf_sfclayrev.F
M phys/module_surface_driver.F
M run/README.namelist
M share/module_check_a_mundo.F
M share/module_optional_input.F
M test/em_real/namelist.examples
TESTS CONDUCTED:
Tests were conducted in 2 phases: within (1) real.exe and (2) wrf.exe.
For the case producing a warning (no bathymetry, shalwater_z0 = 1.0, shalwater_depth <= 0.0), the following
warning is presented in rsl.error.* files:
The tests all performed as expected producing the following results for the WATER_DEPTH variable:
With incorrect namelist settings (use shallow water roughness drag, sfclay scheme other than revised MO):
The depth = 0.0 case produces the following error message:
The remaining cases produce WATER_DEPTH fields as follows:
After running these cases for 36 hours and discarding the first 12 hours as model-spinup. The averaged field
(output every 2 hours) for ZNT and wind speed can be seen to show the expected impacts from the new
scheme. When the true bathymetry is used, ZNT is higher for depths between 10 and 100 m (green lines).
However, when a constant shalwater_depth is used, the value is set over the whole domain and ZNT is
increased (in this case) over all water cells. Additionally, when shalwater_depth is set to a valid number, it will
overwrite the bathymetry data within wrf.exe and produce the same result as if you did not have bathymetry
data.
Additionally, in order to remain consistent with the lake model (sf_lake_physics > 0) we allow water_depth to
be overwritten by lake_depth if sf_lake_physics > 0:
RELEASE NOTE: The shallow-water roughness scheme from Jiménez and Dudhia (2018) is included for offshore roughness adjustment in water depths between 10 and 100 m. The bathymetry data is open source from GEBCO Compilation Group. Please acknowledge the following in presentations and publications: GEBCO Compilation Group (2021) GEBCO 2021 Grid (doi:10.5285/c6612cbe-50b3-0cff-e053-6c86abc09f8f).
Jiménez, P. A., & Dudhia, J. (2018). On the need to modify the sea surface roughness formulation over shallow waters. Journal of Applied Meteorology and Climatology, 57(5), 1101-1110, DOI: 10.1175/JAMC-D-17-0137.1