Changeset 3527 for trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90
- Timestamp:
- Nov 20, 2024, 3:53:19 PM (25 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90
r3345 r3527 2 2 3 3 implicit none 4 5 4 6 5 ! Flags for ice management … … 33 32 implicit none 34 33 35 ! arguments36 ! ---------37 38 34 ! Inputs: 39 integer, intent(in) :: timelen, ngrid, nslope, iflat ! number of time sample, physical points, subslopes, index of the flat subslope 40 real, dimension(ngrid,nslope), intent(in) :: subslope_dist ! Physical points x Slopes: Distribution of the subgrid slopes 41 real, dimension(ngrid), intent(in) :: def_slope_mean ! Physical points: values of the sub grid slope angles 42 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PEM ! Physical x Time field : VMR of co2 in the first layer [mol/mol] 43 real, dimension(ngrid,timelen), intent(in) :: ps_PCM ! Physical x Time field: surface pressure given by the PCM [Pa] 44 real, intent(in) :: global_avg_ps_PCM ! Global averaged surface pressure from the PCM [Pa] 45 real, intent(in) :: global_avg_ps_PEM ! global averaged surface pressure during the PEM iteration [Pa] 46 35 !-------- 36 integer, intent(in) :: timelen, ngrid, nslope, iflat ! number of time sample, physical points, subslopes, index of the flat subslope 37 real, dimension(ngrid,nslope), intent(in) :: subslope_dist ! Physical points x Slopes: Distribution of the subgrid slopes 38 real, dimension(ngrid), intent(in) :: def_slope_mean ! Physical points: values of the sub grid slope angles 39 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PEM ! Physical x Time field : VMR of co2 in the first layer [mol/mol] 40 real, dimension(ngrid,timelen), intent(in) :: ps_PCM ! Physical x Time field: surface pressure given by the PCM [Pa] 41 real, intent(in) :: global_avg_ps_PCM ! Global averaged surface pressure from the PCM [Pa] 42 real, intent(in) :: global_avg_ps_PEM ! global averaged surface pressure during the PEM iteration [Pa] 43 47 44 ! Ouputs: 48 real, dimension(ngrid,nslope), intent(inout) :: co2ice ! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2] 49 real, dimension(ngrid,nslope), intent(inout) :: flag_co2flow ! flag to see if there is flow on the subgrid slopes 50 real, dimension(ngrid), intent(inout) :: flag_co2flow_mesh ! same but within the mesh 51 45 !-------- 46 real, dimension(ngrid,nslope), intent(inout) :: co2ice ! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2] 47 real, dimension(ngrid,nslope), intent(inout) :: flag_co2flow ! flag to see if there is flow on the subgrid slopes 48 real, dimension(ngrid), intent(inout) :: flag_co2flow_mesh ! same but within the mesh 52 49 ! Local 53 real, dimension(ngrid,nslope) :: Tcond ! Physical field: CO2 condensation temperature [K] 54 real, dimension(ngrid,nslope) :: hmax ! Physical x Slope field: maximum thickness for co2 glacier before flow 55 56 !----------------------------- 50 !------ 51 real, dimension(ngrid,nslope) :: Tcond ! Physical field: CO2 condensation temperature [K] 52 real, dimension(ngrid,nslope) :: hmax ! Physical x Slope field: maximum thickness for co2 glacier before flow 53 57 54 write(*,*) "Flow of CO2 glaciers" 58 59 55 call computeTcondCO2(timelen,ngrid,nslope,vmr_co2_PEM,ps_PCM,global_avg_ps_PCM,global_avg_ps_PEM,Tcond) 60 56 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tcond,"co2",hmax) … … 83 79 84 80 ! Inputs: 85 integer,intent(in) :: timelen,ngrid,nslope,iflat ! number of time sample, physical points, subslopes, index of the flat subslope 86 real,intent(in) :: subslope_dist(ngrid,nslope), def_slope_mean(ngrid) ! Physical points x Slopes : Distribution of the subgrid slopes; Slopes: values of the sub grid slope angles 87 real,intent(in) :: Tice(ngrid,nslope) ! Ice Temperature [K] 81 integer, intent(in) :: timelen, ngrid, nslope, iflat ! number of time sample, physical points, subslopes, index of the flat subslope 82 real, dimension(ngrid,nslope), intent(in) :: subslope_dist ! Physical points x Slopes : Distribution of the subgrid slopes 83 real, dimension(ngrid), intent(in) :: def_slope_mean ! Slopes: values of the sub grid slope angles 84 real, dimension(ngrid,nslope), intent(in) :: Tice ! Ice Temperature [K] 88 85 ! Ouputs: 89 real,intent(inout) :: h2oice(ngrid,nslope)! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2]90 real,intent(inout) :: flag_h2oflow(ngrid,nslope)! flag to see if there is flow on the subgrid slopes91 real,intent(inout) :: flag_h2oflow_mesh(ngrid)! same but within the mesh86 real, dimension(ngrid,nslope), intent(inout) :: h2oice ! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2] 87 real, dimension(ngrid,nslope), intent(inout) :: flag_h2oflow ! flag to see if there is flow on the subgrid slopes 88 real, dimension(ngrid), intent(inout) :: flag_h2oflow_mesh ! same but within the mesh 92 89 ! Local 93 real :: hmax(ngrid,nslope) ! Physical x Slope field: maximum thickness for co2 glacier before flow 94 95 !----------------------------- 90 real, dimension(ngrid,nslope) :: hmax ! Physical x Slope field: maximum thickness for co2 glacier before flow 91 96 92 write(*,*) "Flow of H2O glaciers" 97 98 93 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,"h2o",hmax) 99 94 call transfer_ice_duringflow(ngrid,nslope,iflat, subslope_dist,def_slope_mean,hmax,Tice,"h2o",h2oice,flag_h2oflow,flag_h2oflow_mesh) … … 105 100 SUBROUTINE compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,name_ice,hmax) 106 101 102 use ice_table_mod, only: rho_ice 107 103 use abort_pem_mod, only: abort_pem 108 104 #ifndef CPP_STD … … 114 110 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 115 111 !!! 116 !!! Purpose: Compute the maximum thickness of CO2 and H2O glaciers given a slope angle 117 !!! before initating flow 112 !!! Purpose: Compute the maximum thickness of CO2 and H2O glaciers given a slope angle before initating flow 118 113 !!! 119 114 !!! Author: LL,based on work by A.Grau Galofre (LPG) and Isaac Smith (JGR Planets 2022) … … 123 118 implicit none 124 119 125 ! arguments126 ! --------127 128 120 ! Inputs 129 integer,intent(in) :: ngrid,nslope ! # of grid points and subslopes 130 integer,intent(in) :: iflat ! index of the flat subslope 131 real,intent(in) :: def_slope_mean(nslope) ! Slope field: Values of the subgrid slope angles [deg] 132 real,intent(in) :: Tice(ngrid,nslope) ! Physical field: ice temperature [K] 133 character(len=3), intent(in) :: name_ice ! Nature of the ice 121 ! ------ 122 integer, intent(in) :: ngrid, nslope ! # of grid points and subslopes 123 integer, intent(in) :: iflat ! index of the flat subslope 124 real, dimension(nslope), intent(in) :: def_slope_mean ! Slope field: Values of the subgrid slope angles [deg] 125 real, dimension(ngrid,nslope), intent(in) :: Tice ! Physical field: ice temperature [K] 126 character(3), intent(in) :: name_ice ! Nature of ice 134 127 ! Outputs 135 real,intent(out) :: hmax(ngrid,nslope) ! Physical grid x Slope field: maximum thickness before flaw [m] 128 ! ------- 129 real, dimension(ngrid,nslope), intent(out) :: hmax ! Physical grid x Slope field: maximum thickness before flaw [m] 136 130 ! Local 137 DOUBLE PRECISION :: tau_d ! characteristic basal drag, understood as the stress that an ice mass flowing under its weight balanced by viscosity. Value obtained from I.Smith 138 real :: rho(ngrid,nslope) ! co2 ice density [kg/m^3] 139 integer :: ig,islope ! loop variables 140 real :: slo_angle 141 142 ! 1. Compute rho 143 if(name_ice.eq."co2") then 144 DO ig = 1,ngrid 145 DO islope = 1,nslope 146 rho(ig,islope) = (1.72391 - 2.53e-4*Tice(ig,islope)-2.87*1e-7*Tice(ig,islope)**2)*1e3 ! Mangan et al. 2017 131 ! ----- 132 real :: tau_d ! characteristic basal drag, understood as the stress that an ice mass flowing under its weight balanced by viscosity. Value obtained from I.Smith 133 integer :: ig, islope ! loop variables 134 real :: slo_angle 135 136 select case (trim(adjustl(name_ice))) 137 case('h2o') 138 tau_d = 1.e5 139 case('co2') 147 140 tau_d = 5.e3 148 ENDDO 149 ENDDO 150 elseif (name_ice.eq."h2o") then 151 DO ig = 1,ngrid 152 DO islope = 1,nslope 153 rho(ig,islope) = -3.5353e-4*Tice(ig,islope)**2+ 0.0351* Tice(ig,islope) + 933.5030 ! Rottgers, 2012 154 tau_d = 1.e5 155 ENDDO 156 ENDDO 157 else 158 call abort_pem("PEM - Transfer ice","Name of ice is not co2 or h2o",1) 159 endif 160 161 ! 3. Compute max thickness 162 DO ig = 1,ngrid 163 DO islope = 1,nslope 164 if(islope.eq.iflat) then 141 case default 142 call abort_pem("compute_hmaxglaciers","Type of ice not known!",1) 143 end select 144 145 do ig = 1,ngrid 146 do islope = 1,nslope 147 if (islope == iflat) then 165 148 hmax(ig,islope) = 1.e8 166 149 else 167 150 slo_angle = abs(def_slope_mean(islope)*pi/180.) 168 hmax(ig,islope) = tau_d/(rho(ig,islope)*g*slo_angle) 169 endif 170 ENDDO 171 ENDDO 151 hmax(ig,islope) = tau_d/(rho_ice(Tice(ig,islope),name_ice)*g*slo_angle) 152 endif 153 enddo 154 enddo 155 172 156 END SUBROUTINE compute_hmaxglaciers 173 157 … … 183 167 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 184 168 169 use ice_table_mod, only: rho_ice 185 170 use abort_pem_mod, only: abort_pem 186 171 #ifndef CPP_STD … … 192 177 implicit none 193 178 194 ! arguments195 ! --------196 197 179 ! Inputs 198 integer, intent(in) :: ngrid,nslope !# of physical points and subslope 199 integer, intent(in) :: iflat ! index of the flatsubslope200 real, intent(in) :: subslope_dist(ngrid,nslope) ! Distribution of the subgrid slopes within the mesh 201 real, intent(in) :: def_slope_mean(nslope) ! values of the subgrid slopes 202 real, intent(in) :: hmax(ngrid,nslope) ! maximum height of the glaciers before initiating flow [m] 203 real, intent(in) :: Tice(ngrid,nslope) ! Ice temperature[K]204 character(len=3), intent(in) :: name_ice ! Nature of the ice 205 180 !------- 181 integer, intent(in) :: ngrid, nslope ! # of physical points and subslope 182 integer, intent(in) :: iflat ! index of the flat subslope 183 real, dimension(ngrid,nslope), intent(in) :: subslope_dist ! Distribution of the subgrid slopes within the mesh 184 real, dimension(nslope), intent(in) :: def_slope_mean ! values of the subgrid slopes 185 real, dimension(ngrid,nslope), intent(in) :: hmax ! maximum height of the glaciers before initiating flow [m] 186 real, dimension(ngrid,nslope), intent(in) :: Tice ! Ice temperature[K] 187 character(3), intent(in) :: name_ice ! Nature of the ice 206 188 ! Outputs 207 real, intent(inout) :: qice(ngrid,nslope) ! CO2 in the subslope [kg/m^2] 208 real, intent(inout) :: flag_flow(ngrid,nslope) ! boolean to check if there is flow on a subgrid slope 209 real, intent(inout) :: flag_flowmesh(ngrid) ! boolean to check if there is flow in the mesh 189 !-------- 190 real, dimension(ngrid,nslope), intent(inout) :: qice ! CO2 in the subslope [kg/m^2] 191 real, dimension(ngrid,nslope), intent(inout) :: flag_flow ! boolean to check if there is flow on a subgrid slope 192 real, dimension(ngrid), intent(inout) :: flag_flowmesh ! boolean to check if there is flow in the mesh 210 193 ! Local 211 integer ig,islope ! loop 212 real rho(ngrid,nslope) ! density of ice, temperature dependant [kg/m^3] 213 integer iaval ! ice will be transfered here 214 215 ! 0. Compute rho 216 if(name_ice.eq."co2") then 217 DO ig = 1,ngrid 218 DO islope = 1,nslope 219 rho(ig,islope) = (1.72391 - 2.53e-4*Tice(ig,islope)-2.87*1e-7*Tice(ig,islope)**2)*1e3 ! Mangan et al. 2017 220 ENDDO 221 ENDDO 222 elseif (name_ice.eq."h2o") then 223 DO ig = 1,ngrid 224 DO islope = 1,nslope 225 rho(ig,islope) = -3.5353e-4*Tice(ig,islope)**2+ 0.0351* Tice(ig,islope) + 933.5030 ! Rottgers, 2012 226 ENDDO 227 ENDDO 228 else 229 call abort_pem("PEM - Transfer ice","Name of ice is not co2 or h2o",1) 230 endif 231 232 ! 1. Compute the transfer of ice 233 234 DO ig = 1,ngrid 235 DO islope = 1,nslope 236 IF(islope.ne.iflat) THEN ! ice can be infinite on flat ground 194 !------ 195 integer :: ig, islope ! loop 196 integer :: iaval ! ice will be transfered here 197 198 do ig = 1,ngrid 199 do islope = 1,nslope 200 if (islope /= iflat) then ! ice can be infinite on flat ground 237 201 ! First: check that CO2 ice must flow (excess of ice on the slope), ice can accumulate infinitely on flat ground 238 IF(qice(ig,islope).ge.rho(ig,islope)*hmax(ig,islope) * & 239 cos(pi*def_slope_mean(islope)/180.)) THEN 202 if (qice(ig,islope) >= rho_ice(Tice(ig,islope),'h2o')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180.)) then 240 203 ! Second: determine the flatest slopes possible: 241 IF(islope.gt.iflat) THEN 242 iaval=islope-1 243 ELSE 244 iaval=islope+1 245 ENDIF 246 do while ((iaval.ne.iflat).and. & 247 (subslope_dist(ig,iaval).eq.0)) 248 IF(iaval.gt.iflat) THEN 249 iaval=iaval-1 250 ELSE 251 iaval=iaval+1 252 ENDIF 204 if (islope > iflat) then 205 iaval=islope-1 206 else 207 iaval = islope + 1 208 endif 209 do while (iaval /= iflat .and. subslope_dist(ig,iaval) == 0) 210 if (iaval > iflat) then 211 iaval = iaval - 1 212 else 213 iaval = iaval + 1 214 endif 253 215 enddo 254 qice(ig,iaval) = qice(ig,iaval) + & 255 (qice(ig,islope) - rho(ig,islope)*hmax(ig,islope) * & 256 cos(pi*def_slope_mean(islope)/180.)) * & 257 subslope_dist(ig,islope)/subslope_dist(ig,iaval) * & 258 cos(pi*def_slope_mean(iaval)/180.) / & 259 cos(pi*def_slope_mean(islope)/180.) 260 261 qice(ig,islope)=rho(ig,islope)*hmax(ig,islope) * & 262 cos(pi*def_slope_mean(islope)/180.) 263 264 flag_flow(ig,islope) = 1. 265 flag_flowmesh(ig) = 1. 266 ENDIF ! co2ice > hmax 267 ENDIF ! iflat 268 ENDDO !islope 269 ENDDO !ig 216 qice(ig,iaval) = qice(ig,iaval) + (qice(ig,islope) - rho_ice(Tice(ig,islope),'h2o')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180.)) & 217 *subslope_dist(ig,islope)/subslope_dist(ig,iaval)*cos(pi*def_slope_mean(iaval)/180.)/cos(pi*def_slope_mean(islope)/180.) 218 219 qice(ig,islope) = rho_ice(Tice(ig,islope),'h2o')*hmax(ig,islope)*cos(pi*def_slope_mean(islope)/180.) 220 flag_flow(ig,islope) = 1. 221 flag_flowmesh(ig) = 1. 222 endif ! co2ice > hmax 223 endif ! iflat 224 enddo !islope 225 enddo !ig 226 270 227 END SUBROUTINE 271 228 … … 281 238 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 282 239 283 use constants_marspem_mod, only: alpha_clap_co2,beta_clap_co2240 use constants_marspem_mod, only: alpha_clap_co2,beta_clap_co2 284 241 285 242 implicit none … … 302 259 real :: ave ! Intermediate to compute average 303 260 304 !!!!!!!!!!!!!!!!!!!!!!!!!!!!305 261 do ig = 1,ngrid 306 262 ave = 0
Note: See TracChangeset
for help on using the changeset viewer.