Skip to content

Lake information into the GEOS BCS workflow#1214

Draft
biljanaorescanin wants to merge 14 commits intodevelopfrom
feature/borescan_lake_to_til_file
Draft

Lake information into the GEOS BCS workflow#1214
biljanaorescanin wants to merge 14 commits intodevelopfrom
feature/borescan_lake_to_til_file

Conversation

@biljanaorescanin
Copy link
Copy Markdown
Contributor

@biljanaorescanin biljanaorescanin commented Feb 24, 2026

This PR introduces HydroLAKES-TopoCat v1.1 (2023) lake information into the GEOS BCS workflow.
This update does not alter tile geometry or Pfafstetter indexing. It augments tile metadata with physically consistent lake fraction information.

It implements:

  1. Lake preprocessing pipeline ( 2 python codes and readme) added under preproc
  2. Tile-level lake metrics appended to tile .nc4 files ( we add two subroutines to rmTinyCatchParaMod + calls)

Branch was tested in BCs package for EASE grid (M36 and M09) and for Cube (c180 and c90)

Example of one tile info : CF0180x6C_DE1440xPE0720-Pfafstetter.nc4
19 : 0000-00-00 00:00:00 0 2252578 0 : 0.0000 0.0099671 1.0000 : tile_lake_frac
20 : 0000-00-00 00:00:00 0 2252578 0 : 0.0000 0.0090341 1.0000 : tile_is_lake_50pct

and:
double tile_lake_frac(tile) ;
tile_lake_frac:long_name = "Lake fraction in tile" ;
tile_lake_frac:units = "1" ;
int tile_is_lake_50pct(tile) ;
tile_is_lake_50pct:long_name = "Flag: tile_lake_frac >= 0.5" ;
tile_is_lake_50pct:units = "1" ;

@gmao-rreichle

@biljanaorescanin biljanaorescanin added enhancement New feature or request 0 diff The changes in this pull request have verified to be zero-diff with the target branch. 0-diff AMIP 0-diff for uncoupled AMIP runs labels Feb 24, 2026
Copy link
Copy Markdown
Contributor

@gmao-rreichle gmao-rreichle left a comment

Choose a reason for hiding this comment

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

@biljanaorescanin : I tried to clean up a bit. See also comments/questions below.

integer, intent(in) :: nc_rst, nr_rst
integer, intent(in) :: tile_id(1:nc_rst, 1:nr_rst)

real(REAL64), intent(out) :: tile_lake_frac( 1:n_tile)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really need REAL64 here? By construction, there are only 10 distinct real numbers in the 30 arcsec files: [0, 0.11111, 0.22222, ..., 0.88888, 1]. Even for a tile that spans a 1-deg by 1-deg area, there are still only ~10,000 raster (30 arcsec) grid cells. Single-precision should be able to accommodate the digits required to handle the useful information.

Copy link
Copy Markdown
Contributor Author

@biljanaorescanin biljanaorescanin Apr 20, 2026

Choose a reason for hiding this comment

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

Done in this commit: d0753af

… not defined in "use netcdf" (rmTinyCatchParaMod.F90)
@mathomp4
Copy link
Copy Markdown
Member

@gmao-rreichle In re last commit, what constants aren't defined in use netcdf? They should all be there, though maybe as their NF90_ variants.

If some are missing, I can talk to the devs.

@gmao-rreichle
Copy link
Copy Markdown
Contributor

@mathomp4 : For the record, I'm attaching the build log (0-2.txt) that I got when I replaced "include 'netcdf.inc'" with "use netcdf". Looks like nothing with "NF_" is available from "use netcdf".
I tried this based on ChatGSFC saying that "use netcdf" should be backward compatible and should make the F77 API available. I guess ChatGSFC was hallucinating...
I suppose we could change the NF_* to the NF90_* equivalent, but that's more than I'm willing to do at this time. I just used the F77 API again...

@biljanaorescanin
Copy link
Copy Markdown
Contributor Author

biljanaorescanin commented Apr 20, 2026

The last commit addresses all @gmao-rreichle comments. I reran the workflow after the updates. As expected, changing tile_lake_frac from REAL64 to REAL32 introduces small round-off differences relative to the previous outputs, so the files are not zero-diff.
The roundoff in M09 nc4 tile file:
Date Time Level Gridsize Miss Diff : S Z Max_Absdiff Max_Reldiff : Parameter name
15 : 0000-00-00 00:00:00 0 2163601 0 440376 : F T 2.9802e-08 5.9464e-08 : tile_lake_frac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-diff AMIP 0-diff for uncoupled AMIP runs 0 diff The changes in this pull request have verified to be zero-diff with the target branch. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants