next up previous contents
Next: About this document ... Up: mainexpand Previous: 6. Performances   Contents

Subsections

7. Annexe: User Guide of Interface Routines

7.1 Initialization

Using the communication layer requires a set of pre initializations by the user. The order of initializations must obey to the following scheme :

  1. First initialize the global size model with SET_DIM.

  2. Pass the maximum number of models, and external point sizes informations with SET_JP_ll.

  3. Set the ratio, origin, hierarchy parameters of all models with corresponding SET subroutines.

  4. Finally, call the INI_PARA_ll subroutine.

  5. To close the paralleization call the END_PARA_ll subroutine.

7.1.1 SET_DIM_ll

SET_DIM_ll subroutine






Synopsis
 

CALL SET_DIM_ll(X, Y, Z)
Arguments
 
IN

INTEGER :: X    
INTEGER :: Y    
INTEGER :: Z    
OUT

Discussion
 

The routine sets the entire model sizes. MUST be called by user to pass the model size to the communication layer. The call is necessary before launching INI_PARA_ll.

Location
 

mode_init.f90


7.1.2 SET_JP_ll

SET_JP_ll subroutine






Synopsis
 

CALL SET_JP_ll(MODELMAX, HEXT, VEXT)
Arguments
 
IN

INTEGER :: MODELMAX    
INTEGER :: HEXT    
INTEGER :: VEXT    
OUT

Discussion
 

The routine sets the maximum number of models MODELMAX, the number of horizontal external points HEXT, and the number of vertical external points VEXT. MUST be called by user to pass informations to the communication layer.

Location
 

mode_init.f90


7.1.3 SET_DAD_ll

SET_DAD_ll subroutine






Synopsis
 

CALL SET_DAD_ll(DAD, NMODEL)
Arguments
 
IN

INTEGER :: DAD    
INTEGER :: NMODEL    
OUT

Discussion
 

The routine sets the number of the dad model DAD for a model NMODEL. If DAD is 0, the model has no father. MUST be called by user to pass informations to the communication layer in multi model case.

Location
 

mode_init.f90


Suggestions
 

7.1.4 SET_LB_X_ll

SET_LB_X_ll subroutine






Synopsis
 

CALL SET_LB_X_ll(LBX, MODEL)
Arguments
 
IN

CHARACTER(LEN=4) :: LBX    
INTEGER :: MODEL    
OUT

Discussion
 

The routine sets the X lateral boundary condition to LBX for the model number MODEL. The same routine SET_LB_Y_ll is available to set Y lateral boundary condition of a model. MUST be called by user to pass lateral boundaries conditions to the communication layer.

Location
 

mode_init.f90


Suggestions
 

7.1.5 SET_XRATIO_ll

SET_XRATIO_ll subroutine






Synopsis
 

CALL SET_XRATIO_ll(XRATIO, NMODEL)
Arguments
 
IN

INTEGER :: XRATIO    
INTEGER :: NMODEL    
OUT

Discussion
 

The routine sets the x ratio XRATIO for the model NMODEL. The same routine is available for the y ratio SET_YRATIO_ll. MUST be called by user to pass informations to the communication layer in multi model case.

Location
 

mode_init.f90


Suggestions
 

7.1.6 SET_XOR_ll

SET_XOR_ll subroutine






Synopsis
 

CALL SET_XOR_ll(XOR, NMODEL)
Arguments
 
IN

INTEGER :: XOR    
INTEGER :: NMODEL    
OUT

Discussion
 

The routine sets the X origin XOR of the model NMODEL. For Y origin, use SET_YOR_ll. MUST be called by user to pass informations to the communication layer in multi model case.

Location
 

mode_init.f90


Suggestions
 

7.1.7 SET_XEND_ll

SET_XEND_ll subroutine






Synopsis
 

CALL SET_XEND_ll(XEND, NMODEL)
Arguments
 
IN

INTEGER :: XEND    
INTEGER :: NMODEL    
OUT

Discussion
 

The routine sets the X end XEND of the model NMODEL. For Y end, use SET_YEND_ll. MUST be called by user to pass informations to the communication layer in multi model case.

Location
 

mode_init.f90


Suggestions
 

7.1.8 INI_PARA_ll

INI_PARA_ll subroutine






Synopsis
 

CALL INI_PARA_ll(KINFO_ll)
Arguments
 
IN

None    
OUT

INTEGER :: KINFO_ll ! return status    
Modules
 
Module MODE_PARALLEL_ll    

Discussion
 

The INI_PARA_ll routine initialises the data structures used internally by the parallel routines. In this routine information on the location of the subdomains in the model and useful information for the halo exchanges, the grid-nesting and the transpositions are initialized.

Thus it will be called once at the beginning of the simulation. It must be called before any other communication routines can be used.

Before the INI_PARA_ll routine is called some information regarding the data partition on the processors have to be read in the namelist file and stored in the variables of the MODD_PARALLEL_ll module.

Location
 

mode_parallele.f90


Suggestions
 

7.1.9 END_PARA_ll

END_PARA_ll subroutine






Synopsis
 

CALL END_PARA_ll(KINFO_ll)
Arguments
 
IN

None    
OUT

INTEGER :: KINFO_ll ! return status    

Discussion
 

The END_PARA_ll routine finalizes the parallel session.

Location
 

mode_parallele.f90


7.2 Halo

7.2.1 ADD2DFIELD_ll, ADD3DFIELD_ll

ADD2DFIELD_ll, ADD3DFIELD_ll subroutine






Synopsis
 

CALL ADD2DFIELD_ll(TPFIELDSLIST_ll,PFIELD)
CALL ADD3DFIELD_ll(TPFIELDSLIST_ll,PFIELD)
Arguments
 
IN

TYPE(LIST_ll), POINTER :: TPFIELDSLIST_ll    
REAL, DIMENSION(:,:) :: PFIELD or    
REAL, DIMENSION(:,:,:) :: PFIELD    
OUT

TYPE(LIST_ll), POINTER :: TPFIELDSLIST_ll    
Discussion
 

The routine enables to add the PFIELD 2D (resp. 3D) field to the list of fields that have to be communicated. This list of fields in then used is the update routines.

This mechanism spares the MesoNH developper the effort of modifying the update routines if he wishes to update a new PNEWFIELD field that has not been originally included in the update routines : if that is the case he just needs to add CALL ADDnFIELD_ll(TPFIELDSLIST_ll, PNEWFIELD) at the beginning of the code.

This mechanism does not require significant additional memory since the list contains only pointers to the existing fields.

Location
 

mode_argslist.f90


7.2.2 ADD1DFIELD_ll

ADD1DFIELD_ll subroutine






Synopsis
 

CALL ADD1DFIELD_ll(HDIR, TPFIELDSLIST_ll,PFIELD)
Arguments
 
IN

CHARACTER(LEN=1) :: HDIR    
TYPE(LIST1D_ll), POINTER :: TPFIELDSLIST_ll    
REAL, DIMENSION(:) :: PFIELD    
OUT

TYPE(LIST1D_ll), POINTER :: TPFIELDSLIST_ll    
Discussion
 

The routine enables to add the PFIELD 1D field to the list of one dimensional fields that have to be communicated. This list of fields in then used is the UPDATE_1DHALO_ll routine.

The HDIR argument allows to specify in which direction the field is oriented ( HDIR = "X" or "Y").

Location
 

mode_argslist.f90


7.2.3 DEL2DFIELD_ll, DEL3DFIELD_ll

DEL2DFIELD_ll, DEL3DFIELD_ll subroutine






Synopsis
 

CALL DEL2DFIELD_ll(TPFIELDSLIST_ll,PFIELD,KINFO)
CALL DEL3DFIELD_ll(TPFIELDSLIST_ll,PFIELD,KINFO)
Arguments
 
IN

TYPE(LIST_ll), POINTER :: TPFIELDSLIST_ll    
REAL, DIMENSION(:,:) :: PFIELD or    
REAL, DIMENSION(:,:,:) :: PFIELD    
OUT

TYPE(LIST_ll), POINTER :: TPFIELDSLIST_ll    
INTEGER :: KINFO ! return status    
Discussion
 

The routine enables to delete the PFIELD 2D (resp. 3D) field from the TPFIELDSLIST_ll list of fields that have to be communicated. (see the ADDnDFIELD_ll section for details).

return status KINFO is

0 if PFIELD has been found in TPFIELDSLIST_ll
1 otherwise

Location
 

mode_argslist.f90


Suggestions
 

7.2.4 ADD_FIELD2_ll

ADD_FIELD2_ll subroutine






Synopsis
 

CALL ADD_FIELD2_ll(TPHALO2LIST_ll,TPHALO2_ll)
Arguments
 
IN

TYPE(HALO2LIST_ll), POINTER :: TPHALO2LIST_ll    
TYPE(HALO2_ll) :: TPHALO2_ll    
OUT

TYPE(HALO2LIST_ll), POINTER :: TPHALO2LIST_ll    
Discussion
 

The ADD_FIELD2_ll routine adds the TPHALO2_ll halo in the list of halos TPHALO2LIST_ll to be updated. The TPHALO2_ll variable contains the second layer of the halo. Its type is HALO2_ll which is defined as follows :

TYPE HALO2_ll
REAL, DIMENSION(NISUP,NKSUP) :: WEST, EAST
REAL, DIMENSION(NJSUP,NKSUP) :: NORTH, SOUTH
END TYPE HALO2_ll

(This routine is similar to the ADD3DFIELD_ll routine. )

Location
 

mode_argslist2.f90


7.2.5 DEL_FIELD2_ll

DEL_FIELD2_ll subroutine






Synopsis
 

CALL DEL_FIELD2_ll(TPHALO2LIST_ll,TPHALO2_ll, KINFO)
Arguments
 
IN

TYPE(HALOLIST_ll), POINTER :: TPHALO2LIST_ll    
TYPE(HALO_ll) :: TPHALO2_ll    
OUT

TYPE(HALOLIST_ll), POINTER :: TPHALO2LIST_ll    
INTEGER :: KINFO ! return status    
Discussion
 

