Changeset 3098
- Timestamp:
- Oct 23, 2023, 7:02:06 PM (14 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3095 r3098 4273 4273 Prettyfied solarlong.F and made it a module. Likewise for conf_phys.F 4274 4274 4275 == 23/10/2023 == EV 4276 We added the to module vdifc the possibily of subsurface intercation, mostly to have the option of buried glaicer that can lose ice and create polar layers. 4277 if no ice is on the surface the ice the atmosphere can directly interact with the subsurface ice. 4278 if ice is on the surface it can interact with the subsurface ice. 4279 **For now it is not working with more then one subslope. I will add this feature soon** 4280 In order to use it there are two flags that needs to be set to true. 4281 paleoclimate=.true. 4282 lag_layer=.true. 4283 in addition one need to give the following parametrs in startfi or run.def: 4284 d_coef=X for the diffusion coeficent (4e-4 is the defualt) 4285 <h2o_ice_depth=X> if its zero or lower there is no subsurface ice (default -1). 4286 outputs: zdq_ssi, momentarily zdqsdif after the interaction with the SSIzdq_subtimestep, momentarily flux after the interaction with the SSIzdq_ssi_frost momentarily zdqsdif after the interaction of the frost with the SSI 4287 q1, atmospheric first layer water vapor quatity 4288 qeq, SSI water vapor quantity 4289 4290 4275 4291 Some code tidying: 4276 4292 Made pi in module comcstfi_h a parameter (and not a variable recomputed at -
trunk/LMDZ.MARS/libf/phymars/conf_phys.F
r3094 r3098 37 37 use aeropacity_mod, only: iddist, topdustref 38 38 USE mod_phys_lmdz_transfert_para, ONLY: bcast 39 USE paleoclimate_mod,ONLY: paleoclimate,albedo_perenialco2 39 USE paleoclimate_mod,ONLY: paleoclimate,albedo_perenialco2, 40 & lag_layer 40 41 use microphys_h, only: mteta 41 42 … … 338 339 ! PALEOCLIMATE 339 340 340 write(*,*)"Is it paleoclimate run?" 341 write(*,*)"Using lag layer??" 342 lag_layer=.false. 343 call getin_p("lag_layer",lag_layer) 344 write(*,*) " lag_layer = ", lag_layer 345 346 write(*,*)"Is it paleoclimate run?" 341 347 paleoclimate=.false. ! default value 342 348 call getin_p("paleoclimate",paleoclimate) 343 349 write(*,*)" paleoclimate = ",paleoclimate 350 344 351 345 352 write(*,*)"Albedo for perenial CO2 ice?" -
trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
r3095 r3098 477 477 call getin("subsurface_ice_depth",ice_depth) 478 478 479 479 480 z0(1) = z0_default ! default value for roughness 480 481 write(*,*) 'Surface roughness length z0 (m)?' … … 716 717 write(*,*) 'Prescribed atmospheric water vapor profile' 717 718 write(*,*) 'Unless it reaches saturation (maximal value)' 719 else if (atm_wat_profile .eq. 2) then 720 write(*,*) 'Prescribed atmospheric water vapor profile' 721 write(*,*) 'like present day northern midlatitude' 722 write(*,*) 'Unless it reaches saturation (maximal value)' 718 723 else 719 724 error stop 'Water vapor profile value not correct!' -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3092 r3098 179 179 endif 180 180 endif 181 endif 181 !EV profile 182 ! IF(atm_wat_profile.eq.2) THEN 183 ! DO ilayer=1,16 184 ! q(1,ilayer,igcm_h2o_vap)=min(zqsat(ilayer),6e-5) 185 ! ENDDO! ilayer=1,16 186 ! DO ilayer=17,22 187 ! q(1,ilayer,igcm_h2o_vap)=min(zqsat(ilayer),3e-5) 188 ! ENDDO! ilayer=17,22 189 ! DO ilayer=23,nlayer 190 ! q(1,ilayer,igcm_h2o_vap)=0 191 ! ENDDO! ilayer=23,nlayer 192 ! endif 193 endif 182 194 183 195 ! Call physics -
trunk/LMDZ.MARS/libf/phymars/paleoclimate_mod.F90
r3007 r3098 15 15 !$OMP THREADPRIVATE(paleoclimate) 16 16 17 real, save, allocatable :: lag_h2o_ice(:,:) ! Thickness of the lag before H2O ice [m]17 real, save, allocatable :: h2o_ice_depth(:,:) ! Thickness of the lag before H2O ice [m] 18 18 real, save, allocatable :: lag_co2_ice(:,:) ! Thickness of the lag before CO2 ice [m] 19 19 real, save :: albedo_perenialco2 ! Albedo for perenial co2 ice [1] 20 !$OMP THREADPRIVATE(lag_h2o_ice,lag_co2_ice,albedo_perenialco2) 20 real, save, allocatable :: d_coef(:,:) ! Diffusion coeficent 21 LOGICAL,SAVE :: lag_layer ! does lag layer is present? 22 !$OMP THREADPRIVATE(h2o_ice_depth,lag_co2_ice,albedo_perenialco2) 21 23 22 24 CONTAINS … … 29 31 integer,intent(in) :: nslope ! number of slope within a mesh 30 32 31 allocate( lag_h2o_ice(ngrid,nslope))33 allocate(h2o_ice_depth(ngrid,nslope)) 32 34 allocate(lag_co2_ice(ngrid,nslope)) 35 allocate(d_coef(ngrid,nslope)) 33 36 end subroutine ini_paleoclimate_h 34 37 … … 36 39 37 40 implicit none 38 if (allocated(lag_h2o_ice)) deallocate(lag_h2o_ice) 41 if (allocated(d_coef)) deallocate(d_coef) 42 if (allocated(h2o_ice_depth)) deallocate(h2o_ice_depth) 39 43 if (allocated(lag_co2_ice)) deallocate(lag_co2_ice) 40 44 end subroutine end_paleoclimate_h -
trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90
r3037 r3098 27 27 use comsoil_h, only: flux_geo 28 28 USE comslope_mod, ONLY: nslope, major_slope 29 USE paleoclimate_mod, ONLY: paleoclimate, lag_h2o_ice, lag_co2_ice29 USE paleoclimate_mod, ONLY: paleoclimate, h2o_ice_depth, lag_co2_ice, d_coef 30 30 USE comcstfi_h, only: pi 31 31 use geometry_mod, only: latitude … … 744 744 if (startphy_file) then 745 745 ! Depth of H2O lag 746 call get_field("lag_h2o_ice",lag_h2o_ice,found,indextime) 747 if (.not.found) then 748 write(*,*) "phyetat0: Failed loading <lag_h2o_ice> : ", & 749 "<lag_h2o_ice> is set as -1 (no subsurface ice)" 750 lag_h2o_ice(:,:) = -1. 751 endif 746 call get_field("h2o_ice_depth",h2o_ice_depth,found,indextime) 747 if (.not.found) then 748 write(*,*) "phyetat0: Failed loading <h2o_ice_depth> : ", & 749 "<h2o_ice_depth> is set as -1 (no subsurface ice)" 750 h2o_ice_depth(:,:) = -1. 751 endif 752 753 ! Diffuesion coeficent 754 call get_field("d_coef",d_coef,found,indextime) 755 if (.not.found) then 756 write(*,*) "phyetat0: Failed loading <d_coef> : ", & 757 "<d_coef> is set as 4e-4 (defualt value)" 758 d_coef(:,:) = 4e-4 759 endif 760 752 761 753 762 ! Depth of CO2 lag … … 774 783 endif ! notfound 775 784 else ! no startfiphyle 776 lag_h2o_ice(:,:) = -1.785 h2o_ice_depth(:,:) = -1. 777 786 lag_co2_ice(:,:) = -1. 778 787 perenial_co2ice(:,:) = 0. 788 d_coef(:,:)= 4.e-4 779 789 if (abs(latitude(ngrid)-(-pi/2.)).lt.1.e-5) then 780 790 DO islope = 1,nslope … … 786 796 endif !startphy_file 787 797 else 788 lag_h2o_ice(:,:) = -1.798 h2o_ice_depth(:,:) = -1. 789 799 lag_co2_ice(:,:) = -1. 790 800 perenial_co2ice(:,:) = 0. 801 d_coef(:,:)= 4.e-4 791 802 endif !paleoclimate 792 803 -
trunk/LMDZ.MARS/libf/phymars/phyredem.F90
r3051 r3098 25 25 use time_phylmdz_mod, only: daysec 26 26 use comslope_mod, ONLY: nslope 27 USE paleoclimate_mod, ONLY: paleoclimate, lag_h2o_ice, lag_co2_ice27 USE paleoclimate_mod, ONLY: paleoclimate, h2o_ice_depth, lag_co2_ice 28 28 implicit none 29 29 … … 156 156 ! Paleoclimate outputs 157 157 if(paleoclimate) then 158 call put_field(" lag_h2o_ice","Depth of the H2O lags",lag_h2o_ice)158 call put_field("h2o_ice_depth","Depth to the fisrt H2O ice",h2o_ice_depth) 159 159 call put_field("lag_co2_ice","Depth of the CO2 lags",lag_co2_ice) 160 160 endif -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3095 r3098 1514 1514 & zdqdif,zdqsdif,wstar,zcdv,zcdh,hfmax_th, 1515 1515 & zcondicea_co2microp,sensibFlux, 1516 & dustliftday,local_time,watercap,dwatercap_dif) 1516 & dustliftday,local_time,watercap,dwatercap_dif, 1517 & tsoil,nsoilmx) 1517 1518 1518 1519 DO ig=1,ngrid -
trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
r3059 r3098 13 13 $ pdqdif,pdqsdif,wstar,zcdv_true,zcdh_true, 14 14 $ hfmax,pcondicea_co2microp,sensibFlux, 15 $ dustliftday,local_time,watercap, dwatercap_dif )16 15 $ dustliftday,local_time,watercap, dwatercap_dif, 16 $ tsoil,nsoil) 17 17 use tracer_mod, only: noms, igcm_dust_mass, igcm_dust_number, 18 18 & igcm_dust_submicron, igcm_h2o_vap, … … 32 32 & subslope_dist,major_slope,iflat 33 33 use microphys_h, only: To 34 use paleoclimate_mod, only: d_coef,h2o_ice_depth,lag_layer 35 use comsoil_h, only: layer, mlayer 34 36 35 37 IMPLICIT NONE … … 61 63 c ---------- 62 64 63 INTEGER,INTENT(IN) :: ngrid,nlay 65 INTEGER,INTENT(IN) :: ngrid,nlay,nsoil 64 66 REAL,INTENT(IN) :: ptimestep 65 67 REAL,INTENT(IN) :: pplay(ngrid,nlay),pplev(ngrid,nlay+1) … … 75 77 REAL,INTENT(IN) :: pcapcal(ngrid,nslope) 76 78 REAL,INTENT(INOUT) :: pq2(ngrid,nlay+1) 79 REAL,INTENT(IN) :: tsoil(ngrid,nsoil,nslope) 77 80 78 81 c Argument added for condensation: … … 102 105 REAL :: pt(ngrid,nlay) 103 106 104 INTEGER ilev,ig,ilay,nlev,islope 107 INTEGER ilev,ig,ilay,nlev,islope,ik,lice 105 108 106 109 REAL z4st,zdplanck(ngrid) … … 118 121 REAL zcst1 119 122 REAL zu2(ngrid) 123 REAL Tice(ngrid,nslope) ! subsurface temperature where ice is located. 124 REAL qeq(ngrid,nslope) ! saturation water vapor in the subsurface 125 REAL dist_up(ngrid,nslope) !distance from ice to layer above 126 REAL dist_down(ngrid,nslope) !distance from ice to layer down 127 REAL dist_sum(ngrid,nslope) ! sum of distance 128 REAL zdqsdif_ssi(ngrid,nslope) !SSI flux 129 REAL zdqsdif_ssi_frost(ngrid,nslope) !SSI-frost interaction 120 130 121 131 EXTERNAL SSUM,SCOPY … … 155 165 REAL rho(ngrid) ! near surface air density 156 166 REAL qsat(ngrid) 167 REAL qsat2(ngrid,nslope) 168 REAL resist(ngrid,nslope) !subsurface ice flux reduction coef 157 169 158 170 REAL hdoflux(ngrid,nslope) ! value of vapour flux of HDO … … 272 284 zdqsdif(1:ngrid)=0 273 285 dwatercap_dif(1:ngrid,1:nslope)=0 274 286 ! h2o_ice_depth(1:ngrid,1:nslope)=5 275 287 c ** calcul de rho*dz et dt*rho/dz=dt*rho**2 g/dp 276 288 c avec rho=p/RT=p/ (R Theta) (p/ps)**kappa … … 914 926 c Utilisation d'un sous pas de temps afin 915 927 c de decrire le flux de chaleur latente 916 928 917 929 do iq=1,nq 918 930 if ((water).and.(iq.eq.igcm_h2o_vap)) then … … 920 932 DO islope = 1,nslope 921 933 DO ig=1,ngrid 934 935 936 922 937 zqsurf(ig)=pqsurf(ig,igcm_h2o_ice,islope)/ 923 938 & cos(pi*def_slope_mean(islope)/180.) … … 943 958 zq_tmp_vap(ig,:,:) =zq(ig,:,:) 944 959 c Debut du sous pas de temps 945 946 960 DO tsub=1,nsubtimestep(ig) 947 961 … … 980 994 if ((-zdqsdif(ig)*subtimestep) 981 995 & .gt.(zqsurf(ig))) then 996 997 998 !EV subsurface ice 999 IF(h2o_ice_depth(ig,islope) .gt. 0 .and. lag_layer) 1000 & then 1001 zdqsdif(ig)= 1002 & -zqsurf(ig)/subtimestep 1003 zqsurf(ig)=0 1004 1005 DO ik=0,nsoil-2 ! go through all the layers to find the ice locations 1006 IF((mlayer(ik).le.h2o_ice_depth(ig,islope)).and. 1007 & (mlayer(ik+1).gt.h2o_ice_depth(ig,islope))) THEN 1008 lice = ik+1 1009 EXIT 1010 ENDIF 1011 ENDDO !of subsurface loop 1012 IF (lice .gt. 1) then !calculate the distance from the layers 1013 dist_up(ig,islope)=(h2o_ice_depth(ig,islope) 1014 & -mlayer(lice-1)) 1015 dist_down(ig,islope)=(mlayer(lice) 1016 & -h2o_ice_depth(ig,islope)) 1017 dist_sum(ig,islope)=dist_up(ig,islope) 1018 & +dist_down(ig,islope) 1019 Tice(ig,islope)=(dist_up(ig,islope) ! Linear interp to calculate the temp 1020 & *tsoil(ig,lice-1,islope) 1021 & /dist_sum(ig,islope))+ 1022 & (dist_down(ig,islope)*tsoil(ig,lice,islope) 1023 & /dist_sum(ig,islope)) 1024 ELSE 1025 Tice(ig,islope)=tsoil(ig,1,islope) 1026 ENDIF 1027 call watersat(1,Tice(ig,1),pplev(ig,1) 1028 & ,qsat2(ig,1)) 1029 qeq(ig,1)=(ztsrf(ig)/Tice(ig,1)) 1030 & *qsat2(ig,1) 1031 resist(ig,1)=(1+(h2o_ice_depth(ig,islope)*zcdh(ig) 1032 & /d_coef(ig,islope))) 1033 !write(*,*)'R=',resist(ig,islope) 1034 !write(*,*)'zice=',h2o_ice_depth(ig,islope) 1035 !write(*,*)'D=',d_coef(ig,islope) 1036 !write(*,*)'zcdh=',zcdh(ig) 1037 zb(ig,1)=zb(ig,1)/resist(ig,1) ! change zb to account subsurface ice 1038 !vdifc algorithem !!!!!needs to change reseist io to the mean 1039 !beacuse of the slopes!!!!! 1040 z1(ig)=1./(za(ig,nlay)+zb(ig,nlay)) 1041 zc(ig,nlay)=za(ig,nlay)*zq_tmp_vap(ig,nlay,iq)*z1(ig) 1042 zd(ig,nlay)=zb(ig,nlay)*z1(ig) 1043 DO ilay=nlay-1,2,-1 1044 z1(ig)=1./(za(ig,ilay)+zb(ig,ilay)+ 1045 $ zb(ig,ilay+1)*(1.-zd(ig,ilay+1))) 1046 zc(ig,ilay)=(za(ig,ilay)*zq_tmp_vap(ig,ilay,iq)+ 1047 $ zb(ig,ilay+1)*zc(ig,ilay+1))*z1(ig) 1048 zd(ig,ilay)=zb(ig,ilay)*z1(ig) 1049 ENDDO 1050 z1(ig)=1./(za(ig,1)+zb(ig,1)+ 1051 $ zb(ig,2)*(1.-zd(ig,2))) 1052 zc(ig,1)=(za(ig,1)*zq_tmp_vap(ig,1,iq)+ 1053 $ zb(ig,2)*zc(ig,2)) * z1(ig) 1054 zd(ig,1)=zb(ig,1)*z1(ig) 1055 zq1temp(ig)=zc(ig,1)+ zd(ig,1)*qsat(ig) 1056 zdqsdif_ssi(ig,1)=rho(ig)*dryness(ig)*zcdv(ig) 1057 & *(zq1temp(ig)-qeq(ig,islope)) 1058 call write_output('zdq_ssi', 1059 & '','',zdqsdif_ssi(ig,1)) 1060 call write_output('qeq', 1061 & '','',qeq(ig,1)) 1062 call write_output('q1', 1063 & '','',zq1temp(ig)) 1064 !write(*,*)'qeq=',qeq(ig,1) 1065 !write(*,*)'q1=',zq1temp(ig) 1066 !write(*,*)'zdqsdif_ssi=',zdqsdif_ssi(ig,1) 1067 !I should some all the interactions with the SSI accoridng 1068 !to the statistics and the evaluate 1069 1070 !write(*,*) "zdq_ssi*t", zdqsdif_ssi(ig)*subtimestep 1071 if (zdqsdif_ssi(ig,1)<0) then 1072 !zdqsdif(ig)=zdqsdif_ssi(ig,1)-(zqsurf(ig)/subtimestep) 1073 zdqsdif(ig)=zdqsdif(ig)+zdqsdif_ssi(ig,1) 1074 call write_output('zdq_zdqssi', 1075 & '','',zdqsdif(ig)+zdqsdif_ssi(ig,1)) 1076 endif 1077 ELSE 982 1078 c pdqsdif > 0 : ice condensing 983 1079 c pdqsdif < 0 : ice subliming 984 cwrite(*,*) "subliming more than available frost: qsurf!"1080 write(*,*) "subliming more than available frost: qsurf!" 985 1081 zdqsdif(ig)= 986 1082 & -zqsurf(ig)/subtimestep … … 991 1087 $ (-zdqsdif(ig)) *subtimestep) *z1(ig) 992 1088 zq1temp(ig)=zc(ig,1) 1089 ENDIF !if h2o_ice_depth>0 and lag_layer 993 1090 endif !if .not.watercaptag(ig) 994 1091 endif ! if sublim more than surface 1092 1093 ! subsurface ice <--> frost interaction !EV 1094 IF(h2o_ice_depth(ig,islope) .gt. 4e-4 .and. lag_layer 1095 & .and. zqsurf(ig) .gt. 0) then 1096 zdqsdif_ssi_frost(ig,1)=(d_coef(ig,1) 1097 & /h2o_ice_depth(ig,1)) 1098 & *rho(ig)*dryness(ig)*(qsat(ig)-qeq(ig,1)) 1099 !needs to change to the mean of eq 1100 zdqsdif(ig)=zdqsdif(ig)-zdqsdif_ssi_frost(ig,1) 1101 !!!!! zdsqdif_ssi_frosst need to be changed to an 1102 !average 1103 ELSEIF (h2o_ice_depth(ig,islope) .gt. 4e-4 .and. lag_layer 1104 & .and. watercaptag(ig)) then 1105 zdqsdif_ssi_frost(ig,1)=(d_coef(ig,1) 1106 & /h2o_ice_depth(ig,1)) 1107 & *rho(ig)*dryness(ig)*(qsat(ig)-qeq(ig,1)) 1108 zdqsdif(ig)=zdqsdif(ig)-zdqsdif_ssi_frost(ig,1) 1109 !needs to change to the mean of eq 1110 ENDIF 1111 call write_output('zdqsdif_ssi_frost', 1112 & '','',zdqsdif_ssi_frost(ig,1)) 1113 call write_output('subtimestep', 1114 & '','',subtimestep) 1115 ! ENDDO !subsurface ice subslope 1116 1117 995 1118 996 1119 c Starting upward calculations for water : 997 1120 c Actualisation de h2o_vap dans le premier niveau 998 1121 zq_tmp_vap(ig,1,igcm_h2o_vap)=zq1temp(ig) 999 1000 1122 c Take into account the H2O latent heat impact on the surface temperature 1001 1123 if (latentheat_surfwater) then … … 1009 1131 & *zq_tmp_vap(ig,ilay-1,iq) 1010 1132 ENDDO 1011 1012 1133 c Subtimestep water budget : 1013 1134 … … 1016 1137 zqsurf(ig)= zqsurf(ig)+( 1017 1138 & zdqsdif(ig))*subtimestep 1018 1139 if (zqsurf(ig)<0) then 1140 zqsurf(ig)=0 1141 endif 1019 1142 c Monitoring instantaneous latent heat flux in W.m-2 : 1020 1143 zsurf_h2o_lh(ig,islope) = zsurf_h2o_lh(ig,islope)+ … … 1033 1156 c Fin du sous pas de temps 1034 1157 ENDDO ! tsub=1,nsubtimestep 1035 1036 1158 c Integration of subtimestep temp and water budget : 1037 1159 c (btw could also compute the post timestep temp and ice … … 1044 1166 & cos(pi*def_slope_mean(islope)/180.)) 1045 1167 & /ptimestep 1046 1047 1168 c if subliming more than qsurf(ice) and on watercaptag, water 1048 1169 c sublimates from watercap reservoir (dwatercap_dif is <0) … … 1063 1184 ENDDO ! of DO ig=1,ngrid 1064 1185 ENDDO ! islope 1065 1066 1186 c Some grid box averages: interface with the atmosphere 1067 1187 DO ig = 1,ngrid … … 1075 1195 ENDDO 1076 1196 ENDDO 1077 1078 1197 ! Recompute values in kg/m^2 slopped 1079 1198 DO ig = 1,ngrid … … 1167 1286 & "Ground ice latent heat flux", 1168 1287 & "W.m-2",surf_h2o_lh(:,iflat)) 1169 1288 call write_output('zdq_subtimestep', 1289 & '','',zdqsdif(:)*subtimestep) 1290 call write_output('zdq_end', 1291 & '','',zdqsdif(:)) 1292 call write_output('vdifc_subtimestep', 1293 & '','',subtimestep) 1170 1294 C Diagnostic output for HDO 1171 1295 ! if (hdo) then
Note: See TracChangeset
for help on using the changeset viewer.