Ignore:
Timestamp:
Jul 10, 2023, 1:40:39 AM (19 months ago)
Author:
yann meurdesoif
Message:

Suppress usage of preprocessing key CPP_XIOS.
Wrapper file is used to suppress XIOS symbol when xios is not linked and not used (-io ioipsl)
The CPP_XIOS key is replaced in model by "using_xios" boolean variable to switch between IOIPSL or XIOS output.

YM

Location:
LMDZ6/trunk/libf/phylmd/cospv2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_interface.F90

    r3723 r4619  
    6767  use ioipsl
    6868  use iophy
     69  use lmdz_xios, ONLY : using_xios
    6970  use lmdz_cosp_output_mod
    7071  use lmdz_cosp_output_write_mod
     
    262263
    263264! 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
    267268   call read_cosp_output_nl(itap,cosp_output_nl,cfg)
    268 #endif
     269 ENDIF
    269270
    270271  print*,' Cles des differents simulateurs cosp a itap :',itap
     
    278279    endif
    279280
    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
    290304    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
    305306
    306307  print*,'Fin lecture Namelists, debut_cosp =',debut_cosp
     
    311312!!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml
    312313  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)
    316315    first_write=.false.
    317316
  • LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_output_mod.F90

    r3491 r4619  
    326326  USE time_phylmdz_mod, ONLY: day_ref, annee_ref, day_ini, start_time, itau_phy
    327327  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
    333330
    334331  IMPLICIT NONE
     
    350347!!! Variables d'entree
    351348
    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
    359354
    360355    WRITE(lunout,*) 'Debut lmdz_cosp_output_mod.F90'
     
    401396    CALL ymds2ju(annee_ref, 1, day_ini, start_time, zjulian_start)
    402397
    403 #ifdef CPP_XIOS
     398  IF (using_xios) THEN
     399
    404400   
    405 ! recuperer la valeur indefine Xios
    406 !    CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value)
    407 !         Cosp_fill_value=missing_val
     401  ! recuperer la valeur indefine Xios
     402  !    CALL xios_get_field_attr("clcalipso",default_value=Cosp_fill_value)
     403  !         Cosp_fill_value=missing_val
    408404          Cosp_fill_value=0.
    409405         print*,'Cosp_fill_value=',Cosp_fill_value
     
    426422    CALL wxios_add_vaxis("column", Ncolumns, column_ax)
    427423
    428    WRITE(lunout,*) 'wxios_add_vaxis temp LIDAR_NTEMP, LIDAR_PHASE_TEMP ', &
    429                     LIDAR_NTEMP, LIDAR_PHASE_TEMP
    430    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 ', &
    433429                    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 ', &
    437433                    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', &
    441437                   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, &
    445441                   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, &
    449445                    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', &
    453449                    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
    457453   
    458454    zdtimemoy_cosp = freq_COSP         ! Frequence ou l on moyenne
     
    467463!                    nhoricosp(iff),cosp_nidfiles(iff)
    468464
    469 #ifdef CPP_XIOS
     465 IF (using_xios) THEN
    470466        IF (.not. ok_all_xml) then
    471467         WRITE(lunout,*) 'wxios_add_file ',cosp_outfilenames(iff)
    472468         CALL wxios_add_file(cosp_outfilenames(iff),chfreq(iff),10)
    473469        ENDIF
    474 #endif
     470 ENDIF
    475471
    476472#ifndef CPP_IOIPSL_NO_OUTPUT
  • LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90

    r3731 r4619  
    4242
    4343    USE wxios, only: wxios_closedef
    44     USE xios, only: xios_update_calendar, xios_field_is_active
     44    USE lmdz_xios, only: xios_update_calendar, xios_field_is_active
    4545  IMPLICIT NONE 
    4646!!! Variables d'entree
     
    807807  USE print_control_mod, ONLY: lunout,prt_level
    808808
    809   USE xios, only: xios_send_field
     809  USE lmdz_xios, only: xios_send_field
    810810
    811811  IMPLICIT NONE
     
    889889  USE print_control_mod, ONLY: lunout,prt_level
    890890
    891   USE xios, only: xios_send_field
     891  USE lmdz_xios, only: xios_send_field
    892892
    893893
     
    980980  USE print_control_mod, ONLY: lunout,prt_level
    981981
    982   USE xios, only: xios_send_field
     982  USE lmdz_xios, only: xios_send_field
    983983
    984984
  • LMDZ6/trunk/libf/phylmd/cospv2/lmdz_cosp_read_outputkeys.F90

    r3491 r4619  
    422422
    423423 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
    428425  implicit none
    429426  character(len=*),intent(in) :: cosp_nl
     
    10201017
    10211018 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
    10261020  implicit none
    10271021  type(cosp_config),intent(inout) :: cfg
    10281022  integer :: i
    1029 
    1030 #ifdef CPP_XIOS
    10311023
    10321024!COSPv2 local variables
     
    10671059       
    10681060  character(len=32) :: out_list(107)
     1061
     1062 IF (using_xios) THEN
    10691063
    10701064  do i=1,107
     
    17171711 endif
    17181712
    1719 #endif
     1713 ENDIF !using_xios
    17201714
    17211715  END SUBROUTINE read_xiosfieldactive
Note: See TracChangeset for help on using the changeset viewer.