Skip to content

Introduce physics suites mechanism for ARW #124

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

Merged
merged 13 commits into from
Feb 15, 2017

Conversation

mgduda
Copy link
Collaborator

@mgduda mgduda commented Jan 17, 2017

TYPE: enhancement

KEYWORDS: physics suites

SOURCE: internal

PURPOSE:
Introduce a mechanism for specifying physics suites, which automatically set physics options based on the suite selection.

DESCRIPTION OF CHANGES:
This PR introduces a mechanism for selecting suites of physics schemes via the namelist.input file, and it provides the initial definitions of two suites, tentatively named 'CONUS' and 'tropical'.

From a user perspective, the &physics namelist record contains a new option, physics_suite, which is a character string naming the physics suite to be used in a simulation. By default, namelist options for selecting individual physics schemes (specifically, mp_physics, cu_physics, ra_lw_physics, ra_sw_physics, bl_pbl_physics, sf_sfclay_physics, and sf_surface_physics) do not appear in the namelist. However, the selection of any of the aforementioned schemes may be overridden by specifying that namelist option explicitly.

At runtime, the model prints to the rsl files a summary of the physics schemes that will be used in the simulation:

*************************************
Configuring physics suite 'tropical'

         mp_physics:      6      6
         cu_physics:     16     16
      ra_lw_physics:      4      4
      ra_sw_physics:      4      4
     bl_pbl_physics:      1      1
  sf_sfclay_physics:     91     91
 sf_surface_physics:      2      2
*************************************

In the printout, if any options were overridden by the user, those options will be printed with a trailing asterisk.

The suite mechanism is implemented as a new routine, setup_physics_suite( ), that is called just after check_nml_consistency( ) and before set_physics_rconfigs( ). Suite definitions are hard-wired in this routine as CASE statements.

Several design decisions are worth mentioning:

  1. Only a single physics suite is specified for a simulation; all nests are assumed to use the same physics options unless the user specifically overrides these options for a nested domain. For example, to override the cumulus scheme in domain 3, one might write:
 &physics
 physics_suite                       = 'tropical'
 cu_physics                          = -1,    -1,     0,
 ...

which results in the following printout to the rsl.error.0000 file:

*************************************
Configuring physics suite 'tropical'

         mp_physics:      6      6      6
         cu_physics:     16     16      0*
      ra_lw_physics:      4      4      4
      ra_sw_physics:      4      4      4
     bl_pbl_physics:      1      1      1
  sf_sfclay_physics:     91     91     91
 sf_surface_physics:      2      2      2

(* = option overrides suite setting)
*************************************
  1. A value of -1 was chosen to indicate "the scheme following the choice of physics suite" for the namelist options mp_physics, cu_physics, ra_lw_physics, ra_sw_physics, etc., since a value of 0 is already used to indicate no parameterization.

  2. Both the real.exe and wrf.exe programs may use physics suites, but at present no attempt to enable physics suites for WRF DA has been made.

  3. The namelist.output file reflects the state of the namelist before processing of physics suites. This means that, for example, CU_PHYSICS= 11*-1 appears in the namelist.output file if the user has not explicitly overridden the selection of cumulus scheme for any domain.

LIST OF MODIFIED FILES:

  • main/module_wrf_top.F
  • main/real_em.F
  • Registry/Registry.EM_COMMON
  • share/module_check_a_mundo.F
  • test/em_real/namelist.input

TESTS CONDUCTED:
All WTF regression tests pass.

Short two-domain simulations with 'CONUS' and 'tropical' suites, with and without specific physics schemes overridden from suite default.

This option selects the physics suite, either 'continental_convection' or 'tropical_convection'
This new routine is responsible for setting physics options based on
the physics suite selection made in the namelist.
The setting up of physics suites happens after the call to check_nml_consistency
but before the call to set_physics_rconfigs.
The namelist variables mp_physics, ra_lw_physics, ra_sw_physics, sf_surface_physics,
bl_pbl_physics, and cu_physics are set to -1 in the Registry.EM_COMMON file,
indicating that these options should take on whatever value is dictated by the physics
suite chosen by the user.
As part of a suite specification, we now include the surface layer scheme. The default
value for the 'sf_sfclay_physics' namelist option is now -1, indicating that this option
should default to the option from the selected suite.
…t.input

All physics options that are selected by a suite should no longer appear in
the default ARW namelist.input file.
When listing the physics schemes selected by a physics suite, the width
of the field with the name of the option has been reduced.
@jamiebresch
Copy link
Contributor

Why not have the default of physics_suite in Registry be 'none'?

@davegill
Copy link
Contributor

@jamiebresch
Regarding physics suites in ARW, there is strong motivation in the WRF community that we are responding to. Specifically, there is interest to have a default suite of "works well together physics". After hearing this for the past couple of years at the WRF Workshop, the WRF and MPAS upper management basically required that this capability be part of this release. Michael's implementation follows the gist of the requirements that came out of several meetings. For new users, who will definitely be the primary beneficiaries of the suite capability, having "none" as the default sort of defeats the whole purpose.

