54 '$Id: CRTM_IRSSEM.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 56 INTEGER,
PARAMETER ::
ml = 256
67 INTEGER :: n_angles = 0
70 LOGICAL :: is_allocated = .false.
76 INTEGER,
ALLOCATABLE :: i1(:), i2(:)
80 LOGICAL,
ALLOCATABLE :: a_outbound(:)
84 REAL(fp),
ALLOCATABLE :: a_int(:)
88 REAL(fp),
ALLOCATABLE :: a(:,:)
89 REAL(fp),
ALLOCATABLE :: f(:)
90 REAL(fp),
ALLOCATABLE :: v(:)
188 IRwaterCoeff, & ! Input model coefficients
189 Wind_Speed , & ! Input
190 Frequency , & ! Input
192 iVar , & ! Internal variable output
197 REAL(fp) ,
INTENT(IN) :: wind_speed
198 REAL(fp) ,
INTENT(IN) :: frequency
199 REAL(fp) ,
INTENT(IN) :: angle(:)
201 REAL(fp) ,
INTENT(OUT) :: emissivity(:)
205 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_IRSSEM' 208 INTEGER :: n_angles, i
209 REAL(fp) :: sec_angle(
size(angle))
214 n_angles =
SIZE(angle)
215 IF (
SIZE(emissivity) /= n_angles )
THEN 217 msg =
'Input Angle and output Emissivity array dimensions inconsistent.' 225 msg =
'Error allocating interpolation variable structure.' 235 ivar%ei%v_int = wind_speed
237 ivar%ei%v_int, ivar%ei%k1, ivar%ei%k2, ivar%ei%v_outbound)
238 ivar%ei%v = irwatercoeff%Wind_Speed(ivar%ei%k1:ivar%ei%k2)
240 CALL lpoly( ivar%ei%v , &
247 ivar%ei%f_int = frequency
249 ivar%ei%f_int, ivar%ei%j1, ivar%ei%j2, ivar%ei%f_outbound)
250 ivar%ei%f = irwatercoeff%Frequency(ivar%ei%j1:ivar%ei%j2)
252 CALL lpoly( ivar%ei%f , &
261 ivar%ei%a_int(i) = abs(angle(i))
263 ivar%ei%a_int(i), ivar%ei%i1(i), ivar%ei%i2(i), ivar%ei%a_outbound(i))
264 ivar%ei%a(:,i) = irwatercoeff%Angle(ivar%ei%i1(i):ivar%ei%i2(i))
273 CALL lpoly( ivar%ei%a(:,i) , &
279 CALL interp_3d( irwatercoeff%Emissivity( ivar%ei%i1(i):ivar%ei%i2(i), &
280 ivar%ei%j1 :ivar%ei%j2 , &
281 ivar%ei%k1 :ivar%ei%k2 ), &
355 IRwaterCoeff , & ! Input model coefficients
356 Wind_Speed_TL, & ! Input
357 iVar , & ! Internal variable input
362 REAL(fp) ,
INTENT(IN) :: wind_speed_tl
364 REAL(fp) ,
INTENT(OUT) :: emissivity_tl(:)
368 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_IRSSEM_TL' 372 REAL(fp) :: v_tl(
npts)
381 msg =
'Internal structure ei is not allocated' 386 IF (
SIZE( emissivity_tl ) /= ivar%ei%n_Angles )
THEN 388 msg =
'Input Emissivity_TL array dimensions inconsistent with number of angles.' 393 IF ( ivar%ei%v_outbound )
THEN 406 CALL lpoly_tl( ivar%ei%v, ivar%ei%v_int, &
408 v_tl, wind_speed_tl, &
413 DO i = 1, ivar%ei%n_Angles
416 CALL interp_3d_tl(irwatercoeff%Emissivity(ivar%ei%i1(i):ivar%ei%i2(i), &
417 ivar%ei%j1 :ivar%ei%j2 , &
418 ivar%ei%k1 :ivar%ei%k2 ), &
422 e_tl, wlp_tl, xlp_tl, ylp_tl, &
496 IRwaterCoeff , & ! Input model coefficients
497 Emissivity_AD, & ! Input
498 iVar , & ! Internal Variable Input
503 REAL(fp) ,
INTENT(IN OUT) :: emissivity_ad(:)
505 REAL(fp) ,
INTENT(IN OUT) :: wind_speed_ad
509 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Compute_IRSSEM_AD' 514 REAL(fp) :: v_ad(
npts)
524 msg =
'Internal structure ei is not allocated' 529 IF (
SIZE(emissivity_ad) /= ivar%ei%n_Angles )
THEN 531 msg =
'Input Emissivity_AD array dimensions inconsistent with number of angles.' 536 IF ( ivar%ei%v_outbound )
RETURN 543 DO i = 1, ivar%ei%n_Angles
546 CALL interp_3d_ad(irwatercoeff%Emissivity( ivar%ei%i1(i):ivar%ei%i2(i), &
547 ivar%ei%j1 :ivar%ei%j2 , &
548 ivar%ei%k1 :ivar%ei%k2 ), &
553 e_ad, wlp_ad, xlp_ad, ylp_ad )
556 emissivity_ad(i) =
zero 585 status = ei%Is_Allocated
590 INTEGER,
INTENT(IN) :: n_pts
591 INTEGER,
INTENT(IN) :: n_angles
592 INTEGER :: alloc_stat
593 IF ( n_pts < 1 .OR. n_angles < 1 )
RETURN 594 ALLOCATE( ei%wlp(n_angles) , &
597 ei%a_outbound(n_angles), &
598 ei%a_int(n_angles) , &
599 ei%a(n_pts,n_angles) , &
603 IF ( alloc_stat /= 0 )
RETURN 604 ei%n_Angles = n_angles
606 ei%Is_Allocated = .true.
subroutine, public interp_3d_ad(z, ulp, vlp, wlp, z_int_AD, z_AD, ulp_AD, vlp_AD, wlp_AD)
subroutine, public interp_3d_tl(z, ulp, vlp, wlp, z_TL, ulp_TL, vlp_TL, wlp_TL, z_int_TL)
integer, parameter, public failure
real(fp), parameter, public zero
integer, parameter, public fp
subroutine, public clear_lpoly(p)
subroutine, public lpoly_ad(x, x_int, p, p_AD, x_AD, x_int_AD)
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
real(fp), parameter, public degrees_to_radians
subroutine, public lpoly(x, x_int, p)
integer, parameter, public npts
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************subroutine READ_RECORD_CORE_(unit, field, nwords, data, start, axsiz) integer, intent(in) ::unit type(fieldtype), intent(in) ::field integer, intent(in) ::nwords MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in) ::start(:), axsiz(:) integer(SHORT_KIND) ::i2vals(nwords)!rab used in conjunction with transfer intrinsic to determine size of a variable integer(KIND=1) ::one_byte(8) integer ::word_sz!#ifdef __sgi integer(INT_KIND) ::ivals(nwords) real(FLOAT_KIND) ::rvals(nwords)!#else! integer ::ivals(nwords)! real ::rvals(nwords)!#endif real(DOUBLE_KIND) ::r8vals(nwords) pointer(ptr1, i2vals) pointer(ptr2, ivals) pointer(ptr3, rvals) pointer(ptr4, r8vals) if(mpp_io_stack_size< nwords) call mpp_io_set_stack_size(nwords) call mpp_error(FATAL, 'MPP_READ currently requires use_netCDF option') end subroutine READ_RECORD_CORE_ subroutine READ_RECORD_(unit, field, nwords, data, time_level, domain, position, tile_count, start_in, axsiz_in)!routine that is finally called by all mpp_read routines to perform the read!a non-netCDF record contains:! field ID! a set of 4 coordinates(is:ie, js:je) giving the data subdomain! a timelevel and a timestamp(=NULLTIME if field is static)! 3D real data(stored as 1D)!if you are using direct access I/O, the RECL argument to OPEN must be large enough for the above!in a global direct access file, record position on PE is given by %record.!Treatment of timestamp:! We assume that static fields have been passed without a timestamp.! Here that is converted into a timestamp of NULLTIME.! For non-netCDF fields, field is treated no differently, but is written! with a timestamp of NULLTIME. There is no check in the code to prevent! the user from repeatedly writing a static field. integer, intent(in) ::unit, nwords type(fieldtype), intent(in) ::field MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in), optional ::time_level type(domain2D), intent(in), optional ::domain integer, intent(in), optional ::position, tile_count integer, intent(in), optional ::start_in(:), axsiz_in(:) integer, dimension(size(field%axes(:))) ::start, axsiz integer ::tlevel !, subdomain(4) integer ::i, error, is, ie, js, je, isg, ieg, jsg, jeg type(domain2d), pointer ::io_domain=> tlevel if(PRESENT(start_in) .AND. PRESENT(axsiz_in)) then if(size(start(! the data domain and compute domain must refer to the subdomain being passed ! In this ! since that attempts to gather all data on PE size(field%axes(:)) axsiz(i)
subroutine, public interp_3d(z, ulp, vlp, wlp, z_int)
subroutine, public lpoly_tl(x, x_int, p, x_TL, x_int_TL, p_TL)
integer, parameter, public success