Oasis3-MCT
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Private Member Functions | List of all members
mod_oasis_advance Module Reference

Advances the OASIS coupling. More...

Public Member Functions

subroutine, public oasis_advance_init (kinfo)
 Initializes the OASIS fields. More...
 
subroutine, public oasis_advance_run (mop, varid, msec, kinfo, nff, namid, array1din, array1dout, array2dout, readrest, a2on, array2, a3on, array3, a4on, array4, a5on, array5)
 Advances the OASIS coupling. More...
 

Private Member Functions

subroutine oasis_advance_map (av1, avd, mapper, conserv, consbfb, avon, av2, av3, av4, av5)
 Provides interpolation functionality. More...
 
subroutine oasis_advance_avsum (av, sum, gsmap, mpicom, mask, wts, consbfb)
 A generic method for summing fields in an attribute vector. More...
 
subroutine oasis_advance_avdiag (av, mpicom, mask, wts)
 A generic method for writing the global sums of fields in an attribute vector. More...
 

Detailed Description

Advances the OASIS coupling.

Definition at line 4 of file mod_oasis_advance.F90.

Member Function/Subroutine Documentation

subroutine mod_oasis_advance::oasis_advance_avdiag ( type(mct_avect), intent(in)  av,
integer(kind=ip_i4_p), intent(in)  mpicom,
integer(kind=ip_i4_p), dimension(:), intent(in), optional  mask,
real(kind=ip_r8_p), dimension(:), intent(in), optional  wts 
)
private

A generic method for writing the global sums of fields in an attribute vector.

Definition at line 1878 of file mod_oasis_advance.F90.

subroutine mod_oasis_advance::oasis_advance_avsum ( type(mct_avect), intent(in)  av,
real(kind=ip_r8_p), dimension(:), intent(inout)  sum,
type(mct_gsmap), intent(in)  gsmap,
integer(kind=ip_i4_p), intent(in)  mpicom,
integer(kind=ip_i4_p), dimension(:), intent(in), optional  mask,
real(kind=ip_r8_p), dimension(:), intent(in), optional  wts,
logical, intent(in), optional  consbfb 
)
private

A generic method for summing fields in an attribute vector.

Definition at line 1776 of file mod_oasis_advance.F90.

subroutine, public mod_oasis_advance::oasis_advance_init ( integer(kind=ip_i4_p), intent(inout)  kinfo)

Initializes the OASIS fields.

Parameters
[in,out]kinfostatus, not used

oasis_advance_init does the following

  • Aborts if it's called from non-active tasks
  • Loop over all coupler connections, Loop over get and put connections, For valid connections
    • Checks that lag is reasonable
    • For put fields that need to read a restart file because of a lag, call oasis_advance_run and read in the restart file. Set readrest to true in oasis_advance_run to indicate it's called from init.
  • Loop over all coupler connections, Loop over get and put connections, For valid connections
    • Read restart for LOCTRANS fields. Do after restart and advance above because prism_advance_run fills in the avect with the array info

Definition at line 33 of file mod_oasis_advance.F90.

subroutine mod_oasis_advance::oasis_advance_map ( type(mct_avect), intent(in)  av1,
type(mct_avect), intent(inout)  avd,
type(prism_mapper_type), intent(inout)  mapper,
integer(kind=ip_i4_p), intent(in), optional  conserv,
logical, intent(in), optional  consbfb,
logical, dimension(:), intent(in), optional  avon,
type(mct_avect), intent(in), optional  av2,
type(mct_avect), intent(in), optional  av3,
type(mct_avect), intent(in), optional  av4,
type(mct_avect), intent(in), optional  av5 
)
private

Provides interpolation functionality.

Maps (regrids, interpolates) data from av1 to avd. av2-av5 are for higher order mapping (hot).

Parameters
[in]av1source av
[in,out]avddst av
[in,out]mapperprism_mapper
[in]conservconserv flag
[in]consbfbconserv bfb option
[in]avonwhich source hot are on
[in]av2source av2 hot
[in]av3source av3 hot
[in]av4source av4 hot
[in]av5source av5 hot

oasis_advance_map does the following

  • check for conservation flags
  • check for higher order terms
  • check consistency between weights and coupling terms
  • run mct sparse matrix mapper on data and separately on hot as needed
  • enforce conservation

Definition at line 1475 of file mod_oasis_advance.F90.

subroutine, public mod_oasis_advance::oasis_advance_run ( integer(kind=ip_i4_p), intent(in)  mop,
integer(kind=ip_i4_p), intent(in)  varid,
integer(kind=ip_i4_p), intent(in)  msec,
integer(kind=ip_i4_p), intent(inout)  kinfo,
integer(kind=ip_i4_p), optional  nff,
integer(kind=ip_i4_p), optional  namid,
real (kind=ip_r8_p), dimension(:), optional  array1din,
real (kind=ip_r8_p), dimension(:), optional  array1dout,
real (kind=ip_r8_p), dimension(:,:), optional  array2dout,
logical, optional  readrest,
logical, optional  a2on,
real (kind=ip_r8_p), dimension(:), optional  array2,
logical, optional  a3on,
real (kind=ip_r8_p), dimension(:), optional  array3,
logical, optional  a4on,
real (kind=ip_r8_p), dimension(:), optional  array4,
logical, optional  a5on,
real (kind=ip_r8_p), dimension(:), optional  array5 
)

Advances the OASIS coupling.

Only one from array1din, array1dout, or array2dout can be passed in. readrest is set to true when called by the oasis_advance_init method. Arrays 2 to 5 are for the higher order terms (hot)

Parameters
[in]mopOASIS_Out or OASIS_In
[in]varidprism_var id
[in]msecmodel time
[in,out]kinfostatus
nffspecify particular field for restart
namidonly do this namcouple method for restart
array1din1D put data
array1dout1D get data
array2dout2D get data
readrestspecial flag to indicate this is called from the advance_init
a2onlogical for array2
array2hot put data
a3onlogical for array3
array3hot put data
a4onlogical for array4
array4hot put data
a5onlogical for array5
array5hot put data

oasis_advance_run does the following

  • Aborts if it's called from non-active tasks
  • Verify field (var) is either In or Out
  • Loop over all the couplers associated with this var
    • check this prism_coupler is valid
    • check again that model op matches coupler op
    • set a bunch of local variables
    • check that lag is reasonable
    • read restart for call from init phase
    • compute lag time, only on put side
    • set time_now, is it a coupling period?
    • check that model hasn't gone past maxtime
    • check that model isn't going backwards
    • check that variable didn't miss a coupling period
    • check that prior sequences weren't missed at this step for get (recv) operation.
    • compute field index and check sizes
    • check for higher order coupling fields and get everything ready
    • update avect1-5 on put side and apply appropriate transform
    • if its coupling time, set status of this var to ready
    • decide if it's time to communicate based on time
    • If it's time to communicate
      • check again that time is correct
      • average as needed for some transforms
      • write to restart file if put and at the end of the run, turn off communication
      • map and communicate operations
      • write to output files if output is turned on
      • set avcnt, avect1, ltime, and status
    • at the end of the run only, save fields associated with non-instant loctrans operations to restart files
    • GET only, unpack avect1 if it's newly received
    • always remember last id and last coupler time

Definition at line 282 of file mod_oasis_advance.F90.


The documentation for this module was generated from the following file: