[3080] | 1 | ! $Id: phyredem.F90 5139 2024-07-29 07:59:33Z abarral $ |
---|
[5099] | 2 | |
---|
[5106] | 3 | SUBROUTINE phyredem(fichnom) |
---|
[5099] | 4 | |
---|
[5111] | 5 | !------------------------------------------------------------------------------- |
---|
| 6 | ! Author: Z.X. Li (LMD/CNRS), 1993/08/18 |
---|
| 7 | !------------------------------------------------------------------------------- |
---|
| 8 | ! Purpose: Write restart state for physics. |
---|
| 9 | !------------------------------------------------------------------------------- |
---|
[2395] | 10 | USE dimphy, ONLY: klon, klev |
---|
[5111] | 11 | USE fonte_neige_mod, ONLY: fonte_neige_final |
---|
| 12 | USE pbl_surface_mod, ONLY: pbl_surface_final |
---|
| 13 | USE phys_state_var_mod, ONLY: radpas, zmasq, pctsrf, & |
---|
| 14 | ftsol, beta_aridity, delta_tsurf, falb_dir, & |
---|
| 15 | falb_dif, qsol, fevap, radsol, solsw, sollw, & |
---|
| 16 | sollwdown, rain_fall, snow_fall, bs_fall, z0m, z0h, & |
---|
| 17 | agesno, zmea, zstd, zsig, zgam, zthe, zpic, & |
---|
| 18 | zval, rugoro, t_ancien, q_ancien, & |
---|
| 19 | prw_ancien, prlw_ancien, prsw_ancien, prbsw_ancien, & |
---|
| 20 | ql_ancien, qs_ancien, qbs_ancien, rneb_ancien, u_ancien, & |
---|
| 21 | v_ancien, clwcon, rnebcon, ratqs, pbl_tke, & |
---|
| 22 | wake_delta_pbl_tke, zmax0, f0, sig1, w01, & |
---|
| 23 | wake_deltat, wake_deltaq, wake_s, awake_s, & |
---|
| 24 | wake_dens, awake_dens, cv_gen, & |
---|
| 25 | wake_cstar, & |
---|
| 26 | wake_pe, wake_fip, fm_therm, entr_therm, & |
---|
| 27 | detr_therm, ale_bl, ale_bl_trig, alp_bl, & |
---|
| 28 | ale_wake, ale_bl_stat, & |
---|
| 29 | du_gwd_rando, du_gwd_front, u10m, v10m, & |
---|
| 30 | treedrg, solswfdiff, delta_sal, ds_ns, dt_ns, & |
---|
| 31 | delta_sst, ratqs_inter_, dter, dser, dt_ds |
---|
[3815] | 32 | |
---|
[5112] | 33 | USE lmdz_geometry, ONLY: longitude_deg, latitude_deg |
---|
[3506] | 34 | USE iostart, ONLY: open_restartphy, close_restartphy, enddef_restartphy, put_field, put_var |
---|
[5101] | 35 | USE traclmdz_mod, ONLY: traclmdz_to_restart |
---|
[4389] | 36 | USE infotrac_phy, ONLY: type_trac, nqtot, tracers, nbtr |
---|
[5101] | 37 | USE carbon_cycle_mod, ONLY: carbon_cycle_cpl, co2_send, carbon_cycle_rad, RCO2_glo |
---|
[2395] | 38 | USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic, epsfra |
---|
| 39 | USE surface_data, ONLY: type_ocean, version_ocean |
---|
[5101] | 40 | USE ocean_slab_mod, ONLY: nslay, tslab, seaice, tice, fsic |
---|
[2344] | 41 | USE time_phylmdz_mod, ONLY: annee_ref, day_end, itau_phy, pdtphys |
---|
[5117] | 42 | USE config_ocean_skin_m, ONLY: activate_ocean_skin |
---|
[5111] | 43 | USE lmdz_abort_physic, ONLY: abort_physic |
---|
[5134] | 44 | USE lmdz_alpale |
---|
[5137] | 45 | USE lmdz_clesphys |
---|
[5139] | 46 | USE lmdz_compbl, ONLY: iflag_pbl, iflag_pbl_split, iflag_order2_sollw, ifl_pbltree |
---|
[967] | 47 | |
---|
[5134] | 48 | IMPLICIT NONE |
---|
[2293] | 49 | |
---|
[1827] | 50 | include "dimsoil.h" |
---|
| 51 | !====================================================================== |
---|
| 52 | CHARACTER*(*) fichnom |
---|
[967] | 53 | |
---|
[1827] | 54 | ! les variables globales ecrites dans le fichier restart |
---|
[782] | 55 | |
---|
[1827] | 56 | REAL tsoil(klon, nsoilmx, nbsrf) |
---|
| 57 | REAL qsurf(klon, nbsrf) |
---|
| 58 | REAL snow(klon, nbsrf) |
---|
[5117] | 59 | REAL fder(klon) |
---|
[1827] | 60 | REAL run_off_lic_0(klon) |
---|
| 61 | REAL trs(klon, nbtr) |
---|
[782] | 62 | |
---|
[1827] | 63 | INTEGER nid, nvarid, idim1, idim2, idim3 |
---|
| 64 | INTEGER ierr |
---|
| 65 | INTEGER length |
---|
[5111] | 66 | PARAMETER (length = 100) |
---|
[1827] | 67 | REAL tab_cntrl(length) |
---|
[782] | 68 | |
---|
[5111] | 69 | INTEGER isoil, nsrf, isw |
---|
| 70 | CHARACTER (len = 2) :: str2 |
---|
| 71 | CHARACTER (len = 256) :: nam, lnam |
---|
| 72 | INTEGER :: it, iq, pass |
---|
[524] | 73 | |
---|
[1827] | 74 | !====================================================================== |
---|
[524] | 75 | |
---|
[1827] | 76 | ! Get variables which will be written to restart file from module |
---|
| 77 | ! pbl_surface_mod |
---|
[5117] | 78 | IF (iflag_physiq <= 1) THEN |
---|
[5111] | 79 | CALL pbl_surface_final(fder, snow, qsurf, tsoil) |
---|
[5117] | 80 | ENDIF |
---|
[1279] | 81 | |
---|
[1827] | 82 | ! Get a variable calculated in module fonte_neige_mod |
---|
| 83 | CALL fonte_neige_final(run_off_lic_0) |
---|
[1001] | 84 | |
---|
[1827] | 85 | !====================================================================== |
---|
[1001] | 86 | |
---|
[1827] | 87 | CALL open_restartphy(fichnom) |
---|
[1001] | 88 | |
---|
[1827] | 89 | DO ierr = 1, length |
---|
[5111] | 90 | tab_cntrl(ierr) = 0.0 |
---|
[1827] | 91 | ENDDO |
---|
[2344] | 92 | tab_cntrl(1) = pdtphys |
---|
[1827] | 93 | tab_cntrl(2) = radpas |
---|
| 94 | ! co2_ppm : current value of atmospheric CO2 |
---|
| 95 | tab_cntrl(3) = co2_ppm |
---|
| 96 | tab_cntrl(4) = solaire |
---|
| 97 | tab_cntrl(5) = iflag_con |
---|
| 98 | tab_cntrl(6) = nbapp_rad |
---|
[524] | 99 | |
---|
[5111] | 100 | IF(iflag_cycle_diurne>=1) tab_cntrl(7) = iflag_cycle_diurne |
---|
| 101 | IF(soil_model) tab_cntrl(8) = 1. |
---|
| 102 | IF(new_oliq) tab_cntrl(9) = 1. |
---|
| 103 | IF(ok_orodr) tab_cntrl(10) = 1. |
---|
| 104 | IF(ok_orolf) tab_cntrl(11) = 1. |
---|
[524] | 105 | |
---|
[1827] | 106 | tab_cntrl(13) = day_end |
---|
| 107 | tab_cntrl(14) = annee_ref |
---|
| 108 | tab_cntrl(15) = itau_phy |
---|
| 109 | |
---|
| 110 | ! co2_ppm0 : initial value of atmospheric CO2 |
---|
[4298] | 111 | ! tab_cntrl(16) = co2_ppm0 |
---|
[1827] | 112 | |
---|
[4298] | 113 | ! PC -- initial value of RCO2 for the radiation scheme |
---|
| 114 | ! tab_cntrl(17) = co2_ppm * 1.0e-06 * RMCO2 / RMD |
---|
| 115 | IF (carbon_cycle_rad) tab_cntrl(17) = RCO2_glo |
---|
| 116 | !PRINT*, "PC : phyredem RCO2_glo =",RCO2_glo |
---|
| 117 | |
---|
[5111] | 118 | DO pass = 1, 2 ! pass=1 netcdf definition ; pass=2 netcdf write |
---|
| 119 | |
---|
[3506] | 120 | CALL put_var(pass, "controle", "Parametres de controle", tab_cntrl) |
---|
[1827] | 121 | |
---|
[5111] | 122 | CALL put_field(pass, "longitude", & |
---|
| 123 | "Longitudes de la grille physique", longitude_deg) |
---|
[1827] | 124 | |
---|
[5111] | 125 | CALL put_field(pass, "latitude", "Latitudes de la grille physique", latitude_deg) |
---|
[1827] | 126 | |
---|
[3506] | 127 | ! PB ajout du masque terre/mer |
---|
[1827] | 128 | |
---|
[5111] | 129 | CALL put_field(pass, "masque", "masque terre mer", zmasq) |
---|
[1827] | 130 | |
---|
[3506] | 131 | ! BP ajout des fraction de chaque sous-surface |
---|
[1827] | 132 | |
---|
[3506] | 133 | ! Get last fractions from slab ocean |
---|
| 134 | IF (type_ocean == 'slab' .AND. version_ocean == "sicINT") THEN |
---|
[5111] | 135 | WHERE (1. - zmasq(:)>EPSFRA) |
---|
| 136 | pctsrf(:, is_oce) = (1. - fsic(:)) * (1. - zmasq(:)) |
---|
| 137 | pctsrf(:, is_sic) = fsic(:) * (1. - zmasq(:)) |
---|
| 138 | END WHERE |
---|
[3506] | 139 | END IF |
---|
[2209] | 140 | |
---|
[3506] | 141 | ! 1. fraction de terre |
---|
[1827] | 142 | |
---|
[5111] | 143 | CALL put_field(pass, "FTER", "fraction de continent", pctsrf(:, is_ter)) |
---|
[1827] | 144 | |
---|
[3506] | 145 | ! 2. Fraction de glace de terre |
---|
[1827] | 146 | |
---|
[5111] | 147 | CALL put_field(pass, "FLIC", "fraction glace de terre", pctsrf(:, is_lic)) |
---|
[3506] | 148 | ! 3. fraction ocean |
---|
[1827] | 149 | |
---|
[5111] | 150 | CALL put_field(pass, "FOCE", "fraction ocean", pctsrf(:, is_oce)) |
---|
[1827] | 151 | |
---|
[3506] | 152 | ! 4. Fraction glace de mer |
---|
[1827] | 153 | |
---|
[5111] | 154 | CALL put_field(pass, "FSIC", "fraction glace mer", pctsrf(:, is_sic)) |
---|
[1827] | 155 | |
---|
[3506] | 156 | IF(nbsrf>99) THEN |
---|
| 157 | PRINT*, "Trop de sous-mailles"; CALL abort_physic("phyredem", "", 1) |
---|
| 158 | END IF |
---|
| 159 | IF(nsoilmx>99) THEN |
---|
| 160 | PRINT*, "Trop de sous-surfaces"; CALL abort_physic("phyredem", "", 1) |
---|
| 161 | END IF |
---|
| 162 | IF(nsw>99) THEN |
---|
| 163 | PRINT*, "Trop de bandes"; CALL abort_physic("phyredem", "", 1) |
---|
| 164 | END IF |
---|
[1827] | 165 | |
---|
[5111] | 166 | ! Surface variables |
---|
| 167 | CALL put_field_srf1(pass, "TS", "Temperature", ftsol(:, :)) |
---|
[2293] | 168 | |
---|
[5116] | 169 | IF (iflag_pbl>1 .AND. iflag_wake>=1 .AND. iflag_pbl_split >=1) THEN |
---|
[5111] | 170 | CALL put_field_srf1(pass, "DELTATS", & |
---|
| 171 | "w-x surface temperature difference", delta_tsurf(:, :)) |
---|
| 172 | CALL put_field_srf1(pass, "BETAS", "Aridity factor", beta_aridity(:, :)) |
---|
[4035] | 173 | end IF |
---|
[5111] | 174 | ! End surface variables |
---|
[3888] | 175 | |
---|
[5111] | 176 | ! ================== Albedo ======================================= |
---|
| 177 | PRINT*, 'PHYREDEM NOUVEAU' |
---|
| 178 | CALL put_field_srf2(pass, "A_dir_SW", "Albedo direct", falb_dir(:, :, :)) |
---|
| 179 | CALL put_field_srf2(pass, "A_dif_SW", "Albedo diffus", falb_dif(:, :, :)) |
---|
[2237] | 180 | |
---|
[5111] | 181 | CALL put_field_srf1(pass, "U10M", "u a 10m", u10m) |
---|
[2569] | 182 | |
---|
[5111] | 183 | CALL put_field_srf1(pass, "V10M", "v a 10m", v10m) |
---|
[2569] | 184 | |
---|
| 185 | |
---|
[5111] | 186 | ! ================== Tsoil ========================================= |
---|
| 187 | CALL put_field_srf2(pass, "Tsoil", "Temperature", tsoil(:, :, :)) |
---|
| 188 | !FC |
---|
| 189 | ! CALL put_field_srf2("treedrg","freinage arbres",treedrg(:,:,:)) |
---|
| 190 | CALL put_field(pass, "treedrg_ter", "freinage arbres", treedrg(:, :, is_ter)) |
---|
[524] | 191 | |
---|
[5111] | 192 | CALL put_field_srf1(pass, "QS", "Humidite", qsurf(:, :)) |
---|
[2952] | 193 | |
---|
[5111] | 194 | CALL put_field (pass, "QSOL", "Eau dans le sol (mm)", qsol) |
---|
[1827] | 195 | |
---|
[5111] | 196 | CALL put_field_srf1(pass, "EVAP", "Evaporation", fevap(:, :)) |
---|
[1827] | 197 | |
---|
[5111] | 198 | CALL put_field_srf1(pass, "SNOW", "Neige", snow(:, :)) |
---|
[1827] | 199 | |
---|
[5111] | 200 | CALL put_field(pass, "RADS", "Rayonnement net a la surface", radsol) |
---|
[1827] | 201 | |
---|
[5111] | 202 | CALL put_field(pass, "solsw", "Rayonnement solaire a la surface", solsw) |
---|
[1827] | 203 | |
---|
[5111] | 204 | CALL put_field(pass, "solswfdiff", "Fraction du rayonnement solaire a la surface qui est diffus", solswfdiff) |
---|
[1827] | 205 | |
---|
[5111] | 206 | CALL put_field(pass, "sollw", "Rayonnement IF a la surface", sollw) |
---|
[3756] | 207 | |
---|
[5111] | 208 | CALL put_field(pass, "sollwdown", "Rayonnement down IF a la surface", sollwdown) |
---|
[1827] | 209 | |
---|
[5111] | 210 | CALL put_field(pass, "fder", "Derive de flux", fder) |
---|
[2188] | 211 | |
---|
[5111] | 212 | CALL put_field(pass, "rain_f", "precipitation liquide", rain_fall) |
---|
[1827] | 213 | |
---|
[5111] | 214 | CALL put_field(pass, "snow_f", "precipitation solide", snow_fall) |
---|
[1827] | 215 | |
---|
[5111] | 216 | CALL put_field_srf1(pass, "Z0m", "rugosite", z0m(:, :)) |
---|
[1827] | 217 | |
---|
[5111] | 218 | CALL put_field_srf1(pass, "Z0h", "rugosite", z0h(:, :)) |
---|
[1827] | 219 | |
---|
[5111] | 220 | CALL put_field_srf1(pass, "AGESNO", "Age de la neige", agesno(:, :)) |
---|
[1827] | 221 | |
---|
[5111] | 222 | CALL put_field(pass, "ZMEA", "ZMEA", zmea) |
---|
[2293] | 223 | |
---|
[5111] | 224 | CALL put_field(pass, "ZSTD", "ZSTD", zstd) |
---|
[1827] | 225 | |
---|
[5111] | 226 | CALL put_field(pass, "ZSIG", "ZSIG", zsig) |
---|
[1827] | 227 | |
---|
[5111] | 228 | CALL put_field(pass, "ZGAM", "ZGAM", zgam) |
---|
[1827] | 229 | |
---|
[5111] | 230 | CALL put_field(pass, "ZTHE", "ZTHE", zthe) |
---|
[1827] | 231 | |
---|
[5111] | 232 | CALL put_field(pass, "ZPIC", "ZPIC", zpic) |
---|
[1827] | 233 | |
---|
[5111] | 234 | CALL put_field(pass, "ZVAL", "ZVAL", zval) |
---|
[1827] | 235 | |
---|
[5111] | 236 | CALL put_field(pass, "RUGSREL", "RUGSREL", rugoro) |
---|
[1827] | 237 | |
---|
[5111] | 238 | CALL put_field(pass, "TANCIEN", "TANCIEN", t_ancien) |
---|
[1827] | 239 | |
---|
[5111] | 240 | CALL put_field(pass, "QANCIEN", "QANCIEN", q_ancien) |
---|
[1827] | 241 | |
---|
[5111] | 242 | CALL put_field(pass, "QLANCIEN", "QLANCIEN", ql_ancien) |
---|
[1827] | 243 | |
---|
[5111] | 244 | CALL put_field(pass, "QSANCIEN", "QSANCIEN", qs_ancien) |
---|
[2497] | 245 | |
---|
[4523] | 246 | IF (ok_bs) THEN |
---|
[5111] | 247 | CALL put_field(pass, "bs_f", "precipitation neige soufflee", bs_fall) |
---|
| 248 | CALL put_field(pass, "QBSANCIEN", "QBSANCIEN", qbs_ancien) |
---|
| 249 | CALL put_field(pass, "PRBSWANCIEN", "PRBSWANCIEN", prbsw_ancien) |
---|
[4523] | 250 | ENDIF |
---|
| 251 | |
---|
[5111] | 252 | CALL put_field(pass, "RNEBANCIEN", "RNEBANCIEN", rneb_ancien) |
---|
[4059] | 253 | |
---|
[5111] | 254 | CALL put_field(pass, "PRWANCIEN", "PRWANCIEN", prw_ancien) |
---|
[1827] | 255 | |
---|
[5111] | 256 | CALL put_field(pass, "PRLWANCIEN", "PRLWANCIEN", prlw_ancien) |
---|
[1827] | 257 | |
---|
[5111] | 258 | CALL put_field(pass, "PRSWANCIEN", "PRSWANCIEN", prsw_ancien) |
---|
[2499] | 259 | |
---|
[5111] | 260 | CALL put_field(pass, "UANCIEN", "UANCIEN", u_ancien) |
---|
[2499] | 261 | |
---|
[5111] | 262 | CALL put_field(pass, "VANCIEN", "VANCIEN", v_ancien) |
---|
[2499] | 263 | |
---|
[5111] | 264 | CALL put_field(pass, "CLWCON", "Eau liquide convective", clwcon) |
---|
[1827] | 265 | |
---|
[5111] | 266 | CALL put_field(pass, "RNEBCON", "Nebulosite convective", rnebcon) |
---|
[1827] | 267 | |
---|
[5111] | 268 | CALL put_field(pass, "RATQS", "Ratqs", ratqs) |
---|
[1827] | 269 | |
---|
[3506] | 270 | ! run_off_lic_0 |
---|
[1827] | 271 | |
---|
[5111] | 272 | CALL put_field(pass, "RUNOFFLIC0", "Runofflic0", run_off_lic_0) |
---|
[1827] | 273 | |
---|
[3506] | 274 | ! DEB TKE PBL ! |
---|
[1827] | 275 | |
---|
[5116] | 276 | IF (iflag_pbl>1) THEN |
---|
[5111] | 277 | CALL put_field_srf3(pass, "TKE", "Energ. Cineti. Turb.", & |
---|
| 278 | pbl_tke(:, :, :)) |
---|
| 279 | CALL put_field_srf3(pass, "DELTATKE", "Del TKE wk/env.", & |
---|
| 280 | wake_delta_pbl_tke(:, :, :)) |
---|
[3506] | 281 | END IF |
---|
[1619] | 282 | |
---|
[3506] | 283 | ! FIN TKE PBL ! |
---|
| 284 | !IM ajout zmax0, f0, sig1, w01 |
---|
| 285 | !IM wake_deltat, wake_deltaq, wake_s, wake_cstar, wake_pe, wake_fip |
---|
[1619] | 286 | |
---|
[5111] | 287 | CALL put_field(pass, "ZMAX0", "ZMAX0", zmax0) |
---|
[1619] | 288 | |
---|
[5111] | 289 | CALL put_field(pass, "F0", "F0", f0) |
---|
[878] | 290 | |
---|
[5111] | 291 | CALL put_field(pass, "sig1", "sig1 Emanuel", sig1) |
---|
[1001] | 292 | |
---|
[5111] | 293 | CALL put_field(pass, "w01", "w01 Emanuel", w01) |
---|
[1001] | 294 | |
---|
[3506] | 295 | ! wake_deltat |
---|
[5111] | 296 | CALL put_field(pass, "WAKE_DELTAT", "WAKE_DELTAT", wake_deltat) |
---|
[1279] | 297 | |
---|
[5111] | 298 | CALL put_field(pass, "WAKE_DELTAQ", "WAKE_DELTAQ", wake_deltaq) |
---|
[1403] | 299 | |
---|
[5111] | 300 | CALL put_field(pass, "WAKE_S", "Wake frac. area", wake_s) |
---|
[1403] | 301 | |
---|
[5111] | 302 | CALL put_field(pass, "AWAKE_S", "Active Wake frac. area", awake_s) |
---|
[4744] | 303 | |
---|
[5111] | 304 | CALL put_field(pass, "WAKE_DENS", "Wake num. /unit area", wake_dens) |
---|
[2635] | 305 | |
---|
[5111] | 306 | CALL put_field(pass, "AWAKE_DENS", "Active Wake num. /unit area", awake_dens) |
---|
[3956] | 307 | |
---|
[5111] | 308 | CALL put_field(pass, "CV_GEN", "CB birth rate", cv_gen) |
---|
[3956] | 309 | |
---|
[5111] | 310 | CALL put_field(pass, "WAKE_CSTAR", "WAKE_CSTAR", wake_cstar) |
---|
[1403] | 311 | |
---|
[5111] | 312 | CALL put_field(pass, "WAKE_PE", "WAKE_PE", wake_pe) |
---|
[1403] | 313 | |
---|
[5111] | 314 | CALL put_field(pass, "WAKE_FIP", "WAKE_FIP", wake_fip) |
---|
[1279] | 315 | |
---|
[3506] | 316 | ! thermiques |
---|
[1827] | 317 | |
---|
[5111] | 318 | CALL put_field(pass, "FM_THERM", "FM_THERM", fm_therm) |
---|
[1827] | 319 | |
---|
[5111] | 320 | CALL put_field(pass, "ENTR_THERM", "ENTR_THERM", entr_therm) |
---|
[1827] | 321 | |
---|
[5111] | 322 | CALL put_field(pass, "DETR_THERM", "DETR_THERM", detr_therm) |
---|
[1827] | 323 | |
---|
[5111] | 324 | CALL put_field(pass, "ALE_BL", "ALE_BL", ale_bl) |
---|
[2069] | 325 | |
---|
[5111] | 326 | CALL put_field(pass, "ALE_BL_TRIG", "ALE_BL_TRIG", ale_bl_trig) |
---|
[2069] | 327 | |
---|
[5111] | 328 | CALL put_field(pass, "ALP_BL", "ALP_BL", alp_bl) |
---|
[2069] | 329 | |
---|
[5111] | 330 | CALL put_field(pass, "ALE_WAKE", "ALE_WAKE", ale_wake) |
---|
[3080] | 331 | |
---|
[5111] | 332 | CALL put_field(pass, "ALE_BL_STAT", "ALE_BL_STAT", ale_bl_stat) |
---|
[3080] | 333 | |
---|
| 334 | |
---|
[3856] | 335 | ! fisrtilp/clouds |
---|
[5111] | 336 | CALL put_field(pass, "RATQS_INTER", "Relative width of the lsc sugrid scale water", ratqs_inter_) |
---|
[3856] | 337 | |
---|
[5111] | 338 | IF (ANY(type_trac == ['co2i', 'inco'])) THEN |
---|
| 339 | IF (carbon_cycle_cpl) THEN |
---|
| 340 | IF (.NOT. ALLOCATED(co2_send)) THEN |
---|
| 341 | ! This is the case of create_etat0_limit, ce0l |
---|
| 342 | ALLOCATE(co2_send(klon)) |
---|
| 343 | co2_send(:) = co2_ppm0 |
---|
| 344 | END IF |
---|
| 345 | CALL put_field(pass, "co2_send", "co2_ppm for coupling", co2_send) |
---|
| 346 | END IF |
---|
[3856] | 347 | |
---|
[5111] | 348 | ! trs from traclmdz_mod |
---|
[4263] | 349 | ELSE IF (type_trac == 'lmdz') THEN |
---|
[5111] | 350 | CALL traclmdz_to_restart(trs) |
---|
| 351 | it = 0 |
---|
| 352 | DO iq = 1, nqtot |
---|
| 353 | IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE |
---|
| 354 | it = it + 1 |
---|
| 355 | CALL put_field(pass, "trs_" // tracers(iq)%name, "", trs(:, it)) |
---|
| 356 | END DO |
---|
[3933] | 357 | END IF |
---|
| 358 | |
---|
[3506] | 359 | ! Restart variables for Slab ocean |
---|
| 360 | IF (type_ocean == 'slab') THEN |
---|
[5111] | 361 | IF (nslay==1) THEN |
---|
| 362 | CALL put_field(pass, "tslab", "Slab ocean temperature", tslab) |
---|
| 363 | ELSE |
---|
| 364 | DO it = 1, nslay |
---|
| 365 | WRITE(str2, '(i2.2)') it |
---|
| 366 | CALL put_field(pass, "tslab" // str2, "Slab ocean temperature", tslab(:, it)) |
---|
| 367 | END DO |
---|
| 368 | END IF |
---|
| 369 | IF (version_ocean == 'sicINT') THEN |
---|
| 370 | CALL put_field(pass, "seaice", "Slab seaice (kg/m2)", seaice) |
---|
| 371 | CALL put_field(pass, "slab_tice", "Slab sea ice temperature", tice) |
---|
| 372 | END IF |
---|
[3506] | 373 | END IF |
---|
[1827] | 374 | |
---|
[5117] | 375 | IF (ok_gwd_rando) CALL put_field(pass, "du_gwd_rando", & |
---|
[5111] | 376 | "tendency on zonal wind due to flott gravity waves", du_gwd_rando) |
---|
[2057] | 377 | |
---|
[5117] | 378 | IF (.NOT. ok_hines .AND. ok_gwd_rando) CALL put_field(pass, "du_gwd_front", & |
---|
[5111] | 379 | "tendency on zonal wind due to acama gravity waves", du_gwd_front) |
---|
[1938] | 380 | |
---|
[5117] | 381 | IF (activate_ocean_skin >= 1) THEN |
---|
| 382 | IF (activate_ocean_skin == 2 .AND. type_ocean == 'couple') THEN |
---|
[5111] | 383 | CALL put_field(pass, "delta_sal", & |
---|
| 384 | "ocean-air interface salinity minus bulk salinity", delta_sal) |
---|
| 385 | CALL put_field(pass, "delta_SST", & |
---|
| 386 | "ocean-air interface temperature minus bulk SST", delta_sst) |
---|
| 387 | CALL put_field(pass, "dter", & |
---|
| 388 | "ocean-air interface temperature minus subskin temperature", & |
---|
| 389 | dter) |
---|
| 390 | CALL put_field(pass, "dser", & |
---|
| 391 | "ocean-air interface salinity minus subskin salinity", dser) |
---|
| 392 | CALL put_field(pass, "dt_ds", & |
---|
| 393 | "(tks / tkt) * dTer", dt_ds) |
---|
| 394 | end if |
---|
| 395 | |
---|
| 396 | CALL put_field(pass, "dS_ns", "delta salinity near surface", ds_ns) |
---|
| 397 | CALL put_field(pass, "dT_ns", "delta temperature near surface", dT_ns) |
---|
[3815] | 398 | end if |
---|
[5111] | 399 | |
---|
[3506] | 400 | IF (pass==1) CALL enddef_restartphy |
---|
| 401 | IF (pass==2) CALL close_restartphy |
---|
[4046] | 402 | ENDDO ! DO pass=1,2 ! pass=1 netcdf definition ; pass=2 netcdf write |
---|
[5111] | 403 | |
---|
[1827] | 404 | !$OMP BARRIER |
---|
| 405 | |
---|
[2293] | 406 | |
---|
[5111] | 407 | CONTAINS |
---|
[2293] | 408 | |
---|
| 409 | |
---|
[5111] | 410 | SUBROUTINE put_field_srf1(pass, nam, lnam, field) |
---|
[2293] | 411 | |
---|
[5111] | 412 | IMPLICIT NONE |
---|
| 413 | INTEGER, INTENT(IN) :: pass |
---|
| 414 | CHARACTER(LEN = *), INTENT(IN) :: nam, lnam |
---|
| 415 | REAL, INTENT(IN) :: field(:, :) |
---|
| 416 | CHARACTER(LEN = 256) :: nm, lm, str |
---|
| 417 | DO nsrf = 1, SIZE(field, 2) |
---|
| 418 | WRITE(str, '(i2.2)') nsrf |
---|
| 419 | nm = TRIM(nam) // TRIM(str) |
---|
| 420 | lm = TRIM(lnam) // " de surface No. " // TRIM(str) |
---|
| 421 | CALL put_field(pass, nm, lm, field(:, nsrf)) |
---|
| 422 | END DO |
---|
[2293] | 423 | |
---|
[5111] | 424 | END SUBROUTINE put_field_srf1 |
---|
[2293] | 425 | |
---|
| 426 | |
---|
[5111] | 427 | SUBROUTINE put_field_srf2(pass, nam, lnam, field) |
---|
[2293] | 428 | |
---|
[5111] | 429 | IMPLICIT NONE |
---|
| 430 | INTEGER, INTENT(IN) :: pass |
---|
| 431 | CHARACTER(LEN = *), INTENT(IN) :: nam, lnam |
---|
| 432 | REAL, INTENT(IN) :: field(:, :, :) |
---|
| 433 | CHARACTER(LEN = 256) :: nm, lm, str |
---|
| 434 | DO nsrf = 1, SIZE(field, 3) |
---|
| 435 | DO isoil = 1, SIZE(field, 2) |
---|
| 436 | WRITE(str, '(i2.2,"srf",i2.2)')isoil, nsrf |
---|
| 437 | ! WRITE(lunout,*)"PHYREDEM ",TRIM(nam)//TRIM(str) |
---|
| 438 | nm = TRIM(nam) // TRIM(str) |
---|
| 439 | lm = TRIM(lnam) // " du sol No. " // TRIM(str) |
---|
| 440 | CALL put_field(pass, nm, lm, field(:, isoil, nsrf)) |
---|
| 441 | END DO |
---|
[2293] | 442 | END DO |
---|
| 443 | |
---|
[5111] | 444 | END SUBROUTINE put_field_srf2 |
---|
[2293] | 445 | |
---|
| 446 | |
---|
[5111] | 447 | SUBROUTINE put_field_srf3(pass, nam, lnam, field) |
---|
[2293] | 448 | |
---|
[5111] | 449 | IMPLICIT NONE |
---|
| 450 | INTEGER, INTENT(IN) :: pass |
---|
| 451 | CHARACTER(LEN = *), INTENT(IN) :: nam, lnam |
---|
| 452 | REAL, INTENT(IN) :: field(:, :, :) |
---|
| 453 | CHARACTER(LEN = 256) :: nm, lm, str |
---|
| 454 | DO nsrf = 1, SIZE(field, 3) |
---|
| 455 | WRITE(str, '(i2.2)') nsrf |
---|
| 456 | nm = TRIM(nam) // TRIM(str) |
---|
| 457 | lm = TRIM(lnam) // TRIM(str) |
---|
| 458 | CALL put_field(pass, nm, lm, field(:, 1:klev + 1, nsrf)) |
---|
| 459 | END DO |
---|
[2293] | 460 | |
---|
[5111] | 461 | END SUBROUTINE put_field_srf3 |
---|
[2293] | 462 | |
---|
| 463 | |
---|
[1827] | 464 | END SUBROUTINE phyredem |
---|