[2291] | 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, only : klon,klev |
---|
[2366] | 12 | use comchem_h, only: nkim |
---|
| 13 | USE callkeys_mod, only: callchim |
---|
[2291] | 14 | USE comsoil_h, only : nsoilmx |
---|
| 15 | use comsaison_h, only: mu0, fract |
---|
| 16 | use radcommon_h, only: gzlat, gzlat_ig, Cmk |
---|
| 17 | USE radinc_h, only : L_NSPECTI, L_NSPECTV,naerkind |
---|
[2366] | 18 | use surfdat_h, only: phisfi, albedodat, & |
---|
| 19 | zmea, zstd, zsig, zgam, zthe |
---|
[2291] | 20 | use turb_mod, only: q2,sensibFlux,wstar,ustar,tstar,hfmax_th,zmax_th |
---|
| 21 | |
---|
[2366] | 22 | real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K) |
---|
| 23 | ! Useful for Dynamical Heating calculation. |
---|
| 24 | real,allocatable,dimension(:,:),save :: zuprevious |
---|
| 25 | !$OMP THREADPRIVATE(ztprevious,zuprevious) |
---|
[2291] | 26 | |
---|
| 27 | real, dimension(:),allocatable,save :: tsurf ! Surface temperature (K). |
---|
| 28 | real, dimension(:,:),allocatable,save :: tsoil ! Sub-surface temperatures (K). |
---|
| 29 | real, dimension(:,:),allocatable,save :: albedo ! Surface Spectral albedo. By MT2015. |
---|
| 30 | real, dimension(:),allocatable,save :: albedo_equivalent ! Spectral Mean albedo. |
---|
| 31 | |
---|
[2292] | 32 | !$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent) |
---|
| 33 | |
---|
[2291] | 34 | real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015. |
---|
| 35 | |
---|
[2292] | 36 | !$OMP THREADPRIVATE(albedo_bareground) |
---|
| 37 | |
---|
[2291] | 38 | real, dimension(:), allocatable, save :: tankCH4 ! Depth of surface methane tank (m) |
---|
[2292] | 39 | !$OMP THREADPRIVATE(tankCH4) |
---|
[2291] | 40 | |
---|
| 41 | real,dimension(:),allocatable,save :: emis ! Thermal IR surface emissivity. |
---|
| 42 | real,dimension(:,:),allocatable,save :: dtrad ! Net atmospheric radiative heating rate (K.s-1). |
---|
| 43 | real,dimension(:),allocatable,save :: fluxrad_sky ! Radiative flux from sky absorbed by surface (W.m-2). |
---|
| 44 | real,dimension(:),allocatable,save :: fluxrad ! Net radiative surface flux (W.m-2). |
---|
| 45 | real,dimension(:),allocatable,save :: capcal ! Surface heat capacity (J m-2 K-1). |
---|
| 46 | real,dimension(:),allocatable,save :: fluxgrd ! Surface conduction flux (W.m-2). |
---|
| 47 | real,dimension(:,:),allocatable,save :: qsurf ! Tracer on surface (e.g. kg.m-2). |
---|
[2793] | 48 | !$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf) |
---|
[2292] | 49 | |
---|
[2291] | 50 | ! FOR DIAGNOSTIC : |
---|
| 51 | |
---|
| 52 | real,dimension(:),allocatable,save :: fluxsurf_lw ! Incident Long Wave (IR) surface flux (W.m-2). |
---|
| 53 | real,dimension(:),allocatable,save :: fluxsurf_sw ! Incident Short Wave (stellar) surface flux (W.m-2). |
---|
| 54 | real,dimension(:),allocatable,save :: fluxsurfabs_sw ! Absorbed Short Wave (stellar) flux by the surface (W.m-2). |
---|
[2366] | 55 | !$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw) |
---|
[2291] | 56 | |
---|
| 57 | real,dimension(:),allocatable,save :: fluxtop_lw ! Outgoing LW (IR) flux to space (W.m-2). |
---|
| 58 | real,dimension(:),allocatable,save :: fluxabs_sw ! Absorbed SW (stellar) flux (W.m-2). |
---|
| 59 | real,dimension(:),allocatable,save :: fluxtop_dn ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2). |
---|
| 60 | real,dimension(:),allocatable,save :: fluxdyn ! Horizontal heat transport by dynamics (W.m-2). |
---|
[2366] | 61 | !$OMP THREADPRIVATE(fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn) |
---|
[2291] | 62 | |
---|
| 63 | real,dimension(:,:),allocatable,save :: OLR_nu ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)). |
---|
| 64 | real,dimension(:,:),allocatable,save :: OSR_nu ! Outgoing SW radiation in each band (Normalized to the band width (W/m2/cm-1)). |
---|
| 65 | real,dimension(:,:),allocatable,save :: zdtlw ! LW heating tendencies (K/s). |
---|
| 66 | real,dimension(:,:),allocatable,save :: zdtsw ! SW heating tendencies (K/s). |
---|
| 67 | !real,dimension(:),allocatable,save :: sensibFlux ! Turbulent flux given by the atmosphere to the surface (W.m-2). |
---|
[2366] | 68 | !$OMP THREADPRIVATE(OLR_nu,OSR_nu,zdtlw,zdtsw) |
---|
| 69 | |
---|
[2291] | 70 | real,dimension(:,:,:),allocatable,save :: int_dtauv ! VI optical thickness of layers within narrowbands for diags (). |
---|
| 71 | real,dimension(:,:,:),allocatable,save :: int_dtaui ! IR optical thickness of layers within narrowbands for diags (). |
---|
[2366] | 72 | !$OMP THREADPRIVATE(int_dtaui,int_dtauv) |
---|
[2291] | 73 | |
---|
[3083] | 74 | real,dimension(:,:,:,:),allocatable,save :: zpopthi ! IR optical properties of haze within narrowbands for diags (dtau,tau,k,wbar,gbar). |
---|
| 75 | real,dimension(:,:,:,:),allocatable,save :: zpopthv ! VI optical properties of haze within narrowbands for diags (dtau,tau,k,wbar,gbar). |
---|
| 76 | real,dimension(:,:,:,:),allocatable,save :: zpoptci ! IR optical properties of clouds within narrowbands for diags (dtau,tau,k,wbar,gbar). |
---|
| 77 | real,dimension(:,:,:,:),allocatable,save :: zpoptcv ! VI optical properties of clouds within narrowbands for diags (dtau,tau,k,wbar,gbar). |
---|
| 78 | !$OMP THREADPRIVATE(zpopthi,zpopthv,zpoptci,zpoptcv) |
---|
| 79 | |
---|
| 80 | real,dimension(:,:),allocatable,save :: u_ref ! Reference profile for the zonal wind nudging (m.s-1). |
---|
| 81 | !$OMP THREADPRIVATE(u_ref) |
---|
| 82 | |
---|
[2291] | 83 | real,allocatable,dimension(:,:),save :: qsurf_hist |
---|
[2292] | 84 | !$OMP THREADPRIVATE(qsurf_hist) |
---|
[2366] | 85 | |
---|
| 86 | ! For chemistry |
---|
| 87 | real, dimension(:,:,:), allocatable, save :: dycchi ! NB : Only for chem tracers. Saved since chemistry is not called every step. |
---|
| 88 | !$OMP THREADPRIVATE(dycchi) |
---|
[2291] | 89 | |
---|
| 90 | CONTAINS |
---|
| 91 | |
---|
| 92 | !====================================================================== |
---|
| 93 | SUBROUTINE phys_state_var_init(nqtot) |
---|
| 94 | |
---|
| 95 | IMPLICIT NONE |
---|
| 96 | |
---|
| 97 | integer,intent(in) :: nqtot |
---|
| 98 | |
---|
| 99 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
| 100 | ! |
---|
| 101 | !zmea(:) ! orographie moyenne |
---|
| 102 | !zstd(:) ! deviation standard de l'OESM |
---|
| 103 | !zsig(:) ! pente de l'OESM |
---|
| 104 | !zgam(:) ! anisotropie de l'OESM |
---|
| 105 | !zthe(:) ! orientation de l'OESM |
---|
| 106 | !zpic(:) ! Maximum de l'OESM |
---|
| 107 | !zval(:) ! Minimum de l'OESM |
---|
| 108 | !rugoro(:) ! longueur de rugosite de l'OESM |
---|
| 109 | print*,'klon',klon,'klev',klev |
---|
| 110 | ALLOCATE(tsurf(klon)) |
---|
| 111 | ALLOCATE(tsoil(klon,nsoilmx)) |
---|
| 112 | ALLOCATE(albedo(klon,L_NSPECTV)) |
---|
| 113 | ALLOCATE(albedo_equivalent(klon)) |
---|
| 114 | ALLOCATE(albedo_bareground(klon)) |
---|
| 115 | ALLOCATE(emis(klon)) |
---|
| 116 | ALLOCATE(dtrad(klon,klev)) |
---|
| 117 | ALLOCATE(fluxrad_sky(klon)) |
---|
| 118 | ALLOCATE(fluxrad(klon)) |
---|
| 119 | ALLOCATE(capcal(klon)) |
---|
| 120 | ALLOCATE(fluxgrd(klon)) |
---|
| 121 | ALLOCATE(qsurf(klon,nqtot)) |
---|
| 122 | ALLOCATE(q2(klon,klev+1)) |
---|
| 123 | ALLOCATE(tankCH4(klon)) |
---|
| 124 | ALLOCATE(ztprevious(klon,klev)) |
---|
| 125 | ALLOCATE(zuprevious(klon,klev)) |
---|
| 126 | ALLOCATE(qsurf_hist(klon,nqtot)) |
---|
| 127 | ALLOCATE(fluxsurf_lw(klon)) |
---|
| 128 | ALLOCATE(fluxsurf_sw(klon)) |
---|
| 129 | ALLOCATE(fluxsurfabs_sw(klon)) |
---|
| 130 | ALLOCATE(fluxtop_lw(klon)) |
---|
| 131 | ALLOCATE(fluxabs_sw(klon)) |
---|
| 132 | ALLOCATE(fluxtop_dn(klon)) |
---|
| 133 | ALLOCATE(fluxdyn(klon)) |
---|
| 134 | ALLOCATE(OLR_nu(klon,L_NSPECTI)) |
---|
| 135 | ALLOCATE(OSR_nu(klon,L_NSPECTV)) |
---|
| 136 | ALLOCATE(sensibFlux(klon)) |
---|
| 137 | ALLOCATE(zdtlw(klon,klev)) |
---|
| 138 | ALLOCATE(zdtsw(klon,klev)) |
---|
| 139 | ALLOCATE(int_dtaui(klon,klev,L_NSPECTI)) |
---|
| 140 | ALLOCATE(int_dtauv(klon,klev,L_NSPECTV)) |
---|
[3083] | 141 | ALLOCATE(zpopthi(klon,klev,L_NSPECTI,5)) |
---|
| 142 | ALLOCATE(zpopthv(klon,klev,L_NSPECTV,5)) |
---|
| 143 | ALLOCATE(zpoptci(klon,klev,L_NSPECTI,5)) |
---|
| 144 | ALLOCATE(zpoptcv(klon,klev,L_NSPECTV,5)) |
---|
| 145 | ALLOCATE(u_ref(49,24)) |
---|
[2366] | 146 | allocate(dycchi(klon,klev,nkim)) |
---|
[2291] | 147 | ! This is defined in comsaison_h |
---|
| 148 | ALLOCATE(mu0(klon)) |
---|
| 149 | ALLOCATE(fract(klon)) |
---|
| 150 | ! This is defined in radcommon_h |
---|
| 151 | ALLOCATE(gzlat(klon,klev)) |
---|
[2328] | 152 | ALLOCATE(gzlat_ig(klev)) |
---|
| 153 | ALLOCATE(Cmk(klev)) |
---|
[2366] | 154 | ! This is defined in surfdat_h |
---|
| 155 | ALLOCATE(albedodat(klon)) |
---|
| 156 | ALLOCATE(phisfi(klon)) |
---|
| 157 | ALLOCATE(zmea(klon)) |
---|
| 158 | ALLOCATE(zstd(klon)) |
---|
| 159 | ALLOCATE(zsig(klon)) |
---|
| 160 | ALLOCATE(zgam(klon)) |
---|
| 161 | ALLOCATE(zthe(klon)) |
---|
[2328] | 162 | ! This is defined in turb_mod |
---|
[2291] | 163 | allocate(wstar(klon)) |
---|
| 164 | allocate(ustar(klon)) |
---|
| 165 | allocate(tstar(klon)) |
---|
| 166 | allocate(hfmax_th(klon)) |
---|
| 167 | allocate(zmax_th(klon)) |
---|
| 168 | |
---|
| 169 | END SUBROUTINE phys_state_var_init |
---|
| 170 | |
---|
| 171 | !====================================================================== |
---|
| 172 | SUBROUTINE phys_state_var_end |
---|
| 173 | |
---|
| 174 | IMPLICIT NONE |
---|
| 175 | |
---|
| 176 | DEALLOCATE(tsurf) |
---|
| 177 | DEALLOCATE(tsoil) |
---|
| 178 | DEALLOCATE(albedo) |
---|
| 179 | DEALLOCATE(albedo_equivalent) |
---|
| 180 | DEALLOCATE(albedo_bareground) |
---|
| 181 | DEALLOCATE(emis) |
---|
| 182 | DEALLOCATE(dtrad) |
---|
| 183 | DEALLOCATE(fluxrad_sky) |
---|
| 184 | DEALLOCATE(fluxrad) |
---|
| 185 | DEALLOCATE(capcal) |
---|
| 186 | DEALLOCATE(fluxgrd) |
---|
| 187 | DEALLOCATE(qsurf) |
---|
| 188 | DEALLOCATE(q2) |
---|
| 189 | DEALLOCATE(tankCH4) |
---|
| 190 | DEALLOCATE(ztprevious) |
---|
| 191 | DEALLOCATE(zuprevious) |
---|
| 192 | DEALLOCATE(qsurf_hist) |
---|
| 193 | DEALLOCATE(fluxsurf_lw) |
---|
| 194 | DEALLOCATE(fluxsurf_sw) |
---|
| 195 | DEALLOCATE(fluxsurfabs_sw) |
---|
| 196 | DEALLOCATE(fluxtop_lw) |
---|
| 197 | DEALLOCATE(fluxabs_sw) |
---|
| 198 | DEALLOCATE(fluxtop_dn) |
---|
| 199 | DEALLOCATE(fluxdyn) |
---|
| 200 | DEALLOCATE(OLR_nu) |
---|
| 201 | DEALLOCATE(OSR_nu) |
---|
| 202 | DEALLOCATE(sensibFlux) |
---|
| 203 | DEALLOCATE(zdtlw) |
---|
| 204 | DEALLOCATE(zdtsw) |
---|
| 205 | DEALLOCATE(int_dtaui) |
---|
| 206 | DEALLOCATE(int_dtauv) |
---|
[3083] | 207 | DEALLOCATE(zpopthi) |
---|
| 208 | DEALLOCATE(zpopthv) |
---|
| 209 | DEALLOCATE(zpoptci) |
---|
| 210 | DEALLOCATE(zpoptcv) |
---|
| 211 | DEALLOCATE(u_ref) |
---|
[2366] | 212 | DEALLOCATE(dycchi) |
---|
[2291] | 213 | DEALLOCATE(mu0) |
---|
| 214 | DEALLOCATE(fract) |
---|
| 215 | DEALLOCATE(gzlat) |
---|
| 216 | DEALLOCATE(gzlat_ig) |
---|
| 217 | DEALLOCATE(Cmk) |
---|
[2366] | 218 | DEALLOCATE(phisfi) |
---|
| 219 | DEALLOCATE(albedodat) |
---|
| 220 | DEALLOCATE(zmea) |
---|
| 221 | DEALLOCATE(zstd) |
---|
| 222 | DEALLOCATE(zsig) |
---|
| 223 | DEALLOCATE(zgam) |
---|
| 224 | DEALLOCATE(zthe) |
---|
[2291] | 225 | deallocate(wstar) |
---|
| 226 | deallocate(ustar) |
---|
| 227 | deallocate(tstar) |
---|
| 228 | deallocate(hfmax_th) |
---|
| 229 | deallocate(zmax_th) |
---|
| 230 | |
---|
| 231 | |
---|
| 232 | END SUBROUTINE phys_state_var_end |
---|
| 233 | |
---|
| 234 | END MODULE phys_state_var_mod |
---|