Changeset 3867 for dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/wxios.F90
- Timestamp:
- Jan 8, 2016, 9:52:14 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/wxios.F90
r3849 r3867 31 31 SUBROUTINE reformadate(odate, ndate) 32 32 CHARACTER(len=*), INTENT(IN) :: odate 33 CHARACTER(len=100), INTENT(OUT) :: ndate33 TYPE(xios_duration) :: ndate 34 34 35 35 INTEGER :: i = 0 … … 46 46 i = INDEX(odate, "day") 47 47 IF (i > 0) THEN 48 ndate = odate(1:i-1)//"d"48 read(odate(1:i-1),*) ndate%day 49 49 END IF 50 50 51 51 i = INDEX(odate, "hr") 52 52 IF (i > 0) THEN 53 ndate = odate(1:i-1)//"h"53 read(odate(1:i-1),*) ndate%hour 54 54 END IF 55 55 56 56 i = INDEX(odate, "mth") 57 57 IF (i > 0) THEN 58 ndate = odate(1:i-1)//"mo"58 read(odate(1:i-1),*) ndate%month 59 59 END IF 60 60 … … 135 135 SUBROUTINE wxios_context_init() 136 136 USE print_control_mod, ONLY : prt_level, lunout 137 USE mod_phys_lmdz_mpi_data, ONLY : COMM_LMDZ_PHY 137 138 IMPLICIT NONE 138 139 … … 141 142 !$OMP MASTER 142 143 !Initialisation du contexte: 143 CALL xios_context_initialize(g_ctx_name, g_comm)144 CALL xios_context_initialize(g_ctx_name, COMM_LMDZ_PHY) 144 145 CALL xios_get_handle(g_ctx_name, xios_ctx) !Récupération 145 146 CALL xios_set_current_context(xios_ctx) !Activation … … 186 187 187 188 !Variables pour xios: 188 TYPE(xios_ time) :: mdtime189 TYPE(xios_duration) :: mdtime 189 190 !REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0 190 191 191 mdtime = xios_time(0, 0, 0, 0, 0, pasdetemps)192 mdtime%second=pasdetemps 192 193 193 194 !Réglage du calendrier: 194 195 SELECT CASE (calendrier) 195 196 CASE('earth_360d') 196 CALL xios_ set_context_attr_hdl(g_ctx, calendar_type="D360")197 CALL xios_define_calendar("D360") 197 198 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 360 jours/an' 198 199 CASE('earth_365d') 199 CALL xios_ set_context_attr_hdl(g_ctx, calendar_type="NoLeap")200 CALL xios_define_calendar("NoLeap") 200 201 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 365 jours/an' 201 202 CASE('earth_366d') 202 CALL xios_ set_context_attr_hdl(g_ctx, calendar_type="Gregorian")203 CALL xios_define_calendar("Gregorian") 203 204 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier gregorien' 204 205 CASE DEFAULT … … 211 212 212 213 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Time origin: ", date 213 214 CALL xios_set_ context_attr_hdl(g_ctx, time_origin = date)214 215 CALL xios_set_time_origin(xios_date(annee,mois,jour,int(heure),0,0)) 215 216 216 217 !Formatage de la date de debut: … … 220 221 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Start date: ", date 221 222 222 CALL xios_set_ context_attr_hdl(g_ctx, start_date = date)223 CALL xios_set_start_date(xios_date(ini_an,ini_mois,ini_jour,int(ini_heure),0,0)) 223 224 224 225 !Et enfin,le pas de temps: … … 229 230 SUBROUTINE wxios_set_timestep(ts) 230 231 REAL, INTENT(IN) :: ts 231 TYPE(xios_ time) :: mdtime232 233 mdtime = xios_time(0, 0, 0, 0, 0, ts)232 TYPE(xios_duration) :: mdtime 233 234 mdtime%timestep = ts 234 235 235 236 CALL xios_set_timestep(mdtime) … … 285 286 286 287 !On parametrise le domaine: 287 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin , ni=ni)288 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin , nj=nj, data_dim=2)289 CALL xios_set_domain_attr_hdl(dom, lonvalue =io_lon(ibegin:iend), latvalue=io_lat(jbegin:jend))288 CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin-1, ni=ni) 289 CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin-1, nj=nj, data_dim=2) 290 CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(ibegin:iend), latvalue_1d=io_lat(jbegin:jend)) 290 291 291 292 IF (.NOT.is_sequential) THEN … … 299 300 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,nj)=",mask(:,nj) 300 301 ENDIF 301 CALL xios_set_domain_attr_hdl(dom, mask =mask)302 CALL xios_set_domain_attr_hdl(dom, mask_2d=mask) 302 303 END IF 303 304 … … 322 323 REAL :: boundslon_mpi(klon_mpi,nvertex) 323 324 REAL :: boundslat_mpi(klon_mpi,nvertex) 324 TYPE(xios_domain ) :: dom325 TYPE(xios_domaingroup) :: dom 325 326 326 327 … … 331 332 332 333 !$OMP MASTER 333 CALL xios_get_domain _handle("dom_glo", dom)334 CALL xios_get_domaingroup_handle("dom_glo", dom) 334 335 335 336 !On parametrise le domaine: 336 CALL xios_set_ domain_attr_hdl(dom, ni_glo=klon_glo, ibegin=ij_begin, ni=ij_nb, data_dim=1, type="unstructured")337 CALL xios_set_ domain_attr_hdl(dom, nvertex=nvertex, lonvalue=lon_mpi, latvalue=lat_mpi, bounds_lon=TRANSPOSE(boundslon_mpi), bounds_lat=TRANSPOSE(boundslat_mpi) )337 CALL xios_set_attr(dom, ni_glo=klon_glo, ibegin=ij_begin-1, ni=ij_nb, type="unstructured") 338 CALL xios_set_attr(dom, nvertex=nvertex, lonvalue_1d=lon_mpi, latvalue_1d=lat_mpi, bounds_lon_1d=TRANSPOSE(boundslon_mpi), bounds_lat_1d=TRANSPOSE(boundslat_mpi) ) 338 339 !$OMP END MASTER 339 340 … … 375 376 376 377 ! Ehouarn: New way to declare axis, without axis_group: 377 CALL xios_set_axis_attr(trim(axis_id), size=axis_size,value=axis_value)378 CALL xios_set_axis_attr(trim(axis_id),n_glo=axis_size,value=axis_value) 378 379 379 380 !Vérification: … … 400 401 TYPE(xios_file) :: x_file 401 402 TYPE(xios_filegroup) :: x_fg 402 CHARACTER(len=100) :: nffreq 403 ! CHARACTER(len=100) :: nffreq 404 TYPE(xios_duration) :: nffreq 403 405 404 406 !On regarde si le fichier n'est pas défini par XML: … … 413 415 !On configure: 414 416 CALL xios_set_file_attr_hdl(x_file, name="X"//fname,& 415 output_freq= TRIM(ADJUSTL(nffreq)), output_level=flvl, enabled=.TRUE.)417 output_freq=nffreq, output_level=flvl, enabled=.TRUE.) 416 418 417 419 IF (xios_is_valid_file("X"//fname)) THEN 418 420 IF (prt_level >= 10) THEN 419 421 WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname 420 WRITE(lunout,*) "wxios_add_file: output_freq=", TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl422 WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl 421 423 ENDIF 422 424 ELSE 423 425 WRITE(lunout,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname) 424 WRITE(lunout,*) "wxios_add_file: output_freq=", TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl426 WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl 425 427 END IF 426 428 ELSE … … 492 494 TYPE(xios_field) :: field 493 495 TYPE(xios_fieldgroup) :: fieldgroup 496 TYPE(xios_duration) :: freq_op 494 497 LOGICAL :: bool=.FALSE. 495 498 INTEGER :: lvl =0 … … 550 553 551 554 !L'operation, sa frequence: 552 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op="1ts", prec=4) 555 freq_op%timestep=1 556 CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op=freq_op, prec=4) 553 557 554 558
Note: See TracChangeset
for help on using the changeset viewer.