ufs-community / ccpp-physics

UFS fork for CCPP
Other
4 stars 33 forks source link

[production/RRFS.v1] Thompson-Eidhammer microphysics code formatting #179

Closed grantfirl closed 7 months ago

grantfirl commented 7 months ago

This is @AndersJensen-NOAA 's work. A new PR was created targeting the RRFS release branch, and this supercedes #147

This PR is the first of many that will modernized, modularize, and streamline Thompson-Eidhammer microphysics.

This PR includes:

  1. The addition of parameterized kind: REAL -> real(kind_phys)
  2. Consistent indentation
  3. Removal of GOTO statements
  4. Physical constants are now coming from the host.
grantfirl commented 7 months ago

@mkavulich @AndersJensen-NOAA This one is next up for the RRFS release branch. It is ready to review/test.

grantfirl commented 7 months ago

Reviewers (@AndersJensen-NOAA @mkavulich @dustinswales @Qingfu-Liu @mzhangw):

You may have previously reviewed https://github.com/ufs-community/ccpp-physics/pull/147, which this PR replaces. Most of the changes are identical to that with the exception of the physical constants change work. You can look in commits https://github.com/ufs-community/ccpp-physics/pull/179/commits/716abb6ca92527c42fa9c13c734b9346e57bc84d and https://github.com/ufs-community/ccpp-physics/pull/179/commits/8718420e5cd52498fd4b1ef57bf7603da0217180 for the changes.

Basically, it's changing physical constants that were in module_mp_thompson.F90 from parameters to variables, exposing them to the mp_thompson_init routine and setting them from constants passed in from the host there. Derived constants that had been set in the declaration section had to be moved to the top of the execution in thompson_init since they're no longer parameters.

I decided not to create another separate mp_thompson_common module for physical constants (e.g. like is done for MYNN PBL) because they were already being defined at the module level in module_mp_thompson.

grantfirl commented 7 months ago

These changes look good to me. Thanks @AndersJensen-NOAA and @grantfirl! One question though, will there be a PR into ufs/dev for these changes as well?

Yes. At some point, either after RRFS is released or even before, we can submit these same changes to ufs/dev.