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

Add CLM Lake Model and update Flake #26

Merged
merged 62 commits into from
Apr 26, 2023

Conversation

SamuelTrahanNOAA
Copy link
Collaborator

@SamuelTrahanNOAA SamuelTrahanNOAA commented Dec 1, 2022

This PR adds the CLM Lake Model, updates the Flake This PR adds the CLM Lake Model, updates the Flake model, and adds an experimental feature to run both NSST and a lake model on lake points. The FV3_HRRR suite uses clm_lake by default, and the long-forgotten control_flake test now exists. Any test with LKM=1 that validates a restart file will change results.

Issue requesting this: ufs-community/ufs-weather-model#1510

@SamuelTrahanNOAA
Copy link
Collaborator Author

SamuelTrahanNOAA commented Dec 1, 2022

The automatic github actions are failing because they're trying to access a version of python that doesn't exist.

@grantfirl
Copy link
Collaborator

The automatic github actions are failing because they're trying to access a version of python that doesn't exist.

I think that this bug is fixed in #18, so it should be fixed once merged and pulled into your branch.

Copy link
Collaborator

@tanyasmirnova tanyasmirnova left a comment

Choose a reason for hiding this comment

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

@SamuelTrahanNOAA The changes make sense to me. Most of them are the generalization for the use of lake model. There are important changes in the GFS_surface_composites_post.F90 for non-fractional grid that introduce frac_ice option to make fractional ice work correctly.

physics/flake.F90 Show resolved Hide resolved
else ! islmsk(i) == 2
!-- ice
call composite_icy(.false.)
call composite_wet_and_icy
Copy link
Collaborator

Choose a reason for hiding this comment

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

@SamuelTrahanNOAA Do we need to have on line 289:
if (frac_ice) call composite_wet_and_icy
or
if(cice(i) < 1) call composite_wet_and_icy

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I haven't tested fractional ice on ocean points, so I don't know if that would work. It is set up to only use fractional ice on lake points.

physics/sfc_diff.f Outdated Show resolved Hide resolved

public :: clm_lake_run, clm_lake_init, LAKEDEBUG

integer, parameter, public :: kind_lake = kind_dbl_prec
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does CLM need its own real precision? I.e. Why can't it use kind_phys to be controlled like the rest of the physics?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was double precision in the WRF, and we're uncertain of whether it needs to be double precision. For safety's sake, we're leaving it as double precision for now. The kind_lake lets us experiment with kind_lake=kind_phys without having to rewrite the whole file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added a comment explaining this.

physics/clm_lake.f90 Outdated Show resolved Hide resolved
physics/clm_lake.f90 Outdated Show resolved Hide resolved
physics/clm_lake.f90 Outdated Show resolved Hide resolved
physics/clm_lake.f90 Outdated Show resolved Hide resolved

end subroutine ShalLakeHydrology

subroutine QSat (T, p, es, esdT, qs, qsdT)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@grantfirl note to self: another independent saturation algorithm

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one is run at double precision (kind_lake=kind_dbl_prec)

Copy link
Collaborator

@grantfirl grantfirl left a comment

Choose a reason for hiding this comment

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

Very minor comments. CLM seems like a very well-written scheme. My comments RE: redefined physical constants do not need to be fixed before merging because there are so many other schemes that still have this, but it would be nice to see it fixed at some point.

@SamuelTrahanNOAA
Copy link
Collaborator Author

Apart from 273.15, it isn't immediately apparent to me what those constants are. If someone (@tanyasmirnova?) can tell me, I'll put them at the top of the file.

@SamuelTrahanNOAA
Copy link
Collaborator Author

I can't find 0.61, but I found these:

0.622 = con_eps
0.378 = 1-con_eps
273.15 = con_t0c

There is no entry for con_eps in GFS_typedefs.meta, so I'll have to calculate it as con_rd/con_rv.

@grantfirl
Copy link
Collaborator

I can't find 0.61, but I found these:

0.622 = con_eps 0.378 = 1-con_eps 273.15 = con_t0c

There is no entry for con_eps in GFS_typedefs.meta, so I'll have to calculate it as con_rd/con_rv.

con_eps is imported into GFS_typedefs.F90 and has metadata.

@grantfirl
Copy link
Collaborator

I can't find 0.61, but I found these:

0.622 = con_eps 0.378 = 1-con_eps 273.15 = con_t0c

There is no entry for con_eps in GFS_typedefs.meta, so I'll have to calculate it as con_rd/con_rv.

0.61 is con_fvirt or ratio_of_vapor_to_dry_air_gas_constants_minus_one

@zach1221
Copy link

Testing is finished on PR #1509, and we are ready to begin merge process. @grantfirl are you able to merge this PR?

@jkbk2004
Copy link

@grantfirl @dustinswales @Qingfu-Liu tests are all done at ufs-community/ufs-weather-model#1509. Please, go ahead to merge this pr.

@grantfirl grantfirl merged commit eda81a5 into ufs-community:ufs/dev Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants