source: CONFIG/UNIFORM/v6/IPSLCM5A2CHT.2/SOURCES/NEMO/PALEO/ldfdyn_c2d.h90 @ 6032

Last change on this file since 6032 was 6032, checked in by acosce, 2 years ago

create new configuration for IPSLCM5A2CHT model :

1- this configuration will allow to done paleo experiment (need to be done)
2- compilation will be done with script like v6.2 configurations

File size: 20.6 KB
Line 
1   !!----------------------------------------------------------------------
2   !!                      ***  ldfdyn_c2d.h90  ***
3   !!----------------------------------------------------------------------
4   !!   ldf_dyn_c2d  : set the lateral viscosity coefficients
5   !!   ldf_dyn_c2d_orca : specific case for orca r2 and r4
6   !!----------------------------------------------------------------------
7
8   !!----------------------------------------------------------------------
9   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
10   !! $Id: ldfdyn_c2d.h90 5400 2015-06-10 15:29:08Z cbricaud $
11   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
12   !!----------------------------------------------------------------------
13
14   SUBROUTINE ldf_dyn_c2d( ld_print )
15      !!----------------------------------------------------------------------
16      !!                 ***  ROUTINE ldf_dyn_c2d  ***
17      !!                 
18      !! ** Purpose :   initializations of the horizontal ocean physics
19      !!
20      !! ** Method :
21      !!      2D eddy viscosity coefficients ( longitude, latitude )
22      !!
23      !!       harmonic operator   : ahm1 is defined at t-point
24      !!                             ahm2 is defined at f-point
25      !!           + isopycnal     : ahm3 is defined at u-point
26      !!           or geopotential   ahm4 is defined at v-point
27      !!           iso-model level : ahm3, ahm4 not used
28      !!
29      !!       biharmonic operator : ahm3 is defined at u-point
30      !!                             ahm4 is defined at v-point
31      !!                           : ahm1, ahm2 not used
32      !!
33      !!----------------------------------------------------------------------
34      LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout
35      !
36      INTEGER  ::   ji, jj
37      REAL(wp) ::   za00, zd_max, zetmax, zeumax, zefmax, zevmax
38      !!----------------------------------------------------------------------
39
40      IF(lwp) WRITE(numout,*)
41      IF(lwp) WRITE(numout,*) 'ldf_dyn_c2d : 2d lateral eddy viscosity coefficient'
42      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
43
44      ! harmonic operator (ahm1, ahm2) : ( T- and F- points) (used for laplacian operators
45      ! ===============================                       whatever its orientation is)
46      IF( ln_dynldf_lap ) THEN
47         ! define ahm1 and ahm2 at the right grid point position
48         ! (USER: modify ahm1 and ahm2 following your desiderata)
49
50         zd_max = MAX( MAXVAL( e1t(:,:) ), MAXVAL( e2t(:,:) ) )
51         IF( lk_mpp )   CALL mpp_max( zd_max )   ! max over the global domain
52
53         IF(lwp) WRITE(numout,*) '              laplacian operator: ahm proportional to e1'
54         IF(lwp) WRITE(numout,*) '              maximum grid-spacing = ', zd_max, ' maximum value for ahm = ', ahm0
55
56         za00 = ahm0 / zd_max
57         DO jj = 1, jpj
58            DO ji = 1, jpi
59               zetmax = MAX( e1t(ji,jj), e2t(ji,jj) )
60               zefmax = MAX( e1f(ji,jj), e2f(ji,jj) )
61               ahm1(ji,jj) = za00 * zetmax
62               ahm2(ji,jj) = za00 * zefmax
63            END DO
64         END DO
65
66         IF( ln_dynldf_iso ) THEN
67            IF(lwp) WRITE(numout,*) '              Caution, as implemented now, the isopycnal part of momentum'
68            IF(lwp) WRITE(numout,*) '                 mixing use aht0 as eddy viscosity coefficient. Thus, it is'
69            IF(lwp) WRITE(numout,*) '                 uniform and you must be sure that your ahm is greater than'
70            IF(lwp) WRITE(numout,*) '                 aht0 everywhere in the model domain.'
71         ENDIF
72
73         ! Special case for ORCA R1, R2 and R4 configurations (overwrite the value of ahm1 ahm2)
74         ! Add PALEORCA2 configuration -- JBL 08.02.2017
75         ! ==============================================
76         IF( ( cp_cfg == "orca" .OR. cp_cfg == "paleorca" ) .AND. ( jp_cfg == 2 .OR. jp_cfg == 4 ) )   CALL ldf_dyn_c2d_orca( ld_print )
77         IF( cp_cfg == "orca" .AND.   jp_cfg == 1)                       CALL ldf_dyn_c2d_orca_R1( ld_print )
78
79         ! Control print
80         IF( lwp .AND. ld_print ) THEN
81            WRITE(numout,*)
82            WRITE(numout,*) 'inildf: 2D ahm1 array'
83            CALL prihre(ahm1,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
84            WRITE(numout,*)
85            WRITE(numout,*) 'inildf: 2D ahm2 array'
86            CALL prihre(ahm2,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
87         ENDIF
88      ENDIF
89
90      ! biharmonic operator (ahm3, ahm4) : at U- and V-points (used for bilaplacian operator
91      ! =================================                      whatever its orientation is)
92      IF( ln_dynldf_bilap ) THEN
93         ! (USER: modify ahm3 and ahm4 following your desiderata)
94         ! Here: ahm is proportional to the cube of the maximum of the gridspacing
95         !       in the to horizontal direction
96
97         zd_max = MAX( MAXVAL( e1u(:,:) ), MAXVAL( e2u(:,:) ) )
98         IF( lk_mpp )   CALL mpp_max( zd_max )   ! max over the global domain
99
100         IF(lwp) WRITE(numout,*) '              bi-laplacian operator: ahm proportional to e1**3 '
101         IF(lwp) WRITE(numout,*) '              maximum grid-spacing = ', zd_max, ' maximum value for ahm = ', ahm0
102
103         za00 = ahm0_blp / ( zd_max * zd_max * zd_max )
104         DO jj = 1, jpj
105            DO ji = 1, jpi
106               zeumax = MAX( e1u(ji,jj), e2u(ji,jj) )
107               zevmax = MAX( e1v(ji,jj), e2v(ji,jj) )
108               ahm3(ji,jj) = za00 * zeumax * zeumax * zeumax
109               ahm4(ji,jj) = za00 * zevmax * zevmax * zevmax
110            END DO
111         END DO
112
113         ! Control print
114         IF( lwp .AND. ld_print ) THEN
115            WRITE(numout,*)
116            WRITE(numout,*) 'inildf: ahm3 array'
117            CALL prihre(ahm3,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
118            WRITE(numout,*)
119            WRITE(numout,*) 'inildf: ahm4 array'
120            CALL prihre(ahm4,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
121         ENDIF
122      ENDIF
123      !
124   END SUBROUTINE ldf_dyn_c2d
125
126
127   SUBROUTINE ldf_dyn_c2d_orca( ld_print )
128      !!----------------------------------------------------------------------
129      !!                 ***  ROUTINE ldf_dyn_c2d  ***
130      !!
131      !!                   **** W A R N I N G ****
132      !!
133      !!                ORCA R2 and R4 configurations
134      !!                 
135      !!                   **** W A R N I N G ****
136      !!                 
137      !! ** Purpose :   initializations of the lateral viscosity for orca R2
138      !!
139      !! ** Method  :   blah blah blah...
140      !!
141      !!----------------------------------------------------------------------
142      USE ldftra_oce, ONLY:   aht0
143      USE iom
144      !
145      LOGICAL, INTENT (in) ::   ld_print   ! If true, output arrays on numout
146      !
147      INTEGER  ::   ji, jj, jn   ! dummy loop indices
148      INTEGER  ::   inum, iim, ijm            ! local integers
149      INTEGER  ::   ifreq, il1, il2, ij, ii
150      INTEGER  ::   ijpt0,ijpt1, ierror
151      REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk
152      CHARACTER (len=15) ::   clexp
153      INTEGER,     POINTER, DIMENSION(:,:)  :: icof
154      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztemp2d  ! temporary array to read ahmcoef file
155      !!----------------------------------------------------------------------
156      !                               
157      CALL wrk_alloc( jpi   , jpj   , icof  )
158      !
159      IF(lwp) WRITE(numout,*)
160      IF(lwp) WRITE(numout,*) 'inildf: 2d eddy viscosity coefficient'
161      IF(lwp) WRITE(numout,*) '~~~~~~  --'
162      IF(lwp) WRITE(numout,*) '        orca ocean configuration'
163
164      ! Add PALEORCA2 configuration -- JBL 08.02.2017
165      IF( ( cp_cfg == "orca" .OR. cp_cfg == "paleorca" ) .AND. cp_cfz == "antarctic" ) THEN
166!
167! 1.2 Modify ahm
168! --------------
169         IF(lwp)WRITE(numout,*) ' inildf: Antarctic ocean'
170         IF(lwp)WRITE(numout,*) '         no tropics, no reduction of ahm'
171         IF(lwp)WRITE(numout,*) '         north boundary increase'
172
173         ahm1(:,:) = ahm0
174         ahm2(:,:) = ahm0
175
176         ijpt0=max(1,min(49 -njmpp+1,jpj))
177         ijpt1=max(0,min(49-njmpp+1,jpj-1))
178         DO jj=ijpt0,ijpt1
179            ahm2(:,jj)=ahm0*2.
180            ahm1(:,jj)=ahm0*2.
181         END DO
182         ijpt0=max(1,min(48 -njmpp+1,jpj))
183         ijpt1=max(0,min(48-njmpp+1,jpj-1))
184         DO jj=ijpt0,ijpt1
185            ahm2(:,jj)=ahm0*1.9
186            ahm1(:,jj)=ahm0*1.75
187         END DO
188         ijpt0=max(1,min(47 -njmpp+1,jpj))
189         ijpt1=max(0,min(47-njmpp+1,jpj-1))
190         DO jj=ijpt0,ijpt1
191            ahm2(:,jj)=ahm0*1.5
192            ahm1(:,jj)=ahm0*1.25
193         END DO
194         ijpt0=max(1,min(46 -njmpp+1,jpj))
195         ijpt1=max(0,min(46-njmpp+1,jpj-1))
196         DO jj=ijpt0,ijpt1
197            ahm2(:,jj)=ahm0*1.1
198         END DO
199
200      ! Add PALEORCA2 configuration -- JBL 08.02.2017
201      ELSE IF( ( cp_cfg == "orca" .OR. cp_cfg == "paleorca" ) .AND. cp_cfz == "arctic" ) THEN
202! 1.2 Modify ahm
203! --------------
204         IF(lwp)WRITE(numout,*) ' inildf: Arctic ocean'
205         IF(lwp)WRITE(numout,*) '         no tropics, no reduction of ahm'
206         IF(lwp)WRITE(numout,*) '         south and west boundary increase'
207
208
209         ahm1(:,:) = ahm0
210         ahm2(:,:) = ahm0
211
212         ijpt0=max(1,min(98-jpjzoom+1-njmpp+1,jpj))
213         ijpt1=max(0,min(98-jpjzoom+1-njmpp+1,jpj-1))
214         DO jj=ijpt0,ijpt1
215            ahm2(:,jj)=ahm0*2.
216            ahm1(:,jj)=ahm0*2.
217         END DO
218         ijpt0=max(1,min(99-jpjzoom+1-njmpp+1,jpj))
219         ijpt1=max(0,min(99-jpjzoom+1-njmpp+1,jpj-1))
220         DO jj=ijpt0,ijpt1
221            ahm2(:,jj)=ahm0*1.9
222            ahm1(:,jj)=ahm0*1.75
223         END DO
224         ijpt0=max(1,min(100-jpjzoom+1-njmpp+1,jpj))
225         ijpt1=max(0,min(100-jpjzoom+1-njmpp+1,jpj-1))
226         DO jj=ijpt0,ijpt1
227            ahm2(:,jj)=ahm0*1.5
228            ahm1(:,jj)=ahm0*1.25
229         END DO
230         ijpt0=max(1,min(101-jpjzoom+1-njmpp+1,jpj))
231         ijpt1=max(0,min(101-jpjzoom+1-njmpp+1,jpj-1))
232         DO jj=ijpt0,ijpt1
233            ahm2(:,jj)=ahm0*1.1
234         END DO
235      ELSE
236         ! Read 2d integer array to specify western boundary increase in the
237         ! ===================== equatorial strip (20N-20S) defined at t-points
238         !
239         ALLOCATE( ztemp2d(jpi,jpj) )
240         ztemp2d(:,:) = 0.
241         CALL iom_open ( 'ahmcoef.nc', inum )
242         CALL iom_get  ( inum, jpdom_data, 'icof', ztemp2d)
243         icof(:,:)  = NINT(ztemp2d(:,:))
244         CALL iom_close( inum )
245         DEALLOCATE(ztemp2d)
246
247         ! Set ahm1 and ahm2  ( T- and F- points) (used for laplacian operator)
248         ! =================
249         ! define ahm1 and ahm2 at the right grid point position
250         ! (USER: modify ahm1 and ahm2 following your desiderata)
251
252
253         ! Decrease ahm to zahmeq m2/s in the tropics
254         ! (from 90 to 20 degre: ahm = constant
255         ! from 20 to  2.5 degre: ahm = decrease in (1-cos)/2
256         ! from  2.5 to  0 degre: ahm = constant
257         ! symmetric in the south hemisphere)
258
259         zahmeq = aht0
260
261         DO jj = 1, jpj
262            DO ji = 1, jpi
263               IF( ABS( gphif(ji,jj) ) >= 20. ) THEN
264                  ahm2(ji,jj) =  ahm0
265               ELSEIF( ABS( gphif(ji,jj) ) <= 2.5 ) THEN
266                  ahm2(ji,jj) =  zahmeq
267               ELSE
268                  ahm2(ji,jj) = zahmeq + (ahm0-zahmeq)/2.   &
269                     * ( 1. - COS( rad * ( ABS(gphif(ji,jj))-2.5 ) * 180. / 17.5 ) )
270               ENDIF
271               IF( ABS( gphit(ji,jj) ) >= 20. ) THEN
272                  ahm1(ji,jj) =  ahm0
273               ELSEIF( ABS( gphit(ji,jj) ) <= 2.5 ) THEN
274                  ahm1(ji,jj) =  zahmeq
275               ELSE
276                  ahm1(ji,jj) = zahmeq + (ahm0-zahmeq)/2.   &
277                     * ( 1. - COS( rad * ( ABS(gphit(ji,jj))-2.5 ) * 180. / 17.5 ) )
278               ENDIF
279            END DO
280         END DO
281
282         ! increase along western boundaries of equatorial strip
283         ! t-point
284         DO jj = 1, jpjm1
285            DO ji = 1, jpim1
286               zcoft = FLOAT( icof(ji,jj) ) / 100.
287               ahm1(ji,jj) = zcoft * ahm0 + (1.-zcoft) * ahm1(ji,jj)
288            END DO
289         END DO
290         ! f-point
291         icof(:,:) = icof(:,:) * tmask(:,:,1)
292         DO jj = 1, jpjm1
293            DO ji = 1, jpim1   ! NO vector opt.
294               zmsk = tmask(ji,jj+1,1) + tmask(ji+1,jj+1,1) + tmask(ji,jj,1) + tmask(ji,jj+1,1)
295               IF( zmsk == 0. ) THEN
296                  zcoff = 1.
297               ELSE
298                  zcoff = FLOAT( icof(ji,jj+1) + icof(ji+1,jj+1) + icof(ji,jj) + icof(ji,jj+1) )   &
299                     / (zmsk * 100.)
300               ENDIF
301               ahm2(ji,jj) = zcoff * ahm0 + (1.-zcoff) * ahm2(ji,jj)
302            END DO
303         END DO
304      ENDIF
305     
306      ! Lateral boundary conditions on ( ahm1, ahm2 )
307      !                                ==============
308      CALL lbc_lnk( ahm1, 'T', 1. )   ! T-point, unchanged sign
309      CALL lbc_lnk( ahm2, 'F', 1. )   ! F-point, unchanged sign
310
311      ! Control print
312      IF( lwp .AND. ld_print ) THEN
313         WRITE(numout,*)
314         WRITE(numout,*) 'inildf: 2D ahm1 array'
315         CALL prihre(ahm1,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
316         WRITE(numout,*)
317         WRITE(numout,*) 'inildf: 2D ahm2 array'
318         CALL prihre(ahm2,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
319      ENDIF
320      !
321      CALL wrk_dealloc( jpi   , jpj   , icof  )
322      !
323   END SUBROUTINE ldf_dyn_c2d_orca
324
325
326   SUBROUTINE ldf_dyn_c2d_orca_R1( ld_print )
327      !!----------------------------------------------------------------------
328      !!                 ***  ROUTINE ldf_dyn_c2d  ***
329      !!
330      !!                   **** W A R N I N G ****
331      !!
332      !!                ORCA R1 configuration
333      !!                 
334      !!                   **** W A R N I N G ****
335      !!                 
336      !! ** Purpose :   initializations of the lateral viscosity for orca R1
337      !!
338      !! ** Method  :   blah blah blah...
339      !!
340      !!----------------------------------------------------------------------
341      USE ldftra_oce, ONLY:   aht0
342      USE iom
343      !
344      LOGICAL, INTENT (in) ::   ld_print   ! If true, output arrays on numout
345      !
346      INTEGER ::   ji, jj, jn      ! dummy loop indices
347      INTEGER ::   inum            ! temporary logical unit
348      INTEGER ::   iim, ijm
349      INTEGER ::   ifreq, il1, il2, ij, ii
350      INTEGER ::   ijpt0,ijpt1, ierror
351      REAL(wp) ::   zahmeq, zcoft, zcoff, zmsk, zam20s
352      CHARACTER (len=15) ::   clexp
353      INTEGER,     POINTER, DIMENSION(:,:)  :: icof
354      REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ztemp2d  ! temporary array to read ahmcoef file
355      !!----------------------------------------------------------------------
356      !                               
357      CALL wrk_alloc( jpi   , jpj   , icof  )
358      !                               
359      IF(lwp) WRITE(numout,*)
360      IF(lwp) WRITE(numout,*) 'inildf: 2d eddy viscosity coefficient'
361      IF(lwp) WRITE(numout,*) '~~~~~~  --'
362      IF(lwp) WRITE(numout,*) '        orca_r1 configuration'
363
364      IF( cp_cfg == "orca" .AND. cp_cfz == "antarctic" ) THEN
365!
366! 1.2 Modify ahm
367! --------------
368         IF(lwp)WRITE(numout,*) ' inildf: Antarctic ocean'
369         IF(lwp)WRITE(numout,*) '         no tropics, no reduction of ahm'
370         IF(lwp)WRITE(numout,*) '         north boundary increase'
371
372         ahm1(:,:) = ahm0
373         ahm2(:,:) = ahm0
374
375         ijpt0=max(1,min(49 -njmpp+1,jpj))
376         ijpt1=max(0,min(49-njmpp+1,jpj-1))
377         DO jj=ijpt0,ijpt1
378            ahm2(:,jj)=ahm0*2.
379            ahm1(:,jj)=ahm0*2.
380         END DO
381         ijpt0=max(1,min(48 -njmpp+1,jpj))
382         ijpt1=max(0,min(48-njmpp+1,jpj-1))
383         DO jj=ijpt0,ijpt1
384            ahm2(:,jj)=ahm0*1.9
385            ahm1(:,jj)=ahm0*1.75
386         END DO
387         ijpt0=max(1,min(47 -njmpp+1,jpj))
388         ijpt1=max(0,min(47-njmpp+1,jpj-1))
389         DO jj=ijpt0,ijpt1
390            ahm2(:,jj)=ahm0*1.5
391            ahm1(:,jj)=ahm0*1.25
392         END DO
393         ijpt0=max(1,min(46 -njmpp+1,jpj))
394         ijpt1=max(0,min(46-njmpp+1,jpj-1))
395         DO jj=ijpt0,ijpt1
396            ahm2(:,jj)=ahm0*1.1
397         END DO
398
399      ELSE IF( cp_cfg == "orca" .AND. cp_cfz == "arctic" ) THEN
400! 1.2 Modify ahm
401! --------------
402         IF(lwp)WRITE(numout,*) ' inildf: Arctic ocean'
403         IF(lwp)WRITE(numout,*) '         no tropics, no reduction of ahm'
404         IF(lwp)WRITE(numout,*) '         south and west boundary increase'
405
406
407         ahm1(:,:) = ahm0
408         ahm2(:,:) = ahm0
409
410         ijpt0=max(1,min(98-jpjzoom+1-njmpp+1,jpj))
411         ijpt1=max(0,min(98-jpjzoom+1-njmpp+1,jpj-1))
412         DO jj=ijpt0,ijpt1
413            ahm2(:,jj)=ahm0*2.
414            ahm1(:,jj)=ahm0*2.
415         END DO
416         ijpt0=max(1,min(99-jpjzoom+1-njmpp+1,jpj))
417         ijpt1=max(0,min(99-jpjzoom+1-njmpp+1,jpj-1))
418         DO jj=ijpt0,ijpt1
419            ahm2(:,jj)=ahm0*1.9
420            ahm1(:,jj)=ahm0*1.75
421         END DO
422         ijpt0=max(1,min(100-jpjzoom+1-njmpp+1,jpj))
423         ijpt1=max(0,min(100-jpjzoom+1-njmpp+1,jpj-1))
424         DO jj=ijpt0,ijpt1
425            ahm2(:,jj)=ahm0*1.5
426            ahm1(:,jj)=ahm0*1.25
427         END DO
428         ijpt0=max(1,min(101-jpjzoom+1-njmpp+1,jpj))
429         ijpt1=max(0,min(101-jpjzoom+1-njmpp+1,jpj-1))
430         DO jj=ijpt0,ijpt1
431            ahm2(:,jj)=ahm0*1.1
432         END DO
433      ELSE
434         
435         ! Read 2d integer array to specify western boundary increase in the
436         ! ===================== equatorial strip (20N-20S) defined at t-points
437         ALLOCATE( ztemp2d(jpi,jpj) )
438         ztemp2d(:,:) = 0.
439         CALL iom_open ( 'ahmcoef.nc', inum )
440         CALL iom_get  ( inum, jpdom_data, 'icof', ztemp2d)
441         icof(:,:)  = NINT(ztemp2d(:,:))
442         CALL iom_close( inum )
443         DEALLOCATE(ztemp2d)
444
445         ! Set ahm1 and ahm2  ( T- and F- points) (used for laplacian operator)
446         ! =================
447         ! define ahm1 and ahm2 at the right grid point position
448         ! (USER: modify ahm1 and ahm2 following your desiderata)
449
450
451         ! Decrease ahm to zahmeq m2/s in the tropics
452         ! (from 90   to 20   degrees: ahm = scaled by local metrics
453         !  from 20   to  2.5 degrees: ahm = decrease in (1-cos)/2
454         !  from  2.5 to  0   degrees: ahm = constant
455         ! symmetric in the south hemisphere)
456
457         zahmeq = aht0
458         zam20s = ahm0*COS( rad * 20. )
459
460         DO jj = 1, jpj
461            DO ji = 1, jpi
462               IF( ABS( gphif(ji,jj) ) >= 20. ) THEN
463                  !              leave as set in ldf_dyn_c2d
464               ELSEIF( ABS( gphif(ji,jj) ) <= 2.5 ) THEN
465                  ahm2(ji,jj) =  zahmeq
466               ELSE
467                  ahm2(ji,jj) =  zahmeq + (zam20s-zahmeq)/2.   &
468                     * ( 1. - COS( rad * ( ABS(gphif(ji,jj))-2.5 ) * 180. / 17.5 ) )
469               ENDIF
470               IF( ABS( gphit(ji,jj) ) >= 20. ) THEN
471                  !             leave as set in ldf_dyn_c2d
472               ELSEIF( ABS( gphit(ji,jj) ) <= 2.5 ) THEN
473                  ahm1(ji,jj) =  zahmeq
474               ELSE
475                  ahm1(ji,jj) =  zahmeq + (zam20s-zahmeq)/2.   &
476                     * ( 1. - COS( rad * ( ABS(gphit(ji,jj))-2.5 ) * 180. / 17.5 ) )
477               ENDIF
478            END DO
479         END DO
480
481         ! increase along western boundaries of equatorial strip
482         ! t-point
483         DO jj = 1, jpjm1
484            DO ji = 1, jpim1
485               IF( ABS( gphit(ji,jj) ) < 20. ) THEN
486                  zcoft = FLOAT( icof(ji,jj) ) / 100.
487                  ahm1(ji,jj) = zcoft * ahm0 + (1.-zcoft) * ahm1(ji,jj)
488               ENDIF
489            END DO
490         END DO
491         ! f-point
492         icof(:,:) = icof(:,:) * tmask(:,:,1)
493         DO jj = 1, jpjm1
494            DO ji = 1, jpim1
495               IF( ABS( gphif(ji,jj) ) < 20. ) THEN
496                  zmsk = tmask(ji,jj+1,1) + tmask(ji+1,jj+1,1) + tmask(ji,jj,1) + tmask(ji,jj+1,1)
497                  IF( zmsk == 0. ) THEN
498                     zcoff = 1.
499                  ELSE
500                     zcoff = FLOAT( icof(ji,jj+1) + icof(ji+1,jj+1) + icof(ji,jj) + icof(ji,jj+1) )   &
501                        / (zmsk * 100.)
502                  ENDIF
503                  ahm2(ji,jj) = zcoff * ahm0 + (1.-zcoff) * ahm2(ji,jj)
504               ENDIF
505            END DO
506         END DO
507      ENDIF
508     
509      ! Lateral boundary conditions on ( ahm1, ahm2 )
510      !                                ==============
511      CALL lbc_lnk( ahm1, 'T', 1. )   ! T-point, unchanged sign
512      CALL lbc_lnk( ahm2, 'F', 1. )   ! F-point, unchanged sign
513
514      ! Control print
515      IF( lwp .AND. ld_print ) THEN
516         WRITE(numout,*)
517         WRITE(numout,*) 'inildf: 2D ahm1 array'
518         CALL prihre(ahm1,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
519         WRITE(numout,*)
520         WRITE(numout,*) 'inildf: 2D ahm2 array'
521         CALL prihre(ahm2,jpi,jpj,1,jpi,1,1,jpj,1,1.e-3,numout)
522      ENDIF
523      !
524      CALL wrk_dealloc( jpi   , jpj   , icof  )
525      !
526   END SUBROUTINE ldf_dyn_c2d_orca_R1
Note: See TracBrowser for help on using the repository browser.