Skip to content

Conversation

@maltrud
Copy link
Contributor

@maltrud maltrud commented Jul 10, 2019

This PR allows ocean surface thickness fluxes into/out of the ocean due to precipitation, evaporation, ice formation/melt, and ice runoff to be spread out vertically in a manner analogous to what is done currently for just liquid runoff. there is a new namelist variable that sets the e-folding scale of the vertical spreading profile.

this capability was added to reduce the sometimes unrealistically large vertical stability due to dumping large amounts of fresh water only in the top layer of the model.

@mark-petersen mark-petersen force-pushed the surfaceThicknessFluxSpreading branch from c149dff to ab28828 Compare July 10, 2019 19:46
@mark-petersen mark-petersen self-requested a review July 10, 2019 19:47
@mark-petersen
Copy link
Contributor

I rebased on ocean/develop, compiled, and this passes global ocean test cases.

@maltrud please look at the files changed tab and see if these look like the right code changes.

- fracAbsorbedPrecEvapIce * (rainFlux(iCell) + evaporationFlux(iCell)) * &
activeTracers(indexTempFlux,1,iCell)/rho_sw &
- fracAbsorbedRunoff * surfaceThicknessFluxRunoff(iCell) * ( &
+ min(activeTracers(indexTempFlux,1,iCell),0.0_RKIND) )/rho_sw
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't freshwater fluxes from land ice also be included here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess sea-ice fluxes aren't included so maybe not, but what's special about rain and evap?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

In looking at this a bit, I agree with @xylar here. I think the problem is that @maltrud is talking about the thickness flux spreading, but Xylar raises an important point that there is still a bug in the non local flux for KPP, which is more appropriate to #305 . Landice and seaice freshwater do get added to the heat flux and thickness flux such that the heat content doesn't change, but we need to correct for that additional flux to retain a net zero flux for KPP. As the code is right now a seaice or landice freshwater flux will create an artificially strong surface buoyancy flux which would reduce mixing.

@xylar
Copy link
Collaborator

xylar commented Jul 10, 2019

An extra line needs to be added here:
https://github.com/MPAS-Dev/MPAS-Model/blob/ocean/develop/src/core_ocean/shared/mpas_ocn_diagnostics.F#L1832
to modify surfaceFluxAttenuationCoefficientPrecEvapIce in the same way as surfaceFluxAttenuationCoefficient under land ice. Or we would need to add yet another surfaceFluxAttenuationCoefficientLandIce and another set of loops...

@maltrud
Copy link
Contributor Author

maltrud commented Jul 10, 2019

@xylar , for the first question, the effect of land ice is already included in activeTracersSurfaceFlux(indexTempFlux,iCell) so doesn't need to be handled explicitly.

for the second question, evap and precip are forced to have water entering/leaving at the local SST (instead of at 0C as it was before). we account for that added heat with an additional surface heat flux in activeTracersSurfaceFlux(indexTempFlux,iCell). but this flux doesn't change buoyancy (only heat content) so we have to remove it from the buoyancy flux.

@xylar
Copy link
Collaborator

xylar commented Jul 10, 2019

@maltrud, your comment refers to KPP? Okay, I'll defer to you and desist on that.

@xylar
Copy link
Collaborator

xylar commented Jul 10, 2019

The issue remains that surfaceFluxAttenuationCoefficientPrecEvapIce needs to be modified under land ice in the same way that we modify surfaceFluxAttenuationCoefficient. Otherwise, land ice freshwater fluxes will no longer be distributed as expected.

@maltrud
Copy link
Contributor Author

maltrud commented Jul 10, 2019

@xylar , for the third question, i chose not to touch land ice fluxes. i don't think that what i've done would change the land ice flux treatment at all. if you believe that it would be beneficial to treat land ice fluxes differently than they are now following a similar procedure, that's up to you.

@maltrud
Copy link
Contributor Author

maltrud commented Jul 10, 2019

@xylar ok i just saw your message about needing to modify stuff under land ice--i'll check that.

@xylar
Copy link
Collaborator

xylar commented Jul 10, 2019

i chose not to touch land ice fluxes.

Because landIceFreshwaterFluxes are added to surfaceThicknessFluxes, which were prerviously distributed with surfaceFluxAttenuationCoefficient, and now are distributed with surfaceFluxAttenuationCoefficientPrecEvapIce, I very much do expect land-ice fluxes to be affected.

