-
Notifications
You must be signed in to change notification settings - Fork 28
Feature/improved file regrid #190
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
Feature/improved file regrid #190
Conversation
Add stretched grid attributes to the output of regrid_restart_file, and improve the command line argument handling of the script.
Hi @kilicomu , I've tried regridding files using your updated regrid_restart_file.py. I've tested regridding C24 to C90, C24 to C48, C24 to C120 with SF 4.0, C48 to C90 with SF 4.0, and all of them worked. I tried to run GCHP v14.0.2 with regridded C90 and C120 restart file. After consulting from @lizziel , there is likely a system error on my server that causes both simulations to hang, but restart files have been read in without errors before the hanging point. |
Has anyone tested it with lat-lon to cubed sphere? We want to retire CSGrid for the regridding of GEOS-Chem Classic restart files for use in GCHP. |
Also, no worries if not. I wouldn't let it to hold up fixing the regridding capability for stretched grid asap. |
@lizziel If it worked for lat-lon to gcs before, it should still do, but I will test today and let you know. |
@lizziel The script I have adapted didn't work for regridding lat-lon to gcs before, so it still doesn't. We can open an issue to get that implemented, but I'd like to get this merged in so that we can get on with the stretched grid in GCHP - hope that's ok! @Jourdan-He If you're happy with the changes to the script, we can merge them and I'll get on with the documentation. |
@kilicomu Sure, we can merge them |
…egrid Feature/improved file regrid
This PR contains a first go at reworking the
regrid_restart_file
GCPy module to correctly function with GCHP v14.Key changes are:
--stretched-grid
- whether or not we are regridding to a stretched-grid--stretch-factor
- the stretch factor of the target grid, which will be added to the global attributes of the output file asSTRETCH_FACTOR
--target-latitude
- the target latitude of the output stretched-grid, which will be added to the global attributes of the output file asTARGET_LAT
--target-longitude
- the target longitude of the output stretched-grid, which will be added to the global attributes of the output file asTARGET_LON
--stretched-grid
is detected, the program requires all three other stretched-grid options to be passedargparse
instead of directly readingsys.argv
I've re-tested the tool with the following regridding configurations:
and unless I've missed something (not unlikely - please check!), it looks ok and GCHP 14.0.2 will run fine with the results.
I don't think this is the final solution for regridding in GCPy, though. This still requires
gridspec-create
=>ESMF_RegridWeightGen
=>python -m gcpy.regrid_restart_file ...
as opposed to just using the GCPy module, which would be ideal. I think it is possible to wrap up thegridspec
andESMF_RegridWeightGen
stuff into the module so there is just a single task for users to complete, but I don't have time right now to properly look at it.Let me know what you think.