Changeset 2855 for trunk/LMDZ.COMMON/libf/evolution/computeice_table.F90
- Timestamp:
- Dec 22, 2022, 5:43:14 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/computeice_table.F90
r2849 r2855 1 1 SUBROUTINE computeice_table(ngrid,nslope,nsoil_PEM,rhowatersurf_ave,rhowatersoil_ave,ice_table) 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3 !!! 4 !!! Purpose: Compute the ice table depth knowing the yearly average water 5 !!! density at the surface and at depth. 6 !!! Computations are made following the methods in Schorgofer et al., 2005 7 !!! 8 !!! Author: LL 9 !!! 10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 11 2 12 #ifndef CPP_STD 3 USE comsoil_h, only: inertiedat, volcapa 4 USE vertical_layers_mod, ONLY: ap,bp 5 USE comsoil_h_PEM, only: layer_PEM 13 USE comsoil_h_PEM, only: layer_PEM ! Depth of the vertical grid 6 14 implicit none 7 15 8 integer,intent(in) :: ngrid,nslope,nsoil_PEM 9 real,intent(in) :: rhowatersurf_ave(ngrid,nslope) ! surface temperature, timeseries [K]10 real,intent(in) :: rhowatersoil_ave(ngrid,nsoil_PEM,nslope) ! soil water density, yearly average[kg/m^3]11 real,intent(inout) :: ice_table(ngrid,nslope) ! ice table[m]12 real :: z1,z2 13 integer ig, islope,isoil 14 real :: diff_rho(nsoil_PEM) ! difference of vapor content16 integer,intent(in) :: ngrid,nslope,nsoil_PEM ! Size of the physical grid, number of subslope, number of soil layer in the PEM 17 real,intent(in) :: rhowatersurf_ave(ngrid,nslope) ! Water density at the surface, yearly averaged [kg/m^3] 18 real,intent(in) :: rhowatersoil_ave(ngrid,nsoil_PEM,nslope) ! Water density at depth, computed from clapeyron law's (Murchy and Koop 2005), yearly averaged [kg/m^3] 19 real,intent(inout) :: ice_table(ngrid,nslope) ! ice table depth [m] 20 real :: z1,z2 ! intermediate variables used when doing a linear interpolation between two depths to find the root 21 integer ig, islope,isoil ! loop variables 22 real :: diff_rho(nsoil_PEM) ! difference of water vapor density between the surface and at depth [kg/m^3] 15 23 16 24 … … 24 32 enddo 25 33 26 if(diff_rho(1) > 0) then 34 if(diff_rho(1) > 0) then ! ice is at the surface 27 35 ice_table(ig,islope) = 0. 28 36 else 29 do isoil = 1,nsoil_PEM -1 37 do isoil = 1,nsoil_PEM -1 ! general case, we find the ice table depth by doing a linear approximation between the two depth, and then solve the first degree equation to find the root 30 38 if((diff_rho(isoil).lt.0).and.(diff_rho(isoil+1).gt.0.)) then 31 39 z1 = (diff_rho(isoil) - diff_rho(isoil+1))/(layer_PEM(isoil) - layer_PEM(isoil+1)) … … 38 46 enddo 39 47 enddo 40 41 42 43 48 !======================================================================= 44 49 RETURN 45 46 50 #endif 47 51 END
Note: See TracChangeset
for help on using the changeset viewer.