[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 |
---|
[1191] | 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) |
---|
[1191] | 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 |
---|
[1191] | 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 |
---|
| 76 | tab_cntrl(1) = dtime |
---|
| 77 | tab_cntrl(2) = radpas |
---|
| 78 | tab_cntrl(3) = co2_ppm |
---|
| 79 | tab_cntrl(4) = solaire |
---|
| 80 | tab_cntrl(5) = iflag_con |
---|
| 81 | tab_cntrl(6) = nbapp_rad |
---|
| 82 | |
---|
| 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. |
---|
| 88 | |
---|
| 89 | tab_cntrl(13) = day_end |
---|
| 90 | tab_cntrl(14) = annee_ref |
---|
| 91 | tab_cntrl(15) = itau_phy |
---|
| 92 | c |
---|
[1001] | 93 | CALL put_var("controle","Parametres de controle",tab_cntrl) |
---|
[524] | 94 | c |
---|
[1001] | 95 | |
---|
| 96 | CALL put_field("longitude", |
---|
| 97 | . "Longitudes de la grille physique",rlon) |
---|
| 98 | |
---|
| 99 | CALL put_field("latitude","Latitudes de la grille physique",rlat) |
---|
| 100 | |
---|
[524] | 101 | c |
---|
| 102 | C PB ajout du masque terre/mer |
---|
| 103 | C |
---|
[1001] | 104 | CALL put_field("masque","masque terre mer",zmasq) |
---|
| 105 | |
---|
[524] | 106 | c BP ajout des fraction de chaque sous-surface |
---|
| 107 | C |
---|
| 108 | C 1. fraction de terre |
---|
| 109 | C |
---|
[1001] | 110 | CALL put_field("FTER","fraction de continent",pctsrf(:,is_ter)) |
---|
[524] | 111 | C |
---|
| 112 | C 2. Fraction de glace de terre |
---|
| 113 | C |
---|
[1001] | 114 | CALL put_field("FLIC","fraction glace de terre",pctsrf(:,is_lic)) |
---|
[524] | 115 | C |
---|
| 116 | C 3. fraction ocean |
---|
| 117 | C |
---|
[1001] | 118 | CALL put_field("FOCE","fraction ocean",pctsrf(:,is_oce)) |
---|
[524] | 119 | C |
---|
| 120 | C 4. Fraction glace de mer |
---|
| 121 | C |
---|
[1001] | 122 | CALL put_field("FSIC","fraction glace mer",pctsrf(:,is_sic)) |
---|
[524] | 123 | C |
---|
| 124 | C |
---|
| 125 | c |
---|
| 126 | DO nsrf = 1, nbsrf |
---|
| 127 | IF (nsrf.LE.99) THEN |
---|
[1001] | 128 | WRITE(str2,'(i2.2)') nsrf |
---|
| 129 | CALL put_field("TS"//str2,"Temperature de surface No."//str2, |
---|
| 130 | . ftsol(:,nsrf)) |
---|
[524] | 131 | ELSE |
---|
[1001] | 132 | PRINT*, "Trop de sous-mailles" |
---|
| 133 | CALL abort |
---|
[524] | 134 | ENDIF |
---|
| 135 | ENDDO |
---|
| 136 | c |
---|
| 137 | DO nsrf = 1, nbsrf |
---|
[1001] | 138 | DO isoil=1, nsoilmx |
---|
| 139 | IF (isoil.LE.99 .AND. nsrf.LE.99) THEN |
---|
| 140 | WRITE(str7,'(i2.2,"srf",i2.2)') isoil,nsrf |
---|
| 141 | CALL put_field("Tsoil"//str7,"Temperature du sol No."//str7, |
---|
| 142 | . tsoil(:,isoil,nsrf)) |
---|
| 143 | ELSE |
---|
| 144 | PRINT*, "Trop de couches" |
---|
| 145 | CALL abort |
---|
| 146 | ENDIF |
---|
| 147 | ENDDO |
---|
[524] | 148 | ENDDO |
---|
| 149 | c |
---|
| 150 | DO nsrf = 1, nbsrf |
---|
| 151 | IF (nsrf.LE.99) THEN |
---|
[1001] | 152 | WRITE(str2,'(i2.2)') nsrf |
---|
| 153 | CALL put_field("QS"//str2,"Humidite de surface No."//str2, |
---|
| 154 | . qsurf(:,nsrf)) |
---|
[524] | 155 | ELSE |
---|
[1001] | 156 | PRINT*, "Trop de sous-mailles" |
---|
| 157 | CALL abort |
---|
[524] | 158 | ENDIF |
---|
| 159 | END DO |
---|
| 160 | C |
---|
[1001] | 161 | CALL put_field("QSOL","Eau dans le sol (mm)",qsol) |
---|
[524] | 162 | c |
---|
| 163 | DO nsrf = 1, nbsrf |
---|
| 164 | IF (nsrf.LE.99) THEN |
---|
[1001] | 165 | WRITE(str2,'(i2.2)') nsrf |
---|
| 166 | CALL put_field("ALBE"//str2,"albedo de surface No."//str2, |
---|
| 167 | . falb1(:,nsrf)) |
---|
[524] | 168 | ELSE |
---|
[1001] | 169 | PRINT*, "Trop de sous-mailles" |
---|
| 170 | CALL abort |
---|
[524] | 171 | ENDIF |
---|
| 172 | ENDDO |
---|
| 173 | |
---|
[1001] | 174 | DO nsrf = 1, nbsrf |
---|
[524] | 175 | IF (nsrf.LE.99) THEN |
---|
[1001] | 176 | WRITE(str2,'(i2.2)') nsrf |
---|
| 177 | CALL put_field("ALBLW"//str2,"albedo LW de surface No."//str2, |
---|
| 178 | . falb2(:,nsrf)) |
---|
[524] | 179 | ELSE |
---|
[1001] | 180 | PRINT*, "Trop de sous-mailles" |
---|
| 181 | CALL abort |
---|
[524] | 182 | ENDIF |
---|
| 183 | ENDDO |
---|
| 184 | c |
---|
[888] | 185 | c |
---|
[524] | 186 | DO nsrf = 1, nbsrf |
---|
| 187 | IF (nsrf.LE.99) THEN |
---|
[1001] | 188 | WRITE(str2,'(i2.2)') nsrf |
---|
| 189 | CALL put_field("EVAP"//str2,"Evaporation de surface No."//str2 |
---|
| 190 | . ,evap(:,nsrf)) |
---|
[524] | 191 | ELSE |
---|
[1001] | 192 | PRINT*, "Trop de sous-mailles" |
---|
| 193 | CALL abort |
---|
[524] | 194 | ENDIF |
---|
| 195 | ENDDO |
---|
| 196 | |
---|
| 197 | c |
---|
| 198 | DO nsrf = 1, nbsrf |
---|
| 199 | IF (nsrf.LE.99) THEN |
---|
[1001] | 200 | WRITE(str2,'(i2.2)') nsrf |
---|
| 201 | CALL put_field("SNOW"//str2,"Neige de surface No."//str2, |
---|
| 202 | . snow(:,nsrf)) |
---|
[524] | 203 | ELSE |
---|
[1001] | 204 | PRINT*, "Trop de sous-mailles" |
---|
| 205 | CALL abort |
---|
[524] | 206 | ENDIF |
---|
| 207 | ENDDO |
---|
| 208 | |
---|
| 209 | c |
---|
[1001] | 210 | CALL put_field("RADS","Rayonnement net a la surface",radsol) |
---|
[524] | 211 | c |
---|
[1001] | 212 | CALL put_field("solsw","Rayonnement solaire a la surface",solsw) |
---|
[524] | 213 | c |
---|
[1001] | 214 | CALL put_field("sollw","Rayonnement IF a la surface",sollw) |
---|
[524] | 215 | c |
---|
[1001] | 216 | CALL put_field("fder","Derive de flux",fder) |
---|
[524] | 217 | c |
---|
[1001] | 218 | CALL put_field("rain_f","precipitation liquide",rain_fall) |
---|
[524] | 219 | c |
---|
[1001] | 220 | CALL put_field("snow_f", "precipitation solide",snow_fall) |
---|
[524] | 221 | c |
---|
| 222 | DO nsrf = 1, nbsrf |
---|
| 223 | IF (nsrf.LE.99) THEN |
---|
| 224 | WRITE(str2,'(i2.2)') nsrf |
---|
[1001] | 225 | CALL put_field("RUG"//str2,"rugosite de surface No."//str2, |
---|
| 226 | . frugs(:,nsrf)) |
---|
[524] | 227 | ELSE |
---|
[1001] | 228 | PRINT*, "Trop de sous-mailles" |
---|
| 229 | CALL abort |
---|
[524] | 230 | ENDIF |
---|
| 231 | ENDDO |
---|
| 232 | c |
---|
| 233 | DO nsrf = 1, nbsrf |
---|
| 234 | IF (nsrf.LE.99) THEN |
---|
| 235 | WRITE(str2,'(i2.2)') nsrf |
---|
[1001] | 236 | CALL put_field("AGESNO"//str2, |
---|
| 237 | . "Age de la neige surface No."//str2, |
---|
| 238 | . agesno(:,nsrf)) |
---|
[524] | 239 | ELSE |
---|
| 240 | PRINT*, "Trop de sous-mailles" |
---|
| 241 | CALL abort |
---|
| 242 | ENDIF |
---|
| 243 | ENDDO |
---|
| 244 | c |
---|
[1001] | 245 | CALL put_field("ZMEA","",zmea) |
---|
[524] | 246 | c |
---|
[1001] | 247 | CALL put_field("ZSTD","",zstd) |
---|
| 248 | |
---|
| 249 | CALL put_field("ZSIG","",zsig) |
---|
| 250 | |
---|
| 251 | CALL put_field("ZGAM","",zgam) |
---|
| 252 | |
---|
| 253 | CALL put_field("ZTHE","",zthe) |
---|
| 254 | |
---|
| 255 | CALL put_field("ZPIC","",zpic) |
---|
| 256 | |
---|
| 257 | CALL put_field("ZVAL","",zval) |
---|
| 258 | |
---|
| 259 | CALL put_field("RUGSREL","RUGSREL",rugoro) |
---|
| 260 | |
---|
| 261 | CALL put_field("TANCIEN","",t_ancien) |
---|
| 262 | |
---|
| 263 | CALL put_field("QANCIEN","",q_ancien) |
---|
| 264 | |
---|
| 265 | CALL put_field("RUGMER","Longueur de rugosite sur mer", |
---|
| 266 | . frugs(:,is_oce)) |
---|
| 267 | |
---|
| 268 | CALL put_field("CLWCON","Eau liquide convective",clwcon(:,1)) |
---|
| 269 | |
---|
| 270 | CALL put_field("RNEBCON","Nebulosite convective",rnebcon(:,1)) |
---|
| 271 | |
---|
| 272 | CALL put_field("RATQS", "Ratqs",ratqs(:,1)) |
---|
[524] | 273 | c |
---|
| 274 | c run_off_lic_0 |
---|
| 275 | c |
---|
[1001] | 276 | CALL put_field("RUNOFFLIC0","Runofflic0",run_off_lic_0) |
---|
[524] | 277 | c |
---|
| 278 | c |
---|
[878] | 279 | !!!!!!!!!!!!!!!!!!!! DEB TKE PBL !!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 280 | c |
---|
| 281 | IF (iflag_pbl>1) then |
---|
[1001] | 282 | DO nsrf = 1, nbsrf |
---|
| 283 | IF (nsrf.LE.99) THEN |
---|
[878] | 284 | WRITE(str2,'(i2.2)') nsrf |
---|
[1001] | 285 | CALL put_field("TKE"//str2,"Energ. Cineti. Turb."//str2, |
---|
| 286 | . pbl_tke(:,1:klev,nsrf)) |
---|
| 287 | ELSE |
---|
[878] | 288 | PRINT*, "Trop de sous-mailles" |
---|
| 289 | CALL abort |
---|
[1001] | 290 | ENDIF |
---|
| 291 | ENDDO |
---|
[878] | 292 | ENDIF |
---|
| 293 | |
---|
| 294 | !!!!!!!!!!!!!!!!!!!! FIN TKE PBL !!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[973] | 295 | cIM ajout zmax0, f0, ema_work1, ema_work2 |
---|
| 296 | cIM wake_deltat, wake_deltaq, wake_s, wake_cstar, wake_fip |
---|
[1001] | 297 | |
---|
| 298 | CALL put_field("ZMAX0","",zmax0) |
---|
| 299 | |
---|
| 300 | CALL put_field("F0","",f0) |
---|
| 301 | |
---|
| 302 | CALL put_field("EMA_WORK1","",ema_work1) |
---|
| 303 | |
---|
| 304 | CALL put_field("EMA_WORK2","",ema_work2) |
---|
| 305 | |
---|
[973] | 306 | c wake_deltat |
---|
[1001] | 307 | CALL put_field("WAKE_DELTAT","",wake_deltat) |
---|
| 308 | |
---|
| 309 | CALL put_field("WAKE_DELTAQ","",wake_deltaq) |
---|
| 310 | |
---|
| 311 | CALL put_field("WAKE_S","",wake_s) |
---|
| 312 | |
---|
| 313 | CALL put_field("WAKE_CSTAR","",wake_cstar) |
---|
| 314 | |
---|
| 315 | CALL put_field("WAKE_FIP","",wake_fip) |
---|
| 316 | |
---|
[1191] | 317 | |
---|
| 318 | ! trs from traclmdz_mod |
---|
| 319 | IF (type_trac == 'lmdz') THEN |
---|
| 320 | CALL traclmdz_to_restart(trs) |
---|
| 321 | DO it=1,nbtr |
---|
| 322 | iiq=niadv(it+2) |
---|
| 323 | CALL put_field("trs_"//tname(iiq),"",trs(:,it)) |
---|
| 324 | END DO |
---|
| 325 | END IF |
---|
| 326 | |
---|
[1001] | 327 | CALL close_restartphy |
---|
| 328 | !$OMP BARRIER |
---|
[524] | 329 | RETURN |
---|
| 330 | END |
---|