[232] | 1 | subroutine phyetat0_academic (ngrid,nlayer, fichnom,tab0,Lmodif,nsoil,nq, & |
---|
| 2 | day_ini,time,tsurf,tsoil, & |
---|
| 3 | emis,q2,qsurf,cloudfrac,totcloudfrac,hice, & |
---|
| 4 | rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | USE infotrac, ONLY: tname |
---|
| 8 | USE surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, zthe |
---|
| 9 | use iostart, only: nid_start, open_startphy, close_startphy, & |
---|
| 10 | get_field, get_var, inquire_field, & |
---|
| 11 | inquire_dimension, inquire_dimension_length |
---|
| 12 | use slab_ice_h, only: noceanmx |
---|
[298] | 13 | use mod_phys_lmdz_para, only : is_master |
---|
[232] | 14 | |
---|
| 15 | implicit none |
---|
| 16 | |
---|
| 17 | !====================================================================== |
---|
| 18 | ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 |
---|
| 19 | ! Adaptation à Mars : Yann Wanherdrick |
---|
| 20 | ! Objet: Lecture de l etat initial pour la physique |
---|
| 21 | !====================================================================== |
---|
| 22 | #include "netcdf.inc" |
---|
| 23 | !#include "dimensions.h" |
---|
| 24 | !#include "dimphys.h" |
---|
| 25 | !#include "planete.h" |
---|
| 26 | #include "comcstfi.h" |
---|
| 27 | |
---|
| 28 | !====================================================================== |
---|
| 29 | ! INTEGER nbsrf !Mars nbsrf a 1 au lieu de 4 |
---|
| 30 | ! PARAMETER (nbsrf=1) ! nombre de sous-fractions pour une maille |
---|
| 31 | !====================================================================== |
---|
| 32 | ! Arguments: |
---|
| 33 | ! --------- |
---|
| 34 | ! inputs: |
---|
| 35 | integer,intent(in) :: ngrid |
---|
| 36 | integer,intent(in) :: nlayer |
---|
| 37 | character*(*),intent(in) :: fichnom ! "startfi.nc" file |
---|
| 38 | integer,intent(in) :: tab0 |
---|
| 39 | integer,intent(in) :: Lmodif |
---|
| 40 | integer,intent(in) :: nsoil ! # of soil layers |
---|
| 41 | integer,intent(in) :: nq |
---|
| 42 | integer,intent(in) :: day_ini |
---|
| 43 | real,intent(in) :: time |
---|
| 44 | |
---|
| 45 | ! outputs: |
---|
| 46 | real,intent(out) :: tsurf(ngrid) ! surface temperature |
---|
| 47 | real,intent(out) :: tsoil(ngrid,nsoil) ! soil temperature |
---|
| 48 | real,intent(out) :: emis(ngrid) ! surface emissivity |
---|
| 49 | real,intent(out) :: q2(ngrid, nlayer+1) ! |
---|
| 50 | real,intent(out) :: qsurf(ngrid,nq) ! tracers on surface |
---|
| 51 | ! real co2ice(ngrid) ! co2 ice cover |
---|
| 52 | real,intent(out) :: cloudfrac(ngrid,nlayer) |
---|
| 53 | real,intent(out) :: hice(ngrid), totcloudfrac(ngrid) |
---|
| 54 | real,intent(out) :: pctsrf_sic(ngrid),tslab(ngrid,noceanmx) |
---|
| 55 | real,intent(out) :: tsea_ice(ngrid),sea_ice(ngrid) |
---|
| 56 | real,intent(out) :: rnat(ngrid) |
---|
| 57 | |
---|
| 58 | !====================================================================== |
---|
| 59 | ! Local variables: |
---|
| 60 | |
---|
| 61 | ! INTEGER radpas |
---|
| 62 | ! REAL co2_ppm |
---|
| 63 | ! REAL solaire |
---|
| 64 | |
---|
| 65 | real xmin,xmax ! to display min and max of a field |
---|
| 66 | ! |
---|
| 67 | INTEGER ig,iq,lmax |
---|
| 68 | INTEGER nid, nvarid |
---|
| 69 | INTEGER ierr, i, nsrf |
---|
| 70 | ! integer isoil |
---|
| 71 | ! INTEGER length |
---|
| 72 | ! PARAMETER (length=100) |
---|
| 73 | CHARACTER*7 str7 |
---|
| 74 | CHARACTER*2 str2 |
---|
| 75 | CHARACTER*1 yes |
---|
| 76 | ! |
---|
| 77 | REAL p_rad,p_omeg,p_g,p_cpp,p_mugaz,p_daysec |
---|
| 78 | INTEGER nqold |
---|
| 79 | |
---|
| 80 | ! flag which identifies if 'startfi.nc' file is using old names (qsurf01,...) |
---|
| 81 | ! logical :: oldtracernames=.false. |
---|
| 82 | integer :: count |
---|
| 83 | character(len=30) :: txt ! to store some text |
---|
| 84 | |
---|
| 85 | INTEGER :: indextime=1 ! index of selected time, default value=1 |
---|
[270] | 86 | logical :: found,found_file |
---|
[232] | 87 | |
---|
| 88 | ! |
---|
| 89 | ! ALLOCATE ARRAYS IN surfdat_h |
---|
| 90 | ! |
---|
| 91 | IF (.not. ALLOCATED(albedodat)) ALLOCATE(albedodat(ngrid)) |
---|
| 92 | IF (.not. ALLOCATED(phisfi)) ALLOCATE(phisfi(ngrid)) |
---|
| 93 | IF (.not. ALLOCATED(zmea)) ALLOCATE(zmea(ngrid)) |
---|
| 94 | IF (.not. ALLOCATED(zstd)) ALLOCATE(zstd(ngrid)) |
---|
| 95 | IF (.not. ALLOCATED(zsig)) ALLOCATE(zsig(ngrid)) |
---|
| 96 | IF (.not. ALLOCATED(zgam)) ALLOCATE(zgam(ngrid)) |
---|
| 97 | IF (.not. ALLOCATED(zthe)) ALLOCATE(zthe(ngrid)) |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | ! open physics initial state file: |
---|
[270] | 101 | call open_startphy(fichnom,found_file) |
---|
[232] | 102 | |
---|
[270] | 103 | ! Ehouarn, if file not found, then call tabfi with nid_start==0 |
---|
| 104 | if (.not.found_file) then |
---|
[298] | 105 | if (is_master) write(*,*) 'phyetat0_academic: call tabfi with nid_start=0' |
---|
[270] | 106 | call tabfi (ngrid,0,Lmodif,tab0,day_ini,lmax,p_rad, & |
---|
[232] | 107 | p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) |
---|
[270] | 108 | else |
---|
| 109 | ! possibility to modify tab_cntrl in tabfi |
---|
[298] | 110 | if (is_master) write(*,*) |
---|
| 111 | if (is_master) write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 |
---|
[270] | 112 | call tabfi (ngrid,nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & |
---|
| 113 | p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) |
---|
| 114 | endif |
---|
[232] | 115 | !c |
---|
| 116 | !c Lecture des latitudes (coordonnees): |
---|
| 117 | !c |
---|
| 118 | ! ierr = NF_INQ_VARID (nid, "latitude", nvarid) |
---|
| 119 | ! IF (ierr.NE.NF_NOERR) THEN |
---|
| 120 | ! PRINT*, 'phyetat0: Le champ <latitude> est absent' |
---|
| 121 | ! CALL abort |
---|
| 122 | ! ENDIF |
---|
| 123 | !#ifdef NC_DOUBLE |
---|
| 124 | ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,lati) |
---|
| 125 | !#else |
---|
| 126 | ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,lati) |
---|
| 127 | !#endif |
---|
| 128 | ! IF (ierr.NE.NF_NOERR) THEN |
---|
| 129 | ! PRINT*, 'phyetat0: Lecture echouee pour <latitude>' |
---|
| 130 | ! CALL abort |
---|
| 131 | ! ENDIF |
---|
| 132 | !c |
---|
| 133 | !c Lecture des longitudes (coordonnees): |
---|
| 134 | !c |
---|
| 135 | ! ierr = NF_INQ_VARID (nid, "longitude", nvarid) |
---|
| 136 | ! IF (ierr.NE.NF_NOERR) THEN |
---|
| 137 | ! PRINT*, 'phyetat0: Le champ <longitude> est absent' |
---|
| 138 | ! CALL abort |
---|
| 139 | ! ENDIF |
---|
| 140 | !#ifdef NC_DOUBLE |
---|
| 141 | ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,long) |
---|
| 142 | !#else |
---|
| 143 | ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,long) |
---|
| 144 | !#endif |
---|
| 145 | ! IF (ierr.NE.NF_NOERR) THEN |
---|
| 146 | ! PRINT*, 'phyetat0: Lecture echouee pour <longitude>' |
---|
| 147 | ! CALL abort |
---|
| 148 | ! ENDIF |
---|
| 149 | !c |
---|
| 150 | !c Lecture des aires des mailles: |
---|
| 151 | !c |
---|
| 152 | ! ierr = NF_INQ_VARID (nid, "area", nvarid) |
---|
| 153 | ! IF (ierr.NE.NF_NOERR) THEN |
---|
| 154 | ! PRINT*, 'phyetat0: Le champ <area> est absent' |
---|
| 155 | ! CALL abort |
---|
| 156 | ! ENDIF |
---|
| 157 | !#ifdef NC_DOUBLE |
---|
| 158 | ! ierr = NF_GET_VARA_DOUBLE(nid,nvarid,sta,ngrid,area) |
---|
| 159 | !#else |
---|
| 160 | ! ierr = NF_GET_VARA_REAL(nid,nvarid,sta,ngrid,area) |
---|
| 161 | !#endif |
---|
| 162 | ! IF (ierr.NE.NF_NOERR) THEN |
---|
| 163 | ! PRINT*, 'phyetat0: Lecture echouee pour <area>' |
---|
| 164 | ! CALL abort |
---|
| 165 | ! ENDIF |
---|
| 166 | ! xmin = 1.0E+20 |
---|
| 167 | ! xmax = -1.0E+20 |
---|
| 168 | ! xmin = MINVAL(area) |
---|
| 169 | ! xmax = MAXVAL(area) |
---|
| 170 | ! PRINT*,'Aires des mailles <area>:', xmin, xmax |
---|
| 171 | |
---|
| 172 | ! Load surface geopotential: |
---|
[270] | 173 | if (found_file) then |
---|
| 174 | call get_field("phisfi",phisfi,found) |
---|
| 175 | else |
---|
| 176 | found=.false. |
---|
| 177 | endif |
---|
[232] | 178 | if (.not.found) then |
---|
[298] | 179 | if (is_master) write(*,*) "phyetat0: Failed loading <phisfi>" |
---|
[232] | 180 | phisfi(:)=0 |
---|
| 181 | else |
---|
[298] | 182 | if (is_master) write(*,*) "phyetat0: surface geopotential <phisfi> range:", & |
---|
[232] | 183 | minval(phisfi), maxval(phisfi) |
---|
| 184 | endif |
---|
| 185 | |
---|
| 186 | ! Load bare ground albedo: |
---|
[270] | 187 | if (found_file) then |
---|
| 188 | call get_field("albedodat",albedodat,found) |
---|
| 189 | else |
---|
| 190 | found=.false. |
---|
| 191 | endif |
---|
[232] | 192 | if (.not.found) then |
---|
[298] | 193 | if (is_master) write(*,*) "phyetat0: Failed loading <albedodat>" |
---|
[232] | 194 | do ig=1,ngrid |
---|
| 195 | albedodat(ig)=0. |
---|
| 196 | enddo |
---|
| 197 | else |
---|
[298] | 198 | if (is_master) write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & |
---|
[232] | 199 | minval(albedodat), maxval(albedodat) |
---|
| 200 | endif |
---|
| 201 | |
---|
| 202 | ! ZMEA |
---|
[270] | 203 | if (found_file) then |
---|
| 204 | call get_field("ZMEA",zmea,found) |
---|
| 205 | else |
---|
| 206 | found=.false. |
---|
| 207 | endif |
---|
[232] | 208 | if (.not.found) then |
---|
| 209 | zmea(:)=0. |
---|
| 210 | else |
---|
[298] | 211 | if (is_master) write(*,*) "phyetat0: <ZMEA> range:", & |
---|
[232] | 212 | minval(zmea), maxval(zmea) |
---|
| 213 | endif |
---|
| 214 | |
---|
| 215 | ! ZSTD |
---|
[270] | 216 | if (found_file) then |
---|
| 217 | call get_field("ZSTD",zstd,found) |
---|
| 218 | else |
---|
| 219 | found=.false. |
---|
| 220 | endif |
---|
[232] | 221 | if (.not.found) then |
---|
[298] | 222 | if (is_master) write(*,*) "phyetat0: Failed loading <ZSTD>" |
---|
[232] | 223 | zstd(:)=0. |
---|
| 224 | else |
---|
[298] | 225 | if (is_master) write(*,*) "phyetat0: <ZSTD> range:", & |
---|
[232] | 226 | minval(zstd), maxval(zstd) |
---|
| 227 | endif |
---|
| 228 | |
---|
| 229 | ! ZSIG |
---|
[270] | 230 | if (found_file) then |
---|
| 231 | call get_field("ZSIG",zsig,found) |
---|
| 232 | else |
---|
| 233 | found=.false. |
---|
| 234 | endif |
---|
[232] | 235 | if (.not.found) then |
---|
[298] | 236 | if (is_master) write(*,*) "phyetat0: Failed loading <ZSIG>" |
---|
[232] | 237 | zsig(:)=0. |
---|
| 238 | else |
---|
[298] | 239 | if (is_master) write(*,*) "phyetat0: <ZSIG> range:", & |
---|
[232] | 240 | minval(zsig), maxval(zsig) |
---|
| 241 | endif |
---|
| 242 | |
---|
| 243 | ! ZGAM |
---|
[270] | 244 | if (found_file) then |
---|
| 245 | call get_field("ZGAM",zgam,found) |
---|
| 246 | else |
---|
| 247 | found=.false. |
---|
| 248 | endif |
---|
[232] | 249 | if (.not.found) then |
---|
[298] | 250 | if (is_master) write(*,*) "phyetat0: Failed loading <ZGAM>" |
---|
[232] | 251 | zgam(:)=0. |
---|
| 252 | else |
---|
[298] | 253 | if (is_master) write(*,*) "phyetat0: <ZGAM> range:", & |
---|
[232] | 254 | minval(zgam), maxval(zgam) |
---|
| 255 | endif |
---|
| 256 | |
---|
| 257 | ! ZTHE |
---|
[270] | 258 | if (found_file) then |
---|
| 259 | call get_field("ZTHE",zthe,found) |
---|
| 260 | else |
---|
| 261 | found=.false. |
---|
| 262 | endif |
---|
[232] | 263 | if (.not.found) then |
---|
[298] | 264 | if (is_master) write(*,*) "phyetat0: Failed loading <ZTHE>" |
---|
[232] | 265 | zthe(:)=0. |
---|
| 266 | else |
---|
[298] | 267 | if (is_master) write(*,*) "phyetat0: <ZTHE> range:", & |
---|
[232] | 268 | minval(zthe), maxval(zthe) |
---|
| 269 | endif |
---|
| 270 | |
---|
| 271 | ! Surface temperature : |
---|
[270] | 272 | if (found_file) then |
---|
| 273 | call get_field("tsurf",tsurf,found,indextime) |
---|
| 274 | else |
---|
| 275 | found=.false. |
---|
| 276 | endif |
---|
[232] | 277 | if (.not.found) then |
---|
[270] | 278 | !mi initialising tsurf with pt(:,1) |
---|
| 279 | !tsurf(:)=175.0 |
---|
[232] | 280 | else |
---|
[298] | 281 | if (is_master) write(*,*) "phyetat0: Surface temperature <tsurf> range:", & |
---|
[232] | 282 | minval(tsurf), maxval(tsurf) |
---|
| 283 | endif |
---|
| 284 | |
---|
| 285 | ! Surface emissivity |
---|
[270] | 286 | if (found_file) then |
---|
| 287 | call get_field("emis",emis,found,indextime) |
---|
| 288 | else |
---|
| 289 | found=.false. |
---|
| 290 | endif |
---|
[232] | 291 | if (.not.found) then |
---|
[298] | 292 | if (is_master) write(*,*) "phyetat0: Failed loading <emis>" |
---|
[232] | 293 | emis(:)=0.5 |
---|
| 294 | else |
---|
[298] | 295 | if (is_master) write(*,*) "phyetat0: Surface emissivity <emis> range:", & |
---|
[232] | 296 | minval(emis), maxval(emis) |
---|
| 297 | endif |
---|
| 298 | |
---|
| 299 | ! Cloud fraction (added by BC 2010) |
---|
[270] | 300 | if (found_file) then |
---|
| 301 | call get_field("cloudfrac",cloudfrac,found,indextime) |
---|
| 302 | else |
---|
| 303 | found=.false. |
---|
| 304 | endif |
---|
[232] | 305 | if (.not.found) then |
---|
[298] | 306 | if (is_master) write(*,*) "phyetat0: Failed loading <cloudfrac>" |
---|
[232] | 307 | cloudfrac(:,:)=0. |
---|
| 308 | else |
---|
[298] | 309 | if (is_master) write(*,*) "phyetat0: Cloud fraction <cloudfrac> range:", & |
---|
[232] | 310 | minval(cloudfrac), maxval(cloudfrac) |
---|
| 311 | endif |
---|
| 312 | |
---|
| 313 | ! Total cloud fraction (added by BC 2010) |
---|
[270] | 314 | if (found_file) then |
---|
| 315 | call get_field("totcloudfrac",totcloudfrac,found,indextime) |
---|
| 316 | else |
---|
| 317 | found=.false. |
---|
| 318 | endif |
---|
[232] | 319 | if (.not.found) then |
---|
[298] | 320 | if (is_master) write(*,*) "phyetat0: Failed loading <totcloudfrac>" |
---|
[232] | 321 | totcloudfrac(:)=0.5 |
---|
| 322 | else |
---|
[298] | 323 | if (is_master) write(*,*) "phyetat0: Total cloud fraction <totcloudfrac> range:", & |
---|
[232] | 324 | minval(totcloudfrac), maxval(totcloudfrac) |
---|
| 325 | endif |
---|
| 326 | |
---|
| 327 | ! Height of oceanic ice (added by BC 2010) |
---|
[270] | 328 | if (found_file) then |
---|
| 329 | call get_field("hice",hice,found,indextime) |
---|
| 330 | else |
---|
| 331 | found=.false. |
---|
| 332 | endif |
---|
[232] | 333 | if (.not.found) then |
---|
[298] | 334 | if (is_master) write(*,*) "phyetat0: Failed loading <hice>" |
---|
[232] | 335 | ! call abort |
---|
| 336 | do ig=1,ngrid |
---|
| 337 | hice(ig)=0. |
---|
| 338 | enddo |
---|
| 339 | else |
---|
[298] | 340 | if (is_master) write(*,*) "phyetat0: Height of oceanic ice <hice> range:", & |
---|
[232] | 341 | minval(hice), maxval(hice) |
---|
| 342 | endif |
---|
| 343 | |
---|
| 344 | ! SLAB OCEAN (added by BC 2014) |
---|
| 345 | ! nature of the surface |
---|
[270] | 346 | if (found_file) then |
---|
| 347 | call get_field("rnat",rnat,found,indextime) |
---|
| 348 | else |
---|
| 349 | found=.false. |
---|
| 350 | endif |
---|
[232] | 351 | if (.not.found) then |
---|
[298] | 352 | if (is_master) write(*,*) "phyetat0: Failed loading <rnat>" |
---|
[232] | 353 | do ig=1,ngrid |
---|
| 354 | rnat(ig)=1. |
---|
| 355 | enddo |
---|
| 356 | else |
---|
| 357 | do ig=1,ngrid |
---|
| 358 | if((nint(rnat(ig)).eq.2).or.(nint(rnat(ig)).eq.0))then |
---|
| 359 | rnat(ig)=0. |
---|
| 360 | else |
---|
| 361 | rnat(ig)=1. |
---|
| 362 | endif |
---|
| 363 | enddo |
---|
| 364 | |
---|
[298] | 365 | if (is_master) write(*,*) "phyetat0: Nature of surface <rnat> range:", & |
---|
[232] | 366 | minval(rnat), maxval(rnat) |
---|
| 367 | endif |
---|
| 368 | ! Pourcentage of sea ice cover |
---|
[270] | 369 | if (found_file) then |
---|
| 370 | call get_field("pctsrf_sic",pctsrf_sic,found,indextime) |
---|
| 371 | else |
---|
| 372 | found=.false. |
---|
| 373 | endif |
---|
[232] | 374 | if (.not.found) then |
---|
[298] | 375 | if (is_master) write(*,*) "phyetat0: Failed loading <pctsrf_sic>" |
---|
[232] | 376 | do ig=1,ngrid |
---|
| 377 | pctsrf_sic(ig)=0. |
---|
| 378 | enddo |
---|
| 379 | else |
---|
[298] | 380 | if (is_master) write(*,*) "phyetat0: Pourcentage of sea ice cover <pctsrf_sic> range:", & |
---|
[232] | 381 | minval(pctsrf_sic), maxval(pctsrf_sic) |
---|
| 382 | endif |
---|
| 383 | ! Slab ocean temperature (2 layers) |
---|
[270] | 384 | if (found_file) then |
---|
| 385 | call get_field("tslab",tslab,found,indextime) |
---|
| 386 | else |
---|
| 387 | found=.false. |
---|
| 388 | endif |
---|
[232] | 389 | if (.not.found) then |
---|
[298] | 390 | if (is_master) write(*,*) "phyetat0: Failed loading <tslab>" |
---|
[232] | 391 | do ig=1,ngrid |
---|
| 392 | do iq=1,noceanmx |
---|
| 393 | tslab(ig,iq)=tsurf(ig) |
---|
| 394 | enddo |
---|
| 395 | enddo |
---|
| 396 | else |
---|
[298] | 397 | if (is_master) write(*,*) "phyetat0: Slab ocean temperature <tslab> range:", & |
---|
[232] | 398 | minval(tslab), maxval(tslab) |
---|
| 399 | endif |
---|
| 400 | ! Oceanic ice temperature |
---|
[270] | 401 | if (found_file) then |
---|
| 402 | call get_field("tsea_ice",tsea_ice,found,indextime) |
---|
| 403 | else |
---|
| 404 | found=.false. |
---|
| 405 | endif |
---|
[232] | 406 | if (.not.found) then |
---|
[298] | 407 | if (is_master) write(*,*) "phyetat0: Failed loading <tsea_ice>" |
---|
[232] | 408 | do ig=1,ngrid |
---|
| 409 | tsea_ice(ig)=273.15-1.8 |
---|
| 410 | enddo |
---|
| 411 | else |
---|
[298] | 412 | if (is_master) write(*,*) "phyetat0: Oceanic ice temperature <tsea_ice> range:", & |
---|
[232] | 413 | minval(tsea_ice), maxval(tsea_ice) |
---|
| 414 | endif |
---|
| 415 | ! Oceanic ice quantity (kg/m^2) |
---|
[270] | 416 | if (found_file) then |
---|
| 417 | call get_field("sea_ice",sea_ice,found,indextime) |
---|
| 418 | else |
---|
| 419 | found=.false. |
---|
| 420 | endif |
---|
[232] | 421 | if (.not.found) then |
---|
[298] | 422 | if (is_master) write(*,*) "phyetat0: Failed loading <sea_ice>" |
---|
[232] | 423 | do ig=1,ngrid |
---|
| 424 | tsea_ice(ig)=0. |
---|
| 425 | enddo |
---|
| 426 | else |
---|
[298] | 427 | if (is_master) write(*,*) "phyetat0: Oceanic ice quantity <sea_ice> range:", & |
---|
[232] | 428 | minval(sea_ice), maxval(sea_ice) |
---|
| 429 | endif |
---|
| 430 | |
---|
| 431 | |
---|
| 432 | |
---|
| 433 | |
---|
| 434 | ! pbl wind variance |
---|
[270] | 435 | if (found_file) then |
---|
| 436 | call get_field("q2",q2,found,indextime) |
---|
| 437 | else |
---|
| 438 | found=.false. |
---|
| 439 | endif |
---|
[232] | 440 | if (.not.found) then |
---|
[298] | 441 | if (is_master) write(*,*) "phyetat0: Failed loading <q2>" |
---|
[232] | 442 | q2(:,:)=0.001 |
---|
| 443 | else |
---|
[298] | 444 | if (is_master) write(*,*) "phyetat0: PBL wind variance <q2> range:", & |
---|
[232] | 445 | minval(q2), maxval(q2) |
---|
| 446 | endif |
---|
| 447 | |
---|
| 448 | ! tracer on surface |
---|
| 449 | if (nq.ge.1) then |
---|
| 450 | do iq=1,nq |
---|
| 451 | txt=tname(iq) |
---|
| 452 | if (txt.eq."h2o_vap") then |
---|
| 453 | ! There is no surface tracer for h2o_vap; |
---|
| 454 | ! "h2o_ice" should be loaded instead |
---|
| 455 | txt="h2o_ice" |
---|
[298] | 456 | if (is_master) write(*,*) 'phyetat0: loading surface tracer', & |
---|
[232] | 457 | ' h2o_ice instead of h2o_vap' |
---|
| 458 | endif |
---|
[270] | 459 | if (found_file) then |
---|
| 460 | call get_field(txt,qsurf(:,iq),found,indextime) |
---|
| 461 | else |
---|
| 462 | found=.false. |
---|
| 463 | endif |
---|
[232] | 464 | if (.not.found) then |
---|
[298] | 465 | if (is_master) write(*,*) "phyetat0: Failed loading <",trim(txt),">" |
---|
| 466 | if (is_master) write(*,*) " ",trim(txt)," is set to zero" |
---|
[232] | 467 | else |
---|
[298] | 468 | if (is_master) write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & |
---|
[232] | 469 | minval(qsurf(:,iq)), maxval(qsurf(:,iq)) |
---|
| 470 | endif |
---|
| 471 | enddo |
---|
| 472 | endif ! of if (nq.ge.1) |
---|
| 473 | |
---|
| 474 | |
---|
| 475 | ! Call to soil_settings, in order to read soil temperatures, |
---|
| 476 | ! as well as thermal inertia and volumetric heat capacity |
---|
| 477 | |
---|
| 478 | !ym -> needed for saturn ? |
---|
| 479 | !ym call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) |
---|
| 480 | |
---|
| 481 | |
---|
| 482 | ! |
---|
| 483 | ! close file: |
---|
| 484 | ! |
---|
| 485 | call close_startphy |
---|
| 486 | |
---|
| 487 | END SUBROUTINE phyetat0_academic |
---|