Changeset 3776 for LMDZ6


Ignore:
Timestamp:
Oct 19, 2020, 1:24:19 PM (4 years ago)
Author:
asima
Message:

Preparing physiq_mod.def for LMDZ-SPLA update.
Also, section "USE" re-arranged in alphabetical order.

File:
1 edited

Legend:

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

    r3756 r3776  
    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
     42    USE iophy
     43    USE limit_read_mod, ONLY : init_limit_read
     44    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured
     45    USE mod_phys_lmdz_mpi_data, only: is_mpi_root
     46    USE mod_phys_lmdz_para
     47    USE netcdf95, only: nf95_close
     48    USE netcdf, only: nf90_fill_real     ! IM for NMC files
     49    USE open_climoz_m, only: open_climoz ! ozone climatology from a file
     50    USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
     51    USE pbl_surface_mod, ONLY : pbl_surface
     52    USE phyaqua_mod, only: zenang_an
     53    USE phystokenc_mod, ONLY: offline, phystokenc
    2254    USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, &
    2355         year_cur, mth_cur,jD_cur, jH_cur, jD_ref, day_cur, hour
     56!!  USE phys_local_var_mod, ONLY : a long list of variables
     57!!              ==> see below, after "CPP Keys" section
     58    USE phys_state_var_mod ! Variables sauvegardees de la physique
     59    USE phys_output_mod
     60    USE phys_output_ctrlout_mod
     61    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
     62    USE readaerosol_mod, ONLY : init_aero_fromfile
     63    USE readaerosolstrato_m, ONLY : init_readaerosolstrato
     64    USE radlwsw_m, only: radlwsw
     65    USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz
     66    USE regr_pr_time_av_m, only: regr_pr_time_av
     67    USE surface_data,     ONLY : type_ocean, ok_veget, ok_snow
     68    USE time_phylmdz_mod, only: annee_ref, current_time, day_ini, day_ref, &
     69          day_step_phy, itau_phy, pdtphys, raz_date, start_time, update_time
     70    USE tracinca_mod, ONLY: config_inca
     71    USE tropopause_m,     ONLY: dyn_tropopause
     72    USE vampir
     73    USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp
    2474    USE write_field_phy
    25     USE dimphy
    26     USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac
    27     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured
    28     USE mod_phys_lmdz_para
    29     USE iophy
    30     USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
    31     USE phystokenc_mod, ONLY: offline, phystokenc
    32     USE time_phylmdz_mod, only: raz_date, day_step_phy, update_time,current_time
    33     USE vampir
    34     USE pbl_surface_mod, ONLY : pbl_surface
    35     USE change_srf_frac_mod
    36     USE surface_data,     ONLY : type_ocean, ok_veget, ok_snow
    37     USE tropopause_m,     ONLY: dyn_tropopause
     75
     76    !USE cmp_seri_mod
     77!    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
     78!  &      fl_ebil, fl_cor_ebil
     79
     80!!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
     81!
     82!
    3883#ifdef CPP_Dust
    39     USE phytracr_spl_mod, ONLY: phytracr_spl
     84    USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
     85    USE phys_output_write_spl_mod
     86#else
     87    USE phytrac_mod, ONLY : phytrac_init, phytrac
     88    USE phys_output_write_mod
    4089#endif
     90
     91
     92#ifdef REPROBUS
     93    USE CHEM_REP, ONLY : Init_chem_rep_xjour, &
     94         d_q_rep,d_ql_rep,d_qi_rep,ptrop,ttrop, &
     95         ztrop, gravit,itroprep, Z1,Z2,fac,B
     96#endif
     97
     98
     99#ifdef CPP_RRTM
     100    USE YOERAD, ONLY : NRADLP
     101    USE YOESW, ONLY : RSUN
     102#endif
     103
     104
    41105#ifdef CPP_StratAer
    42106    USE strataer_mod, ONLY: strataer_init
    43107#endif
    44     USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, &
     108
     109
     110#ifdef CPP_XIOS
     111    USE xios, ONLY: xios_update_calendar, xios_context_finalize, &
     112            xios_get_field_attr, xios_field_is_active
     113    USE wxios, ONLY: missing_val, missing_val_omp
     114#endif
     115#ifndef CPP_XIOS
     116    USE paramLMDZ_phy_mod
     117#endif
     118!
     119!
     120!!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!!
     121
     122USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, &
    45123       ! [Variables internes non sauvegardees de la physique]
    46124       ! Variables locales pour effectuer les appels en serie
     
    216294       zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic
    217295       !
    218     USE phys_state_var_mod ! Variables sauvegardees de la physique
    219 #ifdef CPP_Dust
    220     USE phys_output_write_spl_mod
    221 #else
    222     USE phys_output_var_mod ! Variables pour les ecritures des sorties
    223 #endif
    224 
    225     USE phys_output_write_mod
    226     USE fonte_neige_mod, ONLY  : fonte_neige_get_vars
    227     USE phys_output_mod
    228     USE phys_output_ctrlout_mod
    229     USE open_climoz_m, only: open_climoz ! ozone climatology from a file
    230     USE regr_pr_time_av_m, only: regr_pr_time_av
    231     USE netcdf95, only: nf95_close
    232     !IM for NMC files
    233     USE netcdf, only: nf90_fill_real
    234     USE mod_phys_lmdz_mpi_data, only: is_mpi_root
    235     USE aero_mod
    236     USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
    237     USE conf_phys_m, only: conf_phys
    238     USE radlwsw_m, only: radlwsw
    239     USE phyaqua_mod, only: zenang_an
    240     USE time_phylmdz_mod, only: day_step_phy, annee_ref, day_ref, itau_phy, &
    241          start_time, pdtphys, day_ini
    242     USE tracinca_mod, ONLY: config_inca
    243 #ifdef CPP_XIOS
    244     USE wxios, ONLY: missing_val, missing_val_omp
    245     USE xios, ONLY: xios_get_field_attr, xios_field_is_active
    246 #endif
    247 #ifdef REPROBUS
    248     USE CHEM_REP, ONLY : Init_chem_rep_xjour, &
    249          d_q_rep,d_ql_rep,d_qi_rep,ptrop,ttrop, &
    250          ztrop, gravit,itroprep, Z1,Z2,fac,B
    251 #endif
    252     USE indice_sol_mod
    253     USE phytrac_mod, ONLY : phytrac_init, phytrac
    254     USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad
    255 
    256 #ifdef CPP_RRTM
    257     USE YOERAD, ONLY : NRADLP
    258     USE YOESW, ONLY : RSUN
    259 #endif
    260     USE ioipsl_getin_p_mod, ONLY : getin_p
    261 
    262 #ifndef CPP_XIOS
    263     USE paramLMDZ_phy_mod
    264 #endif
    265 
    266     USE cmp_seri_mod
    267     USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
    268   &      fl_ebil, fl_cor_ebil
    269 
    270     !IM stations CFMIP
    271     USE CFMIP_point_locations
    272     USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando
    273     USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando
    274     USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp
    275     USE etat0_limit_unstruct_mod
    276 #ifdef CPP_XIOS
    277     USE xios, ONLY: xios_update_calendar, xios_context_finalize
    278 #endif
    279     USE limit_read_mod, ONLY : init_limit_read
    280     USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz
    281     USE readaerosol_mod, ONLY : init_aero_fromfile
    282     USE readaerosolstrato_m, ONLY : init_readaerosolstrato
     296
    283297
    284298    IMPLICIT NONE
     
    13471361       iflag_phytrac = 1 ! by default we do want to call phytrac
    13481362       CALL getin_p('iflag_phytrac',iflag_phytrac)
     1363#ifdef CPP_Dust
     1364       IF (iflag_phytrac.EQ.0) THEN
     1365         WRITE(lunout,*) 'In order to run with SPLA, iflag_phytrac will be forced to 1'
     1366         iflag_phytrac = 1
     1367       ENDIF
     1368#endif 
    13491369       nvm_lmdz = 13
    13501370       CALL getin_p('NVM',nvm_lmdz)
     
    16811701
    16821702       CALL iniradia(klon,klev,paprs(1,1:klev+1))
    1683        ! Initialisation des champs dans phytrac qui sont utilisés par phys_output_write
     1703
     1704       ! Initialisation des champs dans phytrac* qui sont utilisés par phys_output_write*
     1705#ifdef CPP_Dust
     1706       ! Quand on utilise SPLA, on force iflag_phytrac=1
     1707       CALL phytracr_spl_out_init()
     1708       CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,                  &
     1709                                pplay, lmax_th, aerosol_couple,                 &
     1710                                ok_ade, ok_aie, ivap, ok_sync,                  &
     1711                                ptconv, read_climoz, clevSTD,                   &
     1712                                ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
     1713                                flag_aerosol, flag_aerosol_strat, ok_cdnc)
     1714#else
     1715       ! phys_output_write écrit des variables traceurs seulement si iflag_phytrac == 1
     1716       ! donc seulement dans ce cas on doit appeler phytrac_init()
    16841717       IF (iflag_phytrac == 1 ) THEN
    16851718          CALL phytrac_init()
    1686         ENDIF
    1687 
     1719       ENDIF
    16881720       CALL phys_output_write(itap, pdtphys, paprs, pphis,                    &
    16891721                              pplay, lmax_th, aerosol_couple,                 &
     
    16921724                              ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
    16931725                              flag_aerosol, flag_aerosol_strat, ok_cdnc)
     1726#endif
     1727
    16941728
    16951729#ifdef CPP_XIOS
     
    47754809    ENDIF
    47764810
    4777     IF (iflag_phytrac == 1 ) THEN
    4778 
    47794811#ifdef CPP_Dust
    4780       CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I
     4812    !  Avec SPLA, iflag_phytrac est forcé =1
     4813    CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I
    47814814                      pdtphys,ftsol,                                   &  ! I
    47824815                      t,q_seri,paprs,pplay,RHcl,                  &  ! I
     
    47944827
    47954828#else
    4796 
    4797     CALL phytrac ( &
     4829    IF (iflag_phytrac == 1 ) THEN
     4830      CALL phytrac ( &
    47984831         itap,     days_elapsed+1,    jH_cur,   debut, &
    47994832         lafin,    phys_tstep,     u, v,     t, &
     
    48324865
    48334866#endif
     4867    ENDIF    ! (iflag_phytrac=1)
    48344868
    48354869#endif
    4836     ENDIF    ! (iflag_phytrac=1)
     4870    !ENDIF    ! (iflag_phytrac=1)
    48374871
    48384872    IF (offline) THEN
     
    51345168  CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,  &
    51355169       pplay, lmax_th, aerosol_couple,                 &
    5136        ok_ade, ok_aie, ivap, ok_sync,         &
     5170       ok_ade, ok_aie, ivap, ok_sync,                  &
    51375171       ptconv, read_climoz, clevSTD,                   &
    51385172       ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
     
    51535187#endif
    51545188
    5155 ! On remet des variables a .false. apres un premier appel
     5189! Pour XIOS : On remet des variables a .false. apres un premier appel
    51565190    IF (debut) THEN
    51575191#ifdef CPP_XIOS
Note: See TracChangeset for help on using the changeset viewer.