New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
crslbclnk.F90 in branches/2013/dev_r3411_CNRS4_IOCRS/NEMOGCM/NEMO/OPA_SRC/CRS – NEMO

source: branches/2013/dev_r3411_CNRS4_IOCRS/NEMOGCM/NEMO/OPA_SRC/CRS/crslbclnk.F90 @ 3738

Last change on this file since 3738 was 3738, checked in by cetlod, 10 years ago

dev_r3411_CNRS4_IOCRS : some corrections

File size: 2.8 KB
Line 
1MODULE crslbclnk
2
3   !!======================================================================
4   !!                       ***  MODULE  crslbclnk  ***
5   !!               A temporary solution for lbclnk for coarsened grid.
6   !! Ocean        : lateral boundary conditions for grid coarsening
7   !!=====================================================================
8   !! History :   ! 2012-06  (J. Simeon, G. Madec, C. Ethe)     Original code
9
10   USE dom_oce
11   USE crs_dom
12   USE lbclnk
13   USE par_kind, ONLY: wp
14   USE in_out_manager
15
16   PUBLIC crs_lbc_lnk
17
18   CONTAINS
19
20   SUBROUTINE crs_lbc_lnk( cd_type1, psgn, pt2d, pt3d1, pt3d2, cd_type2, cd_mpp )
21      !!---------------------------------------------------------------------
22      !!                  ***  SUBROUTINE crs_lbc_lnk  ***
23      !!
24      !! ** Purpose :   set lateral boundary conditions for coarsened grid
25      !!
26      !! ** Method  :   Swap domain indices from full to coarse domain
27      !!                before arguments are passed directly to lbc_lnk.
28      !!                Upon exiting, switch back to full domain indices.
29      !!----------------------------------------------------------------------
30      !! Arguments
31      CHARACTER(len=1)                , INTENT(in   )           ::   cd_type1 ! grid type
32      REAL(wp)                        , INTENT(in   )           ::   psgn     ! control of the sign
33
34      REAL(wp), DIMENSION(jpi_crs,jpj_crs),     INTENT(inout), OPTIONAL ::   pt2d  ! 2D array on which the lbc is applied
35      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(inout), OPTIONAL ::   pt3d1 ! 3D array on which the lbc is applied
36      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(inout), OPTIONAL ::   pt3d2     
37
38      CHARACTER(len=1)                , INTENT(in   ), OPTIONAL ::   cd_type2 ! grid type
39      CHARACTER(len=3)                , INTENT(in   ), OPTIONAL ::   cd_mpp    ! MPP only (here do nothing)
40
41      !!----------------------------------------------------------------------
42
43      CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain
44
45      IF ( PRESENT( pt2d ) )  THEN
46
47         IF ( PRESENT( cd_mpp ) ) THEN
48            CALL lbc_lnk( pt2d, cd_type1, psgn, cd_mpp )
49         ELSE
50            CALL lbc_lnk( pt2d, cd_type1, psgn )
51         ENDIF
52       
53      ELSEIF ( PRESENT(pt3d1) .AND. PRESENT(pt3d2) )  THEN
54
55         CALL lbc_lnk( pt3d1, cd_type1, pt3d2, cd_type2, psgn )
56
57      ELSEIF ( PRESENT(pt3d1) ) THEN
58
59         IF ( PRESENT( cd_mpp ) ) THEN
60            CALL lbc_lnk( pt3d1, cd_type1, psgn, cd_mpp )
61         ELSE
62            CALL lbc_lnk( pt3d1, cd_type1, psgn )
63         ENDIF
64
65      ELSE
66
67         WRITE(numout, *) 'crslbclnk. Must supply a 2d or 3d field'
68         STOP
69
70      ENDIF
71
72      CALL dom_grid_glo   ! Return to parent grid domain
73
74   END SUBROUTINE crs_lbc_lnk
75
76
77END MODULE crslbclnk
Note: See TracBrowser for help on using the repository browser.