-
Notifications
You must be signed in to change notification settings - Fork 7
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
support additive forcing perturbations #30
Comments
@aekiss @aidanheerdegen I am resurrecting this issue as there are a few experiments that various people would like to run that would be made significantly easier with such an addition. As an example, Qian is going to be running an experiment with a linearly increasing air temperature modelled on CMIP6 projections, added to the RYF9091 JRA55 forcing. I.e. she would like: Tair(x,y,z,t) = TairRYF(x,y,z,t) + Tair_CMIP_pattern(x,y) * Tair_CMIP_timeseries(t) where TairRYF is the RYF9091 field, Tair_CMIP_pattern(x,y) is a spatial pattern of anomalies and Tair_CMIP_timeseries(t) is a time series of the amplitude of that pattern (a linear function in Qian's case). Such an anomaly is difficult to do in the current system as it requires making a separate copy of the JRA55 Tair files for every year of the simulation. If you're doing a 100-year experiment, then you either have to create 100 copies of the JRA55 data (and they are big files) or you have to manually change the files every year. I also have some ideas for experiments using simple time-dependent, spatially-independent (Tair_CMIP_pattern = 1) forcing field anomalies that would benefit from a similar approach. So I wanted to start a discussion on this. I see two possible (high-level) approaches to make this easier:
Both of these approaches have issues. I am more attracted to no. 2 above because I think it is more general (e.g. it permits more complicated changes, such as keeping the relative humidity constant as the temperature anomalies are applied). I would be interested in everyone's thoughts. |
Hi @rmholmes - sorry we didn't get a chance to discuss this in today's MOM meeting. I think option 2 is a nice idea, as it's more flexible and more able to be deployed for a wider array of uses. I guess the key issue is whether payu can get enough information out of the run to supply the script making the forcing files. If the information required was only time (i.e. other functions of x,y were hardwired into the script) then I think we could probably do this. The key is that, with a small addition to payu, we could do just about anything. @aidanheerdegen - I guess we are relying on you here to have a think and let us know if a payu addition is feasible for this. If yes, maybe a quick online discussion on Monday could be in order? |
I think a zoom chat about this would be a good idea, perhaps after @aidanheerdegen has had a chance to think about what might be possible. One more potential spannar in the works here that is worth considering: After chatting with Qian and Matt yesterday I think Qian's experiment would also benefit from maintaining the atmospheric relative humidity constant as the air temperature anomalies are applied. This is a bit more difficult to fit into the framework as the specific humidity perturbation is then an (x,y,t) perturbation that is not obviously separable into (x,y) and (t). I would want to do the same for the other experiment/s I have in mind. However, perhaps a completely different way to get around this problem was if we could feed access-om2 relative humidity rather than specific humidity as an input field? |
@nichannah has assigned himself to this, so I wouldn't suggest spending any time on this until he can let us know the progress on this. He might already have a solution, or perhaps some well thought through plans for implementation. Nic? |
I think Nic assigned himself this 18 months ago, then completed the work and the issue was closed -- Ryan then reopened it with his new ideas... But I am of course happy if Nic wants to take this one on? |
Oh right, my misunderstanding. Soz. There are no tagged PRs or commits which would make it easier to track related changes to see what has already been done and how new functionality might be incorporated. |
Yes, I'm happy to do it at the libaccessom2 level if that is easier that via Payu. Presently we have the ability to do scaling by either a file with a time dimension or a single constant. In the simplest case we could replicate this but use addition instead of multiplication - using a syntax like @aekiss proposed above. Would that be suitable? On the other hand it might be worth thinking about something more general such as a function of the forcing variables from two files. e.g
This could help: https://github.com/jacobwilliams/fortran_function_parser |
Thanks @nichannah. So just to confirm - when you say "scaling by either a file with a time dimension or a single constant" - I think you mean that the scaling file (currently multiplicative - but easy to implement additive) is a single file that contains both spatial and temporal information? Is it possible to separate the spatial and temporal scaling information? This would really help with applying the perturbations that we commonly want that have a fixed spatial pattern (possibly even spatially-constant) but a long-term temporal variation (e.g. a linear trend in Qian's case, or a sinusoidal oscillation with an interannual to decadal period, as I would like to implement). Ideally we want this temporal variation to be smooth across each JRA55 input time step - meaning that to do it properly without a system such as we are discussing here requires copying the JRA55 forcing files at full temporal resolution for the whole time period of the simulation (50+ years in Qian's case). If such were possible then it would cover the cases I am thinking of, with the below significant caveat. The caveat - relative humidity: In both Qian and my experiments it would be best to keep the relative humidity constant while the air temperature is changed. To do this while specific humidity is the input field requires changing the specific humidity through a complicated function of unperturbed and perturbed air temperature, unperturbed specific humidity and air pressure (see this script that Claire put together). This caveat could be easily solved if we could change the coupling system to allow relative humidity as an input field rather than specific humidity. E.g. in
with
where rair is the relative humidity calculated just once from the other JRA55 forcing fields. Is this possible? |
I've had a bit more of a think about using relative humidity as a forcing field. Since this is about physics I'm now of the opinion that it should be treated in CICE and can be easily done in the subroutine if(do_rh2q) then where rh2q is a simple elemental function. I think I'd put it in How's that sound? |
That sounds pretty good to me @russfiedler. However, I can't say that I know much about CICE. We would then just need to create new RYF input files that contained relative humidity (rhair0) rather than specific humidity, do the substitutions in I would have expected that a relative - specific humidity conversion would already occur somewhere in the code. Again, I know little about CICE but I did find that in I can volunteer to do some testing in ACCESS-OM2-1 once these changes are made. |
@rmholmes We're using the gfdl form for fluxes so I'd use probably use the lookup tables for the saturated vapor pressure in |
@rmholmes - Nic was referring to this: #31 - ie support for spatially uniform and temporally constant scalings specified by a @nichannah Here's a straw-man: If we are happy to support just scaling and offsets of any input field
where the 4 scaling and offset entries are all optional. If present, they would all contain a field matching
Similarly If scaling and offset files are both present, they are both applied as in the formula. Would that cover all the use cases we can think of? (other then the humidity issue, which it looks like we can deal with via a code change in CICE) @nichannah does this seem straightforward to implement? @russfiedler this proposal would make |
Also, where time axes are present, the scalings/offsets would only be applied at times covered by those axes (which is how it works currently, allowing a brief perturbation to damp down an individual storm). |
Further possible extensions (probably over the top):
|
Following a discussion on Tuesday, here's an updated straw-man proposal replacing the above. It's long and detailed because I've tried to be explicit about the semantics and corner cases, which in most cases is simply spelling out what you'd expect. Apologies for the boring read! It's unclear to me how much work would be needed to implement something like this, but if we decide to implement only a subset it would be good to bear this bigger picture in mind to allow for a possibility such as this in the future. ObjectiveTo support the scaling and offsetting of any input field
and allow efficient representation when scaling and/or offset have:
where the temporal variation may be either
Notation
Semantics
Comments
|
Thanks @aekiss for the comprehensive plan. It looks good to me, and I like the proposed dictionary format for One question on point 6 of semantics: What do you mean in the |
Good catch @rmholmes, that also occurred to me after posting. I agree it would be much better to have it on the forcing timestep in the |
ok how does that look now @rmholmes ? |
Thanks @aekiss - looks good. Is there any chance that leap years/days will cause problems with |
Hmm, good question @rmholmes. As I understand it, the forcing and experiment calendars How do leap years work for your repeat-decades Ryan? @nichannah if you can clarify or correct me, please do! |
@aekiss Our repeat decade forcing (RDF) is 1962-1971. Both 1964 and 1968 are leap years. |
Thanks @mauricehuguenin. I suspect the RDF experiment time is like the RYF one - the leap years appear when they appear in the forcing (1964 and 1968), regardless of the experiment year. When you run the IAF off the end I think you do it like an ensemble OMIP experiment with a fresh restart. |
Yes, that is what I do Ryan. I reset the experiment date back to 1972 when I branch off my IAF run over 1972-2017 from the control. I just checked in |
So does it look like this? If so, it's not a Gregorian calendar... forcing 62 63 64 65 66 67 68 69 70 71 62 63 64 65 66 67 68 69 70 71 bold are correct leap years |
How would I be able to check this? The |
|
Thanks, unfortunately the
followed by
So the experiment calendar has correct leap years. During these days, the forcing for the 28th of February is applied twice. |
Yes, that should work. However I think I'd like to change it so that the comment is necessary. The reason for this is that I think it's good to be able to detect typos. |
Is there anyway to specify that the time dimension on the perturbation can be
That way if users have a 10 year cycle of forcing they don't have to create a file with the same data repeating, and don't have to know how long the run has to be a priori. |
ping @nichannah @aekiss |
This was originally a feature for the mighty Ferret. The time unit was assumed to be a year. So setting In netCDF files, the modulo attribute is specified as follows:
|
Hi @nichannah, I have come across a potential bug when using the "perturbations" feature in forcing.json files. I have run an experiment where using the "perturbations" feature I perform a constant in space and time perturbation to the rlds field by 8 (integer) and the tas field by 1.5 (float). The results were surprising, in particular in the evolution of global average temperature. To investigate, I performed the equivalent experiment where I manually added the equivalent perturbations to the tas and rlds nc files, and there was indeed a difference. When using "perturbations", the warming is less than when I manually perturbed the forcing files, even though they should be exactly the same. Interestingly, I have also run experiments with the equivalent doubling (16 to rlds and 8 to tas), using both "perturbations" and manually perturbed forcing files, and the average temperature evolution was the same for both (i.e., "perturbations" and manually perturbed forcing files gave the same results). Might this divergence be due to some unwanted rounding of the '1.5' float value? What do you think? The runs (i.e. 8 to rlds and 1.5 to tas) can be found at |
Just to add to Matt's comment here, I performed simulations with the same config files but from cold starts (rather than starting from a spun-up control simulation) and found the same differences. Those runs are at Just to check whether there is some rounding issue going on, I'm currently running an additional run with 1.5 changed to 1 to see if it makes a difference. |
Yes this must be some rounding/type error. I get exactly the same simulation result whether I use @nichannah can you track this down? |
I haven't yet had time to update all of the experiments, however I've pushed the fixes to YATM and tested. You can find the new executable here: /g/data/ik11/inputs/access-om2/bin/yatm_a28ed21.exe |
Great! Thanks @nichannah. |
Hi all,
The goal is to add a time-varying perturbation to the RYF fields that consists of the N34(t) index multiplied with a constant spatial pattern uas(x,y). To include the new input files I have added
to the
Unfortunately the run exits with the error warning: |
Storage flags added to qsub_flags are ignored. payu automatically determines the required storage flags by examining paths in the manifests. Just run
to populate the manifests, then |
Thank you Aidan. It looks like an attribute is missing in one of the input files because the model aborts with:
My perturbation time series @nichannah Do you still have the .nc files you used in #30 (comment)? That could help me find the specific structure the input files need to have. |
@mauricehuguenin I successfully got a temporally-constant, spatially-varying perturbation working at |
@mauricehuguenin I believe the netCDF library is complaining because your variable has a If you include a |
I found the issue that caused the model to crash: at some point during my troubleshooting I copied over an My multi-year simulation with #30 (comment) has now been successful (although I have not yet looked at the output). |
Hi all, it has been a while since my last comment. I was focusing on a different project. My goal is to run a multi-year simulation with a ramp up (year 1) and ramp down (year 2) of spatially constant and time varying anomalies. In
When using When using I run my simulation out of |
@mauricehuguenin before continuing and just to make sure; have you first checked that your files work with
|
Branching off from #25 as a separate issue.
Implement this via a new
offset_filename
key, so that we can have both additive and multiplicative perturbations to any forcing field, which would be a useful extension to our current scaling-only perturbation capability discussed in the wiki.An example
forcing.json
entry:The text was updated successfully, but these errors were encountered: