Changeset 4489 for LMDZ6/trunk/libf/phylmd/ecrad/radiation_gas.F90
- Timestamp:
- Mar 31, 2023, 8:42:57 PM (15 months ago)
- Location:
- LMDZ6/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk
- Property svn:mergeinfo changed
/LMDZ6/branches/LMDZ_ECRad (added) merged: 4175,4177-4183,4188,4192,4200-4203,4355,4366,4387-4388,4390,4444,4482,4486,4488
- Property svn:mergeinfo changed
-
LMDZ6/trunk/libf/phylmd/ecrad/radiation_gas.F90
r3908 r4489 19 19 20 20 use parkind1, only : jprb 21 use radiation_gas_constants 21 22 22 23 implicit none 23 24 public 24 25 ! Gas codes; these indices match those of RRTM-LW up to 726 integer, parameter :: IGasNotPresent = 027 integer, parameter :: IH2O = 128 integer, parameter :: ICO2 = 229 integer, parameter :: IO3 = 330 integer, parameter :: IN2O = 431 integer, parameter :: ICO = 532 integer, parameter :: ICH4 = 633 integer, parameter :: IO2 = 734 integer, parameter :: ICFC11 = 835 integer, parameter :: ICFC12 = 936 integer, parameter :: IHCFC22= 1037 integer, parameter :: ICCl4 = 1138 integer, parameter :: INO2 = 1239 integer, parameter :: NMaxGases = 1240 41 ! Molar masses (g mol-1) of dry air and the various gases above42 real(jprb), parameter :: IAirMolarMass = 28.97043 real(jprb), parameter, dimension(0:NMaxGases) :: IGasMolarMass = (/ &44 & 0.0_jprb, & ! Gas not present45 & 18.0152833_jprb, & ! H2O46 & 44.011_jprb, & ! CO247 & 47.9982_jprb, & ! O348 & 44.013_jprb, & ! N2O49 & 28.0101_jprb, & ! CO50 & 16.043_jprb, & ! CH451 & 31.9988_jprb, & ! O252 & 137.3686_jprb, & ! CFC1153 & 120.914_jprb, & ! CFC1254 & 86.469_jprb, & ! HCFC2255 & 153.823_jprb, & ! CCl456 & 46.0055_jprb /) ! NO257 58 ! The corresponding names of the gases in upper and lower case, used59 ! for reading variables from the input file60 character*6, dimension(NMaxGases), parameter :: GasName &61 & = (/'H2O ','CO2 ','O3 ','N2O ','CO ','CH4 ', &62 & 'O2 ','CFC11 ','CFC12 ','HCFC22','CCl4 ','NO2 '/)63 character*6, dimension(NMaxGases), parameter :: GasLowerCaseName &64 & = (/'h2o ','co2 ','o3 ','n2o ','co ','ch4 ', &65 & 'o2 ','cfc11 ','cfc12 ','hcfc22','ccl4 ','no2 '/)66 25 67 26 ! Available units … … 121 80 122 81 !--------------------------------------------------------------------- 82 ! Allocate a derived type for holding gas mixing ratios given the 83 ! number of columns and levels 123 84 subroutine allocate_gas(this, ncol, nlev) 124 85 … … 191 152 integer, optional, intent(in) :: istartcol 192 153 193 integer :: i1, i2 154 integer :: i1, i2, jc, jk 155 194 156 195 157 real(jprb) :: hook_handle … … 245 207 this%iunits(igas) = iunits 246 208 this%is_well_mixed(igas) = .false. 247 this%mixing_ratio(i1:i2,:,igas) = mixing_ratio 248 209 210 do jk = 1,this%nlev 211 do jc = i1,i2 212 this%mixing_ratio(jc,jk,igas) = mixing_ratio(jc-i1+1,jk) 213 end do 214 end do 249 215 if (present(scale_factor)) then 250 216 this%scale_factor(igas) = scale_factor … … 276 242 real(jprb) :: hook_handle 277 243 278 integer :: i1, i2 244 integer :: i1, i2, jc, jk 279 245 280 246 if (lhook) call dr_hook('radiation_gas:put_well_mixed',0,hook_handle) … … 326 292 this%iunits(igas) = iunits 327 293 this%is_well_mixed(igas) = .true. 328 this%mixing_ratio(i1:i2,:,igas) = mixing_ratio 329 294 295 do jk = 1,this%nlev 296 do jc = i1,i2 297 this%mixing_ratio(jc,jk,igas) = mixing_ratio 298 end do 299 end do 330 300 if (present(scale_factor)) then 331 301 this%scale_factor(igas) = scale_factor … … 344 314 ! immediately, but changes the scale factor for the specified gas, 345 315 ! ready to be used in set_units_gas. 346 347 316 subroutine scale_gas(this, igas, scale_factor, lverbose) 348 317 … … 411 380 if (iunits == IMassMixingRatio & 412 381 & .and. this%iunits(igas) == IVolumeMixingRatio) then 413 sf = sf * IGasMolarMass(igas) / IAirMolarMass382 sf = sf * GasMolarMass(igas) / AirMolarMass 414 383 else if (iunits == IVolumeMixingRatio & 415 384 & .and. this%iunits(igas) == IMassMixingRatio) then 416 sf = sf * IAirMolarMass / IGasMolarMass(igas)385 sf = sf * AirMolarMass / GasMolarMass(igas) 417 386 end if 418 387 sf = sf * this%scale_factor(igas) … … 538 507 if (iunits == IMassMixingRatio & 539 508 & .and. this%iunits(igas) == IVolumeMixingRatio) then 540 sf = sf * IGasMolarMass(igas) / IAirMolarMass509 sf = sf * GasMolarMass(igas) / AirMolarMass 541 510 else if (iunits == IVolumeMixingRatio & 542 511 & .and. this%iunits(igas) == IMassMixingRatio) then 543 sf = sf * IAirMolarMass / IGasMolarMass(igas)512 sf = sf * AirMolarMass / GasMolarMass(igas) 544 513 end if 545 514 sf = sf * this%scale_factor(igas) … … 591 560 592 561 use yomhook, only : lhook, dr_hook 593 use radiation_c onfig,only : out_of_bounds_3d562 use radiation_check, only : out_of_bounds_3d 594 563 595 564 class(gas_type), intent(inout) :: this
Note: See TracChangeset
for help on using the changeset viewer.