-
Notifications
You must be signed in to change notification settings - Fork 7
Feature/gauss grid #5
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
Changes from 14 commits
ab79082
9d4cc45
646c49a
1bca7a3
af1b4fd
30fa44e
03d788e
b6a6819
e4561ce
3578f93
acd9943
7a01a16
f81758f
4408d9e
e4a4f88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,20 @@ | ||
| This program is designed to convert individual variables between resolutions, for DA applications (specificially re-gridding for use in re-centering, and regridding increments). | ||
|
|
||
| Clara Draper, Aug 13, 2024. | ||
| Clara Draper, Aug 17, 2024. | ||
|
|
||
| * Uses bi-linear interpolation, with masking of the input and output. | ||
| * Only mask option right now is "soil" (no water, no land-ice). Could add others easily. | ||
| * Does not guarantee all output grid cells with have mapped values, by design. | ||
| * Current masking options are all soil (land, no glaciers) and snow-free soil (input increment only) | ||
| * Does not guarantee all output grid cells with have mapped values, by design. CANNOT BY USED FOR RESTARTS (could be changed though). | ||
| * Output grid cells that do not have a value after the interpolation step are filled with the nearest neighbouring output grid cell. If there are no mapped neighbours within two layers of surrounding neighbours, the output grid cell will remain unmapped. In this way, islands do not get filled with distant values. | ||
| * Currently, only reads in / writes out fv3 files (TO-DO, add Gaussian grid option for GSI increments). | ||
| * Reads in / writes out fv3 files and Gaussian grid (gsi output increment) files. | ||
| * Handling Gaussian files requires a scrip file with the grid details. This can be generated using the ufs_utils weigh_gen program. | ||
| * has separate namelist for input and output. Required options depend on the grid type and whether it's in/out. Look in readin_setup routine to check what is needed. | ||
| * example nml provided for input Gaussian increment -> fv3 grid. | ||
|
|
||
| FEATURES TO ADD: | ||
| * Can only process 2D variables (no vertical dimension; TO-DO fix this) | ||
| * Add time dimension to put all gsi increments in a single file (for reading in by IAU) | ||
| * Re-think parallelization so can do multiple ensemble members at once | ||
| * Add code to check required options are available for requested set-up grid | ||
|
|
||
| Options are controlled by the namelist: | ||
|
|
||
| dir_fix -> base directory for the orog files (one layer below C$RES dir) | ||
| res_atm_in -> atmos input resolution | ||
| res_atm_out -> atmos output resolution | ||
| fname_in -> start of the input restart file name (everything before ".tile?.nc" ) | ||
| dir_in -> directory where input restarts are | ||
| fname_out -> start of the output restart file name (everything before ".tile?.nc" ) | ||
| dir_out -> directory where output restarts will go | ||
| ! the next two are needed to read in veg_type for calculating the output mask | ||
| fname_out_rst -> start of file name for example restart at output res (everything before ".tile?.nc" ) | ||
| dir_out_rst -> directory where example restarts at output res are | ||
| variable_list(1) -> list of variables names to remap. Right-pad with spaces to length of 10 | ||
| variable_list(2) -> | ||
| n_vars -> number of variables to remap (current max. set to 10). | ||
| missing_value -> value used for grid cells that remain unmapped | ||
| mask_type -> only options for now are "none", and "soil" (no water, no land-ice). | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| &config | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. noting here to move this out of src/ "eventually" |
||
| n_vars=4, ! number of vars in list below | ||
| variable_list(1)="soilt1_inc ", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need the space in "soilt1_inc"
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do need it. Here's the gsi output
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think he means the trailing spaces, not the underscore?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes more sense! I believe we do need the fixed length for specifying a char array in a namelist, but will double check.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It worked! I changed it. |
||
| variable_list(2)="soilt2_inc ", | ||
| variable_list(3)="slc1_inc ", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Var list in one line might be better (personal preference to save space)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed - see above. |
||
| variable_list(4)="slc2_inc ", | ||
| missing_value=0., ! any un-filled grid cell takes this value. | ||
| ! use 0. for increments | ||
| / | ||
|
|
||
| ! required fields depend on gridtype, and whether input or output | ||
| &input | ||
| gridtype="gau_inc", ! "gau_inc" for GSI/Gaussian increment file | ||
| ires=192, | ||
| jres=96, | ||
| fname="enkfgdas.t12z.sfci003.ensmean.nc", | ||
| dir="./input/", | ||
| fname_coord="gaussian.192.96.nc", ! this is the scrip file generated by ufs_utils weight_gen | ||
| dir_coord="./input/" | ||
| / | ||
|
|
||
| &output | ||
| gridtype="fv3_rst", ! "fv3_rst" any native model grid file (increment or restart) | ||
| ires=48, | ||
| jres=48, | ||
| fname="inc2ens.sfc_data", | ||
| dir="./output/", | ||
| fname_mask="20211221.090000.sfc_data" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this template for mask? as in mask will be written in this file format? I am guessing it is not an actual output file?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the file that is read in to get the mask. I changed the code to use a fix file instead of a restart though - so I need to change the entry here too. I'll also add a block of comments explaining each variable.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed this file, and added comment block at the end of the example namelist. |
||
| dir_mask="./output_rst/", | ||
| dir_coord="./fixdir/", ! orog dir in fix | ||
| / | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.