Skip to content

Commit

Permalink
Merge branch 'hotfix-v8.0.2'
Browse files Browse the repository at this point in the history
This merge corrects several issues in the MPAS-Atmosphere model, specifically:

* Generalize the mpas_sphere_angle function to provide correct results for
  non-unit-radius spheres. This generalization fixes problems in remapping
  static fields to the outermost layer of specified-zone cells in limited-area
  meshes.

* Initialize mvd_r and mvd_c before first use in the Thompson microphysics
  scheme to prevent the potential use of uninitialized memory, which could lead
  to floating-point exceptions.

* Correct the units for the grid scale input field to the Thompson cloud
  fraction scheme.
  • Loading branch information
mgduda committed Mar 26, 2024
2 parents cd652c3 + 3f6d870 commit 585c96a
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
MPAS-v8.0.1
MPAS-v8.0.2
====

The Model for Prediction Across Scales (MPAS) is a collaborative project for
Expand Down
2 changes: 1 addition & 1 deletion src/core_atmosphere/Registry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="8.0.1">
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="8.0.2">

<!-- **************************************************************************************** -->
<!-- ************************************** Dimensions ************************************** -->
Expand Down
7 changes: 6 additions & 1 deletion src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F
Expand Up @@ -51,7 +51,10 @@ module mpas_atmphys_driver_cloudiness
! Laura D. Fowler (laura@ucar.edu) / 2016-07-05.
! * since we removed the local variable radt_cld_scheme from mpas_atmphys_vars.F, now defines radt_cld_scheme
! as a pointer to config_radt_cld_scheme.
! Laura D. Fowler (laura@ucar.edu) / 2917-02-16.
! Laura D. Fowler (laura@ucar.edu) / 2017-02-16.
! * this is a bug fix. dx_p is converted from meters to kilometers prior to calling the thompson parameterization
! of the cloud fraction.
! Laura D. Fowler (laura@ucar.edu) / 2024-03-23.


contains
Expand Down Expand Up @@ -119,6 +122,8 @@ subroutine cloudiness_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
do j = jts,jte
do i = its,ite
dx_p(i,j) = len_disp / meshDensity(i)**0.25
!conversion of dx_p from meters to kilometers.
dx_p(i,j) = dx_p(i,j)*0.001
xland_p(i,j) = xland(i)
enddo

Expand Down
2 changes: 2 additions & 0 deletions src/core_atmosphere/physics/physics_wrf/module_mp_thompson.F
Expand Up @@ -1593,6 +1593,8 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, &
smod(k) = 0.
smoe(k) = 0.
smof(k) = 0.
mvd_r(k) = 0.
mvd_c(k) = 0.
enddo

!+---+-----------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion src/core_init_atmosphere/Registry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="8.0.1">
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="8.0.2">

<!-- **************************************************************************************** -->
<!-- ************************************** Dimensions ************************************** -->
Expand Down
2 changes: 1 addition & 1 deletion src/core_landice/Registry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="landice" core_abbrev="li" version="8.0.1">
<registry model="mpas" core="landice" core_abbrev="li" version="8.0.2">


<!-- ======================================================================= -->
Expand Down
2 changes: 1 addition & 1 deletion src/core_ocean/Registry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="ocean" core_abbrev="ocn" version="8.0.1">
<registry model="mpas" core="ocean" core_abbrev="ocn" version="8.0.2">

<dims>
<dim name="nCells" units="unitless"
Expand Down
2 changes: 1 addition & 1 deletion src/core_seaice/Registry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="seaice" core_abbrev="seaice" version="8.0.1">
<registry model="mpas" core="seaice" core_abbrev="seaice" version="8.0.2">

<dims>
<dim name="nCells"
Expand Down
2 changes: 1 addition & 1 deletion src/core_sw/Registry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="sw" core_abbrev="sw" version="8.0.1">
<registry model="mpas" core="sw" core_abbrev="sw" version="8.0.2">
<dims>
<dim name="nCells"/>
<dim name="nEdges"/>
Expand Down
2 changes: 1 addition & 1 deletion src/core_test/Registry.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="test" core_abbrev="test" version="8.0.1">
<registry model="mpas" core="test" core_abbrev="test" version="8.0.2">
<dims>
<dim name="nCells"/>
<dim name="nEdges"/>
Expand Down
7 changes: 4 additions & 3 deletions src/operators/mpas_geometry_utils.F
Expand Up @@ -42,9 +42,10 @@ real (kind=RKIND) function mpas_sphere_angle(ax, ay, az, bx, by, bz, cx, cy, cz)
real (kind=RKIND) :: s ! Semiperimeter of the triangle
real (kind=RKIND) :: sin_angle

a = acos(max(min(bx*cx + by*cy + bz*cz,1.0_RKIND),-1.0_RKIND)) ! Eqn. (3)
b = acos(max(min(ax*cx + ay*cy + az*cz,1.0_RKIND),-1.0_RKIND)) ! Eqn. (2)
c = acos(max(min(ax*bx + ay*by + az*bz,1.0_RKIND),-1.0_RKIND)) ! Eqn. (1)

a = mpas_arc_length(bx, by, bz, cx, cy, cz)
b = mpas_arc_length(ax, ay, az, cx, cy, cz)
c = mpas_arc_length(ax, ay, az, bx, by, bz)

ABx = bx - ax
ABy = by - ay
Expand Down

0 comments on commit 585c96a

Please sign in to comment.