Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix-v5.3'
Browse files Browse the repository at this point in the history
This merge corrects an issue in the computation of the initial QV field for
MPAS-Atmosphere; it fixes a bug in the computation of the edgeNormalVectors
field; and it corrects the units and descriptions of scalar tendencies in
MPAS-Atmosphere.

* hotfix-v5.3:
  Correct the "units" attribute for scalar tendencies in atmosphere Registry.xml
  Update comment describing the direction of normal vectors when cell1 == nCells+1
  When deriving QV from RH, always assume RH is w.r.t. liquid water
  Correct the sign of edgeNormalVectors for positive inflow boundary edges
  Update version number to v5.3
  • Loading branch information
mgduda committed Mar 22, 2018
2 parents a74c8d1 + 9156656 commit 7221fbd
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MPAS-v5.2
MPAS-v5.3
====

The Model for Prediction Across Scales (MPAS) is a collaborative project for
Expand Down
34 changes: 17 additions & 17 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="5.2">
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="5.3">

<!-- **************************************************************************************** -->
<!-- ************************************** Dimensions ************************************** -->
Expand Down Expand Up @@ -1633,35 +1633,35 @@

<!-- scalar tendencies -->
<var_array name="scalars_tend" type="real" dimensions="nVertLevels nCells Time">
<var name="tend_qv" name_in_code="qv" array_group="moist" units="kg kg^{-1} s^{-1}"
description="Tendency of water vapor mixing ratio"/>
<var name="tend_qv" name_in_code="qv" array_group="moist" units="kg m^{-3} s^{-1}"
description="Tendency of water vapor mass per unit volume divided by d(zeta)/dz"/>

<var name="tend_qc" name_in_code="qc" array_group="moist" units="kg kg^{-1} s^{-1}"
description="Tendency of cloud water mixing ratio"
<var name="tend_qc" name_in_code="qc" array_group="moist" units="kg m^{-3} s^{-1}"
description="Tendency of cloud water mass per unit volume divided by d(zeta)/dz"
packages="bl_mynn_in;bl_ysu_in;cu_tiedtke_in;mp_kessler_in;mp_thompson_in;mp_wsm6_in"/>

<var name="tend_qr" name_in_code="qr" array_group="moist" units="kg kg^{-1} s^{-1}"
description="Tendency of rain water mixing ratio"
<var name="tend_qr" name_in_code="qr" array_group="moist" units="kg m^{-3} s^{-1}"
description="Tendency of rain water mass per unit volume divided by d(zeta)/dz"
packages="mp_kessler_in;mp_thompson_in;mp_wsm6_in"/>

<var name="tend_qi" name_in_code="qi" array_group="moist" units="kg kg^{-1} s^{-1}"
description="Tendency of ice mixing ratio"
<var name="tend_qi" name_in_code="qi" array_group="moist" units="kg m^{-3} s^{-1}"
description="Tendency of ice mass per unit volume divided by d(zeta)/dz"
packages="bl_mynn_in;bl_ysu_in;cu_tiedtke_in;mp_thompson_in;mp_wsm6_in"/>

<var name="tend_qs" name_in_code="qs" array_group="moist" units="kg kg^{-1} s^{-1}"
description="Tendency of snow ratio"
<var name="tend_qs" name_in_code="qs" array_group="moist" units="kg m^{-3} s^{-1}"
description="Tendency of snow mass per unit volume divided by d(zeta)/dz"
packages="mp_thompson_in;mp_wsm6_in"/>

<var name="tend_qg" name_in_code="qg" array_group="moist" units="kg kg^{-1} s^{-1}"
description="Tendency of graupel mixing ratio"
<var name="tend_qg" name_in_code="qg" array_group="moist" units="kg m^{-3} s^{-1}"
description="Tendency of graupel mass per unit volume divided by d(zeta)/dz"
packages="mp_thompson_in;mp_wsm6_in"/>

<var name="tend_ni" name_in_code="ni" array_group="number" units="nb kg^{-1} s^{-1}"
description="Tendency of cloud ice number concentration"
<var name="tend_ni" name_in_code="ni" array_group="number" units="nb m^{-3} s^{-1}"
description="Tendency of cloud ice number concentration multiplied by dry air density divided by d(zeta)/dz"
packages="bl_mynn_in;mp_thompson_in"/>

<var name="tend_nr" name_in_code="nr" array_group="number" units="nb kg^{-1} s^{-1}"
description="Tendency of rain number concentration"
<var name="tend_nr" name_in_code="nr" array_group="number" units="nb m^{-3} s^{-1}"
description="Tendency of rain number concentration multiplied by dry air density divided by d(zeta)/dz"
packages="mp_thompson_in"/>
</var_array>
</var_struct>
Expand Down
2 changes: 1 addition & 1 deletion src/core_init_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="5.2">
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="5.3">

