Unstructured grid files axis#1114
Conversation
| !TODO Passing in the axis_length because of a gnu issue where inside fms_diag_axis_init, the size of DATA | ||
| !was 2 which was causing the axis_data to not be written correctly... | ||
| diag_axis_init = fms_diag_object%fms_diag_axis_init(name, DATA, units, cart_name, long_name=long_name,& | ||
| & direction=direction, set_name=set_name, edges=edges, Domain=Domain, Domain2=Domain2, DomainU=DomainU, & | ||
| & aux=aux, req=req, tile_count=tile_count, domain_position=domain_position ) | ||
| & aux=aux, req=req, tile_count=tile_count, domain_position=domain_position, axis_length=size(DATA(:)) ) |
There was a problem hiding this comment.
@rem1776 @thomas-robinson FYI i saw this with gnu 9.3. Let me know if you have a better fix for this.
If I were to print the size(DATA(:)) here it gave me the correct answers, but inside fms_diag_axis_init it was equal to 2
There was a problem hiding this comment.
We discussed this, and it sounded good when we discussed it.
| !TODO Passing in the axis_length because of a gnu issue where inside fms_diag_axis_init, the size of DATA | ||
| !was 2 which was causing the axis_data to not be written correctly... | ||
| diag_axis_init = fms_diag_object%fms_diag_axis_init(name, DATA, units, cart_name, long_name=long_name,& | ||
| & direction=direction, set_name=set_name, edges=edges, Domain=Domain, Domain2=Domain2, DomainU=DomainU, & | ||
| & aux=aux, req=req, tile_count=tile_count, domain_position=domain_position ) | ||
| & aux=aux, req=req, tile_count=tile_count, domain_position=domain_position, axis_length=size(DATA(:)) ) |
There was a problem hiding this comment.
We discussed this, and it sounded good when we discussed it.
| !TODO Passing in the axis_length because of a gnu issue where inside fms_diag_axis_init, the size of DATA | ||
| !was 2 which was causing the axis_data to not be written correctly... |
There was a problem hiding this comment.
If this is a bug with a SPECIFIC gnu version, do we need to fix it or can we just say it's not compatible with that version? Is this a C5, CI, or dev box compiler?
There was a problem hiding this comment.
The version of gnu is what we used in the CI
I can also reproduce in the dev box.
| TYPE(fmsDiagAttribute_type),allocatable , private :: attributes(:) !< Array to hold user definable attributes | ||
| INTEGER , private :: num_attributes !< Number of defined attibutes | ||
| INTEGER , private :: domain_position !< The position in the doman (NORTH, EAST or CENTER) | ||
| integer , private :: structured_ids(2) !< If the axis is in the unstructured grid, |
There was a problem hiding this comment.
these are the mappings from unstructured to structured, correct?
There was a problem hiding this comment.
these are not mappings, they are the axis IDs of the original structured axis
| allocate(real(kind=r4_kind) :: this%axis_data(size(axis_data))) | ||
| allocate(real(kind=r4_kind) :: this%axis_data(axis_length)) | ||
| this%axis_data = axis_data | ||
| this%length = axis_length |
There was a problem hiding this comment.
This is optional. What happens if it's not included?
There was a problem hiding this comment.
Changed it to a required argument fms_diag_axis_init is only used locally here:
FMS/diag_manager/diag_axis.F90
Lines 143 to 145 in cf55696
|
|
||
| this%nsubaxis = 0 | ||
| this%num_attributes = 0 | ||
| this%structured_ids = diag_null |
There was a problem hiding this comment.
Can this be allocatable instead of used for every axis? Or should we make a new type that extends the fmsDiagFullAxis_type
There was a problem hiding this comment.
Changed this to allocatables
|
|
||
| select type (this) | ||
| type is (fmsDiagFullAxis_type) | ||
| this%structured_ids = axis_ids |
There was a problem hiding this comment.
this%structured_ids should be allocated here and then set to axis_ids.
| class(*), intent(in) :: compress_att(:) !< The compress attribute to parse | ||
| character(len=120) :: axis_names(2) | ||
|
|
||
| integer :: ios !< Errorcode after parsting the compress attribute |
There was a problem hiding this comment.
should say "after parsing"
| integer :: i,k !< For do loops | ||
| integer :: j !< diag_file%axis_ids(i) (for less typing) |
There was a problem hiding this comment.
switched this to a pointer
axis_ptr => diag_axis(diag_file%axis_ids(i))… structured_axis to allocatables
| !> @return Axis id | ||
| FUNCTION fms_diag_axis_init(this, axis_name, axis_data, units, cart_name, long_name, direction,& | ||
| & set_name, edges, Domain, Domain2, DomainU, aux, req, tile_count, domain_position, axis_length ) & | ||
| FUNCTION fms_diag_axis_init(this, axis_name, axis_data, units, cart_name, axis_length, long_name, direction,& |
There was a problem hiding this comment.
Why change the interface?
There was a problem hiding this comment.
This is now a required arugment, so the interface changed.
* adds the compress attribute and axis data to the netcdf file * Fix some typos, change axis_length to a required argument, change the structured_axis to allocatables
* adds the compress attribute and axis data to the netcdf file * Fix some typos, change axis_length to a required argument, change the structured_axis to allocatables
Description
This is an update for the unstructured grid files.
Axis that are in the "unstructured" domain require a "compress" attribute for the combiner and PP. This attribute is passed in via a diag_axis_add_attribute call in the model code. The compress attribute indicates the names of the axis that were compressed for example grid_index:compress = "grid_yt grid_xt".
This PR:
Fixes # (issue)
How Has This Been Tested?
CI
Checklist:
make distcheckpasses