Changeset 4619
- Timestamp:
- Jul 10, 2023, 1:40:39 AM (10 months ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 1 added
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d/abort_gcm.F
r2100 r4619 12 12 USE ioipsl_getincom 13 13 #endif 14 15 #ifdef CPP_XIOS 16 ! ug Pour les sorties XIOS 14 ! ug Pour les sorties XIOS 17 15 USE wxios 18 #endif19 16 20 17 #include "iniprint.h" … … 34 31 write(lunout,*) 'in abort_gcm' 35 32 36 #ifdef CPP_XIOS 37 38 CALL wxios_close()39 #endif 33 IF (using_xios) THEN 34 !Fermeture propre de XIOS 35 CALL wxios_close() 36 ENDIF 40 37 41 38 #ifdef CPP_IOIPSL -
LMDZ6/trunk/libf/dyn3d/gcm.F90
r4361 r4619 14 14 15 15 16 #ifdef CPP_XIOS 17 ! ug Pour les sorties XIOS 16 ! ug Pour les sorties XIOS 18 17 USE wxios 19 #endif20 18 21 19 USE filtreg_mod … … 156 154 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 157 155 158 #ifdef CPP_XIOS 159 CALL wxios_init("LMDZ")160 #endif 156 IF (using_xios) THEN 157 CALL wxios_init("LMDZ") 158 ENDIF 161 159 162 160 -
LMDZ6/trunk/libf/dyn3dmem/gcm.F90
r4361 r4619 28 28 itau_dyn,itau_phy,day_ini,jD_ref,jH_ref,day_end, & 29 29 dt,hour_ini,itaufin 30 #ifdef CPP_XIOS31 30 USE mod_xios_dyn3dmem, ONLY: xios_dyn3dmem_init 32 #endif33 31 34 32 IMPLICIT NONE … … 457 455 458 456 ! setting up DYN3D/XIOS inerface 459 #ifdef CPP_XIOS 460 if (ok_dyn_xios) then 461 CALL xios_dyn3dmem_init(xios_cal_type, anref, moisref, jourref,heureref, an, & 457 if (ok_dyn_xios) then 458 CALL xios_dyn3dmem_init(xios_cal_type, anref, moisref, jourref,heureref, an, & 462 459 mois, jour, heure, zdtvr) 463 460 endif 464 #endif465 461 466 462 ! #endif of #ifdef CPP_IOIPSL -
LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F
r4607 r4619 42 42 USE temps_mod, ONLY: itaufin,jD_ref,jH_ref,day_ini, 43 43 & day_ref,start_time,dt 44 #ifdef CPP_XIOS45 44 USE mod_xios_dyn3dmem, ONLY : dyn3d_ctx_handle 46 USE xios, ONLY: xios_update_calendar, xios_set_current_context 47 #endif 45 USE lmdz_xios, ONLY: xios_update_calendar, 46 & xios_set_current_context, 47 & using_xios 48 48 49 49 IMPLICIT NONE … … 1523 1523 CALL finalize_inca 1524 1524 ! switching back to LMDZDYN context 1525 #ifdef CPP_XIOS1526 1525 !$OMP MASTER 1527 1526 IF (ok_dyn_xios) THEN … … 1529 1528 ENDIF 1530 1529 !$OMP END MASTER 1531 #endif1532 1530 ENDIF 1533 1531 #endif … … 1582 1580 CALL finalize_inca 1583 1581 ! switching back to LMDZDYN context 1584 #ifdef CPP_XIOS1585 1582 !$OMP MASTER 1586 1583 IF (ok_dyn_xios) THEN … … 1588 1585 ENDIF 1589 1586 !$OMP END MASTER 1590 #endif1591 1587 ENDIF 1592 1588 #endif … … 1661 1657 #endif 1662 1658 1663 #ifdef CPP_XIOS1664 1659 IF (ok_dyn_xios) THEN 1665 1660 c$OMP MASTER … … 1670 1665 & ucov,teta,pk,phi,q,masse,ps,phis) 1671 1666 ENDIF 1672 #endif1673 1667 1674 1668 endif ! of if (leapf.or.(.not.leapf.and.(.not.forward))) … … 1759 1753 CALL finalize_inca 1760 1754 ! switching back to LMDZDYN context 1761 #ifdef CPP_XIOS1762 1755 !$OMP MASTER 1763 1756 IF (ok_dyn_xios) THEN … … 1765 1758 ENDIF 1766 1759 !$OMP END MASTER 1767 #endif1768 1760 ENDIF 1769 1761 … … 1833 1825 #endif 1834 1826 1835 #ifdef CPP_XIOS1836 1827 IF (ok_dyn_xios) THEN 1837 1828 c$OMP MASTER … … 1842 1833 & ucov,teta,pk,phi,q,masse,ps,phis) 1843 1834 ENDIF 1844 #endif1845 1835 1846 1836 ENDIF ! of IF(MOD(itau,iecri).EQ.0) … … 1877 1867 CALL finalize_inca 1878 1868 ! switching back to LMDZDYN context 1879 #ifdef CPP_XIOS1880 1869 !$OMP MASTER 1881 1870 IF (ok_dyn_xios) THEN … … 1883 1872 ENDIF 1884 1873 !$OMP END MASTER 1885 #endif1886 1874 ENDIF 1887 1875 -
LMDZ6/trunk/libf/dyn3dmem/mod_const_mpi.F90
r4604 r4619 23 23 USE mod_prism 24 24 #endif 25 #ifdef CPP_XIOS26 25 USE wxios, only: wxios_init 27 #endif28 26 IMPLICIT NONE 29 27 … … 44 42 #ifdef CPP_COUPLE 45 43 !$OMP MASTER 46 #ifdef CPP_XIOS 47 CALL wxios_init("LMDZ", outcom=COMM_LMDZ, type_ocean=type_ocean)48 #else 49 CALL prism_init_comp_proto (comp_id, 'LMDZ', ierr)50 CALL prism_get_localcomm_proto(COMM_LMDZ,ierr)51 #endif 44 IF (using_xios) THEN 45 CALL wxios_init("LMDZ", outcom=COMM_LMDZ, type_ocean=type_ocean) 46 ELSE 47 CALL prism_init_comp_proto (comp_id, 'LMDZ', ierr) 48 CALL prism_get_localcomm_proto(COMM_LMDZ,ierr) 49 ENDIF 52 50 !$OMP END MASTER 53 51 #endif … … 61 59 SUBROUTINE Init_mpi 62 60 USE lmdz_mpi 61 USE wxios, only: wxios_init, using_xios 63 62 64 #ifdef CPP_XIOS65 USE wxios, only: wxios_init66 #endif67 63 IMPLICIT NONE 68 64 INTEGER :: ierr … … 83 79 ! Initialisation de XIOS 84 80 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 85 #ifdef CPP_XIOS 86 WRITE(*,*)'IN Init_mpi call wxios_init'87 CALL wxios_init("LMDZ", outcom=COMM_LMDZ)88 #endif 81 IF (using_xios) THEN 82 WRITE(*,*)'IN Init_mpi call wxios_init' 83 CALL wxios_init("LMDZ", outcom=COMM_LMDZ) 84 ENDIF 89 85 !$OMP END MASTER 90 86 -
LMDZ6/trunk/libf/dyn3dmem/mod_xios_dyn3dmem.F90
r4371 r4619 12 12 ! 13 13 ! 14 #ifdef CPP_XIOS15 14 16 15 MODULE mod_xios_dyn3dmem 17 16 18 USE xios17 USE lmdz_xios 19 18 USE wxios, ONLY : g_comm 20 19 CHARACTER(len=100), SAVE :: dyn3d_ctx_name = "LMDZDYN" … … 259 258 260 259 END MODULE mod_xios_dyn3dmem 261 #endif 262 260 -
LMDZ6/trunk/libf/dyn3dmem/parallel_lmdz.F90
r4600 r4619 384 384 subroutine Finalize_parallel 385 385 USE lmdz_mpi 386 #ifdef CPP_XIOS387 386 ! ug Pour les sorties XIOS 388 USE wxios389 #endif 387 USE wxios 388 390 389 #ifdef CPP_COUPLE 391 390 ! Use of Oasis-MCT coupler … … 416 415 417 416 if (type_ocean == 'couple') then 418 #ifdef CPP_XIOS 419 !Fermeture propre de XIOS420 CALL wxios_close()421 #else 417 IF (using_xios) THEN 418 !Fermeture propre de XIOS 419 CALL wxios_close() 420 ELSE 422 421 #ifdef CPP_COUPLE 423 call prism_terminate_proto(ierr)424 IF (ierr .ne. PRISM_Ok) THEN425 call abort_gcm('Finalize_parallel',' Probleme dans prism_terminate_proto ',1)426 endif422 call prism_terminate_proto(ierr) 423 IF (ierr .ne. PRISM_Ok) THEN 424 call abort_gcm('Finalize_parallel',' Probleme dans prism_terminate_proto ',1) 425 endif 427 426 #endif 428 #endif 427 ENDIF 429 428 else 430 #ifdef CPP_XIOS 431 !Fermeture propre de XIOS432 CALL wxios_close()433 #endif 434 IF (using_mpi) call MPI_FINALIZE(ierr)429 IF (using_xios) THEN 430 !Fermeture propre de XIOS 431 CALL wxios_close() 432 ENDIF 433 IF (using_mpi) call MPI_FINALIZE(ierr) 435 434 end if 436 435 -
LMDZ6/trunk/libf/dyn3dmem/writedyn_xios.F90
r4146 r4619 5 5 & masse,ps,phis) 6 6 7 #ifdef CPP_XIOS 8 USE xios 7 USE lmdz_xios 9 8 USE parallel_lmdz 10 9 USE misc_mod … … 180 179 CALL writefield_dyn_u('PS', ps(ijb:ije)) 181 180 182 #endif183 184 181 END -
LMDZ6/trunk/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90
r4146 r4619 22 22 USE control_mod, ONLY: planet_type, ok_dyn_xios 23 23 USE physiq_mod, ONLY: physiq 24 #ifdef CPP_XIOS 25 USE mod_xios_dyn3dmem, ONLY : dyn3d_ctx_handle 26 USE xios, ONLY : xios_set_current_context 27 #endif 24 USE lmdz_xios, ONLY : xios_set_current_context, xios_get_current_context, xios_context 28 25 IMPLICIT NONE 29 26 … … 56 53 REAL,INTENT(OUT) :: zdqfi_omp(klon,llm,nqtot) ! tendency on tracers 57 54 REAL,INTENT(OUT) :: zdpsrf_omp(klon) ! tendency on surface pressure 58 55 TYPE(xios_context) :: dyn3d_ctx_handle 56 59 57 ! Local variables 60 58 CHARACTER(len=11) :: modname="call_physiq" … … 70 68 ENDIF 71 69 70 !$OMP MASTER 71 if (ok_dyn_xios) then 72 CALL xios_get_current_context(dyn3d_ctx_handle) 73 endif 74 !$OMP END MASTER 72 75 73 76 ! Call physics package with required inputs/outputs … … 95 98 96 99 ! switching back to LMDZDYN context 97 #ifdef CPP_XIOS98 100 !$OMP MASTER 99 101 if (ok_dyn_xios) then … … 101 103 endif 102 104 !$OMP END MASTER 103 #endif104 105 105 106 -
LMDZ6/trunk/libf/dynphy_lonlat/phylmd/ce0l.F90
r4600 r4619 36 36 USE mod_hallo, ONLY: init_mod_hallo 37 37 USE mod_interface_dyn_phys, ONLY: init_interface_dyn_phys 38 #ifdef CPP_XIOS 39 USE xios, only: xios_finalize 40 #endif 38 USE lmdz_xios, only: xios_finalize 41 39 #endif 42 40 … … 250 248 #ifdef CPP_PARA 251 249 END IF 252 #ifdef CPP_XIOS 253 CALL xios_finalize 254 #endif 250 IF (using_xios) CALL xios_finalize 255 251 IF (using_mpi) call MPI_FINALIZE(ierr) 256 252 #endif -
LMDZ6/trunk/libf/misc/wxios.F90
r4608 r4619 1 1 ! $Id$ 2 #ifdef CPP_XIOS 2 3 3 MODULE wxios 4 USE xios 5 USE iaxis 6 USE iaxis_attr 7 USE icontext_attr 8 USE idate 9 USE idomain_attr 10 USE ifield_attr 11 USE ifile_attr 12 USE ixml_tree 4 USE lmdz_xios 13 5 14 6 !Variables disponibles pendant toute l'execution du programme: … … 411 403 412 404 !On récupère le handle: 413 CALL xios_get_ domain_handle(dom_id, dom)405 CALL xios_get_handle(dom_id, dom) 414 406 415 407 !On parametrise le domaine: 416 CALL xios_set_ domain_attr_hdl(dom, ni_glo=nbp_lon, ibegin=0, ni=nbp_lon, type="rectilinear")417 CALL xios_set_ domain_attr_hdl(dom, nj_glo=nbp_lat, jbegin=jj_begin-1, nj=jj_nb, data_dim=2)418 CALL xios_set_ domain_attr_hdl(dom, lonvalue_1d=io_lon(1:nbp_lon), latvalue_1d=io_lat(jj_begin:jj_end))408 CALL xios_set_attr(dom, ni_glo=nbp_lon, ibegin=0, ni=nbp_lon, type="rectilinear") 409 CALL xios_set_attr(dom, nj_glo=nbp_lat, jbegin=jj_begin-1, nj=jj_nb, data_dim=2) 410 CALL xios_set_attr(dom, lonvalue_1d=io_lon(1:nbp_lon), latvalue_1d=io_lat(jj_begin:jj_end)) 419 411 CALL xios_set_domain_attr("dom_out", domain_ref=dom_id) 420 412 … … 438 430 WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,jj_nb)=",mask(:,jj_nb) 439 431 ENDIF 440 CALL xios_set_ domain_attr_hdl(dom, mask_2d=mask)441 END IF 442 443 CALL xios_is_defined_ domain_attr_hdl(dom,ni_glo=boool)432 CALL xios_set_attr(dom, mask_2d=mask) 433 END IF 434 435 CALL xios_is_defined_attr(dom,ni_glo=boool) 444 436 !Vérification: 445 437 IF (xios_is_valid_domain(dom_id)) THEN … … 480 472 481 473 !$OMP MASTER 482 CALL xios_get_ domain_handle(dom_id, dom)474 CALL xios_get_handle(dom_id, dom) 483 475 484 476 !On parametrise le domaine: … … 580 572 IF (.NOT.xios_is_valid_file(fname)) THEN 581 573 !On créé le noeud: 582 CALL xios_get_ filegroup_handle("defile", x_fg)583 CALL xios_add_ file(x_fg, x_file, fname)574 CALL xios_get_handle("defile", x_fg) 575 CALL xios_add_child(x_fg, x_file, fname) 584 576 585 577 !On reformate la fréquence: … … 587 579 588 580 !On configure: 589 CALL xios_set_ file_attr_hdl(x_file, name="X"//fname,&581 CALL xios_set_attr(x_file, name="X"//fname,& 590 582 output_freq=nffreq, output_level=flvl, enabled=.TRUE.) 591 583 … … 636 628 637 629 !On ajoute le champ: 638 CALL xios_add_ field(fieldgroup, field, fieldname)630 CALL xios_add_child(fieldgroup, field, fieldname) 639 631 !IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field: ",fieldname,fieldgroup, fieldlongname, fieldunit 640 632 641 633 !On rentre ses paramètres: 642 CALL xios_set_ field_attr_hdl(field, standard_name=fieldlongname, unit=newunit, default_value=def)634 CALL xios_set_attr(field, standard_name=fieldlongname, unit=newunit, default_value=def) 643 635 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field: Field ",trim(fieldname), "cree:" 644 636 IF (prt_level >= 10) WRITE(lunout,*) "wxios_add_field: long_name=",trim(fieldlongname),"; unit=",trim(newunit),"; default_value=",nf90_fill_real … … 691 683 !On selectionne le bon groupe de champs: 692 684 IF (fdim.EQ.2) THEN 693 CALL xios_get_ fieldgroup_handle("fields_2D", fieldgroup)685 CALL xios_get_handle("fields_2D", fieldgroup) 694 686 ELSE 695 CALL xios_get_ fieldgroup_handle("fields_3D", fieldgroup)687 CALL xios_get_handle("fields_3D", fieldgroup) 696 688 ENDIF 697 689 … … 722 714 !Champ existe déjà, mais pas XML, alors on l'ajoute 723 715 !On ajoute le champ: 724 CALL xios_get_ file_handle(fname, f)725 CALL xios_add_ fieldtofile(f, field)716 CALL xios_get_handle(fname, f) 717 CALL xios_add_child(f, field) 726 718 727 719 728 720 !L'operation, sa frequence: 729 721 freq_op%timestep=1 730 CALL xios_set_ field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op=freq_op, prec=4)722 CALL xios_set_attr(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op=freq_op, prec=4) 731 723 732 724 733 725 !On rentre ses paramètres: 734 CALL xios_set_ field_attr_hdl(field, level=field_level, enabled=.TRUE.)726 CALL xios_set_attr(field, level=field_level, enabled=.TRUE.) 735 727 736 728 IF (fdim.EQ.2) THEN … … 744 736 !Si 3D : 745 737 !On ajoute l'axe vertical qui va bien: 746 CALL xios_set_ field_attr_hdl(field, axis_ref=TRIM(ADJUSTL(axis_id)))738 CALL xios_set_attr(field, axis_ref=TRIM(ADJUSTL(axis_id))) 747 739 748 740 IF (prt_level >= 10) THEN … … 792 784 END SUBROUTINE wxios_close 793 785 END MODULE wxios 794 #endif 786 -
LMDZ6/trunk/libf/phydev/iophy.F90
r2588 r4619 13 13 14 14 15 #ifdef CPP_XIOS16 15 ! interfaces for both IOIPSL and XIOS 17 16 INTERFACE histwrite_phy 18 17 MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy,histwrite2d_xios,histwrite3d_xios 19 18 END INTERFACE 20 #else 21 ! interfaces for IOIPSL 22 INTERFACE histwrite_phy 23 MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy 24 END INTERFACE 25 #endif 26 27 #ifdef CPP_XIOS 19 28 20 ! interfaces for both IOIPSL and XIOS 29 21 INTERFACE histbeg_phy_all 30 22 MODULE PROCEDURE histbeg_phy, histbeg_phyxios 31 23 END INTERFACE 32 #else33 ! interfaces for IOIPSL34 INTERFACE histbeg_phy_all35 MODULE PROCEDURE histbeg_phy36 END INTERFACE37 #endif38 24 39 25 contains … … 51 37 USE ioipsl, only: flio_dom_set 52 38 #endif 53 #ifdef CPP_XIOS 54 use wxios, only: wxios_domain_param 55 #endif 39 use wxios, only: wxios_domain_param, using_xios 56 40 implicit none 57 41 real,dimension(klon),intent(in) :: rlon … … 122 106 'APPLE',phys_domain_id) 123 107 #endif 124 #ifdef CPP_XIOS 125 ! Set values for the mask:126 IF (mpi_rank == 0) THEN127 data_ibegin = 0128 ELSE129 data_ibegin = ii_begin - 1130 END IF131 132 IF (mpi_rank == mpi_size-1) THEN133 data_iend = nbp_lon134 ELSE135 data_iend = ii_end + 1136 END IF137 138 if (prt_level>=10) then139 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end140 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat141 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend142 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend143 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn144 endif145 146 ! Initialize the XIOS domain coreesponding to this process:147 CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, &148 1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end, &149 klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend, &150 io_lat, io_lon,is_south_pole_dyn,mpi_rank)151 #endif 108 IF (using_xios) THEN 109 ! Set values for the mask: 110 IF (mpi_rank == 0) THEN 111 data_ibegin = 0 112 ELSE 113 data_ibegin = ii_begin - 1 114 END IF 115 116 IF (mpi_rank == mpi_size-1) THEN 117 data_iend = nbp_lon 118 ELSE 119 data_iend = ii_end + 1 120 END IF 121 122 if (prt_level>=10) then 123 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end 124 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat 125 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 126 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend 127 write(lunout,*) "init_iophy_new: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn 128 endif 129 130 ! Initialize the XIOS domain coreesponding to this process: 131 CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, & 132 1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end, & 133 klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend, & 134 io_lat, io_lon,is_south_pole_dyn,mpi_rank) 135 ENDIF 152 136 !$OMP END MASTER 153 137 … … 184 168 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 185 169 186 #ifdef CPP_XIOS187 170 188 171 ! SUBROUTINE histbeg_phyxios(name,itau0,zjulian,dtime,ffreq,lev,nhori,nid_day) … … 213 196 END SUBROUTINE histbeg_phyxios 214 197 215 #endif216 198 217 199 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 339 321 340 322 ! VERSION DES HISTWRITE DEDIEES AU TOUT-XIOS-XML DEJA UTILISEE DANS PHYDEV 341 #ifdef CPP_XIOS 323 342 324 SUBROUTINE histwrite2d_xios(field_name,field) 343 325 USE dimphy, only: klon 344 326 USE mod_phys_lmdz_para, only: gather_omp, grid1Dto2D_mpi, & 345 327 jj_nb, klon_mpi 346 USE xios, only: xios_send_field328 USE lmdz_xios, only: xios_send_field 347 329 USE print_control_mod, ONLY: prt_level, lunout 348 330 USE mod_grid_phy_lmdz, ONLY: nbp_lon … … 368 350 IF (prt_level >= 10) WRITE(lunout,*)'End histrwrite2d_xios ',trim(field_name) 369 351 END SUBROUTINE histwrite2d_xios 370 #endif371 352 372 353 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 373 354 374 355 ! VERSION DES HISTWRITE DEDIEES AU TOUT-XIOS-XML DEJA UTILISEE DANS PHYDEV 375 #ifdef CPP_XIOS 356 376 357 SUBROUTINE histwrite3d_xios(field_name, field) 377 358 USE dimphy, only: klon, klev 378 359 USE mod_phys_lmdz_para, only: gather_omp, grid1Dto2D_mpi, & 379 360 jj_nb, klon_mpi 380 USE xios, only: xios_send_field361 USE lmdz_xios, only: xios_send_field 381 362 USE print_control_mod, ONLY: prt_level,lunout 382 363 USE mod_grid_phy_lmdz, ONLY: nbp_lon … … 407 388 IF (prt_level >= 10) write(lunout,*)'End histrwrite3d_xios ',trim(field_name) 408 389 END SUBROUTINE histwrite3d_xios 409 #endif410 390 411 391 end module iophy -
LMDZ6/trunk/libf/phydev/physiq_mod.F90
r2643 r4619 23 23 USE mod_grid_phy_lmdz, ONLY: nbp_lon,nbp_lat 24 24 25 #ifdef CPP_XIOS 26 USE xios, ONLY: xios_update_calendar 25 USE lmdz_xios, ONLY: xios_update_calendar, using_xios 27 26 USE wxios, only: wxios_add_vaxis, wxios_set_cal, wxios_closedef 28 27 USE iophy, ONLY: histwrite_phy 29 #endif30 28 31 29 IMPLICIT none … … 126 124 #endif 127 125 128 #ifdef CPP_XIOS 126 IF (using_xios) THEN 129 127 !XIOS 130 ! Declare available vertical axes to be used in output files:131 CALL wxios_add_vaxis("presnivs", klev, presnivs)128 ! Declare available vertical axes to be used in output files: 129 CALL wxios_add_vaxis("presnivs", klev, presnivs) 132 130 133 ! Declare calendar and time step134 CALL wxios_set_cal(dtime,"earth_360d",1,1,1,0.0,1,1,1,0.0)131 ! Declare calendar and time step 132 CALL wxios_set_cal(dtime,"earth_360d",1,1,1,0.0,1,1,1,0.0) 135 133 136 !Finalize the context:137 CALL wxios_closedef()138 #endif 134 !Finalize the context: 135 CALL wxios_closedef() 136 ENDIF 139 137 !$OMP END MASTER 140 138 !$OMP BARRIER … … 176 174 177 175 !XIOS 178 #ifdef CPP_XIOS 179 !$OMP MASTER176 IF (using_xios) THEN 177 !$OMP MASTER 180 178 !Increment XIOS time 181 179 CALL xios_update_calendar(itau) 182 !$OMP END MASTER183 !$OMP BARRIER180 !$OMP END MASTER 181 !$OMP BARRIER 184 182 185 183 !Send fields to XIOS: (NB these fields must also be defined as … … 190 188 CALL histwrite_phy("v",v) 191 189 CALL histwrite_phy("ps",paprs(:,1)) 192 #endif 190 ENDIF 193 191 194 192 ! if lastcall, then it is time to write "restartphy.nc" file -
LMDZ6/trunk/libf/phylmd/Dust/phys_output_write_spl_mod.F90
r4593 r4619 389 389 USE iophy, ONLY: set_itau_iophy, histwrite_phy 390 390 USE netcdf, ONLY: nf90_fill_real 391 392 #ifdef CPP_XIOS393 391 ! ug Pour les sorties XIOS 394 USE xios, ONLY: xios_update_calendar 395 USE wxios, ONLY: wxios_closedef, missing_val 396 #endif 392 USE lmdz_xios, ONLY: xios_update_calendar, using_xios 393 USE wxios, ONLY: wxios_closedef, missing_val_xios => missing_val 397 394 USE phys_cal_mod, ONLY : mth_len 398 395 … … 438 435 INTEGER, DIMENSION(iim*jjmp1*klev) :: ndex3d 439 436 REAL, PARAMETER :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2 440 ! REAL, PARAMETER :: missing_val=nf90_fill_real441 #ifndef CPP_XIOS442 437 REAL :: missing_val 443 #endif444 438 REAL, PARAMETER :: un_jour=86400. 439 440 IF (using_xios) THEN 441 missing_val=missing_val_xios 442 ELSE 443 missing_val=nf90_fill_real 444 ENDIF 445 445 446 446 ! On calcul le nouveau tau: … … 460 460 ! ug la boucle qui suit ne sert qu'une fois, pour l'initialisation, sinon il n'y a toujours qu'un seul passage: 461 461 DO iinit=1, iinitend 462 #ifdef CPP_XIOS 463 !$OMP MASTER 464 IF (vars_defined) THEN 465 IF (prt_level >= 10) THEN 466 write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w 467 ENDIF 468 ! CALL xios_update_calendar(itau_w) 469 CALL xios_update_calendar(itap) 470 ENDIF 471 !$OMP END MASTER 472 !$OMP BARRIER 473 #endif 462 IF (using_xios) THEN 463 !$OMP MASTER 464 IF (vars_defined) THEN 465 IF (prt_level >= 10) THEN 466 write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w 467 ENDIF 468 ! CALL xios_update_calendar(itau_w) 469 CALL xios_update_calendar(itap) 470 ENDIF 471 !$OMP END MASTER 472 !$OMP BARRIER 473 ENDIF !using_xios 474 474 475 ! On procède à l'écriture ou à la définition des nombreuses variables: 475 476 !!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 828 829 829 830 #ifdef CPP_IOIPSL 830 #ifndef CPP_XIOS 831 IF (.NOT.ok_all_xml) THEN832 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX:833 ! Champs interpolles sur des niveaux de pression834 missing_val=missing_val_nf90835 DO iff=1, nfiles836 ll=0837 DO k=1, nlevSTD838 bb2=clevSTD(k)839 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. &840 bb2.EQ."500".OR.bb2.EQ."200".OR. &841 bb2.EQ."100".OR. &842 bb2.EQ."50".OR.bb2.EQ."10") THEN 843 844 ! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!845 ll=ll+1846 CALL histwrite_phy(o_uSTDlevs(ll),uwriteSTD(:,k,iff), iff)847 CALL histwrite_phy(o_vSTDlevs(ll),vwriteSTD(:,k,iff), iff)848 CALL histwrite_phy(o_wSTDlevs(ll),wwriteSTD(:,k,iff), iff)849 CALL histwrite_phy(o_zSTDlevs(ll),phiwriteSTD(:,k,iff), iff)850 CALL histwrite_phy(o_qSTDlevs(ll),qwriteSTD(:,k,iff), iff)851 CALL histwrite_phy(o_tSTDlevs(ll),twriteSTD(:,k,iff), iff) 852 853 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.854 855 ENDDO856 ENDIF 831 IF (.NOT. using_xios) THEN 832 IF (.NOT.ok_all_xml) THEN 833 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX: 834 ! Champs interpolles sur des niveaux de pression 835 DO iff=1, nfiles 836 ll=0 837 DO k=1, nlevSTD 838 bb2=clevSTD(k) 839 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. & 840 bb2.EQ."500".OR.bb2.EQ."200".OR. & 841 bb2.EQ."100".OR. & 842 bb2.EQ."50".OR.bb2.EQ."10") THEN 843 844 ! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 845 ll=ll+1 846 CALL histwrite_phy(o_uSTDlevs(ll),uwriteSTD(:,k,iff), iff) 847 CALL histwrite_phy(o_vSTDlevs(ll),vwriteSTD(:,k,iff), iff) 848 CALL histwrite_phy(o_wSTDlevs(ll),wwriteSTD(:,k,iff), iff) 849 CALL histwrite_phy(o_zSTDlevs(ll),phiwriteSTD(:,k,iff), iff) 850 CALL histwrite_phy(o_qSTDlevs(ll),qwriteSTD(:,k,iff), iff) 851 CALL histwrite_phy(o_tSTDlevs(ll),twriteSTD(:,k,iff), iff) 852 853 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR. 854 ENDDO 855 ENDDO 856 ENDIF 857 ENDIF !.NOT.using_xios 857 858 #endif 858 #endif 859 860 #ifdef CPP_XIOS 861 IF (ok_all_xml) THEN 862 !XIOS CALL xios_get_field_attr("u850",default_value=missing_val) 863 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 859 860 IF (using_xios) THEN 861 IF (ok_all_xml) THEN 862 !XIOS CALL xios_get_field_attr("u850",default_value=missing_val) 863 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 864 864 ll=0 865 865 DO k=1, nlevSTD … … 878 878 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR. 879 879 ENDDO 880 ENDIF881 #endif 880 ENDIF 881 ENDIF !using_xios 882 882 IF (vars_defined) THEN 883 883 DO i=1, klon … … 1471 1471 !!!!!!!!!!!! Sorties niveaux de pression NMC !!!!!!!!!!!!!!!!!!!! 1472 1472 #ifdef CPP_IOIPSL 1473 #ifndef CPP_XIOS 1474 IF (.NOT. ok_all_xml) THEN1475 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX:1476 ! Champs interpolles sur des niveaux de pression1477 missing_val=missing_val_nf901473 1474 IF (.NOT. using_xios) THEN 1475 IF (.NOT.ok_all_xml) THEN 1476 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX: 1477 ! Champs interpolles sur des niveaux de pression 1478 1478 DO iff=7, nfiles-1 !--here we deal with files 7,8 and 9 1479 1479 … … 1539 1539 CALL histwrite_phy(o_TxT,T2sumSTD(:,:,iff-6),iff) 1540 1540 ENDDO !nfiles 1541 ENDIF 1541 1542 ENDIF 1542 1543 #endif 1543 #endif 1544 #ifdef CPP_XIOS 1544 1545 IF (using_xios) THEN 1545 1546 IF (ok_all_xml) THEN 1546 1547 ! DO iff=7, nfiles … … 1607 1608 CALL histwrite_phy(o_TxT,T2STD(:,:)) 1608 1609 ! ENDDO !nfiles 1609 ENDIF1610 #endif 1610 ENDIF 1611 ENDIF !using_xios 1611 1612 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1612 1613 itr = 0 … … 1651 1652 ENDDO ! iff 1652 1653 #endif 1653 #ifdef CPP_XIOS1654 1654 !On finalise l'initialisation: 1655 CALL wxios_closedef() 1656 #endif 1655 IF (using_xios) CALL wxios_closedef() 1657 1656 1658 1657 !$OMP END MASTER -
LMDZ6/trunk/libf/phylmd/cosp/cosp_output_mod.F90
r3308 r4619 235 235 USE time_phylmdz_mod, ONLY: day_ref, annee_ref, day_ini, start_time, itau_phy 236 236 USE print_control_mod, ONLY: lunout 237 238 #ifdef CPP_XIOS 239 ! ug Pour les sorties XIOS 240 USE wxios 241 #endif 237 ! ug Pour les sorties XIOS 238 USE wxios 242 239 243 240 IMPLICIT NONE … … 263 260 !!! Variables d'entree 264 261 265 #ifdef CPP_XIOS 266 ! ug Variables utilisées pour récupérer le calendrier pour xios 267 INTEGER :: x_an, x_mois, x_jour 268 REAL :: x_heure 269 INTEGER :: ini_an, ini_mois, ini_jour 270 REAL :: ini_heure 271 #endif 262 ! ug Variables utilisées pour récupérer le calendrier pour xios 263 INTEGER :: x_an, x_mois, x_jour 264 REAL :: x_heure 265 INTEGER :: ini_an, ini_mois, ini_jour 266 REAL :: ini_heure 272 267 273 268 WRITE(lunout,*) 'Debut cosp_output_mod.F90' … … 316 311 CALL ymds2ju(annee_ref, 1, day_ini, start_time, zjulian_start) 317 312 318 #ifdef CPP_XIOS 313 IF (using_xios) THEN 319 314 320 ! recuperer la valeur indefine Xios321 ! CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value)322 ! Cosp_fill_value=missing_val323 Cosp_fill_value=0.324 print*,'Cosp_fill_value=',Cosp_fill_value325 ! if (use_vgrid) then326 ! print*,'vgrid%Nlvgrid, vgrid%z = ',vgrid%Nlvgrid, vgrid%z327 CALL wxios_add_vaxis("height", vgrid%Nlvgrid, vgrid%z)328 print*,'wxios_add_vaxis '329 ! else330 ! WRITE(lunout,*) 'wxios_add_vaxis "presnivs", vgrid%Nlvgrid ',vgrid%Nlvgrid331 ! CALL wxios_add_vaxis("presnivs", vgrid%Nlvgrid, presnivs)332 ! endif333 WRITE(lunout,*) 'wxios_add_vaxis height_mlev, Nlevlmdz ',Nlevlmdz334 CALL wxios_add_vaxis("height_mlev", Nlevlmdz, vgrid%mz)335 WRITE(lunout,*) 'wxios_add_vaxis sza, PARASOL_NREFL ',PARASOL_NREFL336 CALL wxios_add_vaxis("sza", PARASOL_NREFL, PARASOL_SZA)337 WRITE(lunout,*) 'wxios_add_vaxis pressure2 ',7338 CALL wxios_add_vaxis("pressure2", 7, ISCCP_PC)339 WRITE(lunout,*) 'wxios_add_vaxis column ',Ncolumns340 CALL wxios_add_vaxis("column", Ncolumns, column_ax)341 342 ! AI nov 2015343 CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP)344 CALL wxios_add_vaxis("cth", MISR_N_CTH, MISR_CTH)345 CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax)346 CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax)347 CALL wxios_add_vaxis("ReffIce", numMODISReffIceBins, reffICE_binCenters)348 CALL wxios_add_vaxis("ReffLiq", numMODISReffLiqBins, reffLIQ_binCenters)349 print*,'reffICE_binCenters=',reffICE_binCenters350 CALL wxios_add_vaxis("tau", 7, ISCCP_TAU)351 352 #endif 315 ! recuperer la valeur indefine Xios 316 ! CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value) 317 ! Cosp_fill_value=missing_val 318 Cosp_fill_value=0. 319 print*,'Cosp_fill_value=',Cosp_fill_value 320 ! if (use_vgrid) then 321 ! print*,'vgrid%Nlvgrid, vgrid%z = ',vgrid%Nlvgrid, vgrid%z 322 CALL wxios_add_vaxis("height", vgrid%Nlvgrid, vgrid%z) 323 print*,'wxios_add_vaxis ' 324 ! else 325 ! WRITE(lunout,*) 'wxios_add_vaxis "presnivs", vgrid%Nlvgrid ',vgrid%Nlvgrid 326 ! CALL wxios_add_vaxis("presnivs", vgrid%Nlvgrid, presnivs) 327 ! endif 328 WRITE(lunout,*) 'wxios_add_vaxis height_mlev, Nlevlmdz ',Nlevlmdz 329 CALL wxios_add_vaxis("height_mlev", Nlevlmdz, vgrid%mz) 330 WRITE(lunout,*) 'wxios_add_vaxis sza, PARASOL_NREFL ',PARASOL_NREFL 331 CALL wxios_add_vaxis("sza", PARASOL_NREFL, PARASOL_SZA) 332 WRITE(lunout,*) 'wxios_add_vaxis pressure2 ',7 333 CALL wxios_add_vaxis("pressure2", 7, ISCCP_PC) 334 WRITE(lunout,*) 'wxios_add_vaxis column ',Ncolumns 335 CALL wxios_add_vaxis("column", Ncolumns, column_ax) 336 337 ! AI nov 2015 338 CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP) 339 CALL wxios_add_vaxis("cth", MISR_N_CTH, MISR_CTH) 340 CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax) 341 CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax) 342 CALL wxios_add_vaxis("ReffIce", numMODISReffIceBins, reffICE_binCenters) 343 CALL wxios_add_vaxis("ReffLiq", numMODISReffLiqBins, reffLIQ_binCenters) 344 print*,'reffICE_binCenters=',reffICE_binCenters 345 CALL wxios_add_vaxis("tau", 7, ISCCP_TAU) 346 347 ENDIF 353 348 354 349 zdtimemoy_cosp = freq_COSP ! Frequence ou l on moyenne … … 363 358 ! nhoricosp(iff),cosp_nidfiles(iff) 364 359 365 #ifdef CPP_XIOS 366 IF (.not. ok_all_xml) then367 WRITE(lunout,*) 'wxios_add_file ',cosp_outfilenames(iff)368 CALL wxios_add_file(cosp_outfilenames(iff),chfreq(iff),10)369 ENDIF370 #endif 360 IF (using_xios) THEN 361 IF (.not. ok_all_xml) then 362 WRITE(lunout,*) 'wxios_add_file ',cosp_outfilenames(iff) 363 CALL wxios_add_file(cosp_outfilenames(iff),chfreq(iff),10) 364 ENDIF 365 ENDIF 371 366 372 367 #ifndef CPP_IOIPSL_NO_OUTPUT -
LMDZ6/trunk/libf/phylmd/cosp/cosp_output_write_mod.F90
r3308 r4619 26 26 USE time_phylmdz_mod, ONLY: itau_phy, start_time, day_step_phy 27 27 USE print_control_mod, ONLY: lunout,prt_level 28 29 #ifdef CPP_XIOS30 28 USE wxios, only: wxios_closedef 31 USE xios, only: xios_update_calendar, xios_field_is_active 32 #endif 29 USE lmdz_xios, only: xios_update_calendar, xios_field_is_active, using_xios 33 30 IMPLICIT NONE 34 31 !!! Variables d'entree … … 58 55 real, dimension(Npoints,MISR_N_CTH,7) :: tmp_fi4da_misr 59 56 60 #ifdef CPP_XIOS 61 missing_val=missing_cosp62 #else 63 missing_val=0.64 #endif 57 IF (using_xios) THEN 58 missing_val=missing_cosp 59 ELSE 60 missing_val=0. 61 ENDIF 65 62 66 63 Nlevout = vgrid%Nlvgrid … … 90 87 ! endif 91 88 92 !! #ifdef CPP_XIOS89 !!IF (using_xios) THEN 93 90 ! !$OMP MASTER 94 91 !IF (cosp_varsdefined) THEN … … 101 98 ! !$OMP END MASTER 102 99 ! !$OMP BARRIER 103 !! #endif100 !!ENDIF 104 101 105 102 !!!! Sorties Calipso … … 163 160 if (cfg%Lproftemp) CALL histwrite3d_cosp(o_proftemp,stlidar%proftemp,nvert) !TIBO 164 161 165 #ifdef CPP_XIOS 166 do icl=1,SR_BINS 167 tmp_fi4da_cfadL(:,:,icl)=stlidar%cfad_sr(:,icl,:) 168 enddo 169 ! if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr) 170 if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,tmp_fi4da_cfadL) 171 if (cfg%LprofSR) CALL histwrite4d_cosp(o_profSR,stlidar%profSR) !TIBO 172 #else 173 if (cfg%LcfadLidarsr532) then 162 IF (using_xios) THEN 174 163 do icl=1,SR_BINS 175 CALL histwrite3d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr(:,icl,:),nvert,icl)164 tmp_fi4da_cfadL(:,:,icl)=stlidar%cfad_sr(:,icl,:) 176 165 enddo 177 endif 178 if (cfg%LprofSR) then 179 do icl=1,Ncolumns !TIBO 180 CALL histwrite3d_cosp(o_profSR,stlidar%profSR(:,icl,:),nvert,icl) !TIBO 181 enddo !TIBO 182 endif 183 #endif 166 ! if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr) 167 if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,tmp_fi4da_cfadL) 168 if (cfg%LprofSR) CALL histwrite4d_cosp(o_profSR,stlidar%profSR) !TIBO 169 ELSE 170 if (cfg%LcfadLidarsr532) then 171 do icl=1,SR_BINS 172 CALL histwrite3d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr(:,icl,:),nvert,icl) 173 enddo 174 endif 175 if (cfg%LprofSR) then 176 do icl=1,Ncolumns !TIBO 177 CALL histwrite3d_cosp(o_profSR,stlidar%profSR(:,icl,:),nvert,icl) !TIBO 178 enddo !TIBO 179 endif 180 ENDIF 181 184 182 if (cfg%LparasolRefl) CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp) 185 183 … … 201 199 endif 202 200 203 #ifdef CPP_XIOS 204 if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot)205 #else 206 if (cfg%Latb532) then207 do icl=1,Ncolumns208 CALL histwrite3d_cosp(o_atb532,sglidar%beta_tot(:,icl,:),nvertmcosp,icl)209 enddo210 endif211 #endif 201 IF (using_xios) THEN 202 if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot) 203 ELSE 204 if (cfg%Latb532) then 205 do icl=1,Ncolumns 206 CALL histwrite3d_cosp(o_atb532,sglidar%beta_tot(:,icl,:),nvertmcosp,icl) 207 enddo 208 endif 209 ENDIF 212 210 213 211 if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp) … … 219 217 220 218 where(stradar%cfad_ze == R_UNDEF) stradar%cfad_ze = missing_val 221 #ifdef CPP_XIOS 222 do icl=1,DBZE_BINS223 tmp_fi4da_cfadR(:,:,icl)=stradar%cfad_ze(:,icl,:)224 enddo225 if (cfg%Ldbze94) CALL histwrite4d_cosp(o_dbze94,sgradar%Ze_tot)226 !if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze)227 if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR)228 #else 229 if (cfg%Ldbze94) then230 do icl=1,Ncolumns231 CALL histwrite3d_cosp(o_dbze94,sgradar%Ze_tot(:,icl,:),nvert,icl)232 enddo233 endif234 if (cfg%LcfadDbze94) then235 do icl=1,DBZE_BINS236 CALL histwrite3d_cosp(o_cfadDbze94,stradar%cfad_ze(:,icl,:),nvert,icl)237 enddo238 endif239 #endif 219 IF (using_xios) THEN 220 do icl=1,DBZE_BINS 221 tmp_fi4da_cfadR(:,:,icl)=stradar%cfad_ze(:,icl,:) 222 enddo 223 if (cfg%Ldbze94) CALL histwrite4d_cosp(o_dbze94,sgradar%Ze_tot) 224 ! if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze) 225 if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR) 226 ELSE 227 if (cfg%Ldbze94) then 228 do icl=1,Ncolumns 229 CALL histwrite3d_cosp(o_dbze94,sgradar%Ze_tot(:,icl,:),nvert,icl) 230 enddo 231 endif 232 if (cfg%LcfadDbze94) then 233 do icl=1,DBZE_BINS 234 CALL histwrite3d_cosp(o_cfadDbze94,stradar%cfad_ze(:,icl,:),nvert,icl) 235 enddo 236 endif 237 ENDIF 240 238 endif 241 239 ! endif pour radar … … 264 262 265 263 CALL histwrite2d_cosp(o_sunlit,gbx%sunlit) 266 #ifdef CPP_XIOS 267 if (cfg%Lclisccp) CALL histwrite4d_cosp(o_clisccp2,isccp%fq_isccp)268 #else 269 if (cfg%Lclisccp) then270 do icl=1,7271 CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl)272 enddo273 endif274 #endif 264 IF (using_xios) THEN 265 if (cfg%Lclisccp) CALL histwrite4d_cosp(o_clisccp2,isccp%fq_isccp) 266 ELSE 267 if (cfg%Lclisccp) then 268 do icl=1,7 269 CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl) 270 enddo 271 endif 272 ENDIF 275 273 276 274 if (cfg%Lboxtauisccp) CALL histwrite3d_cosp(o_boxtauisccp,isccp%boxtau,nvertcol) … … 288 286 where(misr%fq_MISR == R_UNDEF) misr%fq_MISR = missing_val 289 287 290 #ifdef CPP_XIOS 291 do icl=1,MISR_N_CTH292 tmp_fi4da_misr(:,icl,:)=misr%fq_MISR(:,:,icl)293 enddo294 ! if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR)295 if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,tmp_fi4da_misr)296 #else 297 if (cfg%LclMISR) then298 do icl=1,7299 CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl)300 enddo301 endif302 #endif 288 IF (using_xios) THEN 289 do icl=1,MISR_N_CTH 290 tmp_fi4da_misr(:,icl,:)=misr%fq_MISR(:,:,icl) 291 enddo 292 ! if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR) 293 if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,tmp_fi4da_misr) 294 ELSE 295 if (cfg%LclMISR) then 296 do icl=1,7 297 CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl) 298 enddo 299 endif 300 ENDIF 303 301 endif 304 302 ! endif pour Misr … … 365 363 modis%Optical_Thickness_vs_Cloud_Top_Pressure = missing_val 366 364 367 #ifdef CPP_XIOS 368 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_clmodis,modis%Optical_Thickness_vs_Cloud_Top_Pressure)369 #else 370 if (cfg%Lclmodis) then371 do icl=1,7372 CALL histwrite3d_cosp(o_clmodis, &373 modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl)374 enddo375 endif376 #endif 365 IF (using_xios) THEN 366 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_clmodis,modis%Optical_Thickness_vs_Cloud_Top_Pressure) 367 ELSE 368 if (cfg%Lclmodis) then 369 do icl=1,7 370 CALL histwrite3d_cosp(o_clmodis, & 371 modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl) 372 enddo 373 endif 374 ENDIF 377 375 378 376 where(modis%Optical_Thickness_vs_ReffIce == R_UNDEF) & … … 382 380 modis%Optical_Thickness_vs_ReffLiq = missing_val 383 381 384 #ifdef CPP_XIOS 385 if (cfg%Lcrimodis) CALL histwrite4d_cosp(o_crimodis,modis%Optical_Thickness_vs_ReffIce)386 if (cfg%Lcrlmodis) CALL histwrite4d_cosp(o_crlmodis,modis%Optical_Thickness_vs_ReffLiq)387 #else 388 if (cfg%Lcrimodis) then389 do icl=1,7390 CALL histwrite3d_cosp(o_crimodis, &391 modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl)392 enddo393 endif394 if (cfg%Lcrlmodis) then395 do icl=1,7396 CALL histwrite3d_cosp(o_crlmodis, &397 modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl)398 enddo399 endif400 #endif 382 IF (using_xios) THEN 383 if (cfg%Lcrimodis) CALL histwrite4d_cosp(o_crimodis,modis%Optical_Thickness_vs_ReffIce) 384 if (cfg%Lcrlmodis) CALL histwrite4d_cosp(o_crlmodis,modis%Optical_Thickness_vs_ReffLiq) 385 ELSE 386 if (cfg%Lcrimodis) then 387 do icl=1,7 388 CALL histwrite3d_cosp(o_crimodis, & 389 modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl) 390 enddo 391 endif 392 if (cfg%Lcrlmodis) then 393 do icl=1,7 394 CALL histwrite3d_cosp(o_crlmodis, & 395 modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl) 396 enddo 397 endif 398 ENDIF 401 399 endif !modis 402 400 … … 410 408 ENDDO ! iff 411 409 #endif 412 ! Fermeture dans phys_output_write413 !#ifdef CPP_XIOS414 !On finalise l'initialisation:415 !CALL wxios_closedef()416 !#endif417 410 418 411 !$OMP END MASTER … … 451 444 USE mod_grid_phy_lmdz, ONLY: nbp_lon 452 445 USE print_control_mod, ONLY: lunout,prt_level 453 #ifdef CPP_XIOS 454 USE wxios 455 #endif 446 USE wxios 456 447 457 448 IMPLICIT NONE … … 485 476 ENDIF 486 477 487 #ifdef CPP_XIOS 488 IF (.not. ok_all_xml) then489 IF ( var%cles(iff) ) THEN490 if (prt_level >= 10) then491 492 endif493 CALL wxios_add_field_to_file(var%name, 2, cosp_nidfiles(iff), cosp_outfilenames(iff), &478 IF (using_xios) THEN 479 IF (.not. ok_all_xml) then 480 IF ( var%cles(iff) ) THEN 481 if (prt_level >= 10) then 482 WRITE(lunout,*)'Appel wxios_add_field_to_file var%name =',var%name 483 endif 484 CALL wxios_add_field_to_file(var%name, 2, cosp_nidfiles(iff), cosp_outfilenames(iff), & 494 485 var%description, var%unit, 1, typeecrit) 495 ENDIF496 ENDIF497 #endif 486 ENDIF 487 ENDIF 488 ENDIF 498 489 499 490 #ifndef CPP_IOIPSL_NO_OUTPUT … … 514 505 USE mod_grid_phy_lmdz, ONLY: nbp_lon 515 506 USE print_control_mod, ONLY: lunout,prt_level 516 517 #ifdef CPP_XIOS 518 USE wxios 519 #endif 520 507 USE wxios 521 508 522 509 IMPLICIT NONE … … 591 578 ENDIF 592 579 593 #ifdef CPP_XIOS 580 IF (using_xios) THEN 594 581 IF (.not. ok_all_xml) then 595 582 IF ( var%cles(iff) ) THEN … … 601 588 ENDIF 602 589 ENDIF 603 #endif 590 ENDIF 604 591 605 592 #ifndef CPP_IOIPSL_NO_OUTPUT … … 621 608 USE mod_grid_phy_lmdz, ONLY: nbp_lon 622 609 USE print_control_mod, ONLY: lunout,prt_level 623 624 #ifdef CPP_XIOS 625 USE xios, only: xios_send_field 626 #endif 610 USE lmdz_xios, only: xios_send_field, using_xios 627 611 628 612 IMPLICIT NONE … … 672 656 CALL histwrite(cosp_nidfiles(iff),var%name,itau_iocosp,Field2d,nbp_lon*jj_nb,index2d) 673 657 #endif 674 675 #ifdef CPP_XIOS 658 deallocate(index2d) 659 IF (using_xios) THEN 676 660 IF (.not. ok_all_xml) then 677 661 if (firstx) then … … 683 667 endif 684 668 ENDIF 685 #endif 686 669 ENDIF 670 ENDIF 687 671 ENDDO 688 672 689 #ifdef CPP_XIOS 673 IF (using_xios) THEN 690 674 IF (ok_all_xml) THEN 691 675 if (prt_level >= 1) then … … 694 678 CALL xios_send_field(var%name, Field2d) 695 679 ENDIF 696 #endif 680 ENDIF 697 681 698 682 !$OMP END MASTER … … 710 694 USE mod_grid_phy_lmdz, ONLY: nbp_lon 711 695 USE print_control_mod, ONLY: lunout,prt_level 712 713 #ifdef CPP_XIOS 714 USE xios, only: xios_send_field 715 #endif 716 696 USE lmdz_xios, only: xios_send_field, using_xios 717 697 718 698 IMPLICIT NONE … … 776 756 #endif 777 757 778 #ifdef CPP_XIOS 758 IF (using_xios) THEN 779 759 IF (.not. ok_all_xml) then 780 760 IF (firstx) THEN … … 784 764 ENDIF 785 765 ENDIF 786 #endif 766 ENDIF 787 767 deallocate(index3d) 788 768 ENDIF 789 769 ENDDO 790 #ifdef CPP_XIOS 770 771 IF (using_xios) THEN 791 772 IF (ok_all_xml) THEN 792 773 CALL xios_send_field(nom, Field3d(:,:,1:nlev)) 793 774 IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name 794 775 ENDIF 795 #endif 776 ENDIF 796 777 797 778 !$OMP END MASTER … … 809 790 USE mod_grid_phy_lmdz, ONLY: nbp_lon 810 791 USE print_control_mod, ONLY: lunout,prt_level 811 812 #ifdef CPP_XIOS 813 USE xios, only: xios_send_field 814 #endif 815 792 USE lmdz_xios, only: xios_send_field, using_xios 816 793 817 794 IMPLICIT NONE … … 842 819 CALL grid1Dto2D_mpi(buffer_omp,field4d) 843 820 844 #ifdef CPP_XIOS 821 IF (using_xios) THEN 845 822 ! IF (ok_all_xml) THEN 846 823 CALL xios_send_field(var%name, Field4d(:,:,1:nlev,1:nlev2)) 847 824 IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name 848 825 ! ENDIF 849 #endif 826 ENDIF 850 827 851 828 !$OMP END MASTER -
LMDZ6/trunk/libf/phylmd/cosp/cosp_read_otputkeys.F90
r3377 r4619 226 226 227 227 SUBROUTINE READ_COSP_OUTPUT_NL(itap,cosp_nl,cfg) 228 229 #ifdef CPP_XIOS 230 USE xios, ONLY: xios_field_is_active 231 #endif 228 USE lmdz_xios, ONLY: xios_field_is_active, using_xios 232 229 implicit none 233 230 character(len=*),intent(in) :: cosp_nl … … 746 743 USE MOD_COSP_CONSTANTS 747 744 USE MOD_COSP_TYPES 748 #ifdef CPP_XIOS 749 USE xios, ONLY: xios_field_is_active 750 #endif 745 USE lmdz_xios, ONLY: xios_field_is_active,using_xios 751 746 implicit none 752 747 type(cosp_config),intent(out) :: cfg 753 748 integer :: i 754 755 #ifdef CPP_XIOS756 749 757 750 logical :: Lradar_sim,Llidar_sim,Lisccp_sim,Lmodis_sim,Lmisr_sim,Lrttov_sim, Lstats, & … … 776 769 character(len=32) :: out_list(N_OUT_LIST) 777 770 778 do i=1,N_OUT_LIST 779 cfg%out_list(i)='' 780 enddo 771 IF (using_xios) THEN 772 773 do i=1,N_OUT_LIST 774 cfg%out_list(i)='' 775 enddo 781 776 782 777 LcfadDbze94 = .false. … … 1232 1227 cfg%Lrttov_sim = Lrttov_sim 1233 1228 1234 #endif 1229 ENDIF ! using_xios 1235 1230 1236 1231 END SUBROUTINE read_xiosfieldactive -
LMDZ6/trunk/libf/phylmd/cosp/mod_cosp.F90
r4593 r4619 23 23 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 25 INCLUDE"cosp_defs.h"25 #include "cosp_defs.h" 26 26 MODULE MOD_COSP 27 27 USE MOD_COSP_TYPES -
LMDZ6/trunk/libf/phylmd/cosp/mod_cosp_constants.F90
r4593 r4619 33 33 ! 34 34 35 INCLUDE "cosp_defs.h"35 #INCLUDE "cosp_defs.h" 36 36 MODULE MOD_COSP_CONSTANTS 37 37 IMPLICIT NONE -
LMDZ6/trunk/libf/phylmd/cosp/mod_cosp_simulator.F90
r4593 r4619 31 31 ! 32 32 33 INCLUDE"cosp_defs.h"33 #include "cosp_defs.h" 34 34 MODULE MOD_COSP_SIMULATOR 35 35 USE MOD_COSP_CONSTANTS, ONLY: I_RADAR, I_LIDAR, I_ISCCP, I_MISR, I_MODIS, & -
LMDZ6/trunk/libf/phylmd/cosp/mod_cosp_stats.F90
r4593 r4619 36 36 ! 37 37 ! 38 INCLUDE"cosp_defs.h"38 #include "cosp_defs.h" 39 39 MODULE MOD_COSP_STATS 40 40 USE MOD_COSP_CONSTANTS -
LMDZ6/trunk/libf/phylmd/cosp/phys_cosp.F90
r4593 r4619 73 73 74 74 !! AI rajouter 75 INCLUDE"cosp_defs.h"75 #include "cosp_defs.h" 76 76 USE MOD_COSP_CONSTANTS 77 77 USE MOD_COSP_TYPES … … 84 84 use cosp_output_write_mod 85 85 ! use MOD_COSP_Modis_Simulator, only : cosp_modis 86 #ifdef CPP_XIOS 87 USE xios, ONLY: xios_field_is_active 88 #endif 86 USE lmdz_xios, ONLY: xios_field_is_active, using_xios 89 87 use cosp_read_otputkeys 90 88 … … 183 181 184 182 ! Clefs Outputs initialisation 185 #ifdef CPP_XIOS 186 call cosp_outputkeys_init(cfg) 187 #else 188 call read_cosp_output_nl(itap,cosp_output_nl,cfg) 189 #endif 183 IF (using_xios) THEN 184 call cosp_outputkeys_init(cfg) 185 ELSE 186 call read_cosp_output_nl(itap,cosp_output_nl,cfg) 187 ENDIF 188 190 189 !!! call cosp_outputkeys_test(cfg) 191 190 print*,' Cles des differents simulateurs cosp a itap :',itap … … 203 202 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 204 203 if ((itap.gt.1).and.(first_write))then 205 #ifdef CPP_XIOS 206 call read_xiosfieldactive(cfg)207 #endif 204 205 IF (using_xios) call read_xiosfieldactive(cfg) 206 208 207 first_write=.false. 209 208 -
LMDZ6/trunk/libf/phylmd/cosp2/cosp_interface_v1p4.F90
r4593 r4619 30 30 ! May 2015 - D. Swales - Original version 31 31 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 INCLUDE"cosp_defs.h"32 #include "cosp_defs.h" 33 33 MODULE MOD_COSP_INTERFACE_v1p4 34 34 use COSP_KINDS, only: wp,dp -
LMDZ6/trunk/libf/phylmd/cosp2/cosp_output_mod.F90
r3435 r4619 246 246 USE time_phylmdz_mod, ONLY: day_ref, annee_ref, day_ini, start_time, itau_phy 247 247 USE print_control_mod, ONLY: lunout 248 249 #ifdef CPP_XIOS250 248 ! ug Pour les sorties XIOS 251 USE wxios 252 #endif 249 USE wxios 253 250 254 251 IMPLICIT NONE … … 275 272 !!! Variables d'entree 276 273 277 #ifdef CPP_XIOS 278 ! ug Variables utilisées pour récupérer le calendrier pour xios 279 INTEGER :: x_an, x_mois, x_jour 280 REAL :: x_heure 281 INTEGER :: ini_an, ini_mois, ini_jour 282 REAL :: ini_heure 283 #endif 274 ! ug Variables utilisées pour récupérer le calendrier pour xios 275 INTEGER :: x_an, x_mois, x_jour 276 REAL :: x_heure 277 INTEGER :: ini_an, ini_mois, ini_jour 278 REAL :: ini_heure 284 279 285 280 WRITE(lunout,*) 'Debut cosp_output_mod.F90' … … 328 323 CALL ymds2ju(annee_ref, 1, day_ini, start_time, zjulian_start) 329 324 330 #ifdef CPP_XIOS 331 332 ! recuperer la valeur indefine Xios333 ! CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value)334 ! Cosp_fill_value=missing_val335 336 337 338 CALL wxios_add_vaxis("height", vgrid%Nlvgrid, vgrid%z)339 print*,'wxios_add_vaxis vgrid%Nlvgrid, vgrid%z',vgrid%Nlvgrid,vgrid%z340 341 WRITE(lunout,*) 'wxios_add_vaxis height_mlev, Nlevlmdz vgrid%mz ', &325 IF (using_xios) THEN 326 327 ! recuperer la valeur indefine Xios 328 ! CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value) 329 ! Cosp_fill_value=missing_val 330 Cosp_fill_value=0. 331 print*,'Cosp_fill_value=',Cosp_fill_value 332 333 CALL wxios_add_vaxis("height", vgrid%Nlvgrid, vgrid%z) 334 print*,'wxios_add_vaxis vgrid%Nlvgrid, vgrid%z',vgrid%Nlvgrid,vgrid%z 335 336 WRITE(lunout,*) 'wxios_add_vaxis height_mlev, Nlevlmdz vgrid%mz ', & 342 337 Nlevlmdz,vgrid%mz 343 CALL wxios_add_vaxis("height_mlev", Nlevlmdz, vgrid%mz)344 345 WRITE(lunout,*) 'wxios_add_vaxis sza, PARASOL_NREFL ', &346 PARASOL_NREFL, PARASOL_SZA347 CALL wxios_add_vaxis("sza", PARASOL_NREFL, PARASOL_SZA)348 349 WRITE(lunout,*) 'wxios_add_vaxis pressure2 ',7,pres_binCenters350 CALL wxios_add_vaxis("pressure2", 7, pres_binCenters)351 352 WRITE(lunout,*) 'wxios_add_vaxis column ',Ncolumns,column_ax353 CALL wxios_add_vaxis("column", Ncolumns, column_ax)354 355 WRITE(lunout,*) 'wxios_add_vaxis temp LIDAR_NTEMP, LIDAR_PHASE_TEMP ', &338 CALL wxios_add_vaxis("height_mlev", Nlevlmdz, vgrid%mz) 339 340 WRITE(lunout,*) 'wxios_add_vaxis sza, PARASOL_NREFL ', & 341 PARASOL_NREFL, PARASOL_SZA 342 CALL wxios_add_vaxis("sza", PARASOL_NREFL, PARASOL_SZA) 343 344 WRITE(lunout,*) 'wxios_add_vaxis pressure2 ',7,pres_binCenters 345 CALL wxios_add_vaxis("pressure2", 7, pres_binCenters) 346 347 WRITE(lunout,*) 'wxios_add_vaxis column ',Ncolumns,column_ax 348 CALL wxios_add_vaxis("column", Ncolumns, column_ax) 349 350 WRITE(lunout,*) 'wxios_add_vaxis temp LIDAR_NTEMP, LIDAR_PHASE_TEMP ', & 356 351 LIDAR_NTEMP, LIDAR_PHASE_TEMP 357 CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP)358 359 WRITE(lunout,*) 'wxios_add_vaxis cth16 numMISRHgtBins, misr_histHgtCenters ', &360 numMISRHgtBins, misr_histHgtCenters361 CALL wxios_add_vaxis("cth16", numMISRHgtBins, misr_histHgtCenters)362 363 WRITE(lunout,*) 'wxios_add_vaxis dbze DBZE_BINS, dbze_ax ', &364 DBZE_BINS, dbze_ax365 CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax)366 367 WRITE(lunout,*) 'wxios_add_vaxis scatratio SR_BINS, sratio_ax', &368 SR_BINS, sratio_ax369 CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax)370 371 WRITE(lunout,*) 'wxios_add_vaxis ReffIce numMODISReffIceBins, &372 reffICE_binCenters',numMODISReffIceBins, reffICE_binCenters373 CALL wxios_add_vaxis("ReffIce", numMODISReffIceBins, reffICE_binCenters)374 375 WRITE(lunout,*) 'wxios_add_vaxis ReffLiq numMODISReffLiqBins, &352 CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP) 353 354 WRITE(lunout,*) 'wxios_add_vaxis cth16 numMISRHgtBins, misr_histHgtCenters ', & 355 numMISRHgtBins, misr_histHgtCenters 356 CALL wxios_add_vaxis("cth16", numMISRHgtBins, misr_histHgtCenters) 357 358 WRITE(lunout,*) 'wxios_add_vaxis dbze DBZE_BINS, dbze_ax ', & 359 DBZE_BINS, dbze_ax 360 CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax) 361 362 WRITE(lunout,*) 'wxios_add_vaxis scatratio SR_BINS, sratio_ax', & 363 SR_BINS, sratio_ax 364 CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax) 365 366 WRITE(lunout,*) 'wxios_add_vaxis ReffIce numMODISReffIceBins, & 367 reffICE_binCenters',numMODISReffIceBins, reffICE_binCenters 368 CALL wxios_add_vaxis("ReffIce", numMODISReffIceBins, reffICE_binCenters) 369 370 WRITE(lunout,*) 'wxios_add_vaxis ReffLiq numMODISReffLiqBins, & 376 371 reffLIQ_binCenters', numMODISReffLiqBins, reffLIQ_binCenters 377 CALL wxios_add_vaxis("ReffLiq", numMODISReffLiqBins, reffLIQ_binCenters)378 379 WRITE(lunout,*) 'wxios_add_vaxis 7, tau_binCenters', &380 7, tau_binCenters381 CALL wxios_add_vaxis("tau", 7, tau_binCenters)382 383 #endif 384 372 CALL wxios_add_vaxis("ReffLiq", numMODISReffLiqBins, reffLIQ_binCenters) 373 374 WRITE(lunout,*) 'wxios_add_vaxis 7, tau_binCenters', & 375 7, tau_binCenters 376 CALL wxios_add_vaxis("tau", 7, tau_binCenters) 377 378 ENDIF 379 385 380 zdtimemoy_cosp = freq_COSP ! Frequence ou l on moyenne 386 381 … … 394 389 ! nhoricosp(iff),cosp_nidfiles(iff) 395 390 396 #ifdef CPP_XIOS 397 IF (.not. ok_all_xml) then 398 WRITE(lunout,*) 'wxios_add_file ',cosp_outfilenames(iff) 399 CALL wxios_add_file(cosp_outfilenames(iff),chfreq(iff),10) 391 IF(using_xios) THEN 392 IF (.not. ok_all_xml) then 393 WRITE(lunout,*) 'wxios_add_file ',cosp_outfilenames(iff) 394 CALL wxios_add_file(cosp_outfilenames(iff),chfreq(iff),10) 395 ENDIF 400 396 ENDIF 401 #endif402 397 403 398 #ifndef CPP_IOIPSL_NO_OUTPUT -
LMDZ6/trunk/libf/phylmd/cosp2/cosp_output_write_mod.F90
r3398 r4619 36 36 USE time_phylmdz_mod, ONLY: itau_phy, start_time, day_step_phy 37 37 USE print_control_mod, ONLY: lunout,prt_level 38 39 #ifdef CPP_XIOS40 38 USE wxios, only: wxios_closedef 41 USE xios, only: xios_update_calendar, xios_field_is_active 42 #endif 39 USE lmdz_xios, only: xios_update_calendar, xios_field_is_active, using_xios 43 40 IMPLICIT NONE 44 41 !!! Variables d'entree … … 68 65 real, dimension(Npoints,numMISRHgtBins,7) :: tmp_fi4da_misr 69 66 70 #ifdef CPP_XIOS 71 missing_val=missing_cosp72 #else 73 missing_val=0.74 #endif 67 IF (using_xios) THEN 68 missing_val=missing_cosp 69 ELSE 70 missing_val=0. 71 ENDIF 75 72 76 73 Nlevout = vgrid%Nlvgrid … … 100 97 ! endif 101 98 102 !! #ifdef CPP_XIOS99 !! IF (using_xios) THEN 103 100 ! !$OMP MASTER 104 101 !IF (cosp_varsdefined) THEN … … 111 108 ! !$OMP END MASTER 112 109 ! !$OMP BARRIER 113 !! #endif110 !! ENDIF 114 111 115 112 !!!! Sorties Calipso … … 173 170 ! if (cfg%Lproftemp) CALL histwrite3d_cosp(o_proftemp,stlidar%proftemp,nvert) !TIBO 174 171 175 #ifdef CPP_XIOS 176 do icl=1,SR_BINS 172 IF (using_xios) THEN 173 174 do icl=1,SR_BINS 177 175 tmp_fi4da_cfadL(:,:,icl)=stlidar%cfad_sr(:,icl,:) 178 enddo176 enddo 179 177 ! if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr) 180 if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,tmp_fi4da_cfadL)178 if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,tmp_fi4da_cfadL) 181 179 ! if (cfg%LprofSR) CALL histwrite4d_cosp(o_profSR,stlidar%profSR) !TIBO 182 #else 183 if (cfg%LcfadLidarsr532) then184 do icl=1,SR_BINS180 ELSE 181 if (cfg%LcfadLidarsr532) then 182 do icl=1,SR_BINS 185 183 CALL histwrite3d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr(:,icl,:),nvert,icl) 186 enddo187 endif184 enddo 185 endif 188 186 ! if (cfg%LprofSR) then 189 187 ! do icl=1,Ncolumns !TIBO … … 191 189 ! enddo !TIBO 192 190 ! endif 193 #endif 191 ENDIF 192 194 193 if (cfg%LparasolRefl) CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp) 195 194 … … 211 210 endif 212 211 213 #ifdef CPP_XIOS 214 if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot) 215 #else 216 if (cfg%Latb532) then 217 do icl=1,Ncolumns 212 IF (using_xios) THEN 213 214 if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot) 215 ELSE 216 if (cfg%Latb532) then 217 do icl=1,Ncolumns 218 218 CALL histwrite3d_cosp(o_atb532,sglidar%beta_tot(:,icl,:),nvertmcosp,icl) 219 enddo220 endif221 #endif 219 enddo 220 endif 221 ENDIF 222 222 223 223 if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp) … … 229 229 230 230 where(stradar%cfad_ze == R_UNDEF) stradar%cfad_ze = missing_val 231 #ifdef CPP_XIOS 232 do icl=1,DBZE_BINS 233 tmp_fi4da_cfadR(:,:,icl)=stradar%cfad_ze(:,icl,:) 234 enddo 235 if (cfg%Ldbze94) CALL histwrite4d_cosp(o_dbze94,sgradar%Ze_tot) 236 ! if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze) 237 if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR) 238 #else 239 if (cfg%Ldbze94) then 240 do icl=1,Ncolumns 241 CALL histwrite3d_cosp(o_dbze94,sgradar%Ze_tot(:,icl,:),nvert,icl) 231 IF (using_xios) THEN 232 do icl=1,DBZE_BINS 233 tmp_fi4da_cfadR(:,:,icl)=stradar%cfad_ze(:,icl,:) 242 234 enddo 243 endif 244 if (cfg%LcfadDbze94) then 245 do icl=1,DBZE_BINS 246 CALL histwrite3d_cosp(o_cfadDbze94,stradar%cfad_ze(:,icl,:),nvert,icl) 247 enddo 248 endif 249 #endif 235 if (cfg%Ldbze94) CALL histwrite4d_cosp(o_dbze94,sgradar%Ze_tot) 236 ! if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze) 237 if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR) 238 ELSE 239 if (cfg%Ldbze94) then 240 do icl=1,Ncolumns 241 CALL histwrite3d_cosp(o_dbze94,sgradar%Ze_tot(:,icl,:),nvert,icl) 242 enddo 243 endif 244 if (cfg%LcfadDbze94) then 245 do icl=1,DBZE_BINS 246 CALL histwrite3d_cosp(o_cfadDbze94,stradar%cfad_ze(:,icl,:),nvert,icl) 247 enddo 248 endif 249 ENDIF 250 250 endif 251 251 ! endif pour radar … … 273 273 where(isccp%boxptop == R_UNDEF) isccp%boxptop = missing_val 274 274 275 276 #ifdef CPP_XIOS 277 if (cfg%Lclisccp) CALL histwrite4d_cosp(o_clisccp2,isccp%fq_isccp)278 #else 279 if (cfg%Lclisccp) then280 do icl=1,7281 CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl)282 enddo283 endif284 #endif 275 CALL histwrite2d_cosp(o_sunlit,gbx%sunlit) 276 IF (using_xios) THEN 277 if (cfg%Lclisccp) CALL histwrite4d_cosp(o_clisccp2,isccp%fq_isccp) 278 ELSE 279 if (cfg%Lclisccp) then 280 do icl=1,7 281 CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl) 282 enddo 283 endif 284 ENDIF 285 285 286 286 if (cfg%Lboxtauisccp) CALL histwrite3d_cosp(o_boxtauisccp,isccp%boxtau,nvertcol) … … 298 298 where(misr%fq_MISR == R_UNDEF) misr%fq_MISR = missing_val 299 299 300 #ifdef CPP_XIOS 301 do icl=1,numMISRHgtBins300 IF (using_xios) THEN 301 do icl=1,numMISRHgtBins 302 302 tmp_fi4da_misr(:,icl,:)=misr%fq_MISR(:,:,icl) 303 enddo303 enddo 304 304 ! if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR) 305 if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,tmp_fi4da_misr)306 #else 307 if (cfg%LclMISR) then308 do icl=1,7309 CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl)310 enddo311 endif312 #endif 305 if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,tmp_fi4da_misr) 306 ELSE 307 if (cfg%LclMISR) then 308 do icl=1,7 309 CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl) 310 enddo 311 endif 312 ENDIF 313 313 endif 314 314 ! endif pour Misr … … 375 375 modis%Optical_Thickness_vs_Cloud_Top_Pressure = missing_val 376 376 377 #ifdef CPP_XIOS 378 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_clmodis,modis%Optical_Thickness_vs_Cloud_Top_Pressure)379 #else 380 if (cfg%Lclmodis) then381 do icl=1,7382 CALL histwrite3d_cosp(o_clmodis, &383 modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl)384 enddo385 endif386 #endif 377 IF (using_xios) THEN 378 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_clmodis,modis%Optical_Thickness_vs_Cloud_Top_Pressure) 379 ELSE 380 if (cfg%Lclmodis) then 381 do icl=1,7 382 CALL histwrite3d_cosp(o_clmodis, & 383 modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl) 384 enddo 385 endif 386 ENDIF 387 387 388 388 where(modis%Optical_Thickness_vs_ReffIce == R_UNDEF) & … … 392 392 modis%Optical_Thickness_vs_ReffLiq = missing_val 393 393 394 #ifdef CPP_XIOS 395 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_crimodis,modis%Optical_Thickness_vs_ReffIce)396 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_crlmodis,modis%Optical_Thickness_vs_ReffLiq)397 #else 398 if (cfg%Lclmodis) then399 do icl=1,7400 CALL histwrite3d_cosp(o_crimodis, &401 modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl)402 enddo403 endif404 if (cfg%Lclmodis) then405 do icl=1,7406 CALL histwrite3d_cosp(o_crlmodis, &407 modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl)408 enddo409 endif410 #endif 394 IF (using_xios) THEN 395 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_crimodis,modis%Optical_Thickness_vs_ReffIce) 396 if (cfg%Lclmodis) CALL histwrite4d_cosp(o_crlmodis,modis%Optical_Thickness_vs_ReffLiq) 397 ELSE 398 if (cfg%Lclmodis) then 399 do icl=1,7 400 CALL histwrite3d_cosp(o_crimodis, & 401 modis%Optical_Thickness_vs_ReffIce(:,icl,:),nvertReffIce,icl) 402 enddo 403 endif 404 if (cfg%Lclmodis) then 405 do icl=1,7 406 CALL histwrite3d_cosp(o_crlmodis, & 407 modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl) 408 enddo 409 endif 410 ENDIF !using_xios 411 411 endif !modis 412 412 … … 421 421 #endif 422 422 ! Fermeture dans phys_output_write 423 ! #ifdef CPP_XIOS423 ! IF (using_xios) THEN 424 424 !On finalise l'initialisation: 425 425 !CALL wxios_closedef() 426 ! #endif426 ! ELSE 427 427 428 428 !$OMP END MASTER … … 461 461 USE mod_grid_phy_lmdz, ONLY: nbp_lon 462 462 USE print_control_mod, ONLY: lunout,prt_level 463 #ifdef CPP_XIOS 464 USE wxios 465 #endif 463 USE wxios 466 464 467 465 IMPLICIT NONE … … 495 493 ENDIF 496 494 497 #ifdef CPP_XIOS 495 IF (using_xios) THEN 498 496 IF (.not. ok_all_xml) then 499 497 IF ( var%cles(iff) ) THEN … … 505 503 ENDIF 506 504 ENDIF 507 #endif 505 ENDIF 508 506 509 507 #ifndef CPP_IOIPSL_NO_OUTPUT … … 524 522 USE mod_grid_phy_lmdz, ONLY: nbp_lon 525 523 USE print_control_mod, ONLY: lunout,prt_level 526 527 #ifdef CPP_XIOS 528 USE wxios 529 #endif 530 524 USE wxios 531 525 532 526 IMPLICIT NONE … … 601 595 ENDIF 602 596 603 #ifdef CPP_XIOS 597 IF (using_xios) THEN 604 598 IF (.not. ok_all_xml) then 605 599 IF ( var%cles(iff) ) THEN … … 611 605 ENDIF 612 606 ENDIF 613 #endif 607 ENDIF 614 608 615 609 #ifndef CPP_IOIPSL_NO_OUTPUT … … 631 625 USE mod_grid_phy_lmdz, ONLY: nbp_lon 632 626 USE print_control_mod, ONLY: lunout,prt_level 633 634 #ifdef CPP_XIOS 635 USE xios, only: xios_send_field 636 #endif 627 USE lmdz_xios, only: xios_send_field, using_xios 637 628 638 629 IMPLICIT NONE … … 677 668 firstx=.true. 678 669 DO iff=1, 3 679 670 IF (var%cles(iff) .AND. cosp_outfilekeys(iff)) THEN 680 671 ALLOCATE(index2d(nbp_lon*jj_nb)) 681 672 #ifndef CPP_IOIPSL_NO_OUTPUT … … 683 674 #endif 684 675 deallocate(index2d) 685 #ifdef CPP_XIOS 676 IF (using_xios) THEN 686 677 IF (.not. ok_all_xml) then 687 678 if (firstx) then … … 693 684 endif 694 685 ENDIF 695 #endif 696 686 ENDIF 687 ENDIF 697 688 ENDDO 698 689 699 #ifdef CPP_XIOS 690 IF (using_xios) THEN 700 691 IF (ok_all_xml) THEN 701 692 if (prt_level >= 1) then … … 704 695 CALL xios_send_field(var%name, Field2d) 705 696 ENDIF 706 #endif 697 ENDIF 707 698 708 699 !$OMP END MASTER … … 720 711 USE mod_grid_phy_lmdz, ONLY: nbp_lon 721 712 USE print_control_mod, ONLY: lunout,prt_level 722 723 #ifdef CPP_XIOS 724 USE xios, only: xios_send_field 725 #endif 726 713 USE lmdz_xios, only: xios_send_field, using_xios 727 714 728 715 IMPLICIT NONE … … 786 773 #endif 787 774 788 #ifdef CPP_XIOS 775 IF (using_xios) THEN 789 776 IF (.not. ok_all_xml) then 790 777 IF (firstx) THEN … … 794 781 ENDIF 795 782 ENDIF 796 #endif 783 ENDIF 797 784 deallocate(index3d) 798 785 ENDIF 799 786 ENDDO 800 #ifdef CPP_XIOS 801 IF (ok_all_xml) THEN 802 CALL xios_send_field(nom, Field3d(:,:,1:nlev)) 803 IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name 787 788 IF (using_xios) THEN 789 IF (ok_all_xml) THEN 790 CALL xios_send_field(nom, Field3d(:,:,1:nlev)) 791 IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name 792 ENDIF 804 793 ENDIF 805 #endif806 794 807 795 !$OMP END MASTER … … 819 807 USE mod_grid_phy_lmdz, ONLY: nbp_lon 820 808 USE print_control_mod, ONLY: lunout,prt_level 821 822 #ifdef CPP_XIOS 823 USE xios, only: xios_send_field 824 #endif 825 809 USE lmdz_xios, only: xios_send_field, using_xios 826 810 827 811 IMPLICIT NONE … … 852 836 CALL grid1Dto2D_mpi(buffer_omp,field4d) 853 837 854 #ifdef CPP_XIOS 838 IF (using_xios) THEN 855 839 ! IF (ok_all_xml) THEN 856 840 CALL xios_send_field(var%name, Field4d(:,:,1:nlev,1:nlev2)) 857 841 IF (prt_level >= 1) WRITE(lunout,*)'xios_send_field ',var%name 858 842 ! ENDIF 859 #endif 843 ENDIF 860 844 861 845 !$OMP END MASTER -
LMDZ6/trunk/libf/phylmd/cosp2/cosp_read_otputkeys.F90
r3396 r4619 228 228 229 229 SUBROUTINE READ_COSP_OUTPUT_NL(itap,cosp_nl,cfg) 230 231 #ifdef CPP_XIOS 232 USE xios, ONLY: xios_field_is_active 233 #endif 230 USE lmdz_xios, ONLY: xios_field_is_active, using_xios 234 231 implicit none 235 232 character(len=*),intent(in) :: cosp_nl … … 755 752 ! USE MOD_COSP_CONSTANTS 756 753 ! USE MOD_COSP_TYPES 757 #ifdef CPP_XIOS 758 USE xios, ONLY: xios_field_is_active 759 #endif 754 USE lmdz_xios, ONLY: xios_field_is_active, using_xios 760 755 implicit none 761 756 type(cosp_config),intent(out) :: cfg 762 757 integer :: i 763 764 #ifdef CPP_XIOS765 758 766 759 logical :: Lradar_sim,Llidar_sim,Lparasol_sim,Lisccp_sim,Lmodis_sim,Lmisr_sim,Lrttov_sim, Lstats, & … … 784 777 785 778 character(len=32) :: out_list(78) 779 780 IF (using_xios) THEN 786 781 787 782 do i=1,78 … … 1249 1244 endif 1250 1245 1251 #endif 1246 ENDIF !using_xios 1252 1247 1253 1248 END SUBROUTINE read_xiosfieldactive -
LMDZ6/trunk/libf/phylmd/cosp2/phys_cosp2.F90
r4593 r4619 83 83 use cosp_output_mod 84 84 use cosp_output_write_mod 85 USE lmdz_xios, ONLY : using_xios 85 86 ! use MOD_COSP_Modis_Simulator, only : cosp_modis 86 87 ! use mod_cosp_config, only : vgrid_zl,vgrid_zu,vgrid_z … … 245 246 246 247 ! Clefs Outputs initialisation 247 #ifdef CPP_XIOS 248 IF (using_xios) THEN 248 249 call cosp_outputkeys_init(cfg) 249 #else 250 ELSE 250 251 call read_cosp_output_nl(itap,cosp_output_nl,cfg) 251 #endif 252 ENDIF 252 253 253 254 print*,' Cles des differents simulateurs cosp a itap :',itap … … 265 266 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 266 267 if ((itap.gt.1).and.(first_write))then 267 #ifdef CPP_XIOS 268 call read_xiosfieldactive(cfg) 269 #endif 268 269 IF (using_xios) call read_xiosfieldactive(cfg) 270 270 first_write=.false. 271 271 -
LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_interface.F90
r3723 r4619 67 67 use ioipsl 68 68 use iophy 69 use lmdz_xios, ONLY : using_xios 69 70 use lmdz_cosp_output_mod 70 71 use lmdz_cosp_output_write_mod … … 262 263 263 264 ! Clefs Outputs initialisation 264 #ifdef CPP_XIOS 265 call cosp_outputkeys_init(cfg)266 #else 265 IF (using_xios) THEN 266 call cosp_outputkeys_init(cfg) 267 ELSE 267 268 call read_cosp_output_nl(itap,cosp_output_nl,cfg) 268 #endif 269 ENDIF 269 270 270 271 print*,' Cles des differents simulateurs cosp a itap :',itap … … 278 279 endif 279 280 280 #ifdef CPP_XIOS 281 print*,'On passe par ifdef CPP_XIOS' 282 #else 283 if (cosp_init_flag .eq. 0) then 284 285 ! Initialize the distributional parameters for hydrometeors in radar simulator. 286 ! In COSPv1.4, this was declared in cosp_defs.f. 287 if (cloudsat_micro_scheme == 'MMF_v3.5_two_moment') then 288 ldouble = .true. 289 lsingle = .false. 281 IF (using_xios) THEN 282 print*,'On passe par using_xios' 283 ELSE 284 if (cosp_init_flag .eq. 0) then 285 286 ! Initialize the distributional parameters for hydrometeors in radar simulator. 287 ! In COSPv1.4, this was declared in cosp_defs.f. 288 if (cloudsat_micro_scheme == 'MMF_v3.5_two_moment') then 289 ldouble = .true. 290 lsingle = .false. 291 endif 292 call hydro_class_init(lsingle,ldouble,sd) 293 call quickbeam_optics_init() 294 295 print*,' just before call COSP_INIT, cosp_init_flag =', cosp_init_flag 296 call COSP_INIT(cfg%Lisccp, cfg%Lmodis, cfg%Lmisr, cfg%Lcloudsat, cfg%Lcalipso, & 297 cfg%LgrLidar532, cfg%Latlid, cfg%Lparasol, cfg%Lrttov, & 298 cloudsat_radar_freq, cloudsat_k2, cloudsat_use_gas_abs, & 299 cloudsat_do_ray, isccp_topheight, isccp_topheight_direction, & 300 surface_radar, rcfg_cloudsat, use_vgrid_in, csat_vgrid_in, & 301 niv_sorties, Nlevels, cloudsat_micro_scheme) 302 cosp_init_flag = 1 303 print*,' just after call COSP_INIT, cosp_init_flag =', cosp_init_flag 290 304 endif 291 call hydro_class_init(lsingle,ldouble,sd) 292 call quickbeam_optics_init() 293 294 print*,' just before call COSP_INIT, cosp_init_flag =', cosp_init_flag 295 call COSP_INIT(cfg%Lisccp, cfg%Lmodis, cfg%Lmisr, cfg%Lcloudsat, cfg%Lcalipso, & 296 cfg%LgrLidar532, cfg%Latlid, cfg%Lparasol, cfg%Lrttov, & 297 cloudsat_radar_freq, cloudsat_k2, cloudsat_use_gas_abs, & 298 cloudsat_do_ray, isccp_topheight, isccp_topheight_direction, & 299 surface_radar, rcfg_cloudsat, use_vgrid_in, csat_vgrid_in, & 300 niv_sorties, Nlevels, cloudsat_micro_scheme) 301 cosp_init_flag = 1 302 print*,' just after call COSP_INIT, cosp_init_flag =', cosp_init_flag 303 endif 304 #endif 305 ENDIF 305 306 306 307 print*,'Fin lecture Namelists, debut_cosp =',debut_cosp … … 311 312 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 312 313 if ((itap.ge.1).and.(first_write))then 313 #ifdef CPP_XIOS 314 call read_xiosfieldactive(cfg) 315 #endif 314 IF (using_xios) call read_xiosfieldactive(cfg) 316 315 first_write=.false. 317 316 -
LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_output_mod.F90
r3491 r4619 326 326 USE time_phylmdz_mod, ONLY: day_ref, annee_ref, day_ini, start_time, itau_phy 327 327 USE print_control_mod, ONLY: lunout 328 329 #ifdef CPP_XIOS 330 ! ug Pour les sorties XIOS 331 USE wxios 332 #endif 328 ! ug Pour les sorties XIOS 329 USE wxios 333 330 334 331 IMPLICIT NONE … … 350 347 !!! Variables d'entree 351 348 352 #ifdef CPP_XIOS 353 ! ug Variables utilisées pour récupérer le calendrier pour xios 354 INTEGER :: x_an, x_mois, x_jour 355 REAL :: x_heure 356 INTEGER :: ini_an, ini_mois, ini_jour 357 REAL :: ini_heure 358 #endif 349 ! ug Variables utilisées pour récupérer le calendrier pour xios 350 INTEGER :: x_an, x_mois, x_jour 351 REAL :: x_heure 352 INTEGER :: ini_an, ini_mois, ini_jour 353 REAL :: ini_heure 359 354 360 355 WRITE(lunout,*) 'Debut lmdz_cosp_output_mod.F90' … … 401 396 CALL ymds2ju(annee_ref, 1, day_ini, start_time, zjulian_start) 402 397 403 #ifdef CPP_XIOS 398 IF (using_xios) THEN 399 404 400 405 ! recuperer la valeur indefine Xios406 ! CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value)407 ! Cosp_fill_value=missing_val401 ! recuperer la valeur indefine Xios 402 ! CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value) 403 ! Cosp_fill_value=missing_val 408 404 Cosp_fill_value=0. 409 405 print*,'Cosp_fill_value=',Cosp_fill_value … … 426 422 CALL wxios_add_vaxis("column", Ncolumns, column_ax) 427 423 428 WRITE(lunout,*) 'wxios_add_vaxis temp LIDAR_NTEMP, LIDAR_PHASE_TEMP ', &429 LIDAR_NTEMP, LIDAR_PHASE_TEMP430 CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP)431 432 WRITE(lunout,*) 'wxios_add_vaxis cth16 numMISRHgtBins, misr_histHgtCenters ', &424 WRITE(lunout,*) 'wxios_add_vaxis temp LIDAR_NTEMP, LIDAR_PHASE_TEMP ', & 425 LIDAR_NTEMP, LIDAR_PHASE_TEMP 426 CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP) 427 428 WRITE(lunout,*) 'wxios_add_vaxis cth16 numMISRHgtBins, misr_histHgtCenters ', & 433 429 numMISRHgtBins, misr_histHgtCenters 434 CALL wxios_add_vaxis("cth", numMISRHgtBins, misr_histHgtCenters)435 436 WRITE(lunout,*) 'wxios_add_vaxis dbze CLOUDSAT_DBZE_BINS, cloudsat_binCenters ', &430 CALL wxios_add_vaxis("cth", numMISRHgtBins, misr_histHgtCenters) 431 432 WRITE(lunout,*) 'wxios_add_vaxis dbze CLOUDSAT_DBZE_BINS, cloudsat_binCenters ', & 437 433 CLOUDSAT_DBZE_BINS, cloudsat_binCenters 438 CALL wxios_add_vaxis("dbze", CLOUDSAT_DBZE_BINS, cloudsat_binCenters)439 440 WRITE(lunout,*) 'wxios_add_vaxis scatratio SR_BINS, calipso_binCenters', &434 CALL wxios_add_vaxis("dbze", CLOUDSAT_DBZE_BINS, cloudsat_binCenters) 435 436 WRITE(lunout,*) 'wxios_add_vaxis scatratio SR_BINS, calipso_binCenters', & 441 437 SR_BINS, calipso_binCenters 442 CALL wxios_add_vaxis("scatratio", SR_BINS, calipso_binCenters)443 444 WRITE(lunout,*) 'wxios_add_vaxis ReffIce numMODISReffIceBins, &438 CALL wxios_add_vaxis("scatratio", SR_BINS, calipso_binCenters) 439 440 WRITE(lunout,*) 'wxios_add_vaxis ReffIce numMODISReffIceBins, & 445 441 reffICE_binCenters',numMODISReffIceBins, reffICE_binCenters 446 CALL wxios_add_vaxis("ReffIce", numMODISReffIceBins, reffICE_binCenters)447 448 WRITE(lunout,*) 'wxios_add_vaxis ReffLiq numMODISReffLiqBins, &442 CALL wxios_add_vaxis("ReffIce", numMODISReffIceBins, reffICE_binCenters) 443 444 WRITE(lunout,*) 'wxios_add_vaxis ReffLiq numMODISReffLiqBins, & 449 445 reffLIQ_binCenters', numMODISReffLiqBins, reffLIQ_binCenters 450 CALL wxios_add_vaxis("ReffLiq", numMODISReffLiqBins, reffLIQ_binCenters)451 452 WRITE(lunout,*) 'wxios_add_vaxis 7, tau_binCenters', &446 CALL wxios_add_vaxis("ReffLiq", numMODISReffLiqBins, reffLIQ_binCenters) 447 448 WRITE(lunout,*) 'wxios_add_vaxis 7, tau_binCenters', & 453 449 7, tau_binCenters 454 CALL wxios_add_vaxis("tau", 7, tau_binCenters)455 456 #endif 450 CALL wxios_add_vaxis("tau", 7, tau_binCenters) 451 452 ENDIF 457 453 458 454 zdtimemoy_cosp = freq_COSP ! Frequence ou l on moyenne … … 467 463 ! nhoricosp(iff),cosp_nidfiles(iff) 468 464 469 #ifdef CPP_XIOS 465 IF (using_xios) THEN 470 466 IF (.not. ok_all_xml) then 471 467 WRITE(lunout,*) 'wxios_add_file ',cosp_outfilenames(iff) 472 468 CALL wxios_add_file(cosp_outfilenames(iff),chfreq(iff),10) 473 469 ENDIF 474 #endif 470 ENDIF 475 471 476 472 #ifndef CPP_IOIPSL_NO_OUTPUT -
LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90
r3731 r4619 42 42 43 43 USE wxios, only: wxios_closedef 44 USE xios, only: xios_update_calendar, xios_field_is_active44 USE lmdz_xios, only: xios_update_calendar, xios_field_is_active 45 45 IMPLICIT NONE 46 46 !!! Variables d'entree … … 807 807 USE print_control_mod, ONLY: lunout,prt_level 808 808 809 USE xios, only: xios_send_field809 USE lmdz_xios, only: xios_send_field 810 810 811 811 IMPLICIT NONE … … 889 889 USE print_control_mod, ONLY: lunout,prt_level 890 890 891 USE xios, only: xios_send_field891 USE lmdz_xios, only: xios_send_field 892 892 893 893 … … 980 980 USE print_control_mod, ONLY: lunout,prt_level 981 981 982 USE xios, only: xios_send_field982 USE lmdz_xios, only: xios_send_field 983 983 984 984 -
LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_read_outputkeys.F90
r3491 r4619 422 422 423 423 SUBROUTINE READ_COSP_OUTPUT_NL(itap,cosp_nl,cfg) 424 425 #ifdef CPP_XIOS 426 USE xios, ONLY: xios_field_is_active 427 #endif 424 USE lmdz_xios, ONLY: xios_field_is_active, using_xios 428 425 implicit none 429 426 character(len=*),intent(in) :: cosp_nl … … 1020 1017 1021 1018 SUBROUTINE read_xiosfieldactive(cfg) 1022 1023 #ifdef CPP_XIOS 1024 USE xios, ONLY: xios_field_is_active 1025 #endif 1019 USE lmdz_xios, ONLY: xios_field_is_active, using_xios 1026 1020 implicit none 1027 1021 type(cosp_config),intent(inout) :: cfg 1028 1022 integer :: i 1029 1030 #ifdef CPP_XIOS1031 1023 1032 1024 !COSPv2 local variables … … 1067 1059 1068 1060 character(len=32) :: out_list(107) 1061 1062 IF (using_xios) THEN 1069 1063 1070 1064 do i=1,107 … … 1717 1711 endif 1718 1712 1719 #endif 1713 ENDIF !using_xios 1720 1714 1721 1715 END SUBROUTINE read_xiosfieldactive -
LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90
r4600 r4619 10 10 11 11 SUBROUTINE init_etat0_limit_unstruct 12 #ifdef CPP_XIOS 13 USE xios, ONLY: xios_set_axis_attr, xios_set_fieldgroup_attr, & 12 USE lmdz_xios, ONLY: xios_set_axis_attr, xios_set_fieldgroup_attr, & 14 13 xios_set_filegroup_attr, xios_set_file_attr 15 14 USE mod_phys_lmdz_para, ONLY: is_omp_master … … 49 48 ENDIF 50 49 51 #endif52 50 END SUBROUTINE init_etat0_limit_unstruct 53 51 54 52 SUBROUTINE create_etat0_limit_unstruct 55 #ifdef CPP_XIOS56 53 USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured 57 54 USE create_etat0_unstruct_mod, ONLY: create_etat0_unstruct … … 62 59 USE ioipsl_getin_p_mod, ONLY: getin_p 63 60 USE dimphy, ONLY: klon 64 USE xios, ONLY: xios_context_finalize, xios_set_current_context, &61 USE lmdz_xios, ONLY: xios_context_finalize, xios_set_current_context, & 65 62 xios_finalize 66 63 USE print_control_mod, ONLY: lunout … … 109 106 ENDIF 110 107 111 #endif112 108 END SUBROUTINE create_etat0_limit_unstruct 113 109 -
LMDZ6/trunk/libf/phylmd/create_etat0_unstruct.F90
r4595 r4619 9 9 10 10 SUBROUTINE init_create_etat0_unstruct 11 #ifdef CPP_XIOS 12 USE xios 11 USE lmdz_xios 13 12 USE netcdf 14 13 USE mod_phys_lmdz_para … … 39 38 ENDIF 40 39 41 #endif42 43 40 END SUBROUTINE init_create_etat0_unstruct 44 41 … … 46 43 SUBROUTINE create_etat0_unstruct 47 44 USE dimphy 48 #ifdef CPP_XIOS 49 USE xios 45 USE lmdz_xios 50 46 USE infotrac_phy 51 47 USE fonte_neige_mod … … 269 265 CALL phyredem( "startphy.nc" ) 270 266 271 #endif272 267 END SUBROUTINE create_etat0_unstruct 273 268 -
LMDZ6/trunk/libf/phylmd/create_limit_unstruct.F90
r4361 r4619 10 10 SUBROUTINE create_limit_unstruct 11 11 USE dimphy 12 #ifdef CPP_XIOS 13 USE xios 12 USE lmdz_xios 14 13 USE ioipsl, ONLY : ioget_year_len 15 14 USE time_phylmdz_mod, ONLY : annee_ref … … 175 174 CALL xios_send_field("rug_limout", rugos_year_mpi) 176 175 ENDIF 177 #endif178 176 END SUBROUTINE create_limit_unstruct 179 177 -
LMDZ6/trunk/libf/phylmd/iophy.F90
r4260 r4619 16 16 !$OMP THREADPRIVATE(itau_iophy) 17 17 18 #ifdef CPP_XIOS19 18 INTERFACE histwrite_phy 20 19 MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy,histwrite2d_phy_old,histwrite3d_phy_old,histwrite2d_xios,histwrite3d_xios,histwrite0d_xios 21 20 END INTERFACE 22 #else23 INTERFACE histwrite_phy24 MODULE PROCEDURE histwrite2d_phy,histwrite3d_phy,histwrite2d_phy_old,histwrite3d_phy_old25 END INTERFACE26 #endif27 21 28 22 INTERFACE histbeg_phy_all … … 52 46 USE ioipsl, ONLY: flio_dom_set 53 47 #endif 54 #ifdef CPP_XIOS 55 use wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_context_init 56 #endif 48 use wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_context_init, using_xios 57 49 IMPLICIT NONE 58 50 REAL,DIMENSION(klon),INTENT(IN) :: rlon … … 72 64 INTEGER :: data_ibegin, data_iend 73 65 74 #ifdef CPP_XIOS 75 CALL wxios_context_init 76 #endif 66 if (using_xios) CALL wxios_context_init 77 67 78 68 79 69 IF (grid_type==unstructured) THEN 80 70 81 #ifdef CPP_XIOS82 71 CALL wxios_domain_param_unstructured("dom_glo") 83 #endif84 72 85 73 ELSE … … 140 128 'APPLE',phys_domain_id) 141 129 #endif 142 #ifdef CPP_XIOS 130 IF (using_xios) THEN 143 131 ! Set values for the mask: 144 132 IF (mpi_rank == 0) THEN … … 163 151 164 152 ! Initialize the XIOS domain coreesponding to this process: 165 #endif 153 ENDIF 166 154 !$OMP END MASTER 167 155 168 #ifdef CPP_XIOS 169 CALL wxios_domain_param("dom_glo") 170 #endif 156 IF (using_xios) CALL wxios_domain_param("dom_glo") 171 157 172 158 ENDIF … … 227 213 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat 228 214 USE ioipsl, ONLY: histbeg 229 #ifdef CPP_XIOS 230 USE wxios, ONLY: wxios_add_file 231 #endif 215 USE wxios, ONLY: wxios_add_file, using_xios 232 216 IMPLICIT NONE 233 217 INCLUDE 'clesphys.h' … … 251 235 ENDIF 252 236 253 #ifdef CPP_XIOS 254 ! ug OMP en chantier... 255 IF((.NOT. is_using_mpi) .OR. is_mpi_root) THEN 256 ! ug Création du fichier 257 IF (.not. ok_all_xml) THEN 258 CALL wxios_add_file(name, ffreq, lev) 237 IF (using_xios) THEN 238 ! ug OMP en chantier... 239 IF((.NOT. is_using_mpi) .OR. is_mpi_root) THEN 240 ! ug Création du fichier 241 IF (.not. ok_all_xml) THEN 242 CALL wxios_add_file(name, ffreq, lev) 243 ENDIF 259 244 ENDIF 260 245 ENDIF 261 #endif262 246 !$OMP END MASTER 263 247 … … 608 592 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat 609 593 USE aero_mod, ONLY : naero_tot, name_aero_tau 610 #ifdef CPP_XIOS 611 USE wxios, ONLY: wxios_add_field_to_file 612 #endif 594 USE wxios, ONLY: wxios_add_field_to_file, using_xios 613 595 USE print_control_mod, ONLY: prt_level,lunout 614 596 IMPLICIT NONE … … 650 632 IF(.NOT.clef_stations(iff)) THEN 651 633 652 #ifdef CPP_XIOS 653 IF (.not. ok_all_xml) THEN 654 IF ( var%flag(iff)<=lev_files(iff) ) THEN 655 CALL wxios_add_field_to_file(var%name, 2, iff, phys_out_filenames(iff), & 656 var%description, var%unit, var%flag(iff), typeecrit) 657 IF (prt_level >= 10) THEN 658 WRITE(lunout,*) 'histdef2d: call wxios_add_field_to_file var%name iff: ', & 659 trim(var%name),iff 634 IF (using_xios) THEN 635 IF (.not. ok_all_xml) THEN 636 IF ( var%flag(iff)<=lev_files(iff) ) THEN 637 CALL wxios_add_field_to_file(var%name, 2, iff, phys_out_filenames(iff), & 638 var%description, var%unit, var%flag(iff), typeecrit) 639 IF (prt_level >= 10) THEN 640 WRITE(lunout,*) 'histdef2d: call wxios_add_field_to_file var%name iff: ', & 641 trim(var%name),iff 642 ENDIF 660 643 ENDIF 661 644 ENDIF 662 645 ENDIF 663 #endif664 646 #ifndef CPP_IOIPSL_NO_OUTPUT 665 647 … … 725 707 USE print_control_mod, ONLY: prt_level,lunout 726 708 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat 727 #ifdef CPP_XIOS 728 USE wxios, ONLY: wxios_add_field_to_file 729 #endif 709 USE wxios, ONLY: wxios_add_field_to_file, using_xios 730 710 USE print_control_mod, ONLY: prt_level,lunout 731 711 IMPLICIT NONE … … 766 746 IF(.NOT.clef_stations(iff)) THEN 767 747 768 #ifdef CPP_XIOS 769 IF (.not. ok_all_xml) THEN 770 IF ( var%flag(iff)<=lev_files(iff) ) THEN 771 CALL wxios_add_field_to_file(var%name, 3, iff, phys_out_filenames(iff), & 772 var%description, var%unit, var%flag(iff), typeecrit) 773 IF (prt_level >= 10) THEN 774 WRITE(lunout,*) 'histdef3d: call wxios_add_field_to_file var%name iff: ', & 775 trim(var%name),iff 776 ENDIF 777 ENDIF 778 ENDIF 779 #endif 748 IF (using_xios) THEN 749 750 IF (.not. ok_all_xml) THEN 751 IF ( var%flag(iff)<=lev_files(iff) ) THEN 752 CALL wxios_add_field_to_file(var%name, 3, iff, phys_out_filenames(iff), & 753 var%description, var%unit, var%flag(iff), typeecrit) 754 IF (prt_level >= 10) THEN 755 WRITE(lunout,*) 'histdef3d: call wxios_add_field_to_file var%name iff: ', & 756 trim(var%name),iff 757 ENDIF 758 ENDIF 759 ENDIF 760 ENDIF 780 761 #ifndef CPP_IOIPSL_NO_OUTPUT 781 762 … … 974 955 USE print_control_mod, ONLY: prt_level,lunout 975 956 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, unstructured, regular_lonlat 976 #ifdef CPP_XIOS 977 USE xios, ONLY: xios_send_field, xios_field_is_active 978 #endif 957 USE lmdz_xios, ONLY: xios_send_field, xios_field_is_active, using_xios 979 958 USE print_control_mod, ONLY: lunout, prt_level 980 959 … … 1036 1015 1037 1016 ELSE 1038 #ifdef CPP_XIOS 1039 IF (ok_all_xml) THEN1040 !$omp barrier1041 !$omp master1042 is_active = xios_field_is_active(var%name, at_current_timestep_arg=.false.)1043 !$omp end master1044 !$omp barrier1045 IF(.not. is_active) RETURN1046 ENDIF1047 #endif 1017 IF (using_xios) THEN 1018 IF (ok_all_xml) THEN 1019 !$omp barrier 1020 !$omp master 1021 is_active = xios_field_is_active(var%name, at_current_timestep_arg=.false.) 1022 !$omp end master 1023 !$omp barrier 1024 IF(.not. is_active) RETURN 1025 ENDIF 1026 ENDIF 1048 1027 1049 1028 !Et sinon on.... écrit … … 1068 1047 1069 1048 IF (ok_all_xml) THEN 1070 #ifdef CPP_XIOS 1049 IF (using_xios) THEN 1071 1050 IF (prt_level >= 10) THEN 1072 1051 write(lunout,*)'Dans iophy histwrite2D,var%name ', trim(var%name) … … 1091 1070 trim(var%name) 1092 1071 ENDIF 1093 #else 1094 CALL abort_physic ('iophy','cannot have ok_all_xml = .T. without CPP_XIOS defined' ,1)1095 #endif 1072 ELSE 1073 CALL abort_physic ('iophy','cannot have ok_all_xml = .T. without CPP_XIOS defined' ,1) 1074 ENDIF 1096 1075 ELSE 1097 1076 DO iff=iff_beg, iff_end 1098 1077 IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN 1099 1078 1100 #ifdef CPP_XIOS 1101 IF (firstx) THEN 1102 IF (prt_level >= 10) THEN 1103 write(lunout,*)'Dans iophy histwrite2D,iff,var%name ',& 1104 iff,trim(var%name) 1105 write(lunout,*)"histwrite2d_phy:.NOT.clef_stations(iff)and iff==iff_beg, call xios_send_field" 1106 ENDIF 1107 IF (grid_type==regular_lonlat) THEN 1108 IF (SIZE(field) == klon) then 1109 CALL xios_send_field(var%name, Field2d) 1110 ELSE 1079 IF (using_xios) THEN 1080 IF (firstx) THEN 1081 IF (prt_level >= 10) THEN 1082 write(lunout,*)'Dans iophy histwrite2D,iff,var%name ',& 1083 iff,trim(var%name) 1084 write(lunout,*)"histwrite2d_phy:.NOT.clef_stations(iff)and iff==iff_beg, call xios_send_field" 1085 ENDIF 1086 IF (grid_type==regular_lonlat) THEN 1087 IF (SIZE(field) == klon) then 1088 CALL xios_send_field(var%name, Field2d) 1089 ELSE 1090 CALL xios_send_field(var%name, field) 1091 ENDIF 1092 ELSE IF (grid_type==unstructured) THEN 1093 IF (SIZE(field) == klon) then 1094 CALL xios_send_field(var%name, buffer_omp) 1095 ELSE 1111 1096 CALL xios_send_field(var%name, field) 1112 ENDIF 1113 ELSE IF (grid_type==unstructured) THEN 1114 IF (SIZE(field) == klon) then 1115 CALL xios_send_field(var%name, buffer_omp) 1116 ELSE 1117 CALL xios_send_field(var%name, field) 1118 ENDIF 1119 ENDIF 1120 1121 firstx=.false. 1122 ENDIF 1123 #endif 1097 ENDIF 1098 ENDIF 1099 1100 firstx=.false. 1101 ENDIF 1102 ENDIF 1124 1103 1125 1104 IF (.NOT.clef_stations(iff)) THEN … … 1129 1108 CALL histwrite(nid_files(iff),var%name,itau_iophy,Field2d,nbp_lon*jj_nb,index2d) 1130 1109 #endif 1131 ! #ifdef CPP_XIOS1110 ! IF (using_xios) THEN 1132 1111 ! IF (iff == iff_beg) THEN 1133 1112 ! IF (prt_level >= 10) THEN … … 1136 1115 ! CALL xios_send_field(var%name, Field2d) 1137 1116 ! ENDIF 1138 ! #endif1117 ! ENDIF 1139 1118 ELSE 1140 1119 ALLOCATE(fieldok(npstn)) … … 1188 1167 nid_files, swaerofree_diag 1189 1168 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, regular_lonlat, unstructured 1190 #ifdef CPP_XIOS 1191 USE xios, ONLY: xios_send_field, xios_field_is_active 1192 #endif 1169 USE lmdz_xios, ONLY: xios_send_field, xios_field_is_active, using_xios 1193 1170 USE print_control_mod, ONLY: prt_level,lunout 1194 1171 … … 1236 1213 CALL bcast_omp(swaerofree_diag) 1237 1214 ELSE 1238 #ifdef CPP_XIOS 1239 IF (ok_all_xml) THEN1240 !$omp barrier1241 !$omp master1242 is_active = xios_field_is_active(var%name, at_current_timestep_arg=.false.)1243 !$omp end master1244 !$omp barrier1245 IF(.not. is_active) RETURN1246 ENDIF1247 #endif 1215 IF (using_xios) THEN 1216 IF (ok_all_xml) THEN 1217 !$omp barrier 1218 !$omp master 1219 is_active = xios_field_is_active(var%name, at_current_timestep_arg=.false.) 1220 !$omp end master 1221 !$omp barrier 1222 IF(.not. is_active) RETURN 1223 ENDIF 1224 ENDIF 1248 1225 1249 1226 !Et sinon on.... écrit … … 1273 1250 1274 1251 IF (ok_all_xml) THEN 1275 #ifdef CPP_XIOS 1252 IF (using_xios) THEN 1276 1253 IF (prt_level >= 10) THEN 1277 1254 write(lunout,*)'Dans iophy histwrite3D,var%name ',& … … 1292 1269 ENDIF 1293 1270 1294 #else 1271 ELSE 1295 1272 CALL abort_physic ('iophy','cannot have ok_all_xml = .T. without CPP_XIOS defined' ,1) 1296 #endif 1273 ENDIF 1297 1274 ELSE 1298 1275 1299 1276 DO iff=iff_beg, iff_end 1300 1277 IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN 1301 #ifdef CPP_XIOS 1278 IF (using_xios) THEN 1302 1279 IF (firstx) THEN 1303 1280 IF (prt_level >= 10) THEN … … 1324 1301 firstx=.false. 1325 1302 ENDIF 1326 #endif 1327 IF (.NOT.clef_stations(iff)) THEN 1328 ALLOCATE(index3d(nbp_lon*jj_nb*nlev)) 1329 ALLOCATE(fieldok(nbp_lon*jj_nb,nlev)) 1303 ENDIF 1304 1305 IF (.NOT.clef_stations(iff)) THEN 1306 ALLOCATE(index3d(nbp_lon*jj_nb*nlev)) 1307 ALLOCATE(fieldok(nbp_lon*jj_nb,nlev)) 1330 1308 1331 1309 #ifndef CPP_IOIPSL_NO_OUTPUT … … 1333 1311 #endif 1334 1312 1335 ! #ifdef CPP_XIOS1313 ! IF (using_xios) THEN 1336 1314 ! IF (iff == 1) THEN 1337 1315 ! CALL xios_send_field(var%name, Field3d(:,:,1:klev)) 1338 1316 ! ENDIF 1339 ! #endif1317 ! ENDIF 1340 1318 ! 1341 1319 ELSE … … 1378 1356 1379 1357 ! VERSION DES HISTWRITE DEDIEES AU TOUT-XIOS-XML DEJA UTILISEE DANS PHYDEV 1380 #ifdef CPP_XIOS1381 1358 SUBROUTINE histwrite2d_xios(field_name,field) 1382 1359 … … 1386 1363 jj_nb, klon_mpi, is_master 1387 1364 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, unstructured 1388 USE xios, ONLY: xios_send_field1365 USE lmdz_xios, ONLY: xios_send_field 1389 1366 USE print_control_mod, ONLY: prt_level,lunout 1390 1367 … … 1468 1445 is_sequential, klon_mpi_begin, klon_mpi_end, & 1469 1446 jj_nb, klon_mpi, is_master 1470 USE xios, ONLY: xios_send_field1447 USE lmdz_xios, ONLY: xios_send_field 1471 1448 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid_type, unstructured 1472 1449 USE print_control_mod, ONLY: prt_level,lunout … … 1551 1528 END SUBROUTINE histwrite3d_xios 1552 1529 1553 #ifdef CPP_XIOS1554 1530 SUBROUTINE histwrite0d_xios(field_name, field) 1555 USE xios, ONLY: xios_send_field1531 USE lmdz_xios, ONLY: xios_send_field 1556 1532 USE mod_phys_lmdz_para, ONLY: is_master 1557 1533 USE print_control_mod, ONLY: prt_level,lunout … … 1568 1544 1569 1545 END SUBROUTINE histwrite0d_xios 1570 #endif 1571 1572 #endif 1546 1573 1547 END MODULE iophy -
LMDZ6/trunk/libf/phylmd/limit_read_mod.F90
r3435 r4619 36 36 USE surface_data 37 37 USE mod_phys_lmdz_para 38 #ifdef CPP_XIOS 39 USE XIOS 40 #endif 38 USE lmdz_xios 39 41 40 IMPLICIT NONE 42 41 INTEGER, INTENT(IN) :: first_day … … 45 44 IF ( type_ocean /= 'couple') THEN 46 45 IF (grid_type==unstructured) THEN 47 #ifdef CPP_XIOS48 46 IF (is_omp_master) CALL xios_set_file_attr("limit_read",enabled=.TRUE.,record_offset=first_day) 49 #endif50 47 ENDIF 51 48 ENDIF … … 172 169 USE phys_cal_mod, ONLY : calend, year_len 173 170 USE print_control_mod, ONLY: lunout, prt_level 174 #ifdef CPP_XIOS 175 USE XIOS, ONLY: xios_recv_field 176 #endif 171 USE lmdz_xios, ONLY: xios_recv_field, using_xios 177 172 178 173 IMPLICIT NONE … … 297 292 IF (grid_type==unstructured) THEN 298 293 299 #ifdef CPP_XIOS300 294 IF ( type_ocean /= 'couple') THEN 301 295 … … 331 325 CALL Scatter_omp(rug_mpi, rugos) 332 326 END IF 333 #endif334 335 327 336 328 ELSE ! grid_type==regular -
LMDZ6/trunk/libf/phylmd/moy_undefSTD.F90
r3435 r4619 8 8 USE phys_state_var_mod 9 9 #endif 10 #ifdef CPP_XIOS 11 USE wxios, ONLY: missing_val 12 #endif 10 USE wxios, ONLY: missing_val_xios => missing_val, using_xios 13 11 14 12 USE phys_cal_mod, ONLY: mth_len 15 13 IMPLICIT NONE 16 14 include "clesphys.h" 17 #ifndef CPP_XIOS18 15 REAL :: missing_val 19 #endif20 16 21 17 ! ==================================================================== … … 59 55 60 56 ! missing_val = nf90_fill_real 61 #ifndef CPP_XIOS 62 missing_val=missing_val_nf90 63 #endif 57 IF (using_xios) THEN 58 missing_val = missing_val_xios 59 ELSE 60 missing_val=missing_val_nf90 61 ENDIF 64 62 65 63 DO n = 1, nout -
LMDZ6/trunk/libf/phylmd/oasis.F90
r4596 r4619 117 117 USE surface_data, ONLY : version_ocean 118 118 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl 119 #ifdef CPP_XIOS120 119 USE wxios, ONLY : wxios_context_init 121 USE xios 122 #endif 120 USE lmdz_xios 123 121 USE print_control_mod, ONLY: lunout 124 122 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, grid_type, unstructured, regular_lonlat … … 393 391 ! End definition 394 392 !************************************************************************************ 395 #ifdef CPP_XIOS 396 CALL xios_oasis_enddef()397 #endif 393 394 IF (using_xios) CALL xios_oasis_enddef() 395 398 396 CALL prism_enddef_proto(ierror) 399 397 IF (ierror .NE. PRISM_Ok) THEN … … 404 402 ENDIF 405 403 406 #ifdef CPP_XIOS 407 ! CALL wxios_context_init() 408 #endif 409 410 !$OMP END MASTER 404 S!$OMP END MASTER 411 405 412 406 END SUBROUTINE inicma -
LMDZ6/trunk/libf/phylmd/pbl_surface_mod.F90
r4569 r4619 319 319 use phys_output_var_mod, only: tkt, tks, taur, sss 320 320 use blowing_snow_ini_mod, only : zeta_bs 321 #ifdef CPP_XIOS 322 USE wxios, ONLY: missing_val 323 #else 324 use netcdf, only: missing_val => nf90_fill_real 325 #endif 321 USE wxios, ONLY: missing_val_xios => missing_val, using_xios 322 USE netcdf, only: missing_val_netcdf => nf90_fill_real 326 323 327 324 … … 899 896 ! compression of delta_sst, delta_sal, ds_ns, dt_ns, dter, dser, 900 897 ! dt_ds, tkt, tks, taur, sss on ocean points 901 898 REAL :: missing_val 902 899 !**************************************************************************************** 903 900 ! End of declarations 904 901 !**************************************************************************************** 902 IF (using_xios) THEN 903 missing_val=missing_val_xios 904 ELSE 905 missing_val=missing_val_netcdf 906 ENDIF 905 907 906 908 IF (prt_level >=10) print *,' -> pbl_surface, itap ',itap -
LMDZ6/trunk/libf/phylmd/phyaqua_mod.F90
r4523 r4619 514 514 USE mod_phys_lmdz_para, ONLY: is_omp_master, klon_mpi 515 515 USE mod_phys_lmdz_transfert_para, ONLY: gather_omp 516 #ifdef CPP_XIOS 517 USE xios 518 #endif 516 USE lmdz_xios 519 517 IMPLICIT NONE 520 518 … … 536 534 ! on the whole physics grid 537 535 538 #ifdef CPP_XIOS 539 PRINT *, 'writelim: Ecriture du fichier limit'540 541 CALL gather_omp(phy_foce, phy_mpi)542 IF (is_omp_master) CALL xios_send_field('foce_limout',phy_mpi)543 544 CALL gather_omp(phy_fsic, phy_mpi)545 IF (is_omp_master) CALL xios_send_field('fsic_limout',phy_mpi)536 IF (using_xios) THEN 537 PRINT *, 'writelim: Ecriture du fichier limit' 538 539 CALL gather_omp(phy_foce, phy_mpi) 540 IF (is_omp_master) CALL xios_send_field('foce_limout',phy_mpi) 541 542 CALL gather_omp(phy_fsic, phy_mpi) 543 IF (is_omp_master) CALL xios_send_field('fsic_limout',phy_mpi) 546 544 547 CALL gather_omp(phy_fter, phy_mpi)548 IF (is_omp_master) CALL xios_send_field('fter_limout',phy_mpi)545 CALL gather_omp(phy_fter, phy_mpi) 546 IF (is_omp_master) CALL xios_send_field('fter_limout',phy_mpi) 549 547 550 CALL gather_omp(phy_flic, phy_mpi)551 IF (is_omp_master) CALL xios_send_field('flic_limout',phy_mpi)552 553 CALL gather_omp(phy_sst, phy_mpi)554 IF (is_omp_master) CALL xios_send_field('sst_limout',phy_mpi)555 556 CALL gather_omp(phy_bil, phy_mpi)557 IF (is_omp_master) CALL xios_send_field('bils_limout',phy_mpi)558 559 CALL gather_omp(phy_alb, phy_mpi)560 IF (is_omp_master) CALL xios_send_field('alb_limout',phy_mpi)561 562 CALL gather_omp(phy_rug, phy_mpi)563 IF (is_omp_master) CALL xios_send_field('rug_limout',phy_mpi)564 #endif 548 CALL gather_omp(phy_flic, phy_mpi) 549 IF (is_omp_master) CALL xios_send_field('flic_limout',phy_mpi) 550 551 CALL gather_omp(phy_sst, phy_mpi) 552 IF (is_omp_master) CALL xios_send_field('sst_limout',phy_mpi) 553 554 CALL gather_omp(phy_bil, phy_mpi) 555 IF (is_omp_master) CALL xios_send_field('bils_limout',phy_mpi) 556 557 CALL gather_omp(phy_alb, phy_mpi) 558 IF (is_omp_master) CALL xios_send_field('alb_limout',phy_mpi) 559 560 CALL gather_omp(phy_rug, phy_mpi) 561 IF (is_omp_master) CALL xios_send_field('rug_limout',phy_mpi) 562 ENDIF 565 563 END SUBROUTINE writelim_unstruct 566 564 -
LMDZ6/trunk/libf/phylmd/phyetat0_mod.F90
r4613 r4619 39 39 USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init 40 40 USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy 41 #ifdef CPP_XIOS 42 USE wxios, ONLY: missing_val 43 #else 44 use netcdf, only: missing_val => nf90_fill_real 45 #endif 41 USE wxios, ONLY: missing_val_xios => missing_val, using_xios 42 use netcdf, only: missing_val_netcdf => nf90_fill_real 46 43 use config_ocean_skin_m, only: activate_ocean_skin 47 44 … … 92 89 REAL :: lon_startphy(klon), lat_startphy(klon) 93 90 CHARACTER(LEN=maxlen) :: tname, t(2) 94 91 REAL :: missing_val 92 93 IF (using_xios) THEN 94 missing_val=missing_val_xios 95 ELSE 96 missing_val=missing_val_netcdf 97 ENDIF 98 95 99 ! FH1D 96 100 ! real iolat(jjm+1) -
LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90
r4593 r4619 2065 2065 2066 2066 #ifdef CPP_Dust 2067 INCLUDE "Dust/spla_output_dat.h"2067 INCLUDE 'spla_output_dat.h' 2068 2068 #endif 2069 2069 -
LMDZ6/trunk/libf/phylmd/phys_output_mod.F90
r4228 r4619 47 47 USE vertical_layers_mod, ONLY: ap,bp,preff,presnivs, aps, bps, pseudoalt, presinter 48 48 USE time_phylmdz_mod, ONLY: day_ini, itau_phy, start_time, annee_ref, day_ref 49 #ifdef CPP_XIOS50 49 ! ug Pour les sorties XIOS 51 50 USE wxios 52 #endif53 51 54 52 IMPLICIT NONE … … 129 127 REAL, DIMENSION(klev+1) :: lev_index 130 128 131 #ifdef CPP_XIOS132 129 ! ug Variables utilis\'ees pour r\'ecup\'erer le calendrier pour xios 133 130 INTEGER :: x_an, x_mois, x_jour … … 135 132 INTEGER :: ini_an, ini_mois, ini_jour 136 133 REAL :: ini_heure 137 #endif 134 138 135 INTEGER :: ISW 139 136 REAL, DIMENSION(NSW) :: wl1_sun, wl2_sun !wavelength bounds (in um) for SW … … 290 287 ENDIF 291 288 292 #ifdef CPP_XIOS 293 ! ug R\'eglage du calendrier xios294 !Temps julian => an, mois, jour, heure295 CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure)296 CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure)297 CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, &298 ini_mois, ini_jour, ini_heure )299 #endif 289 IF (using_xios) THEN 290 ! ug R\'eglage du calendrier xios 291 !Temps julian => an, mois, jour, heure 292 CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure) 293 CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure) 294 CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, & 295 ini_mois, ini_jour, ini_heure ) 296 ENDIF 300 297 301 298 !!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 330 327 331 328 332 #ifdef CPP_XIOS 333 !!! Ouverture de chaque fichier XIOS !!!!!!!!!!! 334 IF (.not. ok_all_xml) THEN 329 IF (using_xios) THEN 330 !!! Ouverture de chaque fichier XIOS !!!!!!!!!!! 331 IF (.not. ok_all_xml) THEN 332 IF (prt_level >= 10) THEN 333 print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff)) 334 ENDIF 335 CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 336 ENDIF 337 338 !!! Declaration des axes verticaux de chaque fichier: 335 339 IF (prt_level >= 10) THEN 336 print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff))340 print*,'phys_output_open: Declare vertical axes for each file' 337 341 ENDIF 338 CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 339 ENDIF 340 341 !!! Declaration des axes verticaux de chaque fichier: 342 IF (prt_level >= 10) THEN 343 print*,'phys_output_open: Declare vertical axes for each file' 344 ENDIF 345 346 IF (iff.LE.6.OR.iff.EQ.10) THEN 347 CALL wxios_add_vaxis("presnivs", & 348 levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff))) 349 CALL wxios_add_vaxis("presinter", & 350 klev + 1, presinter(1:klev+1)) 351 CALL wxios_add_vaxis("Ahyb", & 352 levmax(iff) - levmin(iff) + 1, aps(levmin(iff):levmax(iff)), positif='down', & 353 bnds=Ahyb_bounds(levmin(iff):levmax(iff),:)) 354 CALL wxios_add_vaxis("Bhyb", & 355 levmax(iff) - levmin(iff) + 1, bps(levmin(iff):levmax(iff)), positif='down', & 356 bnds=Bhyb_bounds(levmin(iff):levmax(iff),:)) 357 CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, & 358 lev_index(levmin(iff):levmax(iff))) 359 CALL wxios_add_vaxis("klevp1", klev+1, & 360 lev_index(1:klev+1)) 361 CALL wxios_add_vaxis("bnds", 2, (/1.,2./)) 362 363 CALL wxios_add_vaxis("Alt", & 364 levmax(iff) - levmin(iff) + 1, pseudoalt) 365 366 ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um) 367 SELECT CASE(NSW) 368 CASE(6) 369 wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380] 370 wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000] 371 CASE(2) 372 wl1_sun(1:2) = [0.250, 0.690] 373 wl2_sun(1:2) = [0.690, 4.000] 374 END SELECT 375 376 DO ISW=1, NSW 377 wn1_sun(ISW)=1.e+6/wl1_sun(ISW) 378 wn2_sun(ISW)=1.e+6/wl2_sun(ISW) 379 spbnds_sun(ISW,1)=wn2_sun(ISW) 380 spbnds_sun(ISW,2)=wn1_sun(ISW) 381 spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2 382 ENDDO 342 343 IF (iff.LE.6.OR.iff.EQ.10) THEN 344 CALL wxios_add_vaxis("presnivs", & 345 levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff))) 346 CALL wxios_add_vaxis("presinter", & 347 klev + 1, presinter(1:klev+1)) 348 CALL wxios_add_vaxis("Ahyb", & 349 levmax(iff) - levmin(iff) + 1, aps(levmin(iff):levmax(iff)), positif='down', & 350 bnds=Ahyb_bounds(levmin(iff):levmax(iff),:)) 351 CALL wxios_add_vaxis("Bhyb", & 352 levmax(iff) - levmin(iff) + 1, bps(levmin(iff):levmax(iff)), positif='down', & 353 bnds=Bhyb_bounds(levmin(iff):levmax(iff),:)) 354 CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, & 355 lev_index(levmin(iff):levmax(iff))) 356 CALL wxios_add_vaxis("klevp1", klev+1, & 357 lev_index(1:klev+1)) 358 CALL wxios_add_vaxis("bnds", 2, (/1.,2./)) 359 360 CALL wxios_add_vaxis("Alt", & 361 levmax(iff) - levmin(iff) + 1, pseudoalt) 362 363 ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um) 364 SELECT CASE(NSW) 365 CASE(6) 366 wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380] 367 wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000] 368 CASE(2) 369 wl1_sun(1:2) = [0.250, 0.690] 370 wl2_sun(1:2) = [0.690, 4.000] 371 END SELECT 372 373 DO ISW=1, NSW 374 wn1_sun(ISW)=1.e+6/wl1_sun(ISW) 375 wn2_sun(ISW)=1.e+6/wl2_sun(ISW) 376 spbnds_sun(ISW,1)=wn2_sun(ISW) 377 spbnds_sun(ISW,2)=wn1_sun(ISW) 378 spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2 379 ENDDO 383 380 ! 384 381 !!! ajout axe vertical spectband : solar band number 385 CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down')386 ELSE387 ! NMC files388 CALL wxios_add_vaxis("plev", &389 levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff)))390 ENDIF391 #endif382 CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down') 383 ELSE 384 ! NMC files 385 CALL wxios_add_vaxis("plev", & 386 levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff))) 387 ENDIF 388 ENDIF !using_xios 392 389 393 390 IF (clef_files(iff)) THEN -
LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90
r4608 r4619 420 420 USE netcdf, ONLY: nf90_fill_real 421 421 USE print_control_mod, ONLY: prt_level,lunout 422 423 424 #ifdef CPP_XIOS425 422 ! ug Pour les sorties XIOS 426 USE xios 427 USE wxios, ONLY: wxios_closedef, missing_val, wxios_set_context 428 #endif 423 USE lmdz_xios 424 USE wxios, ONLY: wxios_closedef, missing_val_xios=>missing_val, wxios_set_context 429 425 USE phys_cal_mod, ONLY : mth_len 430 426 … … 484 480 !$OMP THREADPRIVATE(kmax_100m) 485 481 REAL :: x 486 #ifndef CPP_XIOS487 482 REAL :: missing_val 488 #endif489 483 REAL, PARAMETER :: un_jour=86400. 490 484 CHARACTER(len=12) :: nvar … … 513 507 ! ENDIF 514 508 515 #ifdef CPP_XIOS 516 CALL wxios_set_context 517 #endif 518 519 #ifndef CPP_XIOS 520 missing_val=missing_val_nf90521 #endif 509 IF (using_xios) CALL wxios_set_context 510 511 IF (using_xios) THEN 512 missing_val=missing_val_xios 513 ELSE 514 missing_val=missing_val_nf90 515 ENDIF 522 516 523 517 IF (.NOT.vars_defined) THEN … … 554 548 DO iinit=1, iinitend 555 549 ! print *,'IFF iinit=', iinit, iinitend 556 #ifdef CPP_XIOS 557 !$OMP MASTER 558 IF (vars_defined) THEN 559 IF (prt_level >= 10) then 560 write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w 561 ENDIF 562 ! CALL xios_update_calendar(itau_w) 563 CALL xios_update_calendar(itap) 564 ENDIF 565 !$OMP END MASTER 566 !$OMP BARRIER 567 #endif 550 IF (using_xios) THEN 551 !$OMP MASTER 552 IF (vars_defined) THEN 553 IF (prt_level >= 10) then 554 write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w 555 ENDIF 556 ! CALL xios_update_calendar(itau_w) 557 CALL xios_update_calendar(itap) 558 ENDIF 559 !$OMP END MASTER 560 !$OMP BARRIER 561 ENDIF 562 568 563 ! On procède à l'écriture ou à la définition des nombreuses variables: 569 564 !!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 588 583 CALL histwrite_phy(o_contfracOR, pctsrf(:,is_ter)) 589 584 ! 590 #ifdef CPP_XIOS 591 CALL histwrite_phy("R_ecc",R_ecc) 592 CALL histwrite_phy("R_peri",R_peri) 593 CALL histwrite_phy("R_incl",R_incl) 594 CALL histwrite_phy("solaire",solaire) 595 CALL histwrite_phy(o_Ahyb, ap) 596 CALL histwrite_phy(o_Bhyb, bp) 597 CALL histwrite_phy(o_Ahyb_bounds, Ahyb_bounds) 598 CALL histwrite_phy(o_Bhyb_bounds, Bhyb_bounds) 599 CALL histwrite_phy(o_Ahyb_mid, aps) 600 CALL histwrite_phy(o_Bhyb_mid, bps) 601 CALL histwrite_phy(o_Ahyb_mid_bounds, Ahyb_mid_bounds) 602 CALL histwrite_phy(o_Bhyb_mid_bounds, Bhyb_mid_bounds) 603 CALL histwrite_phy(o_longitude, longitude_deg) 604 CALL histwrite_phy(o_latitude, latitude_deg) 585 IF (using_xios) THEN 586 587 CALL histwrite_phy("R_ecc",R_ecc) 588 CALL histwrite_phy("R_peri",R_peri) 589 CALL histwrite_phy("R_incl",R_incl) 590 CALL histwrite_phy("solaire",solaire) 591 CALL histwrite_phy(o_Ahyb, ap) 592 CALL histwrite_phy(o_Bhyb, bp) 593 CALL histwrite_phy(o_Ahyb_bounds, Ahyb_bounds) 594 CALL histwrite_phy(o_Bhyb_bounds, Bhyb_bounds) 595 CALL histwrite_phy(o_Ahyb_mid, aps) 596 CALL histwrite_phy(o_Bhyb_mid, bps) 597 CALL histwrite_phy(o_Ahyb_mid_bounds, Ahyb_mid_bounds) 598 CALL histwrite_phy(o_Bhyb_mid_bounds, Bhyb_mid_bounds) 599 CALL histwrite_phy(o_longitude, longitude_deg) 600 CALL histwrite_phy(o_latitude, latitude_deg) 605 601 ! 606 602 #ifdef CPP_RRTM 607 IF (iflag_rrtm.EQ.1) THEN608 DO ISW=1, NSW609 WRITE(ch1,'(i1)') ISW610 ! zx_tmp_0d=RSUN(ISW)611 ! CALL histwrite_phy("rsun"//ch1,zx_tmp_0d)612 CALL histwrite_phy("rsun"//ch1,RSUN(ISW))613 ENDDO614 ENDIF603 IF (iflag_rrtm.EQ.1) THEN 604 DO ISW=1, NSW 605 WRITE(ch1,'(i1)') ISW 606 ! zx_tmp_0d=RSUN(ISW) 607 ! CALL histwrite_phy("rsun"//ch1,zx_tmp_0d) 608 CALL histwrite_phy("rsun"//ch1,RSUN(ISW)) 609 ENDDO 610 ENDIF 615 611 #endif 616 612 ! 617 CALL histwrite_phy("co2_ppm",co2_ppm)618 CALL histwrite_phy("CH4_ppb",CH4_ppb)619 CALL histwrite_phy("N2O_ppb",N2O_ppb)620 CALL histwrite_phy("CFC11_ppt",CFC11_ppt)621 CALL histwrite_phy("CFC12_ppt",CFC12_ppt)613 CALL histwrite_phy("co2_ppm",co2_ppm) 614 CALL histwrite_phy("CH4_ppb",CH4_ppb) 615 CALL histwrite_phy("N2O_ppb",N2O_ppb) 616 CALL histwrite_phy("CFC11_ppt",CFC11_ppt) 617 CALL histwrite_phy("CFC12_ppt",CFC12_ppt) 622 618 ! 623 #endif 619 ENDIF !using_xios 624 620 625 621 !!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 884 880 885 881 ! offline 886 #ifdef CPP_XIOS 887 IF (offline) THEN888 889 coefh_stok(:,1) = cdragh(:)890 coefh_stok(:,2:klev) = coefh(:,2:klev, is_ave)882 IF (using_xios) THEN 883 IF (offline) THEN 884 885 coefh_stok(:,1) = cdragh(:) 886 coefh_stok(:,2:klev) = coefh(:,2:klev, is_ave) 891 887 892 CALL histwrite_phy('upwd_stok', upwd)893 CALL histwrite_phy('t_stok', t)894 CALL histwrite_phy('fm_th_stok', fm_therm(:,1:klev))895 CALL histwrite_phy('en_th_stok', entr_therm)896 CALL histwrite_phy('da_stok',da )897 CALL histwrite_phy('mp_stok',mp )898 CALL histwrite_phy('dnwd_stok', dnwd)899 CALL histwrite_phy('wght_stok', wght_cvfd)900 CALL histwrite_phy('coefh_stok', coefh_stok)901 CALL histwrite_phy('yu1_stok', u1)902 CALL histwrite_phy('yv1_stok', v1)903 904 DO k=1,klev905 IF (k<10) THEN906 WRITE(nvar,'(i1)') k907 ELSE IF (k<100) THEN908 WRITE(nvar,'(i2)') k909 ELSE910 WRITE(nvar,'(i3)') k911 END IF912 nvar='phi_lev'//trim(nvar)913 CALL histwrite_phy(nvar,phi(:,:,k))914 END DO888 CALL histwrite_phy('upwd_stok', upwd) 889 CALL histwrite_phy('t_stok', t) 890 CALL histwrite_phy('fm_th_stok', fm_therm(:,1:klev)) 891 CALL histwrite_phy('en_th_stok', entr_therm) 892 CALL histwrite_phy('da_stok',da ) 893 CALL histwrite_phy('mp_stok',mp ) 894 CALL histwrite_phy('dnwd_stok', dnwd) 895 CALL histwrite_phy('wght_stok', wght_cvfd) 896 CALL histwrite_phy('coefh_stok', coefh_stok) 897 CALL histwrite_phy('yu1_stok', u1) 898 CALL histwrite_phy('yv1_stok', v1) 899 900 DO k=1,klev 901 IF (k<10) THEN 902 WRITE(nvar,'(i1)') k 903 ELSE IF (k<100) THEN 904 WRITE(nvar,'(i2)') k 905 ELSE 906 WRITE(nvar,'(i3)') k 907 END IF 908 nvar='phi_lev'//trim(nvar) 909 CALL histwrite_phy(nvar,phi(:,:,k)) 910 END DO 915 911 916 ENDIF917 #endif 912 ENDIF 913 ENDIF 918 914 919 915 … … 1291 1287 1292 1288 #ifdef CPP_IOIPSL 1293 #ifndef CPP_XIOS 1294 IF (.NOT.ok_all_xml) THEN 1295 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX: 1296 ! Champs interpolles sur des niveaux de pression 1297 DO iff=1, nfiles 1298 ll=0 1299 DO k=1, nlevSTD 1300 bb2=clevSTD(k) 1301 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. & 1289 IF (.NOT. using_xios) THEN 1290 IF (.NOT.ok_all_xml) THEN 1291 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX: 1292 ! Champs interpolles sur des niveaux de pression 1293 DO iff=1, nfiles 1294 ll=0 1295 DO k=1, nlevSTD 1296 bb2=clevSTD(k) 1297 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. & 1298 bb2.EQ."500".OR.bb2.EQ."200".OR. & 1299 bb2.EQ."100".OR. & 1300 bb2.EQ."50".OR.bb2.EQ."10") THEN 1301 1302 ! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1303 ll=ll+1 1304 CALL histwrite_phy(o_uSTDlevs(ll),uwriteSTD(:,k,iff), iff) 1305 CALL histwrite_phy(o_vSTDlevs(ll),vwriteSTD(:,k,iff), iff) 1306 CALL histwrite_phy(o_wSTDlevs(ll),wwriteSTD(:,k,iff), iff) 1307 CALL histwrite_phy(o_zSTDlevs(ll),phiwriteSTD(:,k,iff), iff) 1308 CALL histwrite_phy(o_qSTDlevs(ll),qwriteSTD(:,k,iff), iff) 1309 CALL histwrite_phy(o_tSTDlevs(ll),twriteSTD(:,k,iff), iff) 1310 1311 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR. 1312 ENDDO 1313 ENDDO 1314 ENDIF 1315 ENDIF 1316 #endif 1317 1318 IF (using_xios) THEN 1319 IF (ok_all_xml) THEN 1320 !XIOS CALL xios_get_field_attr("u850",default_value=missing_val) 1321 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1322 ll=0 1323 DO k=1, nlevSTD 1324 bb2=clevSTD(k) 1325 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. & 1302 1326 bb2.EQ."500".OR.bb2.EQ."200".OR. & 1303 1327 bb2.EQ."100".OR. & 1304 1328 bb2.EQ."50".OR.bb2.EQ."10") THEN 1305 1306 ! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1307 ll=ll+1 1308 CALL histwrite_phy(o_uSTDlevs(ll),uwriteSTD(:,k,iff), iff) 1309 CALL histwrite_phy(o_vSTDlevs(ll),vwriteSTD(:,k,iff), iff) 1310 CALL histwrite_phy(o_wSTDlevs(ll),wwriteSTD(:,k,iff), iff) 1311 CALL histwrite_phy(o_zSTDlevs(ll),phiwriteSTD(:,k,iff), iff) 1312 CALL histwrite_phy(o_qSTDlevs(ll),qwriteSTD(:,k,iff), iff) 1313 CALL histwrite_phy(o_tSTDlevs(ll),twriteSTD(:,k,iff), iff) 1314 1315 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR. 1316 ENDDO 1317 ENDDO 1318 ENDIF 1319 #endif 1320 #endif 1321 #ifdef CPP_XIOS 1322 IF (ok_all_xml) THEN 1323 !XIOS CALL xios_get_field_attr("u850",default_value=missing_val) 1324 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1325 ll=0 1326 DO k=1, nlevSTD 1327 bb2=clevSTD(k) 1328 IF (bb2.EQ."850".OR.bb2.EQ."700".OR. & 1329 bb2.EQ."500".OR.bb2.EQ."200".OR. & 1330 bb2.EQ."100".OR. & 1331 bb2.EQ."50".OR.bb2.EQ."10") THEN 1332 ll=ll+1 1333 CALL histwrite_phy(o_uSTDlevs(ll),ulevSTD(:,k)) 1334 CALL histwrite_phy(o_vSTDlevs(ll),vlevSTD(:,k)) 1335 CALL histwrite_phy(o_wSTDlevs(ll),wlevSTD(:,k)) 1336 CALL histwrite_phy(o_zSTDlevs(ll),philevSTD(:,k)) 1337 CALL histwrite_phy(o_qSTDlevs(ll),qlevSTD(:,k)) 1338 CALL histwrite_phy(o_tSTDlevs(ll),tlevSTD(:,k)) 1339 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR. 1340 ENDDO 1341 ENDIF 1342 #endif 1329 ll=ll+1 1330 CALL histwrite_phy(o_uSTDlevs(ll),ulevSTD(:,k)) 1331 CALL histwrite_phy(o_vSTDlevs(ll),vlevSTD(:,k)) 1332 CALL histwrite_phy(o_wSTDlevs(ll),wlevSTD(:,k)) 1333 CALL histwrite_phy(o_zSTDlevs(ll),philevSTD(:,k)) 1334 CALL histwrite_phy(o_qSTDlevs(ll),qlevSTD(:,k)) 1335 CALL histwrite_phy(o_tSTDlevs(ll),tlevSTD(:,k)) 1336 ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR. 1337 ENDDO 1338 ENDIF 1339 ENDIF 1340 1343 1341 IF (vars_defined) THEN 1344 1342 DO i=1, klon … … 1789 1787 ENDIF 1790 1788 1791 #ifdef CPP_XIOS 1789 IF (using_xios) THEN 1792 1790 !solbnd begin 1793 1791 #ifdef CPP_RRTM 1794 IF (iflag_rrtm.EQ.1) THEN1795 IF (vars_defined) THEN1796 DO ISW=1, NSW1797 zx_tmp_fi3dsp(:,ISW) = swdn(:,klevp1)*swradcorr(:)*RSUN(ISW)1798 ENDDO1799 CALL histwrite_phy(o_solbnd, zx_tmp_fi3dsp)1800 ENDIF1801 ENDIF1792 IF (iflag_rrtm.EQ.1) THEN 1793 IF (vars_defined) THEN 1794 DO ISW=1, NSW 1795 zx_tmp_fi3dsp(:,ISW) = swdn(:,klevp1)*swradcorr(:)*RSUN(ISW) 1796 ENDDO 1797 CALL histwrite_phy(o_solbnd, zx_tmp_fi3dsp) 1798 ENDIF 1799 ENDIF 1802 1800 #endif 1803 1801 !solbnd end 1804 #endif 1802 ENDIF 1805 1803 #endif 1806 1804 … … 2379 2377 !!!!!!!!!!!! Sorties niveaux de pression NMC !!!!!!!!!!!!!!!!!!!! 2380 2378 #ifdef CPP_IOIPSL 2381 #ifndef CPP_XIOS 2382 IF (.NOT.ok_all_xml) THEN 2383 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX: 2384 ! Champs interpolles sur des niveaux de pression 2385 DO iff=7, nfiles-1 !--OB: here we deal with files 7,8,9 2386 2387 CALL histwrite_phy(o_tnondef,tnondef(:,:,iff-6),iff) 2388 CALL histwrite_phy(o_ta,twriteSTD(:,:,iff-6),iff) 2389 CALL histwrite_phy(o_zg,phiwriteSTD(:,:,iff-6),iff) 2390 CALL histwrite_phy(o_hus,qwriteSTD(:,:,iff-6),iff) 2391 CALL histwrite_phy(o_hur,rhwriteSTD(:,:,iff-6),iff) 2392 CALL histwrite_phy(o_ua,uwriteSTD(:,:,iff-6),iff) 2393 CALL histwrite_phy(o_va,vwriteSTD(:,:,iff-6),iff) 2394 CALL histwrite_phy(o_wap,wwriteSTD(:,:,iff-6),iff) 2395 IF (vars_defined) THEN 2396 DO k=1, nlevSTD 2397 DO i=1, klon 2398 IF (tnondef(i,k,iff-6).NE.missing_val) THEN 2399 IF (freq_outNMC(iff-6).LT.0) THEN 2400 freq_moyNMC(iff-6)=(mth_len*un_jour)/freq_calNMC(iff-6) 2401 ELSE 2402 freq_moyNMC(iff-6)=freq_outNMC(iff-6)/freq_calNMC(iff-6) 2403 ENDIF 2404 zx_tmp_fi3d_STD(i,k) = (100.*tnondef(i,k,iff-6))/freq_moyNMC(iff-6) 2405 ELSE 2406 zx_tmp_fi3d_STD(i,k) = missing_val 2407 ENDIF 2408 ENDDO 2409 ENDDO 2410 ENDIF 2411 CALL histwrite_phy(o_psbg,zx_tmp_fi3d_STD,iff) 2412 IF (vars_defined) THEN 2413 DO k=1, nlevSTD 2414 DO i=1, klon 2415 IF (O3sumSTD(i,k,iff-6).NE.missing_val) THEN 2416 zx_tmp_fi3d_STD(i,k) = O3sumSTD(i,k,iff-6) * 1.e+9 2417 ELSE 2418 zx_tmp_fi3d_STD(i,k) = missing_val 2419 ENDIF 2420 ENDDO 2421 ENDDO !k=1, nlevSTD 2422 ENDIF 2423 CALL histwrite_phy(o_tro3,zx_tmp_fi3d_STD,iff) 2424 IF (read_climoz == 2) THEN 2379 IF (.NOT. using_xios) THEN 2380 IF (.NOT.ok_all_xml) THEN 2381 ! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX: 2382 ! Champs interpolles sur des niveaux de pression 2383 DO iff=7, nfiles-1 !--OB: here we deal with files 7,8,9 2384 2385 CALL histwrite_phy(o_tnondef,tnondef(:,:,iff-6),iff) 2386 CALL histwrite_phy(o_ta,twriteSTD(:,:,iff-6),iff) 2387 CALL histwrite_phy(o_zg,phiwriteSTD(:,:,iff-6),iff) 2388 CALL histwrite_phy(o_hus,qwriteSTD(:,:,iff-6),iff) 2389 CALL histwrite_phy(o_hur,rhwriteSTD(:,:,iff-6),iff) 2390 CALL histwrite_phy(o_ua,uwriteSTD(:,:,iff-6),iff) 2391 CALL histwrite_phy(o_va,vwriteSTD(:,:,iff-6),iff) 2392 CALL histwrite_phy(o_wap,wwriteSTD(:,:,iff-6),iff) 2425 2393 IF (vars_defined) THEN 2426 DO k=1, nlevSTD 2394 DO k=1, nlevSTD 2395 DO i=1, klon 2396 IF (tnondef(i,k,iff-6).NE.missing_val) THEN 2397 IF (freq_outNMC(iff-6).LT.0) THEN 2398 freq_moyNMC(iff-6)=(mth_len*un_jour)/freq_calNMC(iff-6) 2399 ELSE 2400 freq_moyNMC(iff-6)=freq_outNMC(iff-6)/freq_calNMC(iff-6) 2401 ENDIF 2402 zx_tmp_fi3d_STD(i,k) = (100.*tnondef(i,k,iff-6))/freq_moyNMC(iff-6) 2403 ELSE 2404 zx_tmp_fi3d_STD(i,k) = missing_val 2405 ENDIF 2406 ENDDO 2407 ENDDO 2408 ENDIF 2409 CALL histwrite_phy(o_psbg,zx_tmp_fi3d_STD,iff) 2410 IF (vars_defined) THEN 2411 DO k=1, nlevSTD 2412 DO i=1, klon 2413 IF (O3sumSTD(i,k,iff-6).NE.missing_val) THEN 2414 zx_tmp_fi3d_STD(i,k) = O3sumSTD(i,k,iff-6) * 1.e+9 2415 ELSE 2416 zx_tmp_fi3d_STD(i,k) = missing_val 2417 ENDIF 2418 ENDDO 2419 ENDDO !k=1, nlevSTD 2420 ENDIF 2421 CALL histwrite_phy(o_tro3,zx_tmp_fi3d_STD,iff) 2422 IF (read_climoz == 2) THEN 2423 IF (vars_defined) THEN 2424 DO k=1, nlevSTD 2427 2425 DO i=1, klon 2428 2426 IF (O3daysumSTD(i,k,iff-6).NE.missing_val) THEN … … 2432 2430 ENDIF 2433 2431 ENDDO 2434 ENDDO !k=1, nlevSTD 2432 ENDDO !k=1, nlevSTD 2433 ENDIF 2434 CALL histwrite_phy(o_tro3_daylight,zx_tmp_fi3d_STD,iff) 2435 2435 ENDIF 2436 CALL histwrite_phy(o_tro3_daylight,zx_tmp_fi3d_STD,iff) 2437 endif 2438 CALL histwrite_phy(o_uxv,uvsumSTD(:,:,iff-6),iff) 2439 CALL histwrite_phy(o_vxq,vqsumSTD(:,:,iff-6),iff) 2440 CALL histwrite_phy(o_vxT,vTsumSTD(:,:,iff-6),iff) 2441 CALL histwrite_phy(o_wxq,wqsumSTD(:,:,iff-6),iff) 2442 CALL histwrite_phy(o_vxphi,vphisumSTD(:,:,iff-6),iff) 2443 CALL histwrite_phy(o_wxT,wTsumSTD(:,:,iff-6),iff) 2444 CALL histwrite_phy(o_uxu,u2sumSTD(:,:,iff-6),iff) 2445 CALL histwrite_phy(o_vxv,v2sumSTD(:,:,iff-6),iff) 2446 CALL histwrite_phy(o_TxT,T2sumSTD(:,:,iff-6),iff) 2447 ENDDO !nfiles 2448 ENDIF 2436 CALL histwrite_phy(o_uxv,uvsumSTD(:,:,iff-6),iff) 2437 CALL histwrite_phy(o_vxq,vqsumSTD(:,:,iff-6),iff) 2438 CALL histwrite_phy(o_vxT,vTsumSTD(:,:,iff-6),iff) 2439 CALL histwrite_phy(o_wxq,wqsumSTD(:,:,iff-6),iff) 2440 CALL histwrite_phy(o_vxphi,vphisumSTD(:,:,iff-6),iff) 2441 CALL histwrite_phy(o_wxT,wTsumSTD(:,:,iff-6),iff) 2442 CALL histwrite_phy(o_uxu,u2sumSTD(:,:,iff-6),iff) 2443 CALL histwrite_phy(o_vxv,v2sumSTD(:,:,iff-6),iff) 2444 CALL histwrite_phy(o_TxT,T2sumSTD(:,:,iff-6),iff) 2445 ENDDO !nfiles 2446 ENDIF 2447 ENDIF !.NOT. using_xios 2449 2448 #endif 2450 #endif 2451 #ifdef CPP_XIOS 2452 IF (ok_all_xml) THEN2453 ! DO iff=7, nfiles2449 2450 IF (using_xios) THEN 2451 IF (ok_all_xml) THEN 2452 ! DO iff=7, nfiles 2454 2453 2455 2454 ! CALL histwrite_phy(o_tnondef,tnondef(:,:,3)) … … 2514 2513 CALL histwrite_phy(o_TxT,T2STD(:,:)) 2515 2514 ! ENDDO !nfiles 2516 ENDIF2517 #endif 2515 ENDIF 2516 ENDIF !using_xios 2518 2517 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2519 2518 IF (iflag_phytrac == 1 ) then … … 2698 2697 ENDDO ! iff 2699 2698 #endif 2700 #ifdef CPP_XIOS2701 2699 !On finalise l'initialisation: 2702 CALL wxios_closedef()2703 #endif 2700 IF (using_xios) CALL wxios_closedef() 2701 2704 2702 !$OMP END MASTER 2705 2703 !$OMP BARRIER -
LMDZ6/trunk/libf/phylmd/physiq_mod.F90
r4613 r4619 76 76 USE vampir 77 77 USE write_field_phy 78 #ifdef CPP_XIOS79 78 USE wxios, ONLY: g_ctx, wxios_set_context 80 #endif81 79 USE lscp_mod, ONLY : lscp 82 80 USE lmdz_wake_ini, ONLY : wake_ini … … 134 132 #endif 135 133 136 137 #ifdef CPP_XIOS 138 USE xios, ONLY: xios_update_calendar, xios_context_finalize 139 USE xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context 140 USE xios, ONLY: xios_set_current_context 141 USE wxios, ONLY: missing_val, missing_val_omp 142 #endif 134 USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize 135 USE lmdz_xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context 136 USE lmdz_xios, ONLY: xios_set_current_context 137 USE wxios, ONLY: missing_val, using_xios 138 143 139 #ifndef CPP_XIOS 144 140 USE paramLMDZ_phy_mod … … 520 516 REAL dtadd(klon,klev) 521 517 522 #ifndef CPP_XIOS523 REAL, SAVE :: missing_val=nf90_fill_real524 #endif525 518 !! Variables moved to phys_local_var_mod 526 519 !! ! Variables pour le transport convectif … … 1276 1269 CALL update_time(pdtphys) 1277 1270 phys_tstep=NINT(pdtphys) 1278 #ifdef CPP_XIOS 1279 ! switch to XIOS LMDZ physics context 1280 IF (.NOT. debut .AND. is_omp_master) THEN 1281 CALL wxios_set_context() 1282 CALL xios_update_calendar(itap+1) 1283 ENDIF 1284 #endif 1271 IF (.NOT. using_xios) missing_val=nf90_fill_real 1272 1273 IF (using_xios) THEN 1274 ! switch to XIOS LMDZ physics context 1275 IF (.NOT. debut .AND. is_omp_master) THEN 1276 CALL wxios_set_context() 1277 CALL xios_update_calendar(itap+1) 1278 ENDIF 1279 ENDIF 1285 1280 1286 1281 !====================================================================== … … 1841 1836 1842 1837 1843 #ifdef CPP_XIOS 1844 IF (is_omp_master) CALL xios_update_calendar(1) 1845 #endif 1838 IF (using_xios) THEN 1839 IF (is_omp_master) CALL xios_update_calendar(1) 1840 ENDIF 1841 1846 1842 IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz) 1847 1843 CALL create_etat0_limit_unstruct … … 2022 2018 !============================================================= 2023 2019 2024 #ifdef CPP_XIOS 2025 ! Get "missing_val" value from XML files (from temperature variable) 2026 !$OMP MASTER 2027 CALL xios_get_field_attr("temp",default_value=missing_val_omp) 2028 !$OMP END MASTER 2029 !$OMP BARRIER 2030 missing_val=missing_val_omp 2031 #endif 2032 2033 #ifdef CPP_XIOS 2034 ! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only 2035 ! initialised at that moment 2036 ! Get "missing_val" value from XML files (from temperature variable) 2037 !$OMP MASTER 2038 CALL xios_get_field_attr("temp",default_value=missing_val_omp) 2039 !$OMP END MASTER 2040 !$OMP BARRIER 2041 missing_val=missing_val_omp 2020 IF (using_xios) THEN 2021 ! Get "missing_val" value from XML files (from temperature variable) 2022 IF (is_omp_master) CALL xios_get_field_attr("temp",default_value=missing_val) 2023 CALL bcast_omp(missing_val) 2024 ENDIF 2025 2026 IF (using_xios) THEN 2027 ! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only 2028 ! initialised at that moment 2029 ! Get "missing_val" value from XML files (from temperature variable) 2030 IF (is_omp_master) CALL xios_get_field_attr("temp",default_value=missing_val) 2031 CALL bcast_omp(missing_val) 2042 2032 ! 2043 2033 ! Now we activate some double radiation call flags only if some 2044 2034 ! diagnostics are requested, otherwise there is no point in doing this 2045 IF (is_master) THEN2046 !--setting up swaero_diag to TRUE in XIOS case2047 IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &2048 xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &2049 xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR. &2050 (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &2051 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0")))) &2052 !!!--for now these fields are not in the XML files so they are omitted2053 !!! xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &2054 swaero_diag=.TRUE.2035 IF (is_master) THEN 2036 !--setting up swaero_diag to TRUE in XIOS case 2037 IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 2038 xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 2039 xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR. & 2040 (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 2041 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0")))) & 2042 !!!--for now these fields are not in the XML files so they are omitted 2043 !!! xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 2044 swaero_diag=.TRUE. 2055 2045 2056 !--setting up swaerofree_diag to TRUE in XIOS case2057 IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &2058 xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR. &2059 xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &2060 xios_field_is_active("LWupTOAcleanclr")) &2061 swaerofree_diag=.TRUE.2046 !--setting up swaerofree_diag to TRUE in XIOS case 2047 IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. & 2048 xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR. & 2049 xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. & 2050 xios_field_is_active("LWupTOAcleanclr")) & 2051 swaerofree_diag=.TRUE. 2062 2052 2063 !--setting up dryaod_diag to TRUE in XIOS case2064 DO naero = 1, naero_tot-12065 IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE.2066 ENDDO2067 !2068 !--setting up ok_4xCO2atm to TRUE in XIOS case2069 IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &2070 xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &2071 xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &2072 xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &2073 xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &2074 xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &2075 ok_4xCO2atm=.TRUE.2076 ENDIF2077 !$OMP BARRIER2078 CALL bcast(swaero_diag)2079 CALL bcast(swaerofree_diag)2080 CALL bcast(dryaod_diag)2081 CALL bcast(ok_4xCO2atm)2082 #endif 2053 !--setting up dryaod_diag to TRUE in XIOS case 2054 DO naero = 1, naero_tot-1 2055 IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 2056 ENDDO 2057 ! 2058 !--setting up ok_4xCO2atm to TRUE in XIOS case 2059 IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 2060 xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. & 2061 xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. & 2062 xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. & 2063 xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. & 2064 xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) & 2065 ok_4xCO2atm=.TRUE. 2066 ENDIF 2067 !$OMP BARRIER 2068 CALL bcast(swaero_diag) 2069 CALL bcast(swaerofree_diag) 2070 CALL bcast(dryaod_diag) 2071 CALL bcast(ok_4xCO2atm) 2072 ENDIF !using_xios 2083 2073 ! 2084 2074 CALL printflag( tabcntr0,radpas,ok_journe, & … … 4509 4499 cool = cool + betalwoff * (cool0 - cool) 4510 4500 4511 #ifndef CPP_XIOS 4512 !4513 !IM 2eme calcul radiatif pour le cas perturbe ou au moins un4514 !IM des taux doit etre different du taux actuel4515 !IM Par defaut on a les taux perturbes egaux aux taux actuels4516 !4517 IF (RCO2_per.NE.RCO2_act.OR. &4518 RCH4_per.NE.RCH4_act.OR. &4519 RN2O_per.NE.RN2O_act.OR. &4520 RCFC11_per.NE.RCFC11_act.OR. &4521 RCFC12_per.NE.RCFC12_act) ok_4xCO2atm =.TRUE.4522 #endif 4501 IF (.NOT. using_xios) THEN 4502 ! 4503 !IM 2eme calcul radiatif pour le cas perturbe ou au moins un 4504 !IM des taux doit etre different du taux actuel 4505 !IM Par defaut on a les taux perturbes egaux aux taux actuels 4506 ! 4507 IF (RCO2_per.NE.RCO2_act.OR. & 4508 RCH4_per.NE.RCH4_act.OR. & 4509 RN2O_per.NE.RN2O_act.OR. & 4510 RCFC11_per.NE.RCFC11_act.OR. & 4511 RCFC12_per.NE.RCFC12_act) ok_4xCO2atm =.TRUE. 4512 ENDIF 4523 4513 ! 4524 4514 IF (ok_4xCO2atm) THEN … … 5558 5548 5559 5549 #ifndef CPP_XIOS 5560 CALL write_paramLMDZ_phy(itap,nid_ctesGCM,ok_sync)5550 CALL write_paramLMDZ_phy(itap,nid_ctesGCM,ok_sync) 5561 5551 #endif 5562 5552 … … 5604 5594 5605 5595 ENDIF 5606 #ifdef CPP_XIOS 5607 IF (is_omp_master) CALL xios_context_finalize 5596 5597 IF (using_xios) THEN 5598 IF (is_omp_master) CALL xios_context_finalize 5608 5599 5609 5600 #ifdef INCA 5610 if (type_trac == 'inca') then5611 IF (is_omp_master .and. grid_type==unstructured) THEN5612 CALL finalize_inca5613 ENDIF5614 endif5601 if (type_trac == 'inca') then 5602 IF (is_omp_master .and. grid_type==unstructured) THEN 5603 CALL finalize_inca 5604 ENDIF 5605 endif 5615 5606 #endif 5616 5617 #endif 5607 ENDIF 5618 5608 WRITE(lunout,*) ' physiq fin, nombre de steps ou cvpas = 1 : ', Ncvpaseq1 5619 5609 ENDIF -
LMDZ6/trunk/libf/phylmd/plevel.F90
r2346 r4619 12 12 USE phys_state_var_mod, ONLY: missing_val_nf90 13 13 #endif 14 #ifdef CPP_XIOS 15 USE wxios, ONLY: missing_val 16 #endif 14 USE wxios, ONLY: missing_val_xios => missing_val, using_xios 17 15 IMPLICIT NONE 18 16 … … 60 58 61 59 ! REAL missing_val 62 #ifndef CPP_XIOS63 60 REAL :: missing_val 64 #endif65 61 66 62 ! missing_val = nf90_fill_real 67 68 #ifndef CPP_XIOS 69 missing_val=missing_val_nf90 70 #endif 63 IF (using_xios) THEN 64 missing_val = missing_val_xios 65 ELSE 66 missing_val=missing_val_nf90 67 ENDIF 71 68 72 69 IF (first) THEN -
LMDZ6/trunk/libf/phylmd/plevel_new.F90
r2346 r4619 13 13 USE phys_state_var_mod, ONLY: missing_val_nf90 14 14 #endif 15 #ifdef CPP_XIOS 16 USE wxios, ONLY: missing_val 17 #endif 15 USE wxios, ONLY: missing_val_xios=>missing_val, using_xios 18 16 19 17 IMPLICIT NONE … … 62 60 INTEGER i, k 63 61 64 ! REAL missing_val65 #ifndef CPP_XIOS66 62 REAL :: missing_val 67 #endif68 63 69 ! missing_val = nf90_fill_real 70 71 #ifndef CPP_XIOS 72 73 #endif 64 IF (using_xios) THEN 65 missing_val=missing_val_xios 66 ELSE 67 missing_val=missing_val_nf90 68 ENDIF 74 69 75 70 IF (first) THEN -
LMDZ6/trunk/libf/phylmd/readaerosol_mod.F90
r4103 r4619 173 173 174 174 175 175 SUBROUTINE init_aero_fromfile(flag_aerosol) 176 176 USE netcdf 177 177 USE mod_phys_lmdz_para 178 178 USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured 179 #ifdef CPP_XIOS 180 USE xios 181 #endif 179 USE lmdz_xios 182 180 IMPLICIT NONE 183 181 INTEGER, INTENT(IN) :: flag_aerosol 184 #ifdef CPP_XIOS185 182 REAL,ALLOCATABLE :: lat_src(:) 186 183 REAL,ALLOCATABLE :: lon_src(:) … … 191 188 REAL :: null_array(0) 192 189 193 IF (flag_aerosol>0 .AND. grid_type==unstructured) THEN 190 IF (using_xios) THEN 191 IF (flag_aerosol>0 .AND. grid_type==unstructured) THEN 194 192 195 IF (is_omp_root) THEN193 IF (is_omp_root) THEN 196 194 197 IF (is_mpi_root) THEN195 IF (is_mpi_root) THEN 198 196 199 IF (nf90_open(TRIM(file_aerosol), NF90_NOWRITE, ncid) /= NF90_NOERR) THEN 200 CALL check_err( nf90_open(TRIM(file_so4), NF90_NOWRITE, ncid), "pb open "//trim(file_so4) ) 197 IF (nf90_open(TRIM(file_aerosol), NF90_NOWRITE, ncid) /= NF90_NOERR) THEN 198 CALL check_err( nf90_open(TRIM(file_so4), NF90_NOWRITE, ncid), "pb open "//trim(file_so4) ) 199 ENDIF 200 201 ! Read and test longitudes 202 CALL check_err( nf90_inq_dimid(ncid, "lon", dimID),"pb inq dim lon") 203 CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lon_src),"pb inq dim lon") 204 CALL check_err( nf90_inq_varid(ncid, 'lon', varid),"pb inq lon" ) 205 ALLOCATE(lon_src(nbp_lon_src)) 206 CALL check_err( nf90_get_var(ncid, varid, lon_src(:)),"pb get lon" ) 207 208 ! Read and test latitudes 209 CALL check_err( nf90_inq_dimid(ncid, "lat", dimID),"pb inq dim lat") 210 CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lat_src),"pb inq dim lat") 211 CALL check_err( nf90_inq_varid(ncid, 'lat', varid),"pb inq lat" ) 212 ALLOCATE(lat_src(nbp_lat_src)) 213 CALL check_err( nf90_get_var(ncid, varid, lat_src(:)),"pb get lat" ) 214 IF (nf90_inq_dimid(ncid, 'lev', dimid) /= NF90_NOERR) THEN 215 IF (nf90_inq_dimid(ncid, 'presnivs', dimid)/= NF90_NOERR) THEN 216 CALL check_err(nf90_inq_dimid(ncid, 'PRESNIVS', dimid),'dimension lev,PRESNIVS or presnivs not in file') 217 ENDIF 218 ENDIF 219 CALL check_err( nf90_inquire_dimension(ncid, dimid, len = klev_src),"pb inq dim for PRESNIVS or lev" ) 220 CALL check_err( nf90_close(ncid),"pb in close" ) 201 221 ENDIF 202 222 203 ! Read and test longitudes 204 CALL check_err( nf90_inq_dimid(ncid, "lon", dimID),"pb inq dim lon") 205 CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lon_src),"pb inq dim lon") 206 CALL check_err( nf90_inq_varid(ncid, 'lon', varid),"pb inq lon" ) 207 ALLOCATE(lon_src(nbp_lon_src)) 208 CALL check_err( nf90_get_var(ncid, varid, lon_src(:)),"pb get lon" ) 209 210 ! Read and test latitudes 211 CALL check_err( nf90_inq_dimid(ncid, "lat", dimID),"pb inq dim lat") 212 CALL check_err( nf90_inquire_dimension(ncid, dimID, len = nbp_lat_src),"pb inq dim lat") 213 CALL check_err( nf90_inq_varid(ncid, 'lat', varid),"pb inq lat" ) 214 ALLOCATE(lat_src(nbp_lat_src)) 215 CALL check_err( nf90_get_var(ncid, varid, lat_src(:)),"pb get lat" ) 216 IF (nf90_inq_dimid(ncid, 'lev', dimid) /= NF90_NOERR) THEN 217 IF (nf90_inq_dimid(ncid, 'presnivs', dimid)/= NF90_NOERR) THEN 218 CALL check_err(nf90_inq_dimid(ncid, 'PRESNIVS', dimid),'dimension lev,PRESNIVS or presnivs not in file') 219 ENDIF 223 CALL bcast_mpi(nbp_lat_src) 224 CALL bcast_mpi(nbp_lon_src) 225 CALL bcast_mpi(klev_src) 226 227 IF (is_mpi_root ) THEN 228 CALL xios_set_domain_attr("domain_aerosol",nj_glo=nbp_lat_src, nj=nbp_lat_src, jbegin=0, latvalue_1d=lat_src) 229 CALL xios_set_domain_attr("domain_aerosol",ni_glo=nbp_lon_src, ni=nbp_lon_src, ibegin=0, lonvalue_1d=lon_src) 230 ELSE 231 CALL xios_set_domain_attr("domain_aerosol",nj_glo=nbp_lat_src, nj=0, jbegin=0, latvalue_1d=null_array ) 232 CALL xios_set_domain_attr("domain_aerosol",ni_glo=nbp_lon_src, ni=0, ibegin=0, lonvalue_1d=null_array) 220 233 ENDIF 221 CALL check_err( nf90_inquire_dimension(ncid, dimid, len = klev_src),"pb inq dim for PRESNIVS or lev" ) 222 CALL check_err( nf90_close(ncid),"pb in close" ) 234 CALL xios_set_axis_attr("axis_aerosol",n_glo=klev_src) 235 CALL xios_set_fieldgroup_attr("aerosols", enabled=.TRUE.) 236 223 237 ENDIF 224 225 CALL bcast_mpi(nbp_lat_src)226 CALL bcast_mpi(nbp_lon_src)227 CALL bcast_mpi(klev_src)228 229 IF (is_mpi_root ) THEN230 CALL xios_set_domain_attr("domain_aerosol",nj_glo=nbp_lat_src, nj=nbp_lat_src, jbegin=0, latvalue_1d=lat_src)231 CALL xios_set_domain_attr("domain_aerosol",ni_glo=nbp_lon_src, ni=nbp_lon_src, ibegin=0, lonvalue_1d=lon_src)232 ELSE233 CALL xios_set_domain_attr("domain_aerosol",nj_glo=nbp_lat_src, nj=0, jbegin=0, latvalue_1d=null_array )234 CALL xios_set_domain_attr("domain_aerosol",ni_glo=nbp_lon_src, ni=0, ibegin=0, lonvalue_1d=null_array)235 ENDIF236 CALL xios_set_axis_attr("axis_aerosol",n_glo=klev_src)237 CALL xios_set_fieldgroup_attr("aerosols", enabled=.TRUE.)238 239 ENDIF240 238 241 ENDIF242 #endif243 239 ENDIF 240 ENDIF !using_xios 241 END SUBROUTINE init_aero_fromfile 244 242 245 243 … … 271 269 USE iophy, ONLY : io_lon, io_lat 272 270 USE print_control_mod, ONLY: lunout 273 #ifdef CPP_XIOS 274 USE xios 275 #endif 271 USE lmdz_xios 276 272 IMPLICIT NONE 277 273 … … 685 681 686 682 IF (grid_type==unstructured) THEN 687 #ifdef CPP_XIOS688 683 IF (is_omp_master) THEN 689 684 CALL xios_send_field(TRIM(varname)//"_in",varyear) … … 702 697 CALL scatter_omp(psurf_interp,psurf_out) 703 698 first=.FALSE. 704 #endif705 699 ELSE 706 700 ! Scatter global field to local domain at local process -
LMDZ6/trunk/libf/phylmd/readaerosolstrato.F90
r4489 r4619 16 16 USE dimphy 17 17 USE print_control_mod, ONLY: prt_level,lunout 18 #ifdef CPP_XIOS 19 USE xios 20 #endif 18 USE lmdz_xios 21 19 implicit none 22 20 … … 148 146 149 147 IF (grid_type==unstructured) THEN 150 #ifdef CPP_XIOS151 148 IF (is_omp_master) THEN 152 149 CALL xios_send_field("taustrat_in",tauaerstrat_mois) … … 157 154 ENDIF 158 155 CALL scatter_omp(tau_aer_strat_mpi,tau_aer_strat) 159 #endif160 156 ELSE 161 157 !--scatter on all proc -
LMDZ6/trunk/libf/phylmd/readaerosolstrato_m.F90
r4489 r4619 23 23 24 24 25 SUBROUTINE init_readaerosolstrato1 26 #ifdef CPP_XIOS 25 SUBROUTINE init_readaerosolstrato1 27 26 USE netcdf 28 27 USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 29 28 nf95_inq_varid, nf95_open 30 29 USE mod_phys_lmdz_para 31 USE xios30 USE lmdz_xios 32 31 ! USE YOERAD, ONLY : NLW 33 32 IMPLICIT NONE … … 38 37 INTEGER :: ncid_in, varid 39 38 39 IF (using_xios) THEN 40 40 IF (is_omp_master) THEN 41 41 IF (is_mpi_root) THEN … … 63 63 ENDIF 64 64 65 #endif 66 65 ENDIF 66 END SUBROUTINE init_readaerosolstrato1 67 67 68 SUBROUTINE init_readaerosolstrato2 69 #ifdef CPP_XIOS 68 SUBROUTINE init_readaerosolstrato2 70 69 USE netcdf 71 70 USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 72 71 nf95_inq_varid, nf95_open 73 72 USE mod_phys_lmdz_para 74 USE xios73 USE lmdz_xios 75 74 ! USE YOERAD, ONLY : NLW 76 75 IMPLICIT NONE … … 80 79 REAL :: null_array(0) 81 80 INTEGER :: ncid_in, varid 82 81 82 IF (using_xios) THEN 83 83 IF (is_omp_master) THEN 84 84 IF (is_mpi_root) THEN … … 131 131 132 132 ENDIF 133 #endif134 133 ENDIF 134 END SUBROUTINE init_readaerosolstrato2 135 135 136 136 -
LMDZ6/trunk/libf/phylmd/regr_horiz_time_climoz_m.F90
r4489 r4619 66 66 USE regular_lonlat_mod, ONLY: boundslon_reg, boundslat_reg, south, west, east 67 67 USE slopes_m, ONLY: slopes 68 #ifdef CPP_XIOS 69 USE xios 70 #endif 68 USE lmdz_xios 71 69 USE mod_phys_lmdz_para, ONLY: is_mpi_root, is_master, is_omp_master, gather, gather_mpi, bcast_mpi, klon_mpi 72 70 USE geometry_mod, ONLY : latitude_deg, ind_cell_glo … … 240 238 CALL bcast_mpi(ntim_ou) 241 239 242 #ifdef CPP_XIOS243 240 IF (is_mpi_root) THEN 244 241 CALL xios_set_domain_attr("domain_climoz",nj_glo=nlat_in, nj=nlat_in, jbegin=0, latvalue_1d=lat_in/deg2rad) … … 262 259 CALL xios_set_field_attr("tro3_out", enabled=.TRUE.) 263 260 CALL xios_set_field_attr("tro3_out", enabled=.TRUE.) 264 #endif265 261 266 262 IF (first) THEN … … 415 411 !============================================================================= 416 412 IF (grid_type==unstructured) THEN 417 #ifdef CPP_XIOS418 413 nlat_ou=klon_mpi 419 414 … … 428 423 CALL xios_send_field("tro3_in",o3_in3bis(:,:,:,:,:)) 429 424 CALL xios_recv_field("tro3_out",o3_regr_lonlat(1,:,:,:,:)) 430 #endif431 425 ELSE 432 426 … … 462 456 nlat_ou=nbp_lat 463 457 IF (grid_type==unstructured) THEN 464 #ifdef CPP_XIOS465 458 CALL xios_send_field('o3_out',o3_out3) 466 459 ndims=3 467 460 ALLOCATE(o3_out3_glo(nlat_ou, nlev_in, ntim_ou, read_climoz)) 468 461 CALL gather_mpi(o3_out3(1,:,:,:,:), o3_out3_glo) 469 #endif470 462 ENDIF 471 463 … … 508 500 509 501 IF (grid_type==unstructured) THEN 510 #ifdef CPP_XIOS511 502 nlat_ou=klon_mpi 512 503 … … 522 513 IF(.NOT.lprev) o3_regr_lat(:,:, 0, :) = o3_regr_lat(:,:,12,:) 523 514 IF(.NOT.lnext) o3_regr_lat(:,:,13, :) = o3_regr_lat(:,:, 1,:) 524 #endif525 515 526 516 ELSE -
LMDZ6/trunk/libf/phylmd/rrtm/readaerosolstrato1_rrtm.F90
r4489 r4619 18 18 USE YOERAD, ONLY : NLW 19 19 USE YOMCST 20 #ifdef CPP_XIOS 21 USE xios 22 #endif 20 USE lmdz_xios 23 21 24 22 IMPLICIT NONE … … 167 165 168 166 IF (grid_type==unstructured) THEN 169 #ifdef CPP_XIOS170 167 IF (is_omp_master) THEN 171 168 ALLOCATE(tauaerstrat_mpi(klon_mpi,klev)) … … 176 173 ENDIF 177 174 CALL scatter_omp(tauaerstrat_mpi,tau_aer_strat) 178 #endif179 175 ELSE 180 176 CALL scatter(tauaerstrat_mois_glo,tau_aer_strat) -
LMDZ6/trunk/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90
r4489 r4619 19 19 USE YOERAD, ONLY : NLW 20 20 USE YOMCST 21 #ifdef CPP_XIOS 22 USE xios 23 #endif 21 USE lmdz_xios 24 22 25 23 IMPLICIT NONE … … 282 280 283 281 IF (grid_type==unstructured) THEN 284 285 #ifdef CPP_XIOS286 282 287 283 IF (is_omp_master) THEN … … 310 306 CALL scatter_omp(cgaerstrat_mpi,cg_aer_strat) 311 307 CALL scatter_omp(taulwaerstrat_mpi,taulw_aer_strat) 312 #endif313 308 ELSE 314 309 -
LMDZ6/trunk/libf/phylmd/undefSTD.F90
r4593 r4619 8 8 USE phys_state_var_mod 9 9 #endif 10 #ifdef CPP_XIOS 11 USE wxios, ONLY: missing_val 12 #endif 10 USE wxios, ONLY: missing_val_xios => missing_val, using_xios 13 11 14 12 IMPLICIT NONE 15 13 include "clesphys.h" 16 #ifndef CPP_XIOS17 14 REAL :: missing_val 18 #endif19 15 20 16 ! ==================================================================== … … 59 55 60 56 ! missing_val = nf90_fill_real 61 #ifndef CPP_XIOS 57 IF (using_xios) THEN 58 missing_val=missing_val_xios 59 ELSE 62 60 missing_val=missing_val_nf90 63 #endif 61 ENDIF 64 62 65 63 DO n = 1, nout -
LMDZ6/trunk/libf/phylmdiso/limit_read_mod.F90
r4143 r4619 40 40 USE surface_data 41 41 USE mod_phys_lmdz_para 42 #ifdef CPP_XIOS 43 USE XIOS 44 #endif 42 USE lmdz_xios 45 43 IMPLICIT NONE 46 44 INTEGER, INTENT(IN) :: first_day … … 49 47 IF ( type_ocean /= 'couple') THEN 50 48 IF (grid_type==unstructured) THEN 51 #ifdef CPP_XIOS 52 IF (is_omp_master) CALL xios_set_file_attr("limit_read",enabled=.TRUE.,record_offset=first_day) 53 #endif 49 IF (is_omp_master) CALL xios_set_file_attr("limit_read",enabled=.TRUE.,record_offset=first_day) 54 50 ENDIF 55 51 ENDIF … … 288 284 USE phys_cal_mod, ONLY : calend, year_len 289 285 USE print_control_mod, ONLY: lunout, prt_level 290 #ifdef CPP_XIOS 291 USE XIOS, ONLY: xios_recv_field 292 #endif 286 USE lmdz_XIOS, ONLY: xios_recv_field 293 287 294 288 IMPLICIT NONE … … 416 410 IF (grid_type==unstructured) THEN 417 411 418 #ifdef CPP_XIOS419 412 IF ( type_ocean /= 'couple') THEN 420 413 … … 450 443 CALL Scatter_omp(rug_mpi, rugos) 451 444 END IF 452 #endif 453 454 445 455 446 ELSE ! grid_type==regular 456 447 -
LMDZ6/trunk/libf/phylmdiso/pbl_surface_mod.F90
r4531 r4619 412 412 use phys_output_var_mod, only: tkt, tks, taur, sss 413 413 use blowing_snow_ini_mod, only : zeta_bs 414 #ifdef CPP_XIOS 415 USE wxios, ONLY: missing_val 416 #else 417 use netcdf, only: missing_val => nf90_fill_real 418 #endif 419 420 421 414 USE wxios, ONLY: missing_val_xios => missing_val, using_xios 415 use netcdf, only: nf90_fill_real 422 416 423 417 IMPLICIT NONE … … 944 938 REAL, DIMENSION(klon) :: uzon_w, vmer_w, speed_w, zri1_w, pref_w !speed_w, zri1_w, pref_w, added by Fuxing WANG, 04/03/2015 945 939 REAL, DIMENSION(klon) :: zgeo1_w, tair1_w, qair1_w, tairsol_w 946 940 947 941 !!! jyg le 25/03/2013 948 942 !! Variables intermediaires pour le raccord des deux colonnes \`a la surface … … 1051 1045 ! compression of delta_sst, delta_sal, ds_ns, dt_ns, dter, dser, 1052 1046 ! dt_ds, tkt, tks, taur, sss on ocean points 1053 1047 REAL :: missing_val 1054 1048 #ifdef ISO 1055 1049 REAL, DIMENSION(klon) :: h1 … … 1063 1057 ! End of declarations 1064 1058 !**************************************************************************************** 1065 1059 1066 1060 IF (prt_level >=10) print *,' -> pbl_surface, itap ',itap 1061 1062 IF (using_xios) THEN 1063 missing_val = missing_val_xios 1064 ELSE 1065 missing_val = nf90_fill_real 1066 ENDIF 1067 1067 ! 1068 1068 !!jyg iflag_split = mod(iflag_pbl_split,2) -
LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90
r3927 r4619 536 536 USE mod_phys_lmdz_para, ONLY: is_omp_master, klon_mpi 537 537 USE mod_phys_lmdz_transfert_para, ONLY: gather_omp 538 #ifdef CPP_XIOS 539 USE xios 540 #endif 538 USE lmdz_xios 541 539 IMPLICIT NONE 542 540 … … 558 556 ! on the whole physics grid 559 557 560 #ifdef CPP_XIOS561 558 PRINT *, 'writelim: Ecriture du fichier limit' 562 559 … … 584 581 CALL gather_omp(phy_rug, phy_mpi) 585 582 IF (is_omp_master) CALL xios_send_field('rug_limout',phy_mpi) 586 #endif 583 587 584 END SUBROUTINE writelim_unstruct 588 585 -
LMDZ6/trunk/libf/phylmdiso/phyetat0_mod.F90
r4613 r4619 47 47 USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init 48 48 USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy 49 #ifdef CPP_XIOS 50 USE wxios, ONLY: missing_val 51 #else 52 use netcdf, only: missing_val => nf90_fill_real 53 #endif 49 USE wxios, ONLY: missing_val_xios => missing_val, using_xios 50 use netcdf, only: nf90_fill_real 54 51 use config_ocean_skin_m, only: activate_ocean_skin 55 52 #ifdef ISO … … 108 105 REAL :: lon_startphy(klon), lat_startphy(klon) 109 106 CHARACTER(LEN=maxlen) :: tname, t(2) 110 107 REAL :: missing_val 111 108 #ifdef ISO 112 109 REAL xtsnow(niso,klon, nbsrf) … … 119 116 120 117 ! Ouvrir le fichier contenant l'etat initial: 118 IF (using_xios) THEN 119 missing_val = missing_val_xios 120 ELSE 121 missing_val = nf90_fill_real 122 ENDIF 121 123 122 124 CALL open_startphy(fichnom) -
LMDZ6/trunk/libf/phylmdiso/phys_output_mod.F90
r4524 r4619 47 47 USE vertical_layers_mod, ONLY: ap,bp,preff,presnivs, aps, bps, pseudoalt 48 48 USE time_phylmdz_mod, ONLY: day_ini, itau_phy, start_time, annee_ref, day_ref 49 #ifdef CPP_XIOS50 49 ! ug Pour les sorties XIOS 51 50 USE wxios 52 #endif53 51 #ifdef ISO 54 52 USE isotopes_mod, ONLY: isoName,iso_HTO … … 140 138 REAL, DIMENSION(klev+1) :: lev_index 141 139 142 #ifdef CPP_XIOS143 140 ! ug Variables utilis\'ees pour r\'ecup\'erer le calendrier pour xios 144 141 INTEGER :: x_an, x_mois, x_jour … … 146 143 INTEGER :: ini_an, ini_mois, ini_jour 147 144 REAL :: ini_heure 148 #endif149 145 INTEGER :: ISW 150 146 REAL, DIMENSION(NSW) :: wl1_sun, wl2_sun !wavelength bounds (in um) for SW … … 326 322 ENDIF 327 323 328 #ifdef CPP_XIOS 329 ! ug R\'eglage du calendrier xios330 !Temps julian => an, mois, jour, heure331 CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure)332 CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure)333 CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, &334 ini_mois, ini_jour, ini_heure )335 #endif 324 IF (using_xios) THEN 325 ! ug R\'eglage du calendrier xios 326 !Temps julian => an, mois, jour, heure 327 CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure) 328 CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure) 329 CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, & 330 ini_mois, ini_jour, ini_heure ) 331 ENDIF 336 332 337 333 !!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 366 362 367 363 368 #ifdef CPP_XIOS 364 IF (using_xios) THEN 369 365 !!! Ouverture de chaque fichier XIOS !!!!!!!!!!! 370 IF (.not. ok_all_xml) THEN 366 IF (.not. ok_all_xml) THEN 367 IF (prt_level >= 10) THEN 368 print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff)) 369 ENDIF 370 CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 371 ENDIF 372 373 !!! Declaration des axes verticaux de chaque fichier: 371 374 IF (prt_level >= 10) THEN 372 print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff))375 print*,'phys_output_open: Declare vertical axes for each file' 373 376 ENDIF 374 CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 375 ENDIF 376 377 !!! Declaration des axes verticaux de chaque fichier: 378 IF (prt_level >= 10) THEN 379 print*,'phys_output_open: Declare vertical axes for each file' 380 ENDIF 381 382 IF (iff.LE.6.OR.iff.EQ.10) THEN 383 CALL wxios_add_vaxis("presnivs", & 384 levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff))) 385 CALL wxios_add_vaxis("Ahyb", & 377 378 IF (iff.LE.6.OR.iff.EQ.10) THEN 379 CALL wxios_add_vaxis("presnivs", & 380 levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff))) 381 CALL wxios_add_vaxis("Ahyb", & 386 382 levmax(iff) - levmin(iff) + 1, aps(levmin(iff):levmax(iff)), positif='down', & 387 383 bnds=Ahyb_bounds(levmin(iff):levmax(iff),:)) 388 CALL wxios_add_vaxis("Bhyb", &384 CALL wxios_add_vaxis("Bhyb", & 389 385 levmax(iff) - levmin(iff) + 1, bps(levmin(iff):levmax(iff)), positif='down', & 390 386 bnds=Bhyb_bounds(levmin(iff):levmax(iff),:)) 391 CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, &387 CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, & 392 388 lev_index(levmin(iff):levmax(iff))) 393 CALL wxios_add_vaxis("klevp1", klev+1, &389 CALL wxios_add_vaxis("klevp1", klev+1, & 394 390 lev_index(1:klev+1)) 395 CALL wxios_add_vaxis("bnds", 2, (/1.,2./))396 397 CALL wxios_add_vaxis("Alt", &391 CALL wxios_add_vaxis("bnds", 2, (/1.,2./)) 392 393 CALL wxios_add_vaxis("Alt", & 398 394 levmax(iff) - levmin(iff) + 1, pseudoalt) 399 400 ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um)401 SELECT CASE(NSW)402 CASE(6)403 wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380]404 wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000]405 CASE(2)406 wl1_sun(1:2) = [0.250, 0.690]407 wl2_sun(1:2) = [0.690, 4.000]408 END SELECT409 410 DO ISW=1, NSW411 wn1_sun(ISW)=1.e+6/wl1_sun(ISW)412 wn2_sun(ISW)=1.e+6/wl2_sun(ISW)413 spbnds_sun(ISW,1)=wn2_sun(ISW)414 spbnds_sun(ISW,2)=wn1_sun(ISW)415 spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2416 ENDDO395 396 ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um) 397 SELECT CASE(NSW) 398 CASE(6) 399 wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380] 400 wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000] 401 CASE(2) 402 wl1_sun(1:2) = [0.250, 0.690] 403 wl2_sun(1:2) = [0.690, 4.000] 404 END SELECT 405 406 DO ISW=1, NSW 407 wn1_sun(ISW)=1.e+6/wl1_sun(ISW) 408 wn2_sun(ISW)=1.e+6/wl2_sun(ISW) 409 spbnds_sun(ISW,1)=wn2_sun(ISW) 410 spbnds_sun(ISW,2)=wn1_sun(ISW) 411 spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2 412 ENDDO 417 413 ! 418 414 !!! ajout axe vertical spectband : solar band number 419 CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down')420 ELSE415 CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down') 416 ELSE 421 417 ! NMC files 422 CALL wxios_add_vaxis("plev", &418 CALL wxios_add_vaxis("plev", & 423 419 levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff))) 424 ENDIF425 #endif420 ENDIF 421 ENDIF 426 422 427 423 IF (clef_files(iff)) THEN -
LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
r4613 r4619 76 76 USE vampir 77 77 USE write_field_phy 78 #ifdef CPP_XIOS 79 USE wxios, ONLY: g_ctx, wxios_set_context 80 #endif 78 USE wxios, ONLY: g_ctx, wxios_set_context, using_xios 81 79 USE lscp_mod, ONLY : lscp 82 80 USE lmdz_wake_ini, ONLY : wake_ini … … 134 132 135 133 136 #ifdef CPP_XIOS 137 USE xios, ONLY: xios_update_calendar, xios_context_finalize 138 USE xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context 139 USE xios, ONLY: xios_set_current_context 140 USE wxios, ONLY: missing_val, missing_val_omp 141 #endif 134 USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize 135 USE lmdz_xios, ONLY: xios_get_field_attr, xios_field_is_active, xios_context 136 USE lmdz_xios, ONLY: xios_set_current_context 137 USE wxios, ONLY: missing_val_xios => missing_val 138 142 139 #ifndef CPP_XIOS 143 140 USE paramLMDZ_phy_mod … … 1326 1323 real xtql1(ntraciso,klon),xtql2(ntraciso,klon),corrxtql(ntraciso) 1327 1324 #endif 1328 1325 1329 1326 REAL pi 1330 1327 … … 1343 1340 CALL update_time(pdtphys) 1344 1341 phys_tstep=NINT(pdtphys) 1342 IF (.NOT. using_xios) missing_val=nf90_fill_real 1345 1343 #ifdef CPP_XIOS 1346 1344 ! switch to XIOS LMDZ physics context … … 2150 2148 !============================================================= 2151 2149 2152 #ifdef CPP_XIOS 2153 ! Get "missing_val" value from XML files (from temperature variable) 2154 !$OMP MASTER 2155 CALL xios_get_field_attr("temp",default_value=missing_val_omp) 2156 !$OMP END MASTER 2157 !$OMP BARRIER 2158 missing_val=missing_val_omp 2159 #endif 2160 2161 #ifdef CPP_XIOS 2150 IF (using_xios) THEN 2151 ! Get "missing_val" value from XML files (from temperature variable) 2152 IF (is_omp_master) CALL xios_get_field_attr("temp",default_value=missing_val) 2153 CALL bcast_omp(missing_val) 2154 ENDIF 2155 2156 IF (using_xios) THEN 2162 2157 ! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only 2163 2158 ! initialised at that moment 2164 2159 ! Get "missing_val" value from XML files (from temperature variable) 2165 !$OMP MASTER 2166 CALL xios_get_field_attr("temp",default_value=missing_val_omp) 2167 !$OMP END MASTER 2168 !$OMP BARRIER 2169 missing_val=missing_val_omp 2160 IF (is_omp_master) CALL xios_get_field_attr("temp",default_value=missing_val) 2161 CALL bcast_omp(missing_val) 2162 2170 2163 ! 2171 2164 ! Now we activate some double radiation call flags only if some … … 2208 2201 CALL bcast(dryaod_diag) 2209 2202 CALL bcast(ok_4xCO2atm) 2210 #endif 2203 2204 ENDIF !using_xios 2205 2211 2206 ! 2212 2207 CALL printflag( tabcntr0,radpas,ok_journe, & … … 5773 5768 cool = cool + betalwoff * (cool0 - cool) 5774 5769 5775 #ifndef CPP_XIOS 5776 !5777 !IM 2eme calcul radiatif pour le cas perturbe ou au moins un5778 !IM des taux doit etre different du taux actuel5779 !IM Par defaut on a les taux perturbes egaux aux taux actuels5780 !5781 IF (RCO2_per.NE.RCO2_act.OR. &5782 RCH4_per.NE.RCH4_act.OR. &5783 RN2O_per.NE.RN2O_act.OR. &5784 RCFC11_per.NE.RCFC11_act.OR. &5785 RCFC12_per.NE.RCFC12_act) ok_4xCO2atm =.TRUE.5786 #endif 5770 IF (.NOT. using_xios) THEN 5771 ! 5772 !IM 2eme calcul radiatif pour le cas perturbe ou au moins un 5773 !IM des taux doit etre different du taux actuel 5774 !IM Par defaut on a les taux perturbes egaux aux taux actuels 5775 ! 5776 IF (RCO2_per.NE.RCO2_act.OR. & 5777 RCH4_per.NE.RCH4_act.OR. & 5778 RN2O_per.NE.RN2O_act.OR. & 5779 RCFC11_per.NE.RCFC11_act.OR. & 5780 RCFC12_per.NE.RCFC12_act) ok_4xCO2atm =.TRUE. 5781 ENDIF 5787 5782 ! 5788 5783 IF (ok_4xCO2atm) THEN … … 7005 7000 ! Pour XIOS : On remet des variables a .false. apres un premier appel 7006 7001 IF (debut) THEN 7007 #ifdef CPP_XIOS 7008 swaero_diag=.FALSE. 7009 swaerofree_diag=.FALSE. 7010 dryaod_diag=.FALSE. 7011 ok_4xCO2atm= .FALSE. 7012 ! write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm 7013 7014 IF (is_master) THEN 7015 !--setting up swaero_diag to TRUE in XIOS case 7016 IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 7017 xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 7018 xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR. & 7019 (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 7020 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0")))) & 7021 !!!--for now these fields are not in the XML files so they are omitted 7022 !!! xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 7023 swaero_diag=.TRUE. 7024 7025 !--setting up swaerofree_diag to TRUE in XIOS case 7026 IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. & 7027 xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR. & 7028 xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. & 7029 xios_field_is_active("LWupTOAcleanclr")) & 7030 swaerofree_diag=.TRUE. 7031 7032 !--setting up dryaod_diag to TRUE in XIOS case 7033 DO naero = 1, naero_tot-1 7034 IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 7035 ENDDO 7036 ! 7037 !--setting up ok_4xCO2atm to TRUE in XIOS case 7038 IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 7039 xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. & 7040 xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. & 7041 xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. & 7042 xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. & 7043 xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) & 7044 ok_4xCO2atm=.TRUE. 7045 ENDIF 7046 !$OMP BARRIER 7047 CALL bcast(swaero_diag) 7048 CALL bcast(swaerofree_diag) 7049 CALL bcast(dryaod_diag) 7050 CALL bcast(ok_4xCO2atm) 7051 ! write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm 7052 #endif 7002 7003 IF (using_xios) THEN 7004 swaero_diag=.FALSE. 7005 swaerofree_diag=.FALSE. 7006 dryaod_diag=.FALSE. 7007 ok_4xCO2atm= .FALSE. 7008 ! write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm 7009 7010 IF (is_master) THEN 7011 !--setting up swaero_diag to TRUE in XIOS case 7012 IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 7013 xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 7014 xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR. & 7015 (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 7016 xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0")))) & 7017 !!!--for now these fields are not in the XML files so they are omitted 7018 !!! xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 7019 swaero_diag=.TRUE. 7020 7021 !--setting up swaerofree_diag to TRUE in XIOS case 7022 IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. & 7023 xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR. & 7024 xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. & 7025 xios_field_is_active("LWupTOAcleanclr")) & 7026 swaerofree_diag=.TRUE. 7027 7028 !--setting up dryaod_diag to TRUE in XIOS case 7029 DO naero = 1, naero_tot-1 7030 IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 7031 ENDDO 7032 ! 7033 !--setting up ok_4xCO2atm to TRUE in XIOS case 7034 IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 7035 xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. & 7036 xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. & 7037 xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. & 7038 xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. & 7039 xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) & 7040 ok_4xCO2atm=.TRUE. 7041 ENDIF 7042 !$OMP BARRIER 7043 CALL bcast(swaero_diag) 7044 CALL bcast(swaerofree_diag) 7045 CALL bcast(dryaod_diag) 7046 CALL bcast(ok_4xCO2atm) 7047 ! write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm 7048 ENDIF !using_xios 7053 7049 ENDIF 7054 7050 … … 7112 7108 7113 7109 ENDIF 7114 #ifdef CPP_XIOS 7115 IF (is_omp_master) CALL xios_context_finalize 7110 7111 IF (using_xios) THEN 7112 IF (is_omp_master) CALL xios_context_finalize 7116 7113 7117 7114 #ifdef INCA 7118 if (type_trac == 'inca') then 7119 IF (is_omp_master .and. grid_type==unstructured) THEN 7120 CALL finalize_inca 7121 ENDIF 7122 endif 7123 #endif 7124 7125 #endif 7115 if (type_trac == 'inca') then 7116 IF (is_omp_master .and. grid_type==unstructured) THEN 7117 CALL finalize_inca 7118 ENDIF 7119 endif 7120 #endif 7121 ENDIF !using_xios 7126 7122 WRITE(lunout,*) ' physiq fin, nombre de steps ou cvpas = 1 : ', Ncvpaseq1 7127 7123 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.