Changeset 1897 for LMDZ5/trunk/libf/bibio
- Timestamp:
- Oct 25, 2013, 10:12:38 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/bibio/wxios.F90
r1852 r1897 121 121 INTEGER :: xios_comm 122 122 123 IF (prt_level >= 10) WRITE(lunout,*) " Xios.Initialization"123 IF (prt_level >= 10) WRITE(lunout,*) "wxios_init: Initialization" 124 124 125 125 126 126 127 127 IF (PRESENT(locom)) THEN 128 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ctx=",xios_ctx_name,"local_comm=",locom,",return_comm=",xios_comm129 CALL xios_initialize(xios_ctx_name, local_comm = locom, return_comm = xios_comm )130 ELSE 131 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ctx=",xios_ctx_name,"return_comm=",outcom132 CALL xios_initialize(xios_ctx_name, return_comm = xios_comm )128 CALL xios_initialize(xios_ctx_name, local_comm = locom, return_comm = xios_comm ) 129 IF (prt_level >= 10) WRITE(lunout,*) "wxios_init: ctx=",xios_ctx_name," local_comm=",locom,", return_comm=",xios_comm 130 ELSE 131 CALL xios_initialize(xios_ctx_name, return_comm = xios_comm ) 132 IF (prt_level >= 10) WRITE(lunout,*) "wxios_init: ctx=",xios_ctx_name," return_comm=",xios_comm 133 133 END IF 134 134 135 135 IF (PRESENT(outcom)) THEN 136 outcom = xios_comm 136 outcom = xios_comm 137 IF (prt_level >= 10) WRITE(lunout,*) "wxios_init: ctx=",xios_ctx_name," outcom=",outcom 137 138 END IF 138 139 … … 157 158 g_ctx = xios_ctx 158 159 159 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Current context is ", g_ctx_name160 IF (prt_level >= 10) WRITE(lunout,*) "wxios_context_init: Current context is ",trim(g_ctx_name) 160 161 161 162 !Une première analyse des héritages: … … 191 192 CASE('earth_360d') 192 193 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "D360") 193 IF (prt_level >= 10) WRITE(lunout,*) ' Xios.Calendrier terrestre a 360 jours/an'194 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 360 jours/an' 194 195 CASE('earth_365d') 195 196 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "NoLeap") 196 IF (prt_level >= 10) WRITE(lunout,*) ' Xios.Calendrier terrestre a 365 jours/an'197 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 365 jours/an' 197 198 CASE('earth_366d') 198 199 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "Gregorian") 199 IF (prt_level >= 10) WRITE(lunout,*) ' Xios.Calendrier gregorien'200 IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier gregorien' 200 201 CASE DEFAULT 201 abort_message = ' Xios.Mauvais choix de calendrier'202 abort_message = 'wxios_set_cal: Mauvais choix de calendrier' 202 203 CALL abort_gcm('Gcm:Xios',abort_message,1) 203 204 END SELECT … … 206 207 WRITE(date, "(i4.4,'-',i2.2,'-',i2.2,' 00:00:00')") annee, mois, jour 207 208 208 IF (prt_level >= 10) WRITE(lunout,*) " Xios.Initial time: ", date209 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Initial time: ", date 209 210 210 211 CALL xios_set_context_attr_hdl(g_ctx, start_date= date) … … 212 213 !Et enfin,le pas de temps: 213 214 CALL xios_set_timestep(mdtime) 214 IF (prt_level >= 10) WRITE(lunout,*) " Xios.ts=",mdtime215 IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: ts=",mdtime 215 216 END SUBROUTINE wxios_set_cal 216 217 … … 230 231 ibegin, iend, ii_begin, ii_end, jbegin, jend, & 231 232 data_ni, data_ibegin, data_iend, & 232 io_lat, io_lon )233 io_lat, io_lon,is_south_pole,mpi_rank) 233 234 234 IMPLICIT NONE 235 INCLUDE 'iniprint.h' 236 237 CHARACTER (len=*), INTENT(IN) :: dom_id 238 LOGICAL, INTENT(IN) :: is_sequential 239 INTEGER, INTENT(IN) :: ni, nj, ni_glo, nj_glo, ibegin, iend, ii_begin, ii_end, jbegin, jend 240 INTEGER, INTENT(IN) :: data_ni, data_ibegin, data_iend 241 REAL, DIMENSION(:) :: io_lat, io_lon 242 235 236 IMPLICIT NONE 237 INCLUDE 'iniprint.h' 238 239 CHARACTER(len=*),INTENT(IN) :: dom_id ! domain identifier 240 LOGICAL,INTENT(IN) :: is_sequential ! flag 241 INTEGER,INTENT(IN) :: ni ! local MPI domain number of longitudes 242 INTEGER,INTENT(IN) :: nj ! local MPI domain number of latitudes 243 INTEGER,INTENT(IN) :: ni_glo ! global grid number of longitudes 244 INTEGER,INTENT(IN) :: nj_glo ! global grid number of latitudes 245 INTEGER,INTENT(IN) :: ibegin ! start index, on global grid, of local MPI domain 246 INTEGER,INTENT(IN) :: iend ! end index, on global grid, of local MPI domain 247 INTEGER,INTENT(IN) :: ii_begin ! i index at which local data starts (first row) 248 INTEGER,INTENT(IN) :: ii_end ! i index at which local data ends (last row) 249 INTEGER,INTENT(IN) :: jbegin ! start index, on global grid, of local MPI domain 250 INTEGER,INTENT(IN) :: jend ! end index, on global grid, of local MPI domain 251 INTEGER,INTENT(IN) :: data_ni 252 INTEGER,INTENT(IN) :: data_ibegin 253 INTEGER,INTENT(IN) :: data_iend 254 REAL,INTENT(IN) :: io_lat(:) ! latitudes (of global grid) 255 REAL,INTENT(IN) :: io_lon(:) ! longitudes (of global grid) 256 logical,intent(in) :: is_south_pole ! does this process include the south pole? 257 integer,intent(in) :: mpi_rank ! rank of process 243 258 244 259 TYPE(xios_domain) :: dom … … 251 266 CALL xios_get_domain_handle(dom_id, dom) 252 267 253 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ni:",ni," ni_glo:", ni_glo, " nj:", nj, " nj_glo:", nj_glo 254 IF (prt_level >= 10) WRITE(lunout,*) "Xios. ibegin:",ibegin," iend:", iend, " jbegin:", jbegin, " jend:", jend 255 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Size lon:", SIZE(io_lon(ibegin:iend)), " lat:", SIZE(io_lat(jbegin:jend)) 268 IF (prt_level >= 10) THEN 269 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ni:",ni," ni_glo:", ni_glo, " nj:", nj, " nj_glo:", nj_glo 270 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ibegin:",ibegin," iend:", iend, " jbegin:", jbegin, " jend:", jend 271 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," ii_begin:",ii_begin," ii_end:", ii_end 272 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," Size io_lon:", SIZE(io_lon(ibegin:iend)), " io_lat:", SIZE(io_lat(jbegin:jend)) 273 ENDIF 256 274 257 275 !On parametrise le domaine: … … 262 280 IF (.NOT.is_sequential) THEN 263 281 mask(:,:)=.TRUE. 264 mask(1:ii_begin-1,1) = .FALSE. 265 mask(ii_end+1:ni,nj) = .FALSE. 266 IF (prt_level >= 10) WRITE(lunout,*) "Xios. mask" 267 !CALL xios_set_domain_attr_hdl(dom, mask=mask) 282 if (ii_begin>1) mask(1:ii_begin-1,1) = .FALSE. 283 if (ii_end<ni) mask(ii_end+1:ni,nj) = .FALSE. 284 ! special case for south pole 285 if ((ii_end.eq.1).and.(is_south_pole)) mask(1:ni,nj)=.true. 286 IF (prt_level >= 10) THEN 287 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,1)=",mask(:,1) 288 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,nj)=",mask(:,nj) 289 ENDIF 290 CALL xios_set_domain_attr_hdl(dom, mask=mask) 268 291 END IF 269 292 … … 271 294 !Vérification: 272 295 IF (xios_is_valid_domain(dom_id)) THEN 273 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Domain initialized: ", dom_id, boool274 ELSE 275 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Invalid domain: ", dom_id296 IF (prt_level >= 10) WRITE(lunout,*) "wxios_domain_param: Domain initialized: ", trim(dom_id), boool 297 ELSE 298 IF (prt_level >= 10) WRITE(lunout,*) "wxios_domain_param: Invalid domain: ", trim(dom_id) 276 299 END IF 277 300 END SUBROUTINE wxios_domain_param … … 307 330 !Vérification: 308 331 IF (xios_is_valid_axis(TRIM(ADJUSTL(axis_id)))) THEN 309 IF (prt_level >= 10) WRITE(lunout,*) " Xios.Axis created: ", TRIM(ADJUSTL(axis_id))310 ELSE 311 WRITE(*,*) " Xios.Invalid axis: ", TRIM(ADJUSTL(axis_id))332 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_vaxis: Axis created: ", TRIM(ADJUSTL(axis_id)) 333 ELSE 334 WRITE(*,*) "wxios_add_vaxis: Invalid axis: ", TRIM(ADJUSTL(axis_id)) 312 335 END IF 313 336 … … 344 367 345 368 IF (xios_is_valid_file("X"//fname)) THEN 346 IF (prt_level >= 10) WRITE(lunout,*) " Xios.New file: ", "X"//fname347 IF (prt_level >= 10) WRITE(lunout,*) " Xios.output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl369 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname 370 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 348 371 ELSE 349 WRITE(*,*) " Xios. Error, invalid file: ", "X"//fname350 WRITE(*,*) " Xios.output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl372 WRITE(*,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname) 373 WRITE(*,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl 351 374 END IF 352 375 ELSE 353 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Fichier ", fname, " défini parXML."376 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_file: File ",trim(fname), " défined using XML." 354 377 CALL xios_set_file_attr(fname, enabled=.TRUE.) 355 378 END IF … … 360 383 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 361 384 SUBROUTINE wxios_add_field(fieldname, fieldgroup, fieldlongname, fieldunit) 362 USE netcdf 385 USE netcdf, only: nf90_fill_real 363 386 364 387 IMPLICIT NONE … … 385 408 !On ajoute le champ: 386 409 CALL xios_add_field(fieldgroup, field, fieldname) 387 !IF (prt_level >= 10) WRITE(lunout,*) " Xios.",fieldname,fieldgroup, fieldlongname, fieldunit410 !IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field: ",fieldname,fieldgroup, fieldlongname, fieldunit 388 411 389 412 !On rentre ses paramètres: 390 413 CALL xios_set_field_attr_hdl(field, standard_name=fieldlongname, unit=newunit, default_value=def) 391 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Champ ", fieldname, "cree:"392 IF (prt_level >= 10) WRITE(lunout,*) " Xios. long_name=",fieldlongname,"; unit=",newunit,"; default_value=",nf90_fill_real414 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field: Field ",trim(fieldname), "cree:" 415 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field: long_name=",trim(fieldlongname),"; unit=",trim(newunit),"; default_value=",nf90_fill_real 393 416 394 417 END SUBROUTINE wxios_add_field … … 436 459 IF (xios_is_valid_field(fieldname) .AND. .NOT. g_field_name == fieldname) THEN 437 460 !Si ce champ existe via XML (ie, dès le premier passage, ie g_field_name != fieldname) alors rien d'autre à faire 438 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Champ ", fieldname, "existevia XML"461 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field_to_file: Field ", trim(fieldname), "exists via XML" 439 462 g_flag_xml = .TRUE. 440 463 g_field_name = fieldname … … 443 466 !Si premier pssage et champ indéfini, alors on le créé 444 467 445 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Champ ", fieldname, "nexiste pas"468 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field_to_file: Field ", trim(fieldname), "does not exist" 446 469 447 470 !On le créé: 448 471 CALL wxios_add_field(fieldname, fieldgroup, fieldlongname, fieldunit) 449 472 IF (xios_is_valid_field(fieldname)) THEN 450 IF (prt_level >= 10) WRITE(lunout,*) " Xios. Champ ", fieldname, "cree"473 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field_to_file: Field ", trim(fieldname), "created" 451 474 ENDIF 452 475 … … 472 495 IF (fdim.EQ.2) THEN 473 496 !Si c'est un champ 2D: 474 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ 2D ", fieldname, " de ", "X"//fname ," configure:" 475 IF (prt_level >= 10) WRITE(lunout,*) "Xios. op=", TRIM(ADJUSTL(operation)) 476 IF (prt_level >= 10) WRITE(lunout,*) "Xios. freq_op=1ts","; lvl=",field_level 497 IF (prt_level >= 10) THEN 498 WRITE(lunout,*) "wxios_add_field_to_file: 2D Field ", trim(fieldname), " in ", "X"//trim(fname) ," configured with:" 499 WRITE(lunout,*) "wxios_add_field_to_file: op=", TRIM(ADJUSTL(operation)) 500 WRITE(lunout,*) "wxios_add_field_to_file: freq_op=1ts","; lvl=",field_level 501 ENDIF 477 502 ELSE 478 503 !Si 3D : … … 480 505 CALL xios_set_field_attr_hdl(field, axis_ref=TRIM(ADJUSTL(axis_id))) 481 506 482 IF (prt_level >= 10) WRITE(lunout,*) "Xios. Champ 3D ", fieldname, " de ", "X"//fname, "configure:" 483 IF (prt_level >= 10) WRITE(lunout,*) "Xios. freq_op=1ts","; lvl=",field_level 484 IF (prt_level >= 10) WRITE(lunout,*) "Xios. axe=",TRIM(ADJUSTL(axis_id)) 507 IF (prt_level >= 10) THEN 508 WRITE(lunout,*) "wxios_add_field_to_file: 3D Field",trim(fieldname), " in ", "X"//trim(fname), "configured with:" 509 WRITE(lunout,*) "wxios_add_field_to_file: freq_op=1ts","; lvl=",field_level 510 WRITE(lunout,*) "wxios_add_field_to_file: axis=",TRIM(ADJUSTL(axis_id)) 511 ENDIF 485 512 END IF 486 513
Note: See TracChangeset
for help on using the changeset viewer.