Open AliceHarang opened 1 month ago
Hi Cyp, I have finish most of this branch.
Some little points where I would like to have your point of view:
Things to check:
I agree we should keep the outputtimestep =
mechanism for backward compatibility
I wonder if it is worth adding a compulsory initial output and endtime output? i.e. the user will specify touput= 50,3600,5000 bt that implies touput= 0,50,3600,5000,endtime
We need a sanity check step that the list is monotonically increasing.
time range is not working properly
I would have though it is easier to convert range to vector directly in the read input. While that may not be very efficient its a pretty low cost overall and easier to maintain in the future
SaveInitialisation2Netcdf()
was doing something that was already in Save2Netcdf()
so I removed it.Hi @CyprienBosserelle , I saw that you directly read in to create the vector by putting it in "val". Did you managed to keep the default "OutputTimeSteps" by doing this?
Not yet, thanks for the reminder. I also broke the test so I need to redo it. I was thinking of doing that in the Sanity check. Most of my changes are just to try to setup for using real dates. but the more I think about it the more difficult it seems...
I haven't thought it too much but if we keep the initial structure for the OutputT red but change it in string, we can see if there is a time reference and read them accordingly in the sanity check (as digit or date)?
I suppose all of this would be done in the sanity check after just reading basically the input in the readInput.
Happy to implement this if you this it can work!
Ok I shuffled a few things around and only had time to do minimal testing. But so far it works!
User can now use Toutput
for range or single value(s) as long as they are separated by a ,
. Multiple ranges can be given and a mix of single values and range.
Ranges are defined with pipe symbol |
While :
is commonly used to define ranges it wouldn't work for us. that is because we reserve:
for separating time with specifying a date and there would be no way to distinguish between date and range.
Toutput=5.5,0|2.2|4,3.0
Toutput=3600.0
means 1 hour after start time!
time can be given with a unit.
Toutput=5days,0|2.2s|4h,3.0min
supported units are: second= { "seconds","second","sec","s" }; as 1sec minute = { "minutes","minute","min","m" }; as 60sec hour = { "hours","hour","hrs","hr","h" }; as 3600sec day = { "days","day","d" }; as 243600sec month = { "months","month","mths", "mth", "mon" }; as 3600.0 24.0 30.4375 sec year = { "years","year","yrs", "yr", "y" }; as 3600.0 24.0 * 365.25
as unique dates or ranges:
Toutput=2020-01-01T00:00:00|2.2s|2020-01-01T00:00:04,2020-01-01T00:00:03
Note that range step can't be a date but instead need to be second or have a unit attached
This is link to the task: Add more fexibility in time of output (Projects for FY24/25)