The DEL_FIELD2_ll routine remove the TPHALO2_ll halo from the list of halos TPHALO2LIST_ll to be updated. The TPHALO2_ll variable contains the second layer of the halo. (This routine is similar to the DEL_FIELD_ll routine. )
return status KINFO is

0 if TPHALO2_ll has been found in TPHALO2LIST_ll
1 otherwise

Location
 

mode_argslist2.f90


Suggestions
 

7.2.6 UPDATE_HALO_ll

UPDATE_HALO_ll subroutine






Synopsis
 

CALL UPDATE_HALO_ll(TPFIELDSLIST_ll, KINFO_ll)
Arguments
 
IN

TYPE(LIST_ll) :: TPFIELDSLIST_ll    
OUT

TYPE(LIST_ll) :: TPFIELDSLIST_ll    
INTEGER :: KINFO_ll ! return status    
Modules
 
Module MODD_PARALLEL_ll    
Module MODD_ARGSLIST_ll, ONLY : LIST_ll    
Module MODE_EXCHANGE_ll    
Discussion
 

The UPDATE_HALO_ll routine updates the halo with the values computed by the neighbor subdomains. In the current implementation of Meso-NH, only the first layer of the halo will be updated. Since the vertical dimension is not decomposed, this routine may update two-dimensional or three-dimensional fields. The fields to be updated are in the TPFIELDSLIST_ll list (see the ADD2DFIELD_ll and ADD3DFIELD_ll sections for details).

Location
 

mode_exchange.f90


Suggestions
 

7.2.7 UPDATE_1DHALO_ll

UPDATE_1DHALO_ll subroutine






Synopsis
 

CALL UPDATE_1DHALO_ll(TPFIELDSLIST_ll, KINFO_ll)
Arguments
 
IN

TYPE(LIST1D_ll) :: TPFIELDSLIST_ll    
OUT

TYPE(LIST1D_ll) :: TPFIELDSLIST_ll    
INTEGER :: KINFO_ll ! return status    
Modules
 
Module MODD_PARALLEL_ll    
Module MODD_ARGSLIST_ll, ONLY : LIST_ll    
Module MODE_EXCHANGE_ll    
Discussion
 

The UPDATE_1DHALO_ll routine updates the halo of one-dimensional fields with the values computed by the neighbor subdomains. In the current implementation of Meso-NH, only the first layer of the halo will be updated. Since the vertical dimension is not decomposed, this routine may update two-dimensional or three-dimensional fields. The fields to be updated are in the TPFIELDSLIST_ll list (see the ADD1DFIELD_ll section for details).

Location
 

mode_exchange.f90


Suggestions
 

7.2.8 UPDATE_HALO2_ll

UPDATE_HALO2_ll subroutine






Synopsis
 

CALL UPDATE_HALO2_ll(TPFIELDSLIST_ll, TPHALO2LIST_ll, KINFO)
Arguments
 
IN

TYPE(LIST_ll) :: TPFIELDSLIST_ll    
OUT

TYPE(HALOLIST_ll) :: TPHALO2LIST_ll    
INTEGER :: KINFO ! return status    
Modules
 
IN

Module MODD_PARALLEL    
OUT

None    
Discussion
 

The UPDATE_HALO2_ll routine updates the second layer of the halo with the values computed by the neighbor subdomains.

The TPFIELDSLIST_ll variable contains the list of the 3D fields for which the second layer of the halo has to be updated.

The TPHALO2LIST_ll variable contains a list of elements corresponding to the parts of the fields situated in the second layer of the halo. (see ADDnDFIELD_ll and ADDnDFIELD2_ll sections for details).

Location
 

mode_exchange2.f90


Suggestions
 

7.2.9 UPDATE_BOUNDARIES_ll

UPDATE_BOUNDARIES_ll subroutine






Synopsis
 

CALL UPDATE_BOUNDARIES_ll(HDIRECTION, TPFIELDSLIST_ll, KINFO)
Arguments
 
IN

CHARACTER*2 :: HDIRECTION    
TYPE(LIST_ll) :: TPFIELDSLIST_ll    
OUT

TYPE(LIST_ll) :: TPFIELDSLIST_ll    
INTEGER :: KINFO ! return status    
Modules
 
Module MODD_PARALLEL_ll    
Module MODD_ARGSLIST_ll, ONLY : LIST_ll    
Module MODE_UTIL_ll, ONLY : LNORTH_ll, LSOUTH_ll, LWEST_ll, LEAST_ll    
Module MODE_EXCHANGE_ll    
Discussion
 

The UPDATE_BOUNDARIES_ll routine updates the halo with the values computed by the neighbor subdomains only for the processor on the global domain's boudaries. The fields to be updated are in the TPFIELDSLIST_ll list (see the ADDnDFIELD_ll section for details).

The update can be done only for certains boundaries :

  1. if HDIRECTION = 'XX', only WEST and EAST boundaries are considered,
  2. if HDIRECTION = 'YY', only NORTH and SOUTH boundaries are considered,
  3. if HDIRECTION = 'XY', all boundaries are considered.

Location
 

mode_boundaries.f90


Suggestions
 

7.3 Data distribution

7.3.1 REMAP_2WAY_X_ll

REMAP_2WAY_X_ll subroutine






Synopsis
 

CALL REMAP_2WAY_X_ll(PFIELDIN_ll,PFIELDOUT_ll,KINFO_ll)
Arguments
 
IN

REAL, DIMENSION(:,:,:) :: PFIELDIN_ll    
OUT

REAL, DIMENSION(:,:,:) :: PFIELDOUT_ll    
INTEGER :: KINFO_ll ! return status    
Modules
 
Module MODD_PARALLEL_ll    
Module MODD_ARGSLIST_ll, ONLY : LIST_ll    
Module MODE_EXCHANGE_ll    
Discussion
 

The REMAP_2WAY_X_ll routine transforms the data partition from a two-way distribution ( PFIELDIN_ll field) into an x-slices distribution ( PFIELDOUT_ll field).

\begin{figure}
\centerline {
\psfig{figure=Figures/beam2xslices.eps,width=10cm}
}\end{figure}

Location
 

mode_exchange.f90


Suggestions
 

7.3.2 REMAP_X_Y_ll

REMAP_X_Y_ll subroutine






Synopsis
 

CALL REMAP_X_Y_ll(PFIELDIN_ll,PFIELDOUT_ll,KINFO_ll)
Arguments
 
IN

REAL, DIMENSION(:,:,:) :: PFIELDIN_ll    
OUT

REAL, DIMENSION(:,:,:) :: PFIELDOUT_ll    
INTEGER :: KINFO_ll ! return status    
Modules
 
Module MODD_PARALLEL_ll    
Module MODD_ARGSLIST_ll, ONLY : LIST_ll    
Module MODE_EXCHANGE_ll    
Discussion
 

The REMAP_X_Y_ll routine transforms the data partition from an x-slices distribution ( PFIELDIN_ll field) into a y-slices distribution ( PFIELDOUT_ll field).

It is advised to do not call successively REMAP_2WAY_X_ll and REMAP_X_Y_ll (potential problems in halos).

\begin{figure}
\centerline {
\psfig{figure=Figures/xslices2yslices.eps,width=10cm}
}\end{figure}

Location
 

mode_exchange.f90


7.3.3 REMAP_Y_X_ll

REMAP_Y_X_ll subroutine






Synopsis
 

CALL REMAP_Y_X_ll(PFIELDIN_ll,PFIELDOUT_ll,KINFO_ll)
Arguments
 
IN

REAL, DIMENSION(:,:,:) :: PFIELDIN    
OUT

REAL, DIMENSION(:,:,:) :: PFIELDOUT    
INTEGER :: KINFO ! return status    
Modules
 
Module MODD_PARALLEL_ll    
Module MODD_ARGSLIST_ll, ONLY : LIST_ll    
Module MODE_EXCHANGE_ll    
Discussion
 

The REMAP_Y_X_ll routine transforms the data partition from a y-slices distribution ( PFIELDIN_ll field) into an x-slices distribution ( PFIELDOUT_ll field).

It is advised to do not call successively REMAP_2WAY_Y_ll and REMAP_Y_X_ll (potential problems in halos).

Location
 

mode_exchange.f90


\begin{figure}
\centerline{
\psfig{figure=Figures/yslices2xslices.eps,width=10cm}
}\end{figure}

7.3.4 REMAP_X_2WAY_ll

REMAP_X_2WAY_ll subroutine






Synopsis
 

CALL REMAP_X_2WAY_ll(PFIELDIN_ll,PFIELDOUT_ll,KINFO_ll)
Arguments
 
IN

REAL, DIMENSION(:,:,:) :: PFIELDIN_ll    
OUT

REAL, DIMENSION(:,:,:) :: PFIELDOUT_ll    
INTEGER :: KINFO_ll ! return status    
Modules
 
Module MODD_PARALLEL_ll    
Module MODD_ARGSLIST_ll, ONLY : LIST_ll    
Module MODE_EXCHANGE_ll    
Discussion
 

The REMAP_X_2WAY_ll routine transforms the data distribution from an x-slices distribution ( PFIELDIN_ll field) into a two-way distribution ( PFIELDOUT_ll field).

\begin{figure}
\centerline {
\psfig{figure=Figures/xslices2beam.eps,width=10cm}
}\end{figure}

Location
 

mode_exchange.f90


Suggestions
 

7.3.5 EXTRACT_ll

EXTRACT_ll function






Synopsis
 

IEXTRACTED(:,:,:) = EXTRACT_ll( PFIELD, KINFO &
    [KXOR, KYOR, KZOR, KXEND, KYEND, KZEND] )
Arguments
 
IN

REAL :: PFIELD(:,:,:)    
INTEGER, OPTIONAL :: KXOR, KYOR, KZOR, KXEND, KYEND, KZEND    
OUT

INTEGER :: KINFO    
Discussion
 

this function restricts a 3D field PFIELD to the region defined by its first point (KXOR, KYOR, KZOR) and its last point (KXEND, KYEND, KZEND).

These two points are in global coordinates.

If these two points are omitted, we consider the coordinates of the whole physical domain.

The region must be included in the global extended domain.

If KINFO $<> 0$, an error occurs in this extraction (bad region for example).

Location
 

