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