Changeset 4065 for trunk/LMDZ.COMMON/libf/evolution/tendencies.F90
- Timestamp:
- Feb 12, 2026, 9:09:12 AM (2 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/tendencies.F90 (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/tendencies.F90
r3991 r4065 16 16 !----------------------------------------------------------------------- 17 17 18 ! DEPENDENCIES 19 ! ------------ 20 use numerics, only: dp, di, minieps, tol 21 18 22 ! DECLARATION 19 23 ! ----------- … … 24 28 25 29 !======================================================================= 26 SUBROUTINE compute_tend( ngrid,nslope,min_ice,d_ice)30 SUBROUTINE compute_tend(min_ice,d_ice) 27 31 !----------------------------------------------------------------------- 28 32 ! NAME … … 47 51 ! ARGUMENTS 48 52 ! --------- 49 integer, intent(in) :: ngrid 50 integer, intent(in) :: nslope 51 real, dimension(ngrid,nslope,2), intent(in) :: min_ice ! Minima of ice at each point for the PCM years 52 real, dimension(ngrid,nslope), intent(out) :: d_ice ! Evolution of perennial ice 53 real(dp), dimension(:,:,:), intent(in) :: min_ice 54 real(dp), dimension(:,:), intent(out) :: d_ice 53 55 54 56 ! CODE 55 57 ! ---- 56 58 ! We compute the difference 57 d_ice = min_ice(:,:,2) - min_ice(:,:,1)59 d_ice(:,:) = min_ice(:,:,2) - min_ice(:,:,1) 58 60 59 61 ! If the difference is too small, then there is no evolution 60 where (abs(d_ice) < 1.e-10) d_ice = 0.62 where (abs(d_ice) < minieps) d_ice = 0._dp 61 63 62 64 ! If the minimum over the last year is 0, then we have no perennial ice 63 where (abs(min_ice(:,:,2)) < 1.e-10) d_ice = 0.65 where (abs(min_ice(:,:,2)) < minieps) d_ice = 0._dp 64 66 65 67 END SUBROUTINE compute_tend … … 67 69 68 70 !======================================================================= 69 SUBROUTINE recomp_tend_co2(ngrid,nslope,timelen,d_co2ice_phys,d_co2ice_ini,co2ice,emissivity, & 70 vmr_co2_PCM,vmr_co2_PEM,ps_PCM,ps_avg_global_ini,ps_avg_global) 71 !----------------------------------------------------------------------- 72 ! NAME 73 ! recomp_tend_co2 71 SUBROUTINE evolve_tend_co2(d_co2ice_ini,co2ice,emissivity,q_co2_ts_ini,q_co2_ts,ps_PCM,ps_avg_glob_ini,ps_avg_global,d_co2ice) 72 !----------------------------------------------------------------------- 73 ! NAME 74 ! evolve_tend_co2 74 75 ! 75 76 ! DESCRIPTION … … 86 87 ! DEPENDENCIES 87 88 ! ------------ 88 use constants_marspem_mod, only : alpha_clap_co2, beta_clap_co2, sigmaB, Lco2, sols_per_my, sec_per_sol 89 use geometry, only: ngrid, nslope, nday 90 use planet, only: alpha_clap_co2, beta_clap_co2, sigmaB, Lco2, m_co2, A, B 91 use orbit, only: yr_len_sol, sol_len_s 92 use display, only: print_msg 93 use utility, only: real2str 89 94 90 95 ! DECLARATION … … 94 99 ! ARGUMENTS 95 100 ! --------- 96 integer, intent(in) :: timelen, ngrid, nslope ! Time length, # of grid points and slopes 97 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PCM ! CO2 VMR in PCM first layer 98 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PEM ! CO2 VMR in PEM first layer 99 real, dimension(ngrid,timelen), intent(in) :: ps_PCM ! Surface pressure in PCM 100 real, intent(in) :: ps_avg_global_ini ! Global average pressure (initial) 101 real, intent(in) :: ps_avg_global ! Global average pressure (current) 102 real, dimension(ngrid,nslope), intent(in) :: d_co2ice_ini ! Initial CO2 ice evolution 103 real, dimension(ngrid,nslope), intent(in) :: co2ice ! CO2 ice surface [kg/m^2] 104 real, dimension(ngrid,nslope), intent(in) :: emissivity ! Emissivity 105 real, dimension(ngrid,nslope), intent(inout) :: d_co2ice_phys ! Updated CO2 ice evolution 101 real(dp), dimension(:,:), intent(in) :: q_co2_ts, q_co2_ts_ini, ps_PCM, d_co2ice_ini, co2ice, emissivity 102 real(dp), intent(in) :: ps_avg_global, ps_avg_glob_ini 103 real(dp), dimension(:,:), intent(inout) :: d_co2ice 106 104 107 105 ! LOCAL VARIABLES 108 106 ! --------------- 109 integer :: i, t, islope 110 real :: coef, avg 107 integer(di) :: i, iday, islope 108 real(dp) :: coef, avg 109 real(dp), dimension(ngrid,nday) :: vmr_co2_ts, vmr_co2_ts_ini 111 110 112 111 ! CODE 113 112 ! ---- 114 write(*,*) "> Updating the CO2 ice tendency for the new pressure" 115 116 ! Evolution of the water ice for each physical point 113 call print_msg("> Evolving the CO2 ice tendency according to the new pressure") 114 call print_msg('Old CO2 ice tendencies [kg/m2/yr] (min|max): '//real2str(minval(d_co2ice))//' | '//real2str(maxval(d_co2ice))) 115 116 ! Compute volume mixing ratio 117 vmr_co2_ts(:,:) = q_co2_ts(:,:)/(A*q_co2_ts(:,:) + B)/m_co2 118 vmr_co2_ts_ini(:,:) = q_co2_ts_ini(:,:)/(A*q_co2_ts_ini(:,:) + B)/m_co2 119 120 ! Recompute the tendency 117 121 do i = 1,ngrid 118 122 do islope = 1,nslope 119 coef = sols_per_my*sec_per_sol*emissivity(i,islope)*sigmaB/Lco2 120 avg = 0. 121 if (co2ice(i,islope) > 1.e-4 .and. abs(d_co2ice_phys(i,islope)) > 1.e-5) then 122 do t = 1,timelen 123 avg = avg + (beta_clap_co2/(alpha_clap_co2-log(vmr_co2_PCM(i,t)*ps_PCM(i,t)/100.)))**4 & 124 - (beta_clap_co2/(alpha_clap_co2-log(vmr_co2_PEM(i,t)*ps_PCM(i,t)*(ps_avg_global/ps_avg_global_ini)/100.)))**4 125 enddo 126 if (avg < 1.e-4) avg = 0. 127 d_co2ice_phys(i,islope) = d_co2ice_ini(i,islope) - coef*avg/timelen 128 endif 129 enddo 130 enddo 131 132 END SUBROUTINE recomp_tend_co2 133 !======================================================================= 134 135 !======================================================================= 136 SUBROUTINE recomp_tend_h2o(h2oice_depth_old,h2oice_depth_new,tsurf,tsoil_PEM_timeseries_old,tsoil_PEM_timeseries_new,d_h2oice) 137 !----------------------------------------------------------------------- 138 ! NAME 139 ! recomp_tend_h2o 123 coef = yr_len_sol*sol_len_s*emissivity(i,islope)*sigmaB/Lco2 124 avg = 0._dp 125 if (co2ice(i,islope) > 1.e-4_dp .and. abs(d_co2ice(i,islope)) > 1.e-5_dp) then 126 do iday = 1,nday 127 avg = avg + (beta_clap_co2/(alpha_clap_co2 - log(q_co2_ts_ini(i,iday)*ps_PCM(i,iday)/100._dp)))**4 & 128 - (beta_clap_co2/(alpha_clap_co2 - log(vmr_co2_ts(i,iday)*ps_PCM(i,iday)*(ps_avg_global/ps_avg_glob_ini)/100._dp)))**4 129 end do 130 if (avg < 1.e-4_dp) avg = 0._dp 131 d_co2ice(i,islope) = d_co2ice_ini(i,islope) - coef*avg/nday 132 end if 133 end do 134 end do 135 call print_msg('New CO2 ice tendencies [kg/m2/yr] (min|max): '//real2str( minval(d_co2ice))//' | '//real2str(maxval(d_co2ice))) 136 137 END SUBROUTINE evolve_tend_co2 138 !======================================================================= 139 140 !======================================================================= 141 SUBROUTINE evolve_tend_h2o(h2oice_depth_old,h2oice_depth_new,tsurf,tsoil_ts_old,tsoil_ts_new,d_h2oice) 142 !----------------------------------------------------------------------- 143 ! NAME 144 ! evolve_tend_h2o 140 145 ! 141 146 ! DESCRIPTION … … 160 165 ! ARGUMENTS 161 166 ! --------- 162 real , intent(in) :: h2oice_depth_old ! Old H2O ice depth163 real , intent(in) :: h2oice_depth_new ! New H2O ice depth164 real , intent(in) :: tsurf ! Surface temperature165 real , dimension(:,:), intent(in) :: tsoil_PEM_timeseries_old! Old soil temperature time series166 real , dimension(:,:), intent(in) :: tsoil_PEM_timeseries_new! New soil temperature time series167 real , intent(inout) :: d_h2oice ! Evolution of perennial ice167 real(dp), intent(in) :: h2oice_depth_old ! Old H2O ice depth 168 real(dp), intent(in) :: h2oice_depth_new ! New H2O ice depth 169 real(dp), intent(in) :: tsurf ! Surface temperature 170 real(dp), dimension(:,:), intent(in) :: tsoil_ts_old ! Old soil temperature time series 171 real(dp), dimension(:,:), intent(in) :: tsoil_ts_new ! New soil temperature time series 172 real(dp), intent(inout) :: d_h2oice ! Evolution of perennial ice 168 173 169 174 ! LOCAL VARIABLES 170 175 ! --------------- 171 real :: Rz_old, Rz_new, R_dec, hum_dec, psv_max_old, psv_max_new172 integer :: t173 real , parameter :: coef_diff = 4.e-4 ! Diffusion coefficient174 real , parameter :: zcdv = 0.0325 ! Drag coefficient176 real(dp) :: Rz_old, Rz_new, R_dec, hum_dec, psv_max_old, psv_max_new 177 integer(di) :: iday 178 real(dp), parameter :: coef_diff = 4.e-4 ! Diffusion coefficient 179 real(dp), parameter :: zcdv = 0.0325 ! Drag coefficient 175 180 176 181 ! CODE … … 182 187 183 188 ! The maxmimum of the daily averages over one year for the saturation vapor pressure at the ice table location 184 psv_max_old = 0. 185 psv_max_new = 0. 186 do t = 1,size(tsoil_PEM_timeseries_old,2)187 psv_max_old = max(psv_max_old,psv(itp_tsoil(tsoil_ PEM_timeseries_old(:,t),tsurf,h2oice_depth_old)))188 psv_max_new = max(psv_max_new,psv(itp_tsoil(tsoil_ PEM_timeseries_new(:,t),tsurf,h2oice_depth_new)))189 end do189 psv_max_old = 0._dp 190 psv_max_new = 0._dp 191 do iday = 1,size(tsoil_ts_old,2) 192 psv_max_old = max(psv_max_old,psv(itp_tsoil(tsoil_ts_old(:,iday),tsurf,h2oice_depth_old))) 193 psv_max_new = max(psv_max_new,psv(itp_tsoil(tsoil_ts_new(:,iday),tsurf,h2oice_depth_new))) 194 end do 190 195 191 196 ! Lower humidity due to growing lag layer (higher depth) 192 if (abs(psv_max_old) < 1.e2*epsilon(1.)) then193 hum_dec = 1. 197 if (abs(psv_max_old) < tol) then 198 hum_dec = 1._dp 194 199 else 195 200 hum_dec = psv_max_new/psv_max_old ! Decrease because of lower water vapor pressure at the new depth 196 end if201 end if 197 202 198 203 ! Flux correction (decrease) 199 204 d_h2oice = d_h2oice*R_dec*hum_dec 200 205 201 END SUBROUTINE recomp_tend_h2o206 END SUBROUTINE evolve_tend_h2o 202 207 !======================================================================= 203 208
Note: See TracChangeset
for help on using the changeset viewer.