mode_sum.f90


Suggestions
 

7.3.6 GET_SLICE_ll

GET_SLICE_ll subroutine






Synopsis
 

CALL GET_SLICE_ll(3DARRAY, HDIR, KLOC, PSLICE, KB, KE, KERR)
resp CALL GET_SLICE_ll(HORIZ_ARRAY, HDIR, KLOC, PSLICE, KB, KE, KKB, KKE, KERR)
Arguments
 
IN

REAL, DIMENSION(:,:,:) :: 3DARRAY with halo    
resp REAL, DIMENSION(:,:) :: HORIZ_ARRAY with halo    
     
CHARACTER(LEN=1) :: HDIR    
INTEGER :: KLOC    
INTEGER, OPTIONAL :: KB, KE    
INTEGER, OPTIONAL :: KERR    
OUT

REAL, DIMENSION(:,:) :: PSLICE    
resp REAL, DIMENSION(:) :: PSLICE    
Discussion
 

The GET_SLICE_ll subroutine returns the PSLICE slice extracted from 3DARRAY or HORIZ_ARRAY. The slice to be extracted is in the HDIR direction and at the KLOC global location. HDIR may be set to "X" or "Y". The first size of the PSLICE array is the width of the global domain in the HDIR direction.

The KB and KE arguments can be used to specify the horizontal extremities of the slice (in local coordinates). By default, KB and KE are set to the beginning and the end of the physical subdomain. In case a 3D array in used, the KKB and KKE arguments can be used to specify the vertical extremities of the slice. By default, KKB and KKE are set to the beginning and the end of the physical vertical dimension.

The KERR argument can be used as the return status.

Example
 

Using the default values of KB and KE, and using HDIR="X", PSLICE contains
3DARRAY(1+JPHEXT:NIMAX+JPHEXT,KLOC,KKB:KKE) ( resp HORIZ_ARRAY(1+JPHEXT:NIMAX+JPHEXT,KLOC)) (in global coordinates) after the call to GET_SLICE_ll.
Location
 

get_slice.f90

Suggestions
 

7.4 Domain informations

7.4.1 GET_DIM_EXT_ll

GET_DIM_EXT_ll subroutine






Synopsis
 

CALL GET_DIM_EXT_ll( HSPLIT, KXDIM, KYDIM )
Arguments
 
IN

CHARACTER*1 :: HSPLITTING    
OUT

INTEGER :: KXDIM, KYDIM    
Discussion
 

This routine return the dimensions of the extended 2way subdomain or of the x-slices subdomain or of the y-slices subdomain of the local processor.

if HSPLIT='B', the dimensions of the extended 2way subdomain are returned
if HSPLIT='X', the dimensions of x-slices subdomain are returned
if HSPLIT='Y', the dimensions of y-slices subdomain are returned

Location
 

mode_tools.f90


Suggestions
 

7.4.2 GET_DIM_PHYS_ll

GET_DIM_PHYS_ll subroutine






Synopsis
 

CALL GET_DIM_PHYS_ll( HSPLIT, KXDIM, KYDIM )
Arguments
 
IN

CHARACTER*1 :: HSPLITTING    
OUT

INTEGER :: KXDIM, KYDIM    
Discussion
 

This routine return the dimensions of the physical 2way subdomain or of the x-slices subdomain or of the y-slices subdomain of the local processor.

if HSPLIT='B', the dimensions of the physical 2way subdomain are returned
if HSPLIT='X', the dimensions of x-slices subdomain are returned
if HSPLIT='Y', the dimensions of y-slices subdomain are returned

Location
 

mode_tools.f90


Suggestions
 

7.4.3 GET_OR_ll

GET_OR_ll subroutine






Synopsis
 

CALL GET_OR_ll( HSPLIT, KXOR, KYOR )
Arguments
 
IN

CHARACTER*1 :: HSPLITTING    
OUT

INTEGER :: KXOR, KYOR    
Discussion
 

this routine returns the origin's coordinates of the extended 2way subdomain or of the x-slices subdomain or of the y-slices subdomain of the local processor.

if HSPLIT='B', the origin of the extended 2way subdomain are returned
if HSPLIT='X', the origin of x-slices subdomain are returned
if HSPLIT='Y', the origin of y-slices subdomain are returned

Location
 

mode_tools.f90


Suggestions
 

7.4.4 GET_GLOBALDIMS_ll

GET_GLOBALDIMS_ll subroutine






Synopsis
 

CALL GET_GLOBALDIMS_ll(KIMAX, KJMAX)
Arguments
 
IN

None    
OUT

INTEGER :: KIMAX, KJMAX    
Discussion
 

This routine returns the global horizontal dimensions of the current model, with the external halos excluded.
Location
 

mode_tools.f90

Suggestions
 

7.4.5 GET_INDICE_ll

GET_INDICE_ll subroutine






Synopsis
 

CALL GET_INDICE_ll( KXOR, KYOR, KXEND, KYEND )
Arguments
 
IN

none    
OUT

INTEGER :: KXOR, KYOR, KXEND, KYEND    
Discussion
 

this routine returns the origin's coordinates and the end's coordinates of the physical local subdomain (in local indices)

