Opened 3 years ago

Last modified 3 years ago

#890 closed upgrade

Important: Updated ROMS interpolation Object — at Version 2

Reported by: arango Owned by:
Priority: major Milestone: Release ROMS/TOMS 4.0
Component: Nonlinear Version: 3.9
Keywords: Cc:

Description (last modified by arango)

The interpolation module inside interpolate.F is renamed to roms_interpolate_mod to differentiate with other interpolation objects inside JEDI. It now includes the following overloading routines:

     INTERFACE roms_datum_interp
       MODULE PROCEDURE roms_datum_interp_2d
       MODULE PROCEDURE roms_datum_interp_3d
       MODULE PROCEDURE roms_datum_column_interp
     END INTERFACE roms_datum_interp
!
     INTERFACE roms_horiz_interp
       MODULE PROCEDURE roms_horiz_interp_2d
       MODULE PROCEDURE roms_horiz_interp_3d
     END INTERFACE roms_horiz_interp

All these overloading routines use the roms_interp_type object structure, say S, for the ROMS-JEDI interface. In the future, it can be used for regridding inside ROMS. They can be used in different ways:

  • Interpolate a ROMS 2D state field to observation locations (ObsVetting is an optional output argument)
    CALL roms_datum_interp (S, fld2d, datum(:), method)
    
  • Interpolate a ROMS 3D state field to observation locations (ObsVetting is an optional output argument)
    CALL roms_datum_interp (S, fld3d, zfld3d, zlocs(:), datum(:), method)
    
  • Interpolate a ROMS 3D state field to observation locations level-by-level and returns datum(1:nlevs,1:nlocs)
    CALL roms_datum_interp (S, fld3d, zfld3d, datum(:,:), method)
    
  • Interpolate a ROMS 2D source field to a new destination location (2D remapping)
    CALL roms_horiz_interp (S, fld2d_src, fld2d_dst, method)
    
  • Interpolate a ROMS 3D source field to a new destination locations level-by-level (3D remapping)
    CALL roms_horiz_interp (S, fld2d_src, fld2d_dst, method)
    

It also includes managing routines for the "roms_interp_type" object.

  • Create a ROMS interpolation object
    CALL roms_interp_create (ng, S)
    
  • Destroy interpolation object:
    CALL roms_interp_delete (S)
    
  • Compute the horizontal fractional coordinates S%x_dst and S%y_dst of the source cells containing the destination values to facilitate interpolation.
    CALL roms_interp_fractional (S)
    

The adjoint of the interpolation object still needs to be coded when the design of the interpolation object is final.

Currently, the interpolation object has the following declarations:

      TYPE :: roms_interp_type

        logical :: rectangular = .FALSE.            ! plaid grid switch
!
        integer :: ng                               ! nested grid number
        integer :: model                            ! model identifier
!
        real(r8):: spval                            ! unbounded value
!
!  Source grid array declaration bounds, tile partition range,
!  longitude/latitude, curvilinear angle, and land/sea mask
!
        integer :: LBi_src, UBi_src, LBj_src, UBj_src
        integer :: Istr_src, Iend_src, Jstr_src, Jend_src
!
        real(r8) :: min_src, max_src
!
        real(r8), allocatable :: lon_src(:,:)
        real(r8), allocatable :: lat_src(:,:)

        real(r8), allocatable :: angle_src(:,:)
        real(r8), allocatable :: mask_src(:,:)
!
!  Destination grid array declaration bounds, tile partition range,
!  longitude/latitude, fractional coordinates, and land/sea mask.
!
        integer :: LBi_dst, UBi_dst, LBj_dst, UBj_dst
        integer :: Istr_dst, Iend_dst, Jstr_dst, Jend_dst
!
        real(r8) :: min_dst, max_dst
!
        real(r8), allocatable :: lon_dst(:,:)
        real(r8), allocatable :: lat_dst(:,:)

        real(r8), allocatable :: mask_dst(:,:)

        real(r8), allocatable :: x_dst(:,:)
        real(r8), allocatable :: y_dst(:,:)

      END TYPE roms_interp_type

It can be easily converted to a Fortran 2003 CLASS object by incorporating the interpolation and managing routines.

Change History (2)

comment:1 by arango, 3 years ago

Description: modified (diff)
Resolution: Done
Status: newclosed

comment:2 by arango, 3 years ago

Description: modified (diff)
Resolution: Done
Status: closedreopened

Changed pointers to allocatable arrays to facilitate manipulation of the source and destination components of the interpolation object. Pointers are too finicky to changes in array rank.

Note: See TracTickets for help on using tickets.