- Timestamp:
- 10/30/20 11:37:20 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/UNIFORM/v7/IPSLCM7/SOURCES/LMDZ/physiq_mod.F90
r5479 r5484 1 1 ! 2 ! $Id: physiq_mod.F90 3 780 2020-10-22 12:50:18Z evignon$2 ! $Id: physiq_mod.F90 3666 2020-04-20 10:13:34Z lfalletti $ 3 3 ! 4 4 !#define IO_DEBUG … … 16 16 d_u, d_v, d_t, d_qx, d_ps) 17 17 18 ! For clarity, the "USE" section is now arranged in alphabetical order,19 ! with a separate section for CPP keys20 ! PLEASE try to follow this rule21 22 USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando23 USE aero_mod24 USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &25 & fl_ebil, fl_cor_ebil26 18 USE assert_m, only: assert 27 USE change_srf_frac_mod28 USE conf_phys_m, only: conf_phys29 USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad30 USE CFMIP_point_locations ! IM stations CFMIP31 USE cmp_seri_mod32 USE dimphy33 USE etat0_limit_unstruct_mod34 USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando35 USE fonte_neige_mod, ONLY : fonte_neige_get_vars36 USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg37 19 USE ioipsl, only: histbeg, histvert, histdef, histend, histsync, & 38 20 histwrite, ju2ymds, ymds2ju, getin 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 21 USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg 54 22 USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, & 55 23 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 24 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 61 30 USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level 62 USE readaerosol_mod, ONLY : init_aero_fromfile63 USE readaerosolstrato_m, ONLY : init_readaerosolstrato64 USE radlwsw_m, only: radlwsw65 USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz66 USE regr_pr_time_av_m, only: regr_pr_time_av31 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 67 36 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_time70 USE tracinca_mod, ONLY: config_inca71 37 USE tropopause_m, ONLY: dyn_tropopause 72 USE vampir73 USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp74 USE write_field_phy75 76 !USE cmp_seri_mod77 ! USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &78 ! & fl_ebil, fl_cor_ebil79 80 !!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!81 !82 !83 38 #ifdef CPP_Dust 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 39 USE phytracr_spl_mod, ONLY: phytracr_spl 89 40 #endif 90 91 92 #ifdef REPROBUS93 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,B96 #endif97 98 99 #ifdef CPP_RRTM100 USE YOERAD, ONLY : NRADLP101 USE YOESW, ONLY : RSUN102 #endif103 104 105 41 #ifdef CPP_StratAer 106 42 USE strataer_mod, ONLY: strataer_init 107 43 #endif 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 122 USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, & 44 USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, & 123 45 ! [Variables internes non sauvegardees de la physique] 124 46 ! Variables locales pour effectuer les appels en serie … … 273 195 ref_liq, ref_ice, theta, & 274 196 ref_liq_pi, ref_ice_pi, & 275 zphi, zx_rh, zx_rhl, zx_rhi,&197 zphi, zx_rh, & 276 198 pmfd, pmfu, & 277 199 ! … … 294 216 zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic 295 217 ! 296 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 297 283 298 284 IMPLICIT NONE … … 1361 1347 iflag_phytrac = 1 ! by default we do want to call phytrac 1362 1348 CALL getin_p('iflag_phytrac',iflag_phytrac) 1363 #ifdef CPP_Dust1364 IF (iflag_phytrac.EQ.0) THEN1365 WRITE(lunout,*) 'In order to run with SPLA, iflag_phytrac will be forced to 1'1366 iflag_phytrac = 11367 ENDIF1368 #endif1369 1349 nvm_lmdz = 13 1370 1350 CALL getin_p('NVM',nvm_lmdz) … … 1535 1515 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1536 1516 CALL init_iophy_new(latitude_deg,longitude_deg) 1537 CALL create_etat0_limit_unstruct1538 CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0)1539 1517 1540 1518 !=================================================================== … … 1631 1609 #ifdef CPP_COSP 1632 1610 IF (ok_cosp) THEN 1633 !DO k = 1, klev1634 !DO i = 1, klon1635 !phicosp(i,k) = pphi(i,k) + pphis(i)1636 !ENDDO1637 !ENDDO1611 DO k = 1, klev 1612 DO i = 1, klon 1613 phicosp(i,k) = pphi(i,k) + pphis(i) 1614 ENDDO 1615 ENDDO 1638 1616 CALL phys_cosp(itap,phys_tstep,freq_cosp, & 1639 1617 ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, & … … 1653 1631 #ifdef CPP_COSP2 1654 1632 IF (ok_cosp) THEN 1655 !DO k = 1, klev1656 !DO i = 1, klon1657 !phicosp(i,k) = pphi(i,k) + pphis(i)1658 !ENDDO1659 !ENDDO1633 DO k = 1, klev 1634 DO i = 1, klon 1635 phicosp(i,k) = pphi(i,k) + pphis(i) 1636 ENDDO 1637 ENDDO 1660 1638 CALL phys_cosp2(itap,phys_tstep,freq_cosp, & 1661 1639 ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, & … … 1703 1681 1704 1682 CALL iniradia(klon,klev,paprs(1,1:klev+1)) 1705 1706 ! Initialisation des champs dans phytrac* qui sont utilisés par phys_output_write* 1707 #ifdef CPP_Dust 1708 ! Quand on utilise SPLA, on force iflag_phytrac=1 1709 CALL phytracr_spl_out_init() 1710 CALL phys_output_write_spl(itap, pdtphys, paprs, pphis, & 1711 pplay, lmax_th, aerosol_couple, & 1712 ok_ade, ok_aie, ivap, ok_sync, & 1713 ptconv, read_climoz, clevSTD, & 1714 ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse, & 1715 flag_aerosol, flag_aerosol_strat, ok_cdnc) 1716 #else 1717 ! phys_output_write écrit des variables traceurs seulement si iflag_phytrac == 1 1718 ! donc seulement dans ce cas on doit appeler phytrac_init() 1683 ! Initialisation des champs dans phytrac qui sont utilisés par phys_output_write 1719 1684 IF (iflag_phytrac == 1 ) THEN 1720 1685 CALL phytrac_init() 1721 ENDIF 1686 ENDIF 1687 1722 1688 CALL phys_output_write(itap, pdtphys, paprs, pphis, & 1723 1689 pplay, lmax_th, aerosol_couple, & … … 1726 1692 ptconvth, d_u, d_t, qx, d_qx, zmasse, & 1727 1693 flag_aerosol, flag_aerosol_strat, ok_cdnc) 1728 #endif1729 1730 1694 1731 1695 #ifdef CPP_XIOS … … 1733 1697 #endif 1734 1698 IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz) 1699 CALL create_etat0_limit_unstruct 1700 CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0) 1735 1701 1736 1702 !jyg< … … 2548 2514 longitude_deg, latitude_deg, rugoro, zrmu0, & 2549 2515 zsig, sollwdown, pphi, cldt, & 2550 rain_fall, snow_fall, solsw, sol swfdiff, sollw, &2516 rain_fall, snow_fall, solsw, sollw, & 2551 2517 gustiness, & 2552 2518 t_seri, q_seri, u_seri, v_seri, & … … 3738 3704 ENDIF 3739 3705 zx_rh(i,k) = q_seri(i,k)/zx_qs 3740 zx_rhl(i,k) = q_seri(i,k)/(qsatl(zx_t)/pplay(i,k))3741 zx_rhi(i,k) = q_seri(i,k)/(qsats(zx_t)/pplay(i,k))3742 3706 zqsat(i,k)=zx_qs 3743 3707 ENDDO … … 4179 4143 heat,heat0,cool,cool0,albpla, & 4180 4144 heat_volc,cool_volc, & 4181 topsw,toplw,solsw,sol swfdiff,sollw, &4145 topsw,toplw,solsw,sollw, & 4182 4146 sollwdown, & 4183 4147 topsw0,toplw0,solsw0,sollw0, & … … 4266 4230 heatp,heat0p,coolp,cool0p,albplap, & 4267 4231 heat_volc,cool_volc, & 4268 topswp,toplwp,solswp,sol swfdiffp,sollwp, &4232 topswp,toplwp,solswp,sollwp, & 4269 4233 sollwdownp, & 4270 4234 topsw0p,toplw0p,solsw0p,sollw0p, & … … 4736 4700 #ifdef CPP_COSPV2 4737 4701 IF (itap.eq.1.or.MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN 4738 ! IF (MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN4739 4702 4740 4703 IF (prt_level .GE.10) THEN 4741 4704 print*,'freq_cosp',freq_cosp 4742 4705 ENDIF 4743 DO k = 1, klev4744 DO i = 1, klon4745 phicosp(i,k) = pphi(i,k) + pphis(i)4746 ENDDO4747 ENDDO4748 4706 mr_ozone=wo(:, :, 1) * dobson_u * 1e3 / zmasse 4749 4707 print*,'Dans physiq.F avant appel ' … … 4811 4769 ENDIF 4812 4770 4771 IF (iflag_phytrac == 1 ) THEN 4772 4813 4773 #ifdef CPP_Dust 4814 ! Avec SPLA, iflag_phytrac est forcé =1 4815 CALL phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con, & ! I 4774 CALL phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con, & ! I 4816 4775 pdtphys,ftsol, & ! I 4817 4776 t,q_seri,paprs,pplay,RHcl, & ! I … … 4829 4788 4830 4789 #else 4831 IF (iflag_phytrac == 1 ) THEN 4832 4790 4791 CALL phytrac ( & 4833 4792 itap, days_elapsed+1, jH_cur, debut, & 4834 4793 lafin, phys_tstep, u, v, t, & … … 4867 4826 4868 4827 #endif 4828 4829 #endif 4869 4830 ENDIF ! (iflag_phytrac=1) 4870 4871 #endif4872 !ENDIF ! (iflag_phytrac=1)4873 4831 4874 4832 IF (offline) THEN … … 5170 5128 CALL phys_output_write_spl(itap, pdtphys, paprs, pphis, & 5171 5129 pplay, lmax_th, aerosol_couple, & 5172 ok_ade, ok_aie, ivap, ok_sync, 5130 ok_ade, ok_aie, ivap, ok_sync, & 5173 5131 ptconv, read_climoz, clevSTD, & 5174 5132 ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse, & … … 5189 5147 #endif 5190 5148 5191 ! Pour XIOS :On remet des variables a .false. apres un premier appel5149 ! On remet des variables a .false. apres un premier appel 5192 5150 IF (debut) THEN 5193 5151 #ifdef CPP_XIOS
Note: See TracChangeset
for help on using the changeset viewer.