Changeset 557 for XIOS


Ignore:
Timestamp:
02/12/15 12:06:01 (10 years ago)
Author:
mhnguyen
Message:

Fixing a bug on calculating global index of band distribution

+) Correct size of vector to number of server
+) Update code for test_new_features.f90

Test
+) On Curie.
+) Test cases: - Seperate Mode. Number of client: 6 - Number of server : 2

  • Attached Mode Number of client: 8

+) All test passed and results are correct.

Location:
XIOS/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/server_distribution_description.cpp

    r553 r557  
    9999{ 
    100100  int dim = nGlobal_.size(); 
    101   indexBegin_.resize(dim); 
    102   dimensionSizes_.resize(dim); 
     101  indexBegin_.resize(nServer); 
     102  dimensionSizes_.resize(nServer); 
    103103 
    104104  for (int i = 0; i< nServer; ++i) 
    105105  { 
    106     indexBegin_[i].resize(nServer); 
    107     dimensionSizes_[i].resize(nServer); 
     106    indexBegin_[i].resize(dim); 
     107    dimensionSizes_[i].resize(dim); 
    108108  } 
    109109 
  • XIOS/trunk/src/test/test_new_features.f90

    r553 r557  
    1111  CHARACTER(len=*),PARAMETER :: id="client" 
    1212  INTEGER :: comm 
    13   TYPE(xios_duration)      :: dtime 
     13  TYPE(xios_duration) :: dtime 
     14  TYPE(xios_date) :: date 
     15  CHARACTER(len=15) :: calendar_type 
    1416  TYPE(xios_context) :: ctx_hdl 
    15   INTEGER,PARAMETER :: ni_glo=5 
    16   INTEGER,PARAMETER :: nj_glo=5 
     17  INTEGER,PARAMETER :: ni_glo=100 
     18  INTEGER,PARAMETER :: nj_glo=100 
    1719  INTEGER,PARAMETER :: llm=5 
    1820  DOUBLE PRECISION  :: lval(llm)=1 
    19   DOUBLE PRECISION  :: lval2(llm)=1 
    2021  TYPE(xios_field) :: field_hdl 
    2122  TYPE(xios_fieldgroup) :: fieldgroup_hdl 
     
    2425 
    2526  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo 
    26 !  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm,llm) 
    27 !  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:,:), lonvalue(:) ; 
    2827  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm) 
    2928  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:) ; 
    3029  INTEGER :: ni,ibegin,iend,nj,jbegin,jend 
    31   INTEGER :: i,j,l,ts,n,k 
     30  INTEGER :: i,j,l,ts,n 
    3231 
    3332!!! MPI Initialization 
     
    4948      lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo 
    5049      DO l=1,llm 
    51 !        DO k=1,llm 
    52 !          field_A_glo(i,j,l,k)=(i-1)+(j-1)*ni_glo+10000*l+100000*k 
    53 !        ENDDO 
    5450        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l 
    5551      ENDDO 
     
    6965 
    7066  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni*nj)) 
    71 ! ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm,llm),lonvalue(ni*nj)) 
    7267  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
    7368  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 
     
    7873  CALL xios_set_current_context(ctx_hdl) 
    7974 
    80 ! CALL xios_define_calendar(type="Gregorian") 
     75  CALL xios_get_calendar_type(calendar_type) 
     76  PRINT *, "calendar_type = ", calendar_type 
     77 
    8178  CALL xios_set_axis_attr("axis_A",size=llm ,value=lval) ; 
    82 ! CALL xios_set_axis_attr("axis_B",size=llm ,value=lval2) ; 
    8379  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj) 
    8480  CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 
     
    9490  CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_C") 
    9591 
     92  dtime%second = 3600 
     93  CALL xios_set_timestep(dtime) 
    9694 
    97     dtime%second=3600 
    98 !   CALL xios_set_timestep(timestep=dtime) 
     95  ! The calendar is created as soon as the calendar type is defined. This way 
     96  ! calendar operations can be used before the context definition is closed 
     97  CALL xios_get_time_origin(date) 
     98  PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 
     99  PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 
     100  PRINT *, "time_origin = ", date 
     101  PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 
     102  PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 
     103  PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 
     104  PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 
     105  PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 
     106  dtime%timestep = 1 
     107  dtime = 0.5 * dtime 
     108  PRINT *, "duration = ", dtime 
     109  date = date + 3 * (dtime + dtime) 
     110  PRINT *, "date = time_origin + 3 * (duration + duration) = ", date 
     111  PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 
     112  PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 
    99113 
    100     ni=0 ; lonvalue(:)=0 
    101     CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue=lonvalue) 
     114  ni=0 ; lonvalue(:)=0 
     115  CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue=lonvalue) 
    102116 
    103     print *,"ni",ni 
    104     print *,"lonvalue",lonvalue ; 
     117  print *,"ni",ni 
     118  print *,"lonvalue",lonvalue ; 
    105119 
    106     CALL xios_is_defined_field_attr("field_A",enabled=ok) 
    107     PRINT *,"field_A : attribute enabled is defined ? ",ok 
    108     CALL xios_close_context_definition() 
     120  CALL xios_is_defined_field_attr("field_A",enabled=ok) 
     121  PRINT *,"field_A : attribute enabled is defined ? ",ok 
     122  CALL xios_close_context_definition() 
    109123 
    110     PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
    111     DO ts=1,24*10 
    112       CALL xios_update_calendar(ts) 
    113       CALL xios_send_field("field_A",field_A) 
    114       CALL wait_us(5000) ; 
    115     ENDDO 
     124  PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
     125  DO ts=1,24*10 
     126    CALL xios_update_calendar(ts) 
     127    CALL xios_send_field("field_A",field_A) 
     128    CALL wait_us(5000) ; 
     129  ENDDO 
    116130 
    117     CALL xios_context_finalize() 
    118     CALL xios_finalize() 
     131  CALL xios_context_finalize() 
     132  CALL xios_finalize() 
    119133 
    120134  CALL MPI_FINALIZE(ierr) 
Note: See TracChangeset for help on using the changeset viewer.