FV3 Bundle
CRTM_IRSSEM.f90
Go to the documentation of this file.
1 !
2 ! CRTM_IRSSEM
3 !
4 ! Module containing function to invoke the CRTM Infrared
5 ! Sea Surface Emissivity Model (IRSSEM).
6 !
7 !
8 ! CREATION HISTORY:
9 ! Written by: Paul van Delst, 22-Jun-2005
10 ! paul.vandelst@noaa.gov
11 !
12 
14 
15  ! -----------------
16  ! Environment setup
17  ! -----------------
18  ! Module use
19  USE type_kinds, ONLY: fp
22  USE crtm_interpolation, ONLY: npts, &
23  lpoly, &
24  lpoly_type, &
25  clear_lpoly, &
26  find_index, &
27  interp_3d, &
28  lpoly_tl, &
29  interp_3d_tl, &
30  lpoly_ad, &
33  ! Disable implicit typing
34  IMPLICIT NONE
35 
36  ! ------------
37  ! Visibilities
38  ! ------------
39  ! Everything private by default
40  PRIVATE
41  ! Derived type
42  PUBLIC :: ivar_type
43  ! Procedures
44  PUBLIC :: crtm_compute_irssem
45  PUBLIC :: crtm_compute_irssem_tl
46  PUBLIC :: crtm_compute_irssem_ad
47 
48 
49  ! -----------------
50  ! Module parameters
51  ! -----------------
52  ! Version Id for the module
53  CHARACTER(*), PARAMETER :: module_version_id = &
54  '$Id: CRTM_IRSSEM.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $'
55  ! Message string length
56  INTEGER, PARAMETER :: ml = 256
57 
58 
59  ! -------------------------------
60  ! Structure definition to hold
61  ! forward interpolating variables
62  ! across fwd, tl and adjoint
63  ! -------------------------------
64  ! The interpolation routine structure
65  TYPE :: einterp_type
66  ! The dimensions
67  INTEGER :: n_angles = 0
68  INTEGER :: n_pts = 0
69  ! Allocation indicator
70  LOGICAL :: is_allocated = .false.
71  ! The interpolating polynomials
72  TYPE(lpoly_type), ALLOCATABLE :: wlp(:) ! Angle
73  TYPE(lpoly_type) :: xlp ! Frequency
74  TYPE(lpoly_type) :: ylp ! Wind Speed
75  ! The LUT interpolation indices
76  INTEGER, ALLOCATABLE :: i1(:), i2(:) ! Angle
77  INTEGER :: j1 , j2 ! Frequency
78  INTEGER :: k1 , k2 ! Wind Speed
79  ! The LUT interpolation boundary check
80  LOGICAL, ALLOCATABLE :: a_outbound(:) ! Angle
81  LOGICAL :: f_outbound ! Frequency
82  LOGICAL :: v_outbound ! Wind Speed
83  ! The interpolation input
84  REAL(fp), ALLOCATABLE :: a_int(:) ! Angle
85  REAL(fp) :: f_int ! Frequency
86  REAL(fp) :: v_int ! Wind Speed
87  ! The data to be interpolated
88  REAL(fp), ALLOCATABLE :: a(:,:) ! Angle
89  REAL(fp), ALLOCATABLE :: f(:) ! Frequency
90  REAL(fp), ALLOCATABLE :: v(:) ! Wind Speed
91  END TYPE einterp_type
92 
93  ! The main internal variable structure
94  TYPE :: ivar_type
95  PRIVATE
96  ! The interpolation data
97  TYPE(einterp_type) :: ei
98  END TYPE ivar_type
99 
100 
101 CONTAINS
102 
103 
104 !################################################################################
105 !################################################################################
106 !## ##
107 !## ## PUBLIC MODULE ROUTINES ## ##
108 !## ##
109 !################################################################################
110 !################################################################################
111 
112 
113 !--------------------------------------------------------------------------------
114 !:sdoc+:
115 !
116 ! NAME:
117 ! CRTM_Compute_IRSSEM
118 !
119 ! PURPOSE:
120 ! Function to compute the CRTM infrared sea surface emissivity (IRSSE)
121 ! for input wind speed, frequency, and angles.
122 !
123 ! CALLING SEQUENCE:
124 ! Error_Status = CRTM_Compute_IRSSEM( IRwaterCoeff, &
125 ! Wind_Speed , &
126 ! Frequency , &
127 ! Angle , &
128 ! iVar , &
129 ! Emissivity )
130 !
131 ! INPUTS:
132 ! IRwaterCoeff: Infrared water emissivity model coefficient object.
133 ! Load the object with the coefficients for the emissivity
134 ! model to use.
135 ! UNITS: N/A
136 ! TYPE: IRwaterCoeff_type
137 ! DIMENSION: Scalar
138 ! ATTRIBUTES: INTENT(IN)
139 !
140 ! Wind_Speed: Wind speed.
141 ! UNITS: metres per second (m.s^-1)
142 ! TYPE: REAL(fp)
143 ! DIMENSION: Scalar
144 ! ATTRIBUTES: INTENT(IN)
145 !
146 ! Frequency: Infrared frequency.
147 ! UNITS: inverse centimetres (cm^-1)
148 ! TYPE: REAL(fp)
149 ! DIMENSION: Scalar
150 ! ATTRIBUTES: INTENT(IN)
151 !
152 ! Angle: Surface zenith angle.
153 ! UNITS: Degrees
154 ! TYPE: REAL(fp)
155 ! DIMENSION: Rank-1 (n_Angles)
156 ! ATTRIBUTES: INTENT(IN)
157 !
158 ! OUTPUTS:
159 ! iVar: Structure containing internal variables required for
160 ! subsequent tangent-linear or adjoint model calls.
161 ! The contents of this structure are NOT accessible
162 ! outside of this module.
163 ! UNITS: N/A
164 ! TYPE: iVar_type
165 ! DIMENSION: Scalar
166 ! ATTRIBUTES: INTENT(OUT)
167 !
168 ! Emissivity: Sea surface emissivities for the
169 ! requested wind speed, frequency, and angles.
170 ! UNITS: N/A
171 ! TYPE: REAL(fp)
172 ! DIMENSION: Same as input ANGLE argument.
173 ! ATTRIBUTES: INTENT(OUT)
174 !
175 ! FUNCTION RESULT:
176 ! Error_Status: The return value is an integer defining the error status.
177 ! The error codes are defined in the Message_Handler module.
178 ! If == SUCCESS the computation was successful.
179 ! == FAILURE an unrecoverable error occurred.
180 ! UNITS: N/A
181 ! TYPE: INTEGER
182 ! DIMENSION: Scalar
183 !
184 !:sdoc-:
185 !--------------------------------------------------------------------------------
186 
187  FUNCTION crtm_compute_irssem( &
188  IRwaterCoeff, & ! Input model coefficients
189  Wind_Speed , & ! Input
190  Frequency , & ! Input
191  Angle , & ! Input
192  iVar , & ! Internal variable output
193  Emissivity ) & ! Output
194  result( err_stat )
195  ! Arguments
196  TYPE(irwatercoeff_type), INTENT(IN) :: irwatercoeff
197  REAL(fp) , INTENT(IN) :: wind_speed ! v
198  REAL(fp) , INTENT(IN) :: frequency ! f
199  REAL(fp) , INTENT(IN) :: angle(:) ! a
200  TYPE(ivar_type) , INTENT(OUT) :: ivar
201  REAL(fp) , INTENT(OUT) :: emissivity(:)
202  ! Function result
203  INTEGER :: err_stat
204  ! Local parameters
205  CHARACTER(*), PARAMETER :: routine_name = 'CRTM_Compute_IRSSEM'
206  ! Local variables
207  CHARACTER(ML) :: msg
208  INTEGER :: n_angles, i
209  REAL(fp) :: sec_angle(size(angle))
210 
211  ! Set up
212  err_stat = success
213  ! ...Check dimensions
214  n_angles = SIZE(angle)
215  IF ( SIZE(emissivity) /= n_angles ) THEN
216  err_stat = failure
217  msg = 'Input Angle and output Emissivity array dimensions inconsistent.'
218  CALL display_message( routine_name, msg, err_stat )
219  RETURN
220  END IF
221  ! ...Allocate interpolation variable structure
222  CALL einterp_create( ivar%ei, npts, n_angles )
223  IF ( .NOT. einterp_associated( ivar%ei ) ) THEN
224  err_stat = failure
225  msg = 'Error allocating interpolation variable structure.'
226  CALL display_message( routine_name, msg, err_stat )
227  RETURN
228  END IF
229  ! ...Convert angles to secants
230  sec_angle = one/cos(degrees_to_radians*angle)
231 
232 
233  ! Compute the wind speed interpolating polynomial
234  ! ...Find the LUT indices and check if input is out of bounds
235  ivar%ei%v_int = wind_speed
236  CALL find_index(irwatercoeff%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)
239  ! ...Compute the polynomial
240  CALL lpoly( ivar%ei%v , & ! Input
241  ivar%ei%v_int, & ! Input
242  ivar%ei%ylp ) ! Output
243 
244 
245  ! Compute the frequency interpolating polynomial
246  ! ...Find the LUT indices and check if input is out of bounds
247  ivar%ei%f_int = frequency
248  CALL find_index(irwatercoeff%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)
251  ! ...Compute the polynomial
252  CALL lpoly( ivar%ei%f , & ! Input
253  ivar%ei%f_int, & ! Input
254  ivar%ei%xlp ) ! Output
255 
256 
257  ! Compute the angle interpolating polynomials
258  DO i = 1, n_angles
259 
260  ! ...Find the LUT indices and check if input is out of bounds
261  ivar%ei%a_int(i) = abs(angle(i))
262  CALL find_index(irwatercoeff%Angle, &
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))
265 
266 !! Secant interpolation test
267 !iVar%ei%a_int(i) = sec_angle(i)
268 !CALL find_index(IRwaterCoeff%Secant_Angle, &
269 ! iVar%ei%a_int(i), iVar%ei%i1(i), iVar%ei%i2(i), iVar%ei%a_outbound(i))
270 !iVar%ei%a(:,i) = IRwaterCoeff%Secant_Angle(iVar%ei%i1(i):iVar%ei%i2(i))
271 
272  ! ...Compute the polynomial
273  CALL lpoly( ivar%ei%a(:,i) , & ! Input
274  ivar%ei%a_int(i), & ! Input
275  ivar%ei%wlp(i) ) ! Output
276 
277 
278  ! Compute the interpolated emissivity
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 ), & ! Input
282  ivar%ei%wlp(i), & ! Input
283  ivar%ei%xlp , & ! Input
284  ivar%ei%ylp , & ! Input
285  emissivity(i) ) ! Output
286 
287  END DO
288 
289  END FUNCTION crtm_compute_irssem
290 
291 
292 !--------------------------------------------------------------------------------
293 !:sdoc+:
294 !
295 ! NAME:
296 ! CRTM_Compute_IRSSEM_TL
297 !
298 ! PURPOSE:
299 ! Function to compute the tangent-linear CRTM infrared sea surface
300 ! emissivity (IRSSE) for input wind speed, frequency, and angles.
301 !
302 ! This function must be called *after* the forward model function,
303 ! CRTM_Compute_IRSSEM, has been called. The forward model function
304 ! populates the internal variable structure argument, iVar.
305 !
306 ! CALLING SEQUENCE:
307 ! Error_Status = CRTM_Compute_IRSSEM_TL( IRwaterCoeff , &
308 ! Wind_Speed_TL, &
309 ! iVar , &
310 ! Emissivity_TL )
311 ! INPUTS:
312 ! IRwaterCoeff: Infrared water emissivity model coefficient object.
313 ! Load the object with the coefficients for the emissivity
314 ! model to use.
315 ! UNITS: N/A
316 ! TYPE: IRwaterCoeff_type
317 ! DIMENSION: Scalar
318 ! ATTRIBUTES: INTENT(IN)
319 !
320 ! Wind_Speed_TL: The tangent-linear wind speed.
321 ! UNITS: metres per second (m.s^-1)
322 ! TYPE: REAL(fp)
323 ! DIMENSION: Scalar
324 ! ATTRIBUTES: INTENT(IN)
325 !
326 ! iVar: Structure containing internal variables required for
327 ! subsequent tangent-linear or adjoint model calls.
328 ! The contents of this structure are NOT accessible
329 ! outside of this module.
330 ! UNITS: N/A
331 ! TYPE: iVar_type
332 ! DIMENSION: Scalar
333 ! ATTRIBUTES: INTENT(IN)
334 !
335 ! OUTPUTS:
336 ! Emissivity_TL: Tangent-linear sea surface emissivity.
337 ! UNITS: N/A
338 ! TYPE: REAL(fp)
339 ! DIMENSION: Rank-1 (n_Angles)
340 ! ATTRIBUTES: INTENT(OUT)
341 !
342 ! FUNCTION RESULT:
343 ! Error_Status: The return value is an integer defining the error status.
344 ! The error codes are defined in the Message_Handler module.
345 ! If == SUCCESS the computation was successful.
346 ! == FAILURE an unrecoverable error occurred.
347 ! UNITS: N/A
348 ! TYPE: INTEGER
349 ! DIMENSION: Scalar
350 !
351 !:sdoc-:
352 !--------------------------------------------------------------------------------
353 
354  FUNCTION crtm_compute_irssem_tl( &
355  IRwaterCoeff , & ! Input model coefficients
356  Wind_Speed_TL, & ! Input
357  iVar , & ! Internal variable input
358  Emissivity_TL) & ! Output
359  result( err_stat )
360  ! Arguments
361  TYPE(irwatercoeff_type), INTENT(IN) :: irwatercoeff
362  REAL(fp) , INTENT(IN) :: wind_speed_tl
363  TYPE(ivar_type) , INTENT(IN) :: ivar
364  REAL(fp) , INTENT(OUT) :: emissivity_tl(:)
365  ! Function result
366  INTEGER :: err_stat
367  ! Local parameters
368  CHARACTER(*), PARAMETER :: routine_name = 'CRTM_Compute_IRSSEM_TL'
369  ! Local variables
370  CHARACTER(ML) :: msg
371  INTEGER :: i
372  REAL(fp) :: v_tl(npts)
373  REAL(fp) :: e_tl(npts,npts,npts)
374  TYPE(lpoly_type) :: ylp_tl, xlp_tl, wlp_tl
375 
376  ! Set up
377  err_stat = success
378  ! ...Check internal variable allocation
379  IF ( .NOT. einterp_associated( ivar%ei ) ) THEN
380  err_stat = failure
381  msg = 'Internal structure ei is not allocated'
382  CALL display_message( routine_name, msg, err_stat )
383  RETURN
384  END IF
385  ! ...Check dimensions
386  IF ( SIZE( emissivity_tl ) /= ivar%ei%n_Angles ) THEN
387  err_stat = failure
388  msg = 'Input Emissivity_TL array dimensions inconsistent with number of angles.'
389  CALL display_message( routine_name, msg, err_stat )
390  RETURN
391  END IF
392  ! ...No TL if wind speed is out of bounds
393  IF ( ivar%ei%v_outbound ) THEN
394  emissivity_tl = zero
395  RETURN
396  END IF
397  ! ...Initialise local TL variables
398  v_tl = zero
399  e_tl = zero
400  CALL clear_lpoly(wlp_tl)
401  CALL clear_lpoly(xlp_tl)
402 
403 
404  ! Calculate the TL interpolating
405  ! polynomials for wind speed
406  CALL lpoly_tl( ivar%ei%v, ivar%ei%v_int, & ! FWD Input
407  ivar%ei%ylp, & ! FWD Input
408  v_tl, wind_speed_tl, & ! TL Input
409  ylp_tl ) ! TL Output
410 
411 
412  ! Begin loop over angles
413  DO i = 1, ivar%ei%n_Angles
414 
415  ! Perform interpolation
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 ), & ! FWD Emissivity input
419  ivar%ei%wlp(i), & ! FWD polynomial input
420  ivar%ei%xlp , & ! FWD polynomial input
421  ivar%ei%ylp , & ! FWD polynomial input
422  e_tl, wlp_tl, xlp_tl, ylp_tl, & ! TL input
423  emissivity_tl(i) ) ! Output
424 
425  END DO
426 
427  END FUNCTION crtm_compute_irssem_tl
428 
429 
430 !--------------------------------------------------------------------------------
431 !:sdoc+:
432 !
433 ! NAME:
434 ! CRTM_Compute_IRSSEM_AD
435 !
436 ! PURPOSE:
437 ! Function to compute the adjoint of the CRTM infrared sea surface
438 ! emissivity (IRSSE) for input wind speed, frequency, and angles.
439 !
440 ! This function must be called *after* the forward model function,
441 ! CRTM_Compute_IRSSEM, has been called. The forward model function
442 ! populates the internal variable structure argument, iVar.
443 !
444 ! CALLING SEQUENCE:
445 ! Error_Status = CRTM_Compute_IRSSEM_AD( IRwaterCoeff , &
446 ! Emissivity_AD, &
447 ! iVar , &
448 ! Wind_Speed_AD )
449 !
450 ! INPUTS:
451 ! IRwaterCoeff: Infrared water emissivity model coefficient object.
452 ! Load the object with the coefficients for the emissivity
453 ! model to use.
454 ! UNITS: N/A
455 ! TYPE: IRwaterCoeff_type
456 ! DIMENSION: Scalar
457 ! ATTRIBUTES: INTENT(IN)
458 !
459 ! Emissivity_AD: Adjoint sea surface emissivity.
460 ! *** SET TO ZERO ON EXIT ***
461 ! UNITS: N/A
462 ! TYPE: REAL(fp)
463 ! DIMENSION: Rank-1 (n_Angles)
464 ! ATTRIBUTES: INTENT(IN OUT)
465 !
466 ! iVar: Structure containing internal variables required for
467 ! subsequent tangent-linear or adjoint model calls.
468 ! The contents of this structure are NOT accessible
469 ! outside of this module.
470 ! UNITS: N/A
471 ! TYPE: iVar_type
472 ! DIMENSION: Scalar
473 ! ATTRIBUTES: INTENT(IN)
474 !
475 ! OUTPUTS:
476 ! Wind_Speed_AD: Adjoint wind speed.
477 ! *** MUST HAVE VALUE ON ENTRY ***
478 ! UNITS: per metres per second, (m.s^-1)^-1
479 ! TYPE: REAL(fp)
480 ! DIMENSION: Scalar
481 ! ATTRIBUTES: INTENT(IN OUT)
482 !
483 ! FUNCTION RESULT:
484 ! Error_Status: The return value is an integer defining the error status.
485 ! The error codes are defined in the Message_Handler module.
486 ! If == SUCCESS the computation was successful.
487 ! == FAILURE an unrecoverable error occurred.
488 ! UNITS: N/A
489 ! TYPE: INTEGER
490 ! DIMENSION: Scalar
491 !
492 !:sdoc-:
493 !--------------------------------------------------------------------------------
494 
495  FUNCTION crtm_compute_irssem_ad( &
496  IRwaterCoeff , & ! Input model coefficients
497  Emissivity_AD, & ! Input
498  iVar , & ! Internal Variable Input
499  Wind_Speed_AD) & ! Output
500  result( err_stat )
501  ! Arguments
502  TYPE(irwatercoeff_type), INTENT(IN) :: irwatercoeff
503  REAL(fp) , INTENT(IN OUT) :: emissivity_ad(:)
504  TYPE(ivar_type) , INTENT(IN) :: ivar
505  REAL(fp) , INTENT(IN OUT) :: wind_speed_ad
506  ! Function result
507  INTEGER :: err_stat
508  ! Local parameters
509  CHARACTER(*), PARAMETER :: routine_name = 'CRTM_Compute_IRSSEM_AD'
510  ! Local variables
511  CHARACTER(ML) :: msg
512  INTEGER :: i
513  REAL(fp) :: e_ad(npts,npts,npts)
514  REAL(fp) :: v_ad(npts)
515  TYPE(lpoly_type) :: wlp_ad, xlp_ad, ylp_ad
516 
517  ! Set Up
518  err_stat = success
519  e_ad = zero
520  v_ad = zero
521  ! ...Check internal variable allocation
522  IF ( .NOT. einterp_associated( ivar%ei ) ) THEN
523  err_stat = failure
524  msg = 'Internal structure ei is not allocated'
525  CALL display_message( routine_name, msg, err_stat )
526  RETURN
527  END IF
528  ! ...Check dimensions
529  IF ( SIZE(emissivity_ad) /= ivar%ei%n_Angles ) THEN
530  err_stat = failure
531  msg = 'Input Emissivity_AD array dimensions inconsistent with number of angles.'
532  CALL display_message( routine_name, msg, err_stat )
533  RETURN
534  END IF
535  ! ...No AD if wind speed is out of bounds
536  IF ( ivar%ei%v_outbound ) RETURN
537  ! ...Initialize local variables
538  CALL clear_lpoly(wlp_ad)
539  CALL clear_lpoly(xlp_ad)
540  CALL clear_lpoly(ylp_ad)
541 
542  ! Loop over emissivity calculation angles
543  DO i = 1, ivar%ei%n_Angles
544 
545  ! Get the adjoint interpoalting polynomial for wind speed
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 ), & ! FWD Input
549  ivar%ei%wlp(i) , & ! FWD Input
550  ivar%ei%xlp , & ! FWD Input
551  ivar%ei%ylp , & ! FWD Input
552  emissivity_ad(i), & ! AD Input
553  e_ad, wlp_ad, xlp_ad, ylp_ad ) ! AD Output
554 
555  ! Set adjoint emissivity to zero
556  emissivity_ad(i) = zero
557 
558  END DO
559 
560  ! Compute the wind speed adjoint
561  CALL lpoly_ad(ivar%ei%v , & ! FWD Input
562  ivar%ei%v_int, & ! FWD Input
563  ivar%ei%ylp , & ! FWD Input
564  ylp_ad , & ! AD Input
565  v_ad , & ! AD Output
566  wind_speed_ad ) ! AD Output
567 
568  END FUNCTION crtm_compute_irssem_ad
569 
570 
571 !################################################################################
572 !################################################################################
573 !## ##
574 !## ## PRIVATE MODULE ROUTINES ## ##
575 !## ##
576 !################################################################################
577 !################################################################################
578 
579  ! ----------------------------------------------
580  ! Procedures to manipulate the Einterp structure
581  ! ----------------------------------------------
582  ELEMENTAL FUNCTION einterp_associated( ei ) RESULT( Status )
583  TYPE(einterp_type), INTENT(IN) :: ei
584  LOGICAL :: status
585  status = ei%Is_Allocated
586  END FUNCTION einterp_associated
587 
588  ELEMENTAL SUBROUTINE einterp_create( ei, n_Pts, n_Angles )
589  TYPE(einterp_type), INTENT(OUT) :: ei
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) , &
595  ei%i1(n_angles) , &
596  ei%i2(n_angles) , &
597  ei%a_outbound(n_angles), &
598  ei%a_int(n_angles) , &
599  ei%a(n_pts,n_angles) , &
600  ei%f(n_pts) , &
601  ei%v(n_pts) , &
602  stat = alloc_stat )
603  IF ( alloc_stat /= 0 ) RETURN
604  ei%n_Angles = n_angles
605  ei%n_Pts = n_pts
606  ei%Is_Allocated = .true.
607  END SUBROUTINE einterp_create
608 
609 END MODULE crtm_irssem
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
Definition: Type_Kinds.f90:124
integer, parameter ml
Definition: CRTM_IRSSEM.f90:56
elemental logical function einterp_associated(ei)
elemental subroutine einterp_create(ei, n_Pts, n_Angles)
subroutine, public clear_lpoly(p)
character(*), parameter module_version_id
Definition: CRTM_IRSSEM.f90:53
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)
integer function, public crtm_compute_irssem(IRwaterCoeff, Wind_Speed, Frequency, Angle, iVar, Emissivity)
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
integer function, public crtm_compute_irssem_tl(IRwaterCoeff, Wind_Speed_TL, iVar, Emissivity_TL)
integer function, public crtm_compute_irssem_ad(IRwaterCoeff, Emissivity_AD, iVar, Wind_Speed_AD)