[3940] | 1 | ! $Id: phyetat0.F90 3890 2021-05-05 15:15:06Z jyg $ |
---|
[3927] | 2 | |
---|
[4358] | 3 | MODULE phyetat0_mod |
---|
| 4 | |
---|
| 5 | PRIVATE |
---|
[4367] | 6 | PUBLIC :: phyetat0 |
---|
[4358] | 7 | |
---|
| 8 | CONTAINS |
---|
| 9 | |
---|
[3927] | 10 | SUBROUTINE phyetat0 (fichnom, clesphy0, tabcntr0) |
---|
| 11 | |
---|
| 12 | USE dimphy, only: klon, zmasq, klev |
---|
| 13 | USE iophy, ONLY : init_iophy_new |
---|
| 14 | USE ocean_cpl_mod, ONLY : ocean_cpl_init |
---|
| 15 | USE fonte_neige_mod, ONLY : fonte_neige_init |
---|
| 16 | USE pbl_surface_mod, ONLY : pbl_surface_init |
---|
| 17 | #ifdef ISO |
---|
| 18 | USE fonte_neige_mod, ONLY : fonte_neige_init_iso |
---|
| 19 | USE pbl_surface_mod, ONLY : pbl_surface_init_iso |
---|
| 20 | #endif |
---|
[4367] | 21 | USE phyetat0_get_mod, ONLY : phyetat0_get, phyetat0_srf |
---|
[3927] | 22 | USE surface_data, ONLY : type_ocean, version_ocean |
---|
| 23 | USE phys_state_var_mod, ONLY : ancien_ok, clwcon, detr_therm, phys_tstep, & |
---|
| 24 | qsol, fevap, z0m, z0h, agesno, & |
---|
| 25 | du_gwd_rando, du_gwd_front, entr_therm, f0, fm_therm, & |
---|
[4727] | 26 | falb_dir, falb_dif, prw_ancien, prlw_ancien, prsw_ancien, prbsw_ancien, & |
---|
| 27 | ftsol, pbl_tke, pctsrf, q_ancien, ql_ancien, qs_ancien, qbs_ancien, rneb_ancien, radpas, radsol, rain_fall, ratqs, & |
---|
| 28 | rnebcon, rugoro, sig1, snow_fall, bs_fall, solaire_etat0, sollw, sollwdown, & |
---|
[3940] | 29 | solsw, solswfdiff, t_ancien, u_ancien, v_ancien, w01, wake_cstar, wake_deltaq, & |
---|
| 30 | wake_deltat, wake_delta_pbl_TKE, delta_tsurf, beta_aridity, wake_fip, wake_pe, & |
---|
[4040] | 31 | wake_s, wake_dens, awake_dens, cv_gen, zgam, zmax0, zmea, zpic, zsig, & |
---|
[3927] | 32 | #ifdef ISO |
---|
| 33 | fxtevap, xtsol, xt_ancien, xtl_ancien, xts_ancien, wake_deltaxt, & |
---|
| 34 | xtrain_fall,xtsnow_fall, & |
---|
| 35 | #endif |
---|
| 36 | zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m, treedrg, & |
---|
[4374] | 37 | ale_wake, ale_bl_stat, ds_ns, dt_ns, delta_sst, delta_sal, dter, dser, & |
---|
[4727] | 38 | dt_ds, ratqs_inter_ |
---|
[3927] | 39 | !FC |
---|
[4056] | 40 | USE geometry_mod, ONLY: longitude_deg, latitude_deg |
---|
| 41 | USE iostart, ONLY: close_startphy, get_field, get_var, open_startphy |
---|
[4389] | 42 | USE infotrac_phy, ONLY: nqtot, nbtr, type_trac, tracers |
---|
[4358] | 43 | USE readTracFiles_mod,ONLY: maxlen, new2oldH2O |
---|
[4056] | 44 | USE traclmdz_mod, ONLY: traclmdz_from_restart |
---|
[4298] | 45 | USE carbon_cycle_mod, ONLY: carbon_cycle_init, carbon_cycle_cpl, carbon_cycle_tr, carbon_cycle_rad, co2_send, RCO2_glo |
---|
[4056] | 46 | USE indice_sol_mod, ONLY: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic |
---|
| 47 | USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, ocean_slab_init |
---|
[3927] | 48 | USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy |
---|
[4727] | 49 | USE wxios, ONLY: missing_val_xios => missing_val, using_xios |
---|
| 50 | use netcdf, only: nf90_fill_real |
---|
[3940] | 51 | use config_ocean_skin_m, only: activate_ocean_skin |
---|
[3927] | 52 | #ifdef ISO |
---|
[4050] | 53 | USE infotrac_phy, ONLY: niso |
---|
[3927] | 54 | USE isotopes_routines_mod, ONLY: phyisoetat0 |
---|
| 55 | USE isotopes_mod, ONLY: iso_eau |
---|
| 56 | #ifdef ISOVERIF |
---|
| 57 | USE isotopes_verif_mod, ONLY: iso_verif_egalite_vect2D,iso_verif_egalite |
---|
| 58 | #endif |
---|
| 59 | #endif |
---|
| 60 | |
---|
| 61 | IMPLICIT none |
---|
| 62 | !====================================================================== |
---|
| 63 | ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 |
---|
| 64 | ! Objet: Lecture de l'etat initial pour la physique |
---|
| 65 | !====================================================================== |
---|
| 66 | include "dimsoil.h" |
---|
| 67 | include "clesphys.h" |
---|
[4089] | 68 | include "alpale.h" |
---|
[3927] | 69 | include "compbl.h" |
---|
| 70 | include "YOMCST.h" |
---|
| 71 | !====================================================================== |
---|
| 72 | CHARACTER*(*) fichnom |
---|
| 73 | |
---|
| 74 | ! les variables globales lues dans le fichier restart |
---|
| 75 | |
---|
| 76 | REAL tsoil(klon, nsoilmx, nbsrf) |
---|
| 77 | REAL qsurf(klon, nbsrf) |
---|
| 78 | REAL snow(klon, nbsrf) |
---|
| 79 | real fder(klon) |
---|
| 80 | REAL run_off_lic_0(klon) |
---|
| 81 | REAL fractint(klon) |
---|
| 82 | REAL trs(klon, nbtr) |
---|
| 83 | REAL zts(klon) |
---|
| 84 | ! pour drag arbres FC |
---|
| 85 | REAL drg_ter(klon,klev) |
---|
| 86 | |
---|
| 87 | CHARACTER*6 ocean_in |
---|
| 88 | LOGICAL ok_veget_in |
---|
| 89 | |
---|
| 90 | INTEGER longcles |
---|
| 91 | PARAMETER ( longcles = 20 ) |
---|
| 92 | REAL clesphy0( longcles ) |
---|
| 93 | |
---|
| 94 | REAL xmin, xmax |
---|
| 95 | |
---|
| 96 | INTEGER nid, nvarid |
---|
| 97 | INTEGER ierr, i, nsrf, isoil , k |
---|
| 98 | INTEGER length |
---|
| 99 | PARAMETER (length=100) |
---|
[4056] | 100 | INTEGER it, iq, isw |
---|
[3927] | 101 | REAL tab_cntrl(length), tabcntr0(length) |
---|
| 102 | CHARACTER*7 str7 |
---|
| 103 | CHARACTER*2 str2 |
---|
[4358] | 104 | LOGICAL :: found |
---|
[3927] | 105 | REAL :: lon_startphy(klon), lat_startphy(klon) |
---|
[4358] | 106 | CHARACTER(LEN=maxlen) :: tname, t(2) |
---|
[4727] | 107 | REAL :: missing_val |
---|
[3927] | 108 | #ifdef ISO |
---|
| 109 | REAL xtsnow(niso,klon, nbsrf) |
---|
| 110 | REAL xtrun_off_lic_0(niso,klon) |
---|
| 111 | REAL Rland_ice(niso,klon) |
---|
| 112 | #endif |
---|
| 113 | ! FH1D |
---|
| 114 | ! real iolat(jjm+1) |
---|
| 115 | !real iolat(jjm+1-1/(iim*jjm)) |
---|
| 116 | |
---|
| 117 | ! Ouvrir le fichier contenant l'etat initial: |
---|
[4727] | 118 | IF (using_xios) THEN |
---|
| 119 | missing_val = missing_val_xios |
---|
| 120 | ELSE |
---|
| 121 | missing_val = nf90_fill_real |
---|
| 122 | ENDIF |
---|
[3927] | 123 | |
---|
| 124 | CALL open_startphy(fichnom) |
---|
| 125 | |
---|
| 126 | ! Lecture des parametres de controle: |
---|
| 127 | |
---|
| 128 | CALL get_var("controle", tab_cntrl) |
---|
| 129 | |
---|
| 130 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 131 | ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique |
---|
| 132 | ! Les constantes de la physiques sont lues dans la physique seulement. |
---|
| 133 | ! Les egalites du type |
---|
| 134 | ! tab_cntrl( 5 )=clesphy0(1) |
---|
| 135 | ! sont remplacees par |
---|
| 136 | ! clesphy0(1)=tab_cntrl( 5 ) |
---|
| 137 | ! On inverse aussi la logique. |
---|
| 138 | ! On remplit les tab_cntrl avec les parametres lus dans les .def |
---|
| 139 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 140 | |
---|
| 141 | DO i = 1, length |
---|
| 142 | tabcntr0( i ) = tab_cntrl( i ) |
---|
| 143 | ENDDO |
---|
| 144 | |
---|
| 145 | tab_cntrl(1)=pdtphys |
---|
| 146 | tab_cntrl(2)=radpas |
---|
| 147 | |
---|
| 148 | ! co2_ppm : value from the previous time step |
---|
[4298] | 149 | |
---|
| 150 | ! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def) |
---|
| 151 | co2_ppm0 = 284.32 |
---|
| 152 | ! when no initial value is available e.g., from a restart |
---|
| 153 | ! this variable must be set in a .def file which will then be |
---|
| 154 | ! used by the conf_phys_m.F90 routine. |
---|
| 155 | ! co2_ppm0 = 284.32 (illustrative example on how to set the variable in .def |
---|
| 156 | ! file, for a pre-industrial CO2 concentration value) |
---|
| 157 | |
---|
[3927] | 158 | IF (carbon_cycle_tr .OR. carbon_cycle_cpl) THEN |
---|
| 159 | co2_ppm = tab_cntrl(3) |
---|
| 160 | RCO2 = co2_ppm * 1.0e-06 * RMCO2 / RMD |
---|
[4298] | 161 | IF (tab_cntrl(17) > 0. .AND. carbon_cycle_rad) THEN |
---|
| 162 | RCO2_glo = tab_cntrl(17) |
---|
| 163 | ELSE |
---|
| 164 | RCO2_glo = co2_ppm0 * 1.0e-06 * RMCO2 / RMD |
---|
| 165 | ENDIF |
---|
[3927] | 166 | ! ELSE : keep value from .def |
---|
| 167 | ENDIF |
---|
| 168 | |
---|
| 169 | solaire_etat0 = tab_cntrl(4) |
---|
| 170 | tab_cntrl(5)=iflag_con |
---|
| 171 | tab_cntrl(6)=nbapp_rad |
---|
| 172 | |
---|
| 173 | IF (iflag_cycle_diurne.GE.1) tab_cntrl( 7) = iflag_cycle_diurne |
---|
| 174 | IF (soil_model) tab_cntrl( 8) =1. |
---|
| 175 | IF (new_oliq) tab_cntrl( 9) =1. |
---|
| 176 | IF (ok_orodr) tab_cntrl(10) =1. |
---|
| 177 | IF (ok_orolf) tab_cntrl(11) =1. |
---|
| 178 | IF (ok_limitvrai) tab_cntrl(12) =1. |
---|
| 179 | |
---|
| 180 | itau_phy = tab_cntrl(15) |
---|
| 181 | |
---|
| 182 | clesphy0(1)=tab_cntrl( 5 ) |
---|
| 183 | clesphy0(2)=tab_cntrl( 6 ) |
---|
| 184 | clesphy0(3)=tab_cntrl( 7 ) |
---|
| 185 | clesphy0(4)=tab_cntrl( 8 ) |
---|
| 186 | clesphy0(5)=tab_cntrl( 9 ) |
---|
| 187 | clesphy0(6)=tab_cntrl( 10 ) |
---|
| 188 | clesphy0(7)=tab_cntrl( 11 ) |
---|
| 189 | clesphy0(8)=tab_cntrl( 12 ) |
---|
[4298] | 190 | clesphy0(9)=tab_cntrl( 17 ) |
---|
[3927] | 191 | |
---|
| 192 | ! set time iteration |
---|
| 193 | CALL init_iteration(itau_phy) |
---|
| 194 | |
---|
| 195 | ! read latitudes and make a sanity check (because already known from dyn) |
---|
| 196 | CALL get_field("latitude",lat_startphy) |
---|
| 197 | DO i=1,klon |
---|
| 198 | IF (ABS(lat_startphy(i)-latitude_deg(i))>=1) THEN |
---|
| 199 | WRITE(*,*) "phyetat0: Error! Latitude discrepancy wrt startphy file:",& |
---|
| 200 | " i=",i," lat_startphy(i)=",lat_startphy(i),& |
---|
| 201 | " latitude_deg(i)=",latitude_deg(i) |
---|
| 202 | ! This is presumably serious enough to abort run |
---|
| 203 | CALL abort_physic("phyetat0","discrepancy in latitudes!",1) |
---|
| 204 | ENDIF |
---|
| 205 | IF (ABS(lat_startphy(i)-latitude_deg(i))>=0.0001) THEN |
---|
| 206 | WRITE(*,*) "phyetat0: Warning! Latitude discrepancy wrt startphy file:",& |
---|
| 207 | " i=",i," lat_startphy(i)=",lat_startphy(i),& |
---|
| 208 | " latitude_deg(i)=",latitude_deg(i) |
---|
| 209 | ENDIF |
---|
| 210 | ENDDO |
---|
| 211 | |
---|
| 212 | ! read longitudes and make a sanity check (because already known from dyn) |
---|
| 213 | CALL get_field("longitude",lon_startphy) |
---|
| 214 | DO i=1,klon |
---|
| 215 | IF (ABS(lon_startphy(i)-longitude_deg(i))>=1) THEN |
---|
| 216 | IF (ABS(360-ABS(lon_startphy(i)-longitude_deg(i)))>=1) THEN |
---|
| 217 | WRITE(*,*) "phyetat0: Error! Longitude discrepancy wrt startphy file:",& |
---|
| 218 | " i=",i," lon_startphy(i)=",lon_startphy(i),& |
---|
| 219 | " longitude_deg(i)=",longitude_deg(i) |
---|
| 220 | ! This is presumably serious enough to abort run |
---|
| 221 | CALL abort_physic("phyetat0","discrepancy in longitudes!",1) |
---|
| 222 | ENDIF |
---|
| 223 | ENDIF |
---|
| 224 | IF (ABS(lon_startphy(i)-longitude_deg(i))>=1) THEN |
---|
| 225 | IF (ABS(360-ABS(lon_startphy(i)-longitude_deg(i))) > 0.0001) THEN |
---|
| 226 | WRITE(*,*) "phyetat0: Warning! Longitude discrepancy wrt startphy file:",& |
---|
| 227 | " i=",i," lon_startphy(i)=",lon_startphy(i),& |
---|
| 228 | " longitude_deg(i)=",longitude_deg(i) |
---|
| 229 | ENDIF |
---|
| 230 | ENDIF |
---|
| 231 | ENDDO |
---|
| 232 | |
---|
| 233 | ! Lecture du masque terre mer |
---|
| 234 | |
---|
| 235 | CALL get_field("masque", zmasq, found) |
---|
| 236 | IF (.NOT. found) THEN |
---|
| 237 | PRINT*, 'phyetat0: Le champ <masque> est absent' |
---|
| 238 | PRINT *, 'fichier startphy non compatible avec phyetat0' |
---|
| 239 | ENDIF |
---|
| 240 | |
---|
| 241 | ! Lecture des fractions pour chaque sous-surface |
---|
| 242 | |
---|
| 243 | ! initialisation des sous-surfaces |
---|
| 244 | |
---|
| 245 | pctsrf = 0. |
---|
| 246 | |
---|
| 247 | ! fraction de terre |
---|
| 248 | |
---|
| 249 | CALL get_field("FTER", pctsrf(:, is_ter), found) |
---|
| 250 | IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FTER> est absent' |
---|
| 251 | |
---|
| 252 | ! fraction de glace de terre |
---|
| 253 | |
---|
| 254 | CALL get_field("FLIC", pctsrf(:, is_lic), found) |
---|
| 255 | IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FLIC> est absent' |
---|
| 256 | |
---|
| 257 | ! fraction d'ocean |
---|
| 258 | |
---|
| 259 | CALL get_field("FOCE", pctsrf(:, is_oce), found) |
---|
| 260 | IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FOCE> est absent' |
---|
| 261 | |
---|
| 262 | ! fraction glace de mer |
---|
| 263 | |
---|
| 264 | CALL get_field("FSIC", pctsrf(:, is_sic), found) |
---|
| 265 | IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FSIC> est absent' |
---|
| 266 | |
---|
| 267 | ! Verification de l'adequation entre le masque et les sous-surfaces |
---|
| 268 | |
---|
| 269 | fractint( 1 : klon) = pctsrf(1 : klon, is_ter) & |
---|
| 270 | + pctsrf(1 : klon, is_lic) |
---|
| 271 | DO i = 1 , klon |
---|
| 272 | IF ( abs(fractint(i) - zmasq(i) ) .GT. EPSFRA ) THEN |
---|
| 273 | WRITE(*, *) 'phyetat0: attention fraction terre pas ', & |
---|
| 274 | 'coherente ', i, zmasq(i), pctsrf(i, is_ter) & |
---|
| 275 | , pctsrf(i, is_lic) |
---|
| 276 | WRITE(*, *) 'Je force la coherence zmasq=fractint' |
---|
| 277 | zmasq(i) = fractint(i) |
---|
| 278 | ENDIF |
---|
| 279 | ENDDO |
---|
| 280 | fractint (1 : klon) = pctsrf(1 : klon, is_oce) & |
---|
| 281 | + pctsrf(1 : klon, is_sic) |
---|
| 282 | DO i = 1 , klon |
---|
| 283 | IF ( abs( fractint(i) - (1. - zmasq(i))) .GT. EPSFRA ) THEN |
---|
| 284 | WRITE(*, *) 'phyetat0 attention fraction ocean pas ', & |
---|
| 285 | 'coherente ', i, zmasq(i) , pctsrf(i, is_oce) & |
---|
| 286 | , pctsrf(i, is_sic) |
---|
| 287 | WRITE(*, *) 'Je force la coherence zmasq=1.-fractint' |
---|
| 288 | zmasq(i) = 1. - fractint(i) |
---|
| 289 | ENDIF |
---|
| 290 | ENDDO |
---|
| 291 | |
---|
| 292 | !=================================================================== |
---|
| 293 | ! Lecture des temperatures du sol: |
---|
| 294 | !=================================================================== |
---|
| 295 | |
---|
[4358] | 296 | found=phyetat0_get(ftsol(:,1),"TS","Surface temperature",283.) |
---|
[3927] | 297 | IF (found) THEN |
---|
| 298 | DO nsrf=2,nbsrf |
---|
| 299 | ftsol(:,nsrf)=ftsol(:,1) |
---|
| 300 | ENDDO |
---|
| 301 | ELSE |
---|
[4358] | 302 | found=phyetat0_srf(ftsol,"TS","Surface temperature",283.) |
---|
[3927] | 303 | ENDIF |
---|
| 304 | |
---|
| 305 | !=================================================================== |
---|
| 306 | ! Lecture des albedo difus et direct |
---|
| 307 | !=================================================================== |
---|
| 308 | |
---|
| 309 | DO nsrf = 1, nbsrf |
---|
| 310 | DO isw=1, nsw |
---|
| 311 | IF (isw.GT.99) THEN |
---|
| 312 | PRINT*, "Trop de bandes SW" |
---|
| 313 | call abort_physic("phyetat0", "", 1) |
---|
| 314 | ENDIF |
---|
| 315 | WRITE(str2, '(i2.2)') isw |
---|
[4358] | 316 | found=phyetat0_srf(falb_dir(:, isw,:),"A_dir_SW"//str2//"srf","Direct Albedo",0.2) |
---|
| 317 | found=phyetat0_srf(falb_dif(:, isw,:),"A_dif_SW"//str2//"srf","Direct Albedo",0.2) |
---|
[3927] | 318 | ENDDO |
---|
| 319 | ENDDO |
---|
| 320 | |
---|
[4358] | 321 | found=phyetat0_srf(u10m,"U10M","u a 10m",0.) |
---|
| 322 | found=phyetat0_srf(v10m,"V10M","v a 10m",0.) |
---|
[3927] | 323 | |
---|
| 324 | !=================================================================== |
---|
| 325 | ! Lecture des temperatures du sol profond: |
---|
| 326 | !=================================================================== |
---|
| 327 | |
---|
| 328 | DO isoil=1, nsoilmx |
---|
| 329 | IF (isoil.GT.99) THEN |
---|
| 330 | PRINT*, "Trop de couches " |
---|
| 331 | call abort_physic("phyetat0", "", 1) |
---|
| 332 | ENDIF |
---|
| 333 | WRITE(str2,'(i2.2)') isoil |
---|
[4358] | 334 | found=phyetat0_srf(tsoil(:, isoil,:),"Tsoil"//str2//"srf","Temp soil",0.) |
---|
[3927] | 335 | IF (.NOT. found) THEN |
---|
| 336 | PRINT*, "phyetat0: Le champ <Tsoil"//str7//"> est absent" |
---|
| 337 | PRINT*, " Il prend donc la valeur de surface" |
---|
| 338 | tsoil(:, isoil, :)=ftsol(:, :) |
---|
| 339 | ENDIF |
---|
| 340 | ENDDO |
---|
| 341 | |
---|
| 342 | !======================================================================= |
---|
| 343 | ! Lecture precipitation/evaporation |
---|
| 344 | !======================================================================= |
---|
| 345 | |
---|
[4358] | 346 | found=phyetat0_srf(qsurf,"QS","Near surface hmidity",0.) |
---|
| 347 | found=phyetat0_get(qsol,"QSOL","Surface hmidity / bucket",0.) |
---|
| 348 | found=phyetat0_srf(snow,"SNOW","Surface snow",0.) |
---|
| 349 | found=phyetat0_srf(fevap,"EVAP","evaporation",0.) |
---|
| 350 | found=phyetat0_get(snow_fall,"snow_f","snow fall",0.) |
---|
| 351 | found=phyetat0_get(rain_fall,"rain_f","rain fall",0.) |
---|
[3927] | 352 | |
---|
[4727] | 353 | IF (ok_bs) THEN |
---|
| 354 | found=phyetat0_get(bs_fall,"bs_f","blowing snow fall",0.) |
---|
| 355 | ELSE |
---|
| 356 | bs_fall(:)=0. |
---|
| 357 | ENDIF |
---|
| 358 | |
---|
| 359 | |
---|
[3927] | 360 | !======================================================================= |
---|
| 361 | ! Radiation |
---|
| 362 | !======================================================================= |
---|
| 363 | |
---|
[4358] | 364 | found=phyetat0_get(solsw,"solsw","net SW radiation surf",0.) |
---|
| 365 | found=phyetat0_get(solswfdiff,"solswfdiff","fraction of SW radiation surf that is diffuse",1.) |
---|
| 366 | found=phyetat0_get(sollw,"sollw","net LW radiation surf",0.) |
---|
| 367 | found=phyetat0_get(sollwdown,"sollwdown","down LW radiation surf",0.) |
---|
[3927] | 368 | IF (.NOT. found) THEN |
---|
[3940] | 369 | sollwdown(:) = 0. ; zts(:)=0. |
---|
| 370 | DO nsrf=1,nbsrf |
---|
[3927] | 371 | zts(:)=zts(:)+ftsol(:,nsrf)*pctsrf(:,nsrf) |
---|
[3940] | 372 | ENDDO |
---|
[3927] | 373 | sollwdown(:)=sollw(:)+RSIGMA*zts(:)**4 |
---|
| 374 | ENDIF |
---|
| 375 | |
---|
[4358] | 376 | found=phyetat0_get(radsol,"RADS","Solar radiation",0.) |
---|
| 377 | found=phyetat0_get(fder,"fder","Flux derivative",0.) |
---|
[3927] | 378 | |
---|
| 379 | |
---|
| 380 | ! Lecture de la longueur de rugosite |
---|
[4358] | 381 | found=phyetat0_srf(z0m,"RUG","Z0m ancien",0.001) |
---|
[3927] | 382 | IF (found) THEN |
---|
| 383 | z0h(:,1:nbsrf)=z0m(:,1:nbsrf) |
---|
| 384 | ELSE |
---|
[4358] | 385 | found=phyetat0_srf(z0m,"Z0m","Roughness length, momentum ",0.001) |
---|
| 386 | found=phyetat0_srf(z0h,"Z0h","Roughness length, enthalpy ",0.001) |
---|
[3927] | 387 | ENDIF |
---|
| 388 | !FC |
---|
| 389 | IF (ifl_pbltree>0) THEN |
---|
| 390 | !CALL get_field("FTER", pctsrf(:, is_ter), found) |
---|
| 391 | treedrg(:,1:klev,1:nbsrf)= 0.0 |
---|
| 392 | CALL get_field("treedrg_ter", drg_ter(:,:), found) |
---|
[4358] | 393 | ! found=phyetat0_srf(treedrg,"treedrg","drag from vegetation" , 0.) |
---|
[3927] | 394 | !lecture du profile de freinage des arbres |
---|
| 395 | IF (.not. found ) THEN |
---|
| 396 | treedrg(:,1:klev,1:nbsrf)= 0.0 |
---|
| 397 | ELSE |
---|
| 398 | treedrg(:,1:klev,is_ter)= drg_ter(:,:) |
---|
[4358] | 399 | ! found=phyetat0_get(treedrg,"treedrg","freinage arbres",0.) |
---|
[3927] | 400 | ENDIF |
---|
| 401 | ELSE |
---|
| 402 | ! initialize treedrg(), because it will be written in restartphy.nc |
---|
| 403 | treedrg(:,:,:) = 0.0 |
---|
| 404 | ENDIF |
---|
| 405 | |
---|
| 406 | ! Lecture de l'age de la neige: |
---|
[4358] | 407 | found=phyetat0_srf(agesno,"AGESNO","SNOW AGE",0.001) |
---|
[3927] | 408 | |
---|
| 409 | ancien_ok=.true. |
---|
[4358] | 410 | ancien_ok=ancien_ok.AND.phyetat0_get(t_ancien,"TANCIEN","TANCIEN",0.) |
---|
| 411 | ancien_ok=ancien_ok.AND.phyetat0_get(q_ancien,"QANCIEN","QANCIEN",0.) |
---|
| 412 | ancien_ok=ancien_ok.AND.phyetat0_get(ql_ancien,"QLANCIEN","QLANCIEN",0.) |
---|
| 413 | ancien_ok=ancien_ok.AND.phyetat0_get(qs_ancien,"QSANCIEN","QSANCIEN",0.) |
---|
| 414 | ancien_ok=ancien_ok.AND.phyetat0_get(rneb_ancien,"RNEBANCIEN","RNEBANCIEN",0.) |
---|
| 415 | ancien_ok=ancien_ok.AND.phyetat0_get(u_ancien,"UANCIEN","UANCIEN",0.) |
---|
| 416 | ancien_ok=ancien_ok.AND.phyetat0_get(v_ancien,"VANCIEN","VANCIEN",0.) |
---|
| 417 | ancien_ok=ancien_ok.AND.phyetat0_get(prw_ancien,"PRWANCIEN","PRWANCIEN",0.) |
---|
| 418 | ancien_ok=ancien_ok.AND.phyetat0_get(prlw_ancien,"PRLWANCIEN","PRLWANCIEN",0.) |
---|
| 419 | ancien_ok=ancien_ok.AND.phyetat0_get(prsw_ancien,"PRSWANCIEN","PRSWANCIEN",0.) |
---|
[3927] | 420 | |
---|
[4727] | 421 | ! cas specifique des variables de la neige soufflee |
---|
| 422 | IF (ok_bs) THEN |
---|
| 423 | ancien_ok=ancien_ok.AND.phyetat0_get(qbs_ancien,"QBSANCIEN","QBSANCIEN",0.) |
---|
| 424 | ancien_ok=ancien_ok.AND.phyetat0_get(prbsw_ancien,"PRBSWANCIEN","PRBSWANCIEN",0.) |
---|
| 425 | ELSE |
---|
| 426 | qbs_ancien(:,:)=0. |
---|
| 427 | prbsw_ancien(:)=0. |
---|
| 428 | ENDIF |
---|
| 429 | |
---|
| 430 | |
---|
[3927] | 431 | ! Ehouarn: addtional tests to check if t_ancien, q_ancien contain |
---|
| 432 | ! dummy values (as is the case when generated by ce0l, |
---|
| 433 | ! or by iniaqua) |
---|
| 434 | IF ( (maxval(q_ancien).EQ.minval(q_ancien)) .OR. & |
---|
| 435 | (maxval(ql_ancien).EQ.minval(ql_ancien)) .OR. & |
---|
| 436 | (maxval(qs_ancien).EQ.minval(qs_ancien)) .OR. & |
---|
[4358] | 437 | (maxval(rneb_ancien).EQ.minval(rneb_ancien)) .OR. & |
---|
[3927] | 438 | (maxval(prw_ancien).EQ.minval(prw_ancien)) .OR. & |
---|
| 439 | (maxval(prlw_ancien).EQ.minval(prlw_ancien)) .OR. & |
---|
| 440 | (maxval(prsw_ancien).EQ.minval(prsw_ancien)) .OR. & |
---|
| 441 | (maxval(t_ancien).EQ.minval(t_ancien)) ) THEN |
---|
| 442 | ancien_ok=.false. |
---|
| 443 | ENDIF |
---|
| 444 | |
---|
[4727] | 445 | IF (ok_bs) THEN |
---|
| 446 | IF ( (maxval(qbs_ancien).EQ.minval(qbs_ancien)) .OR. & |
---|
| 447 | (maxval(prbsw_ancien).EQ.minval(prbsw_ancien)) ) THEN |
---|
| 448 | ancien_ok=.false. |
---|
| 449 | ENDIF |
---|
| 450 | ENDIF |
---|
| 451 | |
---|
| 452 | |
---|
[4358] | 453 | found=phyetat0_get(clwcon,"CLWCON","CLWCON",0.) |
---|
| 454 | found=phyetat0_get(rnebcon,"RNEBCON","RNEBCON",0.) |
---|
| 455 | found=phyetat0_get(ratqs,"RATQS","RATQS",0.) |
---|
[3927] | 456 | |
---|
[4358] | 457 | found=phyetat0_get(run_off_lic_0,"RUNOFFLIC0","RUNOFFLIC0",0.) |
---|
[3927] | 458 | |
---|
| 459 | !================================== |
---|
| 460 | ! TKE |
---|
| 461 | !================================== |
---|
| 462 | ! |
---|
| 463 | IF (iflag_pbl>1) then |
---|
[4358] | 464 | found=phyetat0_srf(pbl_tke,"TKE","Turb. Kinetic. Energ. ",1.e-8) |
---|
[3927] | 465 | ENDIF |
---|
| 466 | |
---|
| 467 | IF (iflag_pbl>1 .AND. iflag_wake>=1 .AND. iflag_pbl_split >=1 ) then |
---|
[4358] | 468 | found=phyetat0_srf(wake_delta_pbl_tke,"DELTATKE","Del TKE wk/env",0.) |
---|
| 469 | !! found=phyetat0_srf(delta_tsurf,"DELTA_TSURF","Delta Ts wk/env ",0.) |
---|
| 470 | found=phyetat0_srf(delta_tsurf,"DELTATS","Delta Ts wk/env ",0.) |
---|
| 471 | !! found=phyetat0_srf(beta_aridity,"BETA_S","Aridity factor ",1.) |
---|
| 472 | found=phyetat0_srf(beta_aridity,"BETAS","Aridity factor ",1.) |
---|
[3927] | 473 | ENDIF !(iflag_pbl>1 .AND. iflag_wake>=1 .AND. iflag_pbl_split >=1 ) |
---|
| 474 | |
---|
| 475 | !================================== |
---|
| 476 | ! thermiques, poches, convection |
---|
| 477 | !================================== |
---|
| 478 | |
---|
| 479 | ! Emanuel |
---|
[4358] | 480 | found=phyetat0_get(sig1,"sig1","sig1",0.) |
---|
| 481 | found=phyetat0_get(w01,"w01","w01",0.) |
---|
[3927] | 482 | |
---|
| 483 | ! Wake |
---|
[4358] | 484 | found=phyetat0_get(wake_deltat,"WAKE_DELTAT","Delta T wake/env",0.) |
---|
| 485 | found=phyetat0_get(wake_deltaq,"WAKE_DELTAQ","Delta hum. wake/env",0.) |
---|
| 486 | found=phyetat0_get(wake_s,"WAKE_S","Wake frac. area",0.) |
---|
[3927] | 487 | !jyg< |
---|
| 488 | ! Set wake_dens to -1000. when there is no restart so that the actual |
---|
| 489 | ! initialization is made in calwake. |
---|
| 490 | !! found=phyetat0_get(1,wake_dens,"WAKE_DENS","Wake num. /unit area",0.) |
---|
[4358] | 491 | found=phyetat0_get(wake_dens,"WAKE_DENS","Wake num. /unit area",-1000.) |
---|
| 492 | found=phyetat0_get(awake_dens,"AWAKE_DENS","Active Wake num. /unit area",0.) |
---|
| 493 | found=phyetat0_get(cv_gen,"CV_GEN","CB birth rate",0.) |
---|
[3927] | 494 | !>jyg |
---|
[4358] | 495 | found=phyetat0_get(wake_cstar,"WAKE_CSTAR","WAKE_CSTAR",0.) |
---|
| 496 | found=phyetat0_get(wake_pe,"WAKE_PE","WAKE_PE",0.) |
---|
| 497 | found=phyetat0_get(wake_fip,"WAKE_FIP","WAKE_FIP",0.) |
---|
[3927] | 498 | |
---|
| 499 | ! Thermiques |
---|
[4358] | 500 | found=phyetat0_get(zmax0,"ZMAX0","ZMAX0",40.) |
---|
| 501 | found=phyetat0_get(f0,"F0","F0",1.e-5) |
---|
| 502 | found=phyetat0_get(fm_therm,"FM_THERM","Thermals mass flux",0.) |
---|
| 503 | found=phyetat0_get(entr_therm,"ENTR_THERM","Thermals Entrain.",0.) |
---|
| 504 | found=phyetat0_get(detr_therm,"DETR_THERM","Thermals Detrain.",0.) |
---|
[3927] | 505 | |
---|
| 506 | ! ALE/ALP |
---|
[4358] | 507 | found=phyetat0_get(ale_bl,"ALE_BL","ALE BL",0.) |
---|
| 508 | found=phyetat0_get(ale_bl_trig,"ALE_BL_TRIG","ALE BL_TRIG",0.) |
---|
| 509 | found=phyetat0_get(alp_bl,"ALP_BL","ALP BL",0.) |
---|
| 510 | found=phyetat0_get(ale_wake,"ALE_WAKE","ALE_WAKE",0.) |
---|
| 511 | found=phyetat0_get(ale_bl_stat,"ALE_BL_STAT","ALE_BL_STAT",0.) |
---|
[3927] | 512 | |
---|
[3940] | 513 | ! fisrtilp/Clouds 0.002 could be ratqsbas. But can stay like this as well |
---|
[4727] | 514 | found=phyetat0_get(ratqs_inter_,"RATQS_INTER","Relative width of the lsc sugrid scale water",0.002) |
---|
[3940] | 515 | |
---|
[3927] | 516 | !=========================================== |
---|
| 517 | ! Read and send field trs to traclmdz |
---|
| 518 | !=========================================== |
---|
| 519 | |
---|
[4170] | 520 | !--OB now this is for co2i - ThL: and therefore also for inco |
---|
[4389] | 521 | IF (ANY(type_trac == ['co2i','inco'])) THEN |
---|
[4170] | 522 | IF (carbon_cycle_cpl) THEN |
---|
| 523 | ALLOCATE(co2_send(klon), stat=ierr) |
---|
| 524 | IF (ierr /= 0) CALL abort_physic('phyetat0', 'pb allocation co2_send', 1) |
---|
[4358] | 525 | found=phyetat0_get(co2_send,"co2_send","co2 send",co2_ppm0) |
---|
[4170] | 526 | ENDIF |
---|
[4358] | 527 | ELSE IF (type_trac == 'lmdz') THEN |
---|
[4056] | 528 | it = 0 |
---|
| 529 | DO iq = 1, nqtot |
---|
[4071] | 530 | IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE |
---|
[4056] | 531 | it = it+1 |
---|
[4358] | 532 | tname = tracers(iq)%name |
---|
| 533 | t(1) = 'trs_'//TRIM(tname); t(2) = 'trs_'//TRIM(new2oldH2O(tname)) |
---|
| 534 | found = phyetat0_get(trs(:,it), t(:), "Surf trac"//TRIM(tname), 0.) |
---|
[4056] | 535 | END DO |
---|
[3927] | 536 | CALL traclmdz_from_restart(trs) |
---|
| 537 | ENDIF |
---|
| 538 | |
---|
| 539 | #ifdef ISO |
---|
| 540 | ! initialise les isotopes |
---|
| 541 | write(*,*) 'phyetat0 1069' |
---|
| 542 | CALL phyisoetat0 (snow,run_off_lic_0, & |
---|
| 543 | & xtsnow,xtrun_off_lic_0, & |
---|
| 544 | & Rland_ice) |
---|
| 545 | #ifdef ISOVERIF |
---|
| 546 | write(*,*) 'phyetat0 1074' |
---|
| 547 | if (iso_eau.gt.0) then |
---|
| 548 | call iso_verif_egalite_vect2D( & |
---|
| 549 | & xtsnow,snow, & |
---|
| 550 | & 'phyetat0 1101a',niso,klon,nbsrf) |
---|
| 551 | do i=1,klon |
---|
| 552 | call iso_verif_egalite(Rland_ice(iso_eau,i),1.0, & |
---|
| 553 | & 'phyetat0 1101b') |
---|
| 554 | enddo |
---|
| 555 | endif |
---|
[4036] | 556 | write(*,*) 'phyetat0 1102' |
---|
[3927] | 557 | #endif |
---|
| 558 | #endif |
---|
| 559 | |
---|
| 560 | !=========================================== |
---|
| 561 | ! ondes de gravite / relief |
---|
| 562 | !=========================================== |
---|
| 563 | |
---|
| 564 | ! ondes de gravite non orographiques |
---|
| 565 | IF (ok_gwd_rando) found = & |
---|
[4358] | 566 | phyetat0_get(du_gwd_rando,"du_gwd_rando","du_gwd_rando",0.) |
---|
[3927] | 567 | IF (.NOT. ok_hines .AND. ok_gwd_rando) found & |
---|
[4358] | 568 | = phyetat0_get(du_gwd_front,"du_gwd_front","du_gwd_front",0.) |
---|
[3927] | 569 | |
---|
| 570 | ! prise en compte du relief sous-maille |
---|
[4358] | 571 | found=phyetat0_get(zmea,"ZMEA","sub grid orography",0.) |
---|
| 572 | found=phyetat0_get(zstd,"ZSTD","sub grid orography",0.) |
---|
| 573 | found=phyetat0_get(zsig,"ZSIG","sub grid orography",0.) |
---|
| 574 | found=phyetat0_get(zgam,"ZGAM","sub grid orography",0.) |
---|
| 575 | found=phyetat0_get(zthe,"ZTHE","sub grid orography",0.) |
---|
| 576 | found=phyetat0_get(zpic,"ZPIC","sub grid orography",0.) |
---|
| 577 | found=phyetat0_get(zval,"ZVAL","sub grid orography",0.) |
---|
| 578 | found=phyetat0_get(zmea,"ZMEA","sub grid orography",0.) |
---|
| 579 | found=phyetat0_get(rugoro,"RUGSREL","sub grid orography",0.) |
---|
[3927] | 580 | |
---|
| 581 | !=========================================== |
---|
| 582 | ! Initialize ocean |
---|
| 583 | !=========================================== |
---|
| 584 | |
---|
| 585 | IF ( type_ocean == 'slab' ) THEN |
---|
| 586 | CALL ocean_slab_init(phys_tstep, pctsrf) |
---|
| 587 | IF (nslay.EQ.1) THEN |
---|
[4358] | 588 | found=phyetat0_get(tslab,["tslab01","tslab "],"tslab",0.) |
---|
[3927] | 589 | ELSE |
---|
| 590 | DO i=1,nslay |
---|
| 591 | WRITE(str2,'(i2.2)') i |
---|
[4358] | 592 | found=phyetat0_get(tslab(:,i),"tslab"//str2,"tslab",0.) |
---|
[3927] | 593 | ENDDO |
---|
| 594 | ENDIF |
---|
| 595 | IF (.NOT. found) THEN |
---|
| 596 | PRINT*, "phyetat0: Le champ <tslab> est absent" |
---|
| 597 | PRINT*, "Initialisation a tsol_oce" |
---|
| 598 | DO i=1,nslay |
---|
| 599 | tslab(:,i)=MAX(ftsol(:,is_oce),271.35) |
---|
| 600 | ENDDO |
---|
| 601 | ENDIF |
---|
| 602 | |
---|
| 603 | ! Sea ice variables |
---|
| 604 | IF (version_ocean == 'sicINT') THEN |
---|
[4358] | 605 | found=phyetat0_get(tice,"slab_tice","slab_tice",0.) |
---|
[3927] | 606 | IF (.NOT. found) THEN |
---|
| 607 | PRINT*, "phyetat0: Le champ <tice> est absent" |
---|
| 608 | PRINT*, "Initialisation a tsol_sic" |
---|
| 609 | tice(:)=ftsol(:,is_sic) |
---|
| 610 | ENDIF |
---|
[4358] | 611 | found=phyetat0_get(seaice,"seaice","seaice",0.) |
---|
[3927] | 612 | IF (.NOT. found) THEN |
---|
| 613 | PRINT*, "phyetat0: Le champ <seaice> est absent" |
---|
| 614 | PRINT*, "Initialisation a 0/1m suivant fraction glace" |
---|
| 615 | seaice(:)=0. |
---|
| 616 | WHERE (pctsrf(:,is_sic).GT.EPSFRA) |
---|
| 617 | seaice=917. |
---|
| 618 | ENDWHERE |
---|
| 619 | ENDIF |
---|
| 620 | ENDIF !sea ice INT |
---|
| 621 | ENDIF ! Slab |
---|
| 622 | |
---|
[3940] | 623 | if (activate_ocean_skin >= 1) then |
---|
| 624 | if (activate_ocean_skin == 2 .and. type_ocean == 'couple') then |
---|
[4358] | 625 | found = phyetat0_get(delta_sal, "delta_sal", & |
---|
[3940] | 626 | "ocean-air interface salinity minus bulk salinity", 0.) |
---|
[4358] | 627 | found = phyetat0_get(delta_sst, "delta_SST", & |
---|
[3940] | 628 | "ocean-air interface temperature minus bulk SST", 0.) |
---|
[4374] | 629 | found = phyetat0_get(dter, "dter", & |
---|
| 630 | "ocean-air interface temperature minus subskin temperature", 0.) |
---|
| 631 | found = phyetat0_get(dser, "dser", & |
---|
| 632 | "ocean-air interface salinity minus subskin salinity", 0.) |
---|
| 633 | found = phyetat0_get(dt_ds, "dt_ds", "(tks / tkt) * dTer", 0.) |
---|
| 634 | |
---|
| 635 | where (pctsrf(:, is_oce) == 0.) |
---|
| 636 | delta_sst = missing_val |
---|
| 637 | delta_sal = missing_val |
---|
| 638 | dter = missing_val |
---|
| 639 | dser = missing_val |
---|
| 640 | dt_ds = missing_val |
---|
| 641 | end where |
---|
[3940] | 642 | end if |
---|
| 643 | |
---|
[4358] | 644 | found = phyetat0_get(ds_ns, "dS_ns", "delta salinity near surface", 0.) |
---|
| 645 | found = phyetat0_get(dt_ns, "dT_ns", "delta temperature near surface", & |
---|
[3940] | 646 | 0.) |
---|
| 647 | |
---|
| 648 | where (pctsrf(:, is_oce) == 0.) |
---|
| 649 | ds_ns = missing_val |
---|
| 650 | dt_ns = missing_val |
---|
| 651 | delta_sst = missing_val |
---|
| 652 | delta_sal = missing_val |
---|
| 653 | end where |
---|
| 654 | end if |
---|
| 655 | |
---|
[3927] | 656 | ! on ferme le fichier |
---|
| 657 | CALL close_startphy |
---|
| 658 | |
---|
| 659 | ! Initialize module pbl_surface_mod |
---|
| 660 | |
---|
[4384] | 661 | ! 994 est trop grand quand OpenMP est activé : on sort du tableau |
---|
| 662 | !#ifdef ISOVERIF |
---|
| 663 | ! write(*,*) 'phyetat0 572: snow(994,:)=',snow(994,2) |
---|
| 664 | ! write(*,*) 'xtsnow(:,994,2)=',xtsnow(:,994,2) |
---|
| 665 | !#endif |
---|
[3927] | 666 | |
---|
| 667 | CALL pbl_surface_init(fder, snow, qsurf, tsoil) |
---|
| 668 | #ifdef ISO |
---|
| 669 | CALL pbl_surface_init_iso(xtsnow,Rland_ice) |
---|
| 670 | #endif |
---|
| 671 | |
---|
| 672 | ! Initialize module ocean_cpl_mod for the case of coupled ocean |
---|
| 673 | IF ( type_ocean == 'couple' ) THEN |
---|
| 674 | CALL ocean_cpl_init(phys_tstep, longitude_deg, latitude_deg) |
---|
| 675 | ENDIF |
---|
| 676 | |
---|
| 677 | ! CALL init_iophy_new(latitude_deg, longitude_deg) |
---|
| 678 | |
---|
| 679 | ! Initilialize module fonte_neige_mod |
---|
| 680 | CALL fonte_neige_init(run_off_lic_0) |
---|
| 681 | #ifdef ISO |
---|
| 682 | CALL fonte_neige_init_iso(xtrun_off_lic_0) |
---|
| 683 | #endif |
---|
| 684 | |
---|
| 685 | END SUBROUTINE phyetat0 |
---|
| 686 | |
---|
[4358] | 687 | END MODULE phyetat0_mod |
---|
[3927] | 688 | |
---|