@mgduda
Copy link
Collaborator Author

mgduda commented Jan 18, 2017

@mkavulich was just asking (in person) about whether we are changing the default behavior in WRF, and it's worth pointing out that using any existing namelist.input file should give the same results as would have been obtained before the introduction of physics suites, since existing namelist.input files explicitly specify (therefore, override) all physics options.

Copy link
Collaborator

@weiwangncar weiwangncar left a comment

Choose a reason for hiding this comment

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

Perhaps we should just use 'tropical' and 'continental' and remove 'convection' in the suite name.
We should also consider removing some of the non-critical physics namelists from our templates a later time.
Should we make recommendation for number of vertical levels too?

Rather than setting components of physics suites based on numbers that may
change, we now use Registry-defined constants, e.g., 16 becomes NTIEDTKESCHEME
for the selection of cu_physics.
Copy link
Contributor

@mkavulich mkavulich left a comment

Choose a reason for hiding this comment

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

  • Change names to "CONUS" and "tropical"
  • Make names case-insensitive

These two physics suites were previously known as 'continental_convection'
and 'tropical_convection'.
Before the select-case block to handle physics suites, we first convert
the name of the physics suite specified by the user to all lowercase.
@mgduda
Copy link
Collaborator Author

mgduda commented Feb 8, 2017

@mkavulich Both of your requested changes (name changes and case insensitivity) have been addressed.

@jamiebresch
Copy link
Contributor

@mgduda the unlimited format string is Fortran 2008 standard.

@mgduda
Copy link
Collaborator Author

mgduda commented Feb 8, 2017

@jamiebresch Thanks for the info. Perhaps that explains why it works for various compilers besides PGI, and also why I couldn't find it in the Fortran 2003 book.

@mgduda
Copy link
Collaborator Author

mgduda commented Feb 8, 2017

@jamiebresch I'll update the commit message to mention Fortran 2003 and earlier, specifically.

The setup_physics_suite() routine previously used format strings like
'(A21,*(I6,A1))' with the intention of repeating the (I6,A1) part some
number of times determined at runtime. The use of '*' as a repetition
count isn't valid in Fortran 90/95/2003, however, and was caught by
the PGI compiler.

This commit introduces code to build a format statement based on the
runtime-determined repetition count, and to then use that format statement
when printing out the schemes selected in a physics suite.
@mgduda
Copy link
Collaborator Author

mgduda commented Feb 8, 2017

@davegill and @dudhia you're both listed as reviewers for this PR. Can you add an approval if you have no objections to merging?

Copy link
Contributor

@davegill davegill left a comment

Choose a reason for hiding this comment

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

Approved

Copy link
Collaborator

@dudhia dudhia left a comment

Choose a reason for hiding this comment

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

As I mentioned to Michael, we need to think about the behavior when someone uses an old namelist which will be seen as 'CONUS' with a lot of overrides in the print-out.

@mgduda
Copy link
Collaborator Author

mgduda commented Feb 14, 2017

@dudhia @davegill @weiwangncar Jimy's concern about the use of existing namelists generating confusing printout in the rsl.error.0000 file is something that we may be able to address with relatively minor changes (described below). Perhaps we can have a quick vote: should we merge this PR as it is now to enable testing of suites to begin, or should we merge this PR after making changes to void confusing printout with old namelist files?

To avoid confusing printout with old namelist files, we could:

  1. Set the default suite in the Registry.EM_COMMON file to none
  2. In the suite setup routine, if the suite is none, print a simple message stating that we are not setting up a physics suite and return immediately

What do you all think?

@dudhia
Copy link
Collaborator

dudhia commented Feb 14, 2017 via email

@weiwangncar
Copy link
Collaborator

weiwangncar commented Feb 14, 2017 via email

This commit sets the default physics suite to 'none', and adds code to print
a simple message and return early from the suite setup routine if the suite
is 'none'. This should avoid any confusing output in the rsl files for anyone
using existing namelist.input files with WRF v3.9.
@mgduda
Copy link
Collaborator Author

mgduda commented Feb 14, 2017

I've just pushed a commit that makes none the default physics suite in the Registry, and prints the following message if the physics suite is none:

*************************************
No physics suite selected.
Physics options will be used directly from the namelist.
*************************************

The default suite in the namelist at test/em_real/namelist.input is still CONUS.

If there are no objections, I'll rerun the regtest and merge this PR later today.

@dudhia
Copy link
Collaborator

dudhia commented Feb 14, 2017 via email

@mgduda
Copy link
Collaborator Author

mgduda commented Feb 14, 2017

@dudhia yes, the code will stop with this fatal error:

-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE:  <stdin>  LINE:    1599
Unrecognized physics suite
-------------------------------------------

@mgduda mgduda merged commit 4962a48 into wrf-model:master Feb 15, 2017
@mgduda mgduda deleted the physics_suites branch February 15, 2017 18:48
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.

6 participants