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.
bdyice_lim2.F90 in branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY – NEMO

source: branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim2.F90 @ 3186

Last change on this file since 3186 was 3182, checked in by davestorkey, 13 years ago

Change dynamic allocation and add timing to BDY module.

File size: 5.2 KB
Line 
1MODULE bdyice_lim2
2   !!======================================================================
3   !!                       ***  MODULE  bdyice_lim2  ***
4   !! Unstructured Open Boundary Cond. :  Flow Relaxation Scheme applied sea-ice (LIM2)
5   !!======================================================================
6   !!  History :  3.3  !  2010-09 (D. Storkey)  Original code
7   !!----------------------------------------------------------------------
8#if defined   key_bdy   &&   defined key_lim2
9   !!----------------------------------------------------------------------
10   !!   'key_bdy'            and                 Unstructured Open Boundary Conditions
11   !!   'key_lim2'                                                 LIM-2 sea ice model
12   !!----------------------------------------------------------------------
13   !!   bdy_ice_lim_2      : Application of open boundaries to ice
14   !!   bdy_ice_frs        : Application of Flow Relaxation Scheme
15   !!----------------------------------------------------------------------
16   USE timing          ! Timing
17   USE oce             ! ocean dynamics and tracers variables
18   USE ice_2           ! LIM_2 ice variables
19   USE dom_oce         ! ocean space and time domain variables
20   USE bdy_oce         ! ocean open boundary conditions
21   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
22   USE in_out_manager  ! write to numout file
23   USE lib_mpp         ! distributed memory computing
24   
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   bdy_ice_lim_2    ! routine called in sbcmod
29
30   !!----------------------------------------------------------------------
31   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
32   !! $Id: bdyice.F90 2715 2011-03-30 15:58:35Z rblod $
33   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE bdy_ice_lim_2( kt )
38      !!----------------------------------------------------------------------
39      !!                  ***  SUBROUTINE bdy_ice_lim_2  ***
40      !!
41      !! ** Purpose : - Apply open boundary conditions for ice (LIM2)
42      !!
43      !!----------------------------------------------------------------------
44      INTEGER, INTENT( in ) :: kt     ! Main time step counter
45      !!
46      INTEGER               :: ib_bdy ! Loop index
47
48      DO ib_bdy=1, nb_bdy
49
50         SELECT CASE( nn_ice_lim2(ib_bdy) )
51         CASE(jp_none)
52            CYCLE
53         CASE(jp_frs)
54            CALL bdy_ice_frs( idx_bdy(ib_bdy), dta_idx(ib_bdy) )
55         CASE DEFAULT
56            CALL ctl_stop( 'bdy_tra : unrecognised option for open boundaries for T an S' )
57         END SELECT
58      ENDDO
59
60   END SUBROUTINE bdy_ice_lim_2
61
62   SUBROUTINE bdy_ice_frs( idx, dta )
63      !!------------------------------------------------------------------------------
64      !!                 ***  SUBROUTINE bdy_ice_frs  ***
65      !!                   
66      !! ** Purpose : Apply the Flow Relaxation Scheme for sea-ice fields in the case
67      !!              of unstructured open boundaries. Currently only tested for LIM2.
68      !!
69      !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in a three-
70      !!             dimensional baroclinic ocean model with realistic topography. Tellus, 365-382.
71      !!------------------------------------------------------------------------------
72      TYPE(OBC_INDEX), INTENT(in) ::   idx  ! OBC indices
73      TYPE(OBC_DATA),  INTENT(in) ::   dta  ! OBC external data
74      !!
75      INTEGER  ::   jb, jk, jgrd   ! dummy loop indices
76      INTEGER  ::   ii, ij         ! local scalar
77      REAL(wp) ::   zwgt, zwgt1    ! local scalar
78      !!------------------------------------------------------------------------------
79      !
80      IF( nn_timing == 1 ) CALL timing_start('bdy_ice_frs')
81      !
82      jgrd = 1      ! Everything is at T-points here
83      !
84      DO jb = 1, idx%nblen(jgrd)
85         DO jk = 1, jpkm1
86            ii    = idx%nbi(jb,jgrd)
87            ij    = idx%nbj(jb,jgrd)
88            zwgt  = idx%nbw(jb,jgrd)
89            zwgt1 = 1.e0 - idx%nbw(jb,jgrd)
90            frld (ii,ij) = ( frld (ii,ij) * zwgt1 + dta%frld (jb) * zwgt ) * tmask(ii,ij,1)     ! Leads fraction
91            hicif(ii,ij) = ( hicif(ii,ij) * zwgt1 + dta%hicif(jb) * zwgt ) * tmask(ii,ij,1)     ! Ice depth
92            hsnif(ii,ij) = ( hsnif(ii,ij) * zwgt1 + dta%hsnif(jb) * zwgt ) * tmask(ii,ij,1)     ! Snow depth
93         END DO
94      END DO
95      CALL lbc_lnk( frld, 'T', 1. )                                         ! lateral boundary conditions
96      CALL lbc_lnk( hicif, 'T', 1. )   ;   CALL lbc_lnk( hsnif, 'T', 1. )
97      !     
98      IF( nn_timing == 1 ) CALL timing_stop('bdy_ice_frs')
99      !
100   END SUBROUTINE bdy_ice_frs
101#else
102   !!---------------------------------------------------------------------------------
103   !!   Default option                                                    Empty module
104   !!---------------------------------------------------------------------------------
105CONTAINS
106   SUBROUTINE bdy_ice_lim_2( kt )      ! Empty routine
107      WRITE(*,*) 'bdy_ice_frs: You should not have seen this print! error?', kt
108   END SUBROUTINE bdy_ice_lim_2
109#endif
110
111   !!=================================================================================
112END MODULE bdyice_lim2
Note: See TracBrowser for help on using the repository browser.