--- trunk/Sources/dyn3d/calfis.f 2015/05/26 17:46:03 139 +++ trunk/dyn3d/calfis.f 2018/03/20 09:35:59 265 @@ -4,8 +4,8 @@ contains - SUBROUTINE calfis(dayvrai, time, ucov, vcov, teta, q, pk, phis, phi, w, & - dufi, dvfi, dtetafi, dqfi, lafin) + SUBROUTINE calfis(ucov, vcov, teta, q, p3d, pk, phis, phi, w, dufi, dvfi, & + dtetafi, dqfi, dayvrai, time, lafin) ! From dyn3d/calfis.F, version 1.3, 2005/05/25 13:10:09 ! Authors: P. Le Van, F. Hourdin @@ -30,21 +30,15 @@ ! rayonnement) et l'aire de la maille (quand on veut int\'egrer une ! grandeur horizontalement). - use comconst, only: kappa, cpp, dtphys, g + use comconst, only: kappa, cpp, g use comgeom, only: apoln, cu_2d, cv_2d, unsaire_2d, apols - use dimens_m, only: iim, jjm, llm, nqmx + use dimensions, only: iim, jjm, llm, nqmx use dimphy, only: klon use disvert_m, only: preff use dynetat0_m, only: rlonu, rlonv use grid_change, only: dyn_phy, gr_fi_dyn use nr_util, only: pi use physiq_m, only: physiq - use pressure_var, only: p3d, pls - - integer, intent(in):: dayvrai - ! current day number, based at value 1 on January 1st of annee_ref - - REAL, intent(in):: time ! time of day, as a fraction of day length REAL, intent(in):: ucov(:, :, :) ! (iim + 1, jjm + 1, llm) ! covariant zonal velocity @@ -58,6 +52,11 @@ REAL, intent(in):: q(:, :, :, :) ! (iim + 1, jjm + 1, llm, nqmx) ! mass fractions of advected fields + REAL, intent(in):: p3d(:, :, :) ! (iim + 1, jjm + 1, llm + 1) + ! pressure at layer interfaces, in Pa + ! ("p3d(i, j, l)" is at longitude "rlonv(i)", latitude "rlatu(j)", + ! for interface "l") + REAL, intent(in):: pk(:, :, :) ! (iim + 1, jjm + 1, llm) ! Exner = cp * (p / preff)**kappa @@ -75,6 +74,11 @@ ! tendency for the potential temperature REAL, intent(out):: dqfi(:, :, :, :) ! (iim + 1, jjm + 1, llm, nqmx) + + integer, intent(in):: dayvrai + ! current day number, based at value 1 on January 1st of annee_ref + + REAL, intent(in):: time ! time of day, as a fraction of day length LOGICAL, intent(in):: lafin ! Local: @@ -104,8 +108,7 @@ ! 43. Température et pression milieu couche DO l = 1, llm pksurcp = pk(:, :, l) / cpp - pls(:, :, l) = preff * pksurcp**(1./ kappa) - play(:, l) = pack(pls(:, :, l), dyn_phy) + play(:, l) = pack(preff * pksurcp**(1./ kappa), dyn_phy) t(:, l) = pack(teta(:, :, l) * pksurcp, dyn_phy) ENDDO @@ -178,9 +181,8 @@ forall(l = 1: llm) v(:, l) = pack(zvfi(:, :, l), dyn_phy) - ! Appel de la physique : - CALL physiq(lafin, dayvrai, time, dtphys, paprs, play, pphi, pphis, u, & - v, t, qx, omega, d_u, d_v, d_t, d_qx) + CALL physiq(lafin, dayvrai, time, paprs, play, pphi, pphis, u, v, t, qx, & + omega, d_u, d_v, d_t, d_qx) ! transformation des tendances physiques en tendances dynamiques: @@ -216,7 +218,7 @@ DO j = 2, jjm ig0 = 1 + (j - 2) * iim DO i = 1, iim - 1 - dufi(i, j, l) = 0.5 * (d_u(ig0 + i, l) + d_u(ig0 + i+1, l)) & + dufi(i, j, l) = 0.5 * (d_u(ig0 + i, l) + d_u(ig0 + i + 1, l)) & * cu_2d(i, j) ENDDO dufi(iim, j, l) = 0.5 * (d_u(ig0 + 1, l) + d_u(ig0 + iim, l)) & @@ -231,7 +233,7 @@ DO j = 2, jjm - 1 ig0 = 1 + (j - 2) * iim DO i = 1, iim - dvfi(i, j, l) = 0.5 * (d_v(ig0 + i, l) + d_v(ig0 + i+iim, l)) & + dvfi(i, j, l) = 0.5 * (d_v(ig0 + i, l) + d_v(ig0 + i + iim, l)) & * cv_2d(i, j) ENDDO dvfi(iim + 1, j, l) = dvfi(1, j, l)