Ignore:
Timestamp:
11/02/15 11:46:25 (8 years ago)
Author:
mhnguyen
Message:

Implementing the reading of attributes of an axis from a file

+) 3d grid can be read directly from a file
+) Clean some redundant codes
+) Add new attribute declaration that allows to output only desired attributes

Test
+) On Curie
+) test_remap passes and result is correct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/test/test_remap.f90

    r742 r775  
    2020  DOUBLE PRECISION,ALLOCATABLE :: src_boundslon(:,:), dst_boundslon(:,:) 
    2121  DOUBLE PRECISION,ALLOCATABLE :: src_boundslat(:,:), dst_boundslat(:,:) 
    22   DOUBLE PRECISION,ALLOCATABLE :: src_field(:), tmp_field(:) 
     22  DOUBLE PRECISION,ALLOCATABLE :: src_field(:), tmp_field(:), tmp_field_1(:) 
    2323  INTEGER :: src_ni_glo, dst_ni_glo; 
    2424  INTEGER :: src_nvertex, dst_nvertex; 
    2525  INTEGER :: src_ibegin, dst_ibegin; 
    2626  INTEGER :: src_ni, dst_ni; 
     27  INTEGER :: src_tmp_ni, src_tmp_nj, src_tmp_n; 
    2728  CHARACTER(LEN=*),PARAMETER :: src_file="h14.nc" 
    2829  CHARACTER(LEN=*),PARAMETER :: dst_file="r180x90.nc" 
     
    119120                            bounds_lon_1D=dst_boundslon, bounds_lat_1D=dst_boundslat, nvertex=dst_nvertex) 
    120121 
    121   ALLOCATE(tmp_field(180*90/2)) 
     122 
    122123  dtime%second = 3600 
    123124  CALL xios_set_timestep(dtime) 
    124125 
    125126  CALL xios_close_context_definition() 
     127  CALL xios_get_domain_attr("src_domain_regular_tmp", ni=src_tmp_ni, nj=src_tmp_nj) 
     128  ALLOCATE(tmp_field(src_tmp_ni*src_tmp_nj)) 
     129 
     130  CALL xios_get_axis_attr("src_axis_curvilinear", n=src_tmp_n) 
     131  CALL xios_get_domain_attr("src_domain_curvilinear", ni=src_tmp_ni, nj=src_tmp_nj) 
     132  ALLOCATE(tmp_field_1(src_tmp_ni*src_tmp_nj*src_tmp_n)) 
    126133 
    127134  DO ts=1,1 
    128     CALL xios_recv_field("src_field_regular", tmp_field) 
     135    CALL xios_recv_field("src_field_regular_tmp", tmp_field) 
     136    CALL xios_recv_field("src_field_curvilinear", tmp_field_1) 
    129137    CALL xios_update_calendar(ts) 
    130138    CALL xios_send_field("src_field",src_field) 
    131139    CALL xios_send_field("tmp_field",tmp_field) 
     140    CALL xios_send_field("tmp_field_1",tmp_field_1) 
    132141    CALL wait_us(5000) ; 
    133142  ENDDO 
Note: See TracChangeset for help on using the changeset viewer.