Oasis3-MCT
Data Types | Functions/Subroutines | Variables
mod_oasis_grid Module Reference

OASIS grid data and methods. More...

Data Types

interface  oasis_write_angle
 Generic interface to support writing 4 or 8 byte reals. More...
 
interface  oasis_write_area
 Generic interface to support writing 4 or 8 byte reals. More...
 
interface  oasis_write_corner
 Generic interface to support writing 4 or 8 byte reals. More...
 
interface  oasis_write_grid
 Generic interface to support writing 4 or 8 byte reals. More...
 
type  prism_grid_type
 Model grid data for creating mapping data and conserving fields. More...
 

Functions/Subroutines

subroutine, public oasis_print_grid_data ()
 Print grid information to log file. More...
 
subroutine, public oasis_start_grids_writing (iwrite)
 User interface to initialize grid writing. More...
 
subroutine oasis_write_grid_r8 (cgrid, nx, ny, lon, lat, partid)
 User interface to set latitudes and longitudes for 8 byte reals. More...
 
subroutine oasis_write_grid_r4 (cgrid, nx, ny, lon, lat, partid)
 User interface to set latitudes and longitudes for 4 byte reals. More...
 
subroutine oasis_write_angle_r8 (cgrid, nx, ny, angle, partid)
 User interface to set angle for 8 byte reals. More...
 
subroutine oasis_write_angle_r4 (cgrid, nx, ny, angle, partid)
 User interface to set angle for 4 byte reals. More...
 
subroutine oasis_write_corner_r8 (cgrid, nx, ny, nc, clon, clat, partid)
 User interface to set corner latitudes and longitudes for 8 byte reals. More...
 
subroutine oasis_write_corner_r4 (cgrid, nx, ny, nc, clon, clat, partid)
 User interface to set corner latitudes and longitudes for 4 byte reals. More...
 
subroutine, public oasis_write_mask (cgrid, nx, ny, mask, partid)
 User interface to set integer mask values. More...
 
subroutine oasis_write_area_r8 (cgrid, nx, ny, area, partid)
 User interface to set area values for 8 byte reals. More...
 
subroutine oasis_write_area_r4 (cgrid, nx, ny, area, partid)
 User interface to set area values for 4 byte reals. More...
 
subroutine, public oasis_terminate_grids_writing ()
 User interface to indicate user defined grids are done. More...
 
subroutine, public oasis_write2files ()
 Interface that actually writes fields to grid files. More...
 
subroutine oasis_findgrid (cgrid, nx, ny, gridID)
 Local interface to find gridID for a specified grid name. More...
 
subroutine oasis_grid_loc2glo (aloc, aglo, partid, taskid)
 Local routine that gathers the local array using partition information. More...
 

Variables

integer(kind=ip_intwp_p), parameter mgrid = 100
 maximum number of grids allowed More...
 
integer(kind=ip_intwp_p), save writing_grids_call =0
 
integer(kind=ip_intwp_p), save, public prism_ngrid = 0
 counter for grids More...
 
type(prism_grid_type), dimension(mgrid), save, public prism_grid
 array of grid datatypes More...
 
logical, parameter local_timers_on = .false.
 

Detailed Description

OASIS grid data and methods.

These interfaces support both grid data specified globally on the root task as required in Oasis3 and grid data decomposed across tasks. If grid data is decomposed across tasks, the optional partid argument must be specified when it exists in the interface.

Function/Subroutine Documentation

◆ oasis_findgrid()

subroutine mod_oasis_grid::oasis_findgrid ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
integer(kind=ip_intwp_p), intent(out)  gridID 
)
private

Local interface to find gridID for a specified grid name.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[out]grididgridID matching cgrid

Definition at line 1217 of file mod_oasis_grid.F90.

◆ oasis_grid_loc2glo()

subroutine mod_oasis_grid::oasis_grid_loc2glo ( real(kind=ip_realwp_p), dimension(:,:), intent(in)  aloc,
real(kind=ip_realwp_p), dimension(:,:), intent(inout)  aglo,
integer(kind=ip_i4_p), intent(in)  partid,
integer(kind=ip_i4_p), intent(in)  taskid 
)
private

Local routine that gathers the local array using partition information.

Parameters
[in]aloclocal array
[in,out]agloglobal array
[in]partidpartition id for local data
[in]taskidtask id to gather data to

Definition at line 1267 of file mod_oasis_grid.F90.

◆ oasis_print_grid_data()

subroutine, public mod_oasis_grid::oasis_print_grid_data ( )

Print grid information to log file.

Definition at line 156 of file mod_oasis_grid.F90.

◆ oasis_start_grids_writing()

subroutine, public mod_oasis_grid::oasis_start_grids_writing ( integer(kind=ip_intwp_p), intent(out)  iwrite)

User interface to initialize grid writing.

Parameters
[out]iwriteflag, obsolete

Definition at line 213 of file mod_oasis_grid.F90.

◆ oasis_terminate_grids_writing()

subroutine, public mod_oasis_grid::oasis_terminate_grids_writing ( )

User interface to indicate user defined grids are done.

Definition at line 822 of file mod_oasis_grid.F90.

◆ oasis_write2files()

subroutine, public mod_oasis_grid::oasis_write2files ( )

Interface that actually writes fields to grid files.

Write fields to grid files. Only write fields that have been buffered and if prism_grid_terminate_grids_writing has been called. This is called by all tasks from oasis_enddef.

  • Check that a grid defined on a partitition is defined on all tasks on that partition.
  • Write grid information
    • Determine which tasks are associated with the grid information
    • Check that array sizes match for all fields
    • Gather longitudes if needed and write from root
    • Gather latitudes if needed and write from root
    • Gather corner longitudes if needed and write from root
    • Gather corner latitudes if needed and write from root
    • Gather areas if needed and write from root
    • Gather angles if needed and write from root
    • Gather masks if needed and write from root

Definition at line 855 of file mod_oasis_grid.F90.

◆ oasis_write_angle_r4()

subroutine mod_oasis_grid::oasis_write_angle_r4 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
real(kind=ip_single_p), dimension(:,:), intent(in)  angle,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set angle for 4 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]angleangles
[in]partidpartition id if nonglobal data

Definition at line 450 of file mod_oasis_grid.F90.

◆ oasis_write_angle_r8()

subroutine mod_oasis_grid::oasis_write_angle_r8 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
real(kind=ip_double_p), dimension(:,:), intent(in)  angle,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set angle for 8 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]angleangles
[in]partidpartition id if nonglobal data

Definition at line 392 of file mod_oasis_grid.F90.

◆ oasis_write_area_r4()

subroutine mod_oasis_grid::oasis_write_area_r4 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
real(kind=ip_single_p), dimension(:,:), intent(in)  area,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set area values for 4 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]areaareas
[in]partidpartition id if nonglobal data

Definition at line 764 of file mod_oasis_grid.F90.

◆ oasis_write_area_r8()

subroutine mod_oasis_grid::oasis_write_area_r8 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
real(kind=ip_double_p), dimension(:,:), intent(in)  area,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set area values for 8 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]areaareas
[in]partidpartition id if nonglobal data

Definition at line 705 of file mod_oasis_grid.F90.

◆ oasis_write_corner_r4()

subroutine mod_oasis_grid::oasis_write_corner_r4 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
integer(kind=ip_intwp_p), intent(in)  nc,
real(kind=ip_single_p), dimension(:,:,:), intent(in)  clon,
real(kind=ip_single_p), dimension(:,:,:), intent(in)  clat,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set corner latitudes and longitudes for 4 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]ncnumber of corners per cell
[in]cloncorner longitudes
[in]clatcorner latitudes
[in]partidpartition id if nonglobal data

Definition at line 577 of file mod_oasis_grid.F90.

◆ oasis_write_corner_r8()

subroutine mod_oasis_grid::oasis_write_corner_r8 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
integer(kind=ip_intwp_p), intent(in)  nc,
real(kind=ip_double_p), dimension(:,:,:), intent(in)  clon,
real(kind=ip_double_p), dimension(:,:,:), intent(in)  clat,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set corner latitudes and longitudes for 8 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]ncnumber of corners per cell
[in]cloncorner longitudes
[in]clatcorner latitudes
[in]partidpartition id if nonglobal data

Definition at line 507 of file mod_oasis_grid.F90.

◆ oasis_write_grid_r4()

subroutine mod_oasis_grid::oasis_write_grid_r4 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
real(kind=ip_single_p), dimension(:,:), intent(in)  lon,
real(kind=ip_single_p), dimension(:,:), intent(in)  lat,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set latitudes and longitudes for 4 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]lonlongitudes
[in]latlatitudes
[in]partidpartition id if nonglobal data

Definition at line 324 of file mod_oasis_grid.F90.

◆ oasis_write_grid_r8()

subroutine mod_oasis_grid::oasis_write_grid_r8 ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
real(kind=ip_double_p), dimension(:,:), intent(in)  lon,
real(kind=ip_double_p), dimension(:,:), intent(in)  lat,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)
private

User interface to set latitudes and longitudes for 8 byte reals.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]lonlongitudes
[in]latlatitudes
[in]partidpartition id if nonglobal data

Definition at line 255 of file mod_oasis_grid.F90.

◆ oasis_write_mask()

subroutine, public mod_oasis_grid::oasis_write_mask ( character(len=*), intent(in)  cgrid,
integer(kind=ip_intwp_p), intent(in)  nx,
integer(kind=ip_intwp_p), intent(in)  ny,
integer(kind=ip_intwp_p), dimension(:,:), intent(in)  mask,
integer(kind=ip_intwp_p), intent(in), optional  partid 
)

User interface to set integer mask values.

Parameters
[in]cgridgrid name
[in]nxglobal nx size
[in]nyglobal ny size
[in]maskmask array
[in]partidpartition id if nonglobal data

Definition at line 646 of file mod_oasis_grid.F90.

Variable Documentation

◆ local_timers_on

logical, parameter mod_oasis_grid::local_timers_on = .false.
private

Definition at line 141 of file mod_oasis_grid.F90.

◆ mgrid

integer(kind=ip_intwp_p), parameter mod_oasis_grid::mgrid = 100
private

maximum number of grids allowed

Definition at line 113 of file mod_oasis_grid.F90.

◆ prism_grid

type(prism_grid_type), dimension(mgrid), save, public mod_oasis_grid::prism_grid

array of grid datatypes

Definition at line 140 of file mod_oasis_grid.F90.

◆ prism_ngrid

integer(kind=ip_intwp_p), save, public mod_oasis_grid::prism_ngrid = 0

counter for grids

Definition at line 139 of file mod_oasis_grid.F90.

◆ writing_grids_call

integer(kind=ip_intwp_p), save mod_oasis_grid::writing_grids_call =0
private

Definition at line 114 of file mod_oasis_grid.F90.