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