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.
sbcrnf.F90 in branches/nemo_v3_3_beta/NEMO/OPA_SRC/SBC – NEMO

source: branches/nemo_v3_3_beta/NEMO/OPA_SRC/SBC/sbcrnf.F90 @ 2243

Last change on this file since 2243 was 2239, checked in by rblod, 14 years ago

First commit to compile ORCA2_LIM for next nemo v3.3

  • Property svn:keywords set to Id
File size: 23.0 KB
Line 
1MODULE sbcrnf
2   !!======================================================================
3   !!                       ***  MODULE  sbcrnf  ***
4   !! Ocean forcing:  river runoff
5   !!=====================================================================
6   !! History :  OPA  !  2000-11  (R. Hordoir, E. Durand)  NetCDF FORMAT
7   !!   NEMO     1.0  !  2002-09  (G. Madec)  F90: Free form and module
8   !!            3.0  !  2006-07  (G. Madec)  Surface module
9   !!            3.2  !  2009-04  (B. Lemaire)  Introduce iom_put
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   sbc_rnf      : monthly runoffs read in a NetCDF file
14   !!   sbc_rnf_init : runoffs initialisation
15   !!   rnf_mouth    : set river mouth mask
16   !!----------------------------------------------------------------------
17   USE dom_oce         ! ocean space and time domain
18   USE phycst          ! physical constants
19   USE sbc_oce         ! surface boundary condition variables
20   USE fldread         ! ???
21   USE in_out_manager  ! I/O manager
22   USE iom             ! I/O module
23
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC sbc_rnf          ! routine call in sbcmod module
28   PUBLIC sbc_rnf_div      ! routine called in sshwzv module
29
30   !                                                      !!* namsbc_rnf namelist *
31   CHARACTER(len=100), PUBLIC ::   cn_dir       = './'    !: Root directory for location of ssr files
32   LOGICAL           , PUBLIC ::   ln_rnf_depth = .false. !: depth       river runoffs attribute specified in a file
33   LOGICAL           , PUBLIC ::   ln_rnf_temp  = .false. !: temperature river runoffs attribute specified in a file
34   LOGICAL           , PUBLIC ::   ln_rnf_sal   = .false. !: salinity    river runoffs attribute specified in a file
35   LOGICAL           , PUBLIC ::   ln_rnf_emp   = .false. !: runoffs into a file to be read or already into precipitation
36   TYPE(FLD_N)       , PUBLIC ::   sn_rnf                 !: information about the runoff file to be read
37   TYPE(FLD_N)       , PUBLIC ::   sn_cnf                 !: information about the runoff mouth file to be read
38   TYPE(FLD_N)                ::   sn_s_rnf               !: information about the salinities of runoff file to be read 
39   TYPE(FLD_N)                ::   sn_t_rnf               !: information about the temperatures of runoff file to be read 
40   TYPE(FLD_N)                ::   sn_dep_rnf             !: information about the depth which river inflow affects
41   LOGICAL           , PUBLIC ::   ln_rnf_mouth = .false. !: specific treatment in mouths vicinity
42   REAL(wp)          , PUBLIC ::   rn_hrnf      = 0.e0    !: runoffs, depth over which enhanced vertical mixing is used
43   REAL(wp)          , PUBLIC ::   rn_avt_rnf   = 0.e0    !: runoffs, value of the additional vertical mixing coef. [m2/s]
44   REAL(wp)          , PUBLIC ::   rn_rfact     = 1.e0    !: multiplicative factor for runoff
45
46   INTEGER , PUBLIC                     ::   nkrnf = 0    !: number of levels over which Kz is increased at river mouths
47   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rnfmsk       !: river mouth mask (hori.)
48   REAL(wp), PUBLIC, DIMENSION(jpk)     ::   rnfmsk_z     !: river mouth mask (vert.)
49
50   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_rnf       !: structure of input river runoff (file information, fields read)
51
52   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_s_rnf     !: structure of input river runoff salinity (file information, fields read) 
53   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     !: structure of input river runoff temperature (file information, fields read) 
54 
55   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   h_rnf        !: depth of runoff in m
56   INTEGER,  PUBLIC, DIMENSION(jpi,jpj) ::   nk_rnf       !: depth of runoff in model levels
57
58   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,2) ::  tsc_rnf  !: temperature & salinity content of river runoffs   [K.m/s & PSU.m/s]
59
60   !! * Substitutions 
61#  include "domzgr_substitute.h90" 
62   !!----------------------------------------------------------------------
63   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)
64   !! $Id$
65   !! Software governed by the CeCILL licence  (NEMOGCM/License_CeCILL.txt)
66   !!----------------------------------------------------------------------
67
68CONTAINS
69
70   SUBROUTINE sbc_rnf( kt )
71      !!----------------------------------------------------------------------
72      !!                  ***  ROUTINE sbc_rnf  ***
73      !!       
74      !! ** Purpose :   Introduce a climatological run off forcing
75      !!
76      !! ** Method  :   Set each river mouth with a monthly climatology
77      !!                provided from different data.
78      !!                CAUTION : upward water flux, runoff forced to be < 0
79      !!
80      !! ** Action  :   runoff updated runoff field at time-step kt
81      !!----------------------------------------------------------------------
82      INTEGER, INTENT(in) ::   kt          ! ocean time step
83      !!
84      INTEGER  ::   ji, jj   ! dummy loop indices
85      REAL(wp) ::   z1_rau0  ! local scalar
86      !!----------------------------------------------------------------------
87      !                                   
88      IF( kt == nit000 )   CALL sbc_rnf_init                           ! Read namelist and allocate structures
89
90      !                                                   !-------------------!
91      IF( .NOT. ln_rnf_emp ) THEN                         !   Update runoff   !
92         !                                                !-------------------!
93         !
94                             CALL fld_read ( kt, nn_fsbc, sf_rnf )      ! Read Runoffs data and provide it at kt
95         IF( ln_rnf_temp )   CALL fld_read ( kt, nn_fsbc, sf_t_rnf )    ! idem for runoffs temperature if required
96         IF( ln_rnf_sal  )   CALL fld_read ( kt, nn_fsbc, sf_s_rnf )    ! idem for runoffs salinity    if required
97
98         ! Runoff reduction only associated to the ORCA2_LIM configuration
99         ! when reading the NetCDF file runoff_1m_nomask.nc
100         IF( cp_cfg == 'orca' .AND. jp_cfg == 2 )   THEN
101            DO jj = 1, jpj
102               DO ji = 1, jpi
103                  IF( gphit(ji,jj) > 40 .AND. gphit(ji,jj) < 65 )   sf_rnf(1)%fnow(ji,jj,1) = 0.85 * sf_rnf(1)%fnow(ji,jj,1)
104               END DO
105            END DO
106         ENDIF
107
108         ! C a u t i o n : runoff is negative and in kg/m2/s
109
110         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN
111            rnf(:,:)  = rn_rfact * ( sf_rnf(1)%fnow(:,:,1) ) 
112            !
113            z1_rau0 = 1.e0 / rau0
114            !                                                              ! set temperature & salinity content of runoffs
115            IF( ln_rnf_temp )   THEN                                       ! use runoffs temperature data
116               tsc_rnf(:,:,jp_tem) = ( sf_t_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * z1_rau0
117               WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999 )                      ! if missing data value use SST as runoffs temperature 
118                   tsc_rnf(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * z1_rau0
119               ENDWHERE
120            ELSE                                                           ! use SST as runoffs temperature
121               tsc_rnf(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * z1_rau0
122            ENDIF 
123            !                                                              ! use runoffs salinity data
124            IF( ln_rnf_sal ) tsc_rnf(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * z1_rau0
125            !                                                              ! else use S=0 for runoffs (done one for all in the init)
126            !
127            IF( ln_rnf_temp .OR. ln_rnf_sal ) THEN                         ! runoffs as outflow: use ocean SST and SSS
128               WHERE( rnf(:,:) < 0.e0 )                                    ! example baltic model when flow is out of domain
129                  tsc_rnf(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * z1_rau0
130                  tsc_rnf(:,:,jp_sal) = sss_m(:,:) * rnf(:,:) * z1_rau0
131               ENDWHERE
132            ENDIF
133
134            CALL iom_put( "runoffs", rnf )         ! output runoffs arrays
135         ENDIF
136         !
137      ENDIF
138      !
139   END SUBROUTINE sbc_rnf
140
141   SUBROUTINE sbc_rnf_div( phdivn )
142      !!----------------------------------------------------------------------
143      !!                  ***  ROUTINE sbc_rnf  ***
144      !!       
145      !! ** Purpose :   update the horizontal divergence with the runoff inflow
146      !!
147      !! ** Method  :   
148      !!                CAUTION : rnf is positive (inflow) decreasing the
149      !!                          divergence and expressed in m/s
150      !!
151      !! ** Action  :   phdivn   decreased by the runoff inflow
152      !!----------------------------------------------------------------------
153      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) ::   phdivn   ! horizontal divergence
154      !!
155      INTEGER  ::   ji, jj, jk   ! dummy loop indices
156      REAL(wp) ::   z1_rau0   ! local scalar
157      !!----------------------------------------------------------------------
158      !
159      z1_rau0 = 1.e0 / rau0
160      IF( ln_rnf_depth ) THEN      !==   runoff distributed over several levels   ==!
161         IF( lk_vvl ) THEN             ! variable volume case
162            DO jj = 1, jpj                   ! update the depth over which runoffs are distributed
163               DO ji = 1, jpi
164                  h_rnf(ji,jj) = 0.e0 
165                  DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres
166                     h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk)   ! to the bottom of the relevant grid box
167                  END DO 
168                  !                          ! apply the runoff input flow
169                  DO jk = 1, nk_rnf(ji,jj)
170                     phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - rnf(ji,jj) * z1_rau0 / h_rnf(ji,jj)
171                  END DO
172               END DO
173            END DO
174         ELSE                          ! constant volume case : just apply the runoff input flow
175            DO jj = 1, jpj
176               DO ji = 1, jpi
177                  DO jk = 1, nk_rnf(ji,jj)
178                     phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - rnf(ji,jj) * z1_rau0 / h_rnf(ji,jj)
179                  END DO
180               END DO
181            END DO
182         ENDIF
183      ELSE                       !==   runoff put only at the surface   ==!
184         phdivn(:,:,1) = phdivn(:,:,1) - rnf(:,:) * z1_rau0 / fse3t(:,:,1)
185      ENDIF
186      !
187   END SUBROUTINE sbc_rnf_div
188
189
190   SUBROUTINE sbc_rnf_init
191      !!----------------------------------------------------------------------
192      !!                  ***  ROUTINE sbc_rnf_init  ***
193      !!
194      !! ** Purpose :   Initialisation of the runoffs if (ln_rnf=T)
195      !!
196      !! ** Method  : - read the runoff namsbc_rnf namelist
197      !!
198      !! ** Action  : - read parameters
199      !!----------------------------------------------------------------------
200      CHARACTER(len=32) ::   rn_dep_file   ! runoff file name 
201      INTEGER           ::   ji, jj, jk    ! dummy loop indices
202      INTEGER           ::   ierror, inum  ! temporary integer
203      !!
204      NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, ln_rnf_depth, ln_rnf_temp, ln_rnf_sal,   &
205         &                 sn_rnf, sn_cnf    , sn_s_rnf    , sn_t_rnf   , sn_dep_rnf,   & 
206         &                 ln_rnf_mouth      , rn_hrnf     , rn_avt_rnf , rn_rfact 
207      !!----------------------------------------------------------------------
208
209      !                                   ! ============
210      !                                   !   Namelist
211      !                                   ! ============
212      ! (NB: frequency positive => hours, negative => months)
213      !            !   file    ! frequency !  variable  ! time intep !  clim  ! 'yearly' or ! weights  ! rotation   !
214      !            !   name    !  (hours)  !   name     !   (T/F)    !  (T/F) !  'monthly'  ! filename ! pairs      !
215      sn_rnf = FLD_N( 'runoffs',    -1     , 'sorunoff' ,  .TRUE.    , .true. ,   'yearly'  , ''       , ''         )
216      sn_cnf = FLD_N( 'runoffs',     0     , 'sorunoff' ,  .FALSE.   , .true. ,   'yearly'  , ''       , ''         )
217
218      sn_s_rnf = FLD_N( 'runoffs',  24.  , 'rosaline' ,  .TRUE.    , .true. ,   'yearly'  , ''    , ''  ) 
219      sn_t_rnf = FLD_N( 'runoffs',  24.  , 'rotemper' ,  .TRUE.    , .true. ,   'yearly'  , ''    , ''  ) 
220      sn_dep_rnf = FLD_N( 'runoffs',   0.  , 'rodepth'  ,  .FALSE.   , .true. ,   'yearly'  , ''    , ''  ) 
221      !
222      REWIND ( numnam )                         ! Read Namelist namsbc_rnf
223      READ   ( numnam, namsbc_rnf )
224
225      !                                         ! Control print
226      IF(lwp) THEN
227         WRITE(numout,*)
228         WRITE(numout,*) 'sbc_rnf : runoff '
229         WRITE(numout,*) '~~~~~~~ '
230         WRITE(numout,*) '   Namelist namsbc_rnf'
231         WRITE(numout,*) '      runoff in a file to be read                ln_rnf_emp   = ', ln_rnf_emp
232         WRITE(numout,*) '      specific river mouths treatment            ln_rnf_mouth = ', ln_rnf_mouth
233         WRITE(numout,*) '      river mouth additional Kz                  rn_avt_rnf   = ', rn_avt_rnf
234         WRITE(numout,*) '      depth of river mouth additional mixing     rn_hrnf      = ', rn_hrnf
235         WRITE(numout,*) '      multiplicative factor for runoff           rn_rfact     = ', rn_rfact   
236      ENDIF
237
238      !                                   ! ==================
239      !                                   !   Type of runoff
240      !                                   ! ==================
241      !
242      IF( ln_rnf_emp ) THEN                     !==  runoffs directly provided in the precipitations  ==!
243         IF(lwp) WRITE(numout,*)
244         IF(lwp) WRITE(numout,*) '          runoffs directly provided in the precipitations'
245         IF( ln_rnf_depth .OR. ln_rnf_temp .OR. ln_rnf_sal ) THEN
246           CALL ctl_warn( 'runoffs already included in precipitations, so runoff (T,S, depth) attributes will not be used' ) 
247           ln_rnf_depth = .FALSE.   ;   ln_rnf_temp = .FALSE.   ;   ln_rnf_sal = .FALSE.
248         ENDIF
249         !
250      ELSE                                      !==  runoffs read in a file : set sf_rnf structure  ==!
251         !
252         ALLOCATE( sf_rnf(1), STAT=ierror )         ! Create sf_rnf structure (runoff inflow)
253         IF(lwp) WRITE(numout,*)
254         IF(lwp) WRITE(numout,*) '          runoffs inflow read in a file'
255         IF( ierror > 0 ) THEN
256            CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
257         ENDIF
258         ALLOCATE( sf_rnf(1)%fnow(jpi,jpj,1)   )
259         IF( sn_rnf%ln_tint ) ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,1,2) )
260         !                                          ! fill sf_rnf with the namelist (sn_rnf) and control print
261         CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf' )
262         !
263         IF( ln_rnf_temp ) THEN                     ! Create (if required) sf_t_rnf structure
264            IF(lwp) WRITE(numout,*)
265            IF(lwp) WRITE(numout,*) '          runoffs temperatures read in a file'
266            ALLOCATE( sf_t_rnf(1), STAT=ierror  )
267            IF( ierror > 0 ) THEN
268               CALL ctl_stop( 'sbc_rnf_init: unable to allocate sf_t_rnf structure' )   ;   RETURN
269            ENDIF
270            ALLOCATE( sf_t_rnf(1)%fnow(jpi,jpj,1)   )
271            IF( sn_t_rnf%ln_tint ) ALLOCATE( sf_t_rnf(1)%fdta(jpi,jpj,1,2) )
272            CALL fld_fill (sf_t_rnf, (/ sn_t_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff temperature data', 'namsbc_rnf' ) 
273         ENDIF
274         !
275         IF( ln_rnf_sal  ) THEN                     ! Create (if required) sf_s_rnf and sf_t_rnf structures
276            IF(lwp) WRITE(numout,*)
277            IF(lwp) WRITE(numout,*) '          runoffs salinities read in a file'
278            ALLOCATE( sf_s_rnf(1), STAT=ierror  )
279            IF( ierror > 0 ) THEN
280               CALL ctl_stop( 'sbc_rnf_init: unable to allocate sf_s_rnf structure' )   ;   RETURN
281            ENDIF
282            ALLOCATE( sf_s_rnf(1)%fnow(jpi,jpj,1)   )
283            IF( sn_s_rnf%ln_tint ) ALLOCATE( sf_s_rnf(1)%fdta(jpi,jpj,1,2) )
284            CALL fld_fill (sf_s_rnf, (/ sn_s_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff salinity data', 'namsbc_rnf' ) 
285         ENDIF
286
287 
288         IF ( ln_rnf_depth ) THEN                     ! depth of runoffs set from a file
289            IF(lwp) WRITE(numout,*)
290            IF(lwp) WRITE(numout,*) '          runoffs depth read in a file'
291            rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 
292            CALL iom_open ( rn_dep_file, inum )                           ! open file 
293            CALL iom_get  ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf )    ! read the river mouth array 
294            CALL iom_close( inum )                                      ! close file 
295 
296            nk_rnf(:,:)=0                              ! set the number of level over which river runoffs are applied
297            DO jj=1,jpj 
298              DO ji=1,jpi 
299                IF ( h_rnf(ji,jj) > 0.e0 ) THEN 
300                  jk=2 
301                  DO WHILE ( jk/=(mbathy(ji,jj)-1) .AND. fsdept(ji,jj,jk) < h_rnf(ji,jj) );  jk=jk+1;   ENDDO 
302                  nk_rnf(ji,jj)=jk 
303                ELSE IF ( h_rnf(ji,jj) == -1   ) THEN   ;  nk_rnf(ji,jj)=1 
304                ELSE IF ( h_rnf(ji,jj) == -999 ) THEN   ;  nk_rnf(ji,jj)=mbathy(ji,jj)-1
305                ELSE IF ( h_rnf(ji,jj) /= 0 ) THEN 
306                  CALL ctl_stop( 'runoff depth not positive, and not -999 or -1, rnf value in file fort.999'  ) 
307                  WRITE(999,*) 'ji, jj, rnf(ji,jj) :', ji, jj, rnf(ji,jj) 
308                ENDIF 
309              ENDDO 
310            ENDDO 
311            DO jj=1,jpj                               ! set the associated depth
312              DO ji=1,jpi 
313                h_rnf(ji,jj)=0.e0
314                DO jk=1,nk_rnf(ji,jj)                       
315                   h_rnf(ji,jj)=h_rnf(ji,jj)+fse3t(ji,jj,jk) 
316                ENDDO
317              ENDDO
318            ENDDO
319         ELSE                                       ! runoffs applied at the surface
320            nk_rnf(:,:)=1 
321            h_rnf(:,:)=fse3t(:,:,1)
322         ENDIF 
323      !
324      ENDIF
325
326      tsc_rnf(:,:,:) = 0.e0                 ! runoffs temperature & salinty contents initilisation
327      !                                   ! ========================
328      !                                   !   River mouth vicinity
329      !                                   ! ========================
330      !
331      IF( ln_rnf_mouth ) THEN                   ! Specific treatment in vicinity of river mouths :
332         !                                      !    - Increase Kz in surface layers ( rn_hrnf > 0 )
333         !                                      !    - set to zero SSS damping (ln_ssr=T)
334         !                                      !    - mixed upstream-centered (ln_traadv_cen2=T)
335         !
336         IF ( ln_rnf_depth )   CALL ctl_warn( 'sbc_rnf_init: increased mixing turned on but effects may already',   &
337            &                                              'be spread through depth by ln_rnf_depth'               ) 
338         !
339         nkrnf = 0                                  ! Number of level over which Kz increase
340         IF( rn_hrnf > 0.e0 ) THEN
341            nkrnf = 2
342            DO WHILE( nkrnf /= jpkm1 .AND. gdepw_0(nkrnf+1) < rn_hrnf )   ;   nkrnf = nkrnf + 1   ;   END DO
343            IF( ln_sco )   &
344               CALL ctl_warn( 'sbc_rnf: number of levels over which Kz is increased is computed for zco...' )
345         ENDIF
346         IF(lwp) WRITE(numout,*)
347         IF(lwp) WRITE(numout,*) '          Specific treatment used in vicinity of river mouths :'
348         IF(lwp) WRITE(numout,*) '             - Increase Kz in surface layers (if rn_hrnf > 0 )'
349         IF(lwp) WRITE(numout,*) '               by ', rn_avt_rnf,' m2/s  over ', nkrnf, ' w-levels'
350         IF(lwp) WRITE(numout,*) '             - set to zero SSS damping       (if ln_ssr=T)'
351         IF(lwp) WRITE(numout,*) '             - mixed upstream-centered       (if ln_traadv_cen2=T)'
352         !
353         CALL rnf_mouth                             ! set river mouth mask
354         !
355      ELSE                                      ! No treatment at river mouths
356         IF(lwp) WRITE(numout,*)
357         IF(lwp) WRITE(numout,*) '          No specific treatment at river mouths'
358         rnfmsk  (:,:) = 0.e0 
359         rnfmsk_z(:)   = 0.e0
360         nkrnf = 0
361      ENDIF
362
363   END SUBROUTINE sbc_rnf_init
364
365
366   SUBROUTINE rnf_mouth
367      !!----------------------------------------------------------------------
368      !!                  ***  ROUTINE rnf_mouth  ***
369      !!       
370      !! ** Purpose :   define the river mouths mask
371      !!
372      !! ** Method  :   read the river mouth mask (=0/1) in the river runoff
373      !!                climatological file. Defined a given vertical structure.
374      !!                CAUTION, the vertical structure is hard coded on the
375      !!                first 5 levels.
376      !!                This fields can be used to:
377      !!                 - set an upstream advection scheme 
378      !!                   (ln_rnf_mouth=T and ln_traadv_cen2=T)
379      !!                 - increase vertical on the top nn_krnf vertical levels
380      !!                   at river runoff input grid point (nn_krnf>=2, see step.F90)
381      !!                 - set to zero SSS restoring flux at river mouth grid points
382      !!
383      !! ** Action  :   rnfmsk   set to 1 at river runoff input, 0 elsewhere
384      !!                rnfmsk_z vertical structure
385      !!----------------------------------------------------------------------
386      USE closea, ONLY :    clo_rnf   ! rnfmsk update routine
387      !
388      INTEGER           ::   inum        ! temporary integers
389      CHARACTER(len=32) ::   cl_rnfile   ! runoff file name
390      !!----------------------------------------------------------------------
391      !
392      IF(lwp) WRITE(numout,*)
393      IF(lwp) WRITE(numout,*) 'rnf_mouth : river mouth mask'
394      IF(lwp) WRITE(numout,*) '~~~~~~~~~ '
395
396      cl_rnfile = TRIM( cn_dir )//TRIM( sn_cnf%clname )
397      IF( .NOT. sn_cnf%ln_clim ) THEN   ;   WRITE(cl_rnfile, '(a,"_y",i4)' ) TRIM( cl_rnfile ), nyear    ! add year
398         IF( sn_cnf%cltype == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month
399      ENDIF
400 
401      ! horizontal mask (read in NetCDF file)
402      CALL iom_open ( cl_rnfile, inum )                           ! open file
403      CALL iom_get  ( inum, jpdom_data, sn_cnf%clvar, rnfmsk )    ! read the river mouth array
404      CALL iom_close( inum )                                      ! close file
405     
406      IF( nclosea == 1 )    CALL clo_rnf( rnfmsk )                ! closed sea inflow set as ruver mouth
407
408      rnfmsk_z(:)   = 0.e0                                        ! vertical structure
409      rnfmsk_z(1)   = 1.0
410      rnfmsk_z(2)   = 1.0                                         ! **********
411      rnfmsk_z(3)   = 0.5                                         ! HARD CODED on the 5 first levels
412      rnfmsk_z(4)   = 0.25                                        ! **********
413      rnfmsk_z(5)   = 0.125
414      !         
415   END SUBROUTINE rnf_mouth
416   
417   !!======================================================================
418END MODULE sbcrnf
Note: See TracBrowser for help on using the repository browser.