Changeset 586 for trunk/LMDZ.GENERIC/libf
- Timestamp:
- Mar 16, 2012, 7:11:41 PM (13 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r538 r586 1 1 subroutine callcorrk(ngrid,nlayer,pq,nq,qsurf, & 2 2 albedo,emis,mu0,pplev,pplay,pt, & 3 tsurf,fract,dist_star,aerosol, cpp3D,muvar, &3 tsurf,fract,dist_star,aerosol,muvar, & 4 4 dtlw,dtsw,fluxsurf_lw, & 5 5 fluxsurf_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn, & … … 164 164 real totcloudfrac(ngridmx) 165 165 logical clearsky 166 167 ! Allow variations in cp with location168 real cpp3D(ngridmx,nlayermx) ! specific heat capacity at const. pressure169 166 170 167 ! for weird cloud test … … 825 822 826 823 ! Finally, the heating rates 827 if(nonideal)then 828 829 DO l=2,L_NLAYRAD 830 dtsw(ig,L_NLAYRAD+1-l)=(fmnetv(l)-fmnetv(l-1)) & 831 *g/(cpp3D(ig,L_NLAYRAD+1-l) & 832 *scalep*(plevrad(2*l+1)-plevrad(2*l-1))) 833 dtlw(ig,L_NLAYRAD+1-l)=(fmneti(l)-fmneti(l-1)) & 834 *g/(cpp3D(ig,L_NLAYRAD+1-l) & 835 *scalep*(plevrad(2*l+1)-plevrad(2*l-1))) 836 END DO 824 825 DO l=2,L_NLAYRAD 826 dtsw(ig,L_NLAYRAD+1-l)=(fmnetv(l)-fmnetv(l-1)) & 827 *g/(cpp*scalep*(plevrad(2*l+1)-plevrad(2*l-1))) 828 dtlw(ig,L_NLAYRAD+1-l)=(fmneti(l)-fmneti(l-1)) & 829 *g/(cpp*scalep*(plevrad(2*l+1)-plevrad(2*l-1))) 830 END DO 837 831 838 832 ! These are values at top of atmosphere 839 dtsw(ig,L_NLAYRAD)=(fmnetv(1)-nfluxtopv) & 840 *g/(cpp3D(ig,L_NLAYRAD)*scalep*(plevrad(3)-plevrad(1))) 841 dtlw(ig,L_NLAYRAD)=(fmneti(1)-nfluxtopi) & 842 *g/(cpp3D(ig,L_NLAYRAD)*scalep*(plevrad(3)-plevrad(1))) 843 844 else 845 846 DO l=2,L_NLAYRAD 847 dtsw(ig,L_NLAYRAD+1-l)=(fmnetv(l)-fmnetv(l-1)) & 848 *g/(cpp*scalep*(plevrad(2*l+1)-plevrad(2*l-1))) 849 dtlw(ig,L_NLAYRAD+1-l)=(fmneti(l)-fmneti(l-1)) & 850 *g/(cpp*scalep*(plevrad(2*l+1)-plevrad(2*l-1))) 851 END DO 852 853 ! These are values at top of atmosphere 854 dtsw(ig,L_NLAYRAD)=(fmnetv(1)-nfluxtopv) & 855 *g/(cpp*scalep*(plevrad(3)-plevrad(1))) 856 dtlw(ig,L_NLAYRAD)=(fmneti(1)-nfluxtopi) & 857 *g/(cpp*scalep*(plevrad(3)-plevrad(1))) 858 859 endif 833 dtsw(ig,L_NLAYRAD)=(fmnetv(1)-nfluxtopv) & 834 *g/(cpp*scalep*(plevrad(3)-plevrad(1))) 835 dtlw(ig,L_NLAYRAD)=(fmneti(1)-nfluxtopi) & 836 *g/(cpp*scalep*(plevrad(3)-plevrad(1))) 860 837 861 838 ! --------------------------------------------------------------- -
trunk/LMDZ.GENERIC/libf/phystd/condense_cloud.F90
r526 r586 4 4 piceco2,psolaralb,pemisurf, & 5 5 pdtc,pdtsrfc,pdpsrf,pduc,pdvc, & 6 pdqc,reffrad ,cpp3D)6 pdqc,reffrad) 7 7 8 8 use radinc_h, only : naerkind … … 83 83 REAL reffrad(ngrid,nlayer,naerkind) 84 84 85 ! Allow variations in cp with location86 REAL cpp3D(ngridmx,nlayermx) ! specific heat capacity at const. pressure87 88 85 89 86 … … 376 373 pdtc(ig,l)=0. 377 374 378 ! tweak ccond if the gas is non-ideal379 if(nonideal)then380 ccond=cpp3D(ig,l)/(g*latcond)381 endif382 383 375 384 376 ! ztcond-> ztnuc in test beneath to nucleate only when super saturation occurs(JL 2011) -
trunk/LMDZ.GENERIC/libf/phystd/inifis.F
r538 r586 216 216 write(*,*) " calladj = ",calladj 217 217 218 write(*,*)"Gas is nonideal CO2 ?"219 nonideal=.false.220 call getin("nonideal",nonideal)221 write(*,*)" nonideal = ",nonideal222 218 223 219 ! Test of incompatibility -
trunk/LMDZ.GENERIC/libf/phystd/kcm1d.F90
r366 r586 52 52 real emis, albedo 53 53 54 real cpp3D(nlayermx) ! specific heat capacity at const. pressure55 real rcp3D(nlayermx) ! R / specific heat capacity56 54 real muvar(nlayermx+1) 57 55 … … 235 233 call callcorrk(ngridmx,nlayer,q,nqmx,qsurf, & 236 234 albedo,emis,mu0,plev,play,temp, & 237 tsurf,fract,dist_star,aerosol,cpp 3D,muvar, &235 tsurf,fract,dist_star,aerosol,cpp,muvar, & 238 236 dtlw,dtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw, & 239 237 fluxabs_sw,fluxtop_dn,reffrad,tau_col, & -
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r538 r586 321 321 real h2otot 322 322 323 ! included by RW to allow variations in cp with location324 real cpp3D(ngridmx,nlayermx) ! specific heat capacity at const. pressure325 real rcp3D(ngridmx,nlayermx) ! R / specific heat capacity326 real cppNI, rcpNI, nnu ! last one just for Seb version327 real zpopskNI(ngridmx,nlayermx)328 323 329 324 … … 643 638 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 644 639 645 do l=1,nlayer 646 do ig=1,ngrid 647 call calc_cpp3d(cppNI,rcpNI,pt(ig,l),pplay(ig,l)) 648 cpp3D(ig,l) = cppNI 649 rcp3D(ig,l) = rcpNI 650 enddo 651 enddo 652 653 do l=1,nlayer 654 do ig=1,ngrid 655 zh(ig,l) = pt(ig,l) 656 zpopskNI(ig,l) = pt(ig,l)/zh(ig,l) 657 zpopsk(ig,l) = pt(ig,l)/zh(ig,l) 658 ! we're only after zpopskNI here, not zh 659 ! zh is calculated seperately before both vdifc and convadj 660 enddo 661 enddo 640 662 641 663 642 do l=1,nlayer … … 717 696 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 718 697 albedo,emis,mu0,pplev,pplay,pt, & 719 tsurf,fract,dist_star,aerosol, cpp3D,muvar,&698 tsurf,fract,dist_star,aerosol,muvar, & 720 699 zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw, & 721 700 fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu, & … … 731 710 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 732 711 albedo,emis,mu0,pplev,pplay,pt, & 733 tsurf,fract,dist_star,aerosol, cpp3D,muvar,&712 tsurf,fract,dist_star,aerosol,muvar, & 734 713 zdtlw1,zdtsw1,fluxsurf_lw1,fluxsurf_sw1,fluxtop_lw1, & 735 714 fluxabs_sw1,fluxtop_dn,OLR_nu1,OSR_nu1, & … … 850 829 do l = 1, nlayer 851 830 masse = (pplev(ig,l) - pplev(ig,l+1))/g 852 dEtotSW = dEtotSW + cpp 3D(ig,l)*masse*zdtsw(ig,l)*area(ig)853 dEtotLW = dEtotLW + cpp 3D(ig,l)*masse*zdtlw(ig,l)*area(ig)831 dEtotSW = dEtotSW + cpp*masse*zdtsw(ig,l)*area(ig) 832 dEtotLW = dEtotLW + cpp*masse*zdtlw(ig,l)*area(ig) 854 833 enddo 855 834 dEtotsSW = dEtotsSW + fluxsurf_sw(ig)*(1.-albedo(ig))*area(ig) … … 937 916 do l = 1, nlayer 938 917 masse = (pplev(ig,l) - pplev(ig,l+1))/g 939 dEtot = dEtot + cpp 3D(ig,l)*masse*zdtdif(ig,l)*area(ig)918 dEtot = dEtot + cpp*masse*zdtdif(ig,l)*area(ig) 940 919 941 920 vabs = sqrt(pdu(ig,l)**2 + pdv(ig,l)**2) … … 1030 1009 do l=1,nlayer 1031 1010 do ig=1,ngrid 1032 if(nonideal)then 1033 zdh(ig,l) = pdt(ig,l)/zpopskNI(ig,l) 1034 else 1035 zdh(ig,l) = pdt(ig,l)/zpopsk(ig,l) 1036 endif 1011 zdh(ig,l) = pdt(ig,l)/zpopsk(ig,l) 1037 1012 enddo 1038 1013 enddo … … 1041 1016 zdhadj(:,:)=0.0 1042 1017 1043 if(nonideal)then 1044 print*,'Nonideal is not used at the moment' 1045 call abort 1046 call convadj(ngrid,nlayer,nq,ptimestep, & 1047 pplay,pplev,zpopskNI, & 1048 pu,pv,zh,pq, & 1049 pdu,pdv,zdh,pdq, & 1050 zduadj,zdvadj,zdhadj, & 1051 zdqadj) 1052 else 1053 1054 call convadj(ngrid,nlayer,nq,ptimestep, & 1055 pplay,pplev,zpopsk, & 1056 pu,pv,zh,pq, & 1057 pdu,pdv,zdh,pdq, & 1058 zduadj,zdvadj,zdhadj, & 1059 zdqadj) 1060 1061 endif 1018 1019 call convadj(ngrid,nlayer,nq,ptimestep, & 1020 pplay,pplev,zpopsk, & 1021 pu,pv,zh,pq, & 1022 pdu,pdv,zdh,pdq, & 1023 zduadj,zdvadj,zdhadj, & 1024 zdqadj) 1062 1025 1063 1026 do l=1,nlayer … … 1065 1028 pdu(ig,l) = pdu(ig,l) + zduadj(ig,l) 1066 1029 pdv(ig,l) = pdv(ig,l) + zdvadj(ig,l) 1067 if(nonideal)then 1068 pdt(ig,l) = pdt(ig,l) + zdhadj(ig,l)*zpopskNI(ig,l) 1069 zdtadj(ig,l) = zdhadj(ig,l)*zpopskNI(ig,l) ! for diagnostic only 1070 else 1071 pdt(ig,l) = pdt(ig,l) + zdhadj(ig,l)*zpopsk(ig,l) 1072 zdtadj(ig,l) = zdhadj(ig,l)*zpopsk(ig,l) ! for diagnostic only 1073 endif 1030 pdt(ig,l) = pdt(ig,l) + zdhadj(ig,l)*zpopsk(ig,l) 1031 zdtadj(ig,l) = zdhadj(ig,l)*zpopsk(ig,l) ! for diagnostic only 1074 1032 enddo 1075 1033 enddo … … 1092 1050 do l = 1, nlayer 1093 1051 masse = (pplev(ig,l) - pplev(ig,l+1))/g 1094 dEtot = dEtot + cpp 3D(ig,l)*masse*zdtadj(ig,l)*area(ig)1052 dEtot = dEtot + cpp*masse*zdtadj(ig,l)*area(ig) 1095 1053 enddo 1096 1054 enddo … … 1142 1100 qsurf(1,igcm_co2_ice),albedo,emis, & 1143 1101 zdtc,zdtsurfc,pdpsrf,zduc,zdvc, & 1144 zdqc,reffrad ,cpp3D)1102 zdqc,reffrad) 1145 1103 1146 1104 do l=1,nlayer … … 1173 1131 do l = 1, nlayer 1174 1132 masse = (pplev(ig,l) - pplev(ig,l+1))/g 1175 dEtot = dEtot + cpp 3D(ig,l)*masse*zdtc(ig,l)*area(ig)1133 dEtot = dEtot + cpp*masse*zdtc(ig,l)*area(ig) 1176 1134 enddo 1177 1135 dEtots = dEtots + capcal(ig)*zdtsurfc(ig)*area(ig) … … 1231 1189 do l = 1, nlayer 1232 1190 masse = (pplev(ig,l) - pplev(ig,l+1))/g 1233 dEtot = dEtot + cpp 3D(ig,l)*masse*(dtmoist(ig,l)+dtevap(ig,l))*area(ig)1234 madjdE(ig) = madjdE(ig) + cpp 3D(ig,l)*masse*(dtmoist(ig,l)+dtevap(ig,l))1191 dEtot = dEtot + cpp*masse*(dtmoist(ig,l)+dtevap(ig,l))*area(ig) 1192 madjdE(ig) = madjdE(ig) + cpp*masse*(dtmoist(ig,l)+dtevap(ig,l)) 1235 1193 enddo 1236 1194 enddo … … 1296 1254 do l = 1, nlayer 1297 1255 masse = (pplev(ig,l) - pplev(ig,l+1))/g 1298 dEtot = dEtot + cpp 3D(ig,l)*masse*(dtlscale(ig,l)+dtevap(ig,l))*area(ig)1299 lscaledE(ig) = lscaledE(ig) + cpp 3D(ig,l)*masse*(dtlscale(ig,l)+dtevap(ig,l))1256 dEtot = dEtot + cpp*masse*(dtlscale(ig,l)+dtevap(ig,l))*area(ig) 1257 lscaledE(ig) = lscaledE(ig) + cpp*masse*(dtlscale(ig,l)+dtevap(ig,l)) 1300 1258 enddo 1301 1259 enddo … … 1369 1327 do l = 1, nlayer 1370 1328 masse = (pplev(ig,l) - pplev(ig,l+1))/g 1371 dEtot = dEtot + cpp 3D(ig,l)*masse*zdtrain(ig,l)*area(ig)1329 dEtot = dEtot + cpp*masse*zdtrain(ig,l)*area(ig) 1372 1330 enddo 1373 1331 enddo … … 1385 1343 do l = 1, nlayer 1386 1344 masse = (pplev(ig,l) - pplev(ig,l+1))/g 1387 dEtot = dEtot + cpp 3D(ig,l)*masse*zdtrain(ig,l)*area(ig)1345 dEtot = dEtot + cpp*masse*zdtrain(ig,l)*area(ig) 1388 1346 enddo 1389 1347 enddo … … 1670 1628 do l=1,nlayer 1671 1629 fluxdyn(ig)=fluxdyn(ig) - (zdtdyn(ig,l)/ptimestep) & 1672 *(pplev(ig,l)-pplev(ig,l+1))*cpp 3D(ig,l)/g1630 *(pplev(ig,l)-pplev(ig,l+1))*cpp/g 1673 1631 enddo 1674 1632 enddo … … 1760 1718 print*,'SW energy balance SW++ - ASR = ',dEtotSW+dEtotsSW-ASR/totarea,' W m-2' 1761 1719 print*,'LW energy balance LW++ + ***ASR*** = ',dEtotLW+dEtotsLW+ASR/totarea,' W m-2' 1720 print*,'LW energy balance LW++ - ***OLR*** = ',dEtotLW+dEtotsLW+OLR/totarea,' W m-2' 1762 1721 endif 1763 1722 -
trunk/LMDZ.GENERIC/libf/phystd/rcm1d.F
r534 r586 106 106 real logplevs(nlayermx) 107 107 108 ! added by RDW to allow variations in cp with location109 REAL cpp3D(ngridmx,nlayermx) ! specific heat capacity at const. pressure110 REAL rcp3D(ngridmx,nlayermx) ! R / specific heat capacity111 112 108 ! added by BC 113 109 REAL cloudfrac(ngridmx,nlayermx) … … 631 627 c ~~~~~~~~~~~~~~~~~~~~~ 632 628 633 if(nonideal)then 634 635 DO ilayer=1,nlayer 636 call calc_cpp3d(cpp3D(1,ilayer), 637 $ rcp3D(1,ilayer),temp(ilayer),play(ilayer)) 638 ENDDO 639 640 DO ilayer=1,nlayer 641 642 ! if(autozlevs)then 643 ! s(ilayer)=(play(ilayer)/psurf)**rcp3D(1,ilayer) 644 ! else 645 s(ilayer)= 646 & (aps(ilayer)/psurf+bps(ilayer))**rcp3D(1,ilayer) 647 ! endif 648 649 h(ilayer)=cpp3D(1,ilayer)*temp(ilayer)/(pks*s(ilayer)) 650 ENDDO 651 652 else 653 DO ilayer=1,nlayer 629 630 DO ilayer=1,nlayer 654 631 655 632 ! if(autozlevs)then 656 633 ! s(ilayer)=(play(ilayer)/psurf)**rcp 657 634 ! else 658 635 s(ilayer)=(aps(ilayer)/psurf+bps(ilayer))**rcp 659 636 ! endif 660 637 !s(ilayer)=(aps(ilayer)/psurf+bps(ilayer))**rcp 661 662 663 endif 638 h(ilayer)=cpp*temp(ilayer)/(pks*s(ilayer)) 639 ENDDO 640 664 641 ! DO ilayer=1,nlayer 665 642 ! s(ilayer)=(aps(ilayer)/psurf+bps(ilayer))**rcp -
trunk/LMDZ.GENERIC/libf/phystd/vdifc.F
r303 r586 170 170 iice=igcm_h2o_ice ! simply to make the code legible 171 171 ! to be generalised later 172 endif173 174 if(ngridmx.ne.1)then175 if(nonideal)then176 print*,'Nonideal doesnt work yet in 3D!!!'177 call abort178 endif179 172 endif 180 173
Note: See TracChangeset
for help on using the changeset viewer.