- Timestamp:
- Nov 10, 2023, 2:12:31 PM (13 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3120 r3121 4325 4325 == 09/11/2023 == JBC + EV 4326 4326 Correction 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 4330 with the subtimestep (but still not in 3D yet). 4331 * Small changes for the boundary conditions when considering 4332 adsorption/desorption 4333 -
trunk/LMDZ.MARS/libf/phymars/soilwater.F90
r3115 r3121 80 80 real, intent(in) :: pc(ngrid, nlayer) ! Coefficients zc 81 81 real, intent(in) :: pd(ngrid, nlayer) ! Coefficients zd 82 real, intent(in) :: pdqsdifpot(ngrid , nq) ! Potential pdqsdif (without subsurface - atmosphere exchange)82 real, intent(in) :: pdqsdifpot(ngrid) ! Potential pdqsdif (without subsurface - atmosphere exchange) 83 83 84 84 real, intent(in) :: pplev(ngrid, nlayer+1) ! Atmospheric pressure levels … … 90 90 ! ---------------------------------------------------------------------- 91 91 real, intent(inout) :: pqsoil(ngrid, nsoil, nqsoil) ! Subsurface tracers (water vapor and ice) 92 real, intent(in) :: pqsurf(ngrid , nq) ! Water ice on the surface92 real, intent(in) :: pqsurf(ngrid) ! Water ice on the surface 93 93 ! (in kg.m - 3 : m - 3 of pore air for water vapor and m - 3 of regolith for water ice and adsorbed water) 94 94 ! Outputs : … … 128 128 real*8 :: alpha0(ngrid) 129 129 real*8 :: beta0(ngrid) 130 real :: co2ice(ngrid) ! CO2 ice on the surface131 130 132 131 ! Adsorbtion/Desorption variables and parameters … … 247 246 integer :: sublim_n ! number of sublimation loop runs 248 247 integer :: satur_n ! number of saturation loop runs 248 249 249 250 250 … … 286 286 ! ================= 287 287 288 co2ice = pqsurf(:,igcm_co2)289 288 290 289 if (firstcall_soil) then … … 648 647 alpha0(ig) = porosity_ice_free(ig, 1) * pb(ig, 1) / delta0(ig) 649 648 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) ) & 651 650 / delta0(ig) 652 651 … … 818 817 flux(ig, 0) = porosity_ice_free(ig, 1) * pb(ig, 1) / ptimestep & 819 818 * ( znsoil(ig, 1) / rho(ig) - beta0(ig) - alpha0(ig) * znsoil(ig, 1) / rho(ig) ) 820 elseif (pqsurf(ig , igcm_h2o_ice).gt.0.) then819 elseif (pqsurf(ig).gt.0.) then 821 820 ! assume that the surface is covered by waterice (if it is co2ice it should not call this subroutine at all) 822 821 flux(ig, 0) = D_mid(ig, 1) / midlayer_dz(ig, 0) * ( znsoil(ig, 1) - qsat_surf(ig) * rhosurf(ig) ) … … 824 823 825 824 ! 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.)) then825 if ((.not.exchange(ig)).and.(pqsurf(ig).eq.0.).and.(flux(ig, 0).lt.0.)) then 827 826 flux(ig, 0) = 0. 828 827 endif … … 926 925 ! calculate the temporty mixing ratio above the surface 927 926 zq1temp2(ig) = beta0(ig) + alpha0(ig) * znsoil(ig, 1) / rho(ig) 928 927 929 928 ! calculate the flux from the subsurface 930 929 zdqsdifrego(ig) = porosity_ice_free(ig, 1) * pb(ig, 1) / ptimestep * (zq1temp2(ig) - znsoil(ig, 1) / rho(ig) ) … … 933 932 ! calculate the flux from the subsurface 934 933 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.)) then934 if ((pqsurf(ig).eq.0.).and.(zdqsdifrego(ig).lt.0.)) then 936 935 zdqsdifrego(ig) = 0. 937 936 endif … … 946 945 if ( (.not.exchange(ig)) & 947 946 .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. ) ) then947 .gt.( pqsurf(ig) + pdqsdifpot(ig) * ptimestep) ) & 948 .and.( (pqsurf(ig) + pdqsdifpot(ig) * ptimestep).gt.0. ) ) then 950 949 951 950 ! calculate a new flux from the subsurface 952 zdqsdifrego(ig) = -( pqsurf(ig , igcm_h2o_ice) + pdqsdifpot(ig, igcm_h2o_ice) * ptimestep ) / ptimestep951 zdqsdifrego(ig) = -( pqsurf(ig) + pdqsdifpot(ig) * ptimestep ) / ptimestep 953 952 954 953 ! ! check case where there is CO2 ice on the surface but qsurf = 0 -
trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
r3120 r3121 955 955 c make_tsub : sous pas de temps adaptatif 956 956 c la subroutine est a la fin du fichier 957 if (adsorption_soil) then958 nsubtimestep(:) = 1959 else960 957 call make_tsub(ngrid,pdtsrf(:,islope),zqsurf, 961 958 & ptimestep,dtmax,watercaptag, 962 959 & nsubtimestep) 963 endif964 960 c Calculation for turbulent exchange with the surface (for ice) 965 961 c initialization of ztsrf, which is surface temperature in … … 1030 1026 1031 1027 if (adsorption_soil) then 1032 1033 1028 call soilwater(1,nlay,nq,nsoil, nqsoil, 1034 1029 & ztsrf(ig),ptsoil(ig,:,islope),subtimestep, … … 1047 1042 zdqsdif_tot(ig)= 1048 1043 & -zqsurf(ig)/subtimestep 1049 zdqsdif_tot(ig) = zdqsdif_surf(ig)1050 1044 else 1051 1045 zdqsdif_tot(ig) = zdqsdif_surf(ig) + … … 1055 1049 endif ! adsorption 1056 1050 1057 if(.not.watercaptag(ig) ) then1051 if(.not.watercaptag(ig).and.(.not.adsorption_soil)) then 1058 1052 if ((-zdqsdif_tot(ig)*subtimestep) 1059 1053 & .gt.(zqsurf(ig))) then … … 1185 1179 c Actualisation de h2o_vap dans le premier niveau 1186 1180 zq_tmp_vap(ig,1,igcm_h2o_vap)=zq1temp(ig) 1187 c Take into account the H2O latent heat impact on the surface temperature1181 c Take into account the H2O latent heat impact on the surface temperature 1188 1182 if (latentheat_surfwater) then 1189 1183 lh=(2834.3-0.28*(ztsrf(ig)-To)- … … 1198 1192 ENDDO 1199 1193 c Subtimestep water budget : 1200 1201 1194 ztsrf(ig) = ztsrf(ig)+(pdtsrf(ig,islope) 1202 1195 & + zdtsrf(ig,islope))*subtimestep
Note: See TracChangeset
for help on using the changeset viewer.