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

Lightning Threat Indexes: pass w to model #243

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

SamuelTrahanNOAA
Copy link

@SamuelTrahanNOAA SamuelTrahanNOAA commented Feb 27, 2023

Description

This is part of a collection of PRs to add lightning threat indexes to the RRFS. The algorithm was originally ported from HRRR to the GFDL_atmos_cubed_sphere NGGPS diagnostics, using the w variable in both implementations. I've moved it to CCPP, but it still needs w in the formulation, so this three-line change sends w to the model.

ufs-community/ufs-weather-model#1632

How Has This Been Tested?

A 3km test case from a time that had some lightning was run and compared to the HRRR output. Developers of the scheme found the results to be sufficiently similar. There'll be more extensive testing after this is merged and running in parallels.

Checklist:

Please check all whether they apply or not

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation -- I don't think there are any documentation changes required.
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules -- no downstream changes

Copy link
Collaborator

@junwang-noaa junwang-noaa left a comment

Choose a reason for hiding this comment

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

The code change is to bring w field from dycore to physics. It looks good to me.

@@ -2113,6 +2113,7 @@ subroutine atmos_phys_driver_statein (IPD_Data, Atm_block,flip_vc)
IPD_Data(nb)%Statein%tgrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%pt(i,j,k1)))
IPD_Data(nb)%Statein%ugrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%ua(i,j,k1)))
IPD_Data(nb)%Statein%vgrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%va(i,j,k1)))
IPD_Data(nb)%Statein%wgrs(ix,k) = _DBL_(_RL_(Atm(mygrid)%w(i,j,k1)))
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this should be protected with an if-test for hydrostatic as w is only defined for non-hydrostatic simulations.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for noticing that. Also, @junwang-noaa requested that wgrs only be allocated if lightning_threat is enabled, so I'll put both in the same "if" guard.

@lharris4
Copy link
Contributor

lharris4 commented Feb 28, 2023 via email

@SamuelTrahanNOAA
Copy link
Author

When implemented in the physics this check will also need to be made.

The code that uses wgrs is never reached unless lightning_threat .eqv. .true.

Copy link
Contributor

@bensonr bensonr left a comment

Choose a reason for hiding this comment

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

Thanks @SamuelTrahanNOAA. I haven't looked at the IPD_Data%Statein ddt in a while, but if it's a pointer and not a pure allocatable, then this all looks good.

@SamuelTrahanNOAA
Copy link
Author

I haven't looked at the IPD_Data%Statein ddt in a while, but if it's a pointer and not a pure allocatable, then this all looks good

From GFS_typedefs.F90:

  type GFS_statein_type
    ...
    real (kind=kind_phys), pointer :: wgrs (:,:)   => null()  !< w component of layer wind
    ...
  end type GFS_statein_type

...
  subroutine statein_create (Statein, IM, Model)
    ...
    if(Model%lightning_threat) then
      allocate (Statein%wgrs   (IM,Model%levs))
    endif

@jkbk2004
Copy link

@bensonr @laurenchilutti Can you merge in this pr? All tests are done on ufs-community/ufs-weather-model#1642

@bensonr bensonr merged commit a4450fb into NOAA-GFDL:dev/emc Mar 24, 2023
@jkbk2004
Copy link

thanks! @bensonr

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.

5 participants