Changeset 5252 for LMDZ6/trunk


Ignore:
Timestamp:
Oct 22, 2024, 2:09:45 PM (2 months ago)
Author:
abarral
Message:

Wrap uses of cpp key REPROBUS and CPP_STRATAER
Add REPROBUS wrapper

Location:
LMDZ6/trunk
Files:
2 added
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3d/dynetat0.F90

    r5251 r5252  
    2525#endif
    2626  USE iso_params_mod   ! tnat_* and alpha_ideal_*
    27   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     27  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS
     28  USE strings_mod, ONLY: strIdx
    2829
    2930  IMPLICIT NONE
     
    4748  CHARACTER(LEN=maxlen) :: mesg, var, modname, oldVar
    4849  INTEGER, PARAMETER :: length=100
    49   INTEGER :: iq, fID, vID, idecal, iqParent, iName, iZone, iPhase
     50  INTEGER :: iq, fID, vID, idecal, iqParent, iName, iZone, iPhase, ix
    5051  REAL    :: time, tnat, alpha_ideal, tab_cntrl(length)    !--- RUN PARAMS TABLE
    5152  LOGICAL :: lSkip, ll, ltnat1
     
    136137!--- Tracers
    137138  ll=.FALSE.
    138 #ifdef REPROBUS
     139IF (CPPKEY_REPROBUS) THEN
    139140  ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= NF90_NoErr                                 !--- DETECT OLD REPRO start.nc FILE
    140 #endif
     141END IF
    141142  ltnat1 = .TRUE.; CALL getin('tnateq1', ltnat1)
    142143  DO iq=1,nqtot
     
    144145    oldVar = new2oldH2O(var)
    145146    lSkip = ll .AND. var == 'HNO3'                                                       !--- FORCE "HNO3_g" READING FOR "HNO3"
    146 #ifdef REPROBUS
     147IF (CPPKEY_REPROBUS) THEN
    147148    ix = strIdx(newHNO3, var); IF(ix /= 0) oldVar = oldHNO3(ix)                          !--- REPROBUS HNO3 exceptions
    148 #endif
     149END IF
    149150IF (CPPKEY_INCA) THEN
    150151    IF(var == 'O3') oldVar = 'OX'                                                        !--- DEAL WITH INCA OZONE EXCEPTION
  • LMDZ6/trunk/libf/dyn3d_common/infotrac.F90

    r5251 r5252  
    118118SUBROUTINE init_infotrac
    119119   USE control_mod, ONLY: planet_type
    120 #ifdef REPROBUS
    121    USE CHEM_REP, ONLY: Init_chem_rep_trac
    122 #endif
    123    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     120   USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_trac
     121   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS, CPPKEY_STRATAER
    124122   IMPLICIT NONE
    125123!==============================================================================================================================
     
    202200END IF
    203201      CASE('repr')
    204 #ifndef REPROBUS
     202IF (.NOT. CPPKEY_REPROBUS) THEN
    205203         CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)
    206 #endif
     204END IF
    207205      CASE('coag')
    208 #ifndef CPP_StratAer
     206IF (.NOT. CPPKEY_STRATAER) THEN
    209207         CALL abort_gcm(modname, 'You must add cpp key StratAer and compile with StratAer code', 1)
    210 #endif
     208END IF
    211209   END SELECT
    212210
     
    279277   !---------------------------------------------------------------------------------------------------------------------------
    280278
    281 #ifdef REPROBUS
     279IF (CPPKEY_REPROBUS) THEN
    282280   CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name)
    283 #endif
     281END IF
    284282
    285283!==============================================================================================================================
  • LMDZ6/trunk/libf/dyn3dmem/dynetat0_loc.F90

    r5251 r5252  
    2626#endif
    2727  USE iso_params_mod   ! tnat_* and alpha_ideal_*
    28   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     28  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS
    2929
    3030  IMPLICIT NONE
     
    161161  ALLOCATE(q_glo(ip1jmp1,llm))
    162162  ll = .FALSE.
    163 #ifdef REPROBUS
     163IF (CPPKEY_REPROBUS) THEN
    164164  ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= NF90_NoErr                                 !--- DETECT OLD REPRO start.nc FILE
    165 #endif
     165END IF
    166166  ltnat1 = .TRUE.; CALL getin('tnateq1', ltnat1)
    167167  DO iq=1,nqtot
     
    169169    oldVar = new2oldH2O(var)
    170170    lSkip = ll .AND. var == 'HNO3'                                                       !--- FORCE "HNO3_g" READING FOR "HNO3"
    171 #ifdef REPROBUS
     171IF (CPPKEY_REPROBUS) THEN
    172172    ix = strIdx(newHNO3, var); IF(ix /= 0) oldVar = oldHNO3(ix)                          !--- REPROBUS HNO3 exceptions
    173 #endif
     173END IF
    174174IF (CPPKEY_INCA) THEN
    175175    IF(var == 'O3') oldVar = 'OX'                                                        !--- DEAL WITH INCA OZONE EXCEPTION
  • LMDZ6/trunk/libf/dyn3dmem/leapfrog_loc.F90

    r5251 r5252  
    4646         xios_set_current_context, &
    4747         using_xios
    48    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     48   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS
    4949
    5050  IMPLICIT NONE
     
    15311531     ENDIF
    15321532END IF
    1533 #ifdef REPROBUS
     1533IF (CPPKEY_REPROBUS) THEN
    15341534     if (type_trac == 'repr') CALL finalize_reprobus
    1535 #endif
     1535END IF
    15361536
    15371537!$OMP MASTER
     
    15881588          ENDIF
    15891589END IF
    1590 #ifdef REPROBUS
     1590IF (CPPKEY_REPROBUS) THEN
    15911591          if (type_trac == 'repr') CALL finalize_reprobus
    1592 #endif
     1592END IF
    15931593
    15941594!$OMP MASTER
     
    17621762
    17631763END IF
    1764 #ifdef REPROBUS
     1764IF (CPPKEY_REPROBUS) THEN
    17651765             if (type_trac == 'repr') CALL finalize_reprobus
    1766 #endif
     1766END IF
    17671767
    17681768!$OMP MASTER
     
    18761876
    18771877END IF
    1878 #ifdef REPROBUS
     1878IF (CPPKEY_REPROBUS) THEN
    18791879  if (type_trac == 'repr') CALL finalize_reprobus
    1880 #endif
     1880END IF
    18811881
    18821882!$OMP MASTER
  • LMDZ6/trunk/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90

    r5251 r5252  
    1717  USE vertical_layers_mod, ONLY : init_vertical_layers
    1818  USE infotrac, ONLY: nbtr, type_trac
    19 #ifdef CPP_StratAer
    2019  USE infotrac_phy, ONLY: nbtr_bin, nbtr_sulgas, id_OCS_strat, &
    2120                      id_SO2_strat, id_H2SO4_strat, id_BIN01_strat
    22 
    23 #endif
    24 #ifdef REPROBUS
    25   USE CHEM_REP, ONLY : Init_chem_rep_phys
     21  USE lmdz_reprobus_wrappers, ONLY : Init_chem_rep_phys
    2622#ifdef CPP_PARA
    2723  USE parallel_lmdz, ONLY : mpi_size, mpi_rank
     
    2925#endif
    3026  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
    31 #endif
    3227  USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq
    3328  USE inifis_mod, ONLY: inifis
     
    4641  USE ioipsl_getin_p_mod, ONLY: getin_p
    4742  USE slab_heat_transp_mod, ONLY: ini_slab_transp_geom
    48   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     43  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS
    4944  IMPLICIT NONE
    5045
     
    140135  ! Initializations for Reprobus
    141136  IF (type_trac == 'repr') THEN
    142 #ifdef REPROBUS
     137IF (CPPKEY_REPROBUS) THEN
    143138    call Init_chem_rep_phys(klon_omp,nlayer)
    144139    call init_reprobus_para( &
    145140          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
    146141          distrib_phys,communicator)
    147 #endif
     142END IF
    148143  ENDIF
    149144!$OMP END PARALLEL
     
    151146
    152147  IF (type_trac == 'repr') THEN
    153 #ifdef REPROBUS
     148IF (CPPKEY_REPROBUS) THEN
    154149    call init_reprobus_para( &
    155150          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
    156151          distrib_phys,communicator)
    157 #endif
     152END IF
    158153  ENDIF
    159154
  • LMDZ6/trunk/libf/misc/lmdz_reprobus_wrappers.F90

    r5230 r5252  
    88
    99  ! TODO ugly temp solution until we properly wrap the REPROBUS code
    10   USE lmdz_dimensions, ONLY: iim, jjm
     10  INCLUDE "dimensions.h"
    1111  INTEGER :: itroprep(iim), iter, ndimozon
    1212  REAL :: rsuntime(2), pdt_rep, daynum, solaireTIME, ptrop(iim), ttrop(iim), ztrop(iim), gravit, Z1, &
  • LMDZ6/trunk/libf/phy_common/physics_distribution_mod.F90

    r5251 r5252  
    1414  USE dimphy, ONLY : Init_dimphy
    1515  USE infotrac_phy, ONLY : type_trac
    16 #ifdef REPROBUS
    17   USE CHEM_REP, ONLY : Init_chem_rep_phys
    18 #endif
    19   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     16  USE lmdz_reprobus_wrappers, ONLY : Init_chem_rep_phys
     17  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS
    2018
    2119  IMPLICIT NONE
     
    3836END IF
    3937
    40 #ifdef REPROBUS
     38IF (CPPKEY_REPROBUS) THEN
    4139! Initialization of Reprobus
    4240    IF (type_trac == 'repr') CALL Init_chem_rep_phys(klon_omp,nbp_lev)
    43 #endif
     41END IF
    4442
    4543!$OMP END PARALLEL
     
    5351!  USE infotrac_phy, ONLY : type_trac
    5452!#ifdef REPROBUS
    55 !  USE CHEM_REP, ONLY : Init_chem_rep_phys
     53!  USE lmdz_reprobus_wrappers, ONLY : Init_chem_rep_phys
    5654!#endif
    5755
  • LMDZ6/trunk/libf/phylmd/conf_phys_m.F90

    r5204 r5252  
    3535    USE phys_state_var_mod, ONLY: phys_tstep
    3636    USE infotrac_phy, ONLY: type_trac
     37    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
    3738
    3839    INCLUDE "conema3.h"
     
    25982599!       CALL abort_physic('conf_phys','ok_suntime_rrtm=y and solaire is provided',1)
    25992600!    ENDIF
    2600 #ifdef CPP_StratAer
    2601     IF (iflag_rrtm .NE. 1) THEN 
     2601IF (CPPKEY_STRATAER) THEN
     2602    IF (iflag_rrtm .NE. 1) THEN
    26022603       WRITE(lunout,*) ' ERROR iflag_rrtm<>1 but StratAer activated'
    26032604       CALL abort_physic('conf_phys','iflag_rrtm not valid for StratAer',1)
    26042605    ENDIF
    2605     IF (NSW .NE. 6) THEN 
     2606    IF (NSW .NE. 6) THEN
    26062607       WRITE(lunout,*) ' ERROR NSW<>6 but StratAer activated'
    26072608       CALL abort_physic('conf_phys','NSW not valid for StratAer',1)
    26082609    ENDIF
    2609 #endif
     2610END IF
    26102611
    26112612    !--test on ocean surface albedo
  • LMDZ6/trunk/libf/phylmd/infotrac_phy.F90

    r5251 r5252  
    1919   PUBLIC :: new2oldH2O                                    !--- For backwards compatibility in phyetat0
    2020   PUBLIC :: addPhase, delPhase                            !--- Add/remove the phase from the name of a tracer
    21 #if defined CPP_StratAer || defined REPROBUS
    2221   PUBLIC :: nbtr_bin, nbtr_sulgas                         !--- Number of aerosols bins and sulfur gases for StratAer model
    2322   PUBLIC :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat
    24 #endif
    2523
    2624   !=== FOR ISOTOPES: General
     
    123121!$OMP THREADPRIVATE(conv_flg, pbl_flg)
    124122
    125 #if defined CPP_StratAer || defined REPROBUS
    126123  !=== SPECIFIC TO STRATOSPHERIC AEROSOLS (CK/OB)
    127124  INTEGER, SAVE ::  nbtr_bin, nbtr_sulgas         !--- number of aerosols bins and sulfur gases for StratAer model
     
    129126  INTEGER, SAVE ::  id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat
    130127!$OMP THREADPRIVATE(id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat)
    131 #endif
    132128
    133129CONTAINS
     
    135131SUBROUTINE init_infotrac_phy
    136132   USE ioipsl_getin_p_mod, ONLY: getin_p
    137 #ifdef REPROBUS
    138    USE CHEM_REP, ONLY: Init_chem_rep_trac
    139 #endif
    140    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     133   USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_trac
     134   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS, CPPKEY_STRATAER
    141135   IMPLICIT NONE
    142136!==============================================================================================================================
     
    169163   CHARACTER(LEN=8), ALLOCATABLE :: solsym_inca(:)                   !--- Tracers names for INCA
    170164   INTEGER :: nqINCA
    171 #ifdef CPP_StratAer
    172165   CHARACTER(LEN=maxlen), ALLOCATABLE :: tnames(:)
    173 #endif
    174166   CHARACTER(LEN=2)      ::   suff(9)                                !--- Suffixes for schemes of order 3 or 4 (Prather)
    175167   CHARACTER(LEN=3)      :: descrq(30)                               !--- Advection scheme description tags
     
    227219END IF
    228220      CASE('repr')
    229 #ifndef REPROBUS
     221IF (.NOT. CPPKEY_REPROBUS) THEN
    230222         CALL abort_physic(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)
    231 #endif
     223END IF
    232224      CASE('coag')
    233 #ifndef CPP_StratAer
     225IF (.NOT. CPPKEY_STRATAER) THEN
    234226         CALL abort_physic(modname, 'You must add cpp key StratAer and compile with StratAer code', 1)
    235 #endif
     227END IF
    236228   END SELECT
    237229!##############################################################################################################################
     
    314306   !---------------------------------------------------------------------------------------------------------------------------
    315307
    316 #ifdef REPROBUS
     308IF (CPPKEY_REPROBUS) THEN
    317309   CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name)                         !--- Transfert the number of tracers to Reprobus
    318 #endif
     310END IF
    319311
    320312!##############################################################################################################################
     
    443435   CALL msg('iso_iName = '//strStack(int2str(PACK(tracers(:)%iso_iName, MASK=tracers(:)%iso_iGroup==iH2O))), modname)
    444436#endif
    445 #ifdef CPP_StratAer
     437IF (CPPKEY_STRATAER) THEN
    446438   IF (type_trac == 'coag') THEN
    447439      nbtr_bin    = COUNT([(tracers(iq)%name(1:3)=='BIN', iq=1, nqtot)])
     
    461453      CALL msg('id_TEST_strat  ='//TRIM(int2str(id_TEST_strat )), modname)
    462454   END IF
    463 #endif
     455END IF
    464456   CALL msg('end', modname)
    465457
  • LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90

    r5215 r5252  
    33!
    44      MODULE phys_local_var_mod
     5            USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
    56! Variables locales pour effectuer les appels en serie
    67!======================================================================
     
    701702      !$OMP THREADPRIVATE(dqsfreez)
    702703
    703 
    704      
    705 
    706 
    707 #ifdef CPP_StratAer
    708 !
    709704! variables for stratospheric aerosol
    710705      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: d_q_emiss
     
    717712!$OMP THREADPRIVATE(DENSO4)
    718713      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: DENSO4B
    719 !$OMP THREADPRIVATE(DENSO4B)     
     714!$OMP THREADPRIVATE(DENSO4B)
    720715      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
    721716!$OMP THREADPRIVATE(f_r_wet)
     
    802797      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
    803798!$OMP THREADPRIVATE(budg_sed_part)
    804 #endif
    805 #ifdef REPROBUS
    806       REAL,SAVE,ALLOCATABLE    :: d_q_emiss(:,:)
    807 !$OMP THREADPRIVATE(d_q_emiss)
    808 #endif
    809799
    810800CONTAINS
     
    821811USE phys_output_var_mod
    822812USE phys_state_var_mod
    823 #ifdef CPP_StratAer
    824813USE infotrac_phy, ONLY : nbtr_bin
    825 #endif
    826814
    827815IMPLICIT NONE
     
    12291217      ALLOCATE(dqsauto(klon,klev), dqsagg(klon,klev), dqsrim(klon,klev), dqsmelt(klon,klev), dqsfreez(klon,klev))
    12301218
    1231 #ifdef CPP_StratAer
     1219IF (CPPKEY_STRATAER) THEN
    12321220      ALLOCATE (d_q_emiss(klon,klev))
    12331221      ALLOCATE (R2SO4(klon,klev))
     
    12781266      ALLOCATE (sulfmmr_mode(klon,klev,nbtr_bin))
    12791267      ALLOCATE (nd_mode(klon,klev,nbtr_bin))
    1280 #endif
     1268END IF
    12811269
    12821270END SUBROUTINE phys_local_var_init
     
    16341622      DEALLOCATE(dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
    16351623
    1636 #ifdef CPP_StratAer
     1624IF (CPPKEY_STRATAER) THEN
    16371625! variables for strat. aerosol CK
    16381626      DEALLOCATE (d_q_emiss)
     
    16811669      DEALLOCATE (budg_h2so4_to_part)
    16821670      DEALLOCATE (budg_sed_part)
    1683 #endif
     1671END IF
    16841672
    16851673END SUBROUTINE phys_local_var_end
  • LMDZ6/trunk/libf/phylmd/phys_output_ctrlout_mod.F90

    r5204 r5252  
    14381438    'flx_co2_land_cor', 'correction of the CO2 flux from the land', 'kg CO2 m-2 s-1', (/ ('', i=1, 10) /))
    14391439
    1440 #ifdef CPP_StratAer
    14411440!--extinction coefficient
    14421441  TYPE(ctrl_out), SAVE :: o_ext_strat_550 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
     
    15171516  TYPE(ctrl_out), SAVE :: o_surf_PM25_sulf = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
    15181517    'surf_PM25_sulf', 'Sulfate PM2.5 concentration at the surface', 'ug/m3', (/ ('', i=1, 10) /))
    1519 #endif
    15201518
    15211519!!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  • LMDZ6/trunk/libf/phylmd/phys_output_mod.F90

    r5056 r5252  
    4949    ! ug Pour les sorties XIOS
    5050    USE wxios
    51 #ifdef CPP_StratAer
    5251   USE infotrac_phy, ONLY: nbtr_bin
    53 #endif
    5452#ifdef ISO
    5553    USE isotopes_mod, ONLY: isoName,iso_HTO
     
    5856#endif
    5957#endif
     58
     59    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
    6060
    6161    IMPLICIT NONE
     
    171171    ALLOCATE(o_dtr_sscav(nqtot),o_dtr_sat(nqtot),o_dtr_uscav(nqtot))
    172172    ALLOCATE(o_dtr_dry(nqtot),o_dtr_vdf(nqtot))
    173 #ifdef CPP_StratAer
     173IF (CPPKEY_STRATAER) THEN
    174174    ALLOCATE(o_nd_mode(nbtr_bin),o_sulfmmr_mode(nbtr_bin))
    175 #endif
     175END IF
    176176#ifdef ISO
    177177    ALLOCATE(o_xtprecip(ntraciso))
     
    233233    clef_files(8) = ok_histNMC(2)
    234234    clef_files(9) = ok_histNMC(3)
    235 #ifdef CPP_StratAer
    236     clef_files(10)= .TRUE.
    237 #else
    238     clef_files(10)= .FALSE.
    239 #endif
     235    IF (CPPKEY_STRATAER) THEN
     236      clef_files(10)= .TRUE.
     237    ELSE
     238      clef_files(10)= .FALSE.
     239    END IF
    240240
    241241    !sortir des fichiers "stations" si clef_stations(:)=.TRUE.
     
    545545            tnam = 'cum'//TRIM(tracers(iq)%name); o_trac_cum(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)])
    546546           
    547 #ifdef CPP_StratAer
     547IF (CPPKEY_STRATAER) THEN
    548548            if(tracers(iq)%name(1:3)=='BIN') then
    549549               itrb = itrb + 1
     
    554554               tnam = TRIM(tracers(iq)%name)//'_sulfmmr_mode';o_sulfmmr_mode  (itrb) = ctrl_out(flag, tnam, lnam, "kg(H2SO4)/kg(air)", [('',i=1,nfiles)])
    555555            endif
    556 #endif
     556END IF
    557557         ENDDO
    558558
  • LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90

    r5204 r5252  
    249249#endif
    250250
    251 #ifdef CPP_StratAer
    252251    USE infotrac_phy, ONLY: nbtr_bin
    253     USE phys_output_ctrlout_mod, ONLY:  & 
     252    USE phys_output_ctrlout_mod, ONLY:  &
    254253         o_budg_3D_nucl, o_budg_3D_cond_evap, o_budg_3D_ocs_to_so2, o_budg_3D_so2_to_h2so4, &
    255254         o_budg_sed_part, o_R2SO4, o_OCS_lifetime, o_SO2_lifetime, &
    256          o_budg_3D_backgr_ocs, o_budg_3D_backgr_so2, & 
     255         o_budg_3D_backgr_ocs, o_budg_3D_backgr_so2, &
    257256         o_budg_dep_dry_ocs, o_budg_dep_wet_ocs, &
    258257         o_budg_dep_dry_so2, o_budg_dep_wet_so2, &
    259258         o_budg_dep_dry_h2so4, o_budg_dep_wet_h2so4, &
    260          o_budg_dep_dry_part, o_budg_dep_wet_part, & 
    261          o_budg_emi_ocs, o_budg_emi_so2, o_budg_emi_h2so4, o_budg_emi_part, & 
     259         o_budg_dep_dry_part, o_budg_dep_wet_part, &
     260         o_budg_emi_ocs, o_budg_emi_so2, o_budg_emi_h2so4, o_budg_emi_part, &
    262261         o_budg_ocs_to_so2, o_budg_so2_to_h2so4, o_budg_h2so4_to_part, &
    263262         o_surf_PM25_sulf, o_ext_strat_550, o_tau_strat_550, &
    264263         o_vsed_aer, o_tau_strat_1020, o_ext_strat_1020, o_f_r_wet, &
    265264         o_SAD_sulfate, o_reff_sulfate, o_sulfmmr, o_nd_mode, o_sulfmmr_mode
    266 #endif
    267265
    268266    USE lmdz_lscp_ini, ONLY: ok_poprecip
     
    411409         reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra
    412410   
    413 #ifdef CPP_StratAer
    414411    USE phys_local_var_mod, ONLY:  &
    415412         budg_3D_nucl, budg_3D_cond_evap, budg_3D_ocs_to_so2, budg_3D_so2_to_h2so4, &
     
    425422         vsed_aer, tau_strat_1020, f_r_wet, &
    426423         SAD_sulfate, reff_sulfate, sulfmmr, nd_mode, sulfmmr_mode
    427 #endif
    428424
    429425    USE carbon_cycle_mod, ONLY: fco2_ff, fco2_bb, fco2_land, fco2_ocean
     
    478474
    479475    USE vertical_layers_mod, ONLY: presnivs
     476    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
    480477
    481478    IMPLICIT NONE
     
    534531    REAL, DIMENSION(klon,klev) :: coefh_stok
    535532   
    536 #ifdef CPP_StratAer
    537533    LOGICAL, PARAMETER :: debug_strataer=.FALSE.
    538534    CHARACTER(LEN=maxlen) :: unt
    539 #endif
    540535
    541536#ifdef ISO
     
    18311826! end add ThL
    18321827
    1833 #ifdef CPP_StratAer
     1828IF (CPPKEY_STRATAER) THEN
    18341829       IF (type_trac=='coag') THEN
    18351830          CALL histwrite_phy(o_R2SO4, R2SO4)
     
    18741869          ENDDO !--itr
    18751870       ENDIF
    1876 #endif
     1871END IF
    18771872       !NL
    18781873       IF (ok_volcan .AND. ok_ade) THEN
  • LMDZ6/trunk/libf/phylmd/physiq_mod.F90

    r5251 r5252  
    112112    USE time_phylmdz_mod,  ONLY: ndays
    113113    USE infotrac_phy,      ONLY: nqCO2
    114 #ifdef REPROBUS
    115     USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
     114    USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
    116115                        ptrop, ttrop, ztrop, gravit, itroprep, Z1, Z2, fac, B
    117116    USE strataer_local_var_mod
    118117    USE strataer_emiss_mod, ONLY: strataer_emiss_init
    119 #endif
    120118    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
    121119    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
    122     USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     120    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS, CPPKEY_STRATAER
    123121
    124122#ifdef CPP_RRTM
     
    127125#endif
    128126
    129 
    130 #ifdef CPP_StratAer
    131127    USE phys_local_var_mod, ONLY: d_q_emiss
    132128    USE strataer_local_var_mod
    133129    USE strataer_nuc_mod, ONLY: strataer_nuc_init
    134130    USE strataer_emiss_mod, ONLY: strataer_emiss_init
    135 #endif
    136131
    137132    USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize
     
    18821877       !
    18831878!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    1884 #ifdef REPROBUS
     1879IF (CPPKEY_REPROBUS) THEN
    18851880       CALL strataer_init
    18861881       CALL strataer_emiss_init
    1887 #endif
    1888 
    1889 #ifdef CPP_StratAer
     1882END IF
     1883
     1884IF (CPPKEY_STRATAER) THEN
    18901885       CALL strataer_init
    18911886       CALL strataer_nuc_init
    18921887       CALL strataer_emiss_init
    1893 #endif
     1888END IF
    18941889
    18951890#ifdef CPP_Dust
     
    22542249       !
    22552250       IF (type_trac == 'repr') THEN
    2256 #ifdef REPROBUS
     2251IF (CPPKEY_REPROBUS) THEN
    22572252          CALL chemini_rep(  &
    22582253               presnivs, &
     
    22652260               io_lon, &
    22662261               io_lat)
    2267 #endif
     2262END IF
    22682263       ENDIF
    22692264
     
    23692364    ! Update time and other variables in Reprobus
    23702365    IF (type_trac == 'repr') THEN
    2371 #ifdef REPROBUS
     2366IF (CPPKEY_REPROBUS) THEN
    23722367       CALL Init_chem_rep_xjour(jD_cur-jD_ref+day_ref)
    23732368       print*,'xjour equivalent rjourvrai',jD_cur-jD_ref+day_ref
    23742369       CALL Rtime(debut)
    2375 #endif
     2370END IF
    23762371    ENDIF
    23772372
     
    26252620
    26262621          wo(:,:,1)=ozonecm(latitude_deg, paprs,read_climoz,rjour=zzz)
    2627 #ifdef REPROBUS
     2622IF (CPPKEY_REPROBUS) THEN
    26282623          ptrop=dyn_tropopause(t_seri, ztsol, paprs, pplay, rot)/100.
    26292624          DO i = 1, klon
     
    26332628             B=Z2-fac*alog(pplay(i,itroprep(i)))
    26342629             ttrop(i)= fac*alog(ptrop(i))+B
    2635 !       
     2630!
    26362631             Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit
    26372632             Z2= 1.e-3 * ( pphi(i,itroprep(i))  +pphis(i) ) / gravit
     
    26402635             ztrop(i)=fac*alog(ptrop(i))+B
    26412636          ENDDO
    2642 #endif
     2637END IF
    26432638       ELSE
    26442639          !--- ro3i = elapsed days number since current year 1st january, 0h
     
    42314226    ENDIF !type_trac = inca or inco
    42324227    IF (type_trac == 'repr') THEN
    4233 #ifdef REPROBUS
     4228IF (CPPKEY_REPROBUS) THEN
    42344229    !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap)
    4235     CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap) 
    4236 #endif
     4230    CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap)
     4231END IF
    42374232    ENDIF
    42384233
     
    43704365          ELSE
    43714366#ifdef CPP_RRTM
    4372 #ifndef CPP_StratAer
    4373           !--prescribed strat aerosols 
     4367IF (.NOT. CPPKEY_STRATAER) THEN
     4368          !--prescribed strat aerosols
    43744369          !--only in the case of non-interactive strat aerosols
    43754370            IF (flag_aerosol_strat.EQ.1) THEN
     
    43814376             CALL abort_physic(modname,abort_message,1)
    43824377            ENDIF
    4383 #endif
     4378END IF
    43844379#else
    43854380             abort_message='You should compile with -rrtm if running ' &
     
    43934388!
    43944389#ifdef CPP_RRTM
    4395 #ifdef CPP_StratAer
     4390IF (CPPKEY_STRATAER) THEN
    43964391       !--compute stratospheric mask
    43974392       CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
    43984393       !--interactive strat aerosols
    43994394       CALL calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
    4400 #endif
     4395END IF
    44014396#endif
    44024397       !--fin STRAT AEROSOL
     
    50115006    IF (ok_qch4) THEN
    50125007!      d_q_ch4: H2O source from CH4 in MMR/s (mass mixing ratio/s or kg H2O/kg air/s)
    5013 #ifdef CPP_StratAer
     5008    IF (CPPKEY_STRATAER) THEN
     5009
    50145010       CALL stratH2O_methox(debut,paprs,d_q_ch4)
    5015 #else
     5011    ELSE
    50165012!      ECMWF routine METHOX
    50175013       CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay)
    5018 #endif
     5014    END IF
    50195015       ! add humidity tendency due to methane
    50205016       d_q_ch4_dtime(:,:) = d_q_ch4(:,:)*phys_tstep
     
    50255021    !
    50265022    !
    5027 #ifdef CPP_StratAer
     5023IF (CPPKEY_STRATAER) THEN
    50285024    IF (ok_qemiss) THEN
    50295025       flh2o=1
     
    50335029          print *,'IN physiq_mod: nAerErupt=',nAerErupt
    50345030       ENDIF
    5035        
     5031
    50365032       SELECT CASE(flag_emit)
    50375033       CASE(1) ! emission volc H2O in LMDZ
     
    50415037                  day_cur>=day_emit_vol(ieru).AND.&
    50425038                  day_cur<(day_emit_vol(ieru)+injdur)) THEN
    5043                
     5039
    50445040                IF(flag_verbose_strataer) print *,'IN physiq_mod: date=',year_cur,mth_cur,day_cur
    50455041                ! initialisation of q tendency emission
     
    50565052                    altemiss_vol(ieru),sigma_alt_vol(ieru),1,1.,&
    50575053                    nAerErupt+1,0)
    5058                
     5054
    50595055                IF(flag_verbose_strataer) print *,'IN physiq_mod: min max d_q_emiss=',&
    50605056                     minval(d_q_emiss),maxval(d_q_emiss)
    5061                
     5057
    50625058                CALL add_phys_tend(du0, dv0, dt0, d_q_emiss, dql0, dqi0, dqbs0, paprs, &
    50635059                     'q_emiss',abortphy,flag_inhib_tend,itap,0)
     
    50685064       END SELECT ! emission scenario (flag_emit)
    50695065    ENDIF
    5070 #endif
     5066END IF
    50715067
    50725068!===============================================================
     
    53055301!MM                               dans Reprobus
    53065302       sh_in(:,:) = q_seri(:,:)
    5307 #ifdef REPROBUS
     5303IF (CPPKEY_REPROBUS) THEN
    53085304       d_q_rep(:,:) = 0.
    53095305       d_ql_rep(:,:) = 0.
    53105306       d_qi_rep(:,:) = 0.
    5311 #endif
     5307END IF
    53125308    ELSE
    53135309       sh_in(:,:) = qx(:,:,ivap)
     
    53625358         d_tr_dyn, &                                 !<<RomP
    53635359         tr_seri, init_source)
    5364 #ifdef REPROBUS
     5360IF (CPPKEY_REPROBUS) THEN
    53655361
    53665362
     
    53745370          print*,'apr add phys rep',abortphy
    53755371
    5376 #endif
     5372END IF
    53775373    ENDIF    ! (iflag_phytrac=1)
    53785374
     
    54435439    ENDDO
    54445440
    5445 #ifdef CPP_StratAer
     5441IF (CPPKEY_STRATAER) THEN
    54465442    IF (ok_qemiss) THEN
    54475443       DO k = 1, klev
     
    54495445       ENDDO
    54505446    ENDIF
    5451 #endif
     5447END IF
    54525448    IF (ok_qch4) THEN
    54535449       DO k = 1, klev
     
    55485544
    55495545    IF (type_trac == 'repr') THEN
    5550 #ifdef REPROBUS
     5546IF (CPPKEY_REPROBUS) THEN
    55515547        CALL coord_hyb_rep(paprs, pplay, aps, bps, ap, bp, cell_area)
    5552 #endif
     5548END IF
    55535549    ENDIF
    55545550
  • LMDZ6/trunk/libf/phylmd/phytrac_mod.F90

    r5246 r5252  
    139139    USE tracco2i_mod
    140140
    141 #ifdef CPP_StratAer
    142141    USE traccoag_mod
    143142    USE phys_local_var_mod, ONLY: mdw
     
    149148    USE strataer_nuc_mod, ONLY : tracstrataer_init
    150149    USE aerophys
    151 #endif
     150
     151    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
    152152
    153153    IMPLICIT NONE
     
    284284    REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf ! Pourcentage de sol (nature du sol)
    285285
    286 #ifdef CPP_StratAer
    287286    REAL,DIMENSION(klon)           :: v_dep_dry !dry deposition velocity of stratospheric sulfate in m/s
    288 #endif
    289287    ! Output argument
    290288    !----------------
     
    513511          iflag_vdf_trac = 1                              ! From CO2i
    514512          iflag_con_trac = 1                              ! From CO2i
    515 #ifdef CPP_StratAer
     513IF (CPPKEY_STRATAER) THEN
    516514       ELSE IF (type_trac == 'coag') THEN
    517515          source(:,:)=0.
    518516          CALL tracstrataer_init(aerosol,lessivage)       ! init aerosols and lessivage param
    519 #endif
     517END IF
    520518       ELSE IF (type_trac == 'lmdz') THEN
    521519          CALL traclmdz_init(pctsrf,xlat,xlon,ftsol,tr_seri,t_seri,pplay,sh,pdtphys,aerosol,lessivage)
     
    564562             ELSE IF (type_trac == 'inco') THEN     ! Add ThL
    565563                flag_cvltr(it)=.FALSE.
    566 #ifdef CPP_StratAer
     564IF (CPPKEY_STRATAER) THEN
    567565             ELSE IF (type_trac == 'coag') THEN
    568566                IF (convscav.and.aerosol(it)) THEN
    569567                   flag_cvltr(it)=.TRUE.
    570                    ccntrAA(it) =ccntrAA_in   
     568                   ccntrAA(it) =ccntrAA_in
    571569                   ccntrENV(it)=ccntrENV_in
    572570                   coefcoli(it)=coefcoli_in
     
    574572                   flag_cvltr(it)=.FALSE.
    575573                ENDIF
    576 #endif
     574END IF
    577575             ELSE IF (type_trac == 'lmdz') THEN
    578576                IF (convscav.and.aerosol(it)) THEN
     
    658656            t_seri, pplay, paprs, tr_seri, source)
    659657
    660 #ifdef CPP_StratAer
     658IF (CPPKEY_STRATAER) THEN
    661659    ELSE IF (type_trac == 'coag') THEN
    662660       !   --STRATOSPHERIC AER IN THE STRAT --
     
    665663            t_seri, pplay, paprs, sh, rh , &
    666664            tr_seri)
    667 #endif
     665END IF
    668666    ELSE IF (type_trac == 'lmdz') THEN
    669667       !    -- Traitement des traceurs avec traclmdz
     
    739737       ENDDO ! nbtr
    740738
    741 #ifdef CPP_StratAer
     739IF (CPPKEY_STRATAER) THEN
    742740       IF (type_trac=='coag') THEN
    743741         ! initialize wet deposition flux of sulfur
     
    770768         ENDDO
    771769       ENDIF
    772 #endif
     770END IF
    773771
    774772    ENDIF ! convection
     
    820818       !  Injection during BL mixing
    821819       !
    822 #ifdef CPP_StratAer
     820IF (CPPKEY_STRATAER) THEN
    823821       IF (type_trac=='coag') THEN
    824822
     
    844842
    845843       ENDIF
    846 #endif
     844END IF
    847845
    848846       DO it=1, nbtr
     
    857855             tr_seri(:,:,it)=tr_seri(:,:,it)+d_tr_cl(:,:,it)
    858856             !
    859 #ifdef CPP_StratAer
     857IF (CPPKEY_STRATAER) THEN
    860858             IF (type_trac=='coag') THEN
    861859               ! compute dry deposition flux of sulfur (sum over gases and particles)
     
    871869               ENDIF
    872870             ENDIF
    873 #endif
     871END IF
    874872             !
    875873          ENDIF
     
    938936          ENDDO  !tr
    939937
    940 #ifdef CPP_StratAer
     938IF (CPPKEY_STRATAER) THEN
    941939         IF (type_trac=='coag') THEN
    942940           ! compute wet deposition flux of sulfur (sum over gases and
     
    964962           ENDDO
    965963         ENDIF
    966 #endif
     964END IF
    967965
    968966       ELSE IF (iflag_lscav .EQ. 2) THEN ! frac_impa, frac_nucl
  • LMDZ6/trunk/libf/phylmd/radiation_AR4.F90

    r4389 r5252  
    480480  USE radiation_ar4_param, ONLY: rsun, rray
    481481  USE infotrac_phy, ONLY: type_trac
    482 #ifdef REPROBUS
    483   USE chem_rep, ONLY: rsuntime, ok_suntime
     482  USE lmdz_reprobus_wrappers, ONLY: rsuntime, ok_suntime
    484483  USE print_control_mod, ONLY: lunout
    485 #endif
     484  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS
    486485
    487486  IMPLICIT NONE
     
    572571  ! Otherwise keep default values from radiation_AR4_param module.
    573572  IF (type_trac=='repr') THEN
    574 #ifdef REPROBUS
     573IF (CPPKEY_REPROBUS) THEN
    575574    IF (ok_suntime) THEN
    576575      rsun(1) = rsuntime(1)
     
    578577    END IF
    579578    WRITE (lunout, *) 'RSUN(1): ', rsun(1)
    580 #endif
     579END IF
    581580  END IF
    582581
     
    702701  USE radiation_ar4_param, ONLY: rsun, rray
    703702  USE infotrac_phy, ONLY: type_trac
    704 #ifdef REPROBUS
    705   USE chem_rep, ONLY: rsuntime, ok_suntime
    706 #endif
     703  USE lmdz_reprobus_wrappers, ONLY: rsuntime, ok_suntime
     704  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS
    707705
    708706  IMPLICIT NONE
     
    826824  ! Otherwise keep default values from radiation_AR4_param module.
    827825  IF (type_trac=='repr') THEN
    828 #ifdef REPROBUS
     826IF (CPPKEY_REPROBUS) THEN
    829827    IF (ok_suntime) THEN
    830828      rsun(1) = rsuntime(1)
    831829      rsun(2) = rsuntime(2)
    832830    END IF
    833 #endif
     831END IF
    834832  END IF
    835833
     
    23142312  USE radiation_ar4_param, ONLY: tref, rt1, raer, at, bt, oct
    23152313  USE infotrac_phy, ONLY: type_trac
    2316 #ifdef REPROBUS
    2317   USE chem_rep, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d
    2318 #endif
     2314  USE lmdz_reprobus_wrappers, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d
     2315  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS
    23192316
    23202317  IMPLICIT NONE
     
    26222619
    26232620        IF (type_trac=='repr') THEN
    2624 #ifdef REPROBUS
     2621IF (CPPKEY_REPROBUS) THEN
    26252622          IF (ok_rtime2d) THEN
    26262623            pabcu(jl, 19, jc) = pabcu(jl, 19, jcp1) + &
     
    26532650              zably(jl, 8, jc)*rcfc12/rco2*zdiff
    26542651          END IF
    2655 #endif
     2652END IF
    26562653        ELSE
    26572654          pabcu(jl, 19, jc) = pabcu(jl, 19, jcp1) + &
  • LMDZ6/trunk/libf/phylmd/radlwsw_m.F90

    r4976 r5252  
    5353    USE write_field_phy
    5454
    55 #ifdef REPROBUS
    56     USE CHEM_REP, ONLY : solaireTIME, ok_SUNTIME, ndimozon
    57 #endif
     55    USE lmdz_reprobus_wrappers, ONLY : solaireTIME, ok_SUNTIME, ndimozon
     56    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS
    5857
    5958#ifdef CPP_RRTM
     
    561560
    562561    IF (type_trac == 'repr') THEN
    563 #ifdef REPROBUS
     562IF (CPPKEY_REPROBUS) THEN
    564563       IF (iflag_rrtm==0) THEN
    565564          IF (ok_SUNTIME) PSCT = solaireTIME/zdist/zdist
    566565          print*,'Constante solaire: ',PSCT*zdist*zdist
    567566       ENDIF
    568 #endif
     567END IF
    569568    ENDIF
    570569
     
    645644
    646645       IF (type_trac == 'repr') THEN
    647 #ifdef REPROBUS
     646IF (CPPKEY_REPROBUS) THEN
    648647          ndimozon = size(wo, 3)
    649648          CALL RAD_INTERACTIF(POZON,iof)
    650 #endif
     649END IF
    651650       ENDIF
    652651       !
  • LMDZ6/trunk/libf/phylmd/rrtm/lwu.F90

    r4389 r5252  
    66 & PAER , PCCO2, PDP , PPMB, PQOF , PTAVE, PVIEW, PWV,&
    77 & PABCU &
    8  & ) 
     8 & )
    99
    1010!**** *LWU* - LONGWAVE EFFECTIVE ABSORBER AMOUNTS
     
    7171USE YOELW    , ONLY : NSIL     ,NUA      ,NG1      ,NG1P1    ,&
    7272 & ALWT     ,BLWT     ,RO3T     ,RT1      ,TREF     ,&
    73  & RVGCO2   ,RVGH2O   ,RVGO3 
     73 & RVGCO2   ,RVGH2O   ,RVGO3
    7474!USE YOERDI   , ONLY : RCH4     ,RN2O     ,RCFC11   ,RCFC12
    7575USE YOERDU   , ONLY : R10E     ,REPSCO   ,REPSCQ
    76 #ifdef REPROBUS
    77 USE chem_rep, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d
     76USE lmdz_reprobus_wrappers, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d
    7877USE infotrac_phy, ONLY : type_trac
    79 #endif
    80 
     78USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS
    8179
    8280IMPLICIT NONE
    8381
    84 INTEGER(KIND=JPIM),INTENT(IN)    :: KLON 
    85 INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV 
    86 INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA 
    87 INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA 
    88 REAL(KIND=JPRB)   ,INTENT(IN)    :: PAER(KLON,6,KLEV) 
    89 REAL(KIND=JPRB)   ,INTENT(IN)    :: PCCO2 
    90 REAL(KIND=JPRB)   ,INTENT(IN)    :: PDP(KLON,KLEV) 
    91 REAL(KIND=JPRB)   ,INTENT(IN)    :: PPMB(KLON,KLEV+1) 
    92 REAL(KIND=JPRB)   ,INTENT(IN)    :: PQOF(KLON,KLEV) 
    93 REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAVE(KLON,KLEV) 
    94 REAL(KIND=JPRB)   ,INTENT(IN)    :: PVIEW(KLON) 
    95 REAL(KIND=JPRB)   ,INTENT(IN)    :: PWV(KLON,KLEV) 
    96 REAL(KIND=JPRB)   ,INTENT(OUT)   :: PABCU(KLON,NUA,3*KLEV+1) 
     82INTEGER(KIND=JPIM),INTENT(IN)    :: KLON
     83INTEGER(KIND=JPIM),INTENT(IN)    :: KLEV
     84INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA
     85INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA
     86REAL(KIND=JPRB)   ,INTENT(IN)    :: PAER(KLON,6,KLEV)
     87REAL(KIND=JPRB)   ,INTENT(IN)    :: PCCO2
     88REAL(KIND=JPRB)   ,INTENT(IN)    :: PDP(KLON,KLEV)
     89REAL(KIND=JPRB)   ,INTENT(IN)    :: PPMB(KLON,KLEV+1)
     90REAL(KIND=JPRB)   ,INTENT(IN)    :: PQOF(KLON,KLEV)
     91REAL(KIND=JPRB)   ,INTENT(IN)    :: PTAVE(KLON,KLEV)
     92REAL(KIND=JPRB)   ,INTENT(IN)    :: PVIEW(KLON)
     93REAL(KIND=JPRB)   ,INTENT(IN)    :: PWV(KLON,KLEV)
     94REAL(KIND=JPRB)   ,INTENT(OUT)   :: PABCU(KLON,NUA,3*KLEV+1)
    9795
    9896#include "clesphys.h"
     
    107105REAL(KIND=JPRB) :: ZABLY(KLON,7,3*KLEV+1)  , ZDPM(KLON,3*KLEV)&
    108106 & ,  ZDUC(KLON, 3*KLEV+1)    , ZFACT(KLON)&
    109  & ,  ZUPM(KLON,3*KLEV) 
     107 & ,  ZUPM(KLON,3*KLEV)
    110108REAL(KIND=JPRB) :: ZPHIO(KLON),ZPSC2(KLON) , ZPSC3(KLON), ZPSH1(KLON)&
    111109 & ,  ZPSH2(KLON),ZPSH3(KLON) , ZPSH4(KLON), ZPSH5(KLON)&
    112110 & ,  ZPSH6(KLON),ZPSIO(KLON) , ZTCON(KLON)&
    113  & ,  ZPHM6(KLON),ZPSM6(KLON) , ZPHN6(KLON), ZPSN6(KLON) 
     111 & ,  ZPHM6(KLON),ZPSM6(KLON) , ZPHN6(KLON), ZPSN6(KLON)
    114112REAL(KIND=JPRB) :: ZSSIG(KLON,3*KLEV+1)    , ZTAVI(KLON)&
    115  & ,  ZUAER(KLON,NSIL)        , ZXOZ(KLON) , ZXWV(KLON) 
     113 & ,  ZUAER(KLON,NSIL)        , ZXOZ(KLON) , ZXWV(KLON)
    116114
    117115INTEGER(KIND=JPIM) :: IAE1, IAE2, IAE3, IC, ICP1, IG1, IJ, IJPN,&
    118116 & IKIP1, IKJ, IKJP, IKJPN, IKJR, IKL, JA, JAE, &
    119  & JK, JKI, JKK, JL 
     117 & JK, JKI, JKK, JL
    120118
    121119REAL(KIND=JPRB) :: ZALUP, ZCAC8, ZCAH1, ZCAH2, ZCAH3, ZCAH4,&
     
    123121 & ZCBH4, ZCBH5, ZCBH6, ZDIFF, ZDPMG, ZDPMP0, &
    124122 & ZFPPW, ZTX, ZTX2, ZU6, ZUP, ZUPMCO2, ZUPMG, &
    125  & ZUPMH2O, ZUPMO3, ZZABLY 
     123 & ZUPMH2O, ZUPMO3, ZZABLY
    126124REAL(KIND=JPRB) :: ZHOOK_HANDLE
    127125
     
    153151    DO JL = KIDIA,KFDIA
    154152      ZSSIG(JL,IKJ)= (ZSSIG(JL,IKJR) + ZSSIG(JL,IKJP)) * 0.5_JPRB &
    155        & + RT1(IG1) * (ZSSIG(JL,IKJP) - ZSSIG(JL,IKJR)) * 0.5_JPRB 
     153       & + RT1(IG1) * (ZSSIG(JL,IKJP) - ZSSIG(JL,IKJR)) * 0.5_JPRB
    156154    ENDDO
    157155  ENDDO
     
    237235       & +RAER(JAE,3)*PAER(JL,3,JK)+RAER(JAE,4)*PAER(JL,4,JK)&
    238236       & +RAER(JAE,5)*PAER(JL,5,JK)+RAER(JAE,6)*PAER(JL,6,JK))&
    239        & /(ZDUC(JL,IAE1)+ZDUC(JL,IAE2)+ZDUC(JL,IAE3)) 
     237       & /(ZDUC(JL,IAE1)+ZDUC(JL,IAE2)+ZDUC(JL,IAE3))
    240238    ENDDO
    241239  ENDDO
     
    297295    DO JL = KIDIA,KFDIA
    298296      ZDIFF = PVIEW(JL)
    299 !- H2O continuum     
     297!- H2O continuum
    300298      PABCU(JL,10,IC)=PABCU(JL,10,ICP1)+ ZABLY(JL,4,IC)          *ZDIFF
    301299      PABCU(JL,11,IC)=PABCU(JL,11,ICP1)+ ZABLY(JL,5,IC)*ZTCON(JL)*ZDIFF
    302 !- O3     
     300!- O3
    303301      PABCU(JL,12,IC)=PABCU(JL,12,ICP1)+ ZABLY(JL,6,IC)*ZPHIO(JL)*ZDIFF
    304302      PABCU(JL,13,IC)=PABCU(JL,13,ICP1)+ ZABLY(JL,7,IC)*ZPSIO(JL)*ZDIFF
     
    320318      PABCU(JL,17,IC)=PABCU(JL,17,ICP1)+ ZUAER(JL,4)    *ZDUC(JL,IC)*ZDIFF
    321319      PABCU(JL,18,IC)=PABCU(JL,18,ICP1)+ ZUAER(JL,5)    *ZDUC(JL,IC)*ZDIFF
    322 #ifdef REPROBUS
    323         IF (type_trac=='repr'.and. ok_rtime2d) THEN
     320        IF (CPPKEY_REPROBUS .AND. type_trac=='repr'.AND. ok_rtime2d) THEN
    324321!- CH4
    325322      PABCU(JL,19,IC)=PABCU(JL,19,ICP1)&
     
    340337
    341338         ELSE
    342 #endif
    343339!- CH4
    344340      PABCU(JL,19,IC)=PABCU(JL,19,ICP1)&
    345        & + ZABLY(JL,2,IC)*RCH4/PCCO2*ZPHM6(JL)*ZDIFF 
     341       & + ZABLY(JL,2,IC)*RCH4/PCCO2*ZPHM6(JL)*ZDIFF
    346342      PABCU(JL,20,IC)=PABCU(JL,20,ICP1)&
    347        & + ZABLY(JL,3,IC)*RCH4/PCCO2*ZPSM6(JL)*ZDIFF 
     343       & + ZABLY(JL,3,IC)*RCH4/PCCO2*ZPSM6(JL)*ZDIFF
    348344!- N2O
    349345      PABCU(JL,21,IC)=PABCU(JL,21,ICP1)&
    350        & + ZABLY(JL,2,IC)*RN2O/PCCO2*ZPHN6(JL)*ZDIFF 
     346       & + ZABLY(JL,2,IC)*RN2O/PCCO2*ZPHN6(JL)*ZDIFF
    351347      PABCU(JL,22,IC)=PABCU(JL,22,ICP1)&
    352        & + ZABLY(JL,3,IC)*RN2O/PCCO2*ZPSN6(JL)*ZDIFF 
     348       & + ZABLY(JL,3,IC)*RN2O/PCCO2*ZPSN6(JL)*ZDIFF
    353349!- CFC11
    354350      PABCU(JL,23,IC)=PABCU(JL,23,ICP1)&
    355        & + ZABLY(JL,2,IC)*RCFC11/PCCO2        *ZDIFF 
     351       & + ZABLY(JL,2,IC)*RCFC11/PCCO2        *ZDIFF
    356352!- CFC12
    357353      PABCU(JL,24,IC)=PABCU(JL,24,ICP1)&
    358        & + ZABLY(JL,2,IC)*RCFC12/PCCO2        *ZDIFF 
    359 #ifdef REPROBUS
     354       & + ZABLY(JL,2,IC)*RCFC12/PCCO2        *ZDIFF
    360355        END IF
    361 #endif
    362356    ENDDO
    363357  ENDDO
  • LMDZ6/trunk/libf/phylmd/tracreprobus_mod.F90

    r4636 r5252  
    1313    USE dimphy
    1414    USE infotrac_phy, ONLY: nbtr
    15 #ifdef REPROBUS
    16     USE CHEM_REP, ONLY : pdt_rep, &  ! pas de temps reprobus
     15    USE lmdz_reprobus_wrappers, ONLY : pdt_rep, &  ! pas de temps reprobus
    1716         daynum, iter, &             ! jourjulien, iteration chimie
    1817         pdel,&
    1918         d_q_rep,d_ql_rep,d_qi_rep
    20 #endif
     19    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS
    2120    IMPLICIT NONE
    2221
     
    4948    INTEGER :: it, k, niter
    5049
    51 #ifdef REPROBUS
     50IF (CPPKEY_REPROBUS) THEN
    5251    !   -- CHIMIE REPROBUS --
    5352!    pdt_rep=pdtphys/2.
     
    8786!       ENDDO
    8887       
    89 #ifdef REPROBUS
     88IF (CPPKEY_REPROBUS) THEN
    9089       CALL chemmain_rlong_1401( &
    9190            tr_seri, & !argument phytrac (change de nom apres: vmr)
     
    117116!       ENDDO
    118117
    119 #endif       
     118END IF
    120119       
    121120    END DO
    122 #endif
     121END IF
    123122  END SUBROUTINE tracreprobus
    124123
  • LMDZ6/trunk/libf/phylmd/tropopause_m.F90

    r3666 r5252  
    1717  USE geometry_mod, ONLY: latitude_deg, longitude_deg
    1818  USE vertical_layers_mod, ONLY: aps, bps, preff
    19 #ifdef REPROBUS
    20   USE chem_rep, ONLY: itroprep
    21 #endif
     19  USE lmdz_reprobus_wrappers, ONLY: itroprep
     20  USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS
    2221
    2322!-------------------------------------------------------------------------------
     
    111110      DO kt=1,klev-1; IF(pplay(i,kt+1)>dyn_tropopause(i)) EXIT; END DO; kp=kt
    112111    END IF
    113 #ifdef REPROBUS
     112IF (CPPKEY_REPROBUS) THEN
    114113    itroprep(i)=MAX(kt,kp)
    115 #endif
     114END IF
    116115    !--- LAST TROPOSPHERIC LAYER INDEX NEEDED
    117116    IF(PRESENT(itrop)) itrop(i)=MAX(kt,kp)
  • LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90

    r5251 r5252  
    112112    USE time_phylmdz_mod,  ONLY: ndays
    113113    USE infotrac_phy,      ONLY: nqCO2
    114 #ifdef REPROBUS
    115     USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
     114    USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
    116115                        ptrop, ttrop, ztrop, gravit, itroprep, Z1, Z2, fac, B
    117116    USE strataer_local_var_mod
    118117    USE strataer_emiss_mod, ONLY: strataer_emiss_init
    119 #endif
    120118    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
    121119    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
     
    128126
    129127
    130 #ifdef CPP_StratAer
    131128    USE phys_local_var_mod, ONLY: d_q_emiss
    132129    USE strataer_local_var_mod
    133130    USE strataer_nuc_mod, ONLY: strataer_nuc_init
    134131    USE strataer_emiss_mod, ONLY: strataer_emiss_init
    135 #endif
    136132
    137133    USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize
     
    437433       reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra
    438434       USE output_physiqex_mod, ONLY: output_physiqex
    439        USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
     435       USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS, CPPKEY_STRATAER
    440436
    441437
     
    15151511          CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz)
    15161512
    1517 #ifdef REPROBUS
    1518        CALL strataer_init
    1519        CALL strataer_emiss_init
    1520 #endif
    1521 
    1522 #ifdef CPP_StratAer
    1523        CALL strataer_init
    1524        CALL strataer_nuc_init
    1525        CALL strataer_emiss_init
    1526 #endif
     1513       IF (CPPKEY_STRATAER .OR. CPPKEY_REPROBUS) THEN
     1514#ifdef ISO
     1515CALL abort_gcm("physiq_mod", "StratAer isn't ISO-compatible for now, 07/24",1)
     1516#else
     1517         CALL strataer_init
     1518         CALL strataer_emiss_init
     1519         IF (CPPKEY_STRATAER) THEN
     1520           CALL strataer_nuc_init
     1521         END IF
     1522#endif
     1523       END IF
    15271524
    15281525       print*, '================================================='
     
    24172414       !
    24182415       IF (type_trac == 'repr') THEN
    2419 #ifdef REPROBUS
     2416IF (CPPKEY_REPROBUS) THEN
    24202417          CALL chemini_rep(  &
    24212418               presnivs, &
     
    24282425               io_lon, &
    24292426               io_lat)
    2430 #endif
     2427END IF
    24312428       ENDIF
    24322429
     
    25362533    ! Update time and other variables in Reprobus
    25372534    IF (type_trac == 'repr') THEN
    2538 #ifdef REPROBUS
     2535IF (CPPKEY_REPROBUS) THEN
    25392536       CALL Init_chem_rep_xjour(jD_cur-jD_ref+day_ref)
    25402537       print*,'xjour equivalent rjourvrai',jD_cur-jD_ref+day_ref
    25412538       CALL Rtime(debut)
    2542 #endif
     2539END IF
    25432540    ENDIF
    25442541
     
    29852982
    29862983          wo(:,:,1)=ozonecm(latitude_deg, paprs,read_climoz,rjour=zzz)
    2987 #ifdef REPROBUS
     2984IF (CPPKEY_REPROBUS) THEN
    29882985          ptrop=dyn_tropopause(t_seri, ztsol, paprs, pplay, rot)/100.
    29892986          DO i = 1, klon
     
    29932990             B=Z2-fac*alog(pplay(i,itroprep(i)))
    29942991             ttrop(i)= fac*alog(ptrop(i))+B
    2995 !       
     2992!
    29962993             Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit
    29972994             Z2= 1.e-3 * ( pphi(i,itroprep(i))  +pphis(i) ) / gravit
     
    30002997             ztrop(i)=fac*alog(ptrop(i))+B
    30012998          ENDDO
    3002 #endif
     2999END IF
    30033000       ELSE
    30043001          !--- ro3i = elapsed days number since current year 1st january, 0h
     
    56865683    ENDIF !type_trac = inca or inco
    56875684    IF (type_trac == 'repr') THEN
    5688 #ifdef REPROBUS
     5685IF (CPPKEY_REPROBUS) THEN
    56895686    !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap)
    5690     CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap) 
    5691 #endif
     5687    CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap)
     5688END IF
    56925689    ENDIF
    56935690
     
    58245821          ELSE
    58255822#ifdef CPP_RRTM
    5826 #ifndef CPP_StratAer
    5827           !--prescribed strat aerosols 
     5823IF (.NOT. CPPKEY_STRATAER) THEN
     5824          !--prescribed strat aerosols
    58285825          !--only in the case of non-interactive strat aerosols
    58295826            IF (flag_aerosol_strat.EQ.1) THEN
     
    58355832             CALL abort_physic(modname,abort_message,1)
    58365833            ENDIF
    5837 #endif
     5834END IF
    58385835#else
    58395836             abort_message='You should compile with -rrtm if running ' &
     
    58475844!
    58485845#ifdef CPP_RRTM
    5849 #ifdef CPP_StratAer
     5846IF (CPPKEY_STRATAER) THEN
     5847#ifdef ISO
     5848CALL abort_gcm("physiq_mod", "StratAer isn't ISO-compatible for now, 07/24",1)
     5849#else
    58505850       !--compute stratospheric mask
    58515851       CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
     
    58535853       CALL calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
    58545854#endif
     5855END IF
    58555856#endif
    58565857       !--fin STRAT AEROSOL
     
    64946495    IF (ok_qch4) THEN
    64956496!      d_q_ch4: H2O source from CH4 in MMR/s (mass mixing ratio/s or kg H2O/kg air/s)
    6496 #ifdef CPP_StratAer
     6497    IF (CPPKEY_STRATAER) THEN
     6498#ifdef ISO
     6499CALL abort_gcm("physiq_mod", "StratAer isn't ISO-compatible for now, 07/24",1)
     6500#else
    64976501       CALL stratH2O_methox(debut,paprs,d_q_ch4)
    6498 #else
     6502#endif
     6503    ELSE
    64996504!      ECMWF routine METHOX
    65006505       CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay)
    6501 #endif
     6506    END IF
    65026507       ! add humidity tendency due to methane
    65036508       d_q_ch4_dtime(:,:) = d_q_ch4(:,:)*phys_tstep
     
    65186523    !
    65196524    !
    6520 #ifdef CPP_StratAer
     6525IF (CPPKEY_STRATAER) THEN
     6526#ifdef ISO
     6527CALL abort_gcm("physiq_mod", "StratAer isn't ISO-compatible for now, 07/24",1)
     6528#else
    65216529    IF (ok_qemiss) THEN
    65226530       flh2o=1
     
    65266534          print *,'IN physiq_mod: nAerErupt=',nAerErupt
    65276535       ENDIF
    6528        
     6536
    65296537       SELECT CASE(flag_emit)
    65306538       CASE(1) ! emission volc H2O in LMDZ
     
    65346542                  day_cur>=day_emit_vol(ieru).AND.&
    65356543                  day_cur<(day_emit_vol(ieru)+injdur)) THEN
    6536                
     6544
    65376545                IF(flag_verbose_strataer) print *,'IN physiq_mod: date=',year_cur,mth_cur,day_cur
    65386546                ! initialisation of q tendency emission
     
    65496557                    altemiss_vol(ieru),sigma_alt_vol(ieru),1,1.,&
    65506558                    nAerErupt+1,0)
    6551                
     6559
    65526560                IF(flag_verbose_strataer) print *,'IN physiq_mod: min max d_q_emiss=',&
    65536561                     minval(d_q_emiss),maxval(d_q_emiss)
    6554                
     6562
    65556563                CALL add_phys_tend(du0, dv0, dt0, d_q_emiss, dql0, dqi0, dqbs0, paprs, &
    65566564                     'q_emiss',abortphy,flag_inhib_tend,itap,0)
     
    65626570    ENDIF
    65636571#endif
     6572END IF
    65646573
    65656574!===============================================================
     
    68796888!MM                               dans Reprobus
    68806889       sh_in(:,:) = q_seri(:,:)
    6881 #ifdef REPROBUS
     6890IF (CPPKEY_REPROBUS) THEN
    68826891       d_q_rep(:,:) = 0.
    68836892       d_ql_rep(:,:) = 0.
    68846893       d_qi_rep(:,:) = 0.
    6885 #endif
     6894END IF
    68866895    ELSE
    68876896       sh_in(:,:) = qx(:,:,ivap)
     
    69366945         d_tr_dyn, &                                 !<<RomP
    69376946         tr_seri, init_source)
    6938 #ifdef REPROBUS
    6939 
     6947IF (CPPKEY_REPROBUS) THEN
     6948#ifdef ISO
     6949        CALL abort_gcm("physiq_mod", "StratAer isn't ISO-compatible for now, 07/24",1)
     6950#else
    69406951
    69416952          print*,'avt add phys rep',abortphy
     
    69476958
    69486959          print*,'apr add phys rep',abortphy
    6949 
    6950 #endif
     6960#endif
     6961END IF
    69516962    ENDIF    ! (iflag_phytrac=1)
    69526963
     
    70217032    ENDDO
    70227033
    7023 #ifdef CPP_StratAer
     7034IF (CPPKEY_STRATAER) THEN
     7035#ifdef ISO
     7036CALL abort_gcm("physiq_mod", "StratAer isn't ISO-compatible for now, 07/24",1)
     7037#else
    70247038    IF (ok_qemiss) THEN
    70257039       DO k = 1, klev
     
    70287042    ENDIF
    70297043#endif
     7044END IF
    70307045    IF (ok_qch4) THEN
    70317046       DO k = 1, klev
     
    71287143
    71297144    IF (type_trac == 'repr') THEN
    7130 #ifdef REPROBUS
     7145IF (CPPKEY_REPROBUS) THEN
    71317146        CALL coord_hyb_rep(paprs, pplay, aps, bps, ap, bp, cell_area)
    7132 #endif
     7147END IF
    71337148    ENDIF
    71347149
  • LMDZ6/trunk/makelmdz

    r5048 r5252  
    506506fi
    507507
    508 if [[ "$strataer" == "true" ]]
    509 then
     508src_dirs="$src_dirs phy${physique}/StratAer"
     509if [[ "$strataer" == "true" ]]; then
    510510   CPP_KEY="$CPP_KEY CPP_StratAer"
    511    src_dirs="$src_dirs phy${physique}/StratAer"
    512511fi
    513512
  • LMDZ6/trunk/makelmdz_fcm

    r5048 r5252  
    494494fi
    495495
    496 if [[ "$strataer" == "true" ]]
    497 then
     496STRATAER_PATH="$LIBFGCM/phy${physique}/StratAer"
     497if [[ "$strataer" == "true" ]]; then
    498498   CPP_KEY="$CPP_KEY CPP_StratAer"
    499    STRATAER_PATH="$LIBFGCM/phy${physique}/StratAer"
    500499fi
    501500
Note: See TracChangeset for help on using the changeset viewer.