Location
 

mode_tools.f90


Suggestions
 

7.4.6 GET_PHYSICAL_ll

GET_PHYSICAL_ll subroutine






Synopsis
 

CALL GET_PHYSICAL_ll( KXOR, KYOR, KXEND, KYEND )
Arguments
 
IN

none    
OUT

INTEGER :: KXOR, KYOR, KXEND, KYEND    
Discussion
 

this routine returns the origin's coordinates and the end's coordinates of the intersection of the physical global domain with the local extended subdomain (in local indices)

Location
 

mode_tools.f90


Suggestions
 

7.4.7 GET_INTERSECTION_ll

GET_INTERSECTION_ll subroutine






Synopsis
 

CALL GET_INTERSECTION_ll( KXOR, KYOR, KXEND, KYEND, &
  KXORI, KYORI, KXENDI, KYENDI, ????, KINFO)
Arguments
 
IN

INTEGER :: KXOR, KYOR, KXEND, KYEND ! Coordinates of the region    
OUT

INTEGER :: KXORI, KYORI, KXENDI, KYENDI ! Coordinates of the intersection    
INTEGER :: KINFO ! status message    
Discussion
 

Routine to get the indices of the intersection between a geographic region and a subdomain.

The input indices are in global coordinates. The output indices are in local coordinates.

If KINFO $=$ -1, the given geographic region is not included in the extended global domain.

If KINFO $=$ 1, the intersection is void.

Location
 

mode_tools.f90


7.4.8 LNORTH_ll, LWEST_ll, LSOUTH_ll, LEAST_ll

LNORTH_ll, LWEST_ll, LSOUTH_ll, LEAST_ll functions






Synopsis
 

G = LNORTH_ll([KPROC_ll],[HSPLITTING])
G = LWEST_ll([KPROC_ll],[HSPLITTING])
G = LSOUTH_ll([KPROC_ll],[HSPLITTING])
G = LEAST_ll([KPROC_ll],[HSPLITTING])
Arguments
 
IN

INTEGER, OPTIONAL :: KPROC_ll    
CHARACTER*1, OPTIONAL :: HSPLITTING    
OUT

None    
Discussion
 

These functions return a boolean which is true if the subdomain number KPROC_ll is situated at the north, west, south or east (depending on which function is called) of the physical domain according to the splitting specified by the character HSPLITTING.

If the optional argument KPROC_ll is missing the situation of the subdomain matching the current processor is taken into account.

The argument HSPLITTING can be 'B' for 2way splitting, 'X' for x-slices splitting, 'Y' for y-slices splitting ; if this argument is missing, the 2way splitting is considered.

Location
 

mode_tools.f90


Suggestions
 

7.5 Min Max

7.5.1 GMAXLOC_ll

GMAXLOC_ll subroutine






Synopsis
 

MAXLOC = GMAXLOC_ll(3DARRAY, [MASK])
resp1 MAXLOC = GMAXLOC_ll(2DARRAY, [KDIMS], [MASK])
resp2 MAXLOC = GMAXLOC_ll(1DARRAY, [KDIMS], [MASK])
Arguments
 
IN

REAL, DIMENSION(:,:,:) :: 3DARRAY    
resp1 REAL, DIMENSION(:,:,:) :: 2DARRAY    
resp2 REAL, DIMENSION(:,:,:) :: 1DARRAY    
     
LOGICAL, DIMENSION(:,:,:), OPTIONAL :: MASK    
resp1 LOGICAL, DIMENSION(:,:), OPTIONAL :: MASK    
resp2 LOGICAL, DIMENSION(:), OPTIONAL :: MASK    
     
resp1 INTEGER, DIMENSION(2), OPTIONAL :: KDIMS    
resp2 INTEGER, OPTIONAL :: KDIMS    
OUT

INTEGER, DIMENSION(3) :: MAXLOC ! coordinates of the global maximum    
resp1 INTEGER, DIMENSION(2) :: MAXLOC    
resp2 INTEGER :: MAXLOC    
Discussion
 

The GMAXLOC_ll function returns the global location of the first element of 3DARRAY, 2DARRAY or 1DARRAY having the maximum value of the elements identified by MASK. In case the function is used with 2DARRAY or 1DARRAY, the KDIMS argument is used to specify along which axis the 2DARRAY or 1DARRAY are. For example, using KDIMS=(/2,3/) means that 2DARRAY is oriented along the y and z axes; using KDIMS=2 means that 1DARRAY is oriented along the y axis.

The default value for the optional KDIMS argument is (/1,2/) (i.e. x and y axes) in case a 2D array is used, and 1 in case a one dimensional array is used.

Location
 

maxloc.f90

Suggestions
 

7.5.2 GMINLOC_ll

GMINLOC_ll subroutine






Synopsis
 

MINLOC = GMINLOC_ll(3DARRAY, [MASK])
resp1 MINLOC = GMINLOC_ll(2DARRAY, [KDIMS], [MASK])
resp2 MINLOC = GMINLOC_ll(1DARRAY, [KDIMS], [MASK])
Arguments
 
IN

REAL, DIMENSION(:,:,:) :: 3DARRAY    
resp1 REAL, DIMENSION(:,:,:) :: 2DARRAY    
resp2 REAL, DIMENSION(:,:,:) :: 1DARRAY    
     
LOGICAL, DIMENSION(:,:,:), OPTIONAL :: MASK    
resp1 LOGICAL, DIMENSION(:,:), OPTIONAL :: MASK    
resp2 LOGICAL, DIMENSION(:), OPTIONAL :: MASK    
     
resp1 INTEGER, DIMENSION(2), OPTIONAL :: KDIMS    
resp2 INTEGER, OPTIONAL :: KDIMS    
OUT

INTEGER, DIMENSION(3) :: MINLOC ! coordinates of the global minimum    
resp1 INTEGER, DIMENSION(2) :: MINLOC    
resp2 INTEGER :: MINLOC    
Discussion
 

The GMINLOC_ll function returns the global location of the first element of 3DARRAY, 2DARRAY or 1DARRAY having the minimum value of the elements identified by MASK. In case the function is used with 2DARRAY or 1DARRAY, the KDIMS argument is used to specify along which axis the 2DARRAY or 1DARRAY are. For example, using KDIMS=(/2,3/) means that 2DARRAY is oriented along the y and z axes; using KDIMS=2 means that 1DARRAY is oriented along the y axis.

The default value for the optional KDIMS argument is (/1,2/) (i.e. x and y axes) in case a 2D array is used, and 1 in case a one dimensional array is used.

Location
 

minloc.f90

Suggestions
 

7.5.3 MAX_ll, MIN_ll

MAX_ll, MIN_ll functions






Synopsis
 

IMAX = MAX_ll( PFIELD,KINFO &
    [KXOR, KYOR, KZOR, KXEND, KYEND, KZEND] )


IMIN = MIN_ll( PFIELD,KINFOi &
    [KXOR, KYOR, KZOR, KXEND, KYEND, KZEND] )
Arguments
 
IN

REAL :: PFIELD(:,:,:) !with halo    
INTEGER, OPTIONAL :: KXOR, KYOR, KZOR, KXEND, KYEND, KZEND    
OUT

INTEGER :: KINFO    
Discussion
 

this function computes the maximum or the minimum of the 3D field PFIELD restricted to the domain defined by its first point (KXOR, KYOR, KZOR) and its last point (KXEND, KYEND, KZEND).

These two points are in global coordinates.

If these two points are omitted, we consider the whole physicale domain.

The region must be included in the global extended domain.

If KINFO $<> 0$ then an error occurs in the function (bad region for example).

Location
 

mode_sum.f90


7.6 Sums


