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.
geo2ocean.F90 in trunk/NEMO/OPA_SRC – NEMO

source: trunk/NEMO/OPA_SRC/geo2ocean.F90 @ 672

Last change on this file since 672 was 672, checked in by ctlod, 17 years ago

nemo_v2_bugfix_043 : SM : bugfix on lbc + add new features

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.3 KB
Line 
1MODULE geo2ocean
2   !!======================================================================
3   !!                     ***  MODULE  geo2ocean  ***
4   !! Ocean mesh    :  ???
5   !!=====================================================================
6
7   !!----------------------------------------------------------------------
8   !!   repcmo      :
9   !!   angle       :
10   !!   geo2oce     :
11   !!   repere      :   old routine suppress it ???
12   !!----------------------------------------------------------------------
13   !! * Modules used
14   USE dom_oce         ! mesh and scale factors
15   USE phycst          ! physical constants
16   USE in_out_manager  ! I/O manager
17   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
18
19   IMPLICIT NONE
20
21   !! * Accessibility
22   PRIVATE
23   PUBLIC rot_rep, repcmo, repere, geo2oce   ! only rot_rep should be used
24                                             ! repcmo and repere are keep only for compatibility.
25                                             ! they are only a useless overlay of rot_rep
26
27   !! * Module variables
28   REAL(wp), DIMENSION(jpi,jpj) ::   &
29      gsint, gcost,   &  ! cos/sin between model grid lines and NP direction at T point
30      gsinu, gcosu,   &  ! cos/sin between model grid lines and NP direction at U point
31      gsinv, gcosv,   &  ! cos/sin between model grid lines and NP direction at V point
32      gsinf, gcosf       ! cos/sin between model grid lines and NP direction at F point
33
34   LOGICAL ::   lmust_init = .TRUE.        !: used to initialize the cos/sin variables (se above)
35
36  !! * Substitutions
37#  include "vectopt_loop_substitute.h90"
38   !!---------------------------------------------------------------------------------
39   !!   OPA 9.0 , LOCEAN-IPSL (2005)
40   !! $Header$
41   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
42   !!---------------------------------------------------------------------------------
43
44CONTAINS
45
46   SUBROUTINE repcmo ( pxu1, pyu1, pxv1, pyv1,   &
47                       px2 , py2 , kt )
48      !!----------------------------------------------------------------------
49      !!                  ***  ROUTINE repcmo  ***
50      !!
51      !! ** Purpose :   Change vector componantes from a geographic grid to a
52      !!      stretched coordinates grid.
53      !!
54      !! ** Method  :   Initialization of arrays at the first call.
55      !!
56      !! ** Action  : - px2 : first componante (defined at u point)
57      !!              - py2 : second componante (defined at v point)
58      !!
59      !! History :
60      !!   7.0  !  07-96  (O. Marti)  Original code
61      !!   8.5  !  02-08  (G. Madec)  F90: Free form
62      !!----------------------------------------------------------------------
63      !! * Arguments
64      INTEGER,  INTENT( in ) ::   &
65         kt                ! ocean time-step
66      REAL(wp), INTENT( in ), DIMENSION(jpi,jpj) ::   & 
67         pxu1, pyu1,     & ! geographic vector componantes at u-point
68         pxv1, pyv1        ! geographic vector componantes at v-point
69      REAL(wp), INTENT( out ), DIMENSION(jpi,jpj) ::   & 
70         px2,            & ! i-componante (defined at u-point)
71         py2               ! j-componante (defined at v-point)
72      !!----------------------------------------------------------------------
73     
74      ! Change from geographic to stretched coordinate
75      ! ----------------------------------------------
76     
77      px2(:,:) = rot_rep( pxu1, pyu1, 'U', 'en->i' )
78      py2(:,:) = rot_rep( pxv1, pyv1, 'V', 'en->j' )
79     
80   END SUBROUTINE repcmo
81
82
83   FUNCTION rot_rep ( pxin, pyin, cd_type, cdtodo )
84      !!----------------------------------------------------------------------
85      !!                  ***  ROUTINE rot_rep  ***
86      !!
87      !! ** Purpose :   Rotate the Repere: Change vector componantes between
88      !!                geographic grid <--> stretched coordinates grid.
89      !!
90      !! History :
91      !!   9.2  !  07-04  (S. Masson) 
92      !!                  (O. Marti ) Original code (repere and repcmo)
93      !!----------------------------------------------------------------------
94      !! * Arguments
95      REAL(wp), DIMENSION(jpi,jpj), INTENT( IN ) ::   pxin, pyin   ! vector componantes
96      CHARACTER(len=1),             INTENT( IN ) ::   cd_type      ! define the nature of pt2d array grid-points
97      CHARACTER(len=5),             INTENT( IN ) ::   cdtodo       ! specify the work to do:
98      !!                                                           ! 'en->i' east-north componantes to model i componante
99      !!                                                           ! 'en->j' east-north componantes to model j componante
100      !!                                                           ! 'ij->e' model i-j componantes to east componante
101      !!                                                           ! 'ij->n' model i-j componantes to east componante
102      REAL(wp), DIMENSION(jpi,jpj) ::   rot_rep     
103
104      !!----------------------------------------------------------------------
105
106      ! Initialization of gsin* and gcos* at first call
107      ! -----------------------------------------------
108
109      IF( lmust_init ) THEN
110         IF(lwp) WRITE(numout,*)
111         IF(lwp) WRITE(numout,*) ' rot_rep : geographic <--> stretched'
112         IF(lwp) WRITE(numout,*) ' ~~~~~    coordinate transformation'
113
114         CALL angle       ! initialization of the transformation
115         lmust_init = .FALSE.
116
117      ENDIF
118     
119      SELECT CASE (cdtodo)
120      CASE ('en->i')      ! 'en->i' est-north componantes to model i componante
121         SELECT CASE (cd_type)
122         CASE ('T')   ;   rot_rep(:,:) = pxin(:,:) * gcost(:,:) + pyin(:,:) * gsint(:,:)
123         CASE ('U')   ;   rot_rep(:,:) = pxin(:,:) * gcosu(:,:) + pyin(:,:) * gsinu(:,:)
124         CASE ('V')   ;   rot_rep(:,:) = pxin(:,:) * gcosv(:,:) + pyin(:,:) * gsinv(:,:)
125         CASE ('F')   ;   rot_rep(:,:) = pxin(:,:) * gcosf(:,:) + pyin(:,:) * gsinf(:,:)
126         CASE DEFAULT   ;   CALL ctl_stop( 'Only T, U, V and F grid points are coded' )
127         END SELECT
128      CASE ('en->j')      ! 'en->j' est-north componantes to model j componante
129         SELECT CASE (cd_type)
130         CASE ('T')   ;   rot_rep(:,:) = pyin(:,:) * gcost(:,:) - pxin(:,:) * gsint(:,:)
131         CASE ('U')   ;   rot_rep(:,:) = pyin(:,:) * gcosu(:,:) - pxin(:,:) * gsinu(:,:)
132         CASE ('V')   ;   rot_rep(:,:) = pyin(:,:) * gcosv(:,:) - pxin(:,:) * gsinv(:,:)   
133         CASE ('F')   ;   rot_rep(:,:) = pyin(:,:) * gcosf(:,:) - pxin(:,:) * gsinf(:,:)   
134         CASE DEFAULT   ;   CALL ctl_stop( 'Only T, U, V and F grid points are coded' )
135         END SELECT
136      CASE ('ij->e')      ! 'ij->e' model i-j componantes to est componante
137         SELECT CASE (cd_type)
138         CASE ('T')   ;   rot_rep(:,:) = pxin(:,:) * gcost(:,:) - pyin(:,:) * gsint(:,:)
139         CASE ('U')   ;   rot_rep(:,:) = pxin(:,:) * gcosu(:,:) - pyin(:,:) * gsinu(:,:)
140         CASE ('V')   ;   rot_rep(:,:) = pxin(:,:) * gcosv(:,:) - pyin(:,:) * gsinv(:,:)
141         CASE ('F')   ;   rot_rep(:,:) = pxin(:,:) * gcosf(:,:) - pyin(:,:) * gsinf(:,:)
142         CASE DEFAULT   ;   CALL ctl_stop( 'Only T, U, V and F grid points are coded' )
143         END SELECT
144      CASE ('ij->n')      ! 'ij->n' model i-j componantes to est componante
145         SELECT CASE (cd_type)
146         CASE ('T')   ;   rot_rep(:,:) = pyin(:,:) * gcost(:,:) + pxin(:,:) * gsint(:,:)
147         CASE ('U')   ;   rot_rep(:,:) = pyin(:,:) * gcosu(:,:) + pxin(:,:) * gsinu(:,:)
148         CASE ('V')   ;   rot_rep(:,:) = pyin(:,:) * gcosv(:,:) + pxin(:,:) * gsinv(:,:)
149         CASE ('F')   ;   rot_rep(:,:) = pyin(:,:) * gcosf(:,:) + pxin(:,:) * gsinf(:,:)
150         CASE DEFAULT   ;   CALL ctl_stop( 'Only T, U, V and F grid points are coded' )
151         END SELECT
152      CASE DEFAULT   ;   CALL ctl_stop( 'rot_rep: Syntax Error in the definition of cdtodo' )
153      END SELECT
154     
155   END FUNCTION rot_rep
156
157
158   SUBROUTINE angle
159      !!----------------------------------------------------------------------
160      !!                  ***  ROUTINE angle  ***
161      !!
162      !! ** Purpose :   Compute angles between model grid lines and the North direction
163      !!
164      !! ** Method  :
165      !!
166      !! ** Action  :   Compute (gsint, gcost, gsinu, gcosu, gsinv, gcosv, gsinf, gcosf) arrays:
167      !!      sinus and cosinus of the angle between the north-south axe and the
168      !!      j-direction at t, u, v and f-points
169      !!
170      !! History :
171      !!   7.0  !  96-07  (O. Marti )  Original code
172      !!   8.0  !  98-06  (G. Madec )
173      !!   8.5  !  98-06  (G. Madec )  Free form, F90 + opt.
174      !!   9.2  !  07-04  (S. Masson)  Add T, F points and bugfix in cos lateral boundary
175      !!----------------------------------------------------------------------
176      !! * local declarations
177      INTEGER ::   ji, jj      ! dummy loop indices
178
179      REAL(wp) ::   &
180         zlam, zphi,            &  ! temporary scalars
181         zlan, zphh,            &  !    "         "
182         zxnpt, zynpt, znnpt,   &  ! x,y components and norm of the vector: T point to North Pole
183         zxnpu, zynpu, znnpu,   &  ! x,y components and norm of the vector: U point to North Pole
184         zxnpv, zynpv, znnpv,   &  ! x,y components and norm of the vector: V point to North Pole
185         zxnpf, zynpf, znnpf,   &  ! x,y components and norm of the vector: F point to North Pole
186         zxvvt, zyvvt, znvvt,   &  ! x,y components and norm of the vector: between V points below and above a T point
187         zxffu, zyffu, znffu,   &  ! x,y components and norm of the vector: between F points below and above a U point
188         zxffv, zyffv, znffv,   &  ! x,y components and norm of the vector: between F points left  and right a V point
189         zxuuf, zyuuf, znuuf       ! x,y components and norm of the vector: between U points below and above a F point
190      !!----------------------------------------------------------------------
191
192      ! ============================= !
193      ! Compute the cosinus and sinus !
194      ! ============================= !
195      ! (computation done on the north stereographic polar plane)
196
197      DO jj = 2, jpjm1
198!CDIR NOVERRCHK
199         DO ji = fs_2, jpi   ! vector opt.
200
201            ! north pole direction & modulous (at t-point)
202            zlam = glamt(ji,jj)
203            zphi = gphit(ji,jj)
204            zxnpt = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
205            zynpt = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
206            znnpt = zxnpt*zxnpt + zynpt*zynpt
207
208            ! north pole direction & modulous (at u-point)
209            zlam = glamu(ji,jj)
210            zphi = gphiu(ji,jj)
211            zxnpu = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
212            zynpu = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
213            znnpu = zxnpu*zxnpu + zynpu*zynpu
214
215            ! north pole direction & modulous (at v-point)
216            zlam = glamv(ji,jj)
217            zphi = gphiv(ji,jj)
218            zxnpv = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
219            zynpv = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
220            znnpv = zxnpv*zxnpv + zynpv*zynpv
221
222            ! north pole direction & modulous (at f-point)
223            zlam = glamf(ji,jj)
224            zphi = gphif(ji,jj)
225            zxnpf = 0. - 2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
226            zynpf = 0. - 2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )
227            znnpf = zxnpf*zxnpf + zynpf*zynpf
228
229            ! j-direction: v-point segment direction (around t-point)
230            zlam = glamv(ji,jj  )
231            zphi = gphiv(ji,jj  )
232            zlan = glamv(ji,jj-1)
233            zphh = gphiv(ji,jj-1)
234            zxvvt =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
235               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
236            zyvvt =  2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
237               &  -  2. * SIN( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
238            znvvt = SQRT( znnpt * ( zxvvt*zxvvt + zyvvt*zyvvt )  )
239            znvvt = MAX( znvvt, 1.e-14 )
240
241            ! j-direction: f-point segment direction (around u-point)
242            zlam = glamf(ji,jj  )
243            zphi = gphif(ji,jj  )
244            zlan = glamf(ji,jj-1)
245            zphh = gphif(ji,jj-1)
246            zxffu =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
247               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
248            zyffu =  2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
249               &  -  2. * SIN( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
250            znffu = SQRT( znnpu * ( zxffu*zxffu + zyffu*zyffu )  )
251            znffu = MAX( znffu, 1.e-14 )
252
253            ! i-direction: f-point segment direction (around v-point)
254            zlam = glamf(ji  ,jj)
255            zphi = gphif(ji  ,jj)
256            zlan = glamf(ji-1,jj)
257            zphh = gphif(ji-1,jj)
258            zxffv =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
259               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
260            zyffv =  2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
261               &  -  2. * SIN( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
262            znffv = SQRT( znnpv * ( zxffv*zxffv + zyffv*zyffv )  )
263            znffv = MAX( znffv, 1.e-14 )
264
265            ! j-direction: u-point segment direction (around f-point)
266            zlam = glamu(ji,jj+1)
267            zphi = gphiu(ji,jj+1)
268            zlan = glamu(ji,jj  )
269            zphh = gphiu(ji,jj  )
270            zxuuf =  2. * COS( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
271               &  -  2. * COS( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
272            zyuuf =  2. * SIN( rad*zlam ) * TAN( rpi/4. - rad*zphi/2. )   &
273               &  -  2. * SIN( rad*zlan ) * TAN( rpi/4. - rad*zphh/2. )
274            znuuf = SQRT( znnpf * ( zxuuf*zxuuf + zyuuf*zyuuf )  )
275            znuuf = MAX( znuuf, 1.e-14 )
276
277            ! cosinus and sinus using scalar and vectorial products
278            gsint(ji,jj) = ( zxnpt*zyvvt - zynpt*zxvvt ) / znvvt
279            gcost(ji,jj) = ( zxnpt*zxvvt + zynpt*zyvvt ) / znvvt
280
281            gsinu(ji,jj) = ( zxnpu*zyffu - zynpu*zxffu ) / znffu
282            gcosu(ji,jj) = ( zxnpu*zxffu + zynpu*zyffu ) / znffu
283
284            gsinf(ji,jj) = ( zxnpf*zyuuf - zynpf*zxuuf ) / znuuf
285            gcosf(ji,jj) = ( zxnpf*zxuuf + zynpf*zyuuf ) / znuuf
286
287            ! (caution, rotation of 90 degres)
288            gsinv(ji,jj) = ( zxnpv*zxffv + zynpv*zyffv ) / znffv
289            gcosv(ji,jj) =-( zxnpv*zyffv - zynpv*zxffv ) / znffv
290
291         END DO
292      END DO
293
294      ! =============== !
295      ! Geographic mesh !
296      ! =============== !
297
298      DO jj = 2, jpjm1
299         DO ji = fs_2, jpi   ! vector opt.
300            IF( MOD( ABS( glamv(ji,jj) - glamv(ji,jj-1) ), 360. ) < 1.e-8 ) THEN
301               gsint(ji,jj) = 0.
302               gcost(ji,jj) = 1.
303            ENDIF
304            IF( MOD( ABS( glamf(ji,jj) - glamf(ji,jj-1) ), 360. ) < 1.e-8 ) THEN
305               gsinu(ji,jj) = 0.
306               gcosu(ji,jj) = 1.
307            ENDIF
308            IF(      ABS( gphif(ji,jj) - gphif(ji-1,jj) )         < 1.e-8 ) THEN
309               gsinv(ji,jj) = 0.
310               gcosv(ji,jj) = 1.
311            ENDIF
312            IF( MOD( ABS( glamu(ji,jj) - glamu(ji,jj+1) ), 360. ) < 1.e-8 ) THEN
313               gsinf(ji,jj) = 0.
314               gcosf(ji,jj) = 1.
315            ENDIF
316         END DO
317      END DO
318
319      ! =========================== !
320      ! Lateral boundary conditions !
321      ! =========================== !
322
323      ! lateral boundary cond.: T-, U-, V-, F-pts, sgn
324      CALL lbc_lnk ( gcost, 'T', 1. )   ;   CALL lbc_lnk( gsint, 'T', -1. )
325      CALL lbc_lnk ( gcosu, 'U', 1. )   ;   CALL lbc_lnk( gsinu, 'U', -1. )
326      CALL lbc_lnk ( gcosv, 'V', 1. )   ;   CALL lbc_lnk( gsinv, 'V', -1. )
327      CALL lbc_lnk ( gcosf, 'F', 1. )   ;   CALL lbc_lnk( gsinf, 'F', -1. )
328
329   END SUBROUTINE angle
330
331
332   SUBROUTINE geo2oce ( pxx , pyy , pzz, cgrid,     &
333                        plon, plat, pte, ptn  , ptv )
334      !!----------------------------------------------------------------------
335      !!                    ***  ROUTINE geo2oce  ***
336      !!     
337      !! ** Purpose :
338      !!
339      !! ** Method  :   Change wind stress from geocentric to east/north
340      !!
341      !! History :
342      !!        !         (O. Marti)  Original code
343      !!        !  91-03  (G. Madec)
344      !!        !  92-07  (M. Imbard)
345      !!        !  99-11  (M. Imbard) NetCDF format with IOIPSL
346      !!        !  00-08  (D. Ludicone) Reduced section at Bab el Mandeb
347      !!   8.5  !  02-06  (G. Madec)  F90: Free form
348      !!----------------------------------------------------------------------
349      !! * Local declarations
350      REAL(wp), INTENT( in ), DIMENSION(jpi,jpj) ::   &
351         pxx, pyy, pzz
352      CHARACTER (len=1), INTENT( in) ::   &
353         cgrid
354      REAL(wp), INTENT( in ), DIMENSION(jpi,jpj) ::   &
355         plon, plat
356      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::    &
357         pte, ptn, ptv
358      REAL(wp), PARAMETER :: rpi = 3.141592653E0
359      REAL(wp), PARAMETER :: rad = rpi / 180.e0
360
361      !! * Local variables
362      INTEGER ::   ig     !
363
364      !! * Local save
365      REAL(wp), SAVE, DIMENSION(jpi,jpj,4) ::   &
366         zsinlon, zcoslon,   &
367         zsinlat, zcoslat
368      LOGICAL, SAVE, DIMENSION (4) ::   &
369         linit = .FALSE.
370      !!----------------------------------------------------------------------
371
372      SELECT CASE( cgrid)
373
374         CASE ( 't' ) ;; ig = 1
375         CASE ( 'u' ) ;; ig = 2
376         CASE ( 'v' ) ;; ig = 3
377         CASE ( 'f' ) ;; ig = 4
378
379         CASE default
380            WRITE(ctmp1,*) 'geo2oce : bad grid argument : ', cgrid
381            CALL ctl_stop( ctmp1 )
382       END SELECT
383     
384      IF( .NOT. linit(ig) ) THEN
385         zsinlon (:,:,ig) = SIN (rad * plon)
386         zcoslon (:,:,ig) = COS (rad * plon)
387         zsinlat (:,:,ig) = SIN (rad * plat)
388         zcoslat (:,:,ig) = COS (rad * plat)
389         linit (ig) = .TRUE.
390      ENDIF
391     
392      pte = - zsinlon (:,:,ig) * pxx + zcoslon (:,:,ig) * pyy
393      ptn = - zcoslon (:,:,ig) * zsinlat (:,:,ig) * pxx    &
394            - zsinlon (:,:,ig) * zsinlat (:,:,ig) * pyy    &
395            + zcoslat (:,:,ig) * pzz
396      ptv =   zcoslon (:,:,ig) * zcoslat (:,:,ig) * pxx    &
397            + zsinlon (:,:,ig) * zcoslat (:,:,ig) * pyy    &
398            + zsinlat (:,:,ig) * pzz
399
400   END SUBROUTINE geo2oce
401
402
403   SUBROUTINE repere ( px1, py1, px2, py2, kchoix, cd_type )
404      !!----------------------------------------------------------------------
405      !!                 ***  ROUTINE repere  ***
406      !!       
407      !! ** Purpose :   Change vector componantes between a geopgraphic grid
408      !!      and a stretched coordinates grid.
409      !!
410      !! ** Method  :   
411      !!
412      !! ** Action  :
413      !!
414      !! History :
415      !!        !  89-03  (O. Marti)  original code
416      !!        !  92-02  (M. Imbard)
417      !!        !  93-03  (M. Guyon)  symetrical conditions
418      !!        !  98-05  (B. Blanke)
419      !!   8.5  !  02-08  (G. Madec)  F90: Free form
420      !!----------------------------------------------------------------------
421      !! * Arguments
422      REAL(wp), INTENT( IN   ), DIMENSION(jpi,jpj) ::   &
423         px1, py1          ! two horizontal components to be rotated
424      REAL(wp), INTENT( OUT  ), DIMENSION(jpi,jpj) ::   &
425         px2, py2          ! the two horizontal components in the model repere
426      INTEGER, INTENT( IN ) ::   &
427         kchoix   ! type of transformation
428                  ! = 1 change from geographic to model grid.
429                  ! =-1 change from model to geographic grid
430      CHARACTER(len=1), INTENT( IN ), OPTIONAL ::   cd_type      ! define the nature of pt2d array grid-points
431      !
432      CHARACTER(len=1) ::   cl_type      ! define the nature of pt2d array grid-points (T point by default)
433      !!----------------------------------------------------------------------
434
435      cl_type = 'T'
436      IF( PRESENT(cd_type) )   cl_type = cd_type
437         !
438      SELECT CASE (kchoix)
439      CASE ( 1)      ! change from geographic to model grid.
440         px2(:,:) = rot_rep( px1, py1, cl_type, 'en->i' )
441         py2(:,:) = rot_rep( px1, py1, cl_type, 'en->j' )
442      CASE (-1)      ! change from model to geographic grid
443         px2(:,:) = rot_rep( px1, py1, cl_type, 'ij->e' )
444         py2(:,:) = rot_rep( px1, py1, cl_type, 'ij->n' )
445      CASE DEFAULT   ;   CALL ctl_stop( 'repere: Syntax Error in the definition of kchoix (1 OR -1' )
446      END SELECT
447     
448   END SUBROUTINE repere
449
450  !!======================================================================
451END MODULE geo2ocean
Note: See TracBrowser for help on using the repository browser.