-100.0_RKIND) )
fracAbsorbedPrecEvapIce = 1.0_RKIND - exp( max(-layerThickness(1, iCell) / &
config_flux_attenuation_coefficient_prec_evap_ice, -100.0_RKIND) )

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need a third fracAbsorbed for all other thickness fluxes that are not being spread, otherwise we will not have a balance of heat fluxes and the corresponding cooling from the layer expansion from the thickness flux. Similar to my comment below.

@maltrud
Copy link
Contributor Author

maltrud commented Jul 10, 2019

yes, i was incorrect before. instead of saying i chose not to modify land ice treatment, i should have said i chose not to exempt land ice from being treated the same as other (non-runoff) thickness fluxes. if you'd like to add another attenuation scale for land ice fluxes, go ahead and do that. this PR is for water cycle, so ice cavities won't be enabled. for testing with ice cavities enabled, one can set the attenuation scale back to 0.001 to get the previous behaviour.

@xylar
Copy link
Collaborator

xylar commented Jul 10, 2019

@maltrud, if you look carefully at the line I posted before, which I will share again:
https://github.com/MPAS-Dev/MPAS-Model/blob/ocean/develop/src/core_ocean/shared/mpas_ocn_diagnostics.F#L1832
we currently modify surfaceFluxAttenuationCoefficient to have a different value under land ice than elsewhere. The current code (before this PR) thus distributes land ice fluxes (including thickness fluxes) over 10 m even if they are distributed over 0.001 m elsewhere.

With this PR, that functionality is broken unless the same treatment is added for the new surfaceFluxAttenuationCoefficientPrecEvapIce. I really must insist that some careful testing be done to make sure this doesn't break ice-shelf cases before this can go in, regardless of whether it is intended for water cycle runs. It isn't acceptable to me to break the cryosphere configuration in haste to get new features in for water cycle.

@maltrud
Copy link
Contributor Author

maltrud commented Jul 10, 2019

ok, there are too many issues to be solved before the freeze. maybe this will get in later, maybe not.

@maltrud maltrud closed this Jul 10, 2019
@maltrud maltrud deleted the surfaceThicknessFluxSpreading branch July 10, 2019 22:52
@xylar
Copy link
Collaborator

xylar commented Jul 11, 2019

@maltrud, I'm sorry for my tone last night. As @mark-petersen kindly pointed out to me, I probably shouldn't be responding to pull requests at 1 am.

It seems like @vanroekel was fine with the KPP changes made here (the remaining concerns about fluxes from land ice and sea ice seem unrelated to this PR).

The only remaining change I needed was the addition of this one line:

            surfaceFluxAttenuationCoefficientPrecEvapIce(iCell) = config_land_ice_flux_attenuation_coefficient

below the line:

            surfaceFluxAttenuationCoefficient(iCell) = config_land_ice_flux_attenuation_coefficient

at
https://github.com/MPAS-Dev/MPAS-Model/blob/ocean/develop/src/core_ocean/shared/mpas_ocn_diagnostics.F#L1832

I got frustrated because it didn't seem like I was making myself very clear on this and that the runs with ice shelves might get broken in the haste to get the PR in before the code freeze. But the fix is simple enough that a quick nightly test could confirm that no harm is done once the above line is added.

If you wan to push for this to happen before the code freeze, I'd support that. I'll do what I can to make sure ice-shelf runs aren't negatively affected.

@mark-petersen
Copy link
Contributor

It was still worth having a PR with the code and issues raised for later reference. No harm done. Mat, don't worry about it now, but after you return we should discuss what is worth merging versus adding to a development list for later.

@maltrud, could you please comment here on what simulations you ran with the thickness flux spreading, what parameter values you used, and what differences you saw? Were there improvements that would indicate that thickness flux spreading should be on by default in V2 simulations?

@maltrud
Copy link
Contributor Author

maltrud commented Jul 11, 2019

@mark-petersen i did simulations with an attenuation scale 0.001, 10., and 50. meters. there were significant improvements in the 50m case, but i'm no longer fully confident in the results due to possible energy conservation issues. they're likely quite small errors, but i need to fix that before definitively saying it should be implemented in v2, especially since it won't be ready by july 15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants