Changeset 3121 for trunk


Ignore:
Timestamp:
Nov 10, 2023, 2:12:31 PM (13 months ago)
Author:
llange
Message:

MARS PCM

  • Fixing index bug in soilwater.F The adsorption/desorption model now run

with the subtimestep (but still not in 3D yet).

  • Small changes for the boundary conditions when considering adsorption/desorption

LL

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

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

    r3120 r3121  
    43254325== 09/11/2023 == JBC + EV
    43264326Correction of a bug introduced in r3059: in case of 'watercaptag=.true.', 'watercap' was prevented to evolve as it should be because of 'zqsurf' in "vdifc_mod.F90" which was forced to be 0 if negative.
     4327
     4328== 10/11/2023 == LL
     4329* Fixing index bug in soilwater.F The adsorption/desorption model now run
     4330with the subtimestep (but still not in 3D yet).
     4331* Small changes for the boundary conditions when considering
     4332adsorption/desorption
     4333
  • trunk/LMDZ.MARS/libf/phymars/soilwater.F90

    r3115 r3121  
    8080real, intent(in) :: pc(ngrid, nlayer)           ! Coefficients zc
    8181real, intent(in) :: pd(ngrid, nlayer)           ! Coefficients zd
    82 real, intent(in) :: pdqsdifpot(ngrid, nq)       ! Potential pdqsdif (without subsurface - atmosphere exchange)
     82real, intent(in) :: pdqsdifpot(ngrid)       ! Potential pdqsdif (without subsurface - atmosphere exchange)
    8383
    8484real, intent(in) :: pplev(ngrid, nlayer+1)      ! Atmospheric pressure levels
     
    9090! ----------------------------------------------------------------------
    9191real, intent(inout) :: pqsoil(ngrid, nsoil, nqsoil) ! Subsurface tracers (water vapor and ice)
    92 real, intent(in) :: pqsurf(ngrid, nq)           ! Water ice on the surface
     92real, intent(in) :: pqsurf(ngrid)           ! Water ice on the surface
    9393                                                      ! (in kg.m - 3 : m - 3 of pore air for water vapor and m - 3 of regolith for water ice and adsorbed water)
    9494! Outputs :
     
    128128real*8 :: alpha0(ngrid)
    129129real*8 :: beta0(ngrid)
    130 real    :: co2ice(ngrid)                        ! CO2 ice on the surface
    131130
    132131! Adsorbtion/Desorption variables and parameters
     
    247246integer :: sublim_n                       ! number of sublimation loop runs
    248247integer :: satur_n                        ! number of saturation loop runs
     248
    249249
    250250
     
    286286! =================
    287287
    288 co2ice =  pqsurf(:,igcm_co2)
    289288
    290289if (firstcall_soil) then
     
    648647            alpha0(ig) = porosity_ice_free(ig, 1) * pb(ig, 1) / delta0(ig)
    649648           
    650             beta0(ig) = ( pb(ig, 2) * pc(ig, 2) + pq(ig, 1, igcm_h2o_vap) * pa(ig, 1) + pqsurf(ig, igcm_h2o_ice) ) &
     649            beta0(ig) = ( pb(ig, 2) * pc(ig, 2) + pq(ig, 1, igcm_h2o_vap) * pa(ig, 1) + pqsurf(ig) ) &
    651650                  / delta0(ig)
    652651                 
     
    818817                        flux(ig, 0) = porosity_ice_free(ig, 1) * pb(ig, 1) / ptimestep &
    819818                              * ( znsoil(ig, 1) / rho(ig) - beta0(ig) - alpha0(ig) * znsoil(ig, 1) / rho(ig) )   
    820                   elseif (pqsurf(ig, igcm_h2o_ice).gt.0.) then
     819                  elseif (pqsurf(ig).gt.0.) then
    821820                        ! assume that the surface is covered by waterice (if it is co2ice it should not call this subroutine at all)
    822821                        flux(ig, 0) = D_mid(ig, 1) / midlayer_dz(ig, 0) * ( znsoil(ig, 1) - qsat_surf(ig) * rhosurf(ig) )
     
    824823                 
    825824                  ! check if the ground would take up water from the surface but there is none
    826                   if ((.not.exchange(ig)).and.(pqsurf(ig, igcm_h2o_ice).eq.0.).and.(flux(ig, 0).lt.0.)) then
     825                  if ((.not.exchange(ig)).and.(pqsurf(ig).eq.0.).and.(flux(ig, 0).lt.0.)) then
    827826                        flux(ig, 0) = 0.
    828827                  endif
     
    926925                  ! calculate the temporty mixing ratio above the surface
    927926                  zq1temp2(ig) = beta0(ig) + alpha0(ig) * znsoil(ig, 1) / rho(ig)
    928                  
     927
    929928                  ! calculate the flux from the subsurface
    930929                  zdqsdifrego(ig) = porosity_ice_free(ig, 1) * pb(ig, 1) / ptimestep * (zq1temp2(ig) - znsoil(ig, 1) / rho(ig) )
     
    933932                  ! calculate the flux from the subsurface
    934933                  zdqsdifrego(ig) = -D_mid(ig, 1) / midlayer_dz(ig, 0) * (qsat_surf(ig) * rhosurf(ig) - znsoil(ig, 1)) ! faut - il faire intervenir la porosite ?
    935                   if ((pqsurf(ig, igcm_h2o_ice).eq.0.).and.(zdqsdifrego(ig).lt.0.)) then
     934                  if ((pqsurf(ig).eq.0.).and.(zdqsdifrego(ig).lt.0.)) then
    936935                        zdqsdifrego(ig) = 0.
    937936                  endif
     
    946945            if ( (.not.exchange(ig)) &
    947946            .and. ( -(zdqsdifrego(ig) * ptimestep) &
    948             .gt.( pqsurf(ig, igcm_h2o_ice) + pdqsdifpot(ig, igcm_h2o_ice) * ptimestep) ) &
    949             .and.( (pqsurf(ig, igcm_h2o_ice) + pdqsdifpot(ig, igcm_h2o_ice) * ptimestep).gt.0. ) ) then
     947            .gt.( pqsurf(ig)  + pdqsdifpot(ig) * ptimestep) ) &
     948            .and.( (pqsurf(ig) + pdqsdifpot(ig) * ptimestep).gt.0. ) ) then
    950949
    951950                  ! calculate a new flux from the subsurface
    952                   zdqsdifrego(ig) = -( pqsurf(ig, igcm_h2o_ice) + pdqsdifpot(ig, igcm_h2o_ice) * ptimestep ) / ptimestep
     951                  zdqsdifrego(ig) = -( pqsurf(ig) + pdqsdifpot(ig) * ptimestep ) / ptimestep
    953952                 
    954953!                  ! check case where there is CO2 ice on the surface but qsurf = 0
  • trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F

    r3120 r3121  
    955955c          make_tsub : sous pas de temps adaptatif
    956956c          la subroutine est a la fin du fichier
    957            if (adsorption_soil) then 
    958               nsubtimestep(:) = 1
    959            else
    960957              call make_tsub(ngrid,pdtsrf(:,islope),zqsurf,
    961958     &                    ptimestep,dtmax,watercaptag,
    962959     &                    nsubtimestep)
    963            endif
    964960c           Calculation for turbulent exchange with the surface (for ice)
    965961c           initialization of ztsrf, which is surface temperature in
     
    10301026
    10311027             if (adsorption_soil) then 
    1032 
    10331028                 call soilwater(1,nlay,nq,nsoil, nqsoil,
    10341029     &                     ztsrf(ig),ptsoil(ig,:,islope),subtimestep,
     
    10471042                         zdqsdif_tot(ig)=
    10481043     &                        -zqsurf(ig)/subtimestep
    1049                         zdqsdif_tot(ig) = zdqsdif_surf(ig)
    10501044                     else
    10511045                         zdqsdif_tot(ig) = zdqsdif_surf(ig) +
     
    10551049              endif ! adsorption
    10561050
    1057              if(.not.watercaptag(ig)) then
     1051             if(.not.watercaptag(ig).and.(.not.adsorption_soil)) then
    10581052               if ((-zdqsdif_tot(ig)*subtimestep)
    10591053     &            .gt.(zqsurf(ig))) then
     
    11851179c             Actualisation de h2o_vap dans le premier niveau
    11861180             zq_tmp_vap(ig,1,igcm_h2o_vap)=zq1temp(ig)
    1187 c    Take into account the H2O latent heat impact on the surface temperature
     1181c             Take into account the H2O latent heat impact on the surface temperature
    11881182              if (latentheat_surfwater) then
    11891183                lh=(2834.3-0.28*(ztsrf(ig)-To)-
     
    11981192              ENDDO
    11991193c             Subtimestep water budget :
    1200 
    12011194              ztsrf(ig) = ztsrf(ig)+(pdtsrf(ig,islope)
    12021195     &                 + zdtsrf(ig,islope))*subtimestep
Note: See TracChangeset for help on using the changeset viewer.