-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add cryo terms to coupler budget #74
Add cryo terms to coupler budget #74
Conversation
Results from the last month of one year tests.
|
driver-mct/main/seq_diag_mct.F90
Outdated
end if | ||
|
||
lSize = mct_avect_lSize(o2x_o) | ||
ic = c_ocn_or | ||
do n=1,lSize | ||
ca_o = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ko,n) | ||
ca_i = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ki,n) | ||
ca_c = dom_o%data%rAttr(kArea,n) !DC area including ice-shelf cavities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this as a scaling factor was a bit of guesswork, but seems to work. Without it, I was getting 0 for ice-shelf melt in the coupler table, I think because the coupler is seeing the ice-shelf cavity grid cells as land, so 0 area for ocean and ice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xylar here is where I got around the coupler masking out ocean cells under ice shelves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks!
driver-mct/main/seq_diag_mct.F90
Outdated
@@ -1652,7 +1673,8 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) | |||
nf = f_hsen ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_sen,n) | |||
nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergh,n) | |||
nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_i*i2x_i%rAttr(index_i2x_Fioi_meltw,n) | |||
nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergw,n) | |||
!DC propose removing wberg from ice entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note I've removed the wberg
calculation for ice. We don't want this term to be cancelled out by itself across ice/ocn since it's an additional forcing to the system. Rather we want to see how closely it's balanced by the removed runoff term(s).
@@ -187,6 +189,10 @@ subroutine mpaso_cpl_indices_set( ) | |||
index_o2x_Faoo_fco2_ocn = mct_avect_indexra(o2x,'Faoo_fco2_ocn',perrWith='quiet') | |||
index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet') | |||
index_o2x_So_ssh = mct_avect_indexra(o2x,'So_ssh') | |||
!DC P needed since in ice-shelf ocean domain? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting I added 'P' for the ice-shelf melt term; I'm not sure if this matters with the way I did the scaling below. The removed runoff terms do not have P.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested without the 'P' and get the same answers, so I'm removing this.
I've posted a single month of the water coupler budget, but for the polar runs, just noting that looking at a single month can be a bit misleading, since the ice-shelf/berg melt has the opposite seasonal cycle as the removed runoff terms. Ideally we would like to see, over the course of the year, that ( EDIT: the tables above are the all-time sums over the 1 year simulations. |
@darincomeau, I don't really speak coupler yet (though I'm keen to get on Duolingo or wherever and learn some!). Is the coupler budget output just the accumulated change in whatever field over the given period (e.g. a month?), as opposed to accumulated over the simulation? |
By the way, thanks so much for getting this going! I'm realizing how far over my head this would have been. |
Good question; I thought they were monthly sums, but given it says 'period = all_time:', perhaps they are accumulations over the entire simulation, which would be preferable. |
@xylar and @darincomeau -- by default, the coupler budgets are output monthly, annually, and all-time. But this is controlled by flags which also allow daily and instantaneous options |
@jonbob, I guess my question was whether the field going in should be |
I was also wondering about accumulation, in particular when the mpas-ocean timestep is shorter than the coupling interval. |
Exactly! |
@darincomeau, I think we probably need to at the very lease accumulate the field over the coupling interval like happens with other fields passed to the coupler. |
Ok, I'll try to find an analog, but if you have one in mind, I'll take it as a starting point. |
Sorry if I misunderstood. But you are correct -- the coupler will take care of accumulations in general but the ocean needs to do its own accumulation over the coupling interval |
@jonbob, thanks, that clears things up. |
Thanks @xylar - looks like this is an important step I missed! |
Maybe use |
call mpas_pool_get_array(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFlux) | ||
endif | ||
|
||
! load data melt rates if used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this didn't work, stays 0 when data ISMF is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to use landIceFreshwaterFlux
for both standalone
and data
, since one is just copied to the other:
https://github.com/E3SM-Project/E3SM/blob/104a2027d9ad34fbd9198422641ad47f19db65c0/components/mpas-ocean/src/shared/mpas_ocn_surface_land_ice_fluxes.F#L300
But that doesn't explain why you're getting zero.
With that last commit, the results for |
components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F
Outdated
Show resolved
Hide resolved
@mark-petersen can you check the proposed unit changes in the conservation check analysis member's Registry here 285be91? @cbegeman and I looked into this and see the flux variables being multiplied by The reason we're looking here is we want to use these Also, many thanks @mark-petersen for your work on this analysis member in the past. It's made verification of this coupler budget accounting much easier. |
@darincomeau, thanks for the progress yesterday! I haven't managed to do any more debugging yet today. I'll see what I can manage this evening. @darincomeau, if I do a merge with E3SM-Project#6221, is this branch otherwise up-to-date with what you're testing with? |
@xylar yes this is up to date. Would you like me to cherry-pick that sea ice IC commit over here, or were you going to do a local merge? I'm planning on doing a clean branch for the actual E3SM PR to clean up commit history, so it's fine to add changes to files here we otherwise won't have in the final PR. I was planning to start the heat terms today, but I'll keep that local until it's complete. |
@darincomeau, I'm still debugging, writing out the streams I recommended above. One thought: could it be that the coupler is masking out the ice shelves when it sums up the fluxes? We certainly mask out ice shelves in some fields (e.g. those that get remapped to the atmosphere or those that get sent to sea ice). Of course, that wouldn't explain why we're not getting zeros for prognostic melt. |
I can confirm that the variable |
@xylar I don't think this is what's going on, though this issue did come up. I commented in the code, I'll ping you where I made a change to get the coupler to not mask out ice shelves. It seems to be doing the right thing, but it was a bit of guesswork. |
Right, I saw this too, it ends up non-zero in timeSeriesStatsMonthly, as well as in the ocean conservation analysis member. That led me to think it was something specific to the mpas_ocn_time_average.F routine. |
@xylar it's late, get some rest! I haven't had a chance to do anything here today, maybe when I implement the heat terms this evening, something will magically pop out. |
Now with heat flux terms for ice shelf melt ( I left off heat flux due to |
<var name="avgLandIceFreshwaterFlux" type="real" dimensions="nCells Time" units="kg m^-2 s^-1" | ||
description="Time-averaged sum of freshwater fluxes associated with ice shelf basal melt fluxes cell centers sent to coupler. Positive into the ocean." | ||
/> | ||
<var name="avgLandIceHeatFlux" type="real" dimensions="nCells Time" units="J m^-2 s^-1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check units here
driver-mct/shr/seq_flds_mod.F90
Outdated
call seq_flds_add(o2x_fluxes,"Foxo_ismh") | ||
longname = 'Heat flux due to basal melting of ice shelves' | ||
stdname = 'basal_iceshelf_heat_flux' | ||
units = 'J m-2 s-1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same unit check
while the units were technically correct, changed to W/m^s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ready for a "real" PR to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please proceed to a full PR with a single design document as discussed on the email thread between @stephenprice and @xylar. Please use the style of the PR E3SM-Project#5958 as a template for your work, including the link to https://acme-climate.atlassian.net/wiki/spaces/ICE/pages/3952476924/Overview+of+Icepack+physics+merge+into+MPAS-SI. This is an example of a major change to the fully coupled model that pretty much sailed through review. This may all seem like overkill, but it's important because this work could significantly impact coupler budgets across the project, so will be subject to a lot of scrutiny.
Thanks for pointing to that design document Andrew, I had been looking at an older version. We'll get started on that. |
Closing in favor of E3SM-Project#6229 |
Adds five new o2x coupling fields and terms to coupler budget for polar configurations:
wism
- water from ice shelf basal melting (either prognostic or data)wrrof
- water removed from Antarctica liquid runoffwriof
- water removed from Antarctica solid runoffhism
- heat from ice shelf basal meltinghriof
- heat from removed ice runoff