Changeset 2812 for LMDZ5/trunk/libf/phylmd
- Timestamp:
- Mar 6, 2017, 2:56:26 PM (8 years ago)
- Location:
- LMDZ5/trunk/libf/phylmd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/add_phys_tend_mod.F90
r2809 r2812 73 73 PRINT *, ' add_pbl_tend, zzdt ', zzdt 74 74 PRINT *, ' add_pbl_tend, zzdq ', zzdq 75 CALL add_phys_tend(zdu, zdv, zzdt, zzdq, zdql, zdqi, paprs, text,abortphy,flag_inhib_tend, itap )75 CALL add_phys_tend(zdu, zdv, zzdt, zzdq, zdql, zdqi, paprs, text,abortphy,flag_inhib_tend, itap, 0) 76 76 ELSE 77 CALL add_phys_tend(zdu, zdv, zdt, zdq, zdql, zdqi, paprs, text,abortphy,flag_inhib_tend, itap )77 CALL add_phys_tend(zdu, zdv, zdt, zdq, zdql, zdqi, paprs, text,abortphy,flag_inhib_tend, itap, 0) 78 78 END IF 79 79 … … 84 84 ! $Id: add_phys_tend.F90 2611 2016-08-03 15:41:26Z jyg $ 85 85 ! 86 SUBROUTINE add_phys_tend (zdu,zdv,zdt,zdq,zdql,zdqi,paprs,text,abortphy,flag_inhib_tend, itap) 86 SUBROUTINE add_phys_tend (zdu,zdv,zdt,zdq,zdql,zdqi,paprs,text, & 87 abortphy,flag_inhib_tend, itap, diag_mode) 87 88 !====================================================================== 88 89 ! Ajoute les tendances des variables physiques aux variables … … 111 112 ! Arguments : 112 113 !------------ 113 REAL zdu(klon,klev),zdv(klon,klev) 114 REAL zdt(klon,klev),zdq(klon,klev),zdql(klon,klev),zdqi(klon,klev) 115 REAL paprs(klon,klev+1) 116 CHARACTER*(*) text 117 INTEGER abortphy 118 INTEGER flag_inhib_tend ! if flag_inhib_tend != 0, tendencies are not added 119 INTEGER itap ! time step number 114 REAL, DIMENSION(klon,klev), INTENT(IN) :: zdu, zdv 115 REAL, DIMENSION(klon,klev), INTENT(IN) :: zdt, zdql, zdqi 116 REAL, DIMENSION(klon,klev+1), INTENT(IN) :: paprs 117 CHARACTER*(*), INTENT(IN) :: text 118 INTEGER, INTENT(IN) :: abortphy 119 INTEGER, INTENT(IN) :: flag_inhib_tend ! if not 0, tendencies are not added 120 INTEGER, INTENT(IN) :: itap ! time step number 121 INTEGER, INTENT(IN) :: diag_mode ! 0 -> normal effective mode 122 ! 1 -> only conservation stats are computed 123 ! 124 REAL, DIMENSION(klon,klev), INTENT(INOUT) :: zdq 120 125 121 126 ! Local : … … 126 131 REAL zqp(klev) 127 132 133 ! Save variables, used in diagnostic mode (diag_mode=1). 134 REAL, DIMENSION(klon,klev) :: sav_u_seri, sav_v_seri 135 REAL, DIMENSION(klon,klev) :: sav_ql_seri, sav_qs_seri, sav_q_seri 136 REAL, DIMENSION(klon,klev) :: sav_t_seri 137 REAL, DIMENSION(klon,klev) :: sav_zdq 138 ! 128 139 INTEGER i, k,j, n 129 140 INTEGER jadrs(klon*klev), jbad … … 191 202 first=.false. 192 203 endif 204 ! 205 ! print *,'add_phys_tend: paprs ',paprs 206 ! When in diagnostic mode, save initial values of out variables 207 IF (diag_mode == 1) THEN 208 sav_u_seri(:,:) = u_seri(:,:) 209 sav_v_seri(:,:) = v_seri(:,:) 210 sav_ql_seri(:,:) = ql_seri(:,:) 211 sav_qs_seri(:,:) = qs_seri(:,:) 212 sav_q_seri(:,:) = q_seri(:,:) 213 sav_t_seri(:,:) = t_seri(:,:) 214 sav_zdq(:,:) = zdq(:,:) 215 ENDIF ! (diag_mode == 1) 193 216 !====================================================================== 194 217 ! Diagnostics for energy conservation tests … … 230 253 zh_dair_col(i,n) = zh_dair_col(i,n) + rcpd*(1.-q_seri(i,k)-ql_seri(i,k)-qs_seri(i,k))* & 231 254 zairm(i, k)*t_seri(i, k) 232 zh_qw_col(i,n) = zh_qw_col(i,n) + zcpvap*q_seri(i, k)*zairm(i, k)*t_seri(i, k) 233 zh_ql_col(i,n) = zh_ql_col(i,n) + zcwat*ql_seri(i, k)*zairm(i, k)*t_seri(i, k) - & 234 rlvtt*ql_seri(i, k)*zairm(i, k) 235 zh_qs_col(i,n) = zh_qs_col(i,n) + zcice*qs_seri(i, k)*zairm(i, k)*t_seri(i, k) - & 236 rlstt*qs_seri(i, k)*zairm(i, k) 255 zh_qw_col(i,n) = zh_qw_col(i,n) + zcpvap*t_seri(i, k) *q_seri(i, k)*zairm(i, k) !jyg 256 zh_ql_col(i,n) = zh_ql_col(i,n) + (zcpvap*t_seri(i, k) - rlvtt)*ql_seri(i, k)*zairm(i, k) !jyg 257 zh_qs_col(i,n) = zh_qs_col(i,n) + (zcpvap*t_seri(i, k) - rlstt)*qs_seri(i, k)*zairm(i, k) !jyg 237 258 END DO 238 259 END DO … … 455 476 zh_dair_col(i,n) = zh_dair_col(i,n) + rcpd*(1.-q_seri(i,k)-ql_seri(i,k)-qs_seri(i,k))* & 456 477 zairm(i, k)*t_seri(i, k) 457 zh_qw_col(i,n) = zh_qw_col(i,n) + zcpvap*q_seri(i, k)*zairm(i, k)*t_seri(i, k) 458 zh_ql_col(i,n) = zh_ql_col(i,n) + zcwat*ql_seri(i, k)*zairm(i, k)*t_seri(i, k) - & 459 rlvtt*ql_seri(i, k)*zairm(i, k) 460 zh_qs_col(i,n) = zh_qs_col(i,n) + zcice*qs_seri(i, k)*zairm(i, k)*t_seri(i, k) - & 461 rlstt*qs_seri(i, k)*zairm(i, k) 478 zh_qw_col(i,n) = zh_qw_col(i,n) + zcpvap*t_seri(i, k) *q_seri(i, k)*zairm(i, k) !jyg 479 zh_ql_col(i,n) = zh_ql_col(i,n) + (zcpvap*t_seri(i, k) - rlvtt)*ql_seri(i, k)*zairm(i, k) !jyg 480 zh_qs_col(i,n) = zh_qs_col(i,n) + (zcpvap*t_seri(i, k) - rlstt)*qs_seri(i, k)*zairm(i, k) !jyg 462 481 END DO 463 482 END DO … … 484 503 485 504 end if ! end if (fl_ebil .GT. 0) 486 505 ! 506 ! When in diagnostic mode, restore "out" variables to initial values. 507 IF (diag_mode == 1) THEN 508 u_seri(:,:) = sav_u_seri(:,:) 509 v_seri(:,:) = sav_v_seri(:,:) 510 ql_seri(:,:) = sav_ql_seri(:,:) 511 qs_seri(:,:) = sav_qs_seri(:,:) 512 q_seri(:,:) = sav_q_seri(:,:) 513 t_seri(:,:) = sav_t_seri(:,:) 514 zdq(:,:) = sav_zdq(:,:) 515 ENDIF ! (mode == 1) 487 516 488 517 RETURN -
LMDZ5/trunk/libf/phylmd/physiq_mod.F90
r2801 r2812 534 534 REAL Tconv(klon,klev) 535 535 REAL sij(klon,klev,klev) 536 !! ! 537 !! ! variables pour tester la conservation de l'energie dans concvl 538 !! REAL, DIMENSION(klon,klev) :: d_t_con_sat 539 !! REAL, DIMENSION(klon,klev) :: d_q_con_sat 540 !! REAL, DIMENSION(klon,klev) :: dql_sat 536 541 537 542 real, save :: alp_bl_prescr=0. … … 821 826 ! 822 827 ! tendance nulles 823 REAL, dimension(klon,klev) 824 REAL, dimension(klon) 825 INTEGER, dimension(klon) 828 REAL, dimension(klon,klev):: du0, dv0, dt0, dq0, dql0, dqi0 829 REAL, dimension(klon) :: dsig0, ddens0 830 INTEGER, dimension(klon) :: wkoccur1 826 831 ! tendance buffer pour appel de add_phys_tend 827 832 REAL, DIMENSION(klon,klev) :: d_q_ch4_dtime … … 1999 2004 CALL add_phys_tend & 2000 2005 (du0,dv0,d_t_eva,d_q_eva,d_ql_eva,d_qi_eva,paprs,& 2001 'eva',abortphy,flag_inhib_tend,itap )2006 'eva',abortphy,flag_inhib_tend,itap,0) 2002 2007 call prt_enerbil('eva',itap) 2003 2008 … … 2226 2231 CALL add_phys_tend & 2227 2232 (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,paprs,& 2228 'vdf',abortphy,flag_inhib_tend,itap )2233 'vdf',abortphy,flag_inhib_tend,itap,0) 2229 2234 ENDIF 2230 2235 call prt_enerbil('vdf',itap) … … 2608 2613 itapcv = itapcv+1 2609 2614 2615 !!!jyg Appel diagnostique a add_phys_tend pour tester la conservation de 2616 !!! l'energie dans les courants satures. 2617 !! d_t_con_sat(:,:) = d_t_con(:,:) - ftd(:,:)*dtime 2618 !! d_q_con_sat(:,:) = d_q_con(:,:) - fqd(:,:)*dtime 2619 !! dql_sat(:,:) = (wdtrainA(:,:)+wdtrainM(:,:))*dtime/zmasse(:,:) 2620 !! CALL add_phys_tend(d_u_con, d_v_con, d_t_con_sat, d_q_con_sat, dql_sat, & 2621 !! dqi0, paprs, 'convection_sat', abortphy, flag_inhib_tend,& 2622 !! itap, 1) 2623 !! call prt_enerbil('convection_sat',itap) 2624 !! 2625 !! 2610 2626 CALL add_phys_tend(d_u_con, d_v_con, d_t_con, d_q_con, dql0, dqi0, paprs, & 2611 'convection',abortphy,flag_inhib_tend,itap )2627 'convection',abortphy,flag_inhib_tend,itap,0) 2612 2628 call prt_enerbil('convection',itap) 2613 2629 … … 2739 2755 ! ajout des tendances des poches froides 2740 2756 CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,paprs,'wake', & 2741 abortphy,flag_inhib_tend,itap )2757 abortphy,flag_inhib_tend,itap,0) 2742 2758 call prt_enerbil('wake',itap) 2743 2759 !------------------------------------------------------------------------ … … 2875 2891 ! 2876 2892 CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs, & 2877 dql0,dqi0,paprs,'thermals', abortphy,flag_inhib_tend,itap )2893 dql0,dqi0,paprs,'thermals', abortphy,flag_inhib_tend,itap,0) 2878 2894 call prt_enerbil('thermals',itap) 2879 2895 ! … … 2938 2954 ! ajout des tendances de l'ajustement sec ou des thermiques 2939 2955 CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,paprs, & 2940 'ajsb',abortphy,flag_inhib_tend,itap )2956 'ajsb',abortphy,flag_inhib_tend,itap,0) 2941 2957 call prt_enerbil('ajsb',itap) 2942 2958 d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_ajsb(:,:) … … 2989 3005 !-JLD 2990 3006 CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,paprs, & 2991 'lsc',abortphy,flag_inhib_tend,itap )3007 'lsc',abortphy,flag_inhib_tend,itap,0) 2992 3008 call prt_enerbil('lsc',itap) 2993 3009 rain_num(:)=0. … … 3769 3785 ENDDO 3770 3786 3771 CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW',abortphy,flag_inhib_tend,itap )3787 CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,paprs,'SW',abortphy,flag_inhib_tend,itap,0) 3772 3788 call prt_enerbil('SW',itap) 3773 CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW',abortphy,flag_inhib_tend,itap )3789 CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,paprs,'LW',abortphy,flag_inhib_tend,itap,0) 3774 3790 call prt_enerbil('LW',itap) 3775 3791 … … 3842 3858 ! ajout des tendances de la trainee de l'orographie 3843 3859 CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,paprs,'oro', & 3844 abortphy,flag_inhib_tend,itap )3860 abortphy,flag_inhib_tend,itap,0) 3845 3861 call prt_enerbil('oro',itap) 3846 3862 !---------------------------------------------------------------------- … … 3889 3905 ! ajout des tendances de la portance de l'orographie 3890 3906 CALL add_phys_tend(d_u_lif, d_v_lif, d_t_lif, dq0, dql0, dqi0, paprs, & 3891 'lif', abortphy,flag_inhib_tend,itap )3907 'lif', abortphy,flag_inhib_tend,itap,0) 3892 3908 call prt_enerbil('lif',itap) 3893 3909 ENDIF ! fin de test sur ok_orolf … … 3913 3929 d_t_hin(:, :)=0. 3914 3930 CALL add_phys_tend(du_gwd_hines, dv_gwd_hines, d_t_hin, dq0, dql0, & 3915 dqi0, paprs, 'hin', abortphy,flag_inhib_tend,itap )3931 dqi0, paprs, 'hin', abortphy,flag_inhib_tend,itap,0) 3916 3932 call prt_enerbil('hin',itap) 3917 3933 ENDIF … … 3931 3947 3932 3948 CALL add_phys_tend(du_gwd_front, dv_gwd_front, dt0, dq0, dql0, dqi0, & 3933 paprs, 'front_gwd_rando', abortphy,flag_inhib_tend,itap )3949 paprs, 'front_gwd_rando', abortphy,flag_inhib_tend,itap,0) 3934 3950 call prt_enerbil('front_gwd_rando',itap) 3935 3951 ENDIF … … 3940 3956 du_gwd_rando, dv_gwd_rando, east_gwstress, west_gwstress) 3941 3957 CALL add_phys_tend(du_gwd_rando, dv_gwd_rando, dt0, dq0, dql0, dqi0, & 3942 paprs, 'flott_gwd_rando', abortphy,flag_inhib_tend,itap )3958 paprs, 'flott_gwd_rando', abortphy,flag_inhib_tend,itap,0) 3943 3959 call prt_enerbil('flott_gwd_rando',itap) 3944 3960 zustr_gwd_rando=0. … … 3992 4008 d_q_ch4_dtime(:,:) = d_q_ch4(:,:)*dtime 3993 4009 CALL add_phys_tend(du0, dv0, dt0, d_q_ch4_dtime, dql0, dqi0, paprs, & 3994 'q_ch4', abortphy,flag_inhib_tend,itap )4010 'q_ch4', abortphy,flag_inhib_tend,itap,0) 3995 4011 d_q_ch4(:,:) = d_q_ch4_dtime(:,:)/dtime 3996 4012 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.