-
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
Create ELM module to handle LUH2 data import #21
Comments
Review of dynHarvestMod.F90, which is used as a template for the dynLandUseMod.F90 development. Notable differences between elm and clm:
|
Development branch: https://github.com/glemieux/E3SM/tree/lnd/fates-luh2 Associated fates branches:
|
@ckoven should use of luh2 data be incompatible with using transient data? |
yes, anything FATES-related should be incompatible with the big-leaf transient land use drivers |
ELM build development notes:
Updated:
ELMBuildNameList notes:
|
@ckoven did I understand correctly that As a followup, iirc in the meeting today, we discussed that using harvest and luh2 at the same time is a future goal, correct? I started to add logic to deny this combo on the elm-side during namelist build check, but I'm wondering if I should let both be set? |
@glemieux no these should both be allowed already. The future goal will be to remove the current reading of the logging rates from the surface dataset entirely and replace them with the same information that is now on the luh2 file. |
elmfates_interfacemod.F90 notes:
|
Aside: should the module actually be located in the
|
I guess another possibility is to put the subroutine not in its own module but in the (ec)lmfates_interfaceMod.F90 module? |
LUH2 file IO notes:
To do:
|
Definitely a possibility. Right now I'm looking to see if I can implement something simple for using controlMod.F90 for the file IO, instead of the dynSubGrid module setup. I've also got a short, tentative walk through of dynSubGrid with Bill (and Erik) since he's the one who did most of the development for it, I believe. |
Build testing is in progress. I've messed up something with the namelist system:
This is failing in A sanity check build against the most recent elm-fates api update builds fine. |
This ended up being a simple issue of having some random characters (the |
Just to say that I pushed commits on both the ELM and FATES branches that include some new history dimensions and one new history variable |
@ckoven can you comment on this change that came in with commit NGEET/fates@8c942e8? It looks like you are adding a new site level variable, but I wasn't sure if that was actually the intent here. |
Thanks @glemieux for catching. Yeah, sorry, I didn't follow that thread to completion. The intent is to get rid of the three variables Then, in the history output, this part of the code https://github.com/NGEET/fates/blob/main/main/FatesHistoryInterfaceMod.F90#L2615-L2635 would need to be reworked to replace all the p2p, s2s, and p2s stuff by a single variable with the new Does that make sense? |
Yep, that makes sense. Reviewing that loop I got to thinking that we could potentially add some logic to it to avoid accumulating the disturbance rate for |
Right, there could be logic but it shouldn't be needed. It might make sense to put in a failure if the donor loop index is not primary, the receiver loop index is primary, and the area disturbed in that part of the loop sequence is nonzero. |
We've got a set of code now with e25e4a8 and NGEET/fates@fb7b4eb that will build in fates default mode. |
OK, I think a couple things need to be done still before turning it on. First is that the current code will I think apply an annual change flux every day. So we need to either divide by 365 or do it only once a year (or put in a switch to allow the user to decide which of those to do). Another thing is I think we've lost some information in the site%disturbance rate variable that was feeding the history diagnostics, I can rework it slightly to give the right info unless you want to do that. Otherwise, it should be good to try I think? |
This came up as an aside in the ctsm meeting today when we were talking the clm-side BGC code updates Ryan was working on. Erik was explaining the ctsm "dribbler" concept for avoiding step function-like changes in the rates.
I can give this a crack tonight or tomorrow morning, unless you get to it first. |
I just added that change and pushed it to ckoven/fates@6c8f560 |
OK I made a couple other changes just now to (hopefully) help the readability of the looping logic a bit just now. Will stop messing with the code now until you can start testing it. |
@ckoven per our conversation, I tried generating some write statements to get the indices of the loop in |
no that should be the simplest configuration |
I wonder if it is because the arrays in aren't being allocated in dynFatesLandUseInit when use_luh isn't true? |
Good thought. I'll look into this. |
This issue I was seeing was a little misleading. I forgot I was to remove the temp code to force disturbance to be zero for a different issue ( I'm hitting an FPE issue now in the first fates history write, but I suspect that should be a straightforward fix. |
@ckoven Ok, the default mode is working now with commit NGEET/fates@b19cedf. An important note: commenting out the write blocks in the
I think I have an idea for why this is and I'm testing it now |
ok great, thanks. On the site where you are testing. Does the initial state vector sum to one? I suspect that once you turn on the land use change code it should crash if that is not the case. |
Thanks for the reminder, I haven't checked that. |
I'm running into some issues with the elm pio that I need to look into to get a better understanding of:
As a minor note, I didn't realize that the pio routines are fussy about variable case. UPDATE: This is likely due to me not running luh mode for the appropriate resolution. |
Running on
Note that I need to change the |
HI @glemieux just curious if there is any update or if it would be helpful to discuss anything today, thanks- |
@ckoven I think this has more to do with elm's expectation of file "structure" at a low-level, for lack of a better term. I.e. I think we need make the luh2 file more closely resemble whatever requirement are being set. I haven't had much time to dig into it this morning, but will be able to give this time this afternoon. |
ok thanks. do you know if the issue is the metadata (variable names and dimensions, etc) or something lower level (netcdf version, variable type, etc)? |
From looking at the code, i think this is metadata (dimensions specifically). |
Looking at the differences between PIO and SCORPIO, this assertion check is specific to SCORPIO. Looking at the PIO code in ctsm, I don't this we'd have an issue with the file metadata as laid out currently: The issue is cropping up upon trying to read in the first record variable ( The relevant commit that where this check was added in SCORPIO is E3SM-Project/scorpio@d0163d2, which was part of E3SM-Project/scorpio#113. I'm going to reach out to the author to get some guidance. |
The above issue has been resolved. This was due to me renaming I'm now running into the |
@ckoven the issue here appears to be due in part to missing calls to the interpolation prior to the patch initialization on the fates-side, which I was missing, so it was getting junk data for the states and rates (names were fine though). The other issue has to do with the loop in the landuse mod in fates here: The |
ok, great. yep that was just a mistake in my logic, sorry. feel free to do the mapping a different way, thanks. |
@ckoven, so I've fixed the initialization order of operations on the elm side to make sure that the My assumption here is that our regridding may be messing up the fractions such that they don't sum to one within the new grid cell? |
I think the first thing to do is divide by the regridded land area, and see if that fixes the summing-to-one problem. The NaNs is a tougher problem, I wonder what the lats and lons are of those gridcells? presumably it is because they are for land that ELM is running over but has no LUH2 data because ice or similar. |
re the NaN issue: e.g. I am noticing that luh2 (unsurprisingly) has no data for Antarctica, whereas ELM also runs at the perimeter of the continent. So I think the strategy should probably be to search for NaNs, and when found, set the primf (or maybe primn) state to be one, and all other states and all transitions to be zero. |
Roger that. Will do |
So basically, rerun the regridder but use |
thanks. but at least as an initial sanity check let's also add a write statement with the lat and lon of each grid cell where we do that, so we can make a map and confirm that that is what is going on. |
No, I mean to ingest the land fraction dataset and propagate that through the regridding, as we had discussed the other day |
So this would be the UPDATE: wait no, that'd be |
(1 - |
For future me, see: glemieux/fates#25 (comment) |
@ckoven do we want to provide a default dataset on the input data server so that users can have something to work with without having to provide it themselves? Currently I have the 1850-2015 f45 historical data listed as the default, but I also have the 0850-2015 on hand that I could upload. |
@glemieux yes I think adding the 1850-2015 f45 dataset as a default is right. |
…Dev/develop Previously, when the regional sea-level prediction capability was added to MALI (#21), the restart config option for the sea-level model was not added. This led the sea-level model to get initialized to Timestep zero when coupled MALI-SLM simulations are being restarted, forgetting about the ice loading changes and associated viscoelastic solid earth deformation that happened in the timesteps prior to current model time. This PR fixes the problem by allowing the sea-level model to resume where it was left off. Note in parallel to this PR, the version of the SLM needs to incorporate the changes made in the following accompanying PR (MALI-Dev/1DSeaLevelModel_FWTW#9) * hollyhan/add_restart_functionality_slm: Don't call SLM on init of a restart Add addl info on restart about the calculated time since last SLM call Allow restarts at any interval when using SLM Add missing error flag so model actually dies when error occurs Add missing arguments to log write statement Update restart check to also use time interval division Adjust check if adaptive dt is on or not Update checks using interval division Improve error handling, correct other usage of config_uplift_method Improve synchronization of timesteps between MALI and SLM Add restart option when the SLM is coupled to MALI
Per @ckoven, use the dynHarvestMod.F90 as a guideline for this module.
Tasks
The text was updated successfully, but these errors were encountered: