subroutine convert_profiles_cfsr(debug, lat, lon, pres, temp, & mixr, wat1, tprof1, wprof1) c----------------------------------------------------------------------- c!F77 c!Description: Convert input profiles to 101-levels necessary for use c with radiative transfer model. c c!Input Parameters: c debug Debug write flag c lat Latitude c lon Longitude c pres input atm. pressure profile (num. levels = 'ni') c temp input atm. temperature profile (num. levels = 'ni') c mixr input atm. water vapor mixing ratio (num. levels = 'ni') c c!Output Parameters: c wat1 Surface water vapor mixing ratio c tropf1 101-level atm. temperature profile c wropf1 101-level atm. water vapor mixing ratio profile c c!Revision History: c 7/10 R. Frey c Modified from UW direct broadcast c software c 1/14 R. Frey c Modified to use CFSR profile data c c!End c----------------------------------------------------------------------- implicit none c ... parameters real EPS_ZERO parameter (EPS_ZERO = 0.00001) c ... arguments integer debug real lat, lon, pres(26), temp(26), mixr(26), wat1, tprof1(101), & wprof1(101) c ... local variables integer j, k, ni real x, x0, dx, y, y0, dy real pstd( 101 ), tstd( 101 ), wstd( 101 ), & latitude c ... instrinsic functions intrinsic iand c ... external functions c----------------------------------------------------------------------- c ... Data Statements c ... Define 101 standard pressure levels (hPa) data pstd / 0.0050, 0.0161, 0.0384, 0.0769, 0.1370, + 0.2244, 0.3454, 0.5064, 0.7140, 0.9753, 1.2972, + 1.6872, 2.1526, 2.7009, 3.3398, 4.0770, 4.9204, + 5.8776, 6.9567, 8.1655, 9.5119, 11.0038, 12.6492, + 14.4559, 16.4318, 18.5847, 20.9224, 23.4526, 26.1829, + 29.1210, 32.2744, 35.6505, 39.2566, 43.1001, 47.1882, + 51.5278, 56.1260, 60.9895, 66.1253, 71.5398, 77.2396, + 83.2310, 89.5204, 96.1138, 103.0172, 110.2366, 117.7775, + 125.6456, 133.8462, 142.3848, 151.2664, 160.4959, 170.0784, + 180.0183, 190.3203, 200.9887, 212.0277, 223.4415, 235.2338, + 247.4085, 259.9691, 272.9191, 286.2617, 300.0000, 314.1369, + 328.6753, 343.6176, 358.9665, 374.7241, 390.8926, 407.4738, + 424.4698, 441.8819, 459.7118, 477.9607, 496.6298, 515.7200, + 535.2322, 555.1669, 575.5248, 596.3062, 617.5112, 639.1398, + 661.1920, 683.6673, 706.5654, 729.8857, 753.6275, 777.7897, + 802.3714, 827.3713, 852.7880, 878.6201, 904.8659, 931.5236, + 958.5911, 986.0666, 1013.9476, 1042.2319, 1070.9170, 1100.0000/ c----------------------------------------------------------------------- c ... Set default output values do k = 1, 101 tprof1( k ) = -999.9 wprof1( k ) = -999.9 end do if ( mixr( 1 ) .ge. 0.0 ) wat1 = mixr( 1 ) c ... Interpolate temperature and water vapor mixing ratio profiles c ... to the 101 standard levels. ni = 26 latitude = lat call extend_profile( ni, pres, temp, mixr, latitude, & tstd, wstd ) c ... Copy temperature and moisture profiles into output array do k = 1, 101 if ( tstd( k ) .ge. 0.0 ) tprof1( k ) = tstd( k ) if ( abs( wstd( k ) ) .lt. EPS_ZERO) then wprof1( k ) = EPS_ZERO elseif ( wstd( k ) .ge. EPS_ZERO ) then wprof1( k ) = wstd( k ) endif end do c----------------------------------------------------------------------- if(debug .gt. 2) then write(*,'(''Input profile data (converted to 101 levels):'')') write(*,'(1x)') write(*,'(''Atmospheric pressure'')') write(*,'(10f9.3)') pstd write(*,'(1x)') write(*,'(''Atmospheric temperature:'')') write(*,'(10f9.3)') tprof1 write(*,'(1x)') write(*,'(''Atmospheric water vapor mixing ratio:'')') write(*,'(10f9.3)') wprof1 write(*,'(1x)') end if c----------------------------------------------------------------------- return end