[892] | 1 | ! |
---|
| 2 | ! $Id: phys_state_var_mod.F90 1670 2012-10-17 08:42:04Z idelkadi $ |
---|
| 3 | ! |
---|
| 4 | MODULE phys_state_var_mod |
---|
| 5 | ! Variables sauvegardees pour le startphy.nc |
---|
| 6 | !====================================================================== |
---|
| 7 | ! |
---|
| 8 | ! |
---|
| 9 | !====================================================================== |
---|
| 10 | ! Declaration des variables |
---|
| 11 | USE dimphy |
---|
[1723] | 12 | USE turb_mod |
---|
[892] | 13 | ! INTEGER, SAVE :: radpas |
---|
| 14 | !!$OMP THREADPRIVATE(radpas) |
---|
| 15 | ! REAL, SAVE :: dtime |
---|
| 16 | !!$OMP THREADPRIVATE(dtime) |
---|
| 17 | |
---|
| 18 | REAL, ALLOCATABLE, SAVE :: ftsol(:) |
---|
| 19 | !$OMP THREADPRIVATE(ftsol) |
---|
| 20 | REAL, ALLOCATABLE, SAVE :: ftsoil(:,:) |
---|
| 21 | !$OMP THREADPRIVATE(ftsoil) |
---|
| 22 | REAL, ALLOCATABLE, SAVE :: falbe(:) |
---|
| 23 | !$OMP THREADPRIVATE(falbe) |
---|
| 24 | |
---|
| 25 | !clesphy0 param physiq |
---|
| 26 | ! |
---|
| 27 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
| 28 | ! |
---|
| 29 | REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:) |
---|
| 30 | !$OMP THREADPRIVATE(zmea, zstd, zsig, zgam) |
---|
| 31 | REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:) |
---|
| 32 | !$OMP THREADPRIVATE(zthe, zpic, zval) |
---|
| 33 | ! REAL tabcntr0(100) |
---|
| 34 | REAL, ALLOCATABLE, SAVE :: rugoro(:) |
---|
| 35 | !$OMP THREADPRIVATE(rugoro) |
---|
| 36 | REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:) |
---|
| 37 | !$OMP THREADPRIVATE(t_ancien, q_ancien) |
---|
| 38 | REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:) |
---|
| 39 | !$OMP THREADPRIVATE(u_ancien, v_ancien) |
---|
| 40 | LOGICAL, SAVE :: ancien_ok |
---|
| 41 | !$OMP THREADPRIVATE(ancien_ok) |
---|
| 42 | ! pressure level |
---|
| 43 | REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:) |
---|
| 44 | !$OMP THREADPRIVATE(zuthe,zvthe) |
---|
| 45 | ! |
---|
[1310] | 46 | ! composition for upper atmosphere |
---|
| 47 | REAL,ALLOCATABLE,SAVE :: co2vmr_gcm(:,:) |
---|
| 48 | !$OMP THREADPRIVATE(co2vmr_gcm) |
---|
| 49 | REAL,ALLOCATABLE,SAVE :: ovmr_gcm(:,:) |
---|
| 50 | !$OMP THREADPRIVATE(ovmr_gcm) |
---|
| 51 | REAL,ALLOCATABLE,SAVE :: n2vmr_gcm(:,:) |
---|
| 52 | !$OMP THREADPRIVATE(n2vmr_gcm) |
---|
| 53 | REAL,ALLOCATABLE,SAVE :: nvmr_gcm(:,:) |
---|
| 54 | !$OMP THREADPRIVATE(nvmr_gcm) |
---|
| 55 | REAL,ALLOCATABLE,SAVE :: covmr_gcm(:,:) |
---|
| 56 | !$OMP THREADPRIVATE(covmr_gcm) |
---|
| 57 | |
---|
[2192] | 58 | ! photochemistry and microphysics |
---|
| 59 | REAL,ALLOCATABLE,SAVE :: d_tr_chem(:,:,:), d_tr_sed(:,:,:) |
---|
| 60 | !$OMP THREADPRIVATE(d_tr_chem,d_tr_sed) |
---|
| 61 | INTEGER,ALLOCATABLE,SAVE :: iter(:,:) |
---|
| 62 | !$OMP THREADPRIVATE(iter) |
---|
| 63 | |
---|
[1310] | 64 | ! Tendencies due to radiative scheme [K/s] |
---|
[892] | 65 | ! heat : chauffage solaire |
---|
| 66 | ! heat0: chauffage solaire ciel clair |
---|
| 67 | ! cool : refroidissement infrarouge |
---|
| 68 | ! cool0 : refroidissement infrarouge ciel clair |
---|
[1310] | 69 | REAL,ALLOCATABLE,SAVE :: heat(:,:) |
---|
| 70 | !$OMP THREADPRIVATE(heat) |
---|
| 71 | REAL,ALLOCATABLE,SAVE :: heat0(:,:) |
---|
| 72 | !$OMP THREADPRIVATE(heat0) |
---|
| 73 | REAL,ALLOCATABLE,SAVE :: cool(:,:) |
---|
| 74 | !$OMP THREADPRIVATE(cool) |
---|
| 75 | REAL,ALLOCATABLE,SAVE :: cool0(:,:) |
---|
| 76 | !$OMP THREADPRIVATE(cool0) |
---|
| 77 | REAL,ALLOCATABLE,SAVE :: dtsw(:,:) |
---|
| 78 | !$OMP THREADPRIVATE(dtsw) |
---|
| 79 | REAL,ALLOCATABLE,SAVE :: dtlw(:,:) |
---|
| 80 | !$OMP THREADPRIVATE(dtlw) |
---|
| 81 | REAL,ALLOCATABLE,SAVE :: d_t_rad(:,:),d_t_euv(:,:) |
---|
| 82 | !$OMP THREADPRIVATE(d_t_rad,d_t_euv) |
---|
| 83 | REAL,ALLOCATABLE,SAVE :: d_t_nirco2(:,:),d_t_nlte(:,:) |
---|
| 84 | !$OMP THREADPRIVATE(d_t_nirco2,d_t_nlte) |
---|
| 85 | |
---|
[2135] | 86 | ! Case for Newtonian cooling (physideal=.true.) |
---|
| 87 | REAL,ALLOCATABLE,SAVE :: zt_eq(:,:) |
---|
| 88 | !$OMP THREADPRIVATE(zt_eq) |
---|
| 89 | |
---|
[1310] | 90 | ! Fluxes (W/m2) |
---|
[892] | 91 | ! sollwdown : downward LW flux at surface |
---|
| 92 | ! sollwdownclr : downward CS LW flux at surface |
---|
| 93 | ! toplwdown : downward CS LW flux at TOA |
---|
| 94 | ! toplwdownclr : downward CS LW flux at TOA |
---|
| 95 | REAL,ALLOCATABLE,SAVE :: swnet(:,:) |
---|
| 96 | !$OMP THREADPRIVATE(swnet) |
---|
| 97 | REAL,ALLOCATABLE,SAVE :: lwnet(:,:) |
---|
| 98 | !$OMP THREADPRIVATE(lwnet) |
---|
| 99 | REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:) |
---|
| 100 | !$OMP THREADPRIVATE(topsw,toplw) |
---|
| 101 | REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:) |
---|
| 102 | !$OMP THREADPRIVATE(solsw, sollw) |
---|
| 103 | REAL, ALLOCATABLE, SAVE :: radsol(:) |
---|
| 104 | !$OMP THREADPRIVATE(radsol) |
---|
| 105 | REAL,ALLOCATABLE,SAVE :: sollwdown(:) |
---|
| 106 | !$OMP THREADPRIVATE(sollwdown) |
---|
| 107 | REAL,ALLOCATABLE,SAVE :: sollwdownclr(:) |
---|
| 108 | !$OMP THREADPRIVATE(sollwdownclr) |
---|
| 109 | REAL,ALLOCATABLE,SAVE :: toplwdown(:) |
---|
| 110 | !$OMP THREADPRIVATE(toplwdown) |
---|
| 111 | REAL,ALLOCATABLE,SAVE :: toplwdownclr(:) |
---|
| 112 | !$OMP THREADPRIVATE(toplwdownclr) |
---|
| 113 | REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:) |
---|
| 114 | !$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0) |
---|
| 115 | REAL,save,allocatable :: dlw(:) ! derivee infra rouge |
---|
| 116 | REAL,save,allocatable :: fder(:) ! Derive de flux (sensible et latente) |
---|
| 117 | !$OMP THREADPRIVATE(dlw,fder) |
---|
| 118 | CONTAINS |
---|
| 119 | |
---|
| 120 | !====================================================================== |
---|
[2193] | 121 | SUBROUTINE phys_state_var_init(nqmax) |
---|
[1525] | 122 | |
---|
[892] | 123 | IMPLICIT NONE |
---|
| 124 | #include "dimsoil.h" |
---|
| 125 | |
---|
[2193] | 126 | integer :: nqmax |
---|
| 127 | |
---|
[892] | 128 | ALLOCATE(ftsol(klon)) ! temperature de surface |
---|
| 129 | ALLOCATE(ftsoil(klon,nsoilmx)) ! temperature dans le sol |
---|
| 130 | ALLOCATE(falbe(klon)) ! albedo |
---|
| 131 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
| 132 | ! |
---|
| 133 | !zmea(:) ! orographie moyenne |
---|
| 134 | !zstd(:) ! deviation standard de l'OESM |
---|
| 135 | !zsig(:) ! pente de l'OESM |
---|
| 136 | !zgam(:) ! anisotropie de l'OESM |
---|
| 137 | !zthe(:) ! orientation de l'OESM |
---|
| 138 | !zpic(:) ! Maximum de l'OESM |
---|
| 139 | !zval(:) ! Minimum de l'OESM |
---|
| 140 | !rugoro(:) ! longueur de rugosite de l'OESM |
---|
| 141 | ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon)) |
---|
| 142 | ALLOCATE(zthe(klon), zpic(klon), zval(klon)) |
---|
| 143 | ALLOCATE(rugoro(klon)) |
---|
| 144 | |
---|
| 145 | ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev)) |
---|
| 146 | ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev)) |
---|
| 147 | |
---|
| 148 | ALLOCATE(zuthe(klon),zvthe(klon)) |
---|
[1314] | 149 | |
---|
| 150 | ALLOCATE(ovmr_gcm(klon,klev),covmr_gcm(klon,klev)) |
---|
| 151 | ALLOCATE(co2vmr_gcm(klon,klev),n2vmr_gcm(klon,klev)) |
---|
| 152 | ALLOCATE(nvmr_gcm(klon,klev)) |
---|
| 153 | |
---|
[2192] | 154 | ALLOCATE(d_tr_chem(klon,klev,nqmax),d_tr_sed(klon,klev,nqmax)) |
---|
| 155 | ALLOCATE(iter(klon,klev)) |
---|
| 156 | |
---|
[892] | 157 | ALLOCATE(heat(klon,klev), heat0(klon,klev)) |
---|
| 158 | ALLOCATE(cool(klon,klev), cool0(klon,klev)) |
---|
[1310] | 159 | ALLOCATE(dtlw(klon,klev),dtsw(klon,klev)) |
---|
| 160 | ALLOCATE(d_t_rad(klon,klev),d_t_euv(klon,klev)) |
---|
| 161 | ALLOCATE(d_t_nirco2(klon,klev),d_t_nlte(klon,klev)) |
---|
[2135] | 162 | ALLOCATE(zt_eq(klon,klev)) |
---|
[1310] | 163 | |
---|
| 164 | ALLOCATE(swnet(klon,klev+1), lwnet(klon,klev+1)) |
---|
[892] | 165 | ALLOCATE(topsw(klon), toplw(klon)) |
---|
| 166 | ALLOCATE(solsw(klon), sollw(klon)) |
---|
| 167 | ALLOCATE(radsol(klon)) ! bilan radiatif au sol calcule par code radiatif |
---|
| 168 | ALLOCATE(sollwdown(klon), sollwdownclr(klon)) |
---|
| 169 | ALLOCATE(toplwdown(klon), toplwdownclr(klon)) |
---|
| 170 | ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon)) |
---|
| 171 | ALLOCATE(dlw(klon), fder(klon)) |
---|
[1723] | 172 | allocate(sens(klon)) |
---|
| 173 | allocate(q2(klon,klev+1)) |
---|
| 174 | allocate(l0(klon)) |
---|
| 175 | allocate(wstar(klon)) |
---|
| 176 | allocate(yustar(klon)) |
---|
| 177 | allocate(tstar(klon)) |
---|
| 178 | allocate(hfmax_th(klon)) |
---|
| 179 | allocate(zmax_th(klon)) |
---|
| 180 | |
---|
[892] | 181 | END SUBROUTINE phys_state_var_init |
---|
| 182 | |
---|
| 183 | !====================================================================== |
---|
| 184 | SUBROUTINE phys_state_var_end |
---|
[1525] | 185 | |
---|
[892] | 186 | IMPLICIT NONE |
---|
| 187 | |
---|
[901] | 188 | deallocate(ftsol, ftsoil, falbe) |
---|
[892] | 189 | deallocate(zmea, zstd, zsig, zgam) |
---|
| 190 | deallocate(zthe, zpic, zval) |
---|
| 191 | deallocate(rugoro, t_ancien, q_ancien) |
---|
| 192 | deallocate( u_ancien, v_ancien) |
---|
| 193 | deallocate(zuthe, zvthe) |
---|
[1310] | 194 | |
---|
[1314] | 195 | deallocate(ovmr_gcm,covmr_gcm) |
---|
| 196 | deallocate(co2vmr_gcm,n2vmr_gcm) |
---|
| 197 | deallocate(nvmr_gcm) |
---|
| 198 | |
---|
[2192] | 199 | deallocate(d_tr_chem,d_tr_sed) |
---|
| 200 | deallocate(iter) |
---|
| 201 | |
---|
[892] | 202 | deallocate(heat, heat0) |
---|
| 203 | deallocate(cool, cool0) |
---|
[1310] | 204 | deallocate(dtlw,dtsw) |
---|
| 205 | deallocate(d_t_rad,d_t_euv) |
---|
| 206 | deallocate(d_t_nirco2,d_t_nlte) |
---|
[2135] | 207 | deallocate(zt_eq) |
---|
[1310] | 208 | |
---|
| 209 | deallocate(swnet, lwnet) |
---|
[892] | 210 | deallocate(solsw, sollw, radsol) |
---|
| 211 | deallocate(topsw, toplw) |
---|
| 212 | deallocate(sollwdown, sollwdownclr) |
---|
| 213 | deallocate(toplwdown, toplwdownclr) |
---|
| 214 | deallocate(topsw0,toplw0,solsw0,sollw0) |
---|
| 215 | deallocate(dlw, fder) |
---|
[1723] | 216 | deallocate(sens) |
---|
| 217 | deallocate(q2) |
---|
| 218 | deallocate(l0) |
---|
| 219 | deallocate(wstar) |
---|
| 220 | deallocate(yustar) |
---|
| 221 | deallocate(tstar) |
---|
| 222 | deallocate(hfmax_th) |
---|
| 223 | deallocate(zmax_th) |
---|
[892] | 224 | END SUBROUTINE phys_state_var_end |
---|
| 225 | |
---|
| 226 | END MODULE phys_state_var_mod |
---|