Update HAFS RTs to use the new multi output grid capability#19
Conversation
…tput_grids branch.
… grid component to write out both parent and nested grids.
…@DusanJovic-NOAA's review suggestions.
| dx: @[DX] # grid cell size in x/y direction (meters) | ||
| dy: @[DY] # needed for lambert_conformal | ||
|
|
||
| <output_grid_02> |
There was a problem hiding this comment.
For the hafs test with single domain output, will this section still show up? Can we remove this section using hafs run script if these output grids are not needed?
There was a problem hiding this comment.
If you think about fv3_conf/hafs_fv3_run.IN, this script doesn't now how many nests are configured. And by the time this script is executed module_configure is already created in the rundir.
There was a problem hiding this comment.
@junwang-noaa and @DusanJovic-NOAA, this is one of the reasons I suggested using the column configuration method. We do not need to add these extra <output_grid_xx> sections. And if default values are the concern, we can just use empty as default values, for example:
output_grid: 'global_latlon', 'regional_latlon', 'rotated_latlon', 'rotated_latlon', 'rotated_latlon'
imo: 360, , , ,
jmo: 181, , , ,
cen_lon: , -175.00, -86.00, -86.00, -86.00
cen_lat: , 0.00, 23.00, 23.00, 23.00
lon1: , -220.00, -45.00, -45.00, -35.00
lat1: , -45.00, -45.00, -45.00, -30.00
lon2: , -130.00, 45.00, 45.00, 35.00
lat2: , 45.00, 45.00, 45.00, 30.00
dlon: , 0.25, 0.25, 0.10, 0.05
dlat: , 0.25, 0.25, 0.10, 0.05
I personally think this will give us a much cleaner model_configure template/file. Thanks!
There was a problem hiding this comment.
@junwang-noaa and @DusanJovic-NOAA, this is one of the reasons I suggested using the column configuration method. We do not need to add these extra <output_grid_xx> sections. And if default values are the concern, we can just use empty as default values, for example:
output_grid: 'global_latlon', 'regional_latlon', 'rotated_latlon', 'rotated_latlon', 'rotated_latlon' imo: 360, , , , jmo: 181, , , , cen_lon: , -175.00, -86.00, -86.00, -86.00 cen_lat: , 0.00, 23.00, 23.00, 23.00 lon1: , -220.00, -45.00, -45.00, -35.00 lat1: , -45.00, -45.00, -45.00, -30.00 lon2: , -130.00, 45.00, 45.00, 35.00 lat2: , 45.00, 45.00, 45.00, 30.00 dlon: , 0.25, 0.25, 0.10, 0.05 dlat: , 0.25, 0.25, 0.10, 0.05I personally think this will give us a much cleaner model_configure template/file. Thanks!
Are you sure this table, with 'empty values', will properly parse using ESMF config parser? Shouldn't all values at a given row be the same type i.e. float?
There was a problem hiding this comment.
I am not very sure. I recall ESMF_config can treat every line as string, then one can parse it into variables (string, integer, float, etc.). But, @theurich probably know this better.
There was a problem hiding this comment.
You can certainly read in every line as a string. Of course, parsing this string, and tokenizing it then becomes your an application level responsibility.
If on the other hand you have as many elements in each line as there are columns, then you can use ESMF_Config API to read in each value. But that is where you would need dummies.
|
I am thinking of adding a section (function) to handle grids in the
rt_fv3.sh. E.g. if configuration variable output_grid_xx is not set, then
remove that section in the model_configure.
On Tue, Feb 8, 2022 at 11:32 AM Dusan Jovic ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tests/parm/model_configure_hafs_shared.IN
<#19 (comment)>
:
> +cen_lon: @[CEN_LON] # central longitude/latitude (degrees)
+cen_lat: @[CEN_LAT] # needed for rotated_latlon, lambert_conformal
+lon1: @[LON1] # longitude/latitude of lower-left corner
+lat1: @[LAT1] # needed for regional_latlon, rotated_latlon, lambert_conformal
+lon2: @[LON2] # longitude/latitude of upper-right corner
+lat2: @[LAT2] # needed for regional_latlon, rotated_latlon
+dlon: @[DLON] # grid spacing in longitude/latitude direction (degrees)
+dlat: @[DLAT] # needed for regional_latlon, rotated_latlon
+stdlat1: @[STDLAT1] # latitude of first/second standard parallel (degrees)
+stdlat2: @[STDLAT2] # needed for lambert_conformal
+nx: @[NX] # number of grid cells along x/y-axis
+ny: @[NY] # needed for lambert_conformal
+dx: @[DX] # grid cell size in x/y direction (meters)
+dy: @[DY] # needed for lambert_conformal
+
+<output_grid_02>
If you think about fv3_conf/hafs_fv3_run.IN, this script doesn't now how
many nests are configured. And by the time this script is executed
module_configure is already created in the rundir.
—
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI7D6TM34MYBAIMJEMPRD5TU2FARZANCNFSM5N2PBCYA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
How would you do that? And is it worth complicating the script to remove parts of the configure file that are not going to be read in anyway. In my opinion the much cleaner solution is to not have them in the model_configure in the first place. That means instead of having a template with 6 sections, have a script that will append just needed sections. But that will complicate scripting in a different way, which I'm also not sure is worth doing.
|
|
@junwang-noaa and @DusanJovic-NOAA, I added a few lines in run_test.sh to remove those unneeded the <output_grid_xx> sections from model_configure. For example, It's not an elegant solution, but it at least works fine. Thanks! |
Thanks. Unnecessary complication that's not really necessary. But since it's been already added, let's leave it. This entire section is very repetitive, difficult to maintain, and error prone. |
| lnbeg=$(grep -i -n "<output_grid_04>" model_configure | cut -d: -f1) | ||
| lnend=$(grep -i -n "</output_grid_04>" model_configure | cut -d: -f1) | ||
| [[ ! -z "$lnbeg" ]] && [[ ! -z "$lnend" ]] && sed -i -e "${lnbeg},${lnend}d" model_configure |
There was a problem hiding this comment.
Can these three lines be replaced by something like:
sed -i -e "/<output_grid_04>/,/<\/output_grid_04>/d" model_configure
There was a problem hiding this comment.
@DusanJovic-NOAA, I think your solution is simpler and better. Since the PR is already merged, please commit your change directly into your branch. Thanks a lot!
Update/unify existing HAFS RTs to use the new capability of the write grid component to write out both parent and nested grids.