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 5 commits
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
6 changes: 4 additions & 2 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ export soil_type_src="bnu.v3.30s" # Soil type data.
# For Beijing Norm. Univ. data
# 1) "bnu.v3.30s" for global 30s data.

export lake_data_srce=MODISP_GLDBV3 # 'GLDBV3', 'MODISP_GLOBATHY', 'MODISP_GLDBV3', and 'VIIRS_GLDBV3'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This new variable will also need to be defined in the driver scripts for WCOSS, Orion and Jet. I would also define what the four choices are as is done for the soil and vegetation data.

Copy link
Author

Choose a reason for hiding this comment

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

lake_data_srce is now defined in all driver_scripts. It runs well on hera, jet and orion. The lakefrac generated on hera, jet and orion are identical.

Copy link
Author

Choose a reason for hiding this comment

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

Q: The 'readthedocs' must be updated for the new datasets.
A: Could you help with updating 'readthedocs', as I don't have the permisson? Thanks!
Q: None of the regression tests in ./reg_tests/grid_gen excercise the 'lake' option. Do you want to add a test for lakes?
A: Lake option for regional is not ready at the moment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can help with the 'readthedocs'.

One of the regression tests is for a C96 global uniform. That test has the lakes turned off. We can turn on the lakes for that test or add a new global test that uses lakes. We could also test multiple input lake datasets.

In the driver scripts, can you define what the lake source options are? For example, what is 'GLDBV3'? I assume 'VIIRS_GLDBV3' means VIIRS-base GLDBV3. The general user should know what to pick.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In order to get 'readthedocs' to work, please merge the latest updates from 'develop' to your branch.


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