-
Notifications
You must be signed in to change notification settings - Fork 29
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
en/latest/examples/CloseHeatBudget_POP2 #96
Comments
Hello, I would like to ask, are DZU, DZT and dz the same? There is no DZU and DZT in my pop output. |
You'll have to compute |
Thank you very much for your reply. I'm studying cesm recently and want to do heat budget analysis. I read your reply and tried to use pop_tools.grid.calc_dzu_dzt() to calculate 'DZT' and 'DZU', but 'DZBC' doesn't exist in my POP output file. The POP grid I used is gx1v6. May I ask if you have any files including the 'DZT' and 'DZU' corresponding to this grid? If yes, can you send me in the format of 'nc' file? Thank you. |
Hi there, we don't have |
Hi again, you are looking at 1° model output, correct? In that case |
Thank you very much for your reply. It is very helpful to me. I found that gx1v6 is a 1° grid on average, which is also a three-pole grid. According to your reply, if DZT[k,:,:] = dz[k], the program can run normally, but it seems that 'SUM' and 'TEND_TEMP' are not completely equal (not closed). For your example code above, except for DZT and DZU, I did not make any other modifications. This may be incorrect. My calculation code can be found here : https://github.com/Zhangqs-hub/pop_tools-test. But the POP output file used is a bit big, more than 2G, I don’t know how to send it to you. If you have any good ideas, please let me know. Thanks again. |
@Zhangqs-hub if you put that code in a notebook, run it, then upload it; we'll at least be able to see the figures even if we cannot actually run it. |
OK, thank you, let me try. |
I have run and uploaded the notebook file, please check it out, thank you. |
@Zhangqs-hub , I suggest plotting some maps of the fields around the depths where the budget doesn't close. It's not obvious to me from the line plot why it doesn't. |
Thank you for your suggestions. I drew the maps at z_t=12500 and uploaded them to the previous github. I would like to ask, can the small error between 'SUM' and 'TEND_TEMP' be the reason for the grid conversion, such as converting the three-pole grid of POP to xgcm will produce a small deviation, which will cause it to not close? In addition, is there any problem with the calculation and creation of my DZT and DZU? |
@Zhangqs-hub, are you looking at model output that you are generating? If so, you might consider writing out double precision output and seeing if the magnitude of your residuals goes down. If the residuals don't go down in magnitude, then you can probably conclude that a term is missing or mishandled. Double precision output can be enabled by running the following command in CASEROOT
That said, it doesn't look like your computation includes contributions from |
Thanks for your reply. I followed your reply and carried out the output of double precision, and tested it, and found that it is indeed still not closed. I checked the output file and found that there are indeed two variables, |
I'm not familiar enough with
|
Thank you very much for your clear reply, but there seem to be some problems after I tried. I have uploaded the notebook file (https://github.com/Zhangqs-hub/pop_tools-test),and you may be able to check. Thanks again for your help. |
Please try replacing
with
I think this more closely mimics the treatment of |
According to your modification, the thermal balance analysis has been closed!This's so great! |
That's great news that the budget is closing. Regarding The contribution of Prior to CESM2, we used a time filtering approach in POP that didn't lead to a contribution in tracer budgets. We switched to the Robert filter in POP in CESM2 to enable hourly coupling of the ocean to the atmosphere. If we used hourly coupling with the previously used time filtering approach, the computational cost of POP would have gone up by a factor of 3, because of extra time steps required by the previous approach. (The previous approach requires at least 3 time steps per coupling interval.) In the hi-res configuration analyzed in |
Thank you very much for your detailed answers! |
Looking at CESM2, it doesn't seem to have a HDIFE_TEMP term like in CESM1. All I could find was HDIFT which was the vertically integrated horizontal mixing tendency. Did you have to calculate your HDIFE_TEMP and HDIFN_TEMP terms from other ones? |
@Zhangqs-hub I do not recommend interpolating before closing the budget. Have a look here for interpolation methods: http://xarray.pydata.org/en/stable/user-guide/interpolation.html @jn533213 It sounds like you might not have all the budget terms saved. I am not aware of all the CESM simulations that are available, but if you provide more info on which simulation you are looking at I am happy to ask around whether the budget terms are available. |
I was looking to recreate the heat budget that you have done using the data from CESM2 LENS2 linked here: https://www.cesm.ucar.edu/projects/community-projects/LENS2/data-sets.html only over a different time period and location. Is this the proper data set to go forward with? If not, would you be able to provide a link to the specific data sets used in the pop_tools.DATASETS.fetch function? |
Thank you for your reply. I've had some new problems. |
@jn533213 I am inquiring for you whether the full heat budget has been saved (in the monthly output there is a term HDIFT that I am not familiar with, maybe it is the sum of HDIFE and HDIFN). @Zhangqs-hub |
Thank you for your reply and it helps me a lot. |
Sorry, the picture can be found here, https://github.com/Zhangqs-hub/pop_tools-test |
@jn533213 You actually told me what HDIFT was and I had forgotten, vertically integrated. I'm afraid there are no other heat budget terms saved than what seems to be available to you. So you won't be able to close the budget, sorry about that. |
@Zhangqs-hub great that you investigated! Since you are not taking a gradient in |
Thank you for your reply!
|
@Zhangqs-hub, using the following syntax, you can embed the images in the markdown text: ![](image_url) for e.g. ![](https://github.com/Zhangqs-hub/pop_tools-test/blob/main/fig4.png?raw=true) |
@jn533213 @ALDepp Unfortunately, CESM2 LENS did not save all heat budget terms as monthly output. But, you can close monthly heat budget precisely by using alternative terms to HDIFE_TEMP, HDIFN_TEMP, and HDIFB_TEMP. |
Shouldn't the derivatives be computed using gridxgcm.derivative rather gridxgcm.diff? I see the latter being used to obtain the advection terms but the 'diff' operation just forms the numerator in the derivative calculation, right? |
I am trying to plot the globally averaged terms in the heat budget. I am not sure I fully understand how the weighting is being done here. Here is how I think of the sequence of operations:
But in the code above, the I am also confused why each term is divided by the local cell volume ( |
@ALDepp, I forgot to tag you in the previous two posts of mine. |
Hi @tlsw231, the reason we use |
I agree that it would be much nicer to use One way to do this would be to rescale the output i.e. undo the division by cell area, and then use xgcm's metric-aware functionality. I bet that would be less confusing if we can get it to work. @tlsw231 are you for experimenting with this approach? |
@cherian_deepak I am glad to contribute. I am somewhat new to github, just created an account only very recently. To create a PR, I just follow the instructions in the 'Preparing pull requests' here, right? I can experiment with For creating a PR with just the extra documentation added in, I was wondering what is the standard protocol regarding initiation of the PR. Is it more appropriate for the original author of the notebook to do this? I feel like that person has done all the hard work, even supplying the necessary additional documentation. I would just be doing a copy-paste job :) |
@dcherian I am glad to contribute. I am somewhat new to github, just created an account only very recently. To create a PR, I just follow the instructions in the "Preparing pull requests" here, right? I can experiment with grid.diff vs grid.derivative, this might take a little while though. I have a couple of meetings coming up in the next 10-12 days, hence the flurry of questions:). One question I have is what dataset to use for validation? Based on the comments section for this notebook, it appears terms that vanish for 0.1 deg POP output can be quite significant for 1 deg POP output. In my case, the 0.1 deg output does not have the TEND_TEMP` term, so I have been trying to use the restart files at the beginning and end of the averaging interval to compare the LHS and RHS in the budget. Haven't been successful so far but that might be because I have not been doing the weighting correctly. For creating a PR with just the extra documentation added in, I was wondering what is the standard protocol regarding initiation of the PR. Is it more appropriate for the original author of the notebook to do this? I feel like that person has done all the hard work, even supplying the necessary additional documentation. I would just be doing a copy-paste job :) |
@ALDepp Thanks for the detailed explanation, really appreciate it. Once you assemble the terms in the |
@ALDepp I tried working with 1-degree POP output from CESM version 1.3 but am still having a hard time balancing the budget. I have uploaded a notebook here. One difference between my notebook and yours is that I am first computing the time mean of all the terms but don't see why that should create problems. In the right panel of the plot in the notebook, there is a large discrepancy between the tendency obtained from adding the terms on the right side of the equation and that from the variable TEND_TEMP saved as part of the POP output. I have tried adding/removing: (i) GM terms (ii) submeso terms; (iii) HDIFB (but retaining HDIFE and HDIFN) but always get an order of magnitude difference in the right panel. One of the main sources of my confusion is what all does HDIFB include. In your notebook you omit HDIFB but get an excellent balance. Based on an earlier comment by @Ryohei17, HDIFB must also be included. That is the case in the notebook uploaded by @Zhangqs-hub, who also gets a good balance. If I read through the comments within the NCL code generate_TEMP_budget.map.monthly.ncl provided by NCAR, they say HDIFB includes both resolved and subgrid. Does that mean I should not add TOT_ADV to the sum? (tried that too but to no avail). |
@klindsay28 I have been trying to balance the POP heat budget with 1-deg cesm output (version 1.3, see previous comment). I read your replies earlier in this thread. Would you have any idea what am I doing wrong (link to notebook)? Thanks! |
Is there a way to calculate the individual components of the air-sea heat flux minus the shortwave radiation rather than just the net air-sea heat flux minus the shortwave radiation? I'm not sure how to handle the DIA_IMPVF_TEMP when using individual components ie. sensible, latent heat flux, longwave radiation. |
@klindsay28 From your reply , I learn that in 1 degree model we need HDIFB_TEMP; in CEMS1 the time filtering approach used in POP didn't lead to a contribution in tracer budgets, so in CESM1, there's no RF_TEND_TEMP. I try to recreate the heat budget that you have done using the data from CESM1 LENS linked here: https://www.earthsystemgrid.org/dataset/ucar.cgd.ccsm4.cesmLE.ocn.proc.monthly_ave.html |
@HXJ1008611 Did you finally close the heat budget in the CESM1-LENS? Have the same problem here. |
我已收到您的邮件。我看到后会及时回复,谢谢。
|
@ALDepp Hello, may I ask if the budget['UET'], budget['VNT'] and budget['WTT'] calculated by xgcm correspond to -udT/dy, -vdT/dy, and -wdT/dz, or -d(uT)/dy, -d(vT)/dy, and -d(wT)/dz? |
我已收到您的邮件。我看到后会及时回复,谢谢。
|
@Zhangqs-hub |
Calculate POP2 heat budget using xgcm
https://pop-tools.readthedocs.io/en/latest/examples/CloseHeatBudget_POP2.html
The text was updated successfully, but these errors were encountered: