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