[1] | 1 | ! |
---|
[1189] | 2 | ! $Id: $ |
---|
[1] | 3 | ! |
---|
| 4 | SUBROUTINE caldyn |
---|
[5] | 5 | $ (itau,ucov,vcov,teta,ps,masse,pk,pkf,tsurpk,phis , |
---|
[1] | 6 | $ phi,conser,du,dv,dteta,dp,w,pbaru,pbarv,time ) |
---|
| 7 | |
---|
[1422] | 8 | USE comvert_mod, ONLY: ap,bp |
---|
| 9 | |
---|
[1] | 10 | IMPLICIT NONE |
---|
| 11 | |
---|
[1189] | 12 | !======================================================================= |
---|
| 13 | ! |
---|
| 14 | ! Auteur : P. Le Van |
---|
| 15 | ! |
---|
| 16 | ! Objet: |
---|
| 17 | ! ------ |
---|
| 18 | ! |
---|
| 19 | ! Calcul des tendances dynamiques. |
---|
| 20 | ! |
---|
| 21 | ! Modif 04/93 F.Forget |
---|
| 22 | !======================================================================= |
---|
[1] | 23 | |
---|
[1189] | 24 | !----------------------------------------------------------------------- |
---|
| 25 | ! 0. Declarations: |
---|
| 26 | ! ---------------- |
---|
[1] | 27 | |
---|
| 28 | #include "dimensions.h" |
---|
| 29 | #include "paramet.h" |
---|
| 30 | #include "comgeom.h" |
---|
| 31 | |
---|
[1189] | 32 | ! Arguments: |
---|
| 33 | ! ---------- |
---|
[1] | 34 | |
---|
[1189] | 35 | LOGICAL,INTENT(IN) :: conser ! triggers printing some diagnostics |
---|
| 36 | INTEGER,INTENT(IN) :: itau ! time step index |
---|
| 37 | REAL,INTENT(IN) :: vcov(ip1jm,llm) ! covariant meridional wind |
---|
| 38 | REAL,INTENT(IN) :: ucov(ip1jmp1,llm) ! covariant zonal wind |
---|
| 39 | REAL,INTENT(IN) :: teta(ip1jmp1,llm) ! potential temperature |
---|
| 40 | REAL,INTENT(IN) :: ps(ip1jmp1) ! surface pressure |
---|
| 41 | REAL,INTENT(IN) :: phis(ip1jmp1) ! geopotential at the surface |
---|
| 42 | REAL,INTENT(IN) :: pk(ip1jmp1,llm) ! Exner at mid-layer |
---|
| 43 | REAL,INTENT(IN) :: pkf(ip1jmp1,llm) ! filtered Exner |
---|
| 44 | REAL,INTENT(IN) :: tsurpk(ip1jmp1,llm) ! cpp * temperature / pk |
---|
| 45 | REAL,INTENT(IN) :: phi(ip1jmp1,llm) ! geopotential |
---|
| 46 | REAL,INTENT(OUT) :: masse(ip1jmp1,llm) ! air mass |
---|
| 47 | REAL,INTENT(OUT) :: dv(ip1jm,llm) ! tendency on vcov |
---|
| 48 | REAL,INTENT(OUT) :: du(ip1jmp1,llm) ! tendency on ucov |
---|
| 49 | REAL,INTENT(OUT) :: dteta(ip1jmp1,llm) ! tenddency on teta |
---|
| 50 | REAL,INTENT(OUT) :: dp(ip1jmp1) ! tendency on ps |
---|
| 51 | REAL,INTENT(OUT) :: w(ip1jmp1,llm) ! vertical velocity |
---|
| 52 | REAL,INTENT(OUT) :: pbaru(ip1jmp1,llm) ! mass flux in the zonal direction |
---|
| 53 | REAL,INTENT(OUT) :: pbarv(ip1jm,llm) ! mass flux in the meridional direction |
---|
| 54 | REAL,INTENT(IN) :: time ! current time |
---|
[1] | 55 | |
---|
[1189] | 56 | ! Local: |
---|
| 57 | ! ------ |
---|
| 58 | |
---|
[1] | 59 | REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
| 60 | REAL ang(ip1jmp1,llm),p(ip1jmp1,llmp1) |
---|
| 61 | REAL massebx(ip1jmp1,llm),masseby(ip1jm,llm),psexbarxy(ip1jm) |
---|
| 62 | REAL vorpot(ip1jm,llm) |
---|
[1189] | 63 | REAL ecin(ip1jmp1,llm),convm(ip1jmp1,llm) |
---|
[1] | 64 | REAL bern(ip1jmp1,llm) |
---|
| 65 | REAL massebxy(ip1jm,llm) |
---|
[5] | 66 | REAL temp(ip1jmp1,llm) |
---|
[1] | 67 | |
---|
| 68 | INTEGER ij,l |
---|
| 69 | |
---|
[1189] | 70 | !----------------------------------------------------------------------- |
---|
| 71 | ! Compute dynamical tendencies: |
---|
| 72 | !-------------------------------- |
---|
[1] | 73 | |
---|
[1189] | 74 | ! compute contravariant winds ucont() and vcont |
---|
[1] | 75 | CALL covcont ( llm , ucov , vcov , ucont, vcont ) |
---|
[1189] | 76 | ! compute pressure p() |
---|
[1] | 77 | CALL pression ( ip1jmp1, ap , bp , ps , p ) |
---|
[1189] | 78 | ! compute psexbarxy() XY-area weighted-averaged surface pressure (what for?) |
---|
[1] | 79 | CALL psextbar ( ps , psexbarxy ) |
---|
[1189] | 80 | ! compute mass in each atmospheric mesh: masse() |
---|
[1] | 81 | CALL massdair ( p , masse ) |
---|
[1189] | 82 | ! compute X and Y-averages of mass, massebx() and masseby() |
---|
[1] | 83 | CALL massbar ( masse, massebx , masseby ) |
---|
[1189] | 84 | ! compute XY-average of mass, massebxy() |
---|
[1] | 85 | call massbarxy( masse, massebxy ) |
---|
[1189] | 86 | ! compute mass fluxes pbaru() and pbarv() |
---|
[1] | 87 | CALL flumass ( massebx, masseby , vcont, ucont ,pbaru, pbarv ) |
---|
[1189] | 88 | ! compute dteta() , horizontal converging flux of theta |
---|
[1] | 89 | CALL dteta1 ( teta , pbaru , pbarv, dteta ) |
---|
[1189] | 90 | ! compute convm(), horizontal converging flux of mass |
---|
[1] | 91 | CALL convmas ( pbaru, pbarv , convm ) |
---|
| 92 | |
---|
[1189] | 93 | ! compute pressure variation due to mass convergence |
---|
[1] | 94 | DO ij =1, ip1jmp1 |
---|
| 95 | dp( ij ) = convm( ij,1 ) / airesurg( ij ) |
---|
| 96 | ENDDO |
---|
| 97 | |
---|
[1189] | 98 | ! compute vertical velocity w() |
---|
[1] | 99 | CALL vitvert ( convm , w ) |
---|
[1189] | 100 | ! compute potential vorticity vorpot() |
---|
[1] | 101 | CALL tourpot ( vcov , ucov , massebxy , vorpot ) |
---|
[1189] | 102 | ! compute rotation induced du() and dv() |
---|
[1] | 103 | CALL dudv1 ( vorpot , pbaru , pbarv , du , dv ) |
---|
[1189] | 104 | ! compute kinetic energy ecin() |
---|
[1] | 105 | CALL enercin ( vcov , ucov , vcont , ucont , ecin ) |
---|
[1189] | 106 | ! compute Bernouilli function bern() |
---|
[1] | 107 | CALL bernoui ( ip1jmp1, llm , phi , ecin , bern ) |
---|
[1189] | 108 | ! compute and add du() and dv() contributions from Bernouilli and pressure |
---|
[5] | 109 | CALL dudv2 ( tsurpk , pkf , bern , du , dv ) |
---|
[1] | 110 | |
---|
| 111 | |
---|
| 112 | DO l=1,llm |
---|
| 113 | DO ij=1,ip1jmp1 |
---|
| 114 | ang(ij,l) = ucov(ij,l) + constang(ij) |
---|
| 115 | ENDDO |
---|
| 116 | ENDDO |
---|
| 117 | |
---|
[1189] | 118 | ! compute vertical advection contributions to du(), dv() and dteta() |
---|
[1] | 119 | CALL advect( ang, vcov, teta, w, massebx, masseby, du, dv,dteta ) |
---|
| 120 | |
---|
[1189] | 121 | ! WARNING probleme de peridocite de dv sur les PC/linux. Pb d'arrondi |
---|
| 122 | ! probablement. Observe sur le code compile avec pgf90 3.0-1 |
---|
[1] | 123 | |
---|
| 124 | DO l = 1, llm |
---|
| 125 | DO ij = 1, ip1jm, iip1 |
---|
| 126 | IF( dv(ij,l).NE.dv(ij+iim,l) ) THEN |
---|
[1189] | 127 | ! PRINT *,'!!!ATTENTION!!! probleme de periodicite sur vcov', |
---|
| 128 | ! , ' dans caldyn' |
---|
| 129 | ! PRINT *,' l, ij = ', l, ij, ij+iim,dv(ij+iim,l),dv(ij,l) |
---|
[1] | 130 | dv(ij+iim,l) = dv(ij,l) |
---|
| 131 | endif |
---|
| 132 | enddo |
---|
| 133 | enddo |
---|
| 134 | |
---|
[1189] | 135 | !----------------------------------------------------------------------- |
---|
| 136 | ! Output some control variables: |
---|
| 137 | !--------------------------------- |
---|
| 138 | |
---|
[1] | 139 | IF( conser ) THEN |
---|
| 140 | CALL sortvarc |
---|
[5] | 141 | $ (itau,ucov,tsurpk,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov) |
---|
[1] | 142 | |
---|
| 143 | ENDIF |
---|
| 144 | |
---|
| 145 | END |
---|