Changeset 2281
- Timestamp:
- Apr 8, 2020, 6:35:50 PM (5 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r2280 r2281 2932 2932 This program can be used to interpolate GCM files at one terminator (morning or evening) all around the globe. 2933 2933 + a fix of localtime.F90 which didn't work for stats files. 2934 2935 == 08/04/2020 == AD 2936 Martian physics is now able to start without startfi.nc 2937 Major update for phyetat0_mod and physiq_mod based on what have been done for the Generic physics -
trunk/LMDZ.MARS/libf/phymars/callkeys.h
r2221 r2281 16 16 & ,co2useh2o,meteo_flux,CLFvaryingCO2,spantCO2,CLFvarying & 17 17 & ,satindexco2,rdstorm,slpwind,calllott_nonoro & 18 & ,latentheat_surfwater,gwd_convective_source 19 18 & ,latentheat_surfwater,gwd_convective_source,startphy_file 19 20 20 COMMON/callkeys_i/iradia,iaervar,iddist,ilwd,ilwb,ilwn,ncouche & 21 21 & ,dustbin,nltemodel,nircorr,solvarmod,solvaryear,dustinjection … … 33 33 34 34 COMMON/aeroutput/dustiropacity 35 36 logical startphy_file 35 37 36 38 logical callemis … … 81 83 integer nircorr 82 84 85 83 86 character(len=100) dustiropacity 84 87 real dustrefir -
trunk/LMDZ.MARS/libf/phymars/conf_phys.F
r2218 r2281 35 35 ! to use 'getin' 36 36 USE ioipsl_getincom, only : getin 37 USE ioipsl_getin_p_mod, ONLY : getin_p 37 38 use tracer_mod, only : nuice_sed, ccn_factor, nuiceco2_sed, 38 39 & nuice_ref,nuiceco2_ref … … 90 91 write(*,*) " datadir = ",trim(datadir) 91 92 93 write(*,*) "Initialize physics with startfi.nc file ?" 94 startphy_file=.true. 95 call getin_p("startphy_file",startphy_file) 96 write(*,*) "startphy_file", startphy_file 97 92 98 write(*,*) "Run with or without tracer transport ?" 93 99 tracer=.false. ! default value -
trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90
r2265 r2281 16 16 get_field, get_var, inquire_field, & 17 17 inquire_dimension, inquire_dimension_length 18 use ioipsl_getincom, only : getin19 18 use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd 20 19 use compute_dtau_mod, only: dtau 20 21 USE ioipsl_getin_p_mod, ONLY : getin_p 21 22 22 23 implicit none … … 32 33 ! June 2013 TN : Possibility to read files with a time axis 33 34 ! November 2013 EM : Enabeling parallel, using iostart module 35 ! March 2020 AD: Enabling initialization of physics without startfi 36 ! flag: startphy_file 34 37 !====================================================================== 35 38 INTEGER nbsrf !Mars nbsrf a 1 au lieu de 4 … … 39 42 ! --------- 40 43 ! inputs: 44 ! logical,intent(in) :: startphy_file ! .true. if reading start file 41 45 character*(*),intent(in) :: fichnom ! "startfi.nc" file 42 46 integer,intent(in) :: tab0 … … 97 101 98 102 REAL :: timestart ! to pick which initial state to start from 99 100 ! open physics initial state file: 101 call open_startphy(fichnom) 102 103 104 ! possibility to modify tab_cntrl in tabfi 105 write(*,*) 106 write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 107 call tabfi (nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & 108 p_omeg,p_g,p_mugaz,p_daysec,time0) 109 110 111 ! Load surface geopotential: 112 call get_field("phisfi",phisfi,found) 113 if (.not.found) then 114 write(*,*) "phyetat0: Failed loading <phisfi>" 115 call abort 116 else 117 write(*,*) "phyetat0: surface geopotential <phisfi> range:", & 118 minval(phisfi), maxval(phisfi) 103 REAL :: surfemis ! constant emissivity when no startfi 104 REAL :: surfalbedo ! constant emissivity when no startfi 105 CHARACTER(len=5) :: modname="phyetat0" 106 107 write(*,*) "phyetat0: startphy_file", startphy_file 108 109 if(.not.startphy_file) then 110 surfemis = -999 111 surfalbedo = -999 112 call getin_p("surfemis",surfemis) 113 call getin_p("surfalbedo",surfalbedo) 114 if (surfemis.eq.-999) then 115 call abort_physic(modname, & 116 "Missing value for surfemis in def files!",1) 117 endif 118 if (surfalbedo.eq.-999) then 119 call abort_physic(modname, & 120 "Missing value for surfalbedo in def files!",1) 121 endif 122 write(*,*) "phyetat0: surfemis: ", surfemis 123 write(*,*) "phyetat0: surfalbedo: ", surfalbedo 119 124 endif 120 125 121 122 ! Load bare ground albedo: 123 call get_field("albedodat",albedodat,found) 124 if (.not.found) then 125 write(*,*) "phyetat0: Failed loading <albedodat>" 126 call abort 127 else 128 write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & 126 if (startphy_file) then 127 ! open physics initial state file: 128 call open_startphy(fichnom) 129 ! possibility to modify tab_cntrl in tabfi 130 write(*,*) 131 write(*,*) 'TABFI in phyeta0: Lmodif=',Lmodif," tab0=",tab0 132 call tabfi (nid_start,Lmodif,tab0,day_ini,lmax,p_rad, & 133 p_omeg,p_g,p_mugaz,p_daysec,time0) 134 else ! "academic" initialization of planetary parameters via tabfi 135 call tabfi (0,0,0,day_ini,lmax,p_rad, & 136 p_omeg,p_g,p_mugaz,p_daysec,time0) 137 endif ! of if (startphy_file) 138 139 if (startphy_file) then 140 ! Load surface geopotential: 141 call get_field("phisfi",phisfi,found) 142 if (.not.found) then 143 call abort_physic(modname, & 144 "phyetat0: Failed loading <phisfi>",1) 145 endif 146 else 147 phisfi(:)=0. 148 endif ! of if (startphy_file) 149 write(*,*) "phyetat0: surface geopotential <phisfi> range:", & 150 minval(phisfi), maxval(phisfi) 151 152 153 if (startphy_file) then 154 ! Load bare ground albedo: 155 call get_field("albedodat",albedodat,found) 156 if (.not.found) then 157 call abort_physic(modname, & 158 "phyetat0: Failed loading <albedodat>",1) 159 endif 160 else ! If no startfi file, use parameter surfalbedo in def file 161 surfalbedo=0.5 162 call getin_p("surfalbedo",surfalbedo) 163 print*,"surfalbedo",surfalbedo 164 albedodat(:)=surfalbedo 165 endif ! of if (startphy_file) 166 write(*,*) "phyetat0: Bare ground albedo <albedodat> range:", & 129 167 minval(albedodat), maxval(albedodat) 130 endif131 168 132 169 ! ZMEA 133 call get_field("ZMEA",zmea,found) 134 if (.not.found) then 135 write(*,*) "phyetat0: Failed loading <ZMEA>" 136 call abort 137 else 138 write(*,*) "phyetat0: <ZMEA> range:", & 139 minval(zmea), maxval(zmea) 140 endif 170 if (startphy_file) then 171 call get_field("ZMEA",zmea,found) 172 if (.not.found) then 173 call abort_physic(modname, & 174 "phyetat0: Failed loading <ZMEA>",1) 175 endif 176 else 177 zmea(:)=0. 178 endif ! of if (startphy_file) 179 write(*,*) "phyetat0: <ZMEA> range:", & 180 minval(zmea), maxval(zmea) 141 181 142 182 143 183 ! ZSTD 144 call get_field("ZSTD",zstd,found) 145 if (.not.found) then 146 write(*,*) "phyetat0: Failed loading <ZSTD>" 147 call abort 148 else 149 write(*,*) "phyetat0: <ZSTD> range:", & 150 minval(zstd), maxval(zstd) 151 endif 184 if (startphy_file) then 185 call get_field("ZSTD",zstd,found) 186 if (.not.found) then 187 call abort_physic(modname, & 188 "phyetat0: Failed loading <ZSTD>",1) 189 endif 190 else 191 zstd(:)=0. 192 endif ! of if (startphy_file) 193 write(*,*) "phyetat0: <ZSTD> range:", & 194 minval(zstd), maxval(zstd) 152 195 153 196 154 197 ! ZSIG 155 call get_field("ZSIG",zsig,found) 156 if (.not.found) then 157 write(*,*) "phyetat0: Failed loading <ZSIG>" 158 call abort 159 else 160 write(*,*) "phyetat0: <ZSIG> range:", & 161 minval(zsig), maxval(zsig) 162 endif 198 if (startphy_file) then 199 call get_field("ZSIG",zsig,found) 200 if (.not.found) then 201 call abort_physic(modname, & 202 "phyetat0: Failed loading <ZSIG>",1) 203 endif 204 else 205 zsig(:)=0. 206 endif ! of if (startphy_file) 207 write(*,*) "phyetat0: <ZSIG> range:", & 208 minval(zsig), maxval(zsig) 163 209 164 210 165 211 ! ZGAM 166 call get_field("ZGAM",zgam,found) 167 if (.not.found) then 168 write(*,*) "phyetat0: Failed loading <ZGAM>" 169 call abort 170 else 171 write(*,*) "phyetat0: <ZGAM> range:", & 172 minval(zgam), maxval(zgam) 173 endif 212 if (startphy_file) then 213 call get_field("ZGAM",zgam,found) 214 if (.not.found) then 215 call abort_physic(modname, & 216 "phyetat0: Failed loading <ZGAM>",1) 217 endif 218 else 219 zgam(:)=0. 220 endif ! of if (startphy_file) 221 write(*,*) "phyetat0: <ZGAM> range:", & 222 minval(zgam), maxval(zgam) 174 223 175 224 176 225 ! ZTHE 177 call get_field("ZTHE",zthe,found) 178 if (.not.found) then 179 write(*,*) "phyetat0: Failed loading <ZTHE>" 180 call abort 181 else 182 write(*,*) "phyetat0: <ZTHE> range:", & 226 if (startphy_file) then 227 call get_field("ZTHE",zthe,found) 228 if (.not.found) then 229 call abort_physic(modname, & 230 "phyetat0: Failed loading <ZTHE>",1) 231 endif 232 else 233 zthe(:)=0. 234 endif ! of if (startphy_file) 235 write(*,*) "phyetat0: <ZTHE> range:", & 183 236 minval(zthe), maxval(zthe) 184 endif 185 186 ! hmons 187 call get_field("hmons",hmons,found) 188 if (.not.found) then 189 write(*,*) "WARNING: phyetat0: Failed loading <hmons>" 190 if (rdstorm) then 191 call abort 192 else 193 write(*,*) "will continue anyway..." 194 write(*,*) "because you may not need it." 195 hmons(:)=0. 196 end if 197 else 198 do ig=1,ngrid 199 if (hmons(ig) .eq. -999999.) hmons(ig)=0. 200 enddo 201 write(*,*) "phyetat0: <hmons> range:", & 202 minval(hmons), maxval(hmons) 203 endif 204 205 ! summit 206 call get_field("summit",summit,found) 207 if (.not.found) then 208 write(*,*) "WARNING: phyetat0: Failed loading <summit>" 209 if (rdstorm) then 210 call abort 211 else 212 write(*,*) "will continue anyway..." 213 write(*,*) "because you may not need it." 214 summit(:)=0. 215 end if 216 else 217 do ig=1,ngrid 218 if (summit(ig) .eq. -999999.) summit(ig)=0. 219 enddo 220 write(*,*) "phyetat0: <summit> range:", & 221 minval(summit), maxval(summit) 222 endif 223 224 ! summit 225 call get_field("base",base,found) 226 if (.not.found) then 227 write(*,*) "WARNING: phyetat0: Failed loading <base>" 228 if (rdstorm) then 229 call abort 230 else 231 write(*,*) "will continue anyway..." 232 write(*,*) "because you may not need it." 233 base(:)=0. 234 end if 235 else 236 do ig=1,ngrid 237 if (base(ig) .eq. -999999.) base(ig)=0. 238 enddo 239 write(*,*) "phyetat0: <base> range:", & 240 minval(base), maxval(base) 241 endif 237 238 ! hmons 239 if (startphy_file) then 240 call get_field("hmons",hmons,found) 241 if (.not.found) then 242 write(*,*) "WARNING: phyetat0: Failed loading <hmons>" 243 if (rdstorm) then 244 call abort_physic(modname, & 245 "phyetat0: Failed loading <hmons>",1) 246 else 247 write(*,*) "will continue anyway..." 248 write(*,*) "because you may not need it." 249 hmons(:)=0. 250 end if ! if (rdstorm) 251 else 252 do ig=1,ngrid 253 if (hmons(ig) .eq. -999999.) hmons(ig)=0. 254 enddo 255 endif ! (.not.found) 256 else 257 hmons(:)=0. 258 endif ! if (startphy_file) 259 write(*,*) "phyetat0: <hmons> range:", & 260 minval(hmons), maxval(hmons) 261 262 263 ! summit 264 if (startphy_file) then 265 call get_field("summit",summit,found) 266 if (.not.found) then 267 write(*,*) "WARNING: phyetat0: Failed loading <summit>" 268 if (rdstorm) then 269 call abort_physic(modname, & 270 "phyetat0: Failed loading <summit>",1) 271 else 272 write(*,*) "will continue anyway..." 273 write(*,*) "because you may not need it." 274 summit(:)=0. 275 end if 276 else 277 do ig=1,ngrid 278 if (summit(ig) .eq. -999999.) summit(ig)=0. 279 enddo 280 endif ! if (.not.found) 281 else 282 summit(:)=0. 283 endif ! if (startphy_file) 284 write(*,*) "phyetat0: <summit> range:", & 285 minval(summit), maxval(summit) 286 287 288 ! base 289 if (startphy_file) then 290 call get_field("base",base,found) 291 if (.not.found) then 292 write(*,*) "WARNING: phyetat0: Failed loading <base>" 293 if (rdstorm) then 294 call abort_physic(modname, & 295 "phyetat0: Failed loading <base>",1) 296 else 297 write(*,*) "will continue anyway..." 298 write(*,*) "because you may not need it." 299 base(:)=0. 300 end if 301 else 302 do ig=1,ngrid 303 if (base(ig) .eq. -999999.) base(ig)=0. 304 enddo 305 endif ! if(.not.found) 306 else 307 base(:)=0. 308 endif ! if (startphy_file) 309 write(*,*) "phyetat0: <base> range:", & 310 minval(base), maxval(base) 311 242 312 243 313 ! Time axis 244 314 ! obtain timestart from run.def 245 315 timestart=-9999 ! default value 246 call getin("timestart",timestart) 247 248 found=inquire_dimension("Time") 249 if (.not.found) then 316 call getin_p("timestart",timestart) 317 if (startphy_file) then 318 found=inquire_dimension("Time") 319 if (.not.found) then 320 indextime = 1 321 write(*,*) "phyetat0: No time axis found in "//trim(fichnom) 322 else 323 write(*,*) "phyetat0: Time axis found in "//trim(fichnom) 324 timelen=inquire_dimension_length("Time") 325 allocate(time(timelen)) 326 ! load "Time" array: 327 call get_var("Time",time,found) 328 if (.not.found) then 329 call abort_physic(modname, & 330 "phyetat0: Failed loading <Time>",1) 331 endif 332 ! seclect the desired time index 333 IF (timestart .lt. 0) THEN ! default: we use the last time value 334 indextime = timelen 335 ELSE ! else we look for the desired value in the time axis 336 indextime = 0 337 DO i=1,timelen 338 IF (abs(time(i) - timestart) .lt. 0.01) THEN 339 indextime = i 340 EXIT 341 ENDIF 342 ENDDO 343 IF (indextime .eq. 0) THEN 344 PRINT*, "Time", timestart," is not in "//trim(fichnom)//"!!" 345 PRINT*, "Stored times are:" 346 DO i=1,timelen 347 PRINT*, time(i) 348 ENDDO 349 call abort_physic(modname,"phyetat0: Time error",1) 350 ENDIF 351 ENDIF ! of IF (timestart .lt. 0) 352 ! In startfi the absolute date is day_ini + time0 + time 353 ! For now on, in the GCM physics, it is day_ini + time0 354 time0 = time(indextime) + time0 355 day_ini = day_ini + INT(time0) 356 time0 = time0 - INT(time0) 357 PRINT*, "phyetat0: Selected time ",time(indextime), & 358 " at index ",indextime 359 DEALLOCATE(time) 360 endif ! of if Time not found in file 361 else 250 362 indextime = 1 251 write(*,*) "phyetat0: No time axis found in "//trim(fichnom) 252 else 253 write(*,*) "phyetat0: Time axis found in "//trim(fichnom) 254 timelen=inquire_dimension_length("Time") 255 allocate(time(timelen)) 256 ! load "Time" array: 257 call get_var("Time",time,found) 258 if (.not.found) then 259 write(*,*) "phyetat0: Failed loading <Time>" 260 call abort 261 endif 262 ! seclect the desired time index 263 IF (timestart .lt. 0) THEN ! default: we use the last time value 264 indextime = timelen 265 ELSE ! else we look for the desired value in the time axis 266 indextime = 0 267 DO i=1,timelen 268 IF (abs(time(i) - timestart) .lt. 0.01) THEN 269 indextime = i 270 EXIT 271 ENDIF 272 ENDDO 273 IF (indextime .eq. 0) THEN 274 PRINT*, "Time", timestart," is not in "//trim(fichnom)//"!!" 275 PRINT*, "Stored times are:" 276 DO i=1,timelen 277 PRINT*, time(i) 278 ENDDO 279 CALL abort 280 ENDIF 281 ENDIF ! of IF (timestart .lt. 0) 282 ! In startfi the absolute date is day_ini + time0 + time 283 ! For now on, in the GCM physics, it is day_ini + time0 284 time0 = time(indextime) + time0 285 day_ini = day_ini + INT(time0) 286 time0 = time0 - INT(time0) 287 288 PRINT*, "phyetat0: Selected time ",time(indextime), & 289 " at index ",indextime 290 291 DEALLOCATE(time) 292 endif ! of if Time not found in file 293 363 endif ! if (startphy_file) 294 364 295 365 ! CO2 ice cover 296 call get_field("co2ice",co2ice,found,indextime) 297 if (.not.found) then 298 write(*,*) "phyetat0: Failed loading <co2ice>" 299 call abort 300 else 301 write(*,*) "phyetat0: CO2 ice cover <co2ice> range:", & 302 minval(co2ice), maxval(co2ice) 303 endif 366 if (startphy_file) then 367 call get_field("co2ice",co2ice,found,indextime) 368 if (.not.found) then 369 call abort_physic(modname, & 370 "phyetat0: Failed loading <co2ice>",1) 371 endif 372 else 373 co2ice(:)=0. 374 endif !if (startphy_file) 375 write(*,*) "phyetat0: CO2 ice cover <co2ice> range:", & 376 minval(co2ice), maxval(co2ice) 304 377 305 378 ! Memory of the origin of the co2 particles 306 call get_field("mem_Mccn_co2",mem_Mccn_co2,found,indextime) 307 if (.not.found) then 308 write(*,*) "phyetat0: <mem_Mccn_co2> not in file" 309 mem_Mccn_co2(:,:)=0 310 else 311 write(*,*) "phyetat0: Memory of CCN mass of H2O and dust used by CO2" 312 write(*,*) " <mem_Mccn_co2> range:", & 379 if (startphy_file) then 380 call get_field("mem_Mccn_co2",mem_Mccn_co2,found,indextime) 381 if (.not.found) then 382 write(*,*) "phyetat0: <mem_Mccn_co2> not in file" 383 mem_Mccn_co2(:,:)=0 384 endif 385 else 386 mem_Mccn_co2(:,:)=0 387 endif !if (startphy_file) 388 write(*,*) "phyetat0: Memory of CCN mass of H2O and dust used by CO2" 389 write(*,*) " <mem_Mccn_co2> range:", & 313 390 minval(mem_Mccn_co2), maxval(mem_Mccn_co2) 314 endif 315 316 call get_field("mem_Nccn_co2",mem_Nccn_co2,found,indextime) 317 if (.not.found) then 318 write(*,*) "phyetat0: <mem_Nccn_co2> not in file" 391 392 if (startphy_file) then 393 call get_field("mem_Nccn_co2",mem_Nccn_co2,found,indextime) 394 if (.not.found) then 395 write(*,*) "phyetat0: <mem_Nccn_co2> not in file" 396 mem_Nccn_co2(:,:)=0 397 endif 398 else 319 399 mem_Nccn_co2(:,:)=0 320 e lse321 322 400 endif ! if (startphy_file) 401 write(*,*) "phyetat0: Memory of CCN number of H2O and dust used by CO2" 402 write(*,*) " <mem_Nccn_co2> range:", & 323 403 minval(mem_Nccn_co2), maxval(mem_Nccn_co2) 324 endif 325 326 call get_field("mem_Mh2o_co2",mem_Mh2o_co2,found,indextime) 327 if (.not.found) then 328 write(*,*) "phyetat0: <mem_Mh2o_co2> not in file" 329 mem_Mh2o_co2(:,:)=0 330 else 331 write(*,*) "phyetat0: Memory of H2O mass integred into CO2 crystal" 332 write(*,*) " <mem_Mh2o_co2> range:", & 404 405 if (startphy_file) then 406 call get_field("mem_Mh2o_co2",mem_Mh2o_co2,found,indextime) 407 if (.not.found) then 408 write(*,*) "phyetat0: <mem_Mh2o_co2> not in file" 409 mem_Mh2o_co2(:,:)=0 410 endif 411 else 412 mem_Mh2o_co2(:,:)=0 413 endif ! if (startphy_file) 414 write(*,*) "phyetat0: Memory of H2O mass integred into CO2 crystal" 415 write(*,*) " <mem_Mh2o_co2> range:", & 333 416 minval(mem_Mh2o_co2), maxval(mem_Mh2o_co2) 334 endif335 417 336 418 ! Dust conversion factor 337 call get_field("tauscaling",tauscaling,found,indextime) 338 if (.not.found) then 339 write(*,*) "phyetat0: <tauscaling> not in file" 340 tauscaling(:) = 1 341 else 342 write(*,*) "phyetat0: dust conversion factor <tauscaling> range:", & 343 minval(tauscaling), maxval(tauscaling) 344 endif 419 if (startphy_file) then 420 call get_field("tauscaling",tauscaling,found,indextime) 421 if (.not.found) then 422 write(*,*) "phyetat0: <tauscaling> not in file" 423 tauscaling(:) = 1 424 endif 425 else 426 tauscaling(:) = 1 427 endif ! if (startphy_file) 428 write(*,*) "phyetat0: dust conversion factor <tauscaling> range:", & 429 minval(tauscaling), maxval(tauscaling) 430 345 431 346 432 ! dtau: opacity difference between GCM and dust scenario 347 call get_field("dtau",dtau,found,indextime) 348 if (.not.found) then 349 write(*,*) "phyetat0: <dtau> not in file; set to zero" 350 dtau(:) = 0 351 else 352 write(*,*) "phyetat0: opacity diff wrt scenario <dtau> range:", & 353 minval(dtau), maxval(dtau) 354 endif 433 if (startphy_file) then 434 call get_field("dtau",dtau,found,indextime) 435 if (.not.found) then 436 write(*,*) "phyetat0: <dtau> not in file; set to zero" 437 dtau(:) = 0 438 endif 439 else 440 dtau(:)= 0 441 endif ! if (startphy_file) 442 write(*,*) "phyetat0: opacity diff wrt scenario <dtau> range:", & 443 minval(dtau), maxval(dtau) 355 444 356 445 357 446 ! Sub-grid cloud fraction 358 call get_field("totcloudfrac",totcloudfrac,found,indextime) 359 if (.not.found) then 360 write(*,*) "phyetat0: <totcloudfrac> not in file WARNING put to 1" 361 totcloudfrac(:) = 1.0 !valeur par defaut (CLFfixval par defaut) 362 else 363 write(*,*) "phyetat0: total cloud fraction <totcloudfrac> range:", & 364 minval(totcloudfrac), maxval(totcloudfrac) 365 endif 447 if (startphy_file) then 448 call get_field("totcloudfrac",totcloudfrac,found,indextime) 449 if (.not.found) then 450 write(*,*) "phyetat0: <totcloudfrac> not in file WARNING put to 1" 451 totcloudfrac(:) = 1.0 !valeur par defaut (CLFfixval par defaut) 452 endif 453 else 454 totcloudfrac(:)=1.0 455 endif ! if (startphy_file) 456 write(*,*) "phyetat0: total cloud fraction <totcloudfrac> range:", & 457 minval(totcloudfrac), maxval(totcloudfrac) 458 366 459 367 460 ! Max vertical velocity in thermals 368 call get_field("wstar",wstar,found,indextime) 369 if (.not.found) then 370 write(*,*) "phyetat0: <wstar> not in file! Set to zero" 371 wstar(:)=0 372 else 373 write(*,*) "phyetat0: Max vertical velocity in thermals <wstar> range:", & 374 minval(wstar),maxval(wstar) 375 endif 461 if (startphy_file) then 462 call get_field("wstar",wstar,found,indextime) 463 if (.not.found) then 464 write(*,*) "phyetat0: <wstar> not in file! Set to zero" 465 wstar(:)=0 466 endif 467 else 468 wstar(:)=0 469 endif ! if (startphy_file) 470 write(*,*) "phyetat0: Max vertical velocity in thermals <wstar> range:", & 471 minval(wstar),maxval(wstar) 472 376 473 377 474 ! Surface temperature : 378 call get_field("tsurf",tsurf,found,indextime) 379 if (.not.found) then 380 write(*,*) "phyetat0: Failed loading <tsurf>" 381 call abort 382 else 383 write(*,*) "phyetat0: Surface temperature <tsurf> range:", & 384 minval(tsurf), maxval(tsurf) 385 endif 475 if (startphy_file) then !tsurf 476 call get_field("tsurf",tsurf,found,indextime) 477 if (.not.found) then 478 call abort_physic(modname, & 479 "phyetat0: Failed loading <tsurf>",1) 480 endif 481 else 482 tsurf(:)=0. ! will be updated afterwards in physiq ! 483 endif ! of if (startphy_file) 484 write(*,*) "phyetat0: Surface temperature <tsurf> range:", & 485 minval(tsurf), maxval(tsurf) 386 486 387 487 ! Surface albedo 388 call get_field("albedo",albedo(:,1),found,indextime) 389 if (.not.found) then 390 write(*,*) "phyetat0: Failed loading <albedo>" 391 albedo(:,1)=albedodat(:) 392 else 393 write(*,*) "phyetat0: Surface albedo <albedo> range:", & 394 minval(albedo(:,1)), maxval(albedo(:,1)) 395 endif 488 if (startphy_file) then 489 call get_field("albedo",albedo(:,1),found,indextime) 490 if (.not.found) then 491 write(*,*) "phyetat0: Failed loading <albedo>" 492 albedo(:,1)=albedodat(:) 493 endif 494 else 495 albedo(:,1)=albedodat(:) 496 endif ! of if (startphy_file) 497 write(*,*) "phyetat0: Surface albedo <albedo> range:", & 498 minval(albedo(:,1)), maxval(albedo(:,1)) 396 499 albedo(:,2)=albedo(:,1) 397 500 398 501 ! Surface emissivity 399 call get_field("emis",emis,found,indextime) 400 if (.not.found) then 401 write(*,*) "phyetat0: Failed loading <emis>" 402 call abort 403 else 404 write(*,*) "phyetat0: Surface emissivity <emis> range:", & 405 minval(emis), maxval(emis) 406 endif 502 if (startphy_file) then 503 call get_field("emis",emis,found,indextime) 504 if (.not.found) then 505 call abort_physic(modname, & 506 "phyetat0: Failed loading <emis>",1) 507 endif 508 else 509 ! If no startfi file, use parameter surfemis in def file 510 surfemis=1.0 511 call getin_p("surfemis",surfemis) 512 print*,"surfemis",surfemis 513 emis(:)=surfemis 514 endif ! of if (startphy_file) 515 write(*,*) "phyetat0: Surface emissivity <emis> range:", & 516 minval(emis), maxval(emis) 407 517 408 518 409 519 ! surface roughness length (NB: z0 is a common in surfdat_h) 410 call get_field("z0",z0,found) 411 if (.not.found) then 412 write(*,*) "phyetat0: Failed loading <z0>" 413 write(*,*) 'will use constant value of z0_default:',z0_default 414 z0(:)=z0_default 415 else 416 write(*,*) "phyetat0: Surface roughness <z0> range:", & 417 minval(z0), maxval(z0) 418 endif 520 if (startphy_file) then 521 call get_field("z0",z0,found) 522 if (.not.found) then 523 write(*,*) "phyetat0: Failed loading <z0>" 524 write(*,*) 'will use constant value of z0_default:',z0_default 525 z0(:)=z0_default 526 endif 527 else 528 z0(:)=z0_default 529 endif ! of if (startphy_file) 530 write(*,*) "phyetat0: Surface roughness <z0> range:", & 531 minval(z0), maxval(z0) 419 532 420 533 421 534 ! pbl wind variance 422 call get_field("q2",q2,found,indextime) 423 if (.not.found) then 424 write(*,*) "phyetat0: Failed loading <q2>" 425 call abort 426 else 427 write(*,*) "phyetat0: PBL wind variance <q2> range:", & 428 minval(q2), maxval(q2) 429 endif 430 431 ! Non-orographic gravity waves 432 call get_field("du_nonoro_gwd",du_nonoro_gwd,found,indextime) 433 if (.not.found) then 434 write(*,*) "phyetat0: <du_nonoro_gwd> not in file" 435 du_nonoro_gwd(:,:)=0. 436 else 437 write(*,*) "phyetat0: Memory of zonal wind tendency due to non-orographic GW" 438 write(*,*) " <du_nonoro_gwd> range:", & 439 minval(du_nonoro_gwd), maxval(du_nonoro_gwd) 440 endif 441 442 call get_field("dv_nonoro_gwd",dv_nonoro_gwd,found,indextime) 443 if (.not.found) then 444 write(*,*) "phyetat0: <dv_nonoro_gwd> not in file" 445 dv_nonoro_gwd(:,:)=0. 446 else 447 write(*,*) "phyetat0: Memory of meridional wind tendency due to non-orographic GW" 448 write(*,*) " <dv_nonoro_gwd> range:", & 449 minval(dv_nonoro_gwd), maxval(dv_nonoro_gwd) 450 endif 535 if (startphy_file) then 536 call get_field("q2",q2,found,indextime) 537 if (.not.found) then 538 call abort_physic(modname, & 539 "phyetat0: Failed loading <q2>",1) 540 endif 541 else 542 q2(:,:)=0. 543 endif ! of if (startphy_file) 544 write(*,*) "phyetat0: PBL wind variance <q2> range:", & 545 minval(q2), maxval(q2) 546 547 ! Non-orographic gravity waves 548 if (startphy_file) then 549 call get_field("du_nonoro_gwd",du_nonoro_gwd,found,indextime) 550 if (.not.found) then 551 write(*,*) "phyetat0: <du_nonoro_gwd> not in file" 552 du_nonoro_gwd(:,:)=0. 553 endif 554 else 555 du_nonoro_gwd(:,:)=0. 556 endif ! if (startphy_file) 557 write(*,*) "phyetat0: Memory of zonal wind tendency due to non-orographic GW" 558 write(*,*) " <du_nonoro_gwd> range:", & 559 minval(du_nonoro_gwd), maxval(du_nonoro_gwd) 560 561 if (startphy_file) then 562 call get_field("dv_nonoro_gwd",dv_nonoro_gwd,found,indextime) 563 if (.not.found) then 564 write(*,*) "phyetat0: <dv_nonoro_gwd> not in file" 565 dv_nonoro_gwd(:,:)=0. 566 endif 567 else ! ! if (startphy_file) 568 dv_nonoro_gwd(:,:)=0. 569 endif ! if (startphy_file) 570 write(*,*) "phyetat0: Memory of meridional wind tendency due to non-orographic GW" 571 write(*,*) " <dv_nonoro_gwd> range:", & 572 minval(dv_nonoro_gwd), maxval(dv_nonoro_gwd) 451 573 452 574 ! tracer on surface … … 462 584 write(*,*) 'iq = ', iq 463 585 endif 464 call get_field(txt,qsurf(:,iq),found,indextime) 465 if (.not.found) then 466 write(*,*) "phyetat0: Failed loading <",trim(txt),">" 467 write(*,*) " ",trim(txt)," is set to zero" 586 if (startphy_file) then 587 call get_field(txt,qsurf(:,iq),found,indextime) 588 if (.not.found) then 589 write(*,*) "phyetat0: Failed loading <",trim(txt),">" 590 write(*,*) " ",trim(txt)," is set to zero" 591 endif 468 592 else 469 write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & 593 qsurf(:,iq)=0. 594 endif ! of if (startphy_file) 595 write(*,*) "phyetat0: Surface tracer <",trim(txt),"> range:", & 470 596 minval(qsurf(:,iq)), maxval(qsurf(:,iq)) 471 endif 472 enddo 597 enddo ! of do iq=1,nq 473 598 endif ! of if (nq.ge.1) 474 599 475 476 call get_field("watercap",watercap,found,indextime) 477 if (.not.found) then 478 write(*,*) "phyetat0: Failed loading <watercap> : ", & 479 "<watercap> is set to zero" 480 watercap(:)=0 481 482 write(*,*) 'Now transfer negative surface water ice to', & 483 ' watercap !' 484 if (nq.ge.1) then 485 do iq=1,nq 486 txt=noms(iq) 487 if (txt.eq."h2o_ice") then 488 do ig=1,ngrid 489 if (qsurf(ig,iq).lt.0.0) then 490 watercap(ig) = qsurf(ig,iq) 491 qsurf(ig,iq) = 0.0 492 end if 493 end do 494 endif 495 enddo 496 endif ! of if (nq.ge.1) 497 498 else 499 write(*,*) "phyetat0: Surface water ice <watercap> range:", & 500 minval(watercap), maxval(watercap) 501 endif 502 503 504 ! Call to soil_settings, in order to read soil temperatures, 505 ! as well as thermal inertia and volumetric heat capacity 506 call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) 507 600 if (startphy_file) then 601 call get_field("watercap",watercap,found,indextime) 602 if (.not.found) then 603 write(*,*) "phyetat0: Failed loading <watercap> : ", & 604 "<watercap> is set to zero" 605 watercap(:)=0 606 607 write(*,*) 'Now transfer negative surface water ice to', & 608 ' watercap !' 609 if (nq.ge.1) then 610 do iq=1,nq 611 txt=noms(iq) 612 if (txt.eq."h2o_ice") then 613 do ig=1,ngrid 614 if (qsurf(ig,iq).lt.0.0) then 615 watercap(ig) = qsurf(ig,iq) 616 qsurf(ig,iq) = 0.0 617 end if 618 end do 619 endif 620 enddo 621 endif ! of if (nq.ge.1) 622 endif ! of if (.not.found) 623 else 624 watercap(:)=0 625 endif ! of if (startphy_file) 626 write(*,*) "phyetat0: Surface water ice <watercap> range:", & 627 minval(watercap), maxval(watercap) 628 629 630 631 if (startphy_file) then 632 ! Call to soil_settings, in order to read soil temperatures, 633 ! as well as thermal inertia and volumetric heat capacity 634 call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) 635 endif ! of if (startphy_file) 508 636 ! 509 637 ! close file: 510 638 ! 511 call close_startphy639 if (startphy_file) call close_startphy 512 640 513 641 end subroutine phyetat0 -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r2265 r2281 270 270 271 271 ! CHARACTER*80 fichier 272 INTEGER l,ig,ierr,igout,iq,tapphys 272 INTEGER l,ig,ierr,igout,iq,tapphys,isoil 273 273 274 274 REAL fluxsurf_lw(ngrid) !incident LW (IR) surface flux (W.m-2) … … 479 479 REAL hsummit(ngrid) 480 480 481 ! LOGICAL startphy_file 482 481 483 c======================================================================= 482 484 … … 515 517 & mem_Mccn_co2,mem_Nccn_co2, 516 518 & mem_Mh2o_co2,watercap) 517 518 if (pday.ne.day_ini) then519 write(*,*) "PHYSIQ: ERROR: bad synchronization between ",520 & "physics and dynamics"521 write(*,*) "dynamics day [pday]: ",pday522 write(*,*) "physics day [day_ini]: ",day_ini523 call abort_physic("physiq","dynamics day /= physics day",1)524 endif525 526 write (*,*) 'In physiq day_ini =', day_ini527 519 528 520 #else … … 545 537 day_ini = pday 546 538 #endif 539 #ifndef MESOSCALE 540 if (.not.startphy_file) then 541 ! starting without startfi.nc and with callsoil 542 ! is not yet possible as soildepth default is not defined 543 if (callsoil) then 544 call abort_physic("physiq","callsoil option is not", 545 & "yet available without startfi",1) 546 endif 547 ! additionnal "academic" initialization of physics 548 write(*,*) "Physiq: initializing tsurf(:) to pt(:,1) !!" 549 tsurf(:)=pt(:,1) 550 write(*,*) "Physiq: initializing tsoil(:) to pt(:,1) !!" 551 do isoil=1,nsoilmx 552 tsoil(1:ngrid,isoil)=tsurf(1:ngrid) 553 enddo 554 write(*,*) "Physiq: initializing inertiedat !!" 555 inertiedat(:,:)=400. 556 write(*,*) "Physiq: initializing day_ini to pdat !" 557 day_ini=pday 558 endif 559 #endif 560 561 if (pday.ne.day_ini) then 562 write(*,*) "PHYSIQ: ERROR: bad synchronization between ", 563 & "physics and dynamics" 564 write(*,*) "dynamics day [pday]: ",pday 565 write(*,*) "physics day [day_ini]: ",day_ini 566 call abort_physic("physiq","dynamics day /= physics day",1) 567 endif 568 569 write (*,*) 'In physiq day_ini =', day_ini 547 570 548 571 c initialize tracers … … 654 677 ENDIF ! (end of "if firstcall") 655 678 656 657 679 c --------------------------------------------------- 658 680 c 1.2 Initializations done at every physical timestep: … … 664 686 call update_xios_timestep 665 687 #endif 666 667 c Initialize various variables668 688 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 669 689 pdv(:,:)=0 … … 705 725 zplay(:,:) = pplay(:,:) 706 726 ps(:) = pplev(:,1) 707 708 727 709 728 c Compute geopotential at interlayers … … 739 758 ENDDO 740 759 ENDDO 741 742 760 #ifndef MESOSCALE 743 761 c----------------------------------------------------------------------- … … 768 786 c 2. Compute radiative tendencies : 769 787 c------------------------------------ 770 771 788 772 789 IF (callrad) THEN … … 931 948 & zls*180./pi,latitude(igout)*180/pi, 932 949 & longitude(igout)*180/pi 950 933 951 write(*,'(" tauref(",f4.0," Pa) =",f9.6, 934 952 & " tau(",f4.0," Pa) =",f9.6)') … … 1161 1179 c ------------------------------------------- 1162 1180 if (dustinjection.gt.0) then 1181 1163 1182 CALL compute_dtau(ngrid,nlayer, 1164 1183 & zday,pplev,tauref, … … 1229 1248 pdt(:,1)=pdt(:,1) + (tke_heat_flux/zz1(:))*zpopsk(:,1) 1230 1249 ENDIF 1231 1232 1250 c Calling vdif (Martian version WITH CO2 condensation) 1233 1251 CALL vdifc(ngrid,nlayer,nq,co2ice,zpopsk, … … 1256 1274 ENDDO 1257 1275 ENDDO 1258 1259 1276 if (tracer) then 1260 1277 DO iq=1, nq … … 3540 3557 3541 3558 icount=icount+1 3542 3543 3559 3544 3560 END SUBROUTINE physiq -
trunk/LMDZ.MARS/libf/phymars/tabfi.F
r1543 r2281 43 43 c 44 44 c======================================================================= 45 ! to use 'getin_p' 46 use ioipsl_getin_p_mod, only: getin_p 45 47 46 48 use comsoil_h, only: volcapa ! soil volumetric heat capacity … … 81 83 CHARACTER modif*20 82 84 LOGICAL :: found 85 CHARACTER(len=5) :: modname="tabfi" 83 86 84 87 write(*,*)"tabfi: nid=",nid," tab0=",tab0," Lmodif=",Lmodif … … 88 91 c----------------------------------------------------------------------- 89 92 IF (nid.eq.0) then 93 94 ! to avoid further issues with writing 95 tab_cntrl(:)=0 96 lmax=0 97 day_ini=0 98 time = 0 90 99 91 100 c Reference pressure … … 150 159 call get_var("controle",tab_cntrl,found) 151 160 if (.not.found) then 152 write(*,*)"tabfi: Failed reading <controle> array"153 call abort161 call abort_physic(modname, 162 & "tabfi: Failed reading <controle> array",1) 154 163 else 155 164 write(*,*)'tabfi: tab_cntrl',tab_cntrl
Note: See TracChangeset
for help on using the changeset viewer.