Changeset 3124
- Timestamp:
- Nov 14, 2023, 2:53:04 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
r3121 r3124 296 296 zq1temp_regolith(1:ngrid)=0 297 297 zdqsdif_tot(1:ngrid)=0 298 ! h2o_ice_depth(1:ngrid,1:nslope)=5 298 !h2o_ice_depth(1:ngrid,1:nslope)=1 299 299 c ** calcul de rho*dz et dt*rho/dz=dt*rho**2 g/dp 300 300 c avec rho=p/RT=p/ (R Theta) (p/ps)**kappa … … 963 963 saved_h2o_vap(:)= zq(:,1,igcm_h2o_vap) 964 964 DO ig=1,ngrid 965 !nsubtimestep(ig)=1 for debug 965 966 subtimestep = ptimestep/nsubtimestep(ig) 966 967 ztsrf(ig)=ptsrf(ig,islope) ! +pdtsrf(ig)*subtimestep … … 1152 1153 IF(h2o_ice_depth(ig,islope) .gt. 4e-4 .and. lag_layer 1153 1154 & .and. zqsurf(ig) .gt. 0) then 1155 DO ik=0,nsoil-2 ! go through all the layers to find the ice locations 1156 IF((mlayer(ik).le.h2o_ice_depth(ig,islope)).and. 1157 & (mlayer(ik+1).gt.h2o_ice_depth(ig,islope))) THEN 1158 lice = ik+1 1159 EXIT 1160 ENDIF 1161 ENDDO !of subsurface loop 1162 IF (lice .gt. 1) then !calculate the distance from the layers 1163 dist_up(ig,islope)=(h2o_ice_depth(ig,islope) 1164 & -mlayer(lice-1)) 1165 dist_down(ig,islope)=(mlayer(lice) 1166 & -h2o_ice_depth(ig,islope)) 1167 dist_sum(ig,islope)=dist_up(ig,islope) 1168 & +dist_down(ig,islope) 1169 Tice(ig,islope)=(dist_up(ig,islope) ! Linear interp to calculate the temp 1170 & *ptsoil(ig,lice-1,islope) 1171 & /dist_sum(ig,islope))+ 1172 & (dist_down(ig,islope)*ptsoil(ig,lice,islope) 1173 & /dist_sum(ig,islope)) 1174 ELSE 1175 Tice(ig,islope)=ptsoil(ig,1,islope) 1176 ENDIF 1177 1178 call watersat(1,Tice(ig,1),pplev(ig,1) 1179 & ,qsat2(ig,1)) 1180 qeq(ig,1)=(ztsrf(ig)/Tice(ig,1)) 1181 & *qsat2(ig,1) 1182 ! write(*,*)'icedep=',h2o_ice_depth(ig,1) 1183 ! write(*,*)'qeq=',qeq(ig,1) 1184 ! write(*,*)'d=',d_coef(ig,1) 1185 ! write(*,*)'qsat=',qsat(ig) 1186 ! write(*,*)'dry=',dryness(ig) 1187 ! write(*,*)'rho=',rho(ig) 1154 1188 zdqsdif_ssi_frost(ig,1)=(d_coef(ig,1) 1155 1189 & /h2o_ice_depth(ig,1)) … … 1161 1195 ELSEIF (h2o_ice_depth(ig,islope) .gt. 4e-4 .and. lag_layer 1162 1196 & .and. watercaptag(ig)) then 1197 DO ik=0,nsoil-2 ! go through all the layers to find the ice locations 1198 IF((mlayer(ik).le.h2o_ice_depth(ig,islope)).and. 1199 & (mlayer(ik+1).gt.h2o_ice_depth(ig,islope))) THEN 1200 lice = ik+1 1201 EXIT 1202 ENDIF 1203 ENDDO !of subsurface loop 1204 IF (lice .gt. 1) then !calculate the distance from the layers 1205 dist_up(ig,islope)=(h2o_ice_depth(ig,islope) 1206 & -mlayer(lice-1)) 1207 dist_down(ig,islope)=(mlayer(lice) 1208 & -h2o_ice_depth(ig,islope)) 1209 dist_sum(ig,islope)=dist_up(ig,islope) 1210 & +dist_down(ig,islope) 1211 Tice(ig,islope)=(dist_up(ig,islope) ! Linear interp to calculate the temp 1212 & *ptsoil(ig,lice-1,islope) 1213 & /dist_sum(ig,islope))+ 1214 & (dist_down(ig,islope)*ptsoil(ig,lice,islope) 1215 & /dist_sum(ig,islope)) 1216 ELSE 1217 Tice(ig,islope)=ptsoil(ig,1,islope) 1218 ENDIF 1219 1220 call watersat(1,Tice(ig,1),pplev(ig,1) 1221 & ,qsat2(ig,1)) 1222 qeq(ig,1)=(ztsrf(ig)/Tice(ig,1)) 1223 & *qsat2(ig,1) 1224 1163 1225 zdqsdif_ssi_frost(ig,1)=(d_coef(ig,1) 1164 1226 & /h2o_ice_depth(ig,1)) … … 1167 1229 !needs to change to the mean of eq 1168 1230 ENDIF 1169 call write_output('zdqsdif_ssi_frost',1170 & 'Flux between frost and subsurface','kg.m-2.s-1',1171 & zdqsdif_ssi_frost(ig,1))1172 1231 call write_output('subtimestep', 1173 1232 & 'vdifc substimestep length','s',subtimestep) … … 1211 1270 1212 1271 c Fin du sous pas de temps 1213 ENDDO ! tsub=1,nsubtimestep 1272 ENDDO ! tsub=1,nsubtimestep 1273 1214 1274 c Integration of subtimestep temp and water budget : 1215 1275 c (btw could also compute the post timestep temp and ice … … 1342 1402 & "Ground ice latent heat flux", 1343 1403 & "W.m-2",surf_h2o_lh(:,iflat)) 1404 call write_output('zdqsdif_ssi_frost', 1405 & 'Flux between frost and subsurface','kg.m-2.s-1', 1406 & zdqsdif_ssi_frost(:,1)) 1407 call write_output('subtimestep', 1408 & 'vdifc substimestep length','s',subtimestep) 1409 1344 1410 call write_output('zdq_subtimestep', 1345 & 1346 & 1411 & 'Actual flux zdqsdif_surf*subtimestep', 1412 & 'kg.m-2',zdqsdif_surf(:)*subtimestep) 1347 1413 call write_output('zdq_end', 1348 & 1349 & 1414 & 'Flux after all contributions', 1415 & 'kg.m-2.s-1',zdqsdif_surf(:)) 1350 1416 C Diagnostic output for HDO 1351 1417 ! if (hdo) then
Note: See TracChangeset
for help on using the changeset viewer.