Skip to content
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

-- Fix coastal lakes with revised code #856

Merged
merged 16 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ export soil_type_src="bnu.v3.30s" # Soil type data.
# For Beijing Norm. Univ. data
# 1) "bnu.v3.30s" for global 30s data.

export reg_domain=na3km # '3km', 'na3km', '13km', and 'na13km'
GeorgeGayno-NOAA marked this conversation as resolved.
Show resolved Hide resolved
export lake_data_srce=MODISP_GLDBV3 # 'GLDBV3', 'MODIS_GLOBATHY', 'MODISP_GLDBV3', and 'VIIRS_GLDBV3'
This conversation was marked as resolved.
Show resolved Hide resolved

if [ $gtype = uniform ]; then
export res=96
export add_lake=false # Add lake frac and depth to orography data.
export lake_cutoff=0.20 # lake frac < lake_cutoff ignored when add_lake=T
export add_lake=true # Add lake frac and depth to orography data.
export lake_cutoff=0.50 # lake frac < lake_cutoff ignored when add_lake=T
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add line after this:
export gridcell_lake = 1 # 1:only consider grid cell lakes; 0: consider fractional lakes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Is "gridcell_lake" same as "binary_lake"?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, maybe binary_lake is a better name.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the comment should say "# 1:only consider full grid cell lakes; 0: consider fractional lakes"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or "# 1:only output full grid cell lakes; 0: output fractional lakes"

elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down
38 changes: 34 additions & 4 deletions sorc/orog_mask_tools.fd/inland.fd/inland.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ PROGRAM inland_mask

REAL, ALLOCATABLE :: inland(:,:,:)
REAL, ALLOCATABLE :: land_frac(:,:,:)
INTEGER :: i_ctr, j_ctr, tile_beg, tile_end
INTEGER :: tile_beg, tile_end
INTEGER :: cs_res, x_res, y_res
CHARACTER(len=32) :: arg
INTEGER :: stat
INTEGER :: max_rd
REAL :: cutoff
CHARACTER(len=1) :: reg

LOGICAL, ALLOCATABLE :: done(:,:,:)
LOGICAL, ALLOCATABLE :: done(:,:,:)

CALL getarg(0, arg) ! get the program name
IF (iargc() /= 3 .AND. iargc() /= 4) THEN
Expand Down Expand Up @@ -78,14 +78,19 @@ PROGRAM inland_mask
!! @author Ning Wang
SUBROUTINE mark_global_inland(cs_res)
INTEGER, INTENT(IN) :: cs_res
INTEGER :: i_seed, j_seed

ALLOCATE(done(cs_res,cs_res,6))
ALLOCATE(inland(cs_res,cs_res,6))
done = .false.
inland = 1.0
i_ctr = cs_res/2; j_ctr = cs_res/2

CALL mark_global_inland_rec_d(i_ctr, j_ctr, 2, 0)
i_seed = cs_res/2; j_seed = cs_res/2
CALL mark_global_inland_rec_d(i_seed, j_seed, 2, 0)

! to make sure black sea is excluded
GeorgeGayno-NOAA marked this conversation as resolved.
Show resolved Hide resolved
i_seed = REAL(cs_res)/32.0*3; j_seed = i_seed
CALL mark_global_inland_rec_d(i_seed, j_seed, 3, 0)

DEALLOCATE(done)

Expand All @@ -99,6 +104,7 @@ END SUBROUTINE mark_global_inland
SUBROUTINE mark_inland_reg(cs_res)
INTEGER, INTENT(IN) :: cs_res
INTEGER :: i_seed, j_seed
INTEGER :: i

ALLOCATE(done(x_res,y_res,1))
ALLOCATE(inland(x_res,y_res,1))
Expand All @@ -116,6 +122,30 @@ SUBROUTINE mark_inland_reg(cs_res)
i_seed = x_res/3; j_seed = 1
CALL mark_regional_inland_rec_d(i_seed, j_seed, 1, 0)

j_seed = 1
DO i = 1, x_res
CALL mark_regional_inland_rec_d(i, j_seed, 1, 0)
ENDDO

j_seed = y_res
DO i = x_res/2, x_res
CALL mark_regional_inland_rec_d(i, j_seed, 1, 0)
ENDDO

! set up additional 3 seeds for ESG CONUS grid
! i_seed = 1600; j_seed = 1040
! i_seed = x_res - 10; j_seed = y_res
! CALL mark_regional_inland_rec_d(i_seed, j_seed, 1, 0)

! i_seed = x_res - 60; j_seed = y_res
! CALL mark_regional_inland_rec_d(i_seed, j_seed, 1, 0)

! i_seed = x_res - 275; j_seed = y_res
! CALL mark_regional_inland_rec_d(i_seed, j_seed, 1, 0)

! i_seed = 500; j_seed = 1
! CALL mark_regional_inland_rec_d(i_seed, j_seed, 1, 0)

DEALLOCATE(done)

END SUBROUTINE mark_inland_reg
Expand Down
Loading
Loading