Changeset 366 for trunk/LMDZ.GENERIC
- Timestamp:
- Nov 9, 2011, 3:47:17 PM (13 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r305 r366 35 35 #include "callkeys.h" 36 36 #include "tracer.h" 37 #include "gases.h" 37 38 38 39 !----------------------------------------------------------------------- … … 104 105 REAL*8 tauaero(L_LEVELS+1,naerkind) 105 106 REAL*8 nfluxtopv,nfluxtopi,nfluxtop 106 real*8 NFLUXTOPV_nu(L_NSPECTV)107 real*8 NFLUXTOPI_nu(L_NSPECTI)107 real*8 nfluxoutv_nu(L_NSPECTV) ! outgoing band-resolved VI flux at TOA (W/m2) 108 real*8 nfluxtopi_nu(L_NSPECTI) ! net band-resolved IR flux at TOA (W/m2) 108 109 real*8 fluxupi_nu(L_NLAYRAD,L_NSPECTI) ! for 1D diagnostic 109 110 REAL*8 fmneti(L_NLAYRAD),fmnetv(L_NLAYRAD) … … 163 164 logical OLRz 164 165 real OLR_nu(ngrid,L_NSPECTI) 165 real GSR_nu(ngrid,L_NSPECTV) 166 !real GSR_nu(ngrid,L_NSPECTV) 167 real OSR_nu(ngrid,L_NSPECTV) 166 168 real*8 NFLUXGNDV_nu(L_NSPECTV) 167 169 … … 184 186 external CBRT 185 187 186 ! included by RW for run way greenhouse 1D study188 ! included by RW for runaway greenhouse 1D study 187 189 real muvar(ngridmx,nlayermx+1) 188 190 real vtmp(nlayermx) … … 589 591 end do 590 592 593 594 595 !----------------------------------------------------------------------- 596 ! kcm mode only 591 597 if(kastprof)then 598 599 DO l=1,nlayer 600 muvarrad(2*l) = mugaz 601 muvarrad(2*l+1) = mugaz 602 END DO 603 604 do k=1,L_LEVELS 605 qvar(k) = 0.0 606 end do 607 print*,'ASSUMING qH2O=0 EVERYWHERE IN CALLCORRK!' 608 endif 609 610 611 if(kastprof.and.(ngasmx.gt.1))then 592 612 593 613 DO l=1,nlayer … … 613 633 qvar(2*nlayermx+1)=qsurf(ig,i_var)*muvar(ig,1)/mH2O 614 634 615 !do k=1,L_LEVELS 616 ! qvar(k) = 1.0 617 !end do 618 !print*,'ASSUMING qH2O=1 EVERYWHERE IN CALLCORRK!!' 619 620 endif 635 636 endif 637 621 638 622 639 ! Keep values inside limits for which we have radiative transfer coefficients … … 720 737 721 738 call sfluxv(dtauv,tauv,taucumv,albv,dwnv,wbarv,cosbv, & 722 acosz,stel_fract,gweight,nfluxtopv,nfluxgndv_nu, & 739 acosz,stel_fract,gweight, & 740 nfluxtopv,nfluxoutv_nu,nfluxgndv_nu, & 741 !acosz,stel_fract,gweight,nfluxtopv,nfluxgndv_nu, & 723 742 fmnetv,fluxupv,fluxdnv,fzerov,taugsurf) 724 743 725 744 else ! during the night, fluxes = 0 726 nfluxtopv=0.0 745 nfluxtopv = 0.0 746 nfluxoutv_nu(:) = 0.0 747 nfluxgndv_nu(:) = 0.0 727 748 do l=1,L_NLAYRAD 728 749 fmnetv(l)=0.0 … … 775 796 end do 776 797 do nw=1,L_NSPECTV 777 GSR_nu(ig,nw)=nfluxgndv_nu(nw) 798 !GSR_nu(ig,nw)=nfluxgndv_nu(nw) 799 OSR_nu(ig,nw)=nfluxoutv_nu(nw) 778 800 end do 779 801 endif … … 824 846 if(specOLR)then 825 847 if(ngrid.ne.1)then 826 call writediagspecIR(ngrid,"OLR3D","OLR(lon,lat,band)","W m^-2",3,OLR_nu)827 call writediagspecVI(ngrid,"GSR3D","GSR(lon,lat,band)","W m^-2",3,GSR_nu)848 !call writediagspecIR(ngrid,"OLR3D","OLR(lon,lat,band)","W m^-2",3,OLR_nu) 849 !call writediagspecVI(ngrid,"OSR3D","OSR(lon,lat,band)","W m^-2",3,OSR_nu) 828 850 endif 829 851 endif … … 845 867 close(117) 846 868 847 open(127,file=' GSRnu.out')869 open(127,file='OSRnu.out') 848 870 do nw=1,L_NSPECTV 849 write(127,*) GSR_nu(1,nw)871 write(127,*) OSR_nu(1,nw) 850 872 enddo 851 873 close(127) -
trunk/LMDZ.GENERIC/libf/phystd/gradients_kcm.F90
r305 r366 42 42 Pn = rho_n*T*rmn 43 43 44 if(gnom(2).eq.'H2O')then 44 if(ngasmx.eq.1)then 45 print*,'Cannot have moist adiabat with one gas...' 46 stop 47 endif 48 49 if(gnom(ngasmx).eq.'H2O')then 45 50 46 51 call psat_H2O(T-2d-1,psat_minus) … … 68 73 endif 69 74 70 elseif(gnom( 2).eq.'NH3')then75 elseif(gnom(ngasmx).eq.'NH3')then 71 76 72 77 call psat_NH3(T-2d-1,psat_minus) … … 104 109 case(0) ! dry 105 110 106 if(gnom(2).eq.'H2O')then 111 cp_v=0.0 112 if(gnom(ngasmx).eq.'H2O')then 107 113 cp_v = (32.24+1.923d-3*T+1.055d-5*T**2-3.511d-9*T**3)/m_v 108 elseif(gnom( 2).eq.'NH3')then114 elseif(gnom(ngasmx).eq.'NH3')then 109 115 cp_v = 2.058d3 110 elseif(gnom( 2).eq.'CH4')then116 elseif(gnom(ngasmx).eq.'CH4')then 111 117 cp_v = 2.226d3 112 118 endif -
trunk/LMDZ.GENERIC/libf/phystd/kcm1d.F90
r305 r366 162 162 call su_gases 163 163 call calc_cpp_mugaz 164 164 165 165 166 call inifis(1,llm,0,86400.0,1.0,0.0,0.0,1.0,rad,g,r,cpp) … … 192 193 read(90,*,iostat=ierr) tnom(iq) 193 194 if (ierr.ne.0) then 194 write(*,*) ' rcm1d: error reading tracer names...'195 write(*,*) 'kcm1d: error reading tracer names...' 195 196 stop 196 197 endif 197 198 enddo !of do iq=1,nq 198 199 endif 199 endif200 !endif 200 201 201 202 call initracer() 203 204 endif 205 202 206 203 207 do iq=1,nqmx … … 215 219 216 220 iter = 1 217 Tstrat = 200.0221 Tstrat = 60.0 218 222 dTstrat = 1000.0 219 223 … … 227 231 call kcmprof_fn(psurf,qsurf(1),tsurf, & 228 232 tstrat,play,plev,zlay,temp,q(:,1),muvar(1)) 229 230 231 !if(1.eq.2)then232 233 233 234 ! Run radiative transfer … … 242 243 print*,'Tstrat = ',Tstrat 243 244 dTstrat = Tstrat 244 Tstrat = (fluxabs_sw/(2*sigma))**0.25 ! skin temperature (gray approx.) 245 !Tstrat = Tsurf*(0.2786*(psurf/100000.)**(-1.123))**0.25 246 ! skin temperature (gray approx.) using analytic pure H2 expression 247 !Tstrat = (fluxabs_sw/(2*sigma))**0.25 ! skin temperature (gray approx.) 248 Tstrat = (fluxtop_lw/(2*sigma))**0.25 ! skin temperature (gray approx.) 245 249 dTstrat = dTstrat-Tstrat 246 247 !endif248 249 !dTstrat = 0250 250 251 251 if(abs(dTstrat).lt.1.0)then … … 264 264 265 265 ! Calculate total atmospheric energy 266 call calcenergy_kcm(tsurf,temp,play,plev,qsurf,& 267 q(:,1),muvar,Eatmtot) 266 Eatmtot=0.0 267 ! call calcenergy_kcm(tsurf,temp,play,plev,qsurf,& 268 ! q(:,1),muvar,Eatmtot) 268 269 269 270 ! ------------------------ -
trunk/LMDZ.GENERIC/libf/phystd/kcmprof_fn.F90
r305 r366 41 41 double precision Ptop, dlogp, Psat_max 42 42 parameter (Ptop=1.0) ! Pressure at TOA [Pa] 43 parameter (Psat_max=5000.0) ! Maximum vapour pressure [Pa] 43 !parameter (Psat_max=100000.0) ! Maximum vapour pressure [Pa] 44 parameter (Psat_max=0.0) ! set to zero for dry calculations 44 45 45 46 double precision T(1:nlay) ! temperature [K] … … 83 84 ! modify/generalise later?? 84 85 85 if(gnom(2).eq.'H2O')then 86 if(ngasmx.gt.2)then 87 print*,'Only two species possible at present' 88 stop 89 elseif(ngasmx.eq.1)then 90 if(psat_max.gt.0.0)then 91 print*,'Must have Psat_max=0 if no variable species' 92 stop 93 endif 94 print*, 'Assuming pure atmosphere' 95 m_v = 1.0 96 tcrit = 1000.0 97 elseif(gnom(ngasmx).eq.'H2O')then 86 98 m_v = dble(mH2O/1000.) 87 99 tcrit = 6.47d2 88 elseif(gnom( 2).eq.'NH3')then100 elseif(gnom(ngasmx).eq.'NH3')then 89 101 m_v = 17.031/1000. 90 102 tcrit = 4.06d2 91 elseif(gnom( 2).eq.'CH4')then103 elseif(gnom(ngasmx).eq.'CH4')then 92 104 m_v = 16.04/1000. 93 105 tcrit = 1.91d2 … … 113 125 !i! endif 114 126 115 if(gnom(2).eq.'H2O')then 127 128 psat_v=psat_max 129 if(gnom(ngasmx).eq.'H2O')then 116 130 call Psat_H2O(tsurf,psat_v) 117 elseif(gnom( 2).eq.'NH3')then131 elseif(gnom(ngasmx).eq.'NH3')then 118 132 call Psat_NH3(tsurf,psat_v) 119 133 endif 120 134 121 ! Moist adiabat unless greater than psat_max135 ! Moist adiabat unless greater than or equal to psat_max 122 136 if(psat_v*1d6.lt.psat_max)then 123 137 Psurf_v = Psat_v*1d6 … … 141 155 endif 142 156 157 158 143 159 ! define fine pressure grid 144 160 psurf_rcm = real(Psurf_n+Psurf_v) … … 211 227 212 228 ! test for moist adiabat at next level 213 if(gnom(2).eq.'H2O')then 229 psat_v=psat_max 230 if(gnom(ngasmx).eq.'H2O')then 214 231 call Psat_H2O(T(ilay+1),psat_v) 215 elseif(gnom( 2).eq.'NH3')then232 elseif(gnom(ngasmx).eq.'NH3')then 216 233 call Psat_NH3(T(ilay+1),psat_v) 217 234 endif … … 234 251 235 252 if(profil_flag(ilay) .eq. 1)then 236 237 if(gnom(2).eq.'H2O')then 253 254 psat_v=psat_max 255 if(gnom(ngasmx).eq.'H2O')then 238 256 call Psat_H2O(T(ilay+1),psat_v) 239 elseif(gnom( 2).eq.'NH3')then257 elseif(gnom(ngasmx).eq.'NH3')then 240 258 call Psat_NH3(T(ilay+1),psat_v) 241 259 endif -
trunk/LMDZ.GENERIC/libf/phystd/optcv.F90
r305 r366 157 157 DCONT = DCONT*dz(k) 158 158 159 160 161 159 if((.not.callgasvis))then 160 DCONT=0.0 161 endif 162 162 163 163 -
trunk/LMDZ.GENERIC/libf/phystd/sfluxv.F
r253 r366 1 1 SUBROUTINE SFLUXV(DTAUV,TAUV,TAUCUMV,RSFV,DWNV,WBARV,COSBV, 2 * UBAR0,STEL,GWEIGHT,NFLUXTOPV,NFLUXGNDV_nu, 2 * UBAR0,STEL,GWEIGHT,NFLUXTOPV,NFLUXOUTV_nu, 3 * NFLUXGNDV_nu, 3 4 * FMNETV,FLUXUPV,FLUXDNV,FZEROV,taugsurf) 4 5 … … 18 19 real*8 FLUXUPV(L_NLAYRAD), FLUXDNV(L_NLAYRAD) 19 20 real*8 NFLUXTOPV, FLUXUP, FLUXDN 20 real*8 NFLUX TOPV_nu(L_NSPECTV)21 real*8 NFLUXOUTV_nu(L_NSPECTV) 21 22 real*8 NFLUXGNDV_nu(L_NSPECTV) 22 23 real*8 GWEIGHT(L_NGAUSS) … … 38 39 39 40 DO NW=1,L_NSPECTV 40 NFLUX TOPV_nu(NW)=0.041 NFLUXOUTV_nu(NW)=0.0 41 42 NFLUXGNDV_nu(NW)=0.0 42 43 END DO … … 108 109 END DO 109 110 110 c and same thing by spectral band... (RDW) 111 NFLUXTOPV_nu(NW) = NFLUXTOPV_nu(NW) 112 * +(FLUXUP-FLUXDN)*GWEIGHT(NG)* 113 * (1.0-FZEROV(NW)) 111 c band-resolved flux leaving TOA (RDW) 112 NFLUXOUTV_nu(NW) = NFLUXOUTV_nu(NW) 113 * +FLUXUP*GWEIGHT(NG)*(1.0-FZEROV(NW)) 114 114 115 116 c flux at gnd (RDW) 115 c band-resolved flux at ground (RDW) 117 116 NFLUXGNDV_nu(NW) = NFLUXGNDV_nu(NW) 118 117 * +FMDV(L_NLAYRAD)*GWEIGHT(NG)*(1.0-FZEROV(NW)) … … 163 162 END DO 164 163 165 c and same thing by spectral band...(RDW)166 NFLUX TOPV_nu(NW) = NFLUXTOPV_nu(NW)167 * + (FLUXUP-FLUXDN)*FZERO164 c band-resolved flux leaving TOA (RDW) 165 NFLUXOUTV_nu(NW) = NFLUXOUTV_nu(NW) 166 * +FLUXUP*FZERO 168 167 169 c flux at gnd (RDW)168 c band-resolved flux at ground (RDW) 170 169 NFLUXGNDV_nu(NW) = NFLUXGNDV_nu(NW)+FMDV(L_NLAYRAD)*FZERO 171 170
Note: See TracChangeset
for help on using the changeset viewer.