Ignore:
Timestamp:
Feb 29, 2024, 3:45:42 PM (10 months ago)
Author:
llange
Message:

Mars PCM
Fixing bugs in soilwater (array size and indexes in loop)
LL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/soilwater.F90

    r3230 r3245  
    1919! suburface and the atmosphere.
    2020!
    21 ! Water vapor and nsoiladsorbed water are treated as two separate subsurface tracers that are connected
     21! Water vapor and adsorbed water are treated as two separate subsurface tracers that are connected
    2222! by adsorption / desorption coefficients, including an adsorption / desorption kinetic factor.
    2323!
     
    7373logical, intent(in) :: exchange(ngrid)          ! logical :: array describing whether there is exchange with the atmosphere at the current timestep
    7474
    75 real, intent(in) :: qsat_surf(ngrid)           ! Saturation vapor pressure at the current surface temperature (formerly qsat)
     75real, intent(in) :: qsat_surf(ngrid)            ! Saturation mixing ratio at the surface at the current surface temperature (formerly qsat)
    7676real, intent(in) :: pq(ngrid, nlayer, nq)       ! Tracer atmospheric mixing ratio
    7777real, intent(in) :: pa(ngrid, nlayer)           ! Coefficients za
     
    7979real, intent(in) :: pc(ngrid, nlayer)           ! Coefficients zc
    8080real, intent(in) :: pd(ngrid, nlayer)           ! Coefficients zd
    81 real, intent(in) :: pdqsdifpot(ngrid, nq)       ! Potential pdqsdif (without subsurface - atmosphere exchange)
     81real, intent(in) :: pdqsdifpot(ngrid)           ! Potential pdqsdif (without subsurface - atmosphere exchange)
    8282
    8383real, intent(in) :: pplev(ngrid, nlayer+1)      ! Atmospheric pressure levels
     
    8787! Variables modified :
    8888! ----------------------------------------------------------------------
    89 real, intent(inout) :: pqsoil(ngrid, nsoil, 3*nq) ! Subsurface tracers (water vapor and ice)
    90 real, intent(in) :: pqsurf(ngrid)                 ! Water ice on the surface
    91                                                   ! (in kg.m - 3 : m - 3 of pore air for water vapor and m - 3 of regolith for water ice and adsorbed water)
     89real, intent(inout) :: pqsoil(ngrid, nsoil, nqsoil) ! Subsurface tracers (water vapor and ice)
     90real, intent(in) :: pqsurf(ngrid)                   ! Water ice on the surface
     91                                                    ! (in kg.m - 3 : m - 3 of pore air for water vapor and m - 3 of regolith for water ice and adsorbed water)
    9292! Outputs :
    9393! ----------------------------------------------------------------------
     
    404404!                              elseif (choice_ads.eq.2) then  ! par rapport \E0 valeur experimentale de reference
    405405!                                    !                                         Kd(ig, ik) = Kd_ref * exp(-enthalpy_ads / 8.314 *
    406 !                                    !     &                                         (1. / ptsoil(ig, nsoil - 4) - 1. / Tref))
     406!                                    !     &           SSI_1D/ice_lat55_fb/                              (1. / ptsoil(ig, nsoil - 4) - 1. / Tref))
    407407!                                    !                                         Ka(ig, ik) = rho_soil(ig, ik) * Ka_ref *
    408408!                                    !     &                                         sqrt(ptsoil(ig, nsoil - 4) / Tref) / nref!
     
    10791079            if ( (.not.exchange(ig)) &
    10801080            .and. ( (-zdqsdifrego(ig) * ptimestep) &
    1081             .gt.( pqsurf(ig) + pdqsdifpot(ig, igcm_h2o_ice) * ptimestep) ) &
    1082             .and.( (pqsurf(ig) + pdqsdifpot(ig, igcm_h2o_ice) * ptimestep).gt.0. ) ) then
     1081            .gt.( pqsurf(ig) + pdqsdifpot(ig) * ptimestep) ) &
     1082            .and.( (pqsurf(ig) + pdqsdifpot(ig) * ptimestep).gt.0. ) ) then
    10831083
    10841084                  ! calculate a new flux from the subsurface
    1085                   zdqsdifrego(ig) = -( pqsurf(ig) + pdqsdifpot(ig, igcm_h2o_ice) * ptimestep ) / ptimestep
     1085                  zdqsdifrego(ig) = -( pqsurf(ig) + pdqsdifpot(ig) * ptimestep ) / ptimestep
    10861086                 
    10871087!                  ! check case where there is CO2 ice on the surface but qsurf = 0
     
    10891089!                        zdqsdifrego(ig) = 0.D0 
    10901090!                  endif
    1091 
     1091                  do ik = 1, nsoil
    10921092
    10931093                  ! calculate A and B coefficients ! modified 2020
     
    11041104                 
    11051105                  ! initialize all flags for the loop
    1106                   do ik = 1, nsoil
     1106                 
    11071107                       
    11081108                        ! initialize the ice
Note: See TracChangeset for help on using the changeset viewer.