Changeset 2587
- Timestamp:
- Nov 19, 2021, 5:00:58 PM (3 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r2586 r2587 3520 3520 Run with callnlte=callnirco2=calldifv=calladj=calltherm=callrichsl=callcond=callsoil=calllott=TESicealbedo=.true. 3521 3521 3522 == 19/11/2021 == JN 3523 Bug correction in vdifc caused by the computation of watercap tendency within the subtimestep of water ice sublimation. 3524 This is now computed after the subtimestep (actually much simpler). 3525 Local variables "zwatercap" and "zdwatercap_dif" used to monitor the evolution of watercap during the subtimestep 3526 are now obsoletes and thus deleted. 3527 Third stage of implementation of Open_MP in the physic. 3528 Run with callnlte=callnirco2=calldifv=calladj=calltherm=callrichsl=callcond=callsoil=calllott=TESicealbedo=.true. -
trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
r2531 r2587 131 131 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 132 132 REAL zdqsdif(ngrid) ! subtimestep pdqsdif for water ice 133 REAL zwatercap(ngrid) ! subtimestep watercap for water ice134 133 REAL ztsrf(ngrid) ! temporary surface temperature in tsub 135 134 REAL zdtsrf(ngrid) ! surface temperature tendancy in tsub … … 158 157 REAL,INTENT(IN) :: watercap(ngrid) 159 158 REAL,INTENT(OUT) :: dwatercap_dif(ngrid) 160 REAL :: zdwatercap_dif(ngrid)161 159 162 160 c Subtimestep to compute h2o latent heat flux: … … 242 240 pdqsdif(1:ngrid,1:nq)=0 243 241 zdqsdif(1:ngrid)=0 244 zwatercap(1:ngrid)=0245 242 dwatercap_dif(1:ngrid)=0 246 zdwatercap_dif(1:ngrid)=0247 243 248 244 c ** calcul de rho*dz et dt*rho/dz=dt*rho**2 g/dp … … 892 888 subtimestep = ptimestep/nsubtimestep(ig) 893 889 ztsrf(ig)=ptsrf(ig) ! +pdtsrf(ig)*subtimestep 894 zwatercap(ig)=watercap(ig)895 890 896 891 c Debut du sous pas de temps … … 928 923 zdqsdif(ig)=rho(ig)*dryness(ig)*zcdv(ig) 929 924 & *(zq1temp(ig)-qsat(ig)) 930 if ((-zdqsdif(ig)*subtimestep) 925 c write(*,*)'subliming more than available frost: qsurf!' 926 if(.not.watercaptag(ig)) then 927 if ((-zdqsdif(ig)*subtimestep) 931 928 & .gt.(zqsurf(ig))) then 932 c write(*,*)'subliming more than available frost: qsurf!' 933 if(watercaptag(ig)) then 934 c dwatercap_dif same sign as pdqsdif (pos. toward ground) 935 zdwatercap_dif(ig) = zdqsdif(ig) 936 & + zqsurf(ig)/subtimestep 929 c pdqsdif > 0 : ice condensing 930 c pdqsdif < 0 : ice subliming 931 c write(*,*) "subliming more than available frost: qsurf!" 937 932 zdqsdif(ig)= 938 933 & -zqsurf(ig)/subtimestep 939 c write(*,*) "subliming more than available frost: qsurf!"940 else ! (case not.watercaptag(ig))941 zdqsdif(ig)=942 & -zqsurf(ig)/subtimestep943 zdwatercap_dif(ig) = 0.0944 945 934 c write(*,*)'flux vers le sol=',pdqsdif(ig,nq) 946 935 z1(ig)=1./(za(ig,1)+ zb(ig,2)*(1.-zd(ig,2))) 947 936 zc(ig,1)=(za(ig,1)*zq(ig,1,igcm_h2o_vap)+ 948 $ zb(ig,2)*zc(ig,2) + 949 $ (-zdqsdif(ig) -zdwatercap_dif(ig)) *subtimestep) *z1(ig)937 $ zb(ig,2)*zc(ig,2) + 938 $ (-zdqsdif(ig)) *subtimestep) *z1(ig) 950 939 zq1temp(ig)=zc(ig,1) 951 940 endif !if .not.watercaptag(ig) … … 955 944 c Actualisation de h2o_vap dans le premier niveau 956 945 zq(ig,1,igcm_h2o_vap)=zq1temp(ig) 957 958 c 946 947 c Take into account the H2O latent heat impact on the surface temperature 959 948 if (latentheat_surfwater) then 960 949 lh=(2834.3-0.28*(ztsrf(ig)-To)- 961 950 & 0.004*(ztsrf(ig)-To)*(ztsrf(ig)-To))*1.e+3 962 zdtsrf(ig)= (zdwatercap_dif(ig)+ 963 & zdqsdif(ig))*lh /pcapcal(ig) 951 zdtsrf(ig)= zdqsdif(ig)*lh /pcapcal(ig) 964 952 endif ! (latentheat_surfwater) then 965 953 954 DO ilay=2,nlay 955 zq(ig,ilay,iq)=zc(ig,ilay)+zd(ig,ilay)*zq(ig,ilay-1,iq) 956 ENDDO 966 957 967 958 c Subtimestep water budget : … … 971 962 zqsurf(ig)= zqsurf(ig)+( 972 963 & zdqsdif(ig))*subtimestep 973 zwatercap(ig)= zwatercap(ig)+974 & zdwatercap_dif(ig)*subtimestep975 964 976 965 … … 981 970 & .gt.frost_albedo_threshold) ! if there is still ice, T cannot exceed To 982 971 & zdtsrf(ig) = min(zdtsrf(ig),(To-ztsrf(ig))/subtimestep) ! ice melt case 983 984 985 DO ilay=2,nlay 986 zq(ig,ilay,iq)=zc(ig,ilay)+zd(ig,ilay)*zq(ig,ilay-1,iq) 987 ENDDO 972 973 988 974 989 975 c Fin du sous pas de temps 990 991 976 ENDDO ! tsub=1,nsubtimestep 992 977 993 c Integration of subtimestep water budget : 994 978 c Integration of subtimestep temp and water budget : 979 c (btw could also compute the post timestep temp and ice 980 c by simply adding the subtimestep trend instead of this) 995 981 pdtsrf(ig)= (ztsrf(ig) - 996 982 & ptsrf(ig))/ptimestep 997 983 pdqsdif(ig,igcm_h2o_ice)= 998 984 & (zqsurf(ig)- pqsurf(ig,igcm_h2o_ice))/ptimestep 999 dwatercap_dif(ig)=(zwatercap(ig) - 1000 & watercap(ig))/ptimestep 985 986 c if subliming more than qsurf(ice) and on watercaptag, water 987 c sublimates from watercap reservoir (dwatercap_dif is <0) 988 if(watercaptag(ig)) then 989 if ((-pdqsdif(ig,igcm_h2o_ice)*ptimestep) 990 & .gt.(pqsurf(ig,igcm_h2o_ice))) then 991 dwatercap_dif(ig)=pdqsdif(ig,igcm_h2o_ice)+ 992 & pqsurf(ig,igcm_h2o_ice)/ptimestep 993 pdqsdif(ig,igcm_h2o_ice)= 994 & - pqsurf(ig,igcm_h2o_ice)/ptimestep 995 endif! ((-pdqsdif(ig)*ptimestep) 996 endif !(watercaptag(ig)) then 1001 997 1002 998 ENDDO ! of DO ig=1,ngrid
Note: See TracChangeset
for help on using the changeset viewer.