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