[1585] | 1 | ! path: $Source$ |
---|
| 2 | ! author: $Author: mike $ |
---|
| 3 | ! revision: $Revision: 11660 $ |
---|
| 4 | ! created: $Date: 2009-05-22 18:20:11 -0400 (Fri, 22 May 2009) $ |
---|
| 5 | |
---|
| 6 | !=============================================================================== |
---|
| 7 | ! rrtmg_read_nc.f90 |
---|
| 8 | ! |
---|
| 9 | ! Description: This program reads all of the RRTM shortwave data from a NetCDF |
---|
| 10 | ! file in band by band subroutines, as a replacement for the |
---|
| 11 | ! rrtmg_sw_k_g.f90 data statements. |
---|
| 12 | ! |
---|
| 13 | ! Written By: Patrick Hofmann |
---|
| 14 | ! Last Update: 4/3/2009 |
---|
| 15 | !=============================================================================== |
---|
| 16 | |
---|
| 17 | !******************************************************************************* |
---|
| 18 | subroutine sw_kgb16 |
---|
| 19 | use rrsw_kg16, only: sfluxrefo, kao, kbo, selfrefo, forrefo, rayl, no16 |
---|
| 20 | use rrsw_ncpar |
---|
| 21 | use netcdf |
---|
| 22 | |
---|
| 23 | implicit none |
---|
| 24 | save |
---|
| 25 | |
---|
| 26 | integer(kind=im), parameter :: bandNumber = 1, numGPoints = no16 |
---|
| 27 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 28 | integer(kind=im) :: ncid, varID |
---|
| 29 | |
---|
| 30 | real(kind=rb) :: ncrayl(1) |
---|
| 31 | |
---|
| 32 | status(:) = nf90_NoErr |
---|
| 33 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 34 | |
---|
| 35 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 36 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 37 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 38 | count = (/numGPoints,1,1,1/)) |
---|
| 39 | |
---|
| 40 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 41 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 42 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 43 | count = (/1,1,1,1/)) |
---|
| 44 | |
---|
| 45 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 46 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 47 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 48 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 49 | |
---|
| 50 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 51 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 52 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 53 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 54 | |
---|
| 55 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 56 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 57 | count = (/Tself,numGPoints,1,1/)) |
---|
| 58 | |
---|
| 59 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 60 | status(13) = nf90_get_var(ncid, varID, forrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 61 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 62 | |
---|
| 63 | status(14) = nf90_close(ncid) |
---|
| 64 | |
---|
| 65 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 16 variables from file" |
---|
| 66 | |
---|
| 67 | rayl = ncrayl(1) |
---|
| 68 | |
---|
| 69 | end subroutine sw_kgb16 |
---|
| 70 | !******************************************************************************* |
---|
| 71 | |
---|
| 72 | !******************************************************************************* |
---|
| 73 | subroutine sw_kgb17 |
---|
| 74 | use rrsw_kg17, only: sfluxrefo, kao, kbo, selfrefo, forrefo, rayl, no17 |
---|
| 75 | use rrsw_ncpar |
---|
| 76 | use netcdf |
---|
| 77 | |
---|
| 78 | implicit none |
---|
| 79 | save |
---|
| 80 | |
---|
| 81 | integer(kind=im), parameter :: bandNumber = 2 |
---|
| 82 | integer(kind=im), parameter :: numGPoints = no17 |
---|
| 83 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 84 | integer(kind=im) :: ncid, varID |
---|
| 85 | |
---|
| 86 | real(kind=rb) :: ncrayl(1) |
---|
| 87 | |
---|
| 88 | status(:) = nf90_NoErr |
---|
| 89 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 90 | |
---|
| 91 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionUpperAtmos",varID) |
---|
| 92 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 93 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 94 | count = (/numGPoints,keyupper,1,1/)) |
---|
| 95 | |
---|
| 96 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 97 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 98 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 99 | count = (/1,1,1,1/)) |
---|
| 100 | |
---|
| 101 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 102 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 103 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 104 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 105 | |
---|
| 106 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 107 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 108 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 109 | count = (/keyupper,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 110 | |
---|
| 111 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 112 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 113 | count = (/Tself,numGPoints,1,1/)) |
---|
| 114 | |
---|
| 115 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 116 | status(13) = nf90_get_var(ncid, varID, forrefo(1:3,:), start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 117 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 118 | |
---|
| 119 | status(14) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 120 | status(15) = nf90_get_var(ncid, varID, forrefo(4,:), start = (/2,1,bandNumber,gPointSetNumber/), & |
---|
| 121 | count = (/1,numGPoints,1,1/)) |
---|
| 122 | |
---|
| 123 | status(14) = nf90_close(ncid) |
---|
| 124 | |
---|
| 125 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 17 variables from file" |
---|
| 126 | |
---|
| 127 | rayl = ncrayl(1) |
---|
| 128 | |
---|
| 129 | end subroutine sw_kgb17 |
---|
| 130 | !******************************************************************************* |
---|
| 131 | |
---|
| 132 | !******************************************************************************* |
---|
| 133 | subroutine sw_kgb18 |
---|
| 134 | use rrsw_kg18, only: sfluxrefo, kao, kbo, selfrefo, forrefo, rayl, no18 |
---|
| 135 | use rrsw_ncpar |
---|
| 136 | use netcdf |
---|
| 137 | |
---|
| 138 | implicit none |
---|
| 139 | save |
---|
| 140 | |
---|
| 141 | integer(kind=im), parameter :: bandNumber = 3 |
---|
| 142 | integer(kind=im), parameter :: numGPoints = no18 |
---|
| 143 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 144 | integer(kind=im) :: ncid, varID |
---|
| 145 | |
---|
| 146 | real(kind=rb) :: ncrayl(1) |
---|
| 147 | |
---|
| 148 | status(:) = nf90_NoErr |
---|
| 149 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 150 | |
---|
| 151 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 152 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 153 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 154 | count = (/numGPoints,keylower,1,1/)) |
---|
| 155 | |
---|
| 156 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 157 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 158 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 159 | count = (/1,1,1,1/)) |
---|
| 160 | |
---|
| 161 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 162 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 163 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 164 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 165 | |
---|
| 166 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 167 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 168 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 169 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 170 | |
---|
| 171 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 172 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 173 | count = (/Tself,numGPoints,1,1/)) |
---|
| 174 | |
---|
| 175 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 176 | status(13) = nf90_get_var(ncid, varID, forrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 177 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 178 | |
---|
| 179 | status(14) = nf90_close(ncid) |
---|
| 180 | |
---|
| 181 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 18 variables from file" |
---|
| 182 | |
---|
| 183 | rayl = ncrayl(1) |
---|
| 184 | |
---|
| 185 | end subroutine sw_kgb18 |
---|
| 186 | !******************************************************************************* |
---|
| 187 | |
---|
| 188 | !******************************************************************************* |
---|
| 189 | subroutine sw_kgb19 |
---|
| 190 | use rrsw_kg19, only: sfluxrefo, kao, kbo, selfrefo, forrefo, rayl, no19 |
---|
| 191 | use rrsw_ncpar |
---|
| 192 | use netcdf |
---|
| 193 | |
---|
| 194 | implicit none |
---|
| 195 | save |
---|
| 196 | |
---|
| 197 | integer(kind=im), parameter :: bandNumber = 4 |
---|
| 198 | integer(kind=im), parameter :: numGPoints = no19 |
---|
| 199 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 200 | integer(kind=im) :: ncid, varID |
---|
| 201 | |
---|
| 202 | real(kind=rb) :: ncrayl(1) |
---|
| 203 | |
---|
| 204 | status(:) = nf90_NoErr |
---|
| 205 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 206 | |
---|
| 207 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 208 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 209 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 210 | count = (/numGPoints,keylower,1,1/)) |
---|
| 211 | |
---|
| 212 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 213 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 214 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 215 | count = (/1,1,1,1/)) |
---|
| 216 | |
---|
| 217 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 218 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 219 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 220 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 221 | |
---|
| 222 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 223 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 224 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 225 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 226 | |
---|
| 227 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 228 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 229 | count = (/Tself,numGPoints,1,1/)) |
---|
| 230 | |
---|
| 231 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 232 | status(13) = nf90_get_var(ncid, varID, forrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 233 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 234 | |
---|
| 235 | status(14) = nf90_close(ncid) |
---|
| 236 | |
---|
| 237 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 19 variables from file" |
---|
| 238 | |
---|
| 239 | rayl = ncrayl(1) |
---|
| 240 | |
---|
| 241 | end subroutine sw_kgb19 |
---|
| 242 | !******************************************************************************* |
---|
| 243 | |
---|
| 244 | !******************************************************************************* |
---|
| 245 | subroutine sw_kgb20 |
---|
| 246 | use rrsw_kg20, only: sfluxrefo, kao, kbo, selfrefo, forrefo, rayl, absch4o, no20 |
---|
| 247 | use rrsw_ncpar |
---|
| 248 | use netcdf |
---|
| 249 | |
---|
| 250 | implicit none |
---|
| 251 | save |
---|
| 252 | |
---|
| 253 | integer(kind=im) :: ab |
---|
| 254 | integer(kind=im), parameter :: bandNumber = 5 |
---|
| 255 | integer(kind=im), parameter :: numGPoints = no20 |
---|
| 256 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 257 | integer(kind=im) :: ncid, varID |
---|
| 258 | |
---|
| 259 | real(kind=rb) :: ncrayl(1) |
---|
| 260 | |
---|
| 261 | status(:) = nf90_NoErr |
---|
| 262 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 263 | |
---|
| 264 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 265 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 266 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 267 | count = (/numGPoints,1,1,1/)) |
---|
| 268 | |
---|
| 269 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 270 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 271 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 272 | count = (/1,1,1,1/)) |
---|
| 273 | |
---|
| 274 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 275 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 276 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 277 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
| 278 | |
---|
| 279 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 280 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 281 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 282 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 283 | |
---|
| 284 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 285 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 286 | count = (/Tself,numGPoints,1,1/)) |
---|
| 287 | |
---|
| 288 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 289 | status(13) = nf90_get_var(ncid, varID, forrefo(1:3,:), start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 290 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 291 | |
---|
| 292 | status(14) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 293 | status(15) = nf90_get_var(ncid, varID, forrefo(4,:), start = (/2,1,bandNumber,gPointSetNumber/), & |
---|
| 294 | count = (/1,numGPoints,1,1/)) |
---|
| 295 | |
---|
| 296 | !Get absorber index for CH4 |
---|
| 297 | call getAbsorberIndex('CH4',ab) |
---|
| 298 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
| 299 | status(17) = nf90_get_var(ncid, varID, absch4o, & |
---|
| 300 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
| 301 | count = (/1,1,numGPoints,1,1,1/)) |
---|
| 302 | |
---|
| 303 | status(16) = nf90_close(ncid) |
---|
| 304 | |
---|
| 305 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 20 variables from file" |
---|
| 306 | |
---|
| 307 | rayl = ncrayl(1) |
---|
| 308 | |
---|
| 309 | end subroutine sw_kgb20 |
---|
| 310 | !******************************************************************************* |
---|
| 311 | |
---|
| 312 | !******************************************************************************* |
---|
| 313 | subroutine sw_kgb21 |
---|
| 314 | use rrsw_kg21, only: sfluxrefo, kao, kbo, selfrefo, forrefo, rayl, no21 |
---|
| 315 | use rrsw_ncpar |
---|
| 316 | use netcdf |
---|
| 317 | |
---|
| 318 | implicit none |
---|
| 319 | save |
---|
| 320 | |
---|
| 321 | integer(kind=im), parameter :: bandNumber = 6 |
---|
| 322 | integer(kind=im), parameter :: numGPoints = no21 |
---|
| 323 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 324 | integer(kind=im) :: ncid, varID |
---|
| 325 | |
---|
| 326 | real(kind=rb) :: ncrayl(1) |
---|
| 327 | |
---|
| 328 | status(:) = nf90_NoErr |
---|
| 329 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 330 | |
---|
| 331 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 332 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 333 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 334 | count = (/numGPoints,keylower,1,1/)) |
---|
| 335 | |
---|
| 336 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 337 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 338 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 339 | count = (/1,1,1,1/)) |
---|
| 340 | |
---|
| 341 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 342 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 343 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 344 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 345 | |
---|
| 346 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 347 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 348 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 349 | count = (/keyupper,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 350 | |
---|
| 351 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 352 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 353 | count = (/Tself,numGPoints,1,1/)) |
---|
| 354 | |
---|
| 355 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 356 | status(13) = nf90_get_var(ncid, varID, forrefo(1:3,:), start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 357 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 358 | |
---|
| 359 | status(14) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 360 | status(15) = nf90_get_var(ncid, varID, forrefo(4,:), start = (/2,1,bandNumber,gPointSetNumber/), & |
---|
| 361 | count = (/1,numGPoints,1,1/)) |
---|
| 362 | |
---|
| 363 | status(14) = nf90_close(ncid) |
---|
| 364 | |
---|
| 365 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 21 variables from file" |
---|
| 366 | |
---|
| 367 | rayl = ncrayl(1) |
---|
| 368 | |
---|
| 369 | end subroutine sw_kgb21 |
---|
| 370 | !******************************************************************************* |
---|
| 371 | |
---|
| 372 | !******************************************************************************* |
---|
| 373 | subroutine sw_kgb22 |
---|
| 374 | use rrsw_kg22, only: sfluxrefo, kao, kbo, selfrefo, forrefo, rayl, no22 |
---|
| 375 | use rrsw_ncpar |
---|
| 376 | use netcdf |
---|
| 377 | |
---|
| 378 | implicit none |
---|
| 379 | save |
---|
| 380 | |
---|
| 381 | integer(kind=im), parameter :: bandNumber = 7 |
---|
| 382 | integer(kind=im), parameter :: numGPoints = no22 |
---|
| 383 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 384 | integer(kind=im) :: ncid, varID |
---|
| 385 | |
---|
| 386 | real(kind=rb) :: ncrayl(1) |
---|
| 387 | |
---|
| 388 | status(:) = nf90_NoErr |
---|
| 389 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 390 | |
---|
| 391 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 392 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 393 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 394 | count = (/numGPoints,keylower,1,1/)) |
---|
| 395 | |
---|
| 396 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 397 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 398 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 399 | count = (/1,1,1,1/)) |
---|
| 400 | |
---|
| 401 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 402 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 403 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 404 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 405 | |
---|
| 406 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 407 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 408 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 409 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 410 | |
---|
| 411 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 412 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 413 | count = (/Tself,numGPoints,1,1/)) |
---|
| 414 | |
---|
| 415 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 416 | status(13) = nf90_get_var(ncid, varID, forrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 417 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 418 | |
---|
| 419 | status(14) = nf90_close(ncid) |
---|
| 420 | |
---|
| 421 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 22 variables from file" |
---|
| 422 | |
---|
| 423 | rayl = ncrayl(1) |
---|
| 424 | |
---|
| 425 | end subroutine sw_kgb22 |
---|
| 426 | !******************************************************************************* |
---|
| 427 | |
---|
| 428 | !******************************************************************************* |
---|
| 429 | subroutine sw_kgb23 |
---|
| 430 | use rrsw_kg23, only: sfluxrefo, kao, selfrefo, forrefo, raylo, no23 |
---|
| 431 | use rrsw_ncpar |
---|
| 432 | use netcdf |
---|
| 433 | |
---|
| 434 | implicit none |
---|
| 435 | save |
---|
| 436 | |
---|
| 437 | integer(kind=im), parameter :: bandNumber = 8 |
---|
| 438 | integer(kind=im), parameter :: numGPoints = no23 |
---|
| 439 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 440 | integer(kind=im) :: ncid, varID |
---|
| 441 | |
---|
| 442 | status(:) = nf90_NoErr |
---|
| 443 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 444 | |
---|
| 445 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 446 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 447 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 448 | count = (/numGPoints,1,1,1/)) |
---|
| 449 | |
---|
| 450 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 451 | status(5) = nf90_get_var(ncid, varID, raylo, & |
---|
| 452 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 453 | count = (/numGPoints,1,1,1/)) |
---|
| 454 | |
---|
| 455 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 456 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 457 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 458 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
| 459 | |
---|
| 460 | status(8) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 461 | status(9) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 462 | count = (/Tself,numGPoints,1,1/)) |
---|
| 463 | |
---|
| 464 | status(10) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 465 | status(11) = nf90_get_var(ncid, varID, forrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 466 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 467 | |
---|
| 468 | status(12) = nf90_close(ncid) |
---|
| 469 | |
---|
| 470 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 23 variables from file" |
---|
| 471 | |
---|
| 472 | end subroutine sw_kgb23 |
---|
| 473 | !******************************************************************************* |
---|
| 474 | |
---|
| 475 | !******************************************************************************* |
---|
| 476 | subroutine sw_kgb24 |
---|
| 477 | use rrsw_kg24, only: sfluxrefo, kao, kbo, selfrefo, forrefo, & |
---|
| 478 | raylao, raylbo, abso3ao, abso3bo, no24 |
---|
| 479 | use rrsw_ncpar |
---|
| 480 | use netcdf |
---|
| 481 | |
---|
| 482 | implicit none |
---|
| 483 | save |
---|
| 484 | |
---|
| 485 | integer(kind=im) :: ab |
---|
| 486 | integer(kind=im), parameter :: bandNumber = 9 |
---|
| 487 | integer(kind=im), parameter :: numGPoints = no24 |
---|
| 488 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 489 | integer(kind=im) :: ncid, varID |
---|
| 490 | |
---|
| 491 | status(:) = nf90_NoErr |
---|
| 492 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 493 | |
---|
| 494 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 495 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 496 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 497 | count = (/numGPoints,keylower,1,1/)) |
---|
| 498 | |
---|
| 499 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 500 | status(5) = nf90_get_var(ncid, varID, raylao, & |
---|
| 501 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 502 | count = (/numGPoints,keylower,1,1/)) |
---|
| 503 | |
---|
| 504 | status(6) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsUpperAtmos",varID) |
---|
| 505 | status(7) = nf90_get_var(ncid, varID, raylbo, & |
---|
| 506 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 507 | count = (/numGPoints,1,1,1/)) |
---|
| 508 | |
---|
| 509 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 510 | status(9) = nf90_get_var(ncid, varID, kao, & |
---|
| 511 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 512 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 513 | |
---|
| 514 | status(10) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 515 | status(11) = nf90_get_var(ncid, varID, kbo, & |
---|
| 516 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 517 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 518 | |
---|
| 519 | status(12) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 520 | status(13) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 521 | count = (/Tself,numGPoints,1,1/)) |
---|
| 522 | |
---|
| 523 | status(14) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 524 | status(15) = nf90_get_var(ncid, varID, forrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 525 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 526 | |
---|
| 527 | !Get absorber index for O3 |
---|
| 528 | call getAbsorberIndex('O3',ab) |
---|
| 529 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
| 530 | status(17) = nf90_get_var(ncid, varID, abso3ao, & |
---|
| 531 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
| 532 | count = (/1,1,numGPoints,1,1,1/)) |
---|
| 533 | status(18) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
| 534 | status(19) = nf90_get_var(ncid, varID, abso3bo, & |
---|
| 535 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
| 536 | count = (/1,1,numGPoints,1,1,1/)) |
---|
| 537 | |
---|
| 538 | status(20) = nf90_close(ncid) |
---|
| 539 | |
---|
| 540 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 24 variables from file" |
---|
| 541 | |
---|
| 542 | end subroutine sw_kgb24 |
---|
| 543 | !******************************************************************************* |
---|
| 544 | |
---|
| 545 | !******************************************************************************* |
---|
| 546 | subroutine sw_kgb25 |
---|
| 547 | use rrsw_kg25, only: sfluxrefo, kao, raylo, abso3ao, abso3bo, no25 |
---|
| 548 | use rrsw_ncpar |
---|
| 549 | use netcdf |
---|
| 550 | |
---|
| 551 | implicit none |
---|
| 552 | save |
---|
| 553 | |
---|
| 554 | integer(kind=im) :: ab |
---|
| 555 | integer(kind=im), parameter :: bandNumber = 10 |
---|
| 556 | integer(kind=im), parameter :: numGPoints = no25 |
---|
| 557 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 558 | integer(kind=im) :: ncid, varID |
---|
| 559 | |
---|
| 560 | status(:) = nf90_NoErr |
---|
| 561 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 562 | |
---|
| 563 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 564 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 565 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 566 | count = (/numGPoints,1,1,1/)) |
---|
| 567 | |
---|
| 568 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 569 | status(5) = nf90_get_var(ncid, varID, raylo, & |
---|
| 570 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 571 | count = (/numGPoints,1,1,1/)) |
---|
| 572 | |
---|
| 573 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 574 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 575 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 576 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
| 577 | |
---|
| 578 | !Get absorber index for O3 |
---|
| 579 | call getAbsorberIndex('O3',ab) |
---|
| 580 | status(8) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
| 581 | status(9) = nf90_get_var(ncid, varID, abso3ao, & |
---|
| 582 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
| 583 | count = (/1,1,numGPoints,1,1,1/)) |
---|
| 584 | status(10) = nf90_inq_varid(ncid,"AbsorptionCoefficientsUpperAtmos",varID) |
---|
| 585 | status(11) = nf90_get_var(ncid, varID, abso3bo, & |
---|
| 586 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
| 587 | count = (/1,1,numGPoints,1,1,1/)) |
---|
| 588 | |
---|
| 589 | status(12) = nf90_close(ncid) |
---|
| 590 | |
---|
| 591 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 25 variables from file" |
---|
| 592 | |
---|
| 593 | end subroutine sw_kgb25 |
---|
| 594 | !******************************************************************************* |
---|
| 595 | |
---|
| 596 | !******************************************************************************* |
---|
| 597 | subroutine sw_kgb26 |
---|
| 598 | use rrsw_kg26, only: sfluxrefo, raylo, no26 |
---|
| 599 | use rrsw_ncpar |
---|
| 600 | use netcdf |
---|
| 601 | |
---|
| 602 | implicit none |
---|
| 603 | save |
---|
| 604 | |
---|
| 605 | integer(kind=im), parameter :: bandNumber = 11 |
---|
| 606 | integer(kind=im), parameter :: numGPoints = no26 |
---|
| 607 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 608 | integer(kind=im) :: ncid, varID |
---|
| 609 | |
---|
| 610 | status(:) = nf90_NoErr |
---|
| 611 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 612 | |
---|
| 613 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 614 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 615 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 616 | count = (/numGPoints,1,1,1/)) |
---|
| 617 | |
---|
| 618 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 619 | status(5) = nf90_get_var(ncid, varID, raylo, & |
---|
| 620 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 621 | count = (/numGPoints,1,1,1/)) |
---|
| 622 | |
---|
| 623 | status(6) = nf90_close(ncid) |
---|
| 624 | |
---|
| 625 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 26 variables from file" |
---|
| 626 | |
---|
| 627 | end subroutine sw_kgb26 |
---|
| 628 | !******************************************************************************* |
---|
| 629 | |
---|
| 630 | !******************************************************************************* |
---|
| 631 | subroutine sw_kgb27 |
---|
| 632 | use rrsw_kg27, only: sfluxrefo, kao, kbo, raylo, no27 |
---|
| 633 | use rrsw_ncpar |
---|
| 634 | use netcdf |
---|
| 635 | |
---|
| 636 | implicit none |
---|
| 637 | save |
---|
| 638 | |
---|
| 639 | integer(kind=im), parameter :: bandNumber = 12 |
---|
| 640 | integer(kind=im), parameter :: numGPoints = no27 |
---|
| 641 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 642 | integer(kind=im) :: ncid, varID |
---|
| 643 | |
---|
| 644 | status(:) = nf90_NoErr |
---|
| 645 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 646 | |
---|
| 647 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 648 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 649 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 650 | count = (/numGPoints,1,1,1/)) |
---|
| 651 | |
---|
| 652 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 653 | status(5) = nf90_get_var(ncid, varID, raylo, & |
---|
| 654 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 655 | count = (/numGPoints,1,1,1/)) |
---|
| 656 | |
---|
| 657 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 658 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 659 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 660 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
| 661 | |
---|
| 662 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 663 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 664 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 665 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 666 | |
---|
| 667 | status(10) = nf90_close(ncid) |
---|
| 668 | |
---|
| 669 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 27 variables from file" |
---|
| 670 | |
---|
| 671 | end subroutine sw_kgb27 |
---|
| 672 | !******************************************************************************* |
---|
| 673 | |
---|
| 674 | !******************************************************************************* |
---|
| 675 | subroutine sw_kgb28 |
---|
| 676 | use rrsw_kg28, only: sfluxrefo, kao, kbo, rayl, no28 |
---|
| 677 | use rrsw_ncpar |
---|
| 678 | use netcdf |
---|
| 679 | |
---|
| 680 | implicit none |
---|
| 681 | save |
---|
| 682 | |
---|
| 683 | integer(kind=im), parameter :: bandNumber = 13 |
---|
| 684 | integer(kind=im), parameter :: numGPoints = no28 |
---|
| 685 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 686 | integer(kind=im) :: ncid, varID |
---|
| 687 | |
---|
| 688 | real(kind=rb) :: ncrayl(1) |
---|
| 689 | |
---|
| 690 | status(:) = nf90_NoErr |
---|
| 691 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 692 | |
---|
| 693 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionUpperAtmos",varID) |
---|
| 694 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 695 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 696 | count = (/numGPoints,keyupper,1,1/)) |
---|
| 697 | |
---|
| 698 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 699 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 700 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 701 | count = (/1,1,1,1/)) |
---|
| 702 | |
---|
| 703 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 704 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 705 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 706 | count = (/keylower,Tdiff,plower,numGPoints,1,1/)) |
---|
| 707 | |
---|
| 708 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 709 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 710 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 711 | count = (/keyupper,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 712 | |
---|
| 713 | status(10) = nf90_close(ncid) |
---|
| 714 | |
---|
| 715 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 28 variables from file" |
---|
| 716 | |
---|
| 717 | rayl = ncrayl(1) |
---|
| 718 | |
---|
| 719 | end subroutine sw_kgb28 |
---|
| 720 | !******************************************************************************* |
---|
| 721 | |
---|
| 722 | !******************************************************************************* |
---|
| 723 | subroutine sw_kgb29 |
---|
| 724 | use rrsw_kg29, only: sfluxrefo, kao, kbo, selfrefo, forrefo, & |
---|
| 725 | absh2oo, absco2o, rayl, no29 |
---|
| 726 | use rrsw_ncpar |
---|
| 727 | use netcdf |
---|
| 728 | |
---|
| 729 | implicit none |
---|
| 730 | save |
---|
| 731 | |
---|
| 732 | integer(kind=im) :: ab |
---|
| 733 | integer(kind=im), parameter :: bandNumber = 14 |
---|
| 734 | integer(kind=im), parameter :: numGPoints = no29 |
---|
| 735 | integer(kind=im), parameter :: gPointSetNumber = 1 |
---|
| 736 | integer(kind=im) :: ncid, varID |
---|
| 737 | |
---|
| 738 | real(kind=rb) :: ncrayl(1) |
---|
| 739 | |
---|
| 740 | status(:) = nf90_NoErr |
---|
| 741 | status(1) = nf90_open('rrtmg_sw.nc',nf90_nowrite,ncid) |
---|
| 742 | |
---|
| 743 | status(2) = nf90_inq_varid(ncid,"SolarSourceFunctionLowerAtmos",varID) |
---|
| 744 | status(3) = nf90_get_var(ncid, varID, sfluxrefo, & |
---|
| 745 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 746 | count = (/numGPoints,1,1,1/)) |
---|
| 747 | |
---|
| 748 | status(4) = nf90_inq_varid(ncid,"RayleighExtinctionCoefficientsLowerAtmos",varID) |
---|
| 749 | status(5) = nf90_get_var(ncid, varID, ncrayl, & |
---|
| 750 | start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 751 | count = (/1,1,1,1/)) |
---|
| 752 | |
---|
| 753 | status(6) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 754 | status(7) = nf90_get_var(ncid, varID, kao, & |
---|
| 755 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 756 | count = (/1,Tdiff,plower,numGPoints,1,1/)) |
---|
| 757 | |
---|
| 758 | status(8) = nf90_inq_varid(ncid,"KeySpeciesAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 759 | status(9) = nf90_get_var(ncid, varID, kbo, & |
---|
| 760 | start = (/1,1,1,1,bandNumber,gPointSetNumber/), & |
---|
| 761 | count = (/1,Tdiff,pupper,numGPoints,1,1/)) |
---|
| 762 | |
---|
| 763 | status(10) = nf90_inq_varid(ncid,"H2OSelfAbsorptionCoefficients",varID) |
---|
| 764 | status(11) = nf90_get_var(ncid, varID, selfrefo, start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 765 | count = (/Tself,numGPoints,1,1/)) |
---|
| 766 | |
---|
| 767 | status(12) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsLowerAtmos",varID) |
---|
| 768 | status(13) = nf90_get_var(ncid, varID, forrefo(1:3,:), start = (/1,1,bandNumber,gPointSetNumber/), & |
---|
| 769 | count = (/Tforeignlower,numGPoints,1,1/)) |
---|
| 770 | |
---|
| 771 | status(14) = nf90_inq_varid(ncid,"H2OForeignAbsorptionCoefficientsUpperAtmos",varID) |
---|
| 772 | status(15) = nf90_get_var(ncid, varID, forrefo(4,:), start = (/2,1,bandNumber,gPointSetNumber/), & |
---|
| 773 | count = (/1,numGPoints,1,1/)) |
---|
| 774 | |
---|
| 775 | !Get absorber index for H2O |
---|
| 776 | call getAbsorberIndex('H2O',ab) |
---|
| 777 | status(16) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
| 778 | status(17) = nf90_get_var(ncid, varID, absh2oo, & |
---|
| 779 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
| 780 | count = (/1,1,numGPoints,1,1,1/)) |
---|
| 781 | |
---|
| 782 | !Get absorber index for CO2 |
---|
| 783 | call getAbsorberIndex('CO2',ab) |
---|
| 784 | status(18) = nf90_inq_varid(ncid,"AbsorptionCoefficientsLowerAtmos",varID) |
---|
| 785 | status(19) = nf90_get_var(ncid, varID, absco2o, & |
---|
| 786 | start = (/1,1,1,ab,bandNumber,gPointSetNumber/), & |
---|
| 787 | count = (/1,1,numGPoints,1,1,1/)) |
---|
| 788 | |
---|
| 789 | status(18) = nf90_close(ncid) |
---|
| 790 | |
---|
| 791 | if(any(status(:) /= nf90_NoErr)) stop "Error reading band 29 variables from file" |
---|
| 792 | |
---|
| 793 | rayl = ncrayl(1) |
---|
| 794 | |
---|
| 795 | end subroutine sw_kgb29 |
---|
| 796 | !******************************************************************************* |
---|