coupler_module Module

Variables

VOID cfd_realm md_realm realm_name COUPLER_ERROR_REALM COUPLER_ERROR_ONE_REALM COUPLER_ERROR_INIT COUPLER_ERROR_INPUT_FILE COUPLER_ERROR_READ_INPUT COUPLER_ERROR_CONTINUUM_FORCE COUPLER_ABORT_ON_REQUEST COUPLER_ABORT_SEND_CFD COUPLER_ERROR_CART_COMM ierr CPL_WORLD_COMM CPL_REALM_COMM CPL_INTER_COMM CPL_CART_COMM CPL_OLAP_COMM CPL_GRAPH_COMM CPL_REALM_INTERSECTION_COMM realm myid_world rank_world rootid_world myid_realm rank_realm rootid_realm myid_cart rank_cart rootid_cart myid_olap rank_olap CFDid_olap myid_graph rank_graph rank_world2rank_mdrealm rank_world2rank_mdcart rank_world2rank_cfdrealm rank_world2rank_cfdcart rank_world2rank_olap rank_world2rank_graph rank_world2rank_inter rank_mdrealm2rank_world rank_mdcart2rank_world rank_cfdrealm2rank_world rank_cfdcart2rank_world rank_olap2rank_world rank_graph2rank_world rank_inter2rank_world rank_olap2rank_realm nproc_md nproc_cfd nproc_olap nproc_world npx_md npy_md npz_md npx_cfd npy_cfd npz_cfd olap_mask rank2coord_cfd rank2coord_md coord2rank_cfd coord2rank_md iblock_realm jblock_realm kblock_realm ncx ncy ncz icmin icmax jcmin jcmax kcmin kcmax icmin_olap icmax_olap jcmin_olap jcmax_olap kcmin_olap kcmax_olap ncx_olap ncy_olap ncz_olap constraint_algo constraint_CVflag icmin_cnst icmax_cnst jcmin_cnst jcmax_cnst kcmin_cnst kcmax_cnst cpl_cfd_bc_x cpl_cfd_bc_y cpl_cfd_bc_z cpl_md_bc_slice cpl_cfd_bc_slice constraint_off constraint_OT constraint_NCER constraint_Flekkoy constraint_CV icPmin_md icPmax_md jcPmin_md jcPmax_md kcPmin_md kcPmax_md icPmin_cfd icPmax_cfd jcPmin_cfd jcPmax_cfd kcPmin_cfd kcPmax_cfd xL_md yL_md zL_md xL_cfd yL_cfd zL_cfd xL_olap yL_olap zL_olap xLl yLl zLl dx dy dz dymin dymax xg yg zg cfd_icoord2olap_md_icoords cfd_jcoord2olap_md_jcoords cfd_kcoord2olap_md_kcoords nsteps_md nsteps_cfd nsteps_coupled average_period save_period dt_md dt_cfd density_md density_cfd timestep_ratio md_cfd_match_cellsize testval staggered_averages

Interfaces

Functions


All Modules

  • Uses:

  • ISO_C_BINDING
  • mpi
  • mpi
  • mpi
  • mpi
  • mpi
  • mpi
  • mpi
  • mpi
  • mpi

(cfd+md) Splits MPI_COMM_WORLD in both the CFD and MD code respectively and create intercommunicator between CFD and MD

Read Coupler input file

Writes header information to specified filename in the format Variable description ; variable name ; variable

  • Synopsis

    • CPL_write_header (header_filename)
  • Input

    • header_filename
      • File name to write header to
  • Input/Output

    • NONE
  • Output

    • NONE

@author Edward Smith

Establish for all MD processors the mapping (if any) to coupled CFD processors


Variables

TypeVisibility AttributesNameInitial
integer, public, parameter:: VOID =-666

VOID value for data initialisation

integer, public, parameter:: cfd_realm =1

CFD realm identifier

integer, public, parameter:: md_realm =2

MD realm identifier

character(len=*), public, parameter:: realm_name(2) =(/"CFD","CFD"/)

Used with realm identifier to get name

error codes

integer, public, parameter:: COUPLER_ERROR_REALM =1

wrong realm value

integer, public, parameter:: COUPLER_ERROR_ONE_REALM =2

one realm missing

integer, public, parameter:: COUPLER_ERROR_INIT =3

initialisation error

integer, public, parameter:: COUPLER_ERROR_INPUT_FILE =4

wrong value in input file

integer, public, parameter:: COUPLER_ERROR_READ_INPUT =5

error in processing input file or data transfers

integer, public, parameter:: COUPLER_ERROR_CONTINUUM_FORCE =6

the region in which the continuum constrain force is apply spans over two MD domains

integer, public, parameter:: COUPLER_ABORT_ON_REQUEST =7

used in request_abort

integer, public, parameter:: COUPLER_ABORT_SEND_CFD =8

error in coupler_cfd_send

integer, public, parameter:: COUPLER_ERROR_CART_COMM =9

Wrong comm value in CPL_Cart_coords

MPI error flag

integer, public :: ierr
integer, protected :: CPL_WORLD_COMM

Copy of MPI_COMM_WORLD, both CFD and MD realms;

integer, protected :: CPL_REALM_COMM

INTRA communicators within MD/CFD realms;

integer, protected :: CPL_INTER_COMM

CFD/MD INTER communicator between realm comms;

integer, protected :: CPL_CART_COMM

Comm w/cartesian topology for each realm;

integer, protected :: CPL_OLAP_COMM

Local comm between only overlapping MD/CFD procs;

integer, protected :: CPL_GRAPH_COMM

Comm w/ graph topolgy between locally olapg procs;

integer, protected :: CPL_REALM_INTERSECTION_COMM

Intersecting MD/CFD procs in world;

Simulation realms

integer, protected :: realm
integer, protected :: myid_world

Processor ID from 0 to nproc_world-1;

integer, protected :: rank_world

Processor rank from 1 to nproc_world;

integer, protected :: rootid_world

Root processor in world;

integer, protected :: myid_realm

Processor ID from 0 to nproc_realm-1;

integer, protected :: rank_realm

Processor rank from 1 to nproc_realm;

integer, protected :: rootid_realm

Root processor in each realm;

integer, protected :: myid_cart

Processor ID from 0 to nproc_cart-1;

integer, protected :: rank_cart

Processor rank from 1 to nproc_cart;

integer, protected :: rootid_cart

Root processor in each cart topology;

integer, protected :: myid_olap

Processor ID from 0 to nproc_olap-1;

integer, protected :: rank_olap

Processor rank from 1 to nproc_olap;

integer, protected :: CFDid_olap

Root processor in overlap is the CFD processor;

integer, protected :: myid_graph

Processor ID from 0 to nproc_graph-1;

integer, protected :: rank_graph

Processor rank from 1 to nproc_graph;

Get rank in CPL_world_COMM from rank in local COMM

integer, protected, dimension(:), allocatable:: rank_world2rank_mdrealm
integer, protected, dimension(:), allocatable:: rank_world2rank_mdcart
integer, protected, dimension(:), allocatable:: rank_world2rank_cfdrealm
integer, protected, dimension(:), allocatable:: rank_world2rank_cfdcart
integer, protected, dimension(:), allocatable:: rank_world2rank_olap
integer, protected, dimension(:), allocatable:: rank_world2rank_graph
integer, protected, dimension(:), allocatable:: rank_world2rank_inter

Get rank in local COMM from rank in CPL_world_COMM

integer, protected, dimension(:), allocatable:: rank_mdrealm2rank_world
integer, protected, dimension(:), allocatable:: rank_mdcart2rank_world
integer, protected, dimension(:), allocatable:: rank_cfdrealm2rank_world
integer, protected, dimension(:), allocatable:: rank_cfdcart2rank_world
integer, protected, dimension(:), allocatable:: rank_olap2rank_world
integer, protected, dimension(:), allocatable:: rank_graph2rank_world
integer, protected, dimension(:), allocatable:: rank_inter2rank_world
integer, protected, dimension(:), allocatable:: rank_olap2rank_realm
integer, protected :: nproc_md

Total number of processor in md

integer, protected :: nproc_cfd

Total number of processor in cfd

integer, protected :: nproc_olap

Total number of processor in overlap region

integer, protected :: nproc_world

Total number of processor in world

integer, protected :: npx_md

Number of processor in x in the md

integer, protected :: npy_md

Number of processor in y in the md

integer, protected :: npz_md

Number of processor in z in the md

integer, protected :: npx_cfd

Number of processor in x in the cfd

integer, protected :: npy_cfd

Number of processor in y in the cfd

integer, protected :: npz_cfd

Number of processor in z in the cfd

logical, protected, dimension(:), allocatable:: olap_mask

Overlap mask specifying which processors overlap using world ranks

integer, protected, dimension(:,:), allocatable:: rank2coord_cfd
integer, protected, dimension(:,:), allocatable:: rank2coord_md

Array containing coordinates for each cartesian rank

integer, protected, dimension(:,:,:), allocatable:: coord2rank_cfd
integer, protected, dimension(:,:,:), allocatable:: coord2rank_md

Processor cartesian coords

integer, protected :: iblock_realm
integer, protected :: jblock_realm
integer, protected :: kblock_realm
integer, protected :: ncx
integer, protected :: ncy
integer, protected :: ncz
integer, protected :: icmin
integer, protected :: icmax
integer, protected :: jcmin
integer, protected :: jcmax
integer, protected :: kcmin
integer, protected :: kcmax
integer, protected :: icmin_olap
integer, protected :: icmax_olap
integer, protected :: jcmin_olap
integer, protected :: jcmax_olap
integer, protected :: kcmin_olap
integer, protected :: kcmax_olap
integer, protected :: ncx_olap
integer, protected :: ncy_olap
integer, protected :: ncz_olap
integer, protected :: constraint_algo
integer, protected :: constraint_CVflag
integer, protected :: icmin_cnst
integer, protected :: icmax_cnst
integer, protected :: jcmin_cnst
integer, protected :: jcmax_cnst
integer, protected :: kcmin_cnst
integer, protected :: kcmax_cnst
integer, protected :: cpl_cfd_bc_x
integer, protected :: cpl_cfd_bc_y
integer, protected :: cpl_cfd_bc_z
logical, protected :: cpl_md_bc_slice
logical, protected :: cpl_cfd_bc_slice
integer, public, parameter:: constraint_off =0
integer, public, parameter:: constraint_OT =1
integer, public, parameter:: constraint_NCER =2
integer, public, parameter:: constraint_Flekkoy =3
integer, public, parameter:: constraint_CV =4
integer, protected, dimension(:), allocatable:: icPmin_md
integer, protected, dimension(:), allocatable:: icPmax_md
integer, protected, dimension(:), allocatable:: jcPmin_md
integer, protected, dimension(:), allocatable:: jcPmax_md
integer, protected, dimension(:), allocatable:: kcPmin_md
integer, protected, dimension(:), allocatable:: kcPmax_md
integer, protected, dimension(:), allocatable:: icPmin_cfd
integer, protected, dimension(:), allocatable:: icPmax_cfd
integer, protected, dimension(:), allocatable:: jcPmin_cfd
integer, protected, dimension(:), allocatable:: jcPmax_cfd
integer, protected, dimension(:), allocatable:: kcPmin_cfd
integer, protected, dimension(:), allocatable:: kcPmax_cfd
real(kind=kind(0.d0)), protected :: xL_md
real(kind=kind(0.d0)), protected :: yL_md
real(kind=kind(0.d0)), protected :: zL_md
real(kind=kind(0.d0)), protected :: xL_cfd
real(kind=kind(0.d0)), protected :: yL_cfd
real(kind=kind(0.d0)), protected :: zL_cfd
real(kind=kind(0.d0)), protected :: xL_olap
real(kind=kind(0.d0)), protected :: yL_olap
real(kind=kind(0.d0)), protected :: zL_olap
real(kind=kind(0.d0)), protected :: xLl
real(kind=kind(0.d0)), protected :: yLl
real(kind=kind(0.d0)), protected :: zLl
real(kind=kind(0.d0)), protected :: dx
real(kind=kind(0.d0)), protected :: dy
real(kind=kind(0.d0)), protected :: dz
real(kind=kind(0.d0)), protected :: dymin
real(kind=kind(0.d0)), protected :: dymax
real(kind=kind(0.d0)), protected, dimension(:,:), allocatable, target:: xg
real(kind=kind(0.d0)), protected, dimension(:,:), allocatable, target:: yg
real(kind=kind(0.d0)), protected, dimension(:), allocatable, target:: zg
integer, protected, dimension(:,:), allocatable:: cfd_icoord2olap_md_icoords
integer, protected, dimension(:,:), allocatable:: cfd_jcoord2olap_md_jcoords
integer, protected, dimension(:,:), allocatable:: cfd_kcoord2olap_md_kcoords
integer, protected :: nsteps_md
integer, protected :: nsteps_cfd
integer, protected :: nsteps_coupled
integer, protected :: average_period =1
integer, protected :: save_period =10
real(kind=kind(0.d0)), protected :: dt_md
real(kind=kind(0.d0)), protected :: dt_cfd
real(kind=kind(0.d0)), protected :: density_md
real(kind=kind(0.d0)), protected :: density_cfd
integer, protected :: timestep_ratio
integer, protected :: md_cfd_match_cellsize
integer, protected :: testval
logical, protected :: staggered_averages(3) =(/.false.,.false.,.false./)

Interfaces

public interface error_abort

  • private subroutine error_abort_s(msg)

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in), optional :: msg

    Description

  • private subroutine error_abort_si(msg, i)

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: msg
    integer, intent(in) :: i

    Description


Functions

public function CPL_new_fileunit()

Arguments

None

Return Value integer

Description


Subroutines

public subroutine CPL_create_comm(callingrealm, RETURNED_REALM_COMM, ierror)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: callingrealm
integer, intent(out) :: RETURNED_REALM_COMM
integer, intent(out) :: ierror

Description

public subroutine read_coupler_input()

Arguments

None

Description

public subroutine CPL_write_header(header_filename)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: header_filename

Description

public subroutine coupler_cfd_init(nsteps, dt, icomm_grid, icoord, npxyz_cfd, xyzL, ncxyz, density, ijkcmax, ijkcmin, iTmin, iTmax, jTmin, jTmax, kTmin, kTmax, xgrid, ygrid, zgrid)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nsteps
real(kind=kind(0.d0)), intent(in) :: dt
integer, intent(in) :: icomm_grid
integer, intent(in), dimension(:,:):: icoord
integer, intent(in), dimension(3):: npxyz_cfd
real(kind=kind(0.d0)), intent(in), dimension(3):: xyzL
integer, intent(in), dimension(3):: ncxyz
real(kind=kind(0.d0)), intent(in) :: density
integer, intent(in), dimension(3):: ijkcmax
integer, intent(in), dimension(3):: ijkcmin
integer, intent(in), dimension(:):: iTmin
integer, intent(in), dimension(:):: iTmax
integer, intent(in), dimension(:):: jTmin
integer, intent(in), dimension(:):: jTmax
integer, intent(in), dimension(:):: kTmin
integer, intent(in), dimension(:):: kTmax
real(kind=kind(0.d0)), intent(in), dimension(:,:):: xgrid
real(kind=kind(0.d0)), intent(in), dimension(:,:):: ygrid
real(kind=kind(0.d0)), intent(in), dimension(: ):: zgrid

Description

Initialisation routine for coupler module - Every variable is sent and stored to ensure both md and cfd region have an identical list of parameters

public subroutine coupler_md_init(nsteps, initialstep, dt, icomm_grid, icoord, npxyz_md, globaldomain, density)

Arguments

Type IntentOptional AttributesName
integer, intent(inout) :: nsteps
integer, intent(inout) :: initialstep
real(kind=kind(0.d0)), intent(in) :: dt
integer, intent(in) :: icomm_grid
integer, intent(in), dimension(:,:), allocatable:: icoord
integer, intent(in), dimension(3):: npxyz_md
real(kind=kind(0.d0)), intent(in), dimension(3):: globaldomain
real(kind=kind(0.d0)), intent(in) :: density

Description

Initialisation routine for coupler module - Every variable is sent and stored to ensure both md and cfd region have an identical list of parameters

public subroutine set_coupled_timing(Nsteps, initialstep)

Arguments

Type IntentOptional AttributesName
integer, intent(out) :: Nsteps
integer, intent(in) :: initialstep

Description

public subroutine CPL_create_map()

Arguments

None

Description

map%rank_list(1) = coord2rank_cfd(pcoords(1),pcoords(2),pcoords(3))

public subroutine CPL_cfd_adjust_domain(xL, yL, zL, nx, ny, nz, density_output)

Arguments

Type IntentOptional AttributesName
real(kind=kind(0.d0)), intent(inout), optional :: xL
real(kind=kind(0.d0)), intent(inout), optional :: yL
real(kind=kind(0.d0)), intent(inout), optional :: zL
integer, intent(inout), optional :: nx
integer, intent(inout), optional :: ny
integer, intent(inout), optional :: nz
real(kind=kind(0.d0)), intent(inout), optional :: density_output

Description

public subroutine CPL_rank_map(COMM, rank, nproc, comm2world, world2comm, ierr)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: COMM
integer, intent(out) :: rank
integer, intent(out) :: nproc
integer, intent(out), dimension(:), allocatable:: comm2world
integer, intent(out), dimension(:), allocatable:: world2comm
integer, intent(out) :: ierr

Description

public subroutine locate(fileid, keyword, have_data)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: fileid
character(len=*), intent(in) :: keyword
logical, intent(out) :: have_data

Description

public subroutine messenger_lasterrorcheck()

Arguments

None

Description

public subroutine printf(buf, dplaces_in)

Arguments

Type IntentOptional AttributesName
real(kind=kind(0.d0)), intent(in), dimension(:):: buf
integer, intent(in), optional :: dplaces_in

Description

public subroutine write_matrix_int(a, varname, fh)

Arguments

Type IntentOptional AttributesName
integer, intent(inout), dimension(:,:):: a
character(len=*), intent(inout) :: varname
integer, intent(inout) :: fh

Description

public subroutine write_matrix(a, varname, fh)

Arguments

Type IntentOptional AttributesName
real(kind=kind(0.d0)), intent(inout), dimension(:,:):: a
character(len=*), intent(inout) :: varname
integer, intent(inout) :: fh

Description


© 2015 Fortran Program was written by Edward Smith David Trevelyan.
Documentation generated by FORD.