\begin{sidewaystable}
% latex2html id marker 2925\begin{center}
\begin{tabula...
...ze
\caption{Use of the SUM interface routines}
\end{center}\end{sidewaystable} a b a c a d a e a f a g d c a

7.6.1 REDUCESUM_ll

REDUCESUM_ll routine






Synopsis
 

CALL REDUCESUM_ll(PRES, KINFO)
Arguments
 
INOUT

REAL :: PRES or ! without halo    
REAL :: PRES(:) or ! without halo    
REAL :: PRES(:,:) or ! without halo    
REAL :: PRES(:,:,:) ! without halo    
OUT

INTEGER :: KINFO    
Discussion
 

this routine computes the global sum with the local sums. PRES is an INOUT argument ; PRES is passed as the local sum by each processor and is returned with the global sum.

this routine is a generic one :

-
Scalar argument is treated by REDUCE_SUM_0D_ll
-
1D argument is treated by REDUCE_SUM_1D_ll

For 1D argument, PRES on each processor should have the same size ; it is the case when we pass a vertical column.

Equivalent routines for horizontal 1D arrays are SUM_DIM1_ll and SUM_DIM2_ll.

KINFO gives the return of the MPI summation.

Location
 

mode_sum.f90


7.6.2 SUM_DIM1_ll, SUM_DIM2_ll

SUM_DIM1_ll, SUM_DIM2_ll routines






Synopsis
 

CALL SUM_DIM1_ll(PFIELD, PRES, KINFO)
CALL SUM_DIM2_ll(PFIELD, PRES, KINFO)
Arguments
 
INT

REAL :: PFIELD(:) ! with halo    
OUT

REAL :: PRES(:)    
INTEGER :: KINFO    
Discussion
 

For SUM_DIM1_ll (resp. SUM_DIM2_ll), the PFIELD argument is a local 1D array according the y-direction (resp. x-direction), result of local summations in x-direction (resp. y-direction).

The purpose of these routines is to merge all the local sum arrays in a global one PRES, 1D array according the y-direction (resp. x-direction).

KINFO gives the return of the MPI summation.

Location
 

mode_sum.f90


7.6.3 SUM_1DFIELD_ll

SUM_1DFIELD_ll function






Synopsis
 

SUM = SUM_1DFIELD_ll(PFIELD, HDIR, [KOR], [KEND], [KERR])
Arguments
 
IN

REAL, DIMENSION(:) :: PFIELD    
CHARACTER(LEN=1) :: HDIR    
INTEGER, OPTIONAL :: KOR, KEND    
INTEGER :: KERR    
OUT

REAL :: SUM_1DFIELD_ll    
Discussion
 

This function calculates the sum of the PFIELD one-dimensional field according to the HDIR direction. HDIR may be set to "X" or "Y". The dimension of PFIELD is supposed to be the dimension of the local extended subdomain in the HDIR direction.

The KOR and KEND arguments can be used to specify the boundaries of the sum. By default, KOR and KEND are set to the physical boundaries of the global domain.

Location
 

mode_sum.f90


Suggestions
 

7.6.4 SUM_1D_ll

SUM_1D_ll function






Synopsis
 

ISUM(:,:) = SUM_1D_ll( PFIELD, KDIR, KINFO &
    [KXOR, KYOR, KZOR, KXEND, KYEND, KZEND] )
Arguments
 
IN

REAL :: PFIELD(:,:,:) !with halo    
INTEGER :: KDIR    
INTEGER, OPTIONAL :: KXOR, KYOR, KZOR, KXEND, KYEND, KZEND    
OUT

INTEGER :: KINFO    
Discussion
 

this function computes the sum according to a direction KDIR ( $1=x$, $2=y$, $3=z$ ) of the 3D field PFIELD restricted to the domain defined by its first point (KXOR, KYOR, KZOR) and its last point (KXEND, KYEND, KZEND).

These two points are in global coordinates.

If these two points are omitted, we consider the coordinates of the whole physical domain.

The region must be included in the global extended domain.

If KINFO $<> 0$ then an error occurs (bad direction, bad region or summation error for example).

Location
 

mode_sum.f90


Suggestions
 

7.6.5 SUM_2D_ll

SUM_2D_ll function






Synopsis
 

ISUM(:) = SUM_2D_ll( PFIELD, KDIR1, KDIR2, KINFO, &
    [KXOR, KYOR, KZOR, KXEND, KYEND, KZEND] )
Arguments
 
IN

REAL :: PFIELD(:,:,:) !with halo    
INTEGER :: KDIR1, KDIR2    
INTEGER, OPTIONAL :: KXOR, KYOR, KZOR, KXEND, KYEND, KZEND    
OUT

INTEGER :: KINFO    
Discussion
 

this function computes the sum according to the directions KDIR1, KDIR2 ( $1=x$, $2=y$, $3=z$ and KDIR1 $<$ KDIR2) of the 3D field PFIELD restricted to the domain defined by its first point (KXOR, KYOR, KZOR) and its last point (KXEND, KYEND, KZEND).

These two points are in global coordinates.

If these two points are omitted, we consider the coordinates of the whole physical domain.

The region must be included in the global extended domain.

If KINFO $<> 0$ then an error occurs (bad directions, bad region or summation error for example).

Location
 

mode_sum.f90


Suggestions
 

7.6.6 SUM_3D_ll

SUM_3D_ll function






Synopsis
 

ISUM = SUM_3D_ll( PFIELD,KINFO &
    [KXOR, KYOR, KZOR, KXEND, KYEND, KZEND] )
Arguments
 
IN

REAL :: PFIELD(:,:,:) !with halo    
INTEGER, OPTIONAL :: KXOR, KYOR, KZOR, KXEND, KYEND, KZEND    
OUT

INTEGER :: KINFO    
Discussion
 

this function computes the sum according to the three directions of the 3D field PFIELD restricted to the domain defined by its first point (KXOR, KYOR, KZOR) and its last point (KXEND, KYEND, KZEND).

These two points are in global coordinates.

If these two points are omitted, we consider the coordinates of the whole physical domain.

The region must be included in the global extended domain.

If KINFO $<> 0$ then an error occurs in the summation (bad region for example).

Location
 

mode_sum.f90


7.6.7 SUMMASK_ll

SUMMASK_ll function






Synopsis
 

ISUM(:) = SUMMASK_ll( PFIELD, OMASK, KINFO)
Arguments
 
IN

REAL :: PFIELD(:,:,:)    
LOGICAL :: OMASK(:,:)    
OUT

INTEGER :: KINFO    
Discussion
 

this function computes the sum of the 3D field PFIELD on the whole domain according to the directions x and y for the points that pass the 2D-horizontal mask OMASK.

OMASK is a local array.

The result is a vertical column.

If KINFO $<> 0$ then an error occurs (summation error for example).

Location
 

mode_sum.f90


7.6.8 SUMMASKCOMP_ll

SUMMASKCOMP_ll function






Synopsis
 

ISUM = SUMMASKCOMP_ll( PFIELD, OMASK, KINFO)
Arguments
 
IN

REAL :: PFIELD(:,:,:)    
LOGICAL :: OMASK(:,:)    
OUT

INTEGER :: KINFO    
Discussion
 

this function computes the sum of the 3D field PFIELD on the whole domain according the three directions for the points that pass the 2D-horizontal mask OMASK.

OMASK is a local array.

The result is a scalar.

If KINFO $<> 0$ then an error occurs (summation error for example).

Location
 

mode_sum.f90


Suggestions
 


next up previous contents
Next: About this document ... Up: mainexpand Previous: 6. Performances   Contents
serveur WWW de Meso-NH
2001-11-15