Changeset 538 for trunk/LMDZ.GENERIC/libf
- Timestamp:
- Feb 17, 2012, 11:54:16 PM (13 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/calc_cpp_mugaz.F90
r471 r538 4 4 ! Purpose 5 5 ! ------- 6 ! Compute the atmospheric specific heat capacity. 7 ! Compute the atmospheric mean molar mass. 6 ! Check to see if the atmospheric specific heat capacity and 7 ! mean molar mass for the gas mixture defined in gases.def 8 ! corresponds to what we're using. If it doesn't, abort run 9 ! unless option 'check_cpp_match' is set to false in 10 ! callphys.def. 11 ! NOTE: for now, in 1D we do as before. Jeremy, if you're 12 ! re-writing rcm1d you may want to alter this. 8 13 ! 9 14 ! Authors … … 16 21 implicit none 17 22 23 #include "dimensions.h" 24 #include "dimphys.h" 18 25 #include "comcstfi.h" 19 !#include "callkeys.h" 26 #include "callkeys.h" 27 28 real cpp_c 29 real mugaz_c 20 30 21 31 integer igas 22 32 23 cpp =0.024 mugaz =0.033 cpp_c = 0.0 34 mugaz_c = 0.0 25 35 26 36 do igas=1,ngasmx … … 31 41 ! all values at 300 K from Engineering Toolbox 32 42 if(gnom(igas).eq.'CO2')then 33 cpp = cpp+ 0.846*gfrac(igas)34 mugaz = mugaz+ 44.01*gfrac(igas)43 cpp_c = cpp_c + 0.846*gfrac(igas) 44 mugaz_c = mugaz_c + 44.01*gfrac(igas) 35 45 elseif(gnom(igas).eq.'N2_')then 36 cpp = cpp+ 1.040*gfrac(igas)37 mugaz = mugaz+ 28.01*gfrac(igas)46 cpp_c = cpp_c + 1.040*gfrac(igas) 47 mugaz_c = mugaz_c + 28.01*gfrac(igas) 38 48 elseif(gnom(igas).eq.'H2_')then 39 cpp = cpp+ 14.31*gfrac(igas)40 mugaz = mugaz+ 2.01*gfrac(igas)49 cpp_c = cpp_c + 14.31*gfrac(igas) 50 mugaz_c = mugaz_c + 2.01*gfrac(igas) 41 51 elseif(gnom(igas).eq.'H2O')then 42 cpp = cpp+ 1.864*gfrac(igas)43 mugaz = mugaz+ 18.02*gfrac(igas)52 cpp_c = cpp_c + 1.864*gfrac(igas) 53 mugaz_c = mugaz_c + 18.02*gfrac(igas) 44 54 elseif(gnom(igas).eq.'CH4')then 45 cpp = cpp+ 2.226*gfrac(igas)46 mugaz = mugaz+ 16.04*gfrac(igas)55 cpp_c = cpp_c + 2.226*gfrac(igas) 56 mugaz_c = mugaz_c + 16.04*gfrac(igas) 47 57 elseif(gnom(igas).eq.'NH3')then 48 cpp = cpp+ 2.175*gfrac(igas)49 mugaz = mugaz+ 17.03*gfrac(igas)58 cpp_c = cpp_c + 2.175*gfrac(igas) 59 mugaz_c = mugaz_c + 17.03*gfrac(igas) 50 60 print*,'WARNING, cpp for NH3 may be for liquid' 51 61 else … … 57 67 enddo 58 68 59 cpp =1000.0*cpp69 cpp_c = 1000.0*cpp_c 60 70 61 print*,'Cp in calc_cpp_mugaz is ',cpp,'J kg^-1 K^-1' 62 print*,'Mg in calc_cpp_mugaz is ',mugaz,'amu' 71 print*,'Cp in calc_cpp_mugaz is ',cpp_c,'J kg^-1 K^-1' 72 print*,'Mg in calc_cpp_mugaz is ',mugaz_c,'amu' 73 print*,'Predefined Cp in physics is ',cpp,'J kg^-1 K^-1' 74 print*,'Predefined Mg in physics is ',mugaz,'amu' 63 75 64 R = 8.314511E+0 *1000.E+0/mugaz 65 rcp = R/cpp 76 if(ngridmx.eq.1)then 77 print*,'Automatically setting cpp & mugaz to calculated values in calc_cpp_mugaz' 78 cpp = cpp_c 79 mugaz = mugaz_c 80 R = 8.314511E+0 *1000.E+0/mugaz 81 rcp = R/cpp 82 elseif((cpp.ne.cpp_c) .or. (mugaz.ne.mugaz_c))then 83 if(check_cpp_match)then 84 print*,'Values do not match!' 85 print*,'Either adjust cpp / mugaz via newstart to calculated values,' 86 print*,'or set check_cpp_match to .false. in callphys.def.' 87 stop 88 endif 89 endif 66 90 67 91 return -
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r526 r538 4 4 dtlw,dtsw,fluxsurf_lw, & 5 5 fluxsurf_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn, & 6 6 OLR_nu,OSR_nu, & 7 7 reffrad,tau_col,cloudfrac,totcloudfrac, & 8 8 clearsky,firstcall,lastcall) … … 195 195 qsiaer(:,:,:)=0.0 196 196 giaer(:,:,:) =0.0 197 197 198 198 199 if(firstcall) then … … 264 265 stop 265 266 endif 266 267 268 267 268 OLR_nu=0. 269 OSR_nu=0. 269 270 270 271 firstcall=.false. … … 326 327 327 328 do ig=1,ngrid 328 if(tracer.and.igcm_co2_ice.gt.0)then 329 if(tracer)then 330 !if(tracer.and.igcm_co2_ice.gt.0)then 331 332 if(igcm_co2_ice.lt.1)then 333 print*,'Tracers but no CO2 ice still seems to be a problem...' 334 print*,'Aborting in callcorrk.' 335 stop 336 endif 337 329 338 reffrad(ig,l,1) = CBRT( 3*pq(ig,l,igcm_co2_ice)/ & 330 339 (4*Nmix_co2*pi*rho_co2) ) … … 556 565 end do 557 566 qvar(1)=qvar(2) 558 ! qvar(2*nlayermx+1)=qsurf(ig,i_var) !JL12 not very good to compare kg/kg and kg/m2???559 567 560 568 elseif(varfixed)then … … 585 593 Ttemp = tsurf(ig) 586 594 call watersat(Ttemp,ptemp,qsat) 587 588 595 589 596 !qvar(2*nlayermx+1)=qsat ! fully saturated everywhere 590 597 qvar(2*nlayermx+1)= RH * qsat ! ~realistic profile (e.g. 80% saturation at ground) 591 592 593 !!!!!!!!!!!!!!!!!!!!!!!! JL: for completely constant water profile uncoment the following line 594 ! qvar=0.005 598 !qvar=0.005 ! completely constant profile (JL) 595 599 596 600 else … … 600 604 end if 601 605 606 if(.not.kastprof)then 602 607 ! IMPORTANT: Now convert from kg/kg to mol/mol 603 608 do k=1,L_LEVELS 604 609 qvar(k) = qvar(k)/epsi 605 610 end do 611 end if 606 612 607 613 !----------------------------------------------------------------------- … … 634 640 635 641 print*,'Recalculating qvar with VARIABLE epsi for kastprof' 636 i_var=igcm_h2o_vap 642 print*,'Assumes that the variable gas is H2O!!!' 643 print*,'Assumes that there is only one tracer' 644 !i_var=igcm_h2o_vap 645 i_var=1 646 if(nqmx.gt.1)then 647 print*,'Need 1 tracer only to run kcm1d.e' 648 stop 649 endif 637 650 do l=1,nlayer 638 651 vtmp(l)=pq(ig,l,i_var)*muvar(ig,l+1)/mH2O … … 644 657 end do 645 658 qvar(1)=qvar(2) 646 qvar(2*nlayermx+1)=qsurf(ig,i_var)*muvar(ig,1)/mH2O 659 660 print*,'Warning: reducing qvar in callcorrk.' 661 print*,'Temperature profile no longer consistent ', & 662 'with saturated H2O.' 663 do k=1,L_LEVELS 664 qvar(k) = qvar(k)*satval 665 end do 647 666 648 667 endif … … 766 785 qxiaer,qsiaer,giaer,cosbi,wbari,tauaero,tmid,pmid, & 767 786 taugsurfi,qvar,muvarrad) 768 787 769 788 call sfluxi(plevrad,tlevrad,dtaui,taucumi,ubari,albi, & 770 789 wnoi,dwni,cosbi,wbari,gweight,nfluxtopi,nfluxtopi_nu, & … … 859 878 close(116) 860 879 880 ! I am useful, please don`t remove me! 861 881 ! if(specOLR)then 862 882 ! open(117,file='OLRnu.out') -
trunk/LMDZ.GENERIC/libf/phystd/callkeys.h
r526 r538 20 20 & , Tstrat & 21 21 & , newtonian & 22 & , check_cpp_match & 22 23 & , tau_relax & 23 24 & , testradtimes & … … 61 62 logical kastprof 62 63 logical newtonian 64 logical check_cpp_match 63 65 logical testradtimes 64 66 logical rayleigh -
trunk/LMDZ.GENERIC/libf/phystd/inifis.F
r526 r538 177 177 write(*,*) " enertest = ",enertest 178 178 179 write(*,*) "Check to see if cpp values used match gases.def ?" 180 check_cpp_match=.true. ! default value 181 call getin("check_cpp_match",check_cpp_match) 182 write(*,*) " check_cpp_match = ",check_cpp_match 183 184 179 185 write(*,*) "call radiative transfer ?" 180 186 callrad=.true. ! default value … … 192 198 call getin("callgasvis",callgasvis) 193 199 write(*,*) " callgasvis = ",callgasvis 194 200 195 201 write(*,*) "call continuum opacities in radiative transfer ?", 196 202 & "(matters only if callrad=T)" 197 Continuum=. false. ! default value203 Continuum=.true. ! default value 198 204 call getin("Continuum",Continuum) 199 205 write(*,*) " Continuum = ",Continuum 200 206 207 201 208 write(*,*) "call turbulent vertical diffusion ?" 202 209 calldifv=.true. ! default value … … 310 317 endif 311 318 312 313 319 write(*,*)"Use Newtonian cooling for radiative transfer?" 314 320 newtonian=.false. … … 506 512 endif 507 513 508 mugaz=0. 509 cpp=0. 514 mugaz=8.314*1000./pr 510 515 call su_gases 511 516 call calc_cpp_mugaz -
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r526 r538 440 440 ! read startfi (initial parameters) 441 441 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 442 print*,'in physiqu i am in phyetat0'443 442 call phyetat0("startfi.nc",0,0,nsoilmx,nq, & 444 443 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf, & … … 712 711 call abort 713 712 endif 714 muvar(:,:)=0.0 ! only used for climate evolution for now 715 716 713 muvar(:,:)=0.0 ! only used for climate evolution studies (kcm1d) for now 714 717 715 ! standard callcorrk 718 716 clearsky=.false. 719 call callcorrk(ngrid,nlayer,pq,nq,qsurf, &717 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 720 718 albedo,emis,mu0,pplev,pplay,pt, & 721 719 tsurf,fract,dist_star,aerosol,cpp3D,muvar, & 722 720 zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw, & 723 721 fluxabs_sw,fluxtop_dn,OLR_nu,OSR_nu, & 724 722 reffrad,tau_col,cloudfrac,totcloudfrac, & 725 723 clearsky,firstcall,lastcall) 726 727 724 728 725 ! Option to call scheme once more for clear regions … … 732 729 !!! (temporary solution in callcorrk: do not deallocate if CLFvarying ...) 733 730 clearsky=.true. 734 call callcorrk(ngrid,nlayer,pq,nq,qsurf, &731 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 735 732 albedo,emis,mu0,pplev,pplay,pt, & 736 733 tsurf,fract,dist_star,aerosol,cpp3D,muvar, & … … 738 735 fluxabs_sw1,fluxtop_dn,OLR_nu1,OSR_nu1, & 739 736 reffrad,tau_col1,cloudfrac,totcloudfrac, & 740 741 737 clearsky,firstcall,lastcall) 738 clearsky = .false. !! just in case. 742 739 743 740 ! Sum the fluxes and heating rates from cloudy/clear cases … … 757 754 enddo 758 755 759 756 do nw=1,L_NSPECTV 760 757 OSR_nu(ig,nw) = ntf*OSR_nu1(ig,nw) + tf*OSR_nu(ig,nw) 761 762 758 enddo 759 do nw=1,L_NSPECTI 763 760 OLR_nu(ig,nw) = ntf*OLR_nu1(ig,nw) + tf*OLR_nu(ig,nw) 764 761 enddo 765 762 766 763 enddo … … 1939 1936 enddo 1940 1937 1941 1942 1943 1938 endif 1944 1939 … … 2097 2092 print*,'WARNING: tau_col=',tau_col(ig) 2098 2093 print*,'at ig=',ig,'in PHYSIQ' 2099 !call abort2100 2094 endif 2101 2095 end do
Note: See TracChangeset
for help on using the changeset viewer.