Changeset 3066


Ignore:
Timestamp:
Oct 2, 2023, 8:07:50 PM (14 months ago)
Author:
llange
Message:

MARS PCM
Follwing -r 3056:

  • 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.

  • Surface variables in testphys1D and init_testphys1D have a slope

dimension (set to 1 for now, hard-coded, will be improve later).

  • Slight changes are expected for the PEM (TBC w/ JBC) which uses these subroutines.

LL

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/changelog.txt

    r3064 r3066  
    42244224- restore the possibility to run with a temperature-dependent contact parameter without using the cloud adaptative subtimestep
    42254225  (MCD6.1 configuration, mteta = linear fit of temp)
     4226
     4227== 02/10/2023 == LL
     4228Follwing -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).
     4231Slight changes are expected for the PEM (TBC w/ JBC).
     4232
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90

    r3065 r3066  
    66
    77SUBROUTINE 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)
    1010
    1111use ioipsl_getincom,          only: getin ! To use 'getin'
     
    1414use planete_h,                only: year_day, periheli, aphelie, peri_day, obliquit, emin_turb, lmixmin
    1515use 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
    1718use infotrac,                 only: nqtot, tname, nqperes, nqfils
    1819use read_profile_mod,         only: read_profile
    1920use iostart,                  only: open_startphy, get_var, close_startphy
    2021use physics_distribution_mod, only: init_physics_distribution
    21 use comsoil_h,                only: volcapa, nsoilmx, inertiesoil, inertiedat, layer, mlayer, flux_geo
     22use comsoil_h,                only: volcapa, nsoilmx, inertiesoil, inertiedat, layer, mlayer, flux_geo, tsoil
    2223use comvert_mod,              only: ap, bp, aps, bps, pa, preff, presnivs, pseudoalt, scaleheight
    23 use dimradmars_mod,           only: tauvis, totcloudfrac
     24use dimradmars_mod,           only: tauvis, totcloudfrac, albedo
    2425use regular_lonlat_mod,       only: init_regular_lonlat
    2526use mod_interface_dyn_phys,   only: init_interface_dyn_phys
     
    6364real,                              intent(out) :: dttestphys                   ! testphys1d timestep
    6465real, 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)
    6666real, dimension(:,:), allocatable, intent(out) :: dq, dqdyn                    ! Physical and dynamical tandencies
    6767integer,                           intent(out) :: day0                         ! initial (sol ; =0 at Ls=0) and final date
    6868real,                              intent(out) :: day                          ! date during the run
    69 real, dimension(1),                intent(out) :: tsurf                        ! Surface temperature
    7069real,                              intent(out) :: gru, grv                     ! prescribed "geostrophic" background wind
    7170real, dimension(nlayer),           intent(out) :: w                            ! "Dummy wind" in 1D
     
    7372real, dimension(nlayer),           intent(out) :: play                         ! Pressure at the middle of the layers (Pa)
    7473real, 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 albedo
    77 real, dimension(1),                intent(out) :: emis                         ! surface layer
    7874real, dimension(1),                intent(out) :: latitude, longitude, cell_area
    7975real,                              intent(out) :: atm_wat_profile, atm_wat_tau ! Force atmospheric water profiles
     
    241237
    242238! allocate arrays:
    243 allocate(tname(nq),q(nlayer,nq),zqsat(nlayer),qsurf(nq))
     239allocate(tname(nq),q(nlayer,nq),zqsat(nlayer))
    244240allocate(dq(nlayer,nq),dqdyn(nlayer,nq),tnom_transp(nq))
    245241
     
    293289write(*,*) 'nqfils=',nqfils
    294290
    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
    309292
    310293#ifdef CPP_XIOS
     
    465448endif
    466449
     450! Initialize tracers (surface and atmosphere) here:
     451write(*,*) "init_testphys1d: initializing tracers"
     452if (.not. therestart1D) then
     453    call read_profile(nq,nlayer,qsurf(1,:,1),q)
     454else
     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
     463endif
     464
     465
     466
    467467! Initialize albedo / soil thermal inertia
    468468! ----------------------------------------
     
    472472    call getin("albedo",albedodat(1))
    473473    write(*,*) " albedo = ",albedodat(1)
    474     albedo(1,1) = albedodat(1)
     474    albedo(1,:,1) = albedodat(1)
    475475
    476476    inertiedat(1,1) = 400 ! default value for inertiedat
     
    570570
    571571if (.not. startfiles_1D) then
    572     qsurf(igcm_co2) = 0. ! default value for co2ice
     572    qsurf(1,igcm_co2,1) = 0. ! default value for co2ice
    573573    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)
    576576endif !(.not. startfiles_1D )
    577577
     
    579579! ----------
    580580if (.not. startfiles_1D) then
    581     emis = emissiv
    582     if (qsurf(igcm_co2) == 1.) then
    583         emis = emisice(1) ! northern hemisphere
    584         if (latitude(1) < 0) emis = emisice(2) ! southern hemisphere
     581    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
    585585    endif
    586586endif !(.not. startfiles_1D )
     
    614614
    615615if (.not. therestart1D) then
    616     tsurf = tmp2(0)
     616    tsurf(:,1) = tmp2(0)
    617617    temp(:) = tmp2(1:)
    618618else
     
    658658    inertiesoil(1,:,1) = inertiedat(1,:)
    659659
    660     tsoil(:) = tsurf(1) ! soil temperature
     660    tsoil(:,:,1) = tsurf(1,1) ! soil temperature
    661661endif !(.not. startfiles_1D)
    662662
     
    692692    qdyn(1,1,1:llm,1:nq) = q(1:llm,1:nq)
    693693    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)
    695695    q(1:llm,1:nq) = qdyn(1,1,1:llm,1:nq)
    696696endif
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90

    r3065 r3066  
    11PROGRAM testphys1d
    22
    3 use comsoil_h,               only: inertiedat, inertiesoil, nsoilmx
    4 use surfdat_h,               only: albedodat, perenial_co2ice, watercap
     3use comsoil_h,               only: inertiedat, inertiesoil, nsoilmx, tsoil
     4use surfdat_h,               only: albedodat, perenial_co2ice, watercap, tsurf, emis, qsurf
    55use comslope_mod,            only: def_slope, subslope_dist
    66use phyredem,                only: physdem0, physdem1
     
    99use comcstfi_h,              only: pi, rad, omeg, g, mugaz, rcp, r, cpp
    1010use time_phylmdz_mod,        only: daysec, day_step
    11 use dimradmars_mod,          only: tauvis, totcloudfrac
     11use dimradmars_mod,          only: tauvis, totcloudfrac, albedo
    1212use dust_param_mod,          only: tauscaling
    1313use comvert_mod,             only: ap, bp, aps, bps, pa, preff, sig
     
    7171real, dimension(nlayer + 1)       :: plev          ! intermediate pressure levels (pa)
    7272real                              :: psurf         ! Surface pressure
    73 real, dimension(1)                :: tsurf         ! Surface temperature
    7473real, dimension(nlayer)           :: u, v          ! zonal, meridional wind
    7574real                              :: gru, grv      ! prescribed "geostrophic" background wind
    7675real, dimension(nlayer)           :: temp          ! temperature at the middle of the layers
    7776real, 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 layer
    81 real, dimension(1,1)              :: albedo        ! surface albedo
    8277real, dimension(1)                :: wstar = 0.    ! Thermals vertical velocity
    8378real, dimension(nlayer + 1)       :: q2            ! Turbulent Kinetic Energy
     
    121116
    122117call 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)
    125120
    126121! Write a "startfi" file
     
    231226
    232227! 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)
     228if (startfiles_1D) call writerestart1D('restart1D.txt',psurf,tsurf(:,1),nlayer,temp,u,v,nq,noms,qsurf(1,:,1),q)
    234229
    235230write(*,*) "testphys1d: everything is cool."
Note: See TracChangeset for help on using the changeset viewer.