[1944] | 1 | module phyetat0_mod |
---|
| 2 | |
---|
| 3 | implicit none |
---|
[2545] | 4 | real,save :: tab_cntrl_mod(100) |
---|
[1944] | 5 | |
---|
[2578] | 6 | !$OMP THREADPRIVATE(tab_cntrl_mod) |
---|
| 7 | |
---|
[1944] | 8 | contains |
---|
| 9 | |
---|
[1130] | 10 | subroutine phyetat0 (fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq, & |
---|
[1944] | 11 | day_ini,time0,tsurf,tsoil,albedo,emis,q2,qsurf,co2ice, & |
---|
[2562] | 12 | tauscaling,totcloudfrac,wstar,watercap) |
---|
[1922] | 13 | |
---|
[1621] | 14 | use tracer_mod, only: noms ! tracer names |
---|
[1130] | 15 | use surfdat_h, only: phisfi, albedodat, z0, z0_default,& |
---|
[2079] | 16 | zmea, zstd, zsig, zgam, zthe, hmons, summit, base |
---|
[1130] | 17 | use iostart, only: nid_start, open_startphy, close_startphy, & |
---|
| 18 | get_field, get_var, inquire_field, & |
---|
| 19 | inquire_dimension, inquire_dimension_length |
---|
[2220] | 20 | use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd |
---|
[2265] | 21 | use compute_dtau_mod, only: dtau |
---|
[2417] | 22 | use dust_rad_adjust_mod, only: dust_rad_adjust_prev,dust_rad_adjust_next |
---|
| 23 | use dust_param_mod, only: dustscaling_mode |
---|
[2281] | 24 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
| 25 | |
---|
[1130] | 26 | implicit none |
---|
[1974] | 27 | |
---|
| 28 | include "callkeys.h" |
---|
[1130] | 29 | !====================================================================== |
---|
| 30 | ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 |
---|
[2562] | 31 | ! Adaptation � Mars : Yann Wanherdrick |
---|
[1130] | 32 | ! Objet: Lecture de l etat initial pour la physique |
---|
| 33 | ! Modifs: Aug.2010 EM : use NetCDF90 to load variables (enables using |
---|
| 34 | ! r4 or r8 restarts independently of having compiled |
---|
| 35 | ! the GCM in r4 or r8) |
---|
| 36 | ! June 2013 TN : Possibility to read files with a time axis |
---|
| 37 | ! November 2013 EM : Enabeling parallel, using iostart module |
---|
[2281] | 38 | ! March 2020 AD: Enabling initialization of physics without startfi |
---|
| 39 | ! flag: startphy_file |
---|
[1130] | 40 | !====================================================================== |
---|
| 41 | INTEGER nbsrf !Mars nbsrf a 1 au lieu de 4 |
---|
| 42 | PARAMETER (nbsrf=1) ! nombre de sous-fractions pour une maille |
---|
| 43 | !====================================================================== |
---|
| 44 | ! Arguments: |
---|
| 45 | ! --------- |
---|
| 46 | ! inputs: |
---|
[2281] | 47 | ! logical,intent(in) :: startphy_file ! .true. if reading start file |
---|
[1130] | 48 | character*(*),intent(in) :: fichnom ! "startfi.nc" file |
---|
| 49 | integer,intent(in) :: tab0 |
---|
| 50 | integer,intent(in) :: Lmodif |
---|
| 51 | integer,intent(in) :: nsoil ! # of soil layers |
---|
| 52 | integer,intent(in) :: ngrid ! # of atmospheric columns |
---|
| 53 | integer,intent(in) :: nlay ! # of atmospheric layers |
---|
| 54 | integer,intent(in) :: nq |
---|
| 55 | integer :: day_ini |
---|
| 56 | real :: time0 |
---|
| 57 | |
---|
| 58 | ! outputs: |
---|
| 59 | real,intent(out) :: tsurf(ngrid) ! surface temperature |
---|
| 60 | real,intent(out) :: tsoil(ngrid,nsoil) ! soil temperature |
---|
[1944] | 61 | real,intent(out) :: albedo(ngrid,2) ! surface albedo |
---|
[1130] | 62 | real,intent(out) :: emis(ngrid) ! surface emissivity |
---|
| 63 | real,intent(out) :: q2(ngrid,nlay+1) ! |
---|
| 64 | real,intent(out) :: qsurf(ngrid,nq) ! tracers on surface |
---|
| 65 | real,intent(out) :: co2ice(ngrid) ! co2 ice cover |
---|
[1208] | 66 | real,intent(out) :: tauscaling(ngrid) ! dust conversion factor |
---|
[1711] | 67 | real,intent(out) :: totcloudfrac(ngrid) ! total cloud fraction |
---|
[1944] | 68 | real,intent(out) :: wstar(ngrid) ! Max vertical velocity in thermals (m/s) |
---|
[2260] | 69 | real,intent(out) :: watercap(ngrid) ! h2o_ice_cover |
---|
[1130] | 70 | !====================================================================== |
---|
| 71 | ! Local variables: |
---|
| 72 | |
---|
| 73 | real surffield(ngrid) ! to temporarily store a surface field |
---|
| 74 | real xmin,xmax ! to display min and max of a field |
---|
| 75 | ! |
---|
| 76 | INTEGER ig,iq,lmax |
---|
| 77 | INTEGER nid, nvarid |
---|
| 78 | INTEGER ierr, i, nsrf |
---|
| 79 | ! integer isoil |
---|
| 80 | ! INTEGER length |
---|
| 81 | ! PARAMETER (length=100) |
---|
| 82 | CHARACTER*7 str7 |
---|
| 83 | CHARACTER*2 str2 |
---|
| 84 | CHARACTER*1 yes |
---|
| 85 | ! |
---|
| 86 | REAL p_rad,p_omeg,p_g,p_mugaz,p_daysec |
---|
| 87 | INTEGER nqold |
---|
| 88 | |
---|
| 89 | ! flag which identifies if 'startfi.nc' file is using old names (qsurf01,...) |
---|
| 90 | logical :: oldtracernames=.false. |
---|
| 91 | integer :: count |
---|
| 92 | character(len=30) :: txt ! to store some text |
---|
| 93 | |
---|
| 94 | ! specific for time |
---|
| 95 | REAL,ALLOCATABLE :: time(:) ! times stored in start |
---|
| 96 | INTEGER timelen ! number of times stored in the file |
---|
| 97 | INTEGER indextime ! index of selected time |
---|
| 98 | |
---|
| 99 | INTEGER :: edges(3),corner(3) |
---|
| 100 | LOGICAL :: found |
---|
| 101 | |
---|
[1525] | 102 | REAL :: timestart ! to pick which initial state to start from |
---|
[2281] | 103 | REAL :: surfemis ! constant emissivity when no startfi |
---|
[2630] | 104 | REAL :: surfalbedo ! constant albedo when no startfi |
---|
[2281] | 105 | CHARACTER(len=5) :: modname="phyetat0" |
---|
[1525] | 106 | |
---|
[2281] | 107 | write(*,*) "phyetat0: startphy_file", startphy_file |
---|
[1130] | 108 | |
---|
[2281] | 109 | if (startphy_file) then |
---|
| 110 | ! open physics initial state file: |
---|
| 111 | call open_startphy(fichnom) |
---|
| 112 | ! possibility to modify tab_cntrl in tabfi |
---|
| 113 | write(*,*) |
---|
| 114 | write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 |
---|
| 115 | call tabfi (nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & |
---|
| 116 | p_omeg,p_g,p_mugaz,p_daysec,time0) |
---|
| 117 | else ! "academic" initialization of planetary parameters via tabfi |
---|
| 118 | call tabfi (0,0,0,day_ini,lmax,p_rad, & |
---|
| 119 | p_omeg,p_g,p_mugaz,p_daysec,time0) |
---|
| 120 | endif ! of if (startphy_file) |
---|
[1130] | 121 | |
---|
[2281] | 122 | if (startphy_file) then |
---|
| 123 | ! Load surface geopotential: |
---|
| 124 | call get_field("phisfi",phisfi,found) |
---|
| 125 | if (.not.found) then |
---|
| 126 | call abort_physic(modname, & |
---|
| 127 | "phyetat0: Failed loading <phisfi>",1) |
---|
| 128 | endif |
---|
[1130] | 129 | else |
---|
[2281] | 130 | phisfi(:)=0. |
---|
| 131 | endif ! of if (startphy_file) |
---|
| 132 | write(*,*) "phyetat0: surface geopotential <phisfi> range:", & |
---|
| 133 | minval(phisfi), maxval(phisfi) |
---|
[1130] | 134 | |
---|
| 135 | |
---|
[2281] | 136 | if (startphy_file) then |
---|
| 137 | ! Load bare ground albedo: |
---|
| 138 | call get_field("albedodat",albedodat,found) |
---|
| 139 | if (.not.found) then |
---|
| 140 | call abort_physic(modname, & |
---|
| 141 | "phyetat0: Failed loading <albedodat>",1) |
---|
| 142 | endif |
---|
| 143 | else ! If no startfi file, use parameter surfalbedo in def file |
---|
[2294] | 144 | surfalbedo=0.1 |
---|
| 145 | call getin_p("surfalbedo_without_startfi",surfalbedo) |
---|
| 146 | print*,"surfalbedo_without_startfi",surfalbedo |
---|
[2281] | 147 | albedodat(:)=surfalbedo |
---|
| 148 | endif ! of if (startphy_file) |
---|
| 149 | write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & |
---|
[1130] | 150 | minval(albedodat), maxval(albedodat) |
---|
| 151 | |
---|
| 152 | ! ZMEA |
---|
[2281] | 153 | if (startphy_file) then |
---|
| 154 | call get_field("ZMEA",zmea,found) |
---|
| 155 | if (.not.found) then |
---|
| 156 | call abort_physic(modname, & |
---|
| 157 | "phyetat0: Failed loading <ZMEA>",1) |
---|
| 158 | endif |
---|
[1130] | 159 | else |
---|
[2281] | 160 | zmea(:)=0. |
---|
| 161 | endif ! of if (startphy_file) |
---|
| 162 | write(*,*) "phyetat0: <ZMEA> range:", & |
---|
| 163 | minval(zmea), maxval(zmea) |
---|
[1130] | 164 | |
---|
| 165 | |
---|
| 166 | ! ZSTD |
---|
[2281] | 167 | if (startphy_file) then |
---|
| 168 | call get_field("ZSTD",zstd,found) |
---|
| 169 | if (.not.found) then |
---|
| 170 | call abort_physic(modname, & |
---|
| 171 | "phyetat0: Failed loading <ZSTD>",1) |
---|
| 172 | endif |
---|
[1130] | 173 | else |
---|
[2281] | 174 | zstd(:)=0. |
---|
| 175 | endif ! of if (startphy_file) |
---|
| 176 | write(*,*) "phyetat0: <ZSTD> range:", & |
---|
| 177 | minval(zstd), maxval(zstd) |
---|
[1130] | 178 | |
---|
| 179 | |
---|
| 180 | ! ZSIG |
---|
[2281] | 181 | if (startphy_file) then |
---|
| 182 | call get_field("ZSIG",zsig,found) |
---|
| 183 | if (.not.found) then |
---|
| 184 | call abort_physic(modname, & |
---|
| 185 | "phyetat0: Failed loading <ZSIG>",1) |
---|
| 186 | endif |
---|
[1130] | 187 | else |
---|
[2281] | 188 | zsig(:)=0. |
---|
| 189 | endif ! of if (startphy_file) |
---|
| 190 | write(*,*) "phyetat0: <ZSIG> range:", & |
---|
| 191 | minval(zsig), maxval(zsig) |
---|
[1130] | 192 | |
---|
| 193 | |
---|
| 194 | ! ZGAM |
---|
[2281] | 195 | if (startphy_file) then |
---|
| 196 | call get_field("ZGAM",zgam,found) |
---|
| 197 | if (.not.found) then |
---|
| 198 | call abort_physic(modname, & |
---|
| 199 | "phyetat0: Failed loading <ZGAM>",1) |
---|
| 200 | endif |
---|
[1130] | 201 | else |
---|
[2281] | 202 | zgam(:)=0. |
---|
| 203 | endif ! of if (startphy_file) |
---|
| 204 | write(*,*) "phyetat0: <ZGAM> range:", & |
---|
| 205 | minval(zgam), maxval(zgam) |
---|
[1130] | 206 | |
---|
| 207 | |
---|
| 208 | ! ZTHE |
---|
[2281] | 209 | if (startphy_file) then |
---|
| 210 | call get_field("ZTHE",zthe,found) |
---|
| 211 | if (.not.found) then |
---|
| 212 | call abort_physic(modname, & |
---|
| 213 | "phyetat0: Failed loading <ZTHE>",1) |
---|
| 214 | endif |
---|
[1130] | 215 | else |
---|
[2281] | 216 | zthe(:)=0. |
---|
| 217 | endif ! of if (startphy_file) |
---|
| 218 | write(*,*) "phyetat0: <ZTHE> range:", & |
---|
[1130] | 219 | minval(zthe), maxval(zthe) |
---|
| 220 | |
---|
[2281] | 221 | ! hmons |
---|
| 222 | if (startphy_file) then |
---|
| 223 | call get_field("hmons",hmons,found) |
---|
| 224 | if (.not.found) then |
---|
| 225 | write(*,*) "WARNING: phyetat0: Failed loading <hmons>" |
---|
| 226 | if (rdstorm) then |
---|
| 227 | call abort_physic(modname, & |
---|
| 228 | "phyetat0: Failed loading <hmons>",1) |
---|
| 229 | else |
---|
| 230 | write(*,*) "will continue anyway..." |
---|
| 231 | write(*,*) "because you may not need it." |
---|
| 232 | hmons(:)=0. |
---|
| 233 | end if ! if (rdstorm) |
---|
| 234 | else |
---|
| 235 | do ig=1,ngrid |
---|
| 236 | if (hmons(ig) .eq. -999999.) hmons(ig)=0. |
---|
| 237 | enddo |
---|
| 238 | endif ! (.not.found) |
---|
[1974] | 239 | else |
---|
[2281] | 240 | hmons(:)=0. |
---|
| 241 | endif ! if (startphy_file) |
---|
| 242 | write(*,*) "phyetat0: <hmons> range:", & |
---|
| 243 | minval(hmons), maxval(hmons) |
---|
[2079] | 244 | |
---|
[2281] | 245 | |
---|
| 246 | ! summit |
---|
| 247 | if (startphy_file) then |
---|
| 248 | call get_field("summit",summit,found) |
---|
| 249 | if (.not.found) then |
---|
| 250 | write(*,*) "WARNING: phyetat0: Failed loading <summit>" |
---|
| 251 | if (rdstorm) then |
---|
| 252 | call abort_physic(modname, & |
---|
| 253 | "phyetat0: Failed loading <summit>",1) |
---|
| 254 | else |
---|
| 255 | write(*,*) "will continue anyway..." |
---|
| 256 | write(*,*) "because you may not need it." |
---|
| 257 | summit(:)=0. |
---|
| 258 | end if |
---|
| 259 | else |
---|
| 260 | do ig=1,ngrid |
---|
| 261 | if (summit(ig) .eq. -999999.) summit(ig)=0. |
---|
| 262 | enddo |
---|
| 263 | endif ! if (.not.found) |
---|
[2079] | 264 | else |
---|
[2281] | 265 | summit(:)=0. |
---|
| 266 | endif ! if (startphy_file) |
---|
| 267 | write(*,*) "phyetat0: <summit> range:", & |
---|
| 268 | minval(summit), maxval(summit) |
---|
[2079] | 269 | |
---|
[2281] | 270 | |
---|
| 271 | ! base |
---|
| 272 | if (startphy_file) then |
---|
| 273 | call get_field("base",base,found) |
---|
| 274 | if (.not.found) then |
---|
| 275 | write(*,*) "WARNING: phyetat0: Failed loading <base>" |
---|
| 276 | if (rdstorm) then |
---|
| 277 | call abort_physic(modname, & |
---|
| 278 | "phyetat0: Failed loading <base>",1) |
---|
| 279 | else |
---|
| 280 | write(*,*) "will continue anyway..." |
---|
| 281 | write(*,*) "because you may not need it." |
---|
| 282 | base(:)=0. |
---|
| 283 | end if |
---|
| 284 | else |
---|
| 285 | do ig=1,ngrid |
---|
| 286 | if (base(ig) .eq. -999999.) base(ig)=0. |
---|
| 287 | enddo |
---|
| 288 | endif ! if(.not.found) |
---|
[2079] | 289 | else |
---|
[2281] | 290 | base(:)=0. |
---|
| 291 | endif ! if (startphy_file) |
---|
| 292 | write(*,*) "phyetat0: <base> range:", & |
---|
| 293 | minval(base), maxval(base) |
---|
| 294 | |
---|
[1130] | 295 | ! Time axis |
---|
[1525] | 296 | ! obtain timestart from run.def |
---|
| 297 | timestart=-9999 ! default value |
---|
[2281] | 298 | call getin_p("timestart",timestart) |
---|
| 299 | if (startphy_file) then |
---|
| 300 | found=inquire_dimension("Time") |
---|
| 301 | if (.not.found) then |
---|
| 302 | indextime = 1 |
---|
| 303 | write(*,*) "phyetat0: No time axis found in "//trim(fichnom) |
---|
| 304 | else |
---|
| 305 | write(*,*) "phyetat0: Time axis found in "//trim(fichnom) |
---|
| 306 | timelen=inquire_dimension_length("Time") |
---|
| 307 | allocate(time(timelen)) |
---|
| 308 | ! load "Time" array: |
---|
| 309 | call get_var("Time",time,found) |
---|
| 310 | if (.not.found) then |
---|
| 311 | call abort_physic(modname, & |
---|
| 312 | "phyetat0: Failed loading <Time>",1) |
---|
| 313 | endif |
---|
| 314 | ! seclect the desired time index |
---|
| 315 | IF (timestart .lt. 0) THEN ! default: we use the last time value |
---|
| 316 | indextime = timelen |
---|
| 317 | ELSE ! else we look for the desired value in the time axis |
---|
| 318 | indextime = 0 |
---|
| 319 | DO i=1,timelen |
---|
| 320 | IF (abs(time(i) - timestart) .lt. 0.01) THEN |
---|
| 321 | indextime = i |
---|
| 322 | EXIT |
---|
| 323 | ENDIF |
---|
| 324 | ENDDO |
---|
| 325 | IF (indextime .eq. 0) THEN |
---|
| 326 | PRINT*, "Time", timestart," is not in "//trim(fichnom)//"!!" |
---|
| 327 | PRINT*, "Stored times are:" |
---|
| 328 | DO i=1,timelen |
---|
| 329 | PRINT*, time(i) |
---|
| 330 | ENDDO |
---|
| 331 | call abort_physic(modname,"phyetat0: Time error",1) |
---|
| 332 | ENDIF |
---|
| 333 | ENDIF ! of IF (timestart .lt. 0) |
---|
| 334 | ! In startfi the absolute date is day_ini + time0 + time |
---|
| 335 | ! For now on, in the GCM physics, it is day_ini + time0 |
---|
| 336 | time0 = time(indextime) + time0 |
---|
| 337 | day_ini = day_ini + INT(time0) |
---|
| 338 | time0 = time0 - INT(time0) |
---|
| 339 | PRINT*, "phyetat0: Selected time ",time(indextime), & |
---|
| 340 | " at index ",indextime |
---|
| 341 | DEALLOCATE(time) |
---|
| 342 | endif ! of if Time not found in file |
---|
[2545] | 343 | |
---|
| 344 | call ini_tab_controle_dyn_xios(day_ini) |
---|
| 345 | |
---|
[2281] | 346 | else |
---|
[1130] | 347 | indextime = 1 |
---|
[2281] | 348 | endif ! if (startphy_file) |
---|
[1130] | 349 | |
---|
| 350 | ! CO2 ice cover |
---|
[2281] | 351 | if (startphy_file) then |
---|
| 352 | call get_field("co2ice",co2ice,found,indextime) |
---|
| 353 | if (.not.found) then |
---|
| 354 | call abort_physic(modname, & |
---|
| 355 | "phyetat0: Failed loading <co2ice>",1) |
---|
| 356 | endif |
---|
[1130] | 357 | else |
---|
[2281] | 358 | co2ice(:)=0. |
---|
| 359 | endif !if (startphy_file) |
---|
| 360 | write(*,*) "phyetat0: CO2 ice cover <co2ice> range:", & |
---|
| 361 | minval(co2ice), maxval(co2ice) |
---|
[1130] | 362 | |
---|
[1208] | 363 | ! Dust conversion factor |
---|
[2281] | 364 | if (startphy_file) then |
---|
| 365 | call get_field("tauscaling",tauscaling,found,indextime) |
---|
| 366 | if (.not.found) then |
---|
| 367 | write(*,*) "phyetat0: <tauscaling> not in file" |
---|
| 368 | tauscaling(:) = 1 |
---|
| 369 | endif |
---|
[1208] | 370 | else |
---|
[2281] | 371 | tauscaling(:) = 1 |
---|
| 372 | endif ! if (startphy_file) |
---|
| 373 | write(*,*) "phyetat0: dust conversion factor <tauscaling> range:", & |
---|
| 374 | minval(tauscaling), maxval(tauscaling) |
---|
[1208] | 375 | |
---|
[2417] | 376 | ! dust_rad_adjust_* for radiative rescaling of dust |
---|
| 377 | if (dustscaling_mode==2) then |
---|
| 378 | if (startphy_file) then |
---|
| 379 | call get_field("dust_rad_adjust_prev",dust_rad_adjust_prev,found,indextime) |
---|
| 380 | if (.not.found) then |
---|
| 381 | write(*,*) "phyetat0: <dust_rad_adjust_prev> not in file; set to 1" |
---|
| 382 | dust_rad_adjust_prev(:) = 1 |
---|
| 383 | endif |
---|
| 384 | call get_field("dust_rad_adjust_next",dust_rad_adjust_next,found,indextime) |
---|
| 385 | if (.not.found) then |
---|
| 386 | write(*,*) "phyetat0: <dust_rad_adjust_next> not in file; set to 1" |
---|
| 387 | dust_rad_adjust_next(:) = 1 |
---|
| 388 | endif |
---|
| 389 | else |
---|
| 390 | dust_rad_adjust_prev(:)= 0 |
---|
| 391 | dust_rad_adjust_next(:)= 0 |
---|
| 392 | endif ! if (startphy_file) |
---|
| 393 | write(*,*) "phyetat0: radiative scaling coeff <dust_rad_adjust_prev> range:", & |
---|
| 394 | minval(dust_rad_adjust_prev), maxval(dust_rad_adjust_prev) |
---|
| 395 | write(*,*) "phyetat0: radiative scaling coeff <dust_rad_adjust_next> range:", & |
---|
| 396 | minval(dust_rad_adjust_next), maxval(dust_rad_adjust_next) |
---|
| 397 | endif ! of if (dustscaling_mode==2) |
---|
[2281] | 398 | |
---|
[2265] | 399 | ! dtau: opacity difference between GCM and dust scenario |
---|
[2281] | 400 | if (startphy_file) then |
---|
| 401 | call get_field("dtau",dtau,found,indextime) |
---|
| 402 | if (.not.found) then |
---|
| 403 | write(*,*) "phyetat0: <dtau> not in file; set to zero" |
---|
| 404 | dtau(:) = 0 |
---|
| 405 | endif |
---|
[2265] | 406 | else |
---|
[2281] | 407 | dtau(:)= 0 |
---|
| 408 | endif ! if (startphy_file) |
---|
| 409 | write(*,*) "phyetat0: opacity diff wrt scenario <dtau> range:", & |
---|
| 410 | minval(dtau), maxval(dtau) |
---|
[2265] | 411 | |
---|
| 412 | |
---|
[1711] | 413 | ! Sub-grid cloud fraction |
---|
[2281] | 414 | if (startphy_file) then |
---|
| 415 | call get_field("totcloudfrac",totcloudfrac,found,indextime) |
---|
| 416 | if (.not.found) then |
---|
| 417 | write(*,*) "phyetat0: <totcloudfrac> not in file WARNING put to 1" |
---|
| 418 | totcloudfrac(:) = 1.0 !valeur par defaut (CLFfixval par defaut) |
---|
| 419 | endif |
---|
[1711] | 420 | else |
---|
[2281] | 421 | totcloudfrac(:)=1.0 |
---|
| 422 | endif ! if (startphy_file) |
---|
| 423 | write(*,*) "phyetat0: total cloud fraction <totcloudfrac> range:", & |
---|
| 424 | minval(totcloudfrac), maxval(totcloudfrac) |
---|
[1208] | 425 | |
---|
[2281] | 426 | |
---|
[1944] | 427 | ! Max vertical velocity in thermals |
---|
[2281] | 428 | if (startphy_file) then |
---|
| 429 | call get_field("wstar",wstar,found,indextime) |
---|
| 430 | if (.not.found) then |
---|
| 431 | write(*,*) "phyetat0: <wstar> not in file! Set to zero" |
---|
| 432 | wstar(:)=0 |
---|
| 433 | endif |
---|
[1944] | 434 | else |
---|
[2281] | 435 | wstar(:)=0 |
---|
| 436 | endif ! if (startphy_file) |
---|
| 437 | write(*,*) "phyetat0: Max vertical velocity in thermals <wstar> range:", & |
---|
| 438 | minval(wstar),maxval(wstar) |
---|
[1944] | 439 | |
---|
[2281] | 440 | |
---|
[1130] | 441 | ! Surface temperature : |
---|
[2281] | 442 | if (startphy_file) then !tsurf |
---|
| 443 | call get_field("tsurf",tsurf,found,indextime) |
---|
| 444 | if (.not.found) then |
---|
| 445 | call abort_physic(modname, & |
---|
| 446 | "phyetat0: Failed loading <tsurf>",1) |
---|
| 447 | endif |
---|
[1130] | 448 | else |
---|
[2281] | 449 | tsurf(:)=0. ! will be updated afterwards in physiq ! |
---|
| 450 | endif ! of if (startphy_file) |
---|
| 451 | write(*,*) "phyetat0: Surface temperature <tsurf> range:", & |
---|
| 452 | minval(tsurf), maxval(tsurf) |
---|
[1130] | 453 | |
---|
[1944] | 454 | ! Surface albedo |
---|
[2281] | 455 | if (startphy_file) then |
---|
| 456 | call get_field("albedo",albedo(:,1),found,indextime) |
---|
| 457 | if (.not.found) then |
---|
| 458 | write(*,*) "phyetat0: Failed loading <albedo>" |
---|
| 459 | albedo(:,1)=albedodat(:) |
---|
| 460 | endif |
---|
[1944] | 461 | else |
---|
[2281] | 462 | albedo(:,1)=albedodat(:) |
---|
| 463 | endif ! of if (startphy_file) |
---|
| 464 | write(*,*) "phyetat0: Surface albedo <albedo> range:", & |
---|
| 465 | minval(albedo(:,1)), maxval(albedo(:,1)) |
---|
[1944] | 466 | albedo(:,2)=albedo(:,1) |
---|
| 467 | |
---|
[1130] | 468 | ! Surface emissivity |
---|
[2281] | 469 | if (startphy_file) then |
---|
| 470 | call get_field("emis",emis,found,indextime) |
---|
| 471 | if (.not.found) then |
---|
| 472 | call abort_physic(modname, & |
---|
| 473 | "phyetat0: Failed loading <emis>",1) |
---|
| 474 | endif |
---|
[1130] | 475 | else |
---|
[2281] | 476 | ! If no startfi file, use parameter surfemis in def file |
---|
[2294] | 477 | surfemis=0.95 |
---|
| 478 | call getin_p("surfemis_without_startfi",surfemis) |
---|
| 479 | print*,"surfemis_without_startfi",surfemis |
---|
[2281] | 480 | emis(:)=surfemis |
---|
| 481 | endif ! of if (startphy_file) |
---|
| 482 | write(*,*) "phyetat0: Surface emissivity <emis> range:", & |
---|
| 483 | minval(emis), maxval(emis) |
---|
[1130] | 484 | |
---|
| 485 | |
---|
| 486 | ! surface roughness length (NB: z0 is a common in surfdat_h) |
---|
[2281] | 487 | if (startphy_file) then |
---|
| 488 | call get_field("z0",z0,found) |
---|
| 489 | if (.not.found) then |
---|
| 490 | write(*,*) "phyetat0: Failed loading <z0>" |
---|
| 491 | write(*,*) 'will use constant value of z0_default:',z0_default |
---|
| 492 | z0(:)=z0_default |
---|
| 493 | endif |
---|
[1130] | 494 | else |
---|
[2281] | 495 | z0(:)=z0_default |
---|
| 496 | endif ! of if (startphy_file) |
---|
| 497 | write(*,*) "phyetat0: Surface roughness <z0> range:", & |
---|
| 498 | minval(z0), maxval(z0) |
---|
[1130] | 499 | |
---|
| 500 | |
---|
| 501 | ! pbl wind variance |
---|
[2281] | 502 | if (startphy_file) then |
---|
| 503 | call get_field("q2",q2,found,indextime) |
---|
| 504 | if (.not.found) then |
---|
| 505 | call abort_physic(modname, & |
---|
| 506 | "phyetat0: Failed loading <q2>",1) |
---|
| 507 | endif |
---|
[1130] | 508 | else |
---|
[2281] | 509 | q2(:,:)=0. |
---|
| 510 | endif ! of if (startphy_file) |
---|
| 511 | write(*,*) "phyetat0: PBL wind variance <q2> range:", & |
---|
| 512 | minval(q2), maxval(q2) |
---|
[1130] | 513 | |
---|
[2281] | 514 | ! Non-orographic gravity waves |
---|
| 515 | if (startphy_file) then |
---|
| 516 | call get_field("du_nonoro_gwd",du_nonoro_gwd,found,indextime) |
---|
| 517 | if (.not.found) then |
---|
| 518 | write(*,*) "phyetat0: <du_nonoro_gwd> not in file" |
---|
| 519 | du_nonoro_gwd(:,:)=0. |
---|
| 520 | endif |
---|
[2220] | 521 | else |
---|
[2281] | 522 | du_nonoro_gwd(:,:)=0. |
---|
| 523 | endif ! if (startphy_file) |
---|
| 524 | write(*,*) "phyetat0: Memory of zonal wind tendency due to non-orographic GW" |
---|
| 525 | write(*,*) " <du_nonoro_gwd> range:", & |
---|
| 526 | minval(du_nonoro_gwd), maxval(du_nonoro_gwd) |
---|
[1130] | 527 | |
---|
[2281] | 528 | if (startphy_file) then |
---|
| 529 | call get_field("dv_nonoro_gwd",dv_nonoro_gwd,found,indextime) |
---|
| 530 | if (.not.found) then |
---|
| 531 | write(*,*) "phyetat0: <dv_nonoro_gwd> not in file" |
---|
| 532 | dv_nonoro_gwd(:,:)=0. |
---|
| 533 | endif |
---|
| 534 | else ! ! if (startphy_file) |
---|
| 535 | dv_nonoro_gwd(:,:)=0. |
---|
| 536 | endif ! if (startphy_file) |
---|
| 537 | write(*,*) "phyetat0: Memory of meridional wind tendency due to non-orographic GW" |
---|
| 538 | write(*,*) " <dv_nonoro_gwd> range:", & |
---|
| 539 | minval(dv_nonoro_gwd), maxval(dv_nonoro_gwd) |
---|
[2220] | 540 | |
---|
[1130] | 541 | ! tracer on surface |
---|
| 542 | if (nq.ge.1) then |
---|
| 543 | do iq=1,nq |
---|
[1621] | 544 | txt=noms(iq) |
---|
[1130] | 545 | if (txt.eq."h2o_vap") then |
---|
| 546 | ! There is no surface tracer for h2o_vap; |
---|
| 547 | ! "h2o_ice" should be loaded instead |
---|
| 548 | txt="h2o_ice" |
---|
| 549 | write(*,*) 'phyetat0: loading surface tracer', & |
---|
| 550 | ' h2o_ice instead of h2o_vap' |
---|
[2260] | 551 | write(*,*) 'iq = ', iq |
---|
[1130] | 552 | endif |
---|
[2312] | 553 | |
---|
| 554 | if (hdo) then |
---|
| 555 | if (txt.eq."hdo_vap") then |
---|
| 556 | txt="hdo_ice" |
---|
| 557 | write(*,*) 'phyetat0: loading surface tracer', & |
---|
| 558 | ' hdo_ice instead of hdo_vap' |
---|
| 559 | endif |
---|
| 560 | endif !hdo |
---|
| 561 | |
---|
[2281] | 562 | if (startphy_file) then |
---|
| 563 | call get_field(txt,qsurf(:,iq),found,indextime) |
---|
| 564 | if (.not.found) then |
---|
| 565 | write(*,*) "phyetat0: Failed loading <",trim(txt),">" |
---|
| 566 | write(*,*) " ",trim(txt)," is set to zero" |
---|
[2740] | 567 | qsurf(:,iq)=0. |
---|
[2281] | 568 | endif |
---|
[1130] | 569 | else |
---|
[2281] | 570 | qsurf(:,iq)=0. |
---|
| 571 | endif ! of if (startphy_file) |
---|
| 572 | write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & |
---|
[1130] | 573 | minval(qsurf(:,iq)), maxval(qsurf(:,iq)) |
---|
[2281] | 574 | enddo ! of do iq=1,nq |
---|
[1130] | 575 | endif ! of if (nq.ge.1) |
---|
| 576 | |
---|
[2281] | 577 | if (startphy_file) then |
---|
| 578 | call get_field("watercap",watercap,found,indextime) |
---|
| 579 | if (.not.found) then |
---|
| 580 | write(*,*) "phyetat0: Failed loading <watercap> : ", & |
---|
| 581 | "<watercap> is set to zero" |
---|
| 582 | watercap(:)=0 |
---|
[2260] | 583 | |
---|
[2281] | 584 | write(*,*) 'Now transfer negative surface water ice to', & |
---|
| 585 | ' watercap !' |
---|
| 586 | if (nq.ge.1) then |
---|
| 587 | do iq=1,nq |
---|
| 588 | txt=noms(iq) |
---|
| 589 | if (txt.eq."h2o_ice") then |
---|
| 590 | do ig=1,ngrid |
---|
| 591 | if (qsurf(ig,iq).lt.0.0) then |
---|
| 592 | watercap(ig) = qsurf(ig,iq) |
---|
| 593 | qsurf(ig,iq) = 0.0 |
---|
| 594 | end if |
---|
| 595 | end do |
---|
| 596 | endif |
---|
[2378] | 597 | |
---|
| 598 | if (txt.eq."hdo_ice") then |
---|
| 599 | do ig=1,ngrid |
---|
| 600 | if (qsurf(ig,iq).lt.0.0) then |
---|
| 601 | qsurf(ig,iq) = 0.0 |
---|
| 602 | end if |
---|
| 603 | end do |
---|
| 604 | endif |
---|
| 605 | |
---|
[2281] | 606 | enddo |
---|
| 607 | endif ! of if (nq.ge.1) |
---|
| 608 | endif ! of if (.not.found) |
---|
[2264] | 609 | else |
---|
[2281] | 610 | watercap(:)=0 |
---|
| 611 | endif ! of if (startphy_file) |
---|
| 612 | write(*,*) "phyetat0: Surface water ice <watercap> range:", & |
---|
| 613 | minval(watercap), maxval(watercap) |
---|
| 614 | |
---|
[2260] | 615 | |
---|
| 616 | |
---|
[2281] | 617 | if (startphy_file) then |
---|
| 618 | ! Call to soil_settings, in order to read soil temperatures, |
---|
| 619 | ! as well as thermal inertia and volumetric heat capacity |
---|
| 620 | call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) |
---|
| 621 | endif ! of if (startphy_file) |
---|
[1130] | 622 | ! |
---|
| 623 | ! close file: |
---|
| 624 | ! |
---|
[2281] | 625 | if (startphy_file) call close_startphy |
---|
[1130] | 626 | |
---|
[1944] | 627 | end subroutine phyetat0 |
---|
| 628 | |
---|
[2545] | 629 | |
---|
| 630 | subroutine ini_tab_controle_dyn_xios(idayref) |
---|
| 631 | |
---|
| 632 | USE comcstfi_h, only: g, mugaz, omeg, rad, rcp |
---|
| 633 | USE time_phylmdz_mod, ONLY: hour_ini, daysec, dtphys |
---|
| 634 | USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev |
---|
| 635 | IMPLICIT NONE |
---|
| 636 | |
---|
| 637 | |
---|
| 638 | INTEGER*4,intent(in) :: idayref ! date (initial date for this run) |
---|
| 639 | |
---|
| 640 | |
---|
| 641 | INTEGER length,l |
---|
| 642 | parameter (length = 100) |
---|
| 643 | REAL tab_cntrl(length) ! run parameters are stored in this array |
---|
| 644 | |
---|
| 645 | DO l=1,length |
---|
| 646 | tab_cntrl(l)=0. |
---|
| 647 | ENDDO |
---|
| 648 | tab_cntrl(1) = real(nbp_lon) |
---|
| 649 | tab_cntrl(2) = real(nbp_lat-1) |
---|
| 650 | tab_cntrl(3) = real(nbp_lev) |
---|
| 651 | tab_cntrl(4) = real(idayref) |
---|
| 652 | tab_cntrl(5) = rad |
---|
| 653 | tab_cntrl(6) = omeg |
---|
| 654 | tab_cntrl(7) = g |
---|
| 655 | tab_cntrl(8) = mugaz |
---|
| 656 | tab_cntrl(9) = rcp |
---|
| 657 | tab_cntrl(10) = daysec |
---|
| 658 | tab_cntrl(11) = dtphys |
---|
| 659 | |
---|
| 660 | tab_cntrl(27) = hour_ini |
---|
| 661 | |
---|
| 662 | tab_cntrl_mod = tab_cntrl |
---|
| 663 | |
---|
| 664 | end subroutine ini_tab_controle_dyn_xios |
---|
| 665 | |
---|
[1944] | 666 | end module phyetat0_mod |
---|