-
Notifications
You must be signed in to change notification settings - Fork 10
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
Possible units error in getVerticalMassFlux #159
Comments
I'm going to assign @wmputman and hope he sees this. It's beyond me! |
Yes - ultimately this is an issue that only @wmputman can answer. If we don't hear back in a timely manner, we can at least have someone repeat this analysis as a check. |
I have to look at it, sorry for the delay |
This was taken long ago from the old LatLon core. This code is indeed wrong. You just need to remove the fac in the calculation of conv: MFX = Pa * m2 / s conv & pit will maintain units of Pa * m2 / s (conv - bk*pit) / (grav * area) = ( Pa m+2 s-1 ) / ( m s-2 m+2 ) If you have a bad MFZ, you should be able to correct it by multiplying by gravity*dt (dt=450s) |
@wmputman Queries:
|
It only changes the exports for GEOS. I have committed a code fix: 99b2e9a#diff-3dd8e979b916d8034f7682465fb7f31ce0021dda0299b0314edaa496387a21df |
I have been comparing the estimated vertical mass fluxes generated by FV3 with those coming from the older FV code embedded in GEOS-Chem, and have found significant disagreement. However, I am wondering if this is because of a units issue and would appreciate any insights that the developers might have.
Specifically, in FV_StateMod, the vertical mass flux
mfzxyz
is calculated by callingfv_getVerticalMassFlux
withmfxxyz
andmfyxyz
as inputs:FVdycoreCubed_GridComp/DynCore_GridCompMod.F90
Line 4347 in b331e2a
Immediately beforehand,
mfxxyz
andmfyxyz
are used to fill theMX
andMY
exports, which are stated to be in Pa m+2 s-1:FVdycoreCubed_GridComp/DynCore_GridCompMod.F90
Line 998 in b331e2a
Similarly,
mfxxyz
is used immediately after the call tofv_getVerticalMassFlux
to fill the exportMFZ
, which has declared units of kg m-2 s-1:FVdycoreCubed_GridComp/DynCore_GridCompMod.F90
Line 1032 in b331e2a
However, as far as I can tell, the operations in
fv_getVerticalMassFlux
will not convert a quantity with unitsPa m+2 s-1
to a quantity with unitskg m-2 s-1
. Briefly, it appears that the routine in question first calculatesconv
, which must have units ofPa m+2 s-1
multiplied by the units offac
(noting thatxfx = mfx
):FVdycoreCubed_GridComp/FV_StateMod.F90
Lines 3178 to 3179 in b331e2a
fac
is equal to1.0/(dt*MAPL_GRAV)
, and must therefore have units ofs-1 * s+2 * m-1 = s+1 m-1
:FVdycoreCubed_GridComp/FV_StateMod.F90
Line 3170 in b331e2a
That implies that
conv
has units ofPa m+2 s-1 * s+1 m-1 = Pa m
. The only remaining operation infv_getVerticalMassFlux
which should affect the units of the answer are on line 3204, whenmfz
is calculated. Here,b(k) * pit
is subtract fromconv
, and then the result divided byMAPL_GRAV*area
:FVdycoreCubed_GridComp/FV_StateMod.F90
Line 3204 in b331e2a
pit
is just an accumulation ofconv
so should have the same units, which I believe are stillPa m
. Dividing byMAPL_GRAV*area
should then have the effect of changing the units toPa m * s+2 m-1 * m-2 = Pa s+2 m-2
. Converting from pressure to mass still givesPa = N m-2 = kg m s-2 m-2 = kg s-2 m-1
, which means the eventual units end up beingkg m-3
. That would imply that a factor with units equal to velocity is missing from the calculation.I haven't been able to find a fundamental error in my calculation, but may well be missing something obvious. Nonetheless, I would appreciate any insight that anyone can provide. My suspicion (but it is that at most) is that the application of
fac
is incorrect - removing that factor at least causes the units to work out correctly. It also makes logical sense, since inclusion offac
results in a duplicate division byMAPL_GRAV
, and incurs a division bydt
when the units ofmfx
are already meant to be a tendency. Alternatively, it may be that the units ofmfx
andmfy
are incorrectly listed; but again, any information anyone can provide would be very welcome!The text was updated successfully, but these errors were encountered: