Skip to content

Leverage changes from EMC to use updated stochastic physics#81

Open
MingjingTong-NOAA wants to merge 2 commits into
NOAA-GFDL:mainfrom
MingjingTong-NOAA:shield_da_merge
Open

Leverage changes from EMC to use updated stochastic physics#81
MingjingTong-NOAA wants to merge 2 commits into
NOAA-GFDL:mainfrom
MingjingTong-NOAA:shield_da_merge

Conversation

@MingjingTong-NOAA

Copy link
Copy Markdown

Description

This PR include changes made to use updated stochastic physics

Fixes # (issue)

A forecast test was run to compare with the main branch and the results are bit-wise identical.

Checklist:

Please check all whether they apply or not

  • [x ] My code follows the style guidelines of this project
  • [x ] 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
  • [x ] My changes generate no new warnings
  • [x ] Any dependent changes have been merged and published in downstream modules

@lharris4 lharris4 left a comment

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.

Thank you for submitting this code for review. I do believe that there is a lot of complexity added to the SHiELD physics driver for a mostly self-contained module, and in particular a number of options and variables could be moved within the stochastic_physics_wrapper module.

Comment thread GFS_layer/GFS_typedefs.F90 Outdated
print *, 'basic control parameters'
print *, ' me : ', Model%me
print *, ' master : ', Model%master
print *, ' communicator : ', Model%communicator%mpi_val

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.

I am concerned about adding MPI communicators to the physics, as much of the SHiELD physics doesn't manage its own communication. If this is specific to the stochastic physics, then it should be contained in that module. @bensonr can you comment on this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I've removed MPI communicators from physics and changed stochastic physics code to define communicator inside the that module.


real(kind=kind_phys) :: rbcr !< Critical Richardson Number in the PBL scheme
logical :: mix_precip !< Whether to apply PBL mixing to precipitating hydrometeors
logical :: cap_evap !< Whether to apply limiter to evaperation from latent heat flux

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.

Thank you for explicitly adding this option

integer :: nca !< number of independent cellular automata
integer :: nlives !< cellular automata lifetime
integer :: ncells !< cellular automata finer grid
integer :: nca_g !< number of independent cellular automata

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.

Eventually the stochastic physics options should go in a separate stochastic_physics_nml

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Current only three stochastic physics namelist variables are used. We can make this change when we explore other options of stochastic physics.

!< ivegsrc = 2 => UMD (13 category)
integer :: isot !< isot = 0 => Zobler soil type ( 9 category)
!< isot = 1 => STATSGO soil type (19 category)
real(kind=kind_phys), pointer :: pores(:) => null() !< max soil moisture for a given soil type for land surface model

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.

Variables only used within stochastic_physics_wrapper would ideally be contained entirely within that module, possibly in a datatype defined for that module.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I adopted pores and resid from UFS. They are from land surface models not entirely with in stochastic_physics_wrapper. I will leave it there for future applying perturbations to land state.

@@ -2654,36 +2723,48 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!---Cellular automaton options

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.

What do these CA parameters do? In particular pert_radtend is referenced from GFS_physics_driver.F90 and a brief explanation would be helpful to understand the driver logic.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The meaning of those variables has been added

Comment thread GFS_layer/GFS_typedefs.F90 Outdated
@@ -1,5 +1,6 @@
module GFS_typedefs

use mpi_f08

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.

All MPI related functionalities should be done through FMS

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@JosephMouallem Can you show me an example how to do this through FMS? Thanks.

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.

@MingjingTong-NOAA You could directly import any related mpi functionality from fms modules, their name usually start with mpp_, here is an example:
use mpp_mod, only: mpp_pe, mpp_sync_self, mpp_sync, ...
If you could let me know what is needed here, I can point you to the right calls.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@JosephMouallem I need to pass a MPI communicator to stochastic physics routines. Please take a look at stochastic_physics/stochastic_physics_wrapper.F90 to see how I pass the communicator. The subroutines called in stochastic_physics/stochastic_physics_wrapper.F90 can be found here /gpfs/f6/bil-coastal-gfdl/scratch/Mingjing.Tong/SHiELD/shield_da_merge/SHiELD_SRC/stochastic_physics/

Thanks.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I've removed the MPI communicator from physics.

Comment thread GFS_layer/GFS_typedefs.F90 Outdated
type GFS_init_type
integer :: me !< my MPI-rank
integer :: master !< master MPI-rank
type(MPI_Comm) :: fcst_mpi_comm !< forecast tasks mpi communicator

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.

same as above

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same as above

Comment thread GFS_layer/GFS_typedefs.F90 Outdated

integer :: me !< MPI rank designator
integer :: master !< MPI rank of master atmosphere processor
type(MPI_Comm) :: communicator !< MPI communicator

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.

Same comment as above and for all related code that follows.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same as above

logical :: param_update_flag

#ifdef _OPENMP
nthreads = omp_get_max_threads()

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.

I think this should be done upstream and not here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

…c namelist parameters, pass nthreads into stochastic_physics/stochastic_physics_wrapper.F90 from upstream routine

@lharris4 lharris4 left a comment

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.

I think this is good. I'm a bit concerned about the profusion of new variables but the SHiELD physics needs a general cleaning up anyway.

@lharris4

Copy link
Copy Markdown
Contributor

@JosephMouallem @laurenchilutti can you take a look at @MingjingTong-NOAA's PR?

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