Changeset 3149 for trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90
- Timestamp:
- Dec 6, 2023, 4:02:06 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90
r3082 r3149 1 module glaciers_mod 2 3 implicit none 4 LOGICAL co2glaciersflow ! True by default, to compute co2 ice flow. Read in pem.def 5 LOGICAL h2oglaciersflow ! True by default, to compute co2 ice flow. Read in pem.def 6 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 !!! 8 !!! Purpose: Compute CO2 glacier flows 9 !!! 10 !!! Author: LL 11 !!! 12 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 13 1 MODULE glaciers_mod 2 3 implicit none 4 5 logical :: co2_ice_flow ! True by default, to compute co2 ice flow. Read in run_PEM.def 6 logical :: h2o_ice_flow ! True by default, to compute h2o ice flow. Read in run_PEM.def 7 8 !======================================================================= 14 9 contains 15 16 subroutine co2glaciers_evol(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,vmr_co2_PEM,ps_GCM,global_ave_ps_GCM,global_ave_ps_PEM,co2ice,flag_co2flow,flag_co2flow_mesh) 10 !======================================================================= 11 12 SUBROUTINE flow_co2glaciers(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,vmr_co2_PEM,ps_PCM,global_avg_ps_PCM,global_avg_ps_PEM,co2ice,flag_co2flow,flag_co2flow_mesh) 17 13 18 14 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 26 22 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 27 23 28 IMPLICIT NONE 24 implicit none 29 25 30 26 ! arguments … … 32 28 33 29 ! Inputs: 34 INTEGER,INTENT(IN) :: timelen,ngrid,nslope,iflat ! number of time sample, physical points, subslopes, index of the flat subslope 35 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 36 REAL,INTENT(IN) :: vmr_co2_PEM(ngrid,timelen) ! Physical x Time field : VMR of co2 in the first layer [mol/mol] 37 REAL,INTENT(IN) :: ps_GCM(ngrid,timelen) ! Physical x Time field: surface pressure given by the GCM [Pa] 38 REAL,INTENT(IN) :: global_ave_ps_GCM ! Global averaged surface pressure from the GCM [Pa] 39 REAL,INTENT(IN) :: global_ave_ps_PEM ! global averaged surface pressure during the PEM iteration [Pa] 30 integer, intent(in) :: timelen, ngrid, nslope, iflat ! number of time sample, physical points, subslopes, index of the flat subslope 31 real, dimension(ngrid,nslope), intent(in) :: subslope_dist ! Physical points x Slopes: Distribution of the subgrid slopes 32 real, dimension(ngrid), intent(in) :: def_slope_mean ! Physical points: values of the sub grid slope angles 33 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PEM ! Physical x Time field : VMR of co2 in the first layer [mol/mol] 34 real, dimension(ngrid,timelen), intent(in) :: ps_PCM ! Physical x Time field: surface pressure given by the PCM [Pa] 35 real, intent(in) :: global_avg_ps_PCM ! Global averaged surface pressure from the PCM [Pa] 36 real, intent(in) :: global_avg_ps_PEM ! global averaged surface pressure during the PEM iteration [Pa] 40 37 41 38 ! Ouputs: 42 REAL,INTENT(INOUT) :: co2ice(ngrid,nslope) ! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2] 43 REAL,INTENT(INOUT) :: flag_co2flow(ngrid,nslope) ! flag to see if there is flow on the subgrid slopes 44 REAL,INTENT(INOUT) :: flag_co2flow_mesh(ngrid) ! same but within the mesh 45 39 real, dimension(ngrid,nslope), intent(inout) :: co2ice ! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2] 40 real, dimension(ngrid,nslope), intent(inout) :: flag_co2flow ! flag to see if there is flow on the subgrid slopes 41 real, dimension(ngrid), intent(inout) :: flag_co2flow_mesh ! same but within the mesh 46 42 47 43 ! Local 48 REAL :: Tcond(ngrid,nslope) !Physical field: CO2 condensation temperature [K]49 REAL :: hmax(ngrid,nslope)! Physical x Slope field: maximum thickness for co2 glacier before flow44 real, dimension(ngrid,nslope) :: Tcond ! Physical field: CO2 condensation temperature [K] 45 real, dimension(ngrid,nslope) :: hmax ! Physical x Slope field: maximum thickness for co2 glacier before flow 50 46 51 47 !----------------------------- 52 call computeTcondCO2(timelen,ngrid,nslope,vmr_co2_PEM,ps_GCM,global_ave_ps_GCM,global_ave_ps_PEM,Tcond) 53 54 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tcond,"co2",hmax) 55 56 call transfer_ice_duringflow(ngrid,nslope,iflat, subslope_dist,def_slope_mean,hmax,Tcond,"co2",co2ice,flag_co2flow,flag_co2flow_mesh) 57 RETURN 58 end subroutine 59 60 61 62 63 64 subroutine h2oglaciers_evol(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,Tice,h2oice,flag_h2oflow,flag_h2oflow_mesh) 48 write(*,*) "Flow of CO2 glacier" 49 50 call computeTcondCO2(timelen,ngrid,nslope,vmr_co2_PEM,ps_PCM,global_avg_ps_PCM,global_avg_ps_PEM,Tcond) 51 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tcond,"co2",hmax) 52 call transfer_ice_duringflow(ngrid,nslope,iflat, subslope_dist,def_slope_mean,hmax,Tcond,"co2",co2ice,flag_co2flow,flag_co2flow_mesh) 53 54 END SUBROUTINE flow_co2glaciers 55 56 !======================================================================= 57 58 SUBROUTINE flow_h2oglaciers(timelen,ngrid,nslope,iflat,subslope_dist,def_slope_mean,Tice,h2oice,flag_h2oflow,flag_h2oflow_mesh) 65 59 66 60 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 74 68 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 75 69 76 77 IMPLICIT NONE 70 implicit none 78 71 79 72 ! arguments … … 81 74 82 75 ! Inputs: 83 INTEGER,INTENT(IN) :: timelen,ngrid,nslope,iflat ! number of time sample, physical points, subslopes, index of the flat subslope84 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 angles85 REAL,INTENT(IN) :: Tice(ngrid,nslope) ! Ice Temperature [K]76 integer,intent(in) :: timelen,ngrid,nslope,iflat ! number of time sample, physical points, subslopes, index of the flat subslope 77 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 78 real,intent(in) :: Tice(ngrid,nslope) ! Ice Temperature [K] 86 79 ! Ouputs: 87 REAL,INTENT(INOUT) :: h2oice(ngrid,nslope) ! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2]88 REAL,INTENT(INOUT) :: flag_h2oflow(ngrid,nslope) ! flag to see if there is flow on the subgrid slopes89 REAL,INTENT(INOUT) :: flag_h2oflow_mesh(ngrid) ! same but within the mesh80 real,intent(inout) :: h2oice(ngrid,nslope) ! Physical x Slope field: co2 ice on the subgrid slopes [kg/m^2] 81 real,intent(inout) :: flag_h2oflow(ngrid,nslope) ! flag to see if there is flow on the subgrid slopes 82 real,intent(inout) :: flag_h2oflow_mesh(ngrid) ! same but within the mesh 90 83 ! Local 91 REAL:: hmax(ngrid,nslope) ! Physical x Slope field: maximum thickness for co2 glacier before flow84 real :: hmax(ngrid,nslope) ! Physical x Slope field: maximum thickness for co2 glacier before flow 92 85 93 86 !----------------------------- 94 95 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,"h2o",hmax) 96 call transfer_ice_duringflow(ngrid,nslope,iflat, subslope_dist,def_slope_mean,hmax,Tice,"h2o",h2oice,flag_h2oflow,flag_h2oflow_mesh) 97 98 RETURN 99 end subroutine 100 101 102 subroutine compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,name_ice,hmax) 87 write(*,*) "Flow of H2O glaciers" 88 89 call compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,"h2o",hmax) 90 call transfer_ice_duringflow(ngrid,nslope,iflat, subslope_dist,def_slope_mean,hmax,Tice,"h2o",h2oice,flag_h2oflow,flag_h2oflow_mesh) 91 92 END SUBROUTINE flow_h2oglaciers 93 94 !======================================================================= 95 96 SUBROUTINE compute_hmaxglaciers(ngrid,nslope,iflat,def_slope_mean,Tice,name_ice,hmax) 103 97 104 98 use abort_pem_mod, only: abort_pem … … 118 112 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 119 113 120 IMPLICIT NONE 114 implicit none 121 115 122 116 ! arguments … … 124 118 125 119 ! Inputs 126 INTEGER,INTENT(IN) :: ngrid,nslope ! # of grid points and subslopes127 INTEGER,INTENT(IN) :: iflat ! index of the flat subslope128 REAL,INTENT(IN) :: def_slope_mean(nslope) ! Slope field: Values of the subgrid slope angles [deg]129 REAL,INTENT(IN) :: Tice(ngrid,nslope) ! Physical field: ice temperature [K]130 character(len=3), INTENT(IN) :: name_ice ! Nature of the ice120 integer,intent(in) :: ngrid,nslope ! # of grid points and subslopes 121 integer,intent(in) :: iflat ! index of the flat subslope 122 real,intent(in) :: def_slope_mean(nslope) ! Slope field: Values of the subgrid slope angles [deg] 123 real,intent(in) :: Tice(ngrid,nslope) ! Physical field: ice temperature [K] 124 character(len=3), intent(in) :: name_ice ! Nature of the ice 131 125 ! Outputs 132 REAL,INTENT(OUT) :: hmax(ngrid,nslope) ! Physical grid x Slope field: maximum thickness before flaw [m]126 real,intent(out) :: hmax(ngrid,nslope) ! Physical grid x Slope field: maximum thickness before flaw [m] 133 127 ! Local 134 128 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 135 REAL:: rho(ngrid,nslope) ! co2 ice density [kg/m^3]136 INTEGER:: ig,islope ! loop variables137 REAL:: slo_angle129 real :: rho(ngrid,nslope) ! co2 ice density [kg/m^3] 130 integer :: ig,islope ! loop variables 131 real :: slo_angle 138 132 139 133 ! 1. Compute rho … … 167 161 ENDDO 168 162 ENDDO 169 RETURN 170 171 end subroutine 172 173 174 175 176 subroutine transfer_ice_duringflow(ngrid,nslope,iflat, subslope_dist,def_slope_mean,hmax,Tice,name_ice,qice,flag_flow,flag_flowmesh) 163 END SUBROUTINE compute_hmaxglaciers 164 165 !======================================================================= 166 167 SUBROUTINE transfer_ice_duringflow(ngrid,nslope,iflat,subslope_dist,def_slope_mean,hmax,Tice,name_ice,qice,flag_flow,flag_flowmesh) 177 168 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 178 169 !!! … … 196 187 197 188 ! Inputs 198 INTEGER, INTENT(IN) :: ngrid,nslope !# of physical points and subslope199 INTEGER, INTENT(IN) :: iflat ! index of the flat subslope200 REAL, INTENT(IN) :: subslope_dist(ngrid,nslope) ! Distribution of the subgrid slopes within the mesh201 REAL, INTENT(IN) :: def_slope_mean(nslope) ! values of the subgrid slopes202 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 ice189 integer, intent(in) :: ngrid,nslope !# of physical points and subslope 190 integer, intent(in) :: iflat ! index of the flat subslope 191 real, intent(in) :: subslope_dist(ngrid,nslope) ! Distribution of the subgrid slopes within the mesh 192 real, intent(in) :: def_slope_mean(nslope) ! values of the subgrid slopes 193 real, intent(in) :: hmax(ngrid,nslope) ! maximum height of the glaciers before initiating flow [m] 194 real, intent(in) :: Tice(ngrid,nslope) ! Ice temperature[K] 195 character(len=3), intent(in) :: name_ice ! Nature of the ice 205 196 206 197 ! 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 slope209 REAL, INTENT(INOUT) :: flag_flowmesh(ngrid) ! boolean to check if there is flow in the mesh198 real, intent(inout) :: qice(ngrid,nslope) ! CO2 in the subslope [kg/m^2] 199 real, intent(inout) :: flag_flow(ngrid,nslope) ! boolean to check if there is flow on a subgrid slope 200 real, intent(inout) :: flag_flowmesh(ngrid) ! boolean to check if there is flow in the mesh 210 201 ! Local 211 INTEGERig,islope ! loop212 REALrho(ngrid,nslope) ! density of ice, temperature dependant [kg/m^3]213 INTEGERiaval ! ice will be transfered here202 integer ig,islope ! loop 203 real rho(ngrid,nslope) ! density of ice, temperature dependant [kg/m^3] 204 integer iaval ! ice will be transfered here 214 205 215 206 ! 0. Compute rho … … 268 259 ENDDO !islope 269 260 ENDDO !ig 270 RETURN 271 end subroutine 272 273 subroutine computeTcondCO2(timelen,ngrid,nslope,vmr_co2_PEM,ps_GCM,global_ave_ps_GCM,global_ave_ps_PEM,Tcond) 261 END SUBROUTINE 262 263 !======================================================================= 264 265 SUBROUTINE computeTcondCO2(timelen,ngrid,nslope,vmr_co2_PEM,ps_PCM,global_avg_ps_PCM,global_avg_ps_PEM,Tcond) 274 266 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 275 267 !!! … … 288 280 289 281 ! INPUT 290 INTEGER,INTENT(IN) :: timelen, ngrid,nslope ! # of timesample,physical points, subslopes 291 REAL,INTENT(IN) :: vmr_co2_PEM(ngrid,timelen) ! Physical points x times field: VMR of CO2 in the first layer [mol/mol] 292 REAL,INTENT(IN) :: ps_GCM(ngrid,timelen) ! Physical points x times field: surface pressure in the GCM [Pa] 293 REAL,INTENT(IN) :: global_ave_ps_GCM ! Global averaged surfacepressure in the GCM [Pa] 294 REAL, INTENT(IN) :: global_ave_ps_PEM ! Global averaged surface pressure computed during the PEM iteration 282 integer, intent(in) :: timelen, ngrid, nslope ! # of timesample, physical points, subslopes 283 real, dimension(ngrid,timelen), intent(in) :: vmr_co2_PEM ! Physical points x times field: VMR of CO2 in the first layer [mol/mol] 284 real, dimension(ngrid,timelen), intent(in) :: ps_PCM ! Physical points x times field: surface pressure in the PCM [Pa] 285 real, intent(in) :: global_avg_ps_PCM ! Global averaged surfacepressure in the PCM [Pa] 286 real, intent(in) :: global_avg_ps_PEM ! Global averaged surface pressure computed during the PEM iteration 287 295 288 ! OUTPUT 296 REAL,INTENT(OUT) :: Tcond(ngrid,nslope) ! Physical points: condensation temperature of CO2, yearly averaged289 real, dimension(ngrid,nslope), intent(out) :: Tcond ! Physical points: condensation temperature of CO2, yearly averaged 297 290 298 291 ! LOCAL 299 300 INTEGER :: ig,it,islope ! for loop 301 REAL :: ave ! intermediate to compute average 292 integer :: ig, it ! For loop 293 real :: ave ! Intermediate to compute average 302 294 303 295 !!!!!!!!!!!!!!!!!!!!!!!!!!!! 304 305 306 DO ig = 1,ngrid 307 ave = 0 308 DO it = 1,timelen 309 ave = ave + beta_clap_co2/(alpha_clap_co2-log(vmr_co2_PEM(ig,it)*ps_GCM(ig,it)*global_ave_ps_GCM/global_ave_ps_PEM/100)) 310 ENDDO 311 DO islope = 1,nslope 312 Tcond(ig,islope) = ave/timelen 313 ENDDO 314 ENDDO 315 RETURN 316 317 318 end subroutine 319 end module 296 do ig = 1,ngrid 297 ave = 0 298 do it = 1,timelen 299 ave = ave + beta_clap_co2/(alpha_clap_co2 - log(vmr_co2_PEM(ig,it)*ps_PCM(ig,it)*global_avg_ps_PCM/global_avg_ps_PEM/100)) 300 enddo 301 Tcond(ig,:) = ave/timelen 302 enddo 303 304 END SUBROUTINE computeTcondCO2 305 306 END MODULE glaciers_mod
Note: See TracChangeset
for help on using the changeset viewer.