! $Header$ SUBROUTINE ajsec(paprs, pplay, t, q, limbas, d_t, d_q) USE dimphy USE yomcst_mod_h IMPLICIT NONE ! ====================================================================== ! Auteur(s): Z.X. Li (LMD/CNRS) date: 19930818 ! Objet: ajustement sec (adaptation du GCM du LMD) ! ====================================================================== ! Arguments: ! t-------input-R- Temperature ! d_t-----output-R-Incrementation de la temperature ! ====================================================================== REAL paprs(klon, klev+1), pplay(klon, klev) REAL t(klon, klev), q(klon, klev) REAL d_t(klon, klev), d_q(klon, klev) INTEGER limbas(klon), limhau ! les couches a ajuster LOGICAL mixq ! cc PARAMETER (mixq=.TRUE.) PARAMETER (mixq=.FALSE.) REAL zh(klon, klev) REAL zho(klon, klev) REAL zq(klon, klev) REAL zpk(klon, klev) REAL zpkdp(klon, klev) REAL hm, sm, qm LOGICAL modif(klon), down INTEGER i, k, k1, k2 ! Initialisation: ! ym limhau = klev DO k = 1, klev DO i = 1, klon d_t(i, k) = 0.0 d_q(i, k) = 0.0 END DO END DO ! ------------------------------------- detection des profils a modifier DO k = 1, limhau DO i = 1, klon zpk(i, k) = pplay(i, k)**rkappa zh(i, k) = rcpd*t(i, k)/zpk(i, k) zho(i, k) = zh(i, k) zq(i, k) = q(i, k) END DO END DO DO k = 1, limhau DO i = 1, klon zpkdp(i, k) = zpk(i, k)*(paprs(i,k)-paprs(i,k+1)) END DO END DO DO i = 1, klon modif(i) = .FALSE. END DO DO k = 2, limhau DO i = 1, klon IF (.NOT. modif(i) .AND. k-1>limbas(i)) THEN IF (zh(i,k)limhau) GO TO 8001 IF (zh(i,k2)=hm)) GO TO 8021 k2 = k2 + 1 k = k2 END IF GO TO 8020 8021 CONTINUE ! ------------ nouveau profil : constant (valeur moyenne) DO k = k1, k2 zh(i, k) = hm zq(i, k) = qm END DO k2 = k2 + 1 END IF GO TO 8000 8001 CONTINUE END IF END DO DO k = 1, limhau DO i = 1, klon d_t(i, k) = (zh(i,k)-zho(i,k))*zpk(i, k)/rcpd d_q(i, k) = zq(i, k) - q(i, k) END DO END DO ! FH : les d_q et d_t sont maintenant calcules de facon a valoir ! effectivement 0. si on ne fait rien. ! IF (limbas.GT.1) THEN ! DO k = 1, limbas-1 ! DO i = 1, klon ! d_t(i,k) = 0.0 ! d_q(i,k) = 0.0 ! ENDDO ! ENDDO ! ENDIF ! IF (limhau.LT.klev) THEN ! DO k = limhau+1, klev ! DO i = 1, klon ! d_t(i,k) = 0.0 ! d_q(i,k) = 0.0 ! ENDDO ! ENDDO ! ENDIF IF (.NOT. mixq) THEN DO k = 1, klev DO i = 1, klon d_q(i, k) = 0.0 END DO END DO END IF RETURN END SUBROUTINE ajsec SUBROUTINE ajsec_convv2(paprs, pplay, t, q, d_t, d_q) USE dimphy USE yomcst_mod_h IMPLICIT NONE ! ====================================================================== ! Auteur(s): Z.X. Li (LMD/CNRS) date: 19930818 ! Objet: ajustement sec (adaptation du GCM du LMD) ! ====================================================================== ! Arguments: ! t-------input-R- Temperature ! d_t-----output-R-Incrementation de la temperature ! ====================================================================== REAL paprs(klon, klev+1), pplay(klon, klev) REAL t(klon, klev), q(klon, klev) REAL d_t(klon, klev), d_q(klon, klev) INTEGER limbas, limhau ! les couches a ajuster ! cc PARAMETER (limbas=klev-3, limhau=klev) ! ym PARAMETER (limbas=1, limhau=klev) LOGICAL mixq ! cc PARAMETER (mixq=.TRUE.) PARAMETER (mixq=.FALSE.) REAL zh(klon, klev) REAL zq(klon, klev) REAL zpk(klon, klev) REAL zpkdp(klon, klev) REAL hm, sm, qm LOGICAL modif(klon), down INTEGER i, k, k1, k2 ! Initialisation: ! ym limbas = 1 limhau = klev DO k = 1, klev DO i = 1, klon d_t(i, k) = 0.0 d_q(i, k) = 0.0 END DO END DO ! ------------------------------------- detection des profils a modifier DO k = limbas, limhau DO i = 1, klon zpk(i, k) = pplay(i, k)**rkappa zh(i, k) = rcpd*t(i, k)/zpk(i, k) zq(i, k) = q(i, k) END DO END DO DO k = limbas, limhau DO i = 1, klon zpkdp(i, k) = zpk(i, k)*(paprs(i,k)-paprs(i,k+1)) END DO END DO DO i = 1, klon modif(i) = .FALSE. END DO DO k = limbas + 1, limhau DO i = 1, klon IF (.NOT. modif(i)) THEN IF (zh(i,k)limhau) GO TO 8001 IF (zh(i,k2)=hm)) GO TO 8021 k2 = k2 + 1 k = k2 END IF GO TO 8020 8021 CONTINUE ! ------------ nouveau profil : constant (valeur moyenne) DO k = k1, k2 zh(i, k) = hm zq(i, k) = qm END DO k2 = k2 + 1 END IF GO TO 8000 8001 CONTINUE END IF END DO DO k = limbas, limhau DO i = 1, klon d_t(i, k) = zh(i, k)*zpk(i, k)/rcpd - t(i, k) d_q(i, k) = zq(i, k) - q(i, k) END DO END DO IF (limbas>1) THEN DO k = 1, limbas - 1 DO i = 1, klon d_t(i, k) = 0.0 d_q(i, k) = 0.0 END DO END DO END IF IF (limhauklev) GO TO 8001 IF (local_h(i,l2)=hm)) GO TO 8021 l2 = l2 + 1 l = l2 END IF GO TO 8020 8021 CONTINUE ! ------------ nouveau profil : constant (valeur moyenne) DO l = l1, l2 local_h(i, l) = hm END DO l2 = l2 + 1 END IF GO TO 8000 8001 CONTINUE END IF END DO DO l = 1, klev DO i = 1, klon d_t(i, l) = local_h(i, l)*(pplay(i,l)**rkappa)/rcpd - t(i, l) END DO END DO RETURN END SUBROUTINE ajsec_old