Skip to content

Commit

Permalink
-- Fix coastal lakes with revised code
Browse files Browse the repository at this point in the history
-- Link orog to /scratch1/NCEPDEV/global/glopara/fix/raw/orog/ to read MODISP lake fraction and GLDBV3 lake depth for now
-- Add options to choose different lake datasets

Fixes #854
  • Loading branch information
ShanSunNOAA committed Sep 29, 2023
1 parent 2ed2c79 commit 402849a
Show file tree
Hide file tree
Showing 4 changed files with 388 additions and 194 deletions.
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'
export lake_data_srce=MODISP_GLDBV3 # 'GLDBV3', 'MODIS_GLOBATHY', 'MODISP_GLDBV3', and 'VIIRS_GLDBV3'

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
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
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

0 comments on commit 402849a

Please sign in to comment.