Ignore:
Timestamp:
Jun 15, 2021, 1:18:14 PM (3 years ago)
Author:
crisi
Message:

replace files by symbloic liks from phylmdiso towards phylmd.
Many files at once

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90

    r3927 r3940  
    11!
    2 ! $Id: physiq_mod.F90 3666 2020-04-20 10:13:34Z lfalletti $
     2! $Id: physiq_mod.F90 3908 2021-05-20 07:11:13Z idelkadi $
    33!
    44!#define IO_DEBUG
     
    1616       d_u, d_v, d_t, d_qx, d_ps)
    1717
     18! For clarity, the "USE" section is now arranged in alphabetical order,
     19! with a separate section for CPP keys
     20! PLEASE try to follow this rule
     21
     22    USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando
     23    USE aero_mod
     24    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
     25  &      fl_ebil, fl_cor_ebil
    1826    USE assert_m, only: assert
     27    USE change_srf_frac_mod
     28    USE conf_phys_m, only: conf_phys
     29    USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad
     30    USE CFMIP_point_locations   ! IM stations CFMIP
     31    USE cmp_seri_mod
     32    USE dimphy
     33    USE etat0_limit_unstruct_mod
     34    USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando
     35    USE fonte_neige_mod, ONLY  : fonte_neige_get_vars
     36    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
    1937    USE ioipsl, only: histbeg, histvert, histdef, histend, histsync, &
    2038         histwrite, ju2ymds, ymds2ju, getin
    21     USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
     39    USE ioipsl_getin_p_mod, ONLY : getin_p
     40    USE indice_sol_mod
     41    USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac,ok_isotopes, &
     42        nqtottr,itr_indice ! C Risi
     43
     44    USE iophy
     45    USE limit_read_mod, ONLY : init_limit_read
     46    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured
     47    USE mod_phys_lmdz_mpi_data, only: is_mpi_root
     48    USE mod_phys_lmdz_para
     49    USE netcdf95, only: nf95_close
     50    USE netcdf, only: nf90_fill_real     ! IM for NMC files
     51    USE open_climoz_m, only: open_climoz ! ozone climatology from a file
     52    USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
     53    USE pbl_surface_mod, ONLY : pbl_surface
     54    USE phyaqua_mod, only: zenang_an
     55    USE phystokenc_mod, ONLY: offline, phystokenc
    2256    USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, &
    2357         year_cur, mth_cur,jD_cur, jH_cur, jD_ref, day_cur, hour
     58!!  USE phys_local_var_mod, ONLY : a long list of variables
     59!!              ==> see below, after "CPP Keys" section
     60    USE phys_state_var_mod ! Variables sauvegardees de la physique
     61    USE phys_output_mod
     62    USE phys_output_ctrlout_mod
     63    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
     64    USE readaerosol_mod, ONLY : init_aero_fromfile
     65    USE readaerosolstrato_m, ONLY : init_readaerosolstrato
     66    USE radlwsw_m, only: radlwsw
     67    USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz
     68    USE regr_pr_time_av_m, only: regr_pr_time_av
     69    USE surface_data,     ONLY : type_ocean, ok_veget, landice_opt
     70    USE time_phylmdz_mod, only: annee_ref, current_time, day_ini, day_ref, &
     71          day_step_phy, itau_phy, pdtphys, raz_date, start_time, update_time
     72    USE tracinca_mod, ONLY: config_inca
     73    USE tropopause_m,     ONLY: dyn_tropopause
     74    USE vampir
     75    USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp
    2476    USE write_field_phy
    25     USE dimphy
    26 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac,ok_isotopes, &
    27         nqtottr,itr_indice ! C Risi
     77
     78    !USE cmp_seri_mod
     79!    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
     80!  &      fl_ebil, fl_cor_ebil
     81
     82!!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
     83!
     84!
     85#ifdef CPP_Dust
     86    USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
     87    USE phys_output_write_spl_mod
     88#else
     89    USE phytrac_mod, ONLY : phytrac_init, phytrac
     90    USE phys_output_write_mod
     91#endif
     92
     93
     94#ifdef REPROBUS
     95    USE CHEM_REP, ONLY : Init_chem_rep_xjour, &
     96         d_q_rep,d_ql_rep,d_qi_rep,ptrop,ttrop, &
     97         ztrop, gravit,itroprep, Z1,Z2,fac,B
     98#endif
     99
     100
     101#ifdef CPP_RRTM
     102    USE YOERAD, ONLY : NRADLP
     103    USE YOESW, ONLY : RSUN
     104#endif
     105
     106
     107#ifdef CPP_StratAer
     108    USE strataer_mod, ONLY: strataer_init
     109#endif
     110
     111
     112#ifdef CPP_XIOS
     113    USE xios, ONLY: xios_update_calendar, xios_context_finalize, &
     114            xios_get_field_attr, xios_field_is_active
     115    USE wxios, ONLY: missing_val, missing_val_omp
     116#endif
     117#ifndef CPP_XIOS
     118    USE paramLMDZ_phy_mod
     119#endif
     120
     121
    28122#ifdef ISO
    29123    USE infotrac_phy, ONLY:  &
     
    64158#endif
    65159#endif
    66     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured
    67     USE mod_phys_lmdz_para
    68     USE iophy
    69     USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
    70     USE phystokenc_mod, ONLY: offline, phystokenc
    71     USE time_phylmdz_mod, only: raz_date, day_step_phy, update_time,current_time
    72     USE vampir
    73     USE pbl_surface_mod, ONLY : pbl_surface
    74     USE change_srf_frac_mod
    75     USE surface_data,     ONLY : type_ocean, ok_veget, ok_snow
    76     USE tropopause_m,     ONLY: dyn_tropopause
    77 #ifdef CPP_Dust
    78     USE phytracr_spl_mod, ONLY: phytracr_spl
    79 #endif
    80 #ifdef CPP_StratAer
    81     USE strataer_mod, ONLY: strataer_init
    82 #endif
    83     USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, &
     160
     161!
     162!
     163!!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!!
     164
     165USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, &
    84166       ! [Variables internes non sauvegardees de la physique]
    85167       ! Variables locales pour effectuer les appels en serie
     
    160242       cdragm, cdragh,                   &
    161243       zustar, zu10m, zv10m, rh2m, qsat2m, &
    162        zq2m, zt2m, weak_inversion, &
    163        zq2m_cor,zt2m_cor,zu10m_cor,zv10m_cor, & ! pour corriger d'un bug
    164        zrh2m_cor,zqsat2m_cor, &
     244       zq2m, zt2m, zn2mout, weak_inversion, &
    165245       zt2m_min_mon, zt2m_max_mon,   &         ! pour calcul_divers.h
    166246       t2m_min_mon, t2m_max_mon,  &            ! pour calcul_divers.h
     
    175255       zxrunofflic,                            &
    176256       zxtsol, snow_lsc, zxfqfonte, zxqsurf,   &
     257       delta_qsurf,                            &
    177258       rain_lsc, rain_num,                     &
    178259       !
     
    236317       ref_liq, ref_ice, theta,  &
    237318       ref_liq_pi, ref_ice_pi,  &
    238        zphi, zx_rh, &
     319       zphi, zx_rh, zx_rhl, zx_rhi, &
    239320       pmfd, pmfu,  &
    240321       !
     
    284365#endif
    285366       !
    286     USE phys_state_var_mod ! Variables sauvegardees de la physique
    287 #ifdef CPP_Dust
    288     USE phys_output_write_spl_mod
    289 #else
    290     USE phys_output_var_mod ! Variables pour les ecritures des sorties
    291 #endif
    292 
    293     USE phys_output_write_mod
    294     USE fonte_neige_mod, ONLY  : fonte_neige_get_vars
    295     USE phys_output_mod
    296     USE phys_output_ctrlout_mod
    297     USE open_climoz_m, only: open_climoz ! ozone climatology from a file
    298     USE regr_pr_time_av_m, only: regr_pr_time_av
    299     USE netcdf95, only: nf95_close
    300     !IM for NMC files
    301     USE netcdf, only: nf90_fill_real
    302     USE mod_phys_lmdz_mpi_data, only: is_mpi_root
    303     USE aero_mod
    304     USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
    305     USE conf_phys_m, only: conf_phys
    306     USE radlwsw_m, only: radlwsw
    307     USE phyaqua_mod, only: zenang_an
    308     USE time_phylmdz_mod, only: day_step_phy, annee_ref, day_ref, itau_phy, &
    309          start_time, pdtphys, day_ini
    310     USE tracinca_mod, ONLY: config_inca
    311 #ifdef CPP_XIOS
    312     USE wxios, ONLY: missing_val, missing_val_omp
    313     USE xios, ONLY: xios_get_field_attr, xios_field_is_active
    314 #endif
    315 #ifdef REPROBUS
    316     USE CHEM_REP, ONLY : Init_chem_rep_xjour, &
    317          d_q_rep,d_ql_rep,d_qi_rep,ptrop,ttrop, &
    318          ztrop, gravit,itroprep, Z1,Z2,fac,B
    319 #endif
    320     USE indice_sol_mod
    321     USE phytrac_mod, ONLY : phytrac_init, phytrac
    322     USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad
    323 
    324 #ifdef CPP_RRTM
    325     USE YOERAD, ONLY : NRADLP
    326     USE YOESW, ONLY : RSUN
    327 #endif
    328     USE ioipsl_getin_p_mod, ONLY : getin_p
    329 
    330 #ifndef CPP_XIOS
    331     USE paramLMDZ_phy_mod
    332 #endif
    333 
    334     USE cmp_seri_mod
    335     USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
    336   &      fl_ebil, fl_cor_ebil
    337 
    338     !IM stations CFMIP
    339     USE CFMIP_point_locations
    340     USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando
    341     USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando
    342     USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp
    343     USE etat0_limit_unstruct_mod
    344 #ifdef CPP_XIOS
    345     USE xios, ONLY: xios_update_calendar, xios_context_finalize
    346 #endif
    347     USE limit_read_mod, ONLY : init_limit_read
    348     USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz
    349     USE readaerosol_mod, ONLY : init_aero_fromfile
    350     USE readaerosolstrato_m, ONLY : init_readaerosolstrato
     367
    351368
    352369    IMPLICIT NONE
     
    671688    !$OMP THREADPRIVATE(iflag_alp_wk_cond)
    672689
    673     INTEGER,  SAVE               :: iflag_bug_t2m_ipslcm61=1 !
    674     !$OMP THREADPRIVATE(iflag_bug_t2m_ipslcm61)
    675     INTEGER,  SAVE               :: iflag_bug_t2m_stab_ipslcm61=-1 !
    676     !$OMP THREADPRIVATE(iflag_bug_t2m_stab_ipslcm61)
    677 
    678690    REAL t_w(klon,klev),q_w(klon,klev) ! temperature and moisture profiles in the wake region
    679691    REAL t_x(klon,klev),q_x(klon,klev) ! temperature and moisture profiles in the off-wake region
     
    14191431       WRITE(lunout,*) 'debut physiq_mod tau_gl=',tau_gl
    14201432
    1421        iflag_bug_t2m_ipslcm61 = 1
    1422        CALL getin_p('iflag_bug_t2m_ipslcm61', iflag_bug_t2m_ipslcm61)
    1423        iflag_bug_t2m_stab_ipslcm61 = -1
    1424        CALL getin_p('iflag_bug_t2m_stab_ipslcm61', iflag_bug_t2m_stab_ipslcm61)
    1425 
    14261433       CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond)
    14271434       CALL getin_p('random_notrig_max',random_notrig_max)
     
    14511458       iflag_phytrac = 1 ! by default we do want to call phytrac
    14521459       CALL getin_p('iflag_phytrac',iflag_phytrac)
     1460#ifdef CPP_Dust
     1461       IF (iflag_phytrac.EQ.0) THEN
     1462         WRITE(lunout,*) 'In order to run with SPLA, iflag_phytrac will be forced to 1'
     1463         iflag_phytrac = 1
     1464       ENDIF
     1465#endif
    14531466       nvm_lmdz = 13
    14541467       CALL getin_p('NVM',nvm_lmdz)
     
    15081521       tau_overturning_th(:)=0.
    15091522
    1510        IF (type_trac == 'inca') THEN
     1523       IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
    15111524          ! jg : initialisation jusqu'au ces variables sont dans restart
    15121525          ccm(:,:,:) = 0.
     
    17631776#ifdef CPP_COSP
    17641777      IF (ok_cosp) THEN
    1765            DO k = 1, klev
    1766              DO i = 1, klon
    1767                phicosp(i,k) = pphi(i,k) + pphis(i)
    1768              ENDDO
    1769            ENDDO
     1778!           DO k = 1, klev
     1779!             DO i = 1, klon
     1780!               phicosp(i,k) = pphi(i,k) + pphis(i)
     1781!             ENDDO
     1782!           ENDDO
    17701783        CALL phys_cosp(itap,phys_tstep,freq_cosp, &
    17711784               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
     
    17851798#ifdef CPP_COSP2
    17861799        IF (ok_cosp) THEN
    1787            DO k = 1, klev
    1788              DO i = 1, klon
    1789                phicosp(i,k) = pphi(i,k) + pphis(i)
    1790              ENDDO
    1791            ENDDO
     1800!           DO k = 1, klev
     1801!             DO i = 1, klon
     1802!               phicosp(i,k) = pphi(i,k) + pphis(i)
     1803!             ENDDO
     1804!           ENDDO
    17921805          CALL phys_cosp2(itap,phys_tstep,freq_cosp, &
    17931806               ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
     
    18351848
    18361849       CALL iniradia(klon,klev,paprs(1,1:klev+1))
    1837        ! Initialisation des champs dans phytrac qui sont utilisés par phys_output_write
     1850
     1851       ! Initialisation des champs dans phytrac* qui sont utilisés par phys_output_write*
     1852#ifdef CPP_Dust
     1853       ! Quand on utilise SPLA, on force iflag_phytrac=1
     1854       CALL phytracr_spl_out_init()
     1855       CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,                  &
     1856                                pplay, lmax_th, aerosol_couple,                 &
     1857                                ok_ade, ok_aie, ivap, ok_sync,                  &
     1858                                ptconv, read_climoz, clevSTD,                   &
     1859                                ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
     1860                                flag_aerosol, flag_aerosol_strat, ok_cdnc)
     1861#else
     1862       ! phys_output_write écrit des variables traceurs seulement si iflag_phytrac == 1
     1863       ! donc seulement dans ce cas on doit appeler phytrac_init()
    18381864       IF (iflag_phytrac == 1 ) THEN
    18391865          CALL phytrac_init()
    1840         ENDIF
    1841 
     1866       ENDIF
    18421867       CALL phys_output_write(itap, pdtphys, paprs, pphis,                    &
    18431868                              pplay, lmax_th, aerosol_couple,                 &
     
    18461871                              ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
    18471872                              flag_aerosol, flag_aerosol_strat, ok_cdnc)
     1873#endif
     1874
    18481875
    18491876#ifdef CPP_XIOS
     
    20702097       !c         ENDDO
    20712098       !
    2072        IF (type_trac == 'inca') THEN
     2099       IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN                   ! ModThL
    20732100#ifdef INCA
    20742101          CALL VTe(VTphysiq)
     
    20872114               klon, &
    20882115               nqtot, &
    2089                nqo, &
     2116               nqo+nqCO2, &
    20902117               pdtphys, &
    20912118               annee_ref, &
     
    28402867    !   s_therm,   s_trmb1,   s_trmb2, s_trmb3,
    28412868    !   zu10m,     zv10m,   fder,
    2842     !   zxqsurf,   rh2m,      zxfluxu, zxfluxv,
     2869    !   zxqsurf,   delta_qsurf,
     2870    !   rh2m,      zxfluxu, zxfluxv,
    28432871    !   frugs,     agesno,    fsollw,  fsolsw,
    28442872    !   d_ts,      fevap,     fluxlat, t2m,
     
    28902918            debut,     lafin, &
    28912919            longitude_deg, latitude_deg, rugoro,  zrmu0,      &
    2892             zsig,      sollwdown, pphi,    cldt,      &
    2893             rain_fall, snow_fall, solsw,   sollw,     &
     2920            sollwdown,    cldt,      &
     2921            rain_fall, snow_fall, solsw,   solswfdiff, sollw,     &
    28942922            gustiness,                                &
    28952923            t_seri,    q_seri,    u_seri,  v_seri,    &
     
    29012929                                !albedo SB <<<
    29022930            cdragh,    cdragm,  u1,    v1,            &
     2931            beta_aridity, &
    29032932                                !albedo SB >>>
    29042933                                ! albsol1,   albsol2,   sens,    evap,      &
     
    29062935                                !albedo SB <<<
    29072936            albsol3_lic,runoff,   snowhgt,   qsnow, to_ice, sissnow, &
    2908             zxtsol,    zxfluxlat, zt2m,    qsat2m,  &
     2937            zxtsol,    zxfluxlat, zt2m,    qsat2m,  zn2mout, &
    29092938            d_t_vdf,   d_q_vdf,   d_u_vdf, d_v_vdf, d_t_diss, &
    29102939                                !nrlmd<
     
    29272956            s_therm,   s_trmb1,   s_trmb2, s_trmb3, &
    29282957            zustar, zu10m,     zv10m,   fder, &
    2929             zxqsurf,   rh2m,      zxfluxu, zxfluxv, &
     2958            zxqsurf, delta_qsurf,   rh2m,      zxfluxu, zxfluxv, &
    29302959            z0m, z0h,     agesno,    fsollw,  fsolsw, &
    29312960            d_ts,      fevap,     fluxlat, t2m, &
     
    30413070#endif
    30423071       ENDIF
    3043 
    3044 !add limitation for t,q at and wind at 10m
    3045         if ( iflag_bug_t2m_ipslcm61 == 0 ) THEN
    3046           CALL borne_var_surf( klon,klev,nbsrf,                 &
    3047             iflag_bug_t2m_stab_ipslcm61,                        &
    3048             t_seri(:,1),q_seri(:,1),u_seri(:,1),v_seri(:,1),    &
    3049             ftsol,zxqsurf,pctsrf,paprs,                         &
    3050             t2m, q2m, u10m, v10m,                               &
    3051             zt2m_cor, zq2m_cor, zu10m_cor, zv10m_cor,           &
    3052             zrh2m_cor, zqsat2m_cor)
    3053         ELSE
    3054           zt2m_cor(:)=zt2m(:)
    3055           zq2m_cor(:)=zq2m(:)
    3056           zu10m_cor(:)=zu10m(:)
    3057           zv10m_cor(:)=zv10m(:)
    3058           zqsat2m_cor=999.999
    3059         ENDIF
    30603072
    30613073       !---------------------------------------------------------------------
     
    39773989             ENDDO
    39783990          ENDIF
    3979        
     3991         
    39803992#ifdef ISOVERIF
    39813993        write(*,*) 'physiq 3977: verif des inputs de calwake'
     
    43124324          !
    43134325          ENDIF  ! (mod(iflag_pbl_split/10,10) .GE. 1)
    4314 
    43154326          !
    43164327          CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,  &
     
    44564467         iflag_ratqs,iflag_con,iflag_cld_th,pdtphys,  &
    44574468         ratqsbas,ratqshaut,ratqsp0, ratqsdp, &
    4458          tau_ratqs,fact_cldcon,   &
     4469         tau_ratqs,fact_cldcon,wake_s, wake_deltaq,   &
    44594470         ptconv,ptconvth,clwcon0th, rnebcon0th,     &
    44604471         paprs,pplay,q_seri,zqsat,fm_therm, &
    4461          ratqs,ratqsc)
    4462 
     4472         ratqs,ratqsc,ratqs_inter)
    44634473
    44644474    !
     
    50135023          ENDIF
    50145024          zx_rh(i,k) = q_seri(i,k)/zx_qs
     5025            IF (iflag_ice_thermo .GT. 0) THEN
     5026          zx_rhl(i,k) = q_seri(i,k)/(qsatl(zx_t)/pplay(i,k))
     5027          zx_rhi(i,k) = q_seri(i,k)/(qsats(zx_t)/pplay(i,k))
     5028            ENDIF
    50155029          zqsat(i,k)=zx_qs
    50165030       ENDDO
     
    50395053    ENDDO
    50405054
    5041     IF (type_trac == 'inca') THEN
     5055    IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN      ! ModThL
    50425056#ifdef INCA
    50435057       CALL VTe(VTphysiq)
     
    50825096            nbp_lon, &
    50835097            nbp_lat-1, &
    5084             tr_seri, &
     5098            tr_seri(:,:,1+nqCO2:nbtr), &
    50855099            ftsol, &
    50865100            paprs, &
     
    50935107       CALL VTe(VTinca)
    50945108       CALL VTb(VTphysiq)
    5095 #endif 
    5096     ENDIF !type_trac = inca
     5109#endif
     5110    ENDIF !type_trac = inca or inco
    50975111    IF (type_trac == 'repr') THEN
    50985112#ifdef REPROBUS
     
    52655279
    52665280       IF (ok_newmicro) then
    5267           IF (iflag_rrtm.NE.0) THEN
     5281! AI          IF (iflag_rrtm.NE.0) THEN
     5282          IF (iflag_rrtm.EQ.1) THEN
    52685283#ifdef CPP_RRTM
    52695284             IF (ok_cdnc.AND.NRADLP.NE.3) THEN
     
    54525467               heat,heat0,cool,cool0,albpla, &
    54535468               heat_volc,cool_volc, &
    5454                topsw,toplw,solsw,sollw, &
     5469               topsw,toplw,solsw,solswfdiff,sollw, &
    54555470               sollwdown, &
    54565471               topsw0,toplw0,solsw0,sollw0, &
     
    55395554                     heatp,heat0p,coolp,cool0p,albplap, &
    55405555                     heat_volc,cool_volc, &
    5541                      topswp,toplwp,solswp,sollwp, &
     5556                     topswp,toplwp,solswp,solswfdiffp,sollwp, &
    55425557                     sollwdownp, &
    55435558                     topsw0p,toplw0p,solsw0p,sollw0p, &
     
    59765991
    59775992    CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pctsrf,pbl_tke)
    5978 
     5993   !
     5994   ! Prevent pbl_tke_w from becoming negative
     5995    wake_delta_pbl_tke(:,:,:) = max(wake_delta_pbl_tke(:,:,:), -pbl_tke(:,:,:))
     5996   !
    59795997
    59805998       ENDIF
     
    60906108#ifdef CPP_COSPV2
    60916109       IF (itap.eq.1.or.MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN
     6110!        IF (MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN
    60926111
    60936112          IF (prt_level .GE.10) THEN
    60946113             print*,'freq_cosp',freq_cosp
    60956114          ENDIF
     6115           DO k = 1, klev
     6116             DO i = 1, klon
     6117               phicosp(i,k) = pphi(i,k) + pphis(i)
     6118             ENDDO
     6119           ENDDO
    60966120          mr_ozone=wo(:, :, 1) * dobson_u * 1e3 / zmasse
    60976121                 print*,'Dans physiq.F avant appel '
     
    61946218    ELSE
    61956219       sh_in(:,:) = qx(:,:,ivap)
    6196        ch_in(:,:) = qx(:,:,iliq)
     6220       IF (nqo .EQ. 3) THEN
     6221          ch_in(:,:) = qx(:,:,iliq) + qx(:,:,isol)
     6222       ELSE
     6223          ch_in(:,:) = qx(:,:,iliq)
     6224       ENDIF
    61976225    ENDIF
    61986226
    6199     IF (iflag_phytrac == 1 ) THEN
    6200 
    62016227#ifdef CPP_Dust
    6202       CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I
     6228    !  Avec SPLA, iflag_phytrac est forcé =1
     6229    CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I
    62036230                      pdtphys,ftsol,                                   &  ! I
    62046231                      t,q_seri,paprs,pplay,RHcl,                  &  ! I
     
    62166243
    62176244#else
    6218 
    6219     CALL phytrac ( &
     6245    IF (iflag_phytrac == 1 ) THEN
     6246      CALL phytrac ( &
    62206247         itap,     days_elapsed+1,    jH_cur,   debut, &
    62216248         lafin,    phys_tstep,     u, v,     t, &
     
    62546281
    62556282#endif
    6256 
    6257 #endif
    62586283    ENDIF    ! (iflag_phytrac=1)
     6284
     6285#endif
     6286    !ENDIF    ! (iflag_phytrac=1)
    62596287
    62606288    IF (offline) THEN
     
    63456373#endif
    63466374    !
    6347     IF (type_trac == 'inca') THEN
     6375    IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
    63486376#ifdef INCA
    63496377       CALL VTe(VTphysiq)
     
    63546382            pplay, &
    63556383            t_seri, &
    6356             tr_seri, &
     6384            tr_seri(:,:,1+nqCO2:nbtr), &
    63576385            nbtr, &
    63586386            paprs, &
     
    66206648  CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,  &
    66216649       pplay, lmax_th, aerosol_couple,                 &
    6622        ok_ade, ok_aie, ivap, ok_sync,         &
     6650       ok_ade, ok_aie, ivap, ok_sync,                  &
    66236651       ptconv, read_climoz, clevSTD,                   &
    66246652       ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
     
    66396667#endif
    66406668
    6641 ! On remet des variables a .false. apres un premier appel
     6669! Pour XIOS : On remet des variables a .false. apres un premier appel
    66426670    IF (debut) THEN
    66436671#ifdef CPP_XIOS
Note: See TracChangeset for help on using the changeset viewer.