-
Notifications
You must be signed in to change notification settings - Fork 145
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
Develop Aether lon-lat interface #559
Comments
@kdraeder is merging the code which reads and writes restart files from gitm into aether. I believe @johnsonbk will work on translating the interpolation code from the existing Aether C++ |
I've merged GITM routines into the aether_lon-lat model_mod, but need to update the model_mod header
My leaning is to implement the restart dimension names in the aether_to_dart and dart_to_aether code trees |
@johnsonbk @hkershaw-brown |
the aether_to_dart program is going to create N netcdf files (one per ensemble member) that filter will read. are there any fields that have the same name in the neutral and ion files? do they cover different parts of space? if not, it seems like it would be better to read in both the neutral and ion data blocks and create a single netcdf output file per ensemble member and have only a single domain. then filter only has to read one file per member instead of 2, the namelist input for reading fields can be simpler, and the interpolate code can be streamlined. |
Thanks for the quick response! There's no overlap of field names in the 2 files, so they can be combined in aether_to_dart. |
If the model itself used multiple netcdf files as input, then domains would help since each domain specification includes the input filename and filter would read them directly. But since these netcdf files are transient, you can structure them any way you want. Simpler seems better. You're right - the dart_to_aether program will need to know which netcdf variables go into which files, but that seems not too bad. You have to create the netcdf variable names in aether_to_dart since I'm assuming the block files don't have any metadata, so both parts of the packing and unpacking are under your control. |
The model does expect multiple restart files: {ions,neutrals}x #blocks x #members. The block files have units metadata, but no field names. |
@johnsonbk @nancycollins It looks like aether will need a custom read_model_time to get the time. Does DART have code to translate a time from a system with an arbitrary "time=0" |
The time_manager has an array of operators for times and the ability to do
different calendars. I think that you would be able to use time interval
subtraction to do what you need once you know the base dates. That question
should be addressed to Aaron if Ben doesn't know. Jeff
…On Fri, Oct 20, 2023 at 8:38 AM kdraeder ***@***.***> wrote:
@johnsonbk <https://github.com/johnsonbk> @nancycollins
<https://github.com/nancycollins>
Aether_to_dart needs the time of the restart files.
The time in the sample data files is 0, but there's a time.json file with
time 1458347400.0
That's apparently in seconds from some calendar start time.
The sample *output* time.json has the same time, and a date in the
filename of 20110320_000000.
So time = 0 seems to be in Sep. 1964. Does anyone recognize that date?
The closest thing I can think of is the start of the UNIX clock, but
that's Jan 1 1970.
It looks like aether will need a custom read_model_time to get the time.
Is there a "best" way to do that using fortran, other than reading it as a
text file?
Does DART have code to translate a time from a system with an arbitrary
"time=0"
to the gregorian calendar? I don't see that capability in advance_time.
The UNIX date command may be useful.
—
Reply to this email directly, view it on GitHub
<#559 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANDHUIVRA2W3N662A3GGO63YAKEERAVCNFSM6AAAAAA56IF2V6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSHA3DGMBSG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Re: multiple files
Sure, that makes sense. But if the model directly read and wrote multiple netcdf format files, then domains are a way filter can read data from more than one file to build the state. Since you have to make a translator program to stitch the blocks together, it isn't necessary to use multiple domains. You are going to read in the data once, and write it once. For domains, you would look at interpolate and get close and see if there is any advantage to having multiple domains. If not and if you have multiple domains, each call needs to look up which domain a variable is in before it can operate, and all calls need to pass around a domain number besides a variable name/number/offset. That argues against using them without a good cause. Re: time |
The base date is the hangup. And in planets.cpp: The difference between the 2 julian reference dates is 35.0 years, If assume a few things, I can line up this calendar with the gregorian, |
In the short term we only need to know the meaning of the times found in the time.json files |
@hkershaw-brown @nancycollins Then it seems that each member should be able to read all its restart files |
Do the aether files have multiple ensemble members in them? Do you have this already? Is so run ens_size of this program to go parallel. Or just do it in loop for now.
Not quite sure what you are getting at here, but |
There are separate restarts for each member, so running ens_size of aether_to_dart seems to be the best. Yes, filter handles the ensemble of filter_inputX files just fine. |
I'd recommend writing the serial version first. |
i think at this point i'd get the converter programs running and worry about optimizing i/o at a later time once you can run them and measure the performance. if it's a problem, things can be done with scripting changes once you have the running programs. it seems like getting the blocks into a netcdf file and getting variables from the netcdf file back into blocks is a good first goal. |
i don't think we've got any MPI-enabled converters in the system. you write a serial one, you run it serially N times to test and time it. if it takes a significant fraction of the run time, you change the batch scripting to run N copies of it, one for each ensemble member, in parallel. cheap 80-way parallelism without having to write an MPI program! :) |
Perfect! I didn't want to head off in the wrong direction. |
@nancycollins @hkershaw-brown Why is the double version chosen? If you think that the error message is not related to the procedure choice, Thanks. |
temp is r8 that is why nc_get_double_3d is being called DART/models/aether_lon-lat/model_mod.f90 Line 687 in 19a5b0a
DART/models/aether_lon-lat/model_mod.f90 Lines 727 to 728 in 19a5b0a
The Start+count error means this size of what you are reading does not match the variable you've given the read call |
Thanks for digging into it! My fortran is rather rusty. I changed temp to r4 and it still failed, so I explicitly set the index ranges, starts, etc.:
but it's still failing in the same way. |
I think that I found the problem. The Longitude array has 44 altitudes, |
I was wrong. There's something more subtle going wrong (or so obvious I can't see it).
Here are the relevant lines from the reading routine.
open_block_file seems to work:
|
if reversing the order of the dimensions works, then i only know this from previous horrible experiences with it. |
@nancycollins @mgharamti |
On second thought, it's more likely that the date stamp in the file name is off by 30 minutes. |
Since I'm reading in the data in (z,y,x) order, would it break any rules or efficiencies |
@nancycollins confirmed that I should not transpose the data; just read the block NetCDF file We also found that ncdump on Macs is broken; |
I'm confused by the selection of QTYs that can be associated My first problem is interpretting what the available QTY's represent. The Aether variable 'velocity_parallel_up\ (O+)' could potentially have these existing QTYs @johnsonbk I've attached the file issues_QTY.txt which gives more details. |
The existing aether_to_dart derives the names of the Aether restart files One alternative is, one member at a time, for the script (or user) to link the restart files |
Let's focus on getting the aether_to_dart dart_to_aether subroutines out of the model_mod. Once that is done we can sort out what the scripting. |
Here's the issues_QTYs.txt file mentioned in the comment ~2024-1-25. |
@hkershaw-brown |
@kdraeder you can go ahead and make the PR if you're ready. Best practice would be to update aether with the main branch, before you make the PR. But we can just do that in the PR. |
Use case
Collaboration with Aaron Ridley (U Mich) requires development of an interface to his newly developed Aether upper atmosphere model. The first interface will be to the logically rectangular lon-lat grid version.
Later we will develop an interface to the cubed-sphere version.
Describe your preferred solution
We plan to use the tiegcm model_mod as a template representing DART's best practices.
We'll import pieces from gitm, which very closely match the Aether lon-lat restart file structure.
Checkout the "aether" branch to contribute work or see its status.
There are also rst files describing parts of the model and interface, written by @johnsonbk,
which have not been committed yet.
Describe any alternatives you have considered
Developing a model_mod, etc., from scratch. That seems inefficient, given the existence of a gitm interface,
which is closely related to Aether, and the tiegcm interface, which is a recently updated interface
to another upper atmosphere model.
The text was updated successfully, but these errors were encountered: