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

Initialize the OASIS coupler infrastructure. More...

Data Types

type  prism_coupler_type
 Coupler data for managing all aspects of coupling in OASIS. More...
 
type  prism_router_type
 Router information for rearranging data on tasks. More...
 

Functions/Subroutines

subroutine, public oasis_coupler_setup ()
 Main routine to setup couplers. More...
 
subroutine oasis_coupler_print (cplid, pcprint)
 Print routine for oasis_couplers. More...
 
subroutine, public oasis_coupler_bldvarname (varid, varnum, vname)
 Build a consistent variable name based on bundles. More...
 
subroutine, public oasis_coupler_unbldvarname (varid, vname, varnum)
 Deconstruct the varname based on oasis_coupler_bldvarname. More...
 
subroutine cplfind (num, fldlist, fld, ifind, nfind)
 Search a character field list for a matching values. More...
 

Variables

integer(kind=ip_i4_p), parameter, public prism_coupler_avsmax =5
 maximum number of higher order terms in mapping More...
 
integer(kind=ip_i4_p) prism_mrouter
 max routers More...
 
integer(kind=ip_i4_p) prism_nrouter = 0
 router counter More...
 
type(prism_router_type), dimension(:), pointer, public prism_router
 prism_router array More...
 
integer(kind=ip_i4_p), public prism_mcoupler
 max couplers More...
 
type(prism_coupler_type), dimension(:), pointer, public prism_coupler_put
 prism_coupler put array More...
 
type(prism_coupler_type), dimension(:), pointer, public prism_coupler_get
 prism_coupler get array More...
 
integer(kind=ip_i4_p), public lastseq
 last coupler sequence More...
 
integer(kind=ip_i4_p), public lastseqtime
 last coupler sequence time More...
 
logical, public allow_no_restart
 flag to allow no restart files at startup More...
 

Detailed Description

Initialize the OASIS coupler infrastructure.

Function/Subroutine Documentation

◆ cplfind()

subroutine mod_oasis_coupler::cplfind ( integer(in), intent(in)  num,
character(len=cl), dimension(:), intent(in)  fldlist,
character(len=cl), intent(in)  fld,
integer(in), intent(out)  ifind,
integer(in), intent(out)  nfind 
)
private

Search a character field list for a matching values.

Parameters
[in]numsize of array
[in]fldlistsorted field list
[in]fldfield to search for
[out]ifindfirst match index
[out]nfindnumber that match

Definition at line 2106 of file mod_oasis_coupler.F90.

◆ oasis_coupler_bldvarname()

subroutine, public mod_oasis_coupler::oasis_coupler_bldvarname ( integer(ip_i4_p), intent(in)  varid,
integer(ip_i4_p), intent(in)  varnum,
character(len=*), intent(out)  vname 
)

Build a consistent variable name based on bundles.

Parameters
[in]varidvariable id
[in]varnumvariable bundle level number
[out]vnamevariable name

Definition at line 2012 of file mod_oasis_coupler.F90.

◆ oasis_coupler_print()

subroutine mod_oasis_coupler::oasis_coupler_print ( integer(ip_i4_p), intent(in)  cplid,
type(prism_coupler_type), intent(in)  pcprint 
)
private

Print routine for oasis_couplers.

Parameters
[in]cplidcoupler id
[in]pcprintspecific prism_coupler

Definition at line 1904 of file mod_oasis_coupler.F90.

◆ oasis_coupler_setup()

subroutine, public mod_oasis_coupler::oasis_coupler_setup ( )

Main routine to setup couplers.

This routine initializes all the coupler data based on the namcouple inputs and the calls into the OASIS initialization interfaces from models. It reconciles everything. This is called from oasis_enddef.

  • Allocate and zero prism_router, prism_mapper, prism_coupler based on nnamcpl
  • Generate model variable lists across all models based on def_var calls. These will be reconciled with the namcouple input. These are sorted to improve search performance later.
  • Setup couplers based on namcouple and model variable info.
  • Preprocess namcouple strings and sort for faster searches
  • Loop over all my model variables
    • Get parition and field information
    • Check if variable is In or Out and then find namcouple matches
    • Loop over the namcouple matches
      • Migrate namcouple info into part
      • Make sure it's either an In or Out, sanity check
      • Determine matching field name from namcouple
      • Search for list of models with other variable
      • Loop over those other matching variable names
        • Check that one side is In and other side is Out for communication
        • Check if input or output, field name should match on both sides.
        • Check that the bundle size matches in both models for bundled fields
        • Generate field list, multiple field support
        • Add this coupler to list of prism_var couplers
        • Copy namcouple settings into this coupler or check that coupler is consistent with prior setting
        • Set prism_coupler input and output flags
        • Setup prism_coupler router
        • Setup prism_coupler mapper
        • Try to reuse mapper already defined, must match mapping file and partition
        • Or get ready to initialize a new mapper
  • Rebuild the fields list based on field bundles as needed
  • Initialize coupling infrastructure based on initial coupler setup above
  • Loop over all couplers
    • Initialize avect1 which stores the get/put data
    • Compute nflds for this coupling and initialize avcnt and status
    • Initialize the mapper data
    • Read mapper mask and area if not already done
    • Initialize avect1m, the data in avect1 mapped to another grid
    • Initialize router based on rpartID
  • Diagnostics for all couplers

Definition at line 121 of file mod_oasis_coupler.F90.

◆ oasis_coupler_unbldvarname()

subroutine, public mod_oasis_coupler::oasis_coupler_unbldvarname ( integer(ip_i4_p), intent(in)  varid,
character(len=*), intent(in)  vname,
integer(ip_i4_p), intent(out)  varnum 
)

Deconstruct the varname based on oasis_coupler_bldvarname.

Parameters
[in]varidvariable id
[in]vnamevariable name
[out]varnumvariable bundle level number

Definition at line 2055 of file mod_oasis_coupler.F90.

Variable Documentation

◆ allow_no_restart

logical, public mod_oasis_coupler::allow_no_restart

flag to allow no restart files at startup

Definition at line 106 of file mod_oasis_coupler.F90.

◆ lastseq

integer(kind=ip_i4_p), public mod_oasis_coupler::lastseq

last coupler sequence

Definition at line 104 of file mod_oasis_coupler.F90.

◆ lastseqtime

integer(kind=ip_i4_p), public mod_oasis_coupler::lastseqtime

last coupler sequence time

Definition at line 105 of file mod_oasis_coupler.F90.

◆ prism_coupler_avsmax

integer(kind=ip_i4_p), parameter, public mod_oasis_coupler::prism_coupler_avsmax =5

maximum number of higher order terms in mapping

Definition at line 44 of file mod_oasis_coupler.F90.

◆ prism_coupler_get

type(prism_coupler_type), dimension(:), pointer, public mod_oasis_coupler::prism_coupler_get

prism_coupler get array

Definition at line 102 of file mod_oasis_coupler.F90.

◆ prism_coupler_put

type(prism_coupler_type), dimension(:), pointer, public mod_oasis_coupler::prism_coupler_put

prism_coupler put array

Definition at line 101 of file mod_oasis_coupler.F90.

◆ prism_mcoupler

integer(kind=ip_i4_p), public mod_oasis_coupler::prism_mcoupler

max couplers

Definition at line 100 of file mod_oasis_coupler.F90.

◆ prism_mrouter

integer(kind=ip_i4_p) mod_oasis_coupler::prism_mrouter
private

max routers

Definition at line 96 of file mod_oasis_coupler.F90.

◆ prism_nrouter

integer(kind=ip_i4_p) mod_oasis_coupler::prism_nrouter = 0
private

router counter

Definition at line 97 of file mod_oasis_coupler.F90.

◆ prism_router

type(prism_router_type), dimension(:), pointer, public mod_oasis_coupler::prism_router

prism_router array

Definition at line 98 of file mod_oasis_coupler.F90.