Changeset 5159 for LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diagedyn.f90
- Timestamp:
- Aug 2, 2024, 9:58:25 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diagedyn.f90
r5158 r5159 6 6 , ucov , vcov , ps, p ,pk , teta , q, ql) 7 7 !====================================================================== 8 ! 8 9 9 ! Purpose: 10 10 ! Calcul la difference d'enthalpie et de masse d'eau entre 2 appels, … … 14 14 ! Outil pour diagnostiquer la conservation de l'energie 15 15 ! et de la masse dans la dynamique. 16 ! 17 ! 16 17 18 18 !====================================================================== 19 19 ! Arguments: … … 36 36 ! ql-------input-R- liquid watter (kg/kg) 37 37 ! aire-----input-R- mesh surafce (m2) 38 ! 38 39 39 ! the following total value are computed by UNIT of earth surface 40 ! 40 41 41 ! d_h_vcol--output-R- Heat flux (W/m2) define as the Enthalpy 42 42 ! change (J/m2) during one time step (dtime) for the whole … … 47 47 ! d_ql------output-R- same, for the liquid watter only (kg/m2/s) 48 48 ! d_ec------output-R- Cinetic Energy Budget (W/m2) for vertical air column 49 ! 50 ! 49 50 51 51 ! J.L. Dufresne, July 2002 52 52 !====================================================================== … … 56 56 USE lmdz_comgeom 57 57 58 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm 59 USE lmdz_paramet 58 60 IMPLICIT NONE 59 61 ! 60 INCLUDE "dimensions.h" 61 INCLUDE "paramet.h" 62 63 62 64 63 65 ! Ehouarn: for now set these parameters to what is in Earth physics... … … 73 75 REAL,PARAMETER :: RLVTT=2.5008E+6 74 76 75 ! 77 76 78 INTEGER :: imjmp1 77 79 PARAMETER( imjmp1=iim*jjp1) … … 91 93 ! Output variables 92 94 REAL :: d_h_vcol, d_qt, d_qw, d_ql, d_qs, d_ec 93 ! 95 94 96 ! Local variables 95 ! 97 96 98 REAL :: h_vcol_tot, h_dair_tot, h_qw_tot, h_ql_tot & 97 99 , h_qs_tot, qw_tot, ql_tot, qs_tot , ec_tot … … 106 108 ! qs_tot------ total mass of solid watter (kg/m2) 107 109 ! ec_tot------ total cinetic energy (kg/m2) 108 ! 110 109 111 REAL :: masse(ip1jmp1,llm) ! masse d'air 110 112 REAL :: vcont(ip1jm,llm),ucont(ip1jmp1,llm) … … 129 131 REAL :: zh_dair_col(imjmp1) 130 132 REAL :: zh_qw_col(imjmp1), zh_ql_col(imjmp1), zh_qs_col(imjmp1) 131 ! 133 132 134 REAL :: d_h_dair, d_h_qw, d_h_ql, d_h_qs 133 ! 135 134 136 REAL :: airetot, zcpvap, zcwat, zcice 135 ! 137 136 138 INTEGER :: i, k, jj, ij , l ,ip1jjm1 137 ! 139 138 140 INTEGER :: ndiag ! max number of diagnostic in parallel 139 141 PARAMETER (ndiag=10) … … 141 143 save pas 142 144 data pas/ndiag*0/ 143 ! 145 144 146 REAL :: h_vcol_pre(ndiag), h_dair_pre(ndiag), h_qw_pre(ndiag) & 145 147 , h_ql_pre(ndiag), h_qs_pre(ndiag), qw_pre(ndiag) & … … 157 159 CALL massdair( p, masse ) 158 160 !====================================================================== 159 ! 160 ! 161 162 161 163 PRINT*,'MAIS POURQUOI DONC DIAGEDYN NE MARCHE PAS ?' 162 164 RETURN … … 187 189 ENDDO 188 190 ENDDO 189 ! 191 190 192 ! Reset variables 191 193 DO i = 1, imjmp1 … … 199 201 zh_qs_col(i) = 0. 200 202 ENDDO 201 ! 203 202 204 zcpvap=RCPV 203 205 zcwat=RCW 204 206 zcice=RCS 205 ! 207 206 208 ! Compute vertical sum for each atmospheric column 207 209 ! ================================================ … … 230 232 END DO 231 233 ENDDO 232 ! 234 233 235 ! Mean over the planete surface 234 236 ! ============================= … … 243 245 h_qs_tot = 0. 244 246 airetot=0. 245 ! 247 246 248 DO i=1,imjmp1 247 249 qw_tot = qw_tot + zqw_col(i) … … 255 257 airetot=airetot+zaire(i) 256 258 END DO 257 ! 259 258 260 qw_tot = qw_tot/airetot 259 261 ql_tot = ql_tot/airetot … … 264 266 h_ql_tot = h_ql_tot/airetot 265 267 h_qs_tot = h_qs_tot/airetot 266 ! 268 267 269 h_vcol_tot = h_dair_tot+h_qw_tot+h_ql_tot+h_qs_tot 268 ! 270 269 271 ! Compute the change of the atmospheric state compare to the one 270 272 ! stored in "idiag2", and convert it in flux. THis computation … … 272 274 ! for "idiag" 273 275 ! =================================== 274 ! 276 275 277 IF ( (idiag2>0) .AND. (pas(idiag2) /= 0) ) THEN 276 278 d_h_vcol = (h_vcol_tot - h_vcol_pre(idiag2) )/dtime … … 296 298 d_qt = 0. 297 299 ENDIF 298 ! 300 299 301 IF (iprt>=2) THEN 300 302 WRITE(6,9000) tit,pas(idiag),d_qt,d_qw,d_ql,d_qs … … 310 312 9004 format('Dyn3d. Total Energy Budget (W/m2) ',A15,1i6,10(F8.2)) 311 313 END IF 312 ! 314 313 315 ! Store the new atmospheric state in "idiag" 314 ! 316 315 317 pas(idiag)=pas(idiag)+1 316 318 h_vcol_pre(idiag) = h_vcol_tot … … 323 325 qs_pre(idiag) = qs_tot 324 326 ec_pre (idiag) = ec_tot 325 ! 327 326 328 ELSE 327 329 WRITE(lunout,*)'diagedyn: set to function with Earth parameters'
Note: See TracChangeset
for help on using the changeset viewer.