Changeset 3066
- Timestamp:
- Oct 2, 2023, 8:07:50 PM (14 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3064 r3066 4224 4224 - restore the possibility to run with a temperature-dependent contact parameter without using the cloud adaptative subtimestep 4225 4225 (MCD6.1 configuration, mteta = linear fit of temp) 4226 4227 == 02/10/2023 == LL 4228 Follwing -r 3056: 4229 - Surface variables (tsurf, tsoil, albedo, emis, qsurf) are not defined and allocated in testphys1D but the routines testphys1D and init_testphys1D used what is defined in comsoil, surfdat_h, dimradmod. 4230 -surface variables in testphys1D and init_testphys1D have a slope dimension (set to 1 for now, hard-coded, will be improve later). 4231 Slight changes are expected for the PEM (TBC w/ JBC). 4232 -
trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
r3065 r3066 6 6 7 7 SUBROUTINE init_testphys1d(pem1d,ngrid,nlayer,odpref,nq,q,time,psurf,u,v,temp,startfiles_1D,therestart1D,therestartfi, & 8 ndt,ptif,pks,dttestphys,zqsat, qsurf,dq,dqdyn,day0,day,tsurf,gru,grv,w,q2,play,plev,tsoil, &9 albedo,emis,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau)8 ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w,q2,play,plev, & 9 latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 10 10 11 11 use ioipsl_getincom, only: getin ! To use 'getin' … … 14 14 use planete_h, only: year_day, periheli, aphelie, peri_day, obliquit, emin_turb, lmixmin 15 15 use surfdat_h, only: albedodat, z0_default, z0, emissiv, emisice, albedice, iceradius, dtemisice, & 16 zmea, zstd, zsig, zgam, zthe, hmons, summit, base, phisfi, watercaptag, watercap 16 zmea, zstd, zsig, zgam, zthe, hmons, summit, base, phisfi, watercaptag, watercap, & 17 tsurf, emis, qsurf 17 18 use infotrac, only: nqtot, tname, nqperes, nqfils 18 19 use read_profile_mod, only: read_profile 19 20 use iostart, only: open_startphy, get_var, close_startphy 20 21 use physics_distribution_mod, only: init_physics_distribution 21 use comsoil_h, only: volcapa, nsoilmx, inertiesoil, inertiedat, layer, mlayer, flux_geo 22 use comsoil_h, only: volcapa, nsoilmx, inertiesoil, inertiedat, layer, mlayer, flux_geo, tsoil 22 23 use comvert_mod, only: ap, bp, aps, bps, pa, preff, presnivs, pseudoalt, scaleheight 23 use dimradmars_mod, only: tauvis, totcloudfrac 24 use dimradmars_mod, only: tauvis, totcloudfrac, albedo 24 25 use regular_lonlat_mod, only: init_regular_lonlat 25 26 use mod_interface_dyn_phys, only: init_interface_dyn_phys … … 63 64 real, intent(out) :: dttestphys ! testphys1d timestep 64 65 real, dimension(:), allocatable, intent(out) :: zqsat ! useful for (atm_wat_profile=2) 65 real, dimension(:), allocatable, intent(out) :: qsurf ! tracer surface budget (e.g. kg.m-2)66 66 real, dimension(:,:), allocatable, intent(out) :: dq, dqdyn ! Physical and dynamical tandencies 67 67 integer, intent(out) :: day0 ! initial (sol ; =0 at Ls=0) and final date 68 68 real, intent(out) :: day ! date during the run 69 real, dimension(1), intent(out) :: tsurf ! Surface temperature70 69 real, intent(out) :: gru, grv ! prescribed "geostrophic" background wind 71 70 real, dimension(nlayer), intent(out) :: w ! "Dummy wind" in 1D … … 73 72 real, dimension(nlayer), intent(out) :: play ! Pressure at the middle of the layers (Pa) 74 73 real, dimension(nlayer + 1), intent(out) :: plev ! intermediate pressure levels (pa) 75 real, dimension(nsoilmx), intent(out) :: tsoil ! subsurface soil temperature (K)76 real, dimension(1,1), intent(out) :: albedo ! surface albedo77 real, dimension(1), intent(out) :: emis ! surface layer78 74 real, dimension(1), intent(out) :: latitude, longitude, cell_area 79 75 real, intent(out) :: atm_wat_profile, atm_wat_tau ! Force atmospheric water profiles … … 241 237 242 238 ! allocate arrays: 243 allocate(tname(nq),q(nlayer,nq),zqsat(nlayer) ,qsurf(nq))239 allocate(tname(nq),q(nlayer,nq),zqsat(nlayer)) 244 240 allocate(dq(nlayer,nq),dqdyn(nlayer,nq),tnom_transp(nq)) 245 241 … … 293 289 write(*,*) 'nqfils=',nqfils 294 290 295 ! Initialize tracers here: 296 write(*,*) "init_testphys1d: initializing tracers" 297 if (.not. therestart1D) then 298 call read_profile(nq,nlayer,qsurf,q) 299 else 300 do iq = 1,nq 301 open(3,file = start1Dname,status = "old",action = "read") 302 read(3,*) header, qsurf(iq),(q(ilayer,iq), ilayer = 1,nlayer) 303 if (trim(tname(iq)) /= trim(header)) then 304 write(*,*) 'Tracer names not compatible for initialization with "'//trim(start1Dname)//'"!' 305 stop 306 endif 307 enddo 308 endif 291 309 292 310 293 #ifdef CPP_XIOS … … 465 448 endif 466 449 450 ! Initialize tracers (surface and atmosphere) here: 451 write(*,*) "init_testphys1d: initializing tracers" 452 if (.not. therestart1D) then 453 call read_profile(nq,nlayer,qsurf(1,:,1),q) 454 else 455 do iq = 1,nq 456 open(3,file = start1Dname,status = "old",action = "read") 457 read(3,*) header, qsurf(1,iq,1),(q(ilayer,iq), ilayer = 1,nlayer) 458 if (trim(tname(iq)) /= trim(header)) then 459 write(*,*) 'Tracer names not compatible for initialization with "'//trim(start1Dname)//'"!' 460 stop 461 endif 462 enddo 463 endif 464 465 466 467 467 ! Initialize albedo / soil thermal inertia 468 468 ! ---------------------------------------- … … 472 472 call getin("albedo",albedodat(1)) 473 473 write(*,*) " albedo = ",albedodat(1) 474 albedo(1, 1) = albedodat(1)474 albedo(1,:,1) = albedodat(1) 475 475 476 476 inertiedat(1,1) = 400 ! default value for inertiedat … … 570 570 571 571 if (.not. startfiles_1D) then 572 qsurf( igcm_co2) = 0. ! default value for co2ice572 qsurf(1,igcm_co2,1) = 0. ! default value for co2ice 573 573 write(*,*)'Initial CO2 ice on the surface (kg.m-2)' 574 call getin("co2ice",qsurf( igcm_co2))575 write(*,*) " co2ice = ",qsurf( igcm_co2)574 call getin("co2ice",qsurf(1,igcm_co2,1)) 575 write(*,*) " co2ice = ",qsurf(1,igcm_co2,1) 576 576 endif !(.not. startfiles_1D ) 577 577 … … 579 579 ! ---------- 580 580 if (.not. startfiles_1D) then 581 emis = emissiv582 if (qsurf( igcm_co2) == 1.) then583 emis = emisice(1) ! northern hemisphere584 if (latitude(1) < 0) emis = emisice(2) ! southern hemisphere581 emis(:,1) = emissiv 582 if (qsurf(1,igcm_co2,1) == 1.) then 583 emis(:,1) = emisice(1) ! northern hemisphere 584 if (latitude(1) < 0) emis(:,1) = emisice(2) ! southern hemisphere 585 585 endif 586 586 endif !(.not. startfiles_1D ) … … 614 614 615 615 if (.not. therestart1D) then 616 tsurf = tmp2(0)616 tsurf(:,1) = tmp2(0) 617 617 temp(:) = tmp2(1:) 618 618 else … … 658 658 inertiesoil(1,:,1) = inertiedat(1,:) 659 659 660 tsoil(: ) = tsurf(1) ! soil temperature660 tsoil(:,:,1) = tsurf(1,1) ! soil temperature 661 661 endif !(.not. startfiles_1D) 662 662 … … 692 692 qdyn(1,1,1:llm,1:nq) = q(1:llm,1:nq) 693 693 psdyn(1:2,1) = psurf 694 call inichim_newstart(ngrid,nq,qdyn,qsurf ,psdyn,flagh2o,flagthermo)694 call inichim_newstart(ngrid,nq,qdyn,qsurf(1,:,1),psdyn,flagh2o,flagthermo) 695 695 q(1:llm,1:nq) = qdyn(1,1,1:llm,1:nq) 696 696 endif -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3065 r3066 1 1 PROGRAM testphys1d 2 2 3 use comsoil_h, only: inertiedat, inertiesoil, nsoilmx 4 use surfdat_h, only: albedodat, perenial_co2ice, watercap 3 use comsoil_h, only: inertiedat, inertiesoil, nsoilmx, tsoil 4 use surfdat_h, only: albedodat, perenial_co2ice, watercap, tsurf, emis, qsurf 5 5 use comslope_mod, only: def_slope, subslope_dist 6 6 use phyredem, only: physdem0, physdem1 … … 9 9 use comcstfi_h, only: pi, rad, omeg, g, mugaz, rcp, r, cpp 10 10 use time_phylmdz_mod, only: daysec, day_step 11 use dimradmars_mod, only: tauvis, totcloudfrac 11 use dimradmars_mod, only: tauvis, totcloudfrac, albedo 12 12 use dust_param_mod, only: tauscaling 13 13 use comvert_mod, only: ap, bp, aps, bps, pa, preff, sig … … 71 71 real, dimension(nlayer + 1) :: plev ! intermediate pressure levels (pa) 72 72 real :: psurf ! Surface pressure 73 real, dimension(1) :: tsurf ! Surface temperature74 73 real, dimension(nlayer) :: u, v ! zonal, meridional wind 75 74 real :: gru, grv ! prescribed "geostrophic" background wind 76 75 real, dimension(nlayer) :: temp ! temperature at the middle of the layers 77 76 real, dimension(:,:), allocatable :: q ! tracer mixing ratio (e.g. kg/kg) 78 real, dimension(:), allocatable :: qsurf ! tracer surface budget (e.g. kg.m-2)79 real, dimension(nsoilmx) :: tsoil ! subsurface soik temperature (K)80 real, dimension(1) :: emis ! surface layer81 real, dimension(1,1) :: albedo ! surface albedo82 77 real, dimension(1) :: wstar = 0. ! Thermals vertical velocity 83 78 real, dimension(nlayer + 1) :: q2 ! Turbulent Kinetic Energy … … 121 116 122 117 call init_testphys1d(.false.,ngrid,nlayer,odpref,nq,q,time,psurf,u,v,temp,startfiles_1D,therestart1D,therestartfi, & 123 ndt,ptif,pks,dttestphys,zqsat, qsurf,dq,dqdyn,day0,day,tsurf,gru,grv,w,q2,play,plev,tsoil,&124 albedo,emis,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau)118 ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w,q2,play,plev, & 119 latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau) 125 120 126 121 ! Write a "startfi" file … … 231 226 232 227 ! Writing the "restart1D.txt" file for the next run 233 if (startfiles_1D) call writerestart1D('restart1D.txt',psurf,tsurf ,nlayer,temp,u,v,nq,noms,qsurf,q)228 if (startfiles_1D) call writerestart1D('restart1D.txt',psurf,tsurf(:,1),nlayer,temp,u,v,nq,noms,qsurf(1,:,1),q) 234 229 235 230 write(*,*) "testphys1d: everything is cool."
Note: See TracChangeset
for help on using the changeset viewer.