<!-- **************************************************************************************** -->
<!-- ************************************** Dimensions ************************************** -->
Expand Down
6 changes: 5 additions & 1 deletion src/core_init_atmosphere/mpas_init_atm_cases.F
Original file line number Diff line number Diff line change
Expand Up @@ -4647,8 +4647,12 @@ subroutine init_atm_case_gfs(block, mesh, nCells, nEdges, nVertLevels, fg, state
! es = svp1*10.*exp(svp2*(t(k,iCell)-svpt0)/(t(k,iCell)-svp3))
! es = min(es,0.99*0.01*pressure(k,iCell))
! rs = 0.622*es*100. / (pressure(k,iCell)-es*100.)
!
! Note: the RH field provided by ungrib should always be with respect to liquid water,
! hence, we can always call rslf; see the routine fix_gfs_rh in WPS/ungrib/src/rrpr.F .
!
rs = rslf(pressure(k,iCell),t(k,iCell))
if(t(k,iCell) .lt. svpt0) rs = rsif(pressure(k,iCell),t(k,iCell))
scalars(index_qv,k,iCell) = 0.01_RKIND*rs*relhum(k,iCell)
enddo
enddo
Expand Down
2 changes: 1 addition & 1 deletion src/core_landice/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="landice" core_abbrev="li" version="5.2">
<registry model="mpas" core="landice" core_abbrev="li" version="5.3">


<!-- ======================================================================= -->
Expand Down
2 changes: 1 addition & 1 deletion src/core_ocean/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="ocean" core_abbrev="ocn" version="5.2">
<registry model="mpas" core="ocean" core_abbrev="ocn" version="5.3">

<dims>
<dim name="nCells" units="unitless"
Expand Down
2 changes: 1 addition & 1 deletion src/core_sw/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="sw" core_abbrev="sw" version="5.2">
<registry model="mpas" core="sw" core_abbrev="sw" version="5.3">
<dims>
<dim name="nCells"/>
<dim name="nEdges"/>
Expand Down
2 changes: 1 addition & 1 deletion src/core_test/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="test" core_abbrev="test" version="5.2">
<registry model="mpas" core="test" core_abbrev="test" version="5.3">
<dims>
<dim name="nCells"/>
<dim name="nEdges"/>
Expand Down
16 changes: 8 additions & 8 deletions src/operators/mpas_vector_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -706,21 +706,21 @@ subroutine mpas_initialize_vectors(meshPool)!{{{

! Initialize normal unit vectors at each edge
! These vectors point from cell to cell.
! At boundaries, one cell does not exist, so it points from cell to edge.
! At boundaries, one cell does not exist, so it points from cell to edge or from edge to cell.
do iEdge = 1,nEdges
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)

if (cell1 == nCells+1) then ! this is a boundary edge
! the normal points from the cell location to the edge location
! the normal points from the edge location to the cell location
if (is_periodic) then
edgeNormalVectors(1,iEdge) = mpas_fix_periodicity(xEdge(iEdge), xCell(cell2), x_period) - xCell(cell2)
edgeNormalVectors(2,iEdge) = mpas_fix_periodicity(yEdge(iEdge), yCell(cell2), y_period) - yCell(cell2)
edgeNormalVectors(3,iEdge) = zEdge(iEdge) - zCell(cell2)
edgeNormalVectors(1,iEdge) = xCell(cell2) - mpas_fix_periodicity(xEdge(iEdge), xCell(cell2), x_period)
edgeNormalVectors(2,iEdge) = yCell(cell2) - mpas_fix_periodicity(yEdge(iEdge), yCell(cell2), y_period)
edgeNormalVectors(3,iEdge) = zCell(cell2) - zEdge(iEdge)
else
edgeNormalVectors(1,iEdge) = xEdge(iEdge) - xCell(cell2)
edgeNormalVectors(2,iEdge) = yEdge(iEdge) - yCell(cell2)
edgeNormalVectors(3,iEdge) = zEdge(iEdge) - zCell(cell2)
edgeNormalVectors(1,iEdge) = xCell(cell2) - xEdge(iEdge)
edgeNormalVectors(2,iEdge) = yCell(cell2) - yEdge(iEdge)
edgeNormalVectors(3,iEdge) = zCell(cell2) - zEdge(iEdge)
end if

else if (cell2 == nCells+1) then ! this is a boundary edge
Expand Down

0 comments on commit 7221fbd

Please sign in to comment.