[1403] | 1 | ! $Id: phyredem.F90 2241 2015-03-23 21:02:32Z fhourdin $ |
---|
[782] | 2 | |
---|
[1827] | 3 | SUBROUTINE phyredem (fichnom) |
---|
[782] | 4 | |
---|
[1827] | 5 | USE dimphy |
---|
| 6 | USE mod_grid_phy_lmdz |
---|
| 7 | USE mod_phys_lmdz_para |
---|
| 8 | USE fonte_neige_mod, ONLY : fonte_neige_final |
---|
| 9 | USE pbl_surface_mod, ONLY : pbl_surface_final |
---|
| 10 | USE phys_state_var_mod |
---|
| 11 | USE iostart |
---|
| 12 | USE traclmdz_mod, ONLY : traclmdz_to_restart |
---|
| 13 | USE infotrac |
---|
| 14 | USE control_mod |
---|
| 15 | USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send |
---|
| 16 | USE indice_sol_mod |
---|
[2057] | 17 | USE surface_data |
---|
[2209] | 18 | USE ocean_slab_mod, ONLY : tslab, seaice, tice, fsic |
---|
[967] | 19 | |
---|
[1827] | 20 | IMPLICIT none |
---|
| 21 | !====================================================================== |
---|
| 22 | ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 |
---|
| 23 | ! Objet: Ecriture de l'etat de redemarrage pour la physique |
---|
| 24 | !====================================================================== |
---|
| 25 | include "netcdf.inc" |
---|
| 26 | include "dimsoil.h" |
---|
| 27 | include "clesphys.h" |
---|
| 28 | include "temps.h" |
---|
| 29 | include "thermcell.h" |
---|
| 30 | include "compbl.h" |
---|
| 31 | !====================================================================== |
---|
| 32 | CHARACTER*(*) fichnom |
---|
[967] | 33 | |
---|
[1827] | 34 | ! les variables globales ecrites dans le fichier restart |
---|
[782] | 35 | |
---|
[1827] | 36 | REAL tsoil(klon, nsoilmx, nbsrf) |
---|
| 37 | REAL qsurf(klon, nbsrf) |
---|
| 38 | REAL qsol(klon) |
---|
| 39 | REAL snow(klon, nbsrf) |
---|
| 40 | REAL evap(klon, nbsrf) |
---|
| 41 | real fder(klon) |
---|
| 42 | REAL frugs(klon, nbsrf) |
---|
| 43 | REAL agesno(klon, nbsrf) |
---|
| 44 | REAL run_off_lic_0(klon) |
---|
| 45 | REAL trs(klon, nbtr) |
---|
[782] | 46 | |
---|
[1827] | 47 | INTEGER nid, nvarid, idim1, idim2, idim3 |
---|
| 48 | INTEGER ierr |
---|
| 49 | INTEGER length |
---|
| 50 | PARAMETER (length=100) |
---|
| 51 | REAL tab_cntrl(length) |
---|
[782] | 52 | |
---|
[2237] | 53 | INTEGER isoil, nsrf,isw |
---|
[1827] | 54 | CHARACTER (len=7) :: str7 |
---|
| 55 | CHARACTER (len=2) :: str2 |
---|
| 56 | INTEGER :: it, iiq |
---|
[524] | 57 | |
---|
[1827] | 58 | !====================================================================== |
---|
[524] | 59 | |
---|
[1827] | 60 | ! Get variables which will be written to restart file from module |
---|
| 61 | ! pbl_surface_mod |
---|
| 62 | CALL pbl_surface_final(qsol, fder, snow, qsurf, & |
---|
| 63 | evap, frugs, agesno, tsoil) |
---|
[1279] | 64 | |
---|
[1827] | 65 | ! Get a variable calculated in module fonte_neige_mod |
---|
| 66 | CALL fonte_neige_final(run_off_lic_0) |
---|
[1001] | 67 | |
---|
[1827] | 68 | !====================================================================== |
---|
[1001] | 69 | |
---|
[1827] | 70 | CALL open_restartphy(fichnom) |
---|
[1001] | 71 | |
---|
[1827] | 72 | DO ierr = 1, length |
---|
| 73 | tab_cntrl(ierr) = 0.0 |
---|
| 74 | ENDDO |
---|
| 75 | tab_cntrl(1) = dtime |
---|
| 76 | tab_cntrl(2) = radpas |
---|
| 77 | ! co2_ppm : current value of atmospheric CO2 |
---|
| 78 | tab_cntrl(3) = co2_ppm |
---|
| 79 | tab_cntrl(4) = solaire |
---|
| 80 | tab_cntrl(5) = iflag_con |
---|
| 81 | tab_cntrl(6) = nbapp_rad |
---|
[524] | 82 | |
---|
[1827] | 83 | IF( cycle_diurne ) tab_cntrl( 7 ) = 1. |
---|
| 84 | IF( soil_model ) tab_cntrl( 8 ) = 1. |
---|
| 85 | IF( new_oliq ) tab_cntrl( 9 ) = 1. |
---|
| 86 | IF( ok_orodr ) tab_cntrl(10 ) = 1. |
---|
| 87 | IF( ok_orolf ) tab_cntrl(11 ) = 1. |
---|
[524] | 88 | |
---|
[1827] | 89 | tab_cntrl(13) = day_end |
---|
| 90 | tab_cntrl(14) = annee_ref |
---|
| 91 | tab_cntrl(15) = itau_phy |
---|
| 92 | |
---|
| 93 | ! co2_ppm0 : initial value of atmospheric CO2 |
---|
| 94 | tab_cntrl(16) = co2_ppm0 |
---|
| 95 | |
---|
| 96 | CALL put_var("controle", "Parametres de controle", tab_cntrl) |
---|
| 97 | |
---|
| 98 | CALL put_field("longitude", & |
---|
| 99 | "Longitudes de la grille physique", rlon) |
---|
| 100 | |
---|
| 101 | CALL put_field("latitude", "Latitudes de la grille physique", rlat) |
---|
| 102 | |
---|
| 103 | ! PB ajout du masque terre/mer |
---|
| 104 | |
---|
| 105 | CALL put_field("masque", "masque terre mer", zmasq) |
---|
| 106 | |
---|
| 107 | ! BP ajout des fraction de chaque sous-surface |
---|
| 108 | |
---|
[2209] | 109 | ! Get last fractions from slab ocean |
---|
| 110 | IF (type_ocean == 'slab' .AND. version_ocean == "sicINT") THEN |
---|
| 111 | WHERE (1.-zmasq(:).GT.EPSFRA) |
---|
| 112 | pctsrf(:,is_oce)=(1.-fsic(:))*(1.-zmasq(:)) |
---|
| 113 | pctsrf(:,is_sic)=fsic(:)*(1.-zmasq(:)) |
---|
| 114 | END WHERE |
---|
| 115 | END IF |
---|
| 116 | |
---|
[1827] | 117 | ! 1. fraction de terre |
---|
| 118 | |
---|
| 119 | CALL put_field("FTER", "fraction de continent", pctsrf(:, is_ter)) |
---|
| 120 | |
---|
| 121 | ! 2. Fraction de glace de terre |
---|
| 122 | |
---|
| 123 | CALL put_field("FLIC", "fraction glace de terre", pctsrf(:, is_lic)) |
---|
| 124 | |
---|
| 125 | ! 3. fraction ocean |
---|
| 126 | |
---|
| 127 | CALL put_field("FOCE", "fraction ocean", pctsrf(:, is_oce)) |
---|
| 128 | |
---|
| 129 | ! 4. Fraction glace de mer |
---|
| 130 | |
---|
| 131 | CALL put_field("FSIC", "fraction glace mer", pctsrf(:, is_sic)) |
---|
| 132 | |
---|
| 133 | DO nsrf = 1, nbsrf |
---|
| 134 | IF (nsrf.LE.99) THEN |
---|
| 135 | WRITE(str2, '(i2.2)') nsrf |
---|
| 136 | CALL put_field("TS"//str2, "Temperature de surface No."//str2, & |
---|
| 137 | ftsol(:, nsrf)) |
---|
| 138 | ELSE |
---|
| 139 | PRINT*, "Trop de sous-mailles" |
---|
[1931] | 140 | call abort_gcm("phyredem", "", 1) |
---|
[1827] | 141 | ENDIF |
---|
| 142 | ENDDO |
---|
| 143 | |
---|
[2237] | 144 | ! ================== Albedo ======================================= |
---|
| 145 | print*,'PHYREDEM NOUVEAU' |
---|
[1827] | 146 | DO nsrf = 1, nbsrf |
---|
[2237] | 147 | DO isw=1, nsw |
---|
| 148 | IF (isw.LE.99 .AND. nsrf.LE.99) THEN |
---|
| 149 | WRITE(str7, '(i2.2, "srf", i2.2)') isw, nsrf |
---|
| 150 | print*,'PHYREDEM ',"A_dir_SW"//str7 |
---|
| 151 | CALL put_field("A_dir_SW"//str7, "Albedo direct du sol bande "//str7, & |
---|
| 152 | falb_dir(:, isw, nsrf)) |
---|
| 153 | CALL put_field("A_dif_SW"//str7, "Albedo difus du sol bande "//str7, & |
---|
| 154 | falb_dif(:, isw, nsrf)) |
---|
| 155 | ELSE |
---|
| 156 | PRINT*, "Trop de couches" |
---|
| 157 | call abort_gcm("phyredem", "", 1) |
---|
| 158 | ENDIF |
---|
| 159 | ENDDO |
---|
| 160 | ENDDO |
---|
| 161 | |
---|
| 162 | ! ================== Tsoil ======================================= |
---|
| 163 | DO nsrf = 1, nbsrf |
---|
[1827] | 164 | DO isoil=1, nsoilmx |
---|
| 165 | IF (isoil.LE.99 .AND. nsrf.LE.99) THEN |
---|
| 166 | WRITE(str7, '(i2.2, "srf", i2.2)') isoil, nsrf |
---|
| 167 | CALL put_field("Tsoil"//str7, "Temperature du sol No."//str7, & |
---|
| 168 | tsoil(:, isoil, nsrf)) |
---|
[524] | 169 | ELSE |
---|
[1827] | 170 | PRINT*, "Trop de couches" |
---|
[1931] | 171 | call abort_gcm("phyredem", "", 1) |
---|
[524] | 172 | ENDIF |
---|
[1827] | 173 | ENDDO |
---|
| 174 | ENDDO |
---|
[524] | 175 | |
---|
[1827] | 176 | DO nsrf = 1, nbsrf |
---|
| 177 | IF (nsrf.LE.99) THEN |
---|
| 178 | WRITE(str2, '(i2.2)') nsrf |
---|
| 179 | CALL put_field("QS"//str2, "Humidite de surface No."//str2, & |
---|
| 180 | qsurf(:, nsrf)) |
---|
| 181 | ELSE |
---|
| 182 | PRINT*, "Trop de sous-mailles" |
---|
[1931] | 183 | call abort_gcm("phyredem", "", 1) |
---|
[1827] | 184 | ENDIF |
---|
| 185 | END DO |
---|
| 186 | |
---|
| 187 | CALL put_field("QSOL", "Eau dans le sol (mm)", qsol) |
---|
| 188 | |
---|
| 189 | DO nsrf = 1, nbsrf |
---|
| 190 | IF (nsrf.LE.99) THEN |
---|
| 191 | WRITE(str2, '(i2.2)') nsrf |
---|
| 192 | CALL put_field("EVAP"//str2, "Evaporation de surface No."//str2 & |
---|
| 193 | , evap(:, nsrf)) |
---|
| 194 | ELSE |
---|
| 195 | PRINT*, "Trop de sous-mailles" |
---|
[1931] | 196 | call abort_gcm("phyredem", "", 1) |
---|
[1827] | 197 | ENDIF |
---|
| 198 | ENDDO |
---|
| 199 | |
---|
| 200 | DO nsrf = 1, nbsrf |
---|
| 201 | IF (nsrf.LE.99) THEN |
---|
| 202 | WRITE(str2, '(i2.2)') nsrf |
---|
| 203 | CALL put_field("SNOW"//str2, "Neige de surface No."//str2, & |
---|
| 204 | snow(:, nsrf)) |
---|
| 205 | ELSE |
---|
| 206 | PRINT*, "Trop de sous-mailles" |
---|
[1931] | 207 | call abort_gcm("phyredem", "", 1) |
---|
[1827] | 208 | ENDIF |
---|
| 209 | ENDDO |
---|
| 210 | |
---|
| 211 | CALL put_field("RADS", "Rayonnement net a la surface", radsol) |
---|
| 212 | |
---|
| 213 | CALL put_field("solsw", "Rayonnement solaire a la surface", solsw) |
---|
| 214 | |
---|
| 215 | CALL put_field("sollw", "Rayonnement IF a la surface", sollw) |
---|
| 216 | |
---|
[2188] | 217 | CALL put_field("sollwdown", "Rayonnement down IF a la surface", sollw) |
---|
| 218 | |
---|
[1827] | 219 | CALL put_field("fder", "Derive de flux", fder) |
---|
| 220 | |
---|
| 221 | CALL put_field("rain_f", "precipitation liquide", rain_fall) |
---|
| 222 | |
---|
| 223 | CALL put_field("snow_f", "precipitation solide", snow_fall) |
---|
| 224 | |
---|
| 225 | DO nsrf = 1, nbsrf |
---|
| 226 | IF (nsrf.LE.99) THEN |
---|
| 227 | WRITE(str2, '(i2.2)') nsrf |
---|
| 228 | CALL put_field("RUG"//str2, "rugosite de surface No."//str2, & |
---|
| 229 | frugs(:, nsrf)) |
---|
| 230 | ELSE |
---|
| 231 | PRINT*, "Trop de sous-mailles" |
---|
[1931] | 232 | call abort_gcm("phyredem", "", 1) |
---|
[1827] | 233 | ENDIF |
---|
| 234 | ENDDO |
---|
| 235 | |
---|
| 236 | DO nsrf = 1, nbsrf |
---|
| 237 | IF (nsrf.LE.99) THEN |
---|
| 238 | WRITE(str2, '(i2.2)') nsrf |
---|
| 239 | CALL put_field("AGESNO"//str2, & |
---|
| 240 | "Age de la neige surface No."//str2, & |
---|
| 241 | agesno(:, nsrf)) |
---|
| 242 | ELSE |
---|
| 243 | PRINT*, "Trop de sous-mailles" |
---|
[1931] | 244 | call abort_gcm("phyredem", "", 1) |
---|
[1827] | 245 | ENDIF |
---|
| 246 | ENDDO |
---|
| 247 | |
---|
| 248 | CALL put_field("ZMEA", "ZMEA", zmea) |
---|
| 249 | |
---|
| 250 | CALL put_field("ZSTD", "ZSTD", zstd) |
---|
| 251 | |
---|
| 252 | CALL put_field("ZSIG", "ZSIG", zsig) |
---|
| 253 | |
---|
| 254 | CALL put_field("ZGAM", "ZGAM", zgam) |
---|
| 255 | |
---|
| 256 | CALL put_field("ZTHE", "ZTHE", zthe) |
---|
| 257 | |
---|
| 258 | CALL put_field("ZPIC", "ZPIC", zpic) |
---|
| 259 | |
---|
| 260 | CALL put_field("ZVAL", "ZVAL", zval) |
---|
| 261 | |
---|
| 262 | CALL put_field("RUGSREL", "RUGSREL", rugoro) |
---|
| 263 | |
---|
| 264 | CALL put_field("TANCIEN", "TANCIEN", t_ancien) |
---|
| 265 | |
---|
| 266 | CALL put_field("QANCIEN", "QANCIEN", q_ancien) |
---|
| 267 | |
---|
| 268 | CALL put_field("UANCIEN", "", u_ancien) |
---|
| 269 | |
---|
| 270 | CALL put_field("VANCIEN", "", v_ancien) |
---|
| 271 | |
---|
| 272 | CALL put_field("RUGMER", "Longueur de rugosite sur mer", & |
---|
| 273 | frugs(:, is_oce)) |
---|
| 274 | |
---|
| 275 | CALL put_field("CLWCON", "Eau liquide convective", clwcon) |
---|
| 276 | |
---|
| 277 | CALL put_field("RNEBCON", "Nebulosite convective", rnebcon) |
---|
| 278 | |
---|
| 279 | CALL put_field("RATQS", "Ratqs", ratqs) |
---|
| 280 | |
---|
| 281 | ! run_off_lic_0 |
---|
| 282 | |
---|
| 283 | CALL put_field("RUNOFFLIC0", "Runofflic0", run_off_lic_0) |
---|
| 284 | |
---|
| 285 | ! DEB TKE PBL ! |
---|
| 286 | |
---|
| 287 | IF (iflag_pbl>1) then |
---|
| 288 | DO nsrf = 1, nbsrf |
---|
[524] | 289 | IF (nsrf.LE.99) THEN |
---|
[1827] | 290 | WRITE(str2, '(i2.2)') nsrf |
---|
| 291 | CALL put_field("TKE"//str2, "Energ. Cineti. Turb."//str2, & |
---|
| 292 | pbl_tke(:, 1:klev+1, nsrf)) |
---|
[524] | 293 | ELSE |
---|
[1827] | 294 | PRINT*, "Trop de sous-mailles" |
---|
[1931] | 295 | call abort_gcm("phyredem", "", 1) |
---|
[524] | 296 | ENDIF |
---|
[1827] | 297 | ENDDO |
---|
| 298 | ENDIF |
---|
[1619] | 299 | |
---|
[1827] | 300 | ! FIN TKE PBL ! |
---|
| 301 | !IM ajout zmax0, f0, sig1, w01 |
---|
| 302 | !IM wake_deltat, wake_deltaq, wake_s, wake_cstar, wake_pe, wake_fip |
---|
[1619] | 303 | |
---|
[1827] | 304 | CALL put_field("ZMAX0", "ZMAX0", zmax0) |
---|
[1619] | 305 | |
---|
[1827] | 306 | CALL put_field("F0", "F0", f0) |
---|
[878] | 307 | |
---|
[1827] | 308 | CALL put_field("sig1", "sig1 Emanuel", sig1) |
---|
[1001] | 309 | |
---|
[1827] | 310 | CALL put_field("w01", "w01 Emanuel", w01) |
---|
[1001] | 311 | |
---|
[1827] | 312 | ! wake_deltat |
---|
| 313 | CALL put_field("WAKE_DELTAT", "WAKE_DELTAT", wake_deltat) |
---|
[1279] | 314 | |
---|
[1827] | 315 | CALL put_field("WAKE_DELTAQ", "WAKE_DELTAQ", wake_deltaq) |
---|
[1403] | 316 | |
---|
[1827] | 317 | CALL put_field("WAKE_S", "WAKE_S", wake_s) |
---|
[1403] | 318 | |
---|
[1827] | 319 | CALL put_field("WAKE_CSTAR", "WAKE_CSTAR", wake_cstar) |
---|
[1403] | 320 | |
---|
[1827] | 321 | CALL put_field("WAKE_PE", "WAKE_PE", wake_pe) |
---|
[1403] | 322 | |
---|
[1827] | 323 | CALL put_field("WAKE_FIP", "WAKE_FIP", wake_fip) |
---|
[1279] | 324 | |
---|
[1827] | 325 | ! thermiques |
---|
| 326 | |
---|
| 327 | CALL put_field("FM_THERM", "FM_THERM", fm_therm) |
---|
| 328 | |
---|
| 329 | CALL put_field("ENTR_THERM", "ENTR_THERM", entr_therm) |
---|
| 330 | |
---|
| 331 | CALL put_field("DETR_THERM", "DETR_THERM", detr_therm) |
---|
| 332 | |
---|
[2069] | 333 | CALL put_field("ALE_BL", "ALE_BL", Ale_bl) |
---|
| 334 | |
---|
| 335 | CALL put_field("ALE_BL_TRIG", "ALE_BL_TRIG", Ale_bl_trig) |
---|
| 336 | |
---|
| 337 | CALL put_field("ALP_BL", "ALP_BL", Alp_bl) |
---|
| 338 | |
---|
[1827] | 339 | ! trs from traclmdz_mod |
---|
| 340 | IF (type_trac == 'lmdz') THEN |
---|
| 341 | CALL traclmdz_to_restart(trs) |
---|
| 342 | DO it=1, nbtr |
---|
| 343 | iiq=niadv(it+2) |
---|
| 344 | CALL put_field("trs_"//tname(iiq), "", trs(:, it)) |
---|
| 345 | END DO |
---|
| 346 | IF (carbon_cycle_cpl) THEN |
---|
| 347 | IF (.NOT. ALLOCATED(co2_send)) THEN |
---|
| 348 | ! This is the case of create_etat0_limit, ce0l |
---|
| 349 | ALLOCATE(co2_send(klon)) |
---|
| 350 | co2_send(:) = co2_ppm0 |
---|
| 351 | END IF |
---|
| 352 | CALL put_field("co2_send", "co2_ppm for coupling", co2_send) |
---|
| 353 | END IF |
---|
| 354 | END IF |
---|
| 355 | |
---|
[2057] | 356 | ! Restart variables for Slab ocean |
---|
| 357 | IF (type_ocean == 'slab') THEN |
---|
| 358 | CALL put_field("tslab", "Slab ocean temperature", tslab) |
---|
[2209] | 359 | IF (version_ocean == 'sicINT') THEN |
---|
| 360 | CALL put_field("seaice", "Slab seaice (kg/m2)", seaice) |
---|
| 361 | CALL put_field("slab_tice", "Slab sea ice temperature", tice) |
---|
| 362 | END IF |
---|
[2057] | 363 | END IF |
---|
| 364 | |
---|
[1938] | 365 | if (ok_gwd_rando) then |
---|
| 366 | call put_field("du_gwd_rando", & |
---|
| 367 | "tendency on zonal wind due to gravity waves", & |
---|
| 368 | du_gwd_rando) |
---|
| 369 | call put_field("dv_gwd_rando", & |
---|
| 370 | "tendency on meriodional wind due to gravity waves", & |
---|
| 371 | dv_gwd_rando) |
---|
| 372 | end if |
---|
| 373 | |
---|
[1827] | 374 | CALL close_restartphy |
---|
| 375 | !$OMP BARRIER |
---|
| 376 | |
---|
| 377 | END SUBROUTINE phyredem |
---|