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