Changeset 549 for XIOS/trunk/src/test/test_complete.f90
- Timestamp:
- 01/26/15 14:39:26 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/test/test_complete.f90
r537 r549 8 8 INTEGER :: size_loc 9 9 INTEGER :: ierr 10 10 11 11 CHARACTER(len=*),PARAMETER :: id="client" 12 12 INTEGER :: comm 13 TYPE(xios_date) :: start_date, time_origin14 13 TYPE(xios_duration) :: dtime 15 14 TYPE(xios_context) :: ctx_hdl 16 15 INTEGER,PARAMETER :: ni_glo=100 17 INTEGER,PARAMETER :: nj_glo=100 18 INTEGER,PARAMETER :: llm=5 16 INTEGER,PARAMETER :: nj_glo=100 17 INTEGER,PARAMETER :: llm=5 19 18 DOUBLE PRECISION :: lval(llm)=1 20 19 TYPE(xios_field) :: field_hdl … … 34 33 35 34 CALL MPI_INIT(ierr) 36 35 37 36 CALL init_wait 38 37 39 38 !!! XIOS Initialization (get the local communicator) 40 39 … … 42 41 43 42 CALL MPI_COMM_RANK(comm,rank,ierr) 44 CALL MPI_COMM_SIZE(comm,size_loc,ierr) 45 43 CALL MPI_COMM_SIZE(comm,size_loc,ierr) 44 46 45 47 46 !########################################################################### … … 66 65 nj=nj_glo/size_loc 67 66 IF (n<MOD(nj_glo,size_loc)) nj=nj+1 68 IF (n==rank) exit 67 IF (n==rank) exit 69 68 jbegin=jbegin+nj 70 69 ENDDO 71 70 72 71 iend=ibegin+ni-1 ; jend=jbegin+nj-1 73 72 … … 76 75 lat(:,:)=lat_glo(ibegin:iend,jbegin:jend) 77 76 field_A_atm(1:ni,1:nj,:)=field_A_glo(ibegin:iend,jbegin:jend,:) 78 77 79 78 80 79 !!! Context ATMOSPHERE … … 83 82 CALL xios_get_handle("atmosphere",ctx_hdl) 84 83 CALL xios_set_current_context(ctx_hdl) 85 86 CALL xios_set_context_attr("atmosphere",calendar_type="Gregorian") 87 start_date = xios_date(2000, 01, 01, 00, 00, 00) 88 CALL xios_set_context_attr("atmosphere",start_date=start_date) 89 time_origin = xios_date(1999, 01, 01, 15, 00, 00) 90 CALL xios_set_context_attr("atmosphere",time_origin=time_origin) 84 85 CALL xios_define_calendar(type="Gregorian", & 86 start_date=xios_date(2000, 01, 01, 00, 00, 00), & 87 time_origin=xios_date(1999, 01, 01, 15, 00, 00)) 91 88 92 89 CALL xios_set_axis_attr("axis_atm",size=llm ,value=lval) ; … … 104 101 CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) 105 102 106 !!! Création d un nouveau champ 103 !!! Création d un nouveau champ 107 104 108 105 CALL xios_get_handle("field_definition",fieldgroup_hdl) … … 112 109 113 110 CALL xios_set_attr(field_hdl,field_ref="field_A_atm",name="field_B_atm") 114 111 115 112 !!! Affectation de ce nouveau champ au fichier avec un nouveau nom 116 113 … … 118 115 CALL xios_add_child(file_hdl,field_hdl) 119 116 CALL xios_set_attr(field_hdl,field_ref="field_B_atm",name="field_C_atm") 120 117 121 118 !!! Definition du timestep 122 119 123 120 dtime%second=3600 124 CALL xios_set_ context_attr("atmosphere",timestep=dtime)125 121 CALL xios_set_timestep(timestep=dtime) 122 126 123 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalité) 127 124 128 125 ni=0 ; lonvalue(:)=0 129 126 CALL xios_get_domain_attr("domain_atm",ni=ni,lonvalue=lonvalue) 130 127 131 128 PRINT *,"ni",ni 132 129 PRINT *,"lonvalue",lonvalue ; … … 137 134 138 135 !!! Test des valeurs des champs/fichiers 139 140 !!! Attribut defini ? 136 137 !!! Attribut defini ? 141 138 142 139 CALL xios_is_defined_field_attr("field_A_atm",enabled=ok) … … 144 141 145 142 !!! Recuperer la valeur d un attribut 146 143 147 144 CALL xios_get_field_attr("field_A_atm",name=crname) 148 145 PRINT *,"field_A_atm : attribute name is : ",TRIM(crname) 149 146 150 !!! Champ actif (besoin de fournir la valeur) ? 147 !!! Champ actif (besoin de fournir la valeur) ? 151 148 152 149 PRINT*,"field field_A_atm is active ? ",xios_field_is_active("field_A_atm") … … 173 170 CALL xios_get_handle("surface",ctx_hdl) 174 171 CALL xios_set_current_context(ctx_hdl) 175 176 CALL xios_set_context_attr("surface",calendar_type="Gregorian") 177 start_date = xios_date(2000, 01, 01, 00, 00, 00) 178 CALL xios_set_context_attr("surface",start_date=start_date) 179 time_origin = xios_date(1999, 01, 01, 15, 00, 00) 180 CALL xios_set_context_attr("surface",time_origin=time_origin) 172 173 CALL xios_define_calendar(type="Gregorian", & 174 start_date=xios_date(2000, 01, 01, 00, 00, 00), & 175 time_origin=xios_date(1999, 01, 01, 15, 00, 00)) 181 176 182 177 CALL xios_set_axis_attr("axis_srf",size=llm ,value=lval) ; … … 186 181 CALL xios_set_domain_attr("domain_srf",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/))) 187 182 188 !!! Création d un nouveau champ 183 !!! Création d un nouveau champ 189 184 190 185 CALL xios_get_handle("field_definition",fieldgroup_hdl) … … 194 189 195 190 CALL xios_set_attr(field_hdl,field_ref="field_A_srf",name="field_B_srf") 196 191 197 192 !!! Affectation de ce nouveau champ au fichier avec un nouveau nom 198 193 … … 200 195 CALL xios_add_child(file_hdl,field_hdl) 201 196 CALL xios_set_attr(field_hdl,field_ref="field_B_srf",name="field_C_srf") 202 197 203 198 !!! Definition du timestep 204 199 205 200 dtime%second=1800 206 CALL xios_set_ context_attr("surface",timestep=dtime)207 201 CALL xios_set_timestep(timestep=dtime) 202 208 203 !!! Recupration des valeurs des longitudes et de taille des domaines locaux (pour test de fonctionnalité) 209 204 210 205 ni=0 ; lonvalue(:)=0 211 206 CALL xios_get_domain_attr("domain_srf",ni=ni,lonvalue=lonvalue) 212 207 213 208 PRINT *,"ni",ni 214 209 PRINT *,"lonvalue",lonvalue ; … … 226 221 227 222 CALL xios_get_handle("atmosphere",ctx_hdl) 228 CALL xios_set_current_context(ctx_hdl) 223 CALL xios_set_current_context(ctx_hdl) 229 224 230 225 !!! Mise a jour du pas de temps … … 239 234 240 235 CALL xios_get_handle("surface",ctx_hdl) 241 CALL xios_set_current_context(ctx_hdl) 236 CALL xios_set_current_context(ctx_hdl) 242 237 243 238 !!! Mise a jour du pas de temps … … 257 252 258 253 !!! Fin des contextes 259 254 260 255 CALL xios_context_finalize() 261 256 CALL xios_get_handle("atmosphere",ctx_hdl) 262 CALL xios_set_current_context(ctx_hdl) 257 CALL xios_set_current_context(ctx_hdl) 263 258 CALL xios_context_finalize() 264 259 265 260 !!! Fin de XIOS 266 261 267 262 CALL xios_finalize() 268 263 269 264 CALL MPI_FINALIZE(ierr) 270 265 271 266 END PROGRAM test_complete 272 267 273 268 274 269 275 276 277 270 271 272
Note: See TracChangeset
for help on using the changeset viewer.