Changeset 869 for trunk/LMDZ.GENERIC/libf/phystd
- Timestamp:
- Jan 24, 2013, 4:12:48 PM (12 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/calc_cpp_mugaz.F90
r868 r869 39 39 else 40 40 ! all values at 300 K from Engineering Toolbox 41 if( gnom(igas).eq.'CO2')then41 if(igas.eq.igas_CO2)then 42 42 !cpp_c = cpp_c + 0.744*gfrac(igas) ! @ ~210 K (better for Mars conditions) 43 43 cpp_c = cpp_c + 0.846*gfrac(igas) 44 44 mugaz_c = mugaz_c + 44.01*gfrac(igas) 45 elseif( gnom(igas).eq.'N2_')then45 elseif(igas.eq.igas_N2)then 46 46 cpp_c = cpp_c + 1.040*gfrac(igas) 47 47 mugaz_c = mugaz_c + 28.01*gfrac(igas) 48 elseif( gnom(igas).eq.'H2_')then48 elseif(igas.eq.igas_H2)then 49 49 cpp_c = cpp_c + 14.31*gfrac(igas) 50 50 mugaz_c = mugaz_c + 2.01*gfrac(igas) 51 elseif( gnom(igas).eq.'He_')then51 elseif(igas.eq.igas_He)then 52 52 cpp_c = cpp_c + 5.19*gfrac(igas) 53 53 mugaz_c = mugaz_c + 4.003*gfrac(igas) 54 elseif( gnom(igas).eq.'H2O')then54 elseif(igas.eq.igas_H2O)then 55 55 cpp_c = cpp_c + 1.864*gfrac(igas) 56 56 mugaz_c = mugaz_c + 18.02*gfrac(igas) 57 elseif( gnom(igas).eq.'SO2')then57 elseif(igas.eq.igas_SO2)then 58 58 cpp_c = cpp_c + 0.64*gfrac(igas) 59 59 mugaz_c = mugaz_c + 64.066*gfrac(igas) 60 elseif( gnom(igas).eq.'H2S')then60 elseif(igas.eq.igas_H2S)then 61 61 cpp_c = cpp_c + 1.003*gfrac(igas) ! from wikipedia... 62 62 mugaz_c = mugaz_c + 34.08*gfrac(igas) 63 elseif( gnom(igas).eq.'CH4')then63 elseif(igas.eq.igas_CH4)then 64 64 cpp_c = cpp_c + 2.226*gfrac(igas) 65 65 mugaz_c = mugaz_c + 16.04*gfrac(igas) 66 elseif( gnom(igas).eq.'NH3')then66 elseif(igas.eq.igas_NH3)then 67 67 cpp_c = cpp_c + 2.175*gfrac(igas) 68 68 mugaz_c = mugaz_c + 17.03*gfrac(igas) 69 69 print*,'WARNING, cpp for NH3 may be for liquid' 70 elseif( gnom(igas).eq.'2H6')then70 elseif(igas.eq.igas_C2H6)then 71 71 ! C2H6 http://encyclopedia.airliquide.com/Encyclopedia.asp?GasID=28 72 72 cpp_c = cpp_c + 1.763*gfrac(igas) 73 73 mugaz_c = mugaz_c + 30.07*gfrac(igas) 74 elseif( gnom(igas).eq.'2H2')then74 elseif(igas.eq.igas_C2H2)then 75 75 ! C2H2 http://encyclopedia.airliquide.com/Encyclopedia.asp?GasID=1 76 76 cpp_c = cpp_c + 1.575*gfrac(igas) -
trunk/LMDZ.GENERIC/libf/phystd/calc_rayleigh.F90
r861 r869 54 54 do igas=1,ngasmx 55 55 if(igas.eq.vgas)then 56 print*,'Ignoring ', gnom(igas),' in Rayleigh scattering '// &56 print*,'Ignoring ',trim(gnom(igas)),' in Rayleigh scattering '// & 57 57 'as it is variable.' 58 58 elseif(gfrac(igas).lt.5.e-2)then 59 print*,'Ignoring ', gnom(igas),' in Rayleigh scattering '// &59 print*,'Ignoring ',trim(gnom(igas)),' in Rayleigh scattering '// & 60 60 'as its mixing ratio is less than 0.05.' 61 61 ! ignore variable gas in Rayleigh calculation … … 63 63 tauconsti(igas) = 0.0 64 64 else 65 if( gnom(igas).eq.'CO2')then65 if(igas.eq.igas_CO2) then 66 66 tauconsti(igas) = (8.7/g)*1.527*scalep/P0 67 elseif( gnom(igas).eq.'N2_')then67 elseif(igas.eq.igas_N2)then 68 68 tauconsti(igas) = (9.81/g)*8.569E-3*scalep/(P0/93.0) 69 elseif( gnom(igas).eq.'H2O')then69 elseif(igas.eq.igas_H2O)then 70 70 tauconsti(igas) = (10.0/g)*9.22E-3*scalep/101325.0 71 elseif( gnom(igas).eq.'H2_')then71 elseif(igas.eq.igas_H2)then 72 72 tauconsti(igas) = (10.0/g)*0.0241*scalep/101325.0 73 73 !tauconsti(igas) = (10.0/g)*0.0487*scalep/(101325.0) 74 74 ! uses n=1.000132 from Optics, Fourth Edition. 75 75 ! was out by a factor 2! 76 elseif( gnom(igas).eq.'He_')then76 elseif(igas.eq.igas_He)then 77 77 print*,'Helium not ready yet!' 78 78 tauconsti(igas) = 0.0 … … 84 84 85 85 if(gfrac(igas).eq.1.0)then 86 print*,'Rayleigh scattering is for a pure ', gnom(igas),' atmosphere.'86 print*,'Rayleigh scattering is for a pure ',trim(gnom(igas)),' atmosphere.' 87 87 typeknown=.true. 88 88 endif … … 113 113 tauvari(igas) = 0.0 114 114 else 115 if( gnom(igas).eq.'CO2')then115 if(igas.eq.igas_CO2)then 116 116 tauvari(igas) = (1.0+0.013/wl**2)/wl**4 117 elseif( gnom(igas).eq.'N2_')then117 elseif(igas.eq.igas_N2)then 118 118 tauvari(igas) = (1.0+0.0113/wl**2+0.00013/wl**4)/wl**4 119 elseif( gnom(igas).eq.'H2O')then119 elseif(igas.eq.igas_H2O)then 120 120 tauvari(igas) = 1.0/wl**4 ! to be improved... 121 elseif( gnom(igas).eq.'H2_')then121 elseif(igas.eq.igas_H2)then 122 122 tauvari(igas) = 1.0/wl**4 123 elseif( gnom(igas).eq.'He_')then123 elseif(igas.eq.igas_He)then 124 124 print*,'Helium not ready yet!' 125 125 tauvari(igas) = 0.0 -
trunk/LMDZ.GENERIC/libf/phystd/condense_cloud.F90
r858 r869 143 143 144 144 integer igas 145 integer,save :: igasco2=0146 character(len=3) :: gasname147 145 148 146 real ppco2 … … 169 167 enddo 170 168 171 ! find CO2 gas172 do igas=1,ngasmx173 gasname=gnom(igas)174 ! gasname=noms(igas) ! was a bug175 if (gasname.eq."CO2") then176 igasco2=igas177 endif178 enddo179 180 169 write(*,*) "condense_cloud: i_co2ice=",i_co2ice 181 170 … … 265 254 DO l=1,nlayer 266 255 DO ig=1,ngrid 267 ppco2=gfrac(igas co2)*pplay(ig,l)256 ppco2=gfrac(igas_CO2)*pplay(ig,l) 268 257 call get_tcond_co2(ppco2,ztcond(ig,l)) 269 258 call get_tnuc_co2(ppco2,ztnuc(ig,l)) … … 397 386 ! forecast of ground temperature ztsrf and frost temperature ztcondsol 398 387 DO ig=1,ngrid 399 ppco2=gfrac(igas co2)*pplay(ig,1)388 ppco2=gfrac(igas_CO2)*pplay(ig,1) 400 389 call get_tcond_co2(ppco2,ztcondsol(ig)) 401 390 -
trunk/LMDZ.GENERIC/libf/phystd/cp_neutral.F90
r716 r869 9 9 10 10 11 ! this function has been disabled in gradients_kcm.F90 because it do nt11 ! this function has been disabled in gradients_kcm.F90 because it doesnt 12 12 ! work if you have gaseous mixtures. need to decide whether to generalise 13 13 ! it or simply remove entirely... … … 16 16 !cp_neutral = (22.26+5.981d-2*T-3.501d-5*T**2+7.469d-9*T**3)/m_n 17 17 18 if( gnom(1).eq.'N2_')then18 if(trim(gnom(1)).eq.'N2_')then 19 19 cp_neutral = 1040.0 20 elseif( gnom(1).eq.'H2_')then20 elseif(trim(gnom(1)).eq.'H2_')then 21 21 cp_neutral = 14310.0 22 22 else -
trunk/LMDZ.GENERIC/libf/phystd/gases_h.F90
r868 r869 14 14 integer :: ngasmx 15 15 integer :: vgas 16 character* 3,allocatable,DIMENSION(:) :: gnom ! name of the gas16 character*20,allocatable,DIMENSION(:) :: gnom ! name of the gas 17 17 real,allocatable,DIMENSION(:) :: gfrac 18 18 … … 29 29 integer :: igas_CH4 30 30 integer :: igas_NH3 31 integer :: igas_ 2H232 integer :: igas_ 2H631 integer :: igas_C2H2 32 integer :: igas_C2H6 33 33 34 34 end module gases_h -
trunk/LMDZ.GENERIC/libf/phystd/gradients_kcm.F90
r716 r869 46 46 endif 47 47 48 if( gnom(ngasmx).eq.'H2O')then48 if(trim(gnom(ngasmx)).eq.'H2O')then 49 49 50 50 call psat_H2O(T-2d-1,psat_minus) … … 72 72 endif 73 73 74 elseif( gnom(ngasmx).eq.'NH3')then74 elseif(trim(gnom(ngasmx)).eq.'NH3')then 75 75 76 76 call psat_NH3(T-2d-1,psat_minus) … … 109 109 110 110 cp_v=0.0 111 if( gnom(ngasmx).eq.'H2O')then111 if(trim(gnom(ngasmx)).eq.'H2O')then 112 112 cp_v = (32.24+1.923d-3*T+1.055d-5*T**2-3.511d-9*T**3)/m_v 113 elseif( gnom(ngasmx).eq.'NH3')then113 elseif(trim(gnom(ngasmx)).eq.'NH3')then 114 114 cp_v = 2.058d3 115 elseif( gnom(ngasmx).eq.'CH4')then115 elseif(trim(gnom(ngasmx)).eq.'CH4')then 116 116 cp_v = 2.226d3 117 117 endif -
trunk/LMDZ.GENERIC/libf/phystd/kcmprof_fn.F90
r716 r869 99 99 m_v = 1.0 100 100 tcrit = 1000.0 101 elseif( gnom(vgas).eq.'H2O')then101 elseif(trim(gnom(vgas)).eq.'H2O')then 102 102 m_v = dble(mH2O/1000.) 103 103 tcrit = 6.47d2 104 elseif( gnom(vgas).eq.'NH3')then104 elseif(trim(gnom(vgas)).eq.'NH3')then 105 105 m_v = 17.031/1000. 106 106 tcrit = 4.06d2 107 elseif( gnom(vgas).eq.'CH4')then107 elseif(trim(gnom(vgas)).eq.'CH4')then 108 108 m_v = 16.04/1000. 109 109 tcrit = 1.91d2 … … 120 120 psat_v = psat_max 121 121 if(vgas.gt.0)then 122 if( gnom(vgas).eq.'H2O')then122 if(trim(gnom(vgas)).eq.'H2O')then 123 123 call Psat_H2O(tsurf,psat_v) 124 elseif( gnom(vgas).eq.'NH3')then124 elseif(trim(gnom(vgas)).eq.'NH3')then 125 125 call Psat_NH3(tsurf,psat_v) 126 126 endif … … 229 229 230 230 if(vgas.gt.0)then 231 if( gnom(vgas).eq.'H2O')then231 if(trim(gnom(vgas)).eq.'H2O')then 232 232 call Psat_H2O(T(ilay+1),psat_v) 233 elseif( gnom(vgas).eq.'NH3')then233 elseif(trim(gnom(vgas)).eq.'NH3')then 234 234 call Psat_NH3(T(ilay+1),psat_v) 235 235 endif … … 257 257 258 258 if(vgas.gt.0)then 259 if( gnom(vgas).eq.'H2O')then259 if(trim(gnom(vgas)).eq.'H2O')then 260 260 call Psat_H2O(T(ilay+1),psat_v) 261 elseif( gnom(vgas).eq.'NH3')then261 elseif(trim(gnom(vgas)).eq.'NH3')then 262 262 call Psat_NH3(T(ilay+1),psat_v) 263 263 endif -
trunk/LMDZ.GENERIC/libf/phystd/su_gases.F90
r868 r869 69 69 count=0 70 70 do igas=1,ngasmx 71 if ( gnom(igas).eq."H2_") then71 if (trim(gnom(igas)).eq."H2_" .or. trim(gnom(igas)).eq."H2") then 72 72 igas_H2=igas 73 73 count=count+1 74 elseif ( gnom(igas).eq."He_") then74 elseif (trim(gnom(igas)).eq."He_" .or. trim(gnom(igas)).eq."He") then 75 75 igas_He=igas 76 76 count=count+1 77 elseif ( gnom(igas).eq."H2O") then77 elseif (trim(gnom(igas)).eq."H2O") then 78 78 igas_H2O=igas 79 79 count=count+1 80 elseif ( gnom(igas).eq."CO2") then80 elseif (trim(gnom(igas)).eq."CO2") then 81 81 igas_CO2=igas 82 82 count=count+1 83 elseif ( gnom(igas).eq."CO_") then83 elseif (trim(gnom(igas)).eq."CO_" .or. trim(gnom(igas)).eq."CO") then 84 84 igas_CO=igas 85 85 count=count+1 86 elseif ( gnom(igas).eq."N2_") then86 elseif (trim(gnom(igas)).eq."N2_" .or. trim(gnom(igas)).eq."N2") then 87 87 igas_N2=igas 88 88 count=count+1 89 elseif ( gnom(igas).eq."O2_") then89 elseif (trim(gnom(igas)).eq."O2_" .or. trim(gnom(igas)).eq."O2") then 90 90 igas_O2=igas 91 91 count=count+1 92 elseif ( gnom(igas).eq."SO2") then92 elseif (trim(gnom(igas)).eq."SO2") then 93 93 igas_SO2=igas 94 94 count=count+1 95 elseif ( gnom(igas).eq."H2S") then95 elseif (trim(gnom(igas)).eq."H2S") then 96 96 igas_H2S=igas 97 97 count=count+1 98 elseif ( gnom(igas).eq."CH4") then98 elseif (trim(gnom(igas)).eq."CH4") then 99 99 igas_CH4=igas 100 100 count=count+1 101 elseif ( gnom(igas).eq."NH3") then101 elseif (trim(gnom(igas)).eq."NH3") then 102 102 igas_NH3=igas 103 103 count=count+1 104 elseif (gnom(igas).eq."2H6") then 105 ! this is ethane 106 igas_2H6=igas 104 elseif (trim(gnom(igas)).eq."C2H6") then 105 igas_C2H6=igas 107 106 count=count+1 108 elseif (gnom(igas).eq."2H2") then 109 ! this is acetylene 110 igas_2H2=igas 107 elseif (trim(gnom(igas)).eq."C2H2") then 108 igas_C2H2=igas 111 109 count=count+1 112 110 endif -
trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90
r868 r869 46 46 ! ALLOCATABLE ARRAYS -- AS 12/2011 47 47 REAL*8, DIMENSION(:,:,:,:,:), ALLOCATABLE :: gasi8, gasv8 48 character* 3,allocatable,DIMENSION(:) :: gastype ! for check with gnom48 character*20,allocatable,DIMENSION(:) :: gastype ! for check with gnom 49 49 50 50 real*8 x, xi(4), yi(4), ans, p … … 119 119 ! Check that gastype and gnom match 120 120 do igas=1,ngas 121 print*,'Gas ',igas,' is ', gnom(igas)122 if (gnom(igas).ne.gastype(igas))then123 print*,'Name of a gas in radiative transfer data (', gastype(igas),') does not ', &124 'match that in gases.def (', gnom(igas),'), exiting. You should compare ', &121 print*,'Gas ',igas,' is ',trim(gnom(igas)) 122 if (trim(gnom(igas)).ne.trim(gastype(igas))) then 123 print*,'Name of a gas in radiative transfer data (',trim(gastype(igas)),') does not ', & 124 'match that in gases.def (',trim(gnom(igas)),'), exiting. You should compare ', & 125 125 'gases.def with Q.dat in your radiative transfer directory.' 126 !call abort126 call abort 127 127 endif 128 128 enddo … … 589 589 do igas=1,ngasmx 590 590 591 if (gnom(igas).eq.'N2_')then591 if (igas .eq. igas_N2) then 592 592 593 593 call interpolateN2N2(100.D+0,250.D+0,17500.D+0,testcont,.true.) 594 594 595 elseif (gnom(igas).eq.'H2_')then595 elseif (igas .eq. igas_H2) then 596 596 597 597 ! first do self-induced absorption … … 599 599 ! then cross-interactions with other gases 600 600 do jgas=1,ngasmx 601 if (gnom(jgas).eq.'N2_')then601 if (jgas .eq. igas_N2) then 602 602 call interpolateN2H2(592.D+0,278.15D+0,200000.D+0,10000.D+0,testcont,.true.) 603 elseif (gnom(jgas).eq.'He_')then603 elseif (jgas .eq. igas_He) then 604 604 call interpolateH2He(500.D+0,250.D+0,200000.D+0,10000.D+0,testcont,.true.) 605 605 endif 606 606 enddo 607 607 608 elseif (gnom(igas).eq.'H2O')then608 elseif (igas .eq. igas_H2O) then 609 609 610 610 ! H2O is special
Note: See TracChangeset
for help on using the changeset viewer.