Ignore:
Timestamp:
03/22/18 10:43:20 (4 years ago)
Author:
yushan
Message:

branch_openmp merged with XIOS_DEV_CMIP6@1459

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/test/test_client.f90

    r1328 r1460  
    2020  INTEGER,PARAMETER :: nj_glo=100 
    2121  INTEGER,PARAMETER :: llm=5 
    22   DOUBLE PRECISION  :: lval(llm)=1 
     22  DOUBLE PRECISION  :: lval(llm)=1, scalar = 5 
    2323  TYPE(xios_field) :: field_hdl 
    2424  TYPE(xios_fieldgroup) :: fieldgroup_hdl 
     
    2828  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo 
    2929  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm) 
    30   DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:) ; 
     30  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:), axisValue(:), field_domain(:,:) ; 
    3131  INTEGER :: ni,ibegin,iend,nj,jbegin,jend 
    3232  INTEGER :: i,j,l,ts,n 
     
    5050      lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo 
    5151      DO l=1,llm 
    52         field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l 
     52        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo*100+10000*l 
    5353      ENDDO 
    5454    ENDDO 
     
    6666  iend=ibegin+ni-1 ; jend=jbegin+nj-1 
    6767 
    68   ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj)) 
     68  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj), axisValue(nj_glo), field_domain(0:ni+1,-1:nj+2)) 
    6969  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
    7070  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
    7171  field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 
     72  field_domain(1:ni,1:nj) = field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,1) 
     73  axisValue(1:nj_glo)=field_A_glo(1,1:nj_glo,1); 
    7274 
    7375  CALL xios_context_initialize("test",comm) 
     
    7880  PRINT *, "calendar_type = ", calendar_type 
    7981 
     82  ! CALL xios_set_axis_attr("axis_A",n_glo=nj_glo ,value=axisValue, n=nj, begin=jbegin) ; 
    8083  CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; 
    8184  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear') 
     
    8487  CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 
    8588 
    86   CALL xios_get_handle("field_definition",fieldgroup_hdl) 
    87   CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
    88   CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
     89  !CALL xios_get_handle("field_definition",fieldgroup_hdl) 
     90  !CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 
     91  !CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 
    8992 
    90   CALL xios_get_handle("output",file_hdl) 
    91   CALL xios_add_child(file_hdl,field_hdl) 
    92   CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
     93  !CALL xios_get_handle("output",file_hdl) 
     94  !CALL xios_add_child(file_hdl,field_hdl) 
     95  !CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 
    9396 
    9497  dtime%second = 3600 
     
    128131 
    129132  PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
    130   DO ts=1,24*10 
     133  ! CALL xios_recv_field("field", scalar) 
     134  DO ts=1,4 
    131135    CALL xios_update_calendar(ts) 
    132136    CALL xios_send_field("field_A",field_A) 
     137    CALL xios_send_field("field_Axis",axisValue) 
     138    ! CALL xios_send_field("field_Axis",lval) 
     139    CALL xios_send_field("field_Domain",field_domain) 
     140    CALL xios_send_field("field_Scalar",scalar) 
    133141    CALL wait_us(5000) ; 
    134142  ENDDO 
Note: See TracChangeset for help on using the changeset viewer.