- Timestamp:
- 02/12/15 12:06:01 (10 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/server_distribution_description.cpp
r553 r557 99 99 { 100 100 int dim = nGlobal_.size(); 101 indexBegin_.resize( dim);102 dimensionSizes_.resize( dim);101 indexBegin_.resize(nServer); 102 dimensionSizes_.resize(nServer); 103 103 104 104 for (int i = 0; i< nServer; ++i) 105 105 { 106 indexBegin_[i].resize( nServer);107 dimensionSizes_[i].resize( nServer);106 indexBegin_[i].resize(dim); 107 dimensionSizes_[i].resize(dim); 108 108 } 109 109 -
XIOS/trunk/src/test/test_new_features.f90
r553 r557 11 11 CHARACTER(len=*),PARAMETER :: id="client" 12 12 INTEGER :: comm 13 TYPE(xios_duration) :: dtime 13 TYPE(xios_duration) :: dtime 14 TYPE(xios_date) :: date 15 CHARACTER(len=15) :: calendar_type 14 16 TYPE(xios_context) :: ctx_hdl 15 INTEGER,PARAMETER :: ni_glo= 516 INTEGER,PARAMETER :: nj_glo= 517 INTEGER,PARAMETER :: ni_glo=100 18 INTEGER,PARAMETER :: nj_glo=100 17 19 INTEGER,PARAMETER :: llm=5 18 20 DOUBLE PRECISION :: lval(llm)=1 19 DOUBLE PRECISION :: lval2(llm)=120 21 TYPE(xios_field) :: field_hdl 21 22 TYPE(xios_fieldgroup) :: fieldgroup_hdl … … 24 25 25 26 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(:) ;28 27 DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm) 29 28 DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:) ; 30 29 INTEGER :: ni,ibegin,iend,nj,jbegin,jend 31 INTEGER :: i,j,l,ts,n ,k30 INTEGER :: i,j,l,ts,n 32 31 33 32 !!! MPI Initialization … … 49 48 lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo 50 49 DO l=1,llm 51 ! DO k=1,llm52 ! field_A_glo(i,j,l,k)=(i-1)+(j-1)*ni_glo+10000*l+100000*k53 ! ENDDO54 50 field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l 55 51 ENDDO … … 69 65 70 66 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))72 67 lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 73 68 lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) … … 78 73 CALL xios_set_current_context(ctx_hdl) 79 74 80 ! CALL xios_define_calendar(type="Gregorian") 75 CALL xios_get_calendar_type(calendar_type) 76 PRINT *, "calendar_type = ", calendar_type 77 81 78 CALL xios_set_axis_attr("axis_A",size=llm ,value=lval) ; 82 ! CALL xios_set_axis_attr("axis_B",size=llm ,value=lval2) ;83 79 CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj) 84 80 CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) … … 94 90 CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_C") 95 91 92 dtime%second = 3600 93 CALL xios_set_timestep(dtime) 96 94 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) 99 113 100 101 114 ni=0 ; lonvalue(:)=0 115 CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue=lonvalue) 102 116 103 104 117 print *,"ni",ni 118 print *,"lonvalue",lonvalue ; 105 119 106 107 108 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() 109 123 110 111 112 113 114 115 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 116 130 117 118 131 CALL xios_context_finalize() 132 CALL xios_finalize() 119 133 120 134 CALL MPI_FINALIZE(ierr)
Note: See TracChangeset
for help on using the changeset viewer.