Changeset 2741 for LMDZ5/trunk
- Timestamp:
- Jan 5, 2017, 3:21:54 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/misc/wxios.F90
r2509 r2741 25 25 !$OMP THREADPRIVATE(missing_val) 26 26 27 #ifdef XIOS1 28 #error "XIOS v1 no longer supported, use XIOS v2." 29 #endif 30 27 31 CONTAINS 28 32 … … 33 37 SUBROUTINE reformadate(odate, ndate) 34 38 CHARACTER(len=*), INTENT(IN) :: odate 35 #ifdef XIOS136 CHARACTER(len=100), INTENT(OUT) :: ndate37 #else38 39 TYPE(xios_duration) :: ndate 39 #endif40 40 41 41 INTEGER :: i = 0 … … 52 52 i = INDEX(odate, "day") 53 53 IF (i > 0) THEN 54 #ifdef XIOS155 ndate = odate(1:i-1)//"d"56 #else57 54 read(odate(1:i-1),*) ndate%day 58 #endif59 55 END IF 60 56 61 57 i = INDEX(odate, "hr") 62 58 IF (i > 0) THEN 63 #ifdef XIOS164 ndate = odate(1:i-1)//"h"65 #else66 59 read(odate(1:i-1),*) ndate%hour 67 #endif68 60 END IF 69 61 70 62 i = INDEX(odate, "mth") 71 63 IF (i > 0) THEN 72 #ifdef XIOS173 ndate = odate(1:i-1)//"mo"74 #else75 64 read(odate(1:i-1),*) ndate%month 76 #endif77 65 END IF 78 66 … … 197 185 198 186 !Variables pour xios: 199 #ifdef XIOS1200 TYPE(xios_time) :: mdtime201 #else202 187 TYPE(xios_duration) :: mdtime 203 #endif204 188 !REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0 205 189 206 #ifdef XIOS1207 mdtime = xios_time(0, 0, 0, 0, 0, pasdetemps)208 #else209 190 mdtime%second=pasdetemps 210 #endif211 191 212 192 !Réglage du calendrier: 213 #ifdef XIOS1214 SELECT CASE (calendrier)215 CASE('earth_360d')216 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "D360")217 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 360 jours/an'218 CASE('earth_365d')219 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "NoLeap")220 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 365 jours/an'221 CASE('gregorian')222 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "Gregorian")223 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier gregorien'224 CASE DEFAULT225 abort_message = 'wxios_set_cal: Mauvais choix de calendrier'226 CALL abort_gcm('Gcm:Xios',abort_message,1)227 END SELECT228 #else229 193 SELECT CASE (calendrier) 230 194 CASE('earth_360d') … … 241 205 CALL abort_gcm('Gcm:Xios',abort_message,1) 242 206 END SELECT 243 #endif244 207 245 208 !Formatage de la date d'origine: … … 247 210 248 211 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Time origin: ", date 249 #ifdef XIOS1250 CALL xios_set_context_attr_hdl(g_ctx, time_origin = date)251 #else252 212 CALL xios_set_time_origin(xios_date(annee,mois,jour,int(heure),0,0)) 253 #endif254 213 255 214 !Formatage de la date de debut: … … 259 218 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Start date: ", date 260 219 261 #ifdef XIOS1262 CALL xios_set_context_attr_hdl(g_ctx, start_date = date)263 #else264 220 CALL xios_set_start_date(xios_date(ini_an,ini_mois,ini_jour,int(ini_heure),0,0)) 265 #endif266 221 267 222 !Et enfin,le pas de temps: … … 272 227 SUBROUTINE wxios_set_timestep(ts) 273 228 REAL, INTENT(IN) :: ts 274 #ifdef XIOS1275 TYPE(xios_time) :: mdtime276 277 mdtime = xios_time(0, 0, 0, 0, 0, ts)278 #else279 229 TYPE(xios_duration) :: mdtime 280 230 281 231 mdtime%timestep = ts 282 #endif283 232 284 233 CALL xios_set_timestep(mdtime) … … 334 283 335 284 !On parametrise le domaine: 336 #ifdef XIOS1337 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin, ni=ni)338 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin, nj=nj, data_dim=2)339 CALL xios_set_domain_attr_hdl(dom, lonvalue=io_lon(ibegin:iend), latvalue=io_lat(jbegin:jend))340 #else341 285 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin-1, ni=ni, type="rectilinear") 342 286 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin-1, nj=nj, data_dim=2) 343 287 CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(ibegin:iend), latvalue_1d=io_lat(jbegin:jend)) 344 #endif345 288 IF (.NOT.is_sequential) THEN 346 289 mask(:,:)=.TRUE. … … 353 296 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,nj)=",mask(:,nj) 354 297 ENDIF 355 #ifdef XIOS1356 CALL xios_set_domain_attr_hdl(dom, mask=mask)357 #else358 298 CALL xios_set_domain_attr_hdl(dom, mask_2d=mask) 359 #endif360 299 END IF 361 300 … … 401 340 402 341 ! Ehouarn: New way to declare axis, without axis_group: 403 #ifdef XIOS1404 CALL xios_set_axis_attr(trim(axis_id),size=axis_size,value=axis_value)405 #else406 342 CALL xios_set_axis_attr(trim(axis_id),n_glo=axis_size,value=axis_value) 407 #endif 343 408 344 !Vérification: 409 345 IF (xios_is_valid_axis(TRIM(ADJUSTL(axis_id)))) THEN … … 429 365 TYPE(xios_file) :: x_file 430 366 TYPE(xios_filegroup) :: x_fg 431 #ifdef XIOS1432 CHARACTER(len=100) :: nffreq433 #else434 367 TYPE(xios_duration) :: nffreq 435 #endif436 368 437 369 !On regarde si le fichier n'est pas défini par XML: … … 445 377 446 378 !On configure: 447 #ifdef XIOS1448 CALL xios_set_file_attr_hdl(x_file, name="X"//fname,&449 output_freq=TRIM(ADJUSTL(nffreq)), output_level=flvl, enabled=.TRUE.)450 #else451 379 CALL xios_set_file_attr_hdl(x_file, name="X"//fname,& 452 380 output_freq=nffreq, output_level=flvl, enabled=.TRUE.) 453 #endif454 381 455 382 IF (xios_is_valid_file("X"//fname)) THEN 456 383 IF (prt_level >= 10) THEN 457 384 WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname 458 #ifdef XIOS1459 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl460 #else461 385 WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl 462 #endif463 386 ENDIF 464 387 ELSE 465 388 WRITE(lunout,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname) 466 #ifdef XIOS1467 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl468 #else469 389 WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl 470 #endif471 390 END IF 472 391 ELSE … … 538 457 TYPE(xios_field) :: field 539 458 TYPE(xios_fieldgroup) :: fieldgroup 540 #ifndef XIOS1541 459 TYPE(xios_duration) :: freq_op 542 #endif 460 543 461 LOGICAL :: bool=.FALSE. 544 462 INTEGER :: lvl =0 … … 599 517 600 518 !L'operation, sa frequence: 601 #ifdef XIOS1602 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op="1ts", prec=4)603 #else604 519 freq_op%timestep=1 605 520 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op=freq_op, prec=4) 606 #endif607 521 608 522
Note: See TracChangeset
for help on using the changeset viewer.