Skip to content

Commit

Permalink
SFCLAY=1, add shallow water roughness calculation (#1543)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
hawbecker authored Jan 19, 2022
1 parent 609c2fc commit 64fb190
Show file tree
Hide file tree
Showing 12 changed files with 255 additions and 19 deletions.
9 changes: 7 additions & 2 deletions Registry/Registry.EM_COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ state real utrop ij dyn_em 1 X i1 "UTROP"
state real vmaxw ij dyn_em 1 Y i1 "VMAXW" "V-component of the max wind speed" "m s-1"
state real vtrop ij dyn_em 1 Y i1 "VTROP" "V-component of the tropopause wind" "m s-1"
state real erod ij. misc 1 - i012rd "EROD" "fraction of erodible surface in each grid cell (0-1)" "none"
state real bathymetry ij dyn_em 1 - i1 "bathymetry" "Bathymetry and topography" "m"
state integer BATHYMETRY_FLAG - misc 1 - i0rh "BATHYMETRY_FLAG" "Flag for bathymetry in the global attributes for metgrid data"

#-----------------------------------------------------------------------------------------------------------------------------------------------------------------
#
Expand Down Expand Up @@ -854,8 +856,9 @@ state integer IFNDICEDEPTH - misc 1 - ir "F
state real XLAIDYN ij misc 1 - - "XLAIDYN" "Noah Dynamic LEAF AREA INDEX" "m-2/m-2"
# SKIN SST
state real SSTSK ij misc 1 - rhd=(interp_mask_field:lu_index,iswater)u=(copy_fcnm) "SSTSK" "SKIN SEA SURFACE TEMPERATURE" "K"
state real lake_depth ij misc 1 - i012rd=(interp_mask_water_field:lu_index,islake) "lake_depth" "lake depth" "m"
state real DTW ij misc 1 - r "DTW" "WARM LAYER TEMP DIFF" "C"
state real lake_depth ij misc 1 - i012rd=(interp_mask_water_field:lu_index,islake) "lake_depth" "lake depth" "m"
state real water_depth ij misc 1 - i0rhd "water_depth" "global water depth" "m"
state real DTW ij misc 1 - r "DTW" "WARM LAYER TEMP DIFF" "C"
# Ocean surface currents
state real UOCE ij misc 1 - i0124rd=(interp_mask_water_field:lu_index,iswater) "UOCE" "SEA SURFACE ZONAL CURRENTS" "m s-1"
state real VOCE ij misc 1 - i0124rd=(interp_mask_water_field:lu_index,iswater) "VOCE" "SEA SURFACE MERIDIONAL CURRENTS" "m s-1"
Expand Down Expand Up @@ -2560,6 +2563,8 @@ rconfig integer sf_ocean_physics namelist,physics 1 0
rconfig integer traj_opt namelist,physics 1 0 h "traj_opt" "activate trajectory calculation 0=no, 1=on" ""
rconfig logical dm_has_traj namelist,physics max_domains .false. rh "has_traj" "activate trajectory calculation per domain" ""
rconfig integer tracercall namelist,physics 1 0 h "tracercall" "activate tracer calculation 0=no, 1=on" ""
rconfig integer shalwater_z0 namelist,physics max_domains 0 rh "shalwater_z0" "shallow water sea surface roughness flag" ""
rconfig real shalwater_depth namelist,physics 1 -1.0 rh "shalwater_depth" "water depth for shallow water scheme" "m"
rconfig real OMDT namelist,physics 1 1 h "OMDT" "Timestep of ocean model" "s"
rconfig real oml_hml0 namelist,physics 1 50 h "oml_hml0" "oml initial mixed layer depth value" "m"
rconfig real oml_gamma namelist,physics 1 0.14 h "oml_gamma" "oml deep water lapse rate" "K m-1"
Expand Down
3 changes: 3 additions & 0 deletions dyn_em/module_first_rk_step_part1.F
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,9 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& ,HUML=grid%huml, HVML=grid%hvml, F=grid%f &
& ,TMOML=grid%TMOML,ISWATER=iswater &
& ,OML_RELAXATION_TIME=grid%OML_RELAXATION_TIME &
& ,shalwater_z0=config_flags%shalwater_z0 &
& ,water_depth=grid%water_depth &
& ,shalwater_depth=config_flags%shalwater_depth &
& ,lakedepth2d=grid%lakedepth2d, savedtke12d=grid%savedtke12d &
& ,snowdp2d=grid%snowdp2d, h2osno2d=grid%h2osno2d & !lake
& ,snl2d=grid%snl2d, t_grnd2d=grid%t_grnd2d &
Expand Down
38 changes: 38 additions & 0 deletions dyn_em/module_initialize_real.F
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,44 @@ SUBROUTINE init_domain_rk ( grid &
END IF
END IF

grid%bathymetry_flag = flag_bathymetry
IF ( flag_bathymetry .EQ. 0 ) THEN
IF ( grid%shalwater_z0 .EQ. 1 ) THEN
CALL wrf_message ( " Warning: No bathymetry data found for shallow water roughness model." )
IF ( grid%shalwater_depth .LE. 0.0 ) THEN
CALL wrf_message ( " Warning: shalwater_depth must be greater than 0.0 for WRF to run." )
END IF
END IF
DO j = jts, MIN(jde-1,jte)
DO i = its, MIN(ide-1,ite)
grid%water_depth(i,j) = -4.0
END DO
END DO
ELSE
CALL wrf_message ( " Bathymetry dataset 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)." )
DO j = jts, MIN(jde-1,jte)
DO i = its, MIN(ide-1,ite)
grid%water_depth(i,j) = grid%bathymetry(i,j)
! Get depth of lake based on height of water surface:
IF ( grid%lu_index(i,j) .EQ. grid%islake ) THEN
grid%water_depth(i,j) = grid%bathymetry(i,j) - grid%ht_gc(i,j)
END IF
! Depth is positive:
grid%water_depth(i,j) = -grid%water_depth(i,j)
! Set land cells to -10
IF ( ( grid%lu_index(i,j) .NE. grid%islake ) .AND. ( grid%lu_index(i,j) .NE. grid%iswater ) ) THEN
grid%water_depth(i,j) = -2.0
ELSE ! Water cells:
! Find any water cells with negative (originally positive) values...
! ... indicative of mis-match of bathymetry and land mask.
IF (grid%water_depth(i,j) .LT. 0.1) THEN
grid%water_depth(i,j) = 0.1
END IF
END IF
END DO
END DO
END IF

! Send out a quick message about the time steps based on the map scale factors.

IF ( ( internal_time_loop .EQ. 1 ) .AND. ( grid%id .EQ. 1 ) .AND. &
Expand Down
1 change: 1 addition & 0 deletions dyn_em/nest_init_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ SUBROUTINE init_domain_constants_em ( parent , nest )
nest%traj_lat = parent%traj_lat
nest%this_is_an_ideal_run = parent%this_is_an_ideal_run
nest%lake_depth_flag = parent%lake_depth_flag
nest%bathymetry_flag = parent%bathymetry_flag

CALL nl_get_mminlu ( 1, char_junk )
CALL nl_get_iswater( 1, iswater )
Expand Down
1 change: 1 addition & 0 deletions dyn_em/start_em.F
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
grid%tkdry3d, grid%tksatu3d, grid%lake2d, & !lake
config_flags%lakedepth_default, config_flags%lake_min_elev, grid%lake_depth, & !lake
grid%lakemask, grid%lakeflag, grid%LAKE_DEPTH_FLAG, grid%use_lakedepth, & !lake
grid%water_depth, grid%BATHYMETRY_FLAG, grid%shalwater_z0,grid%shalwater_depth, & ! bathymetry
config_flags%sf_surface_mosaic, config_flags%mosaic_cat, config_flags%num_land_cat, & ! Noah tiling
config_flags%maxpatch, & ! start of CLM variables
grid%numc,grid%nump,grid%snl,grid%snowdp,& !
Expand Down
24 changes: 21 additions & 3 deletions phys/module_physics_init.F
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, &
lakemask, lakeflag, & !lake
#endif
lake_depth_flag, use_lakedepth, & !lake
water_depth, bathymetry_flag, shalwater_z0, & ! bathymetry
shalwater_depth, & ! bathymetry
sf_surface_mosaic, mosaic_cat, NLCAT, & ! Noah tiling
!CLM variables
maxpatch, &
Expand Down Expand Up @@ -762,14 +764,18 @@ SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, &
real, dimension( ims:ime,-nlevsnow+0:nlevsoil, jms:jme ),INTENT(inout) :: zi3d
LOGICAL, DIMENSION( ims:ime, jms:jme ),intent(out) :: lake2d
! REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: HT
REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: lake_depth
REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: lake_depth
REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: water_depth
real, intent(in) :: lakedepth_default, lake_min_elev
#if ( EM_CORE == 1 )
REAL, dimension(ims:ime,jms:jme ) :: lakemask
INTEGER, INTENT(IN) :: lakeflag
#endif
INTEGER, INTENT(INOUT) :: lake_depth_flag
INTEGER, INTENT(IN) :: use_lakedepth
INTEGER, INTENT(INOUT) :: bathymetry_flag
INTEGER, INTENT(IN) :: shalwater_z0
REAL, INTENT(IN) :: shalwater_depth
!CLM
Expand Down Expand Up @@ -1486,6 +1492,8 @@ SUBROUTINE phy_init ( id, config_flags, DT, restart, zfull, zhalf, &
lakemask, lakeflag, & !lake
#endif
lake_depth_flag, use_lakedepth, & !lake
water_depth, bathymetry_flag, shalwater_z0, &
shalwater_depth, &
te_temf,cf3d_temf,wm_temf, & ! WA
DZR, DZB, DZG, & !Optional urban
TR_URB2D,TB_URB2D,TG_URB2D,TC_URB2D,QC_URB2D, & !Optional urban
Expand Down Expand Up @@ -2521,6 +2529,8 @@ SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, &
lakemask, lakeflag, & !lake
#endif
lake_depth_flag, use_lakedepth, & !lake
water_depth,bathymetry_flag, shalwater_z0, &
shalwater_depth, &
te_temf,cf3d_temf,wm_temf, & ! WA
! num_roof_layers,num_wall_layers,num_road_layers,& !Optional urban
DZR, DZB, DZG, & !Optional urban
Expand Down Expand Up @@ -2991,13 +3001,17 @@ SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, &
real, dimension( ims:ime,-nlevsnow+0:nlevsoil, jms:jme ),INTENT(inout) :: zi3d
logical, dimension(ims:ime,jms:jme ),intent(out) :: lake2d
REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: lake_depth
REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: lake_depth
REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: water_depth
#if ( EM_CORE == 1 )
REAL, dimension(ims:ime,jms:jme ),intent(inout) :: lakemask
INTEGER, INTENT(IN) :: lakeflag
#endif
INTEGER, INTENT(IN) :: use_lakedepth
INTEGER, INTENT(INOUT) :: lake_depth_flag
INTEGER, INTENT(IN) :: shalwater_z0
REAL, INTENT(IN) :: shalwater_depth
INTEGER, INTENT(INOUT) :: bathymetry_flag
! REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN) :: HT
REAL, DIMENSION( ims:ime , jms:jme ) , OPTIONAL, INTENT(INOUT) :: &
Expand Down Expand Up @@ -3141,7 +3155,11 @@ SUBROUTINE bl_init(STEPBL,BLDT,DT,RUBLTEN,RVBLTEN,RTHBLTEN, &
CALL sfclayinit( allowed_to_read )
isfc = 1
CASE (SFCLAYREVSCHEME)
CALL sfclayrevinit
CALL sfclayrevinit(ims,ime,jms,jme, &
its,ite,jts,jte, &
bathymetry_flag, shalwater_z0, &
shalwater_depth, water_depth, &
xland,LakeModel,lake_depth,lakemask )
isfc = 1
CASE (PXSFCSCHEME)
CALL pxsfclayinit( allowed_to_read )
Expand Down
Loading

0 comments on commit 64fb190

Please sign in to comment.