Skip to content

noresm2_3_beta02: Add RafWBF parameterization for Bergeron factor#274

Open
mvdebolskiy wants to merge 12 commits into
NorESMhub:noresm2_3_developfrom
mvdebolskiy:add-raf-berg
Open

noresm2_3_beta02: Add RafWBF parameterization for Bergeron factor#274
mvdebolskiy wants to merge 12 commits into
NorESMhub:noresm2_3_developfrom
mvdebolskiy:add-raf-berg

Conversation

@mvdebolskiy
Copy link
Copy Markdown
Collaborator

@mvdebolskiy mvdebolskiy commented Apr 26, 2026

Summary: Adds a random-forest parameterization for determining a factor for Bergeron process.

Contributors: @mvdebolskiy @sldamman

Reviewers: @gold2718 @DirkOlivie @oyvindseland

Purpose of changes:

Github PR URL:

Changes made to build system: added namelist options

Changes made to the namelist: added rafwbf_on_on and forestfileWBF namelist vars in group wbf_nl. The switch defaults to .false.

Changes to the defaults for the boundary datasets: None

Substantial timing or memory changes: TBD

[ Detailed description of changes ]

[ List each test suite run. For each suite, include machine, compiler, and any test failures.
For each failure, include the contents of TestStatus or the output from cs.status.testid for that test ]

Issues addressed by this PR: None

@mvdebolskiy mvdebolskiy marked this pull request as draft April 26, 2026 14:51
@oyvindseland
Copy link
Copy Markdown

Has it been tested to give bit-identical results with the switch default to false?

@mvdebolskiy
Copy link
Copy Markdown
Collaborator Author

@oyvindseland I am doing that right now.

@mvdebolskiy mvdebolskiy mentioned this pull request Apr 28, 2026
24 tasks
@mvdebolskiy mvdebolskiy marked this pull request as ready for review April 28, 2026 14:42
@mvdebolskiy
Copy link
Copy Markdown
Collaborator Author

@oyvindseland @gold2718 aux_cam_noresm and prealpha_noresm showed only NLCOMP fails. @sldamman will check the output scientifically, so it will be gtg in a couple of days.

Copy link
Copy Markdown

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

Please see change requests.


<entry id="forestfileWBF" type="char*256" input_pathname="abs" category="microphys"
group="wbf_nl" valid_values="" >
ML parameters for Damman et al., ...
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there supposed to be a reference here?
This needs some reference / documentation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's not published yet.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Then, please include the title and current submission status (e.g., journal, status).

Comment thread src/NorESM/micro_mg2_0.F90 Outdated
! RaFWBF parameterisattion:
if (rafwbf_on) then
do i = 1,mgncol
if (t(i,k) .le. 273.15_r8 .and. t(i,k) .ge. 235.15_r8) then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All of these uses of 273.15 (here and below) should use physconst, only: tmelt. Also, please use modern Fortran syntax:

Suggested change
if (t(i,k) .le. 273.15_r8 .and. t(i,k) .ge. 235.15_r8) then
if (t(i,k) <= tmelt .and. t(i,k) >= 235.15_r8) then

Also, it would be great if you could define and document a parameter for 235.15_r8 and use that.

Comment thread src/NorESM/micro_mg_cam.F90 Outdated
!===============================================================================

subroutine micro_mg_cam_tend(state, ptend, dtime, pbuf)
subroutine micro_mg_cam_tend(state, ptend, dtime, cam_in, pbuf)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do not pass in an entire structure for one variable. Pass just ts.

Comment thread src/NorESM/module_random_forests.F90 Outdated
close(unitn)
end if
else
call endrun(subname//':: ERROR rafwbf_on = .true. is incompatible with micro_mg_version=2')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't this be version 1?

Suggested change
call endrun(subname//':: ERROR rafwbf_on = .true. is incompatible with micro_mg_version=2')
call endrun(subname//':: ERROR rafwbf_on = .true. is incompatible with micro_mg_version=1')

Comment thread src/NorESM/physpkg.F90 Outdated

if (use_subcol_microp) then
call microp_driver_tend(state_sc, ptend_sc, cld_macmic_ztodt, pbuf)
call microp_driver_tend(state_sc, ptend_sc, cld_macmic_ztodt, cam_in, pbuf)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See change request in micro_mg_cam.F90

Comment thread src/physics/cam/micro_mg_cam.F90 Outdated

use micro_mg1_0, only: micro_mg_get_cols1_0 => micro_mg_get_cols
use micro_mg2_0, only: micro_mg_get_cols2_0 => micro_mg_get_cols
use camsrfexch, only: cam_in_t
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Only ts should be passed so this will not be necessary.

Comment thread src/physics/cam/microp_driver.F90 Outdated
case ('MG')
call t_startf('microp_mg_tend')
call micro_mg_cam_tend(state, ptend, dtime, pbuf)
call micro_mg_cam_tend(state, ptend, dtime, cam_in, pbuf)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Only pass ts:

Suggested change
call micro_mg_cam_tend(state, ptend, dtime, cam_in, pbuf)
call micro_mg_cam_tend(state, ptend, dtime, cam_in%ts, pbuf)

@gold2718
Copy link
Copy Markdown

@oyvindseland @gold2718 aux_cam_noresm and prealpha_noresm showed only NLCOMP fails. @sldamman will check the output scientifically, so it will be gtg in a couple of days.

Given how much code is impacted, a short test should be added (can be short SMS test) to protect the baseline moving forwards.

mvdebolskiy and others added 3 commits April 29, 2026 16:48
Co-authored-by: goldy <1588651+gold2718@users.noreply.github.com>
@mvdebolskiy mvdebolskiy requested a review from gold2718 April 29, 2026 18:22
@mvdebolskiy
Copy link
Copy Markdown
Collaborator Author

I've rerun aux_cam only nlcomp fails + 1 baseline fail for the new test.

Copy link
Copy Markdown

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

This is much better but still needs some fixes.
Also, please do not resolve my comments and change requests. I need to see them to make sure everything is resolved.

Comment on lines +1765 to +1767
Tb = t(i,k) - 273.15_r8 ! DegC
PBLHb = pblh(i) !m
TSKb = tsk(i) - 273.15 ! DegC
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are these constants explicitly supposed to be the same as tupb? tmelt? Given the comment, it seems that these should be replaced with tmelt.

Comment thread src/NorESM/micro_mg2_0.F90 Outdated
! RaFWBF parameterisattion:
if (rafwbf_on) then
do i = 1,mgncol
if (t(i,k) >= tupb .and. t(i,k) <= tlob) then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Have you tested this change? I do not see how it is ever .true..

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.

3 participants