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

Wrap uses of cpp key REPROBUS and CPP_STRATAER
Add REPROBUS wrapper

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.