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

source: trunk/NEMO/OPA_SRC/istate.F90 @ 85

Last change on this file since 85 was 79, checked in by opalod, 20 years ago

CT : UPDATE053 : Use logical key "lk_isl" instead of "l_isl"

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.9 KB
Line 
1MODULE istate
2   !!======================================================================
3   !!                     ***  MODULE  istate  ***
4   !! Ocean state   :  initial state setting
5   !!=====================================================================
6
7   !!----------------------------------------------------------------------
8   !!   istate_init   : initial state setting
9   !!   istate_tem    : analytical profile for initial Temperature
10   !!   istate_sal    : analytical profile for initial Salinity
11   !!   istate_eel    : initial state setting of EEL R5 configuration
12   !!   istate_uvg    : initial velocity in geostropic balance
13   !!----------------------------------------------------------------------
14   !! * Modules used
15   USE oce             ! ocean dynamics and active tracers
16   USE dom_oce         ! ocean space and time domain
17   USE daymod          !
18   USE ldftra_oce      ! ocean active tracers: lateral physics
19   USE zdf_oce         ! ocean vertical physics
20   USE in_out_manager  ! I/O manager
21   USE phycst          ! physical constants
22   USE wzvmod          ! verctical velocity               (wzv     routine)
23   USE dtatem          ! temperature data                 (dta_tem routine)
24   USE dtasal          ! salinity data                    (dta_sal routine)
25   USE restart         ! ocean restart                   (rst_read routine)
26   USE solisl          ! ???
27
28   IMPLICIT NONE
29   PRIVATE
30
31   !! * Routine accessibility
32   PUBLIC istate_init   ! routine called by step.F90
33
34   !! * Substitutions
35#  include "domzgr_substitute.h90"
36#  include "vectopt_loop_substitute.h90"
37   !!----------------------------------------------------------------------
38   !!   OPA 9.0 , LODYC-IPSL  (2003)
39   !!----------------------------------------------------------------------
40
41CONTAINS
42
43   SUBROUTINE istate_init
44      !!----------------------------------------------------------------------
45      !!                   ***  ROUTINE istate_init  ***
46      !!
47      !! ** Purpose :   Initialization of the dynamics and tracers.
48      !!
49      !! ** Method  :
50      !!
51      !! History :
52      !!   4.0  !  91-03  ()  Original code
53      !!        !  91-11  (G. Madec)
54      !!   9.0  !  03-09  (G. Madec)  F90: Free form, modules, orthogonality
55      !!----------------------------------------------------------------------
56      !! * Local declarations
57      !!----------------------------------------------------------------------
58
59
60      ! Initialization to zero
61      ! ----------------------
62
63      !     before fields       !       now fields        !      after fields       !
64      ;   ub   (:,:,:) = 0.e0   ;   un   (:,:,:) = 0.e0   ;   ua   (:,:,:) = 0.e0
65      ;   vb   (:,:,:) = 0.e0   ;   vn   (:,:,:) = 0.e0   ;   va   (:,:,:) = 0.e0
66      ;                         ;   wn   (:,:,:) = 0.e0   ;
67      ;   rotb (:,:,:) = 0.e0   ;   rotn (:,:,:) = 0.e0   ;
68      ;   hdivb(:,:,:) = 0.e0   ;   hdivn(:,:,:) = 0.e0   ;
69
70      ;   tb   (:,:,:) = 0.e0   ;   tn   (:,:,:) = 0.e0   ;   ta   (:,:,:) = 0.e0
71      ;   sb   (:,:,:) = 0.e0   ;   sn   (:,:,:) = 0.e0   ;   sa   (:,:,:) = 0.e0
72
73      rhd  (:,:,:) = 0.e0
74      rhop (:,:,:) = 0.e0
75      rn2  (:,:,:) = 0.e0 
76
77#if defined key_dynspg_fsc
78      ! free surface formulation
79      sshb(:,:) = 0.e0      ! before sea-surface height
80      sshn(:,:) = 0.e0      ! now    sea-surface height
81#endif
82#if defined key_dynspg_rl
83      ! rigid-lid formulation
84      bsfb(:,:) = 0.e0      ! before barotropic stream-function
85      bsfn(:,:) = 0.e0      ! now    barotropic stream-function
86      bsfd(:,:) = 0.e0      ! barotropic stream-function trend
87#endif
88
89
90      IF( ln_rstart ) THEN                    ! Restart from a file
91         !                                    ! -------------------
92         neuler = 1                              ! Set time-step indicator at nit000 (leap-frog)
93         CALL rst_read                           ! Read the restart file
94      ELSE
95         !                                    ! Start from rest
96         !                                    ! ---------------
97         neuler = 0                              ! Set time-step indicator at nit000 (euler forward)
98         adatrj = 0._wp
99         IF( cp_cfg == 'eel' ) THEN
100            CALL istate_eel                      ! EEL configuration : start from pre-defined
101            !                                    !                     velocity and thermohaline fields
102         ELSE
103         !                                       ! Initial temperature and salinity fields
104#if defined key_dtatem
105            CALL dta_tem( nit000 )                  ! read 3D temperature data
106            tb(:,:,:) = t_dta(:,:,:)                ! use temperature data read
107            tn(:,:,:) = t_dta(:,:,:)
108#else
109            IF(lwp) WRITE(numout,*)                 ! analytical temperature profile
110            IF(lwp) WRITE(numout,*)' Temperature initialization using an analytic profile'
111            CALL istate_tem
112#endif
113#if defined key_dtasal
114            CALL dta_sal( nit000 )                  ! read 3D salinity data
115            sb(:,:,:) = s_dta(:,:,:)                ! use salinity data read
116            sn(:,:,:) = s_dta(:,:,:)
117#else
118            ! No salinity data
119            IF(lwp)WRITE(numout,*)                  ! analytical salinity profile
120            IF(lwp)WRITE(numout,*)' Salinity initialisation using a constant value'
121            CALL istate_sal
122#endif
123         ENDIF
124
125      ENDIF
126      !                                       ! Vertical velocity
127      !                                       ! -----------------
128      CALL wzv( nit000 )                         ! from horizontal divergence
129
130   END SUBROUTINE istate_init
131
132
133   SUBROUTINE istate_tem
134      !!---------------------------------------------------------------------
135      !!                  ***  ROUTINE istate_tem  ***
136      !!   
137      !! ** Purpose :   Intialization of the temperature field with an
138      !!      analytical profile or a file (i.e. in EEL configuration)
139      !!
140      !! ** Method  :   Use Philander analytic profile of temperature
141      !!
142      !! References :  Philander ???
143      !!
144      !! History :
145      !!   4.0  !  89-12  (P. Andrich)  Original code
146      !!   6.0  !  96-01  (G. Madec)  terrain following coordinates
147      !!   9.0  !  02-09  (G. Madec)  F90: Free form
148      !!----------------------------------------------------------------------
149      !! * Local declarations
150      INTEGER :: ji, jj, jk
151      !!----------------------------------------------------------------------
152
153      IF(lwp) WRITE(numout,*)
154      IF(lwp) WRITE(numout,*) 'istate_tem : initial temperature profile'
155      IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
156
157      DO jk = 1, jpk
158         DO jj = 1, jpj
159            DO ji = 1, jpi
160               tn(ji,jj,jk) = (  ( ( 7.5 - 0.*ABS(gphit(ji,jj))/30. )   &
161                  &               *( 1.-TANH((fsdept(ji,jj,jk)-80.)/30.) )   &
162                  &            + 10.*(5000.-fsdept(ji,jj,jk))/5000.)  ) * tmask(ji,jj,jk)
163               tb(ji,jj,jk) = tn(ji,jj,jk)
164          END DO
165        END DO
166      END DO
167
168      IF(lwp) CALL prizre( tn    , jpi   , jpj   , jpk   , jpj/2 ,   &
169         &                 1     , jpi   , 5     , 1     , jpk   ,   &
170         &                 1     , 1.    , numout                  )
171
172   END SUBROUTINE istate_tem
173
174
175   SUBROUTINE istate_sal
176      !!---------------------------------------------------------------------
177      !!                  ***  ROUTINE istate_sal  ***
178      !!
179      !! ** Purpose :   Intialize the salinity field with an analytic profile
180      !!
181      !! ** Method  :   Use to a constant value 35.5
182      !!             
183      !! ** Action  :   Initialize sn and sb
184      !!
185      !! History :
186      !!   4.0  !  89-12  (P. Andrich)  Original code
187      !!   8.5  !  02-09  (G. Madec)  F90: Free form
188      !!----------------------------------------------------------------------
189      !! * Local declarations
190      REAL(wp) ::   zsal = 35.50_wp
191      !!----------------------------------------------------------------------
192
193      IF(lwp) WRITE(numout,*)
194      IF(lwp) WRITE(numout,*) 'istate_sal : initial salinity : ', zsal
195      IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
196
197      sn(:,:,:) = zsal * tmask(:,:,:)
198      sb(:,:,:) = sn(:,:,:)
199     
200   END SUBROUTINE istate_sal
201
202
203   SUBROUTINE istate_eel
204      !!----------------------------------------------------------------------
205      !!                   ***  ROUTINE istate_eel  ***
206      !!
207      !! ** Purpose :   Initialization of the dynamics and tracers for EEL R5
208      !!      configuration (channel with or without a topographic bump)
209      !!
210      !! ** Method  : - set temprature field
211      !!              - set salinity field
212      !!              - set velocity field including horizontal divergence
213      !!                and relative vorticity fields
214      !!
215      !! History :
216      !!   8.0  !  01-09  (M. Levy, M. Ben Jelloul)  read file for EEL 2 & 6
217      !!   9.0  !  03-09  (G. Madec, C. Talandier)  EEL 5
218      !!----------------------------------------------------------------------
219      !! * Modules used
220      USE eosbn2     ! eq. of state, Brunt Vaisala frequency (eos     routine)
221      USE divcur     ! hor. divergence & rel. vorticity      (div_cur routine)
222#if ! defined key_fdir
223      USE ioipsl
224#endif
225 
226      !! * Local declarations
227      LOGICAL :: llog
228      CHARACTER (len=21) ::   &
229         clname = 'eel.initemp',   &  ! filename (for EEL R2 or R6)
230         clvar  = 'initemp'           ! variable name
231      INTEGER  ::   inum              ! temporary logical unit
232      INTEGER  ::   ji, jj, jk        ! dummy loop indices
233      INTEGER  ::   ilev, itime       ! temporary integers
234      REAL(wp) ::   &
235         zh1, zh2, zslope, zcst       ! temporary scalars
236      REAL(wp) ::   &
237         zt1  = 12.e0,             &  ! surface temperature value (EEL R5)
238         zt2  =  2.e0,             &  ! bottom  temperature value (EEL R5)
239         zsal = 35.5                  ! constant salinity (EEL R2, R5 and R6)
240      REAL(wp) ::   &
241         zdt,  zdate0                 ! temporary scalars
242      REAL(wp), DIMENSION(jpk) ::  &
243         zdept                        ! temporary workspace
244      REAL(wp), DIMENSION(jpiglo,jpjglo) ::   &
245         zlamt, zphit                 ! temporary workspace
246# if defined key_dynspg_fsc
247      REAL(wp), DIMENSION(jpiglo,jpjglo) ::   &
248         zssh                         ! initial ssh over the global domain
249# endif
250      !!----------------------------------------------------------------------
251
252      SELECT CASE ( jp_cfg ) 
253         !                                              ! ====================
254         CASE ( 5 )                                     ! EEL R5 configuration
255            !                                           ! ====================
256
257            ! set temperature field with a linear profile
258            ! -------------------------------------------
259            IF(lwp) WRITE(numout,*)
260            IF(lwp) WRITE(numout,*) 'istate_eel : EEL R5: linear temperature profile'
261            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
262
263            zh1 = gdept(  1  )
264            zh2 = gdept(jpkm1)
265
266            zslope = ( zt1 - zt2 ) / ( zh1 - zh2 )
267            zcst   = ( zt1 * ( zh1 - zh2) - ( zt1 - zt2 ) * zh1 ) / ( zh1 - zh2 )
268
269            DO jk = 1, jpk
270               tn(:,:,jk) = ( zslope * fsdept(:,:,jk) + zcst  ) * tmask(:,:,jk)
271               tb(:,:,jk) = tn(:,:,jk)
272            END DO
273
274            IF(lwp) CALL prizre( tn    , jpi   , jpj   , jpk   , jpj/2 ,   &
275               &                 1     , jpi   , 5     , 1     , jpk   ,   &
276               &                 1     , 1.    , numout                  )
277
278            ! set salinity field to a constant value
279            ! --------------------------------------
280            IF(lwp) WRITE(numout,*)
281            IF(lwp) WRITE(numout,*) 'istate_eel : EEL R5: constant salinity field, S = ', zsal
282            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
283
284            sn(:,:,:) = zsal * tmask(:,:,:)
285            sb(:,:,:) = sn(:,:,:)
286     
287
288# if defined key_dynspg_fsc
289            ! set the dynamics: U,V, hdiv, rot (and ssh if necessary)
290            ! ----------------
291            ! Start EEL5 configuration with barotropic geostrophic velocities
292            ! according the sshb and sshn SSH imposed.
293            ub(:,:,:) = 0.1 * umask(:,:,:)
294            un(:,:,:) = ub(:,:,:)
295
296            DO jj = 1, jpjglo
297               zssh(:,jj) = ( .22 - ( FLOAT(jj-3) * (0.44) ) / 99. )
298            END DO
299            DO jj = 1, nlcj
300               DO ji = 1, nlci
301                  sshb(ji,jj) = zssh( mig(ji) , mjg(jj) ) * tmask(ji,jj,1)
302               END DO
303            END DO
304            sshb(nlci+1:jpi,      :   ) = 0.e0      ! set to zero extra mpp columns
305            sshb(      :   ,nlcj+1:jpj) = 0.e0      ! set to zero extra mpp rows
306
307            sshn(:,:) = sshb(:,:)                   ! set now ssh to the before value
308
309            ! horizontal divergence and relative vorticity (curl)
310            CALL div_cur( nit000 )
311
312            ! N.B. the vertical velocity will be computed from the horizontal divergence field
313            ! in istate by a call to wzv routine
314# endif
315
316
317            !                                     ! ==========================
318         CASE ( 2 , 6 )                           ! EEL R2 or R6 configuration
319            !                                     ! ==========================
320 
321            ! set temperature field with a NetCDF file
322            ! ----------------------------------------
323            IF(lwp) WRITE(numout,*)
324            IF(lwp) WRITE(numout,*) 'istate_eel : EEL R2 or R6: read initial temperature in a NetCDF file'
325            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
326
327            itime  = 0
328            clname = 'eel.initemp'
329            llog   = .FALSE.
330            ilev   = jpk
331            zlamt(:,:) = 0.e0
332            zphit(:,:) = 0.e0
333            CALL restini( clname, jpidta, jpjdta, zlamt , zphit ,   &
334               &          ilev  , zdept , clname, itime , zdate0,   &
335               &          zdt   , inum                            )
336            CALL restget( inum  , 'initemp', jpi, jpj, jpk,   &
337               &          0     , llog     , tb             )     ! read before temprature (tb)
338            CALL restclo( inum )
339 
340            tn(:,:,:) = tb(:,:,:)                                 ! set nox temperature to tb
341
342            IF(lwp) WRITE(numout,*) '               file name : ', clname
343            IF(lwp) CALL prizre( tn    , jpi   , jpj   , jpk   , jpj/2 ,   &
344               &                 1     , jpi   , 5     , 1     , jpk   ,   &
345               &                 1     , 1.    , numout                  )
346
347
348            ! set salinity field to a constant value
349            ! --------------------------------------
350            IF(lwp) WRITE(numout,*)
351            IF(lwp) WRITE(numout,*) 'istate_eel : EEL R5: constant salinity field, S = ', zsal
352            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
353 
354            sn(:,:,:) = zsal * tmask(:,:,:)
355            sb(:,:,:) = sn(:,:,:)
356
357
358            IF( lk_isl ) THEN
359               ! Horizontal velocity : start from geostrophy (EEL config)
360               CALL eos( tn, sn, rhd )     ! now in situ density
361               CALL istate_uvg             ! compute geostrophic velocity
362
363               ! N.B. the vertical velocity will be computed from the horizontal divergence field
364               ! in istate by a call to wzv routine
365            ENDIF
366            !                                    ! ===========================
367         CASE DEFAULT                            ! NONE existing configuration
368            !                                    ! ===========================
369            IF(lwp) WRITE(numout,cform_err) 
370            IF(lwp) WRITE(numout,*) 'EEL with a ', jp_cfg,' km resolution is not coded'
371            nstop = nstop +1
372      END SELECT
373
374   END SUBROUTINE istate_eel
375
376
377   SUBROUTINE istate_uvg
378      !!----------------------------------------------------------------------
379      !!                  ***  ROUTINE istate_uvg  ***
380      !!
381      !! ** Purpose :   Compute the geostrophic velocities from (tn,sn) fields
382      !!
383      !! ** Method  :   Using the hydrostatic hypothesis the now hydrostatic
384      !!      pressure is computed by integrating the in-situ density from the
385      !!      surface to the bottom.
386      !!                 p=integral [ rau*g dz ]
387      !!
388      !! History :
389      !!   8.1  !  01-09  (M. Levy, M. Ben Jelloul)  Original code
390      !!   8.5  !  02-09  (G. Madec)  F90: Free form
391      !!----------------------------------------------------------------------
392      !! * Modules used
393      USE eosbn2          ! eq. of state, Brunt Vaisala frequency (eos     routine)
394      USE dynspg_fsc      ! surface pressure gradient         (dyn_spg_fsc routine)
395      USE dynspg_fsc_atsk ! surface pressure gradient    (dyn_spg_fsc_atsk routine)
396      USE dynspg_rl       ! surface pressure gradient          (dyn_spg_rl routine)
397      USE divcur          ! hor. divergence & rel. vorticity      (div_cur routine)
398      USE lbclnk          ! ocean lateral boundary condition (or mpp link)
399
400      !! * Local declarations
401      INTEGER ::   ji, jj, jk        ! dummy loop indices
402      INTEGER ::   indic             ! ???
403      REAL(wp) ::   &
404         zmsv, zphv, zmsu, zphu,  &  ! temporary scalars
405         zalfg
406      REAL(wp), DIMENSION (jpi,jpj,jpk) ::   &
407         zprn                        ! workspace
408      !!----------------------------------------------------------------------
409
410      IF(lwp) WRITE(numout,*) 
411      IF(lwp) WRITE(numout,*) 'istate_uvg : Start from Geostrophy'
412      IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
413
414      ! Compute the now hydrostatic pressure
415      ! ------------------------------------
416
417      zalfg = 0.5 * grav * rau0
418      ! Surface value
419      zprn(:,:,1) = zalfg * fse3w(:,:,1) * ( 1 + rhd(:,:,1) )
420
421      ! Vertical integration from the surface
422      DO jk = 2, jpkm1
423         zprn(:,:,jk) = zprn(:,:,jk-1)   &
424                      + zalfg * fse3w(:,:,jk) * ( 2. + rhd(:,:,jk) + rhd(:,:,jk-1) )
425      END DO 
426
427      ! Compute geostrophic balance
428      ! ---------------------------
429
430      DO jk = 1, jpkm1
431         DO jj = 2, jpjm1
432            DO ji = fs_2, fs_jpim1   ! vertor opt.
433               zmsv = 1. / MAX(  umask(ji-1,jj+1,jk) + umask(ji  ,jj+1,jk)   &
434                               + umask(ji-1,jj  ,jk) + umask(ji  ,jj  ,jk) , 1.  )
435               zphv = ( zprn(ji  ,jj+1,jk) - zprn(ji-1,jj+1,jk) ) * umask(ji-1,jj+1,jk) / e1u(ji-1,jj+1)   &
436                    + ( zprn(ji+1,jj+1,jk) - zprn(ji  ,jj+1,jk) ) * umask(ji  ,jj+1,jk) / e1u(ji  ,jj+1)   &
437                    + ( zprn(ji  ,jj  ,jk) - zprn(ji-1,jj  ,jk) ) * umask(ji-1,jj  ,jk) / e1u(ji-1,jj  )   &
438                    + ( zprn(ji+1,jj  ,jk) - zprn(ji  ,jj  ,jk) ) * umask(ji  ,jj  ,jk) / e1u(ji  ,jj  )
439               zphv = 1. / rau0 * zphv * zmsv * vmask(ji,jj,jk)
440
441               zmsu = 1. / MAX(  vmask(ji+1,jj  ,jk) + vmask(ji  ,jj  ,jk)   &
442                               + vmask(ji+1,jj-1,jk) + vmask(ji  ,jj-1,jk) , 1.  )
443               zphu = ( zprn(ji+1,jj+1,jk) - zprn(ji+1,jj  ,jk) ) * vmask(ji+1,jj  ,jk) / e2v(ji+1,jj  )   &
444                    + ( zprn(ji  ,jj+1,jk) - zprn(ji  ,jj  ,jk) ) * vmask(ji  ,jj  ,jk) / e2v(ji  ,jj  )   &
445                    + ( zprn(ji+1,jj  ,jk) - zprn(ji+1,jj-1,jk) ) * vmask(ji+1,jj-1,jk) / e2v(ji+1,jj-1)   &
446                    + ( zprn(ji  ,jj  ,jk) - zprn(ji  ,jj-1,jk) ) * vmask(ji  ,jj-1,jk) / e2v(ji  ,jj-1)
447               zphu = 1. / rau0 * zphu * zmsu * umask(ji,jj,jk)
448
449               ! Compute the geostrophic velocities
450               un(ji,jj,jk) = -2. * zphu / ( ff(ji,jj) + ff(ji  ,jj-1) )
451               vn(ji,jj,jk) =  2. * zphv / ( ff(ji,jj) + ff(ji-1,jj  ) )
452            END DO
453         END DO
454      END DO
455
456      IF(lwp) WRITE(numout,*) '         we force to zero bottom velocity'
457
458      ! Susbtract the bottom velocity (level jpk-1 for flat bottom case)
459      ! to have a zero bottom velocity
460
461      DO jk = 1, jpkm1
462         un(:,:,jk) = ( un(:,:,jk) - un(:,:,jpkm1) ) * umask(:,:,jk)
463         vn(:,:,jk) = ( vn(:,:,jk) - vn(:,:,jpkm1) ) * vmask(:,:,jk)
464      END DO
465
466      CALL lbc_lnk( un, 'U', -1. )
467      CALL lbc_lnk( vn, 'V', -1. )
468     
469      ub(:,:,:) = un(:,:,:)
470      vb(:,:,:) = vn(:,:,:)
471     
472      ! WARNING !!!!!
473      ! after initializing u and v, we need to calculate the initial streamfunction bsf.
474      ! Otherwise, only the trend will be computed and the model will blow up (inconsistency).
475     
476      ! to do that, we call dyn_spg with a special trick:
477      ! we fill ua and va with the velocities divided by dt,
478      ! and the streamfunction will be brought to the right
479      ! value assuming the velocities have been set up in
480      ! one time step.
481      ! we then set bsfd to zero (first guess for next step
482      ! is d(psi)/dt = 0.)
483
484      !  sets up s false trend to calculate the barotropic
485      !  streamfunction.
486
487      ua(:,:,:) = ub(:,:,:) / rdt
488      va(:,:,:) = vb(:,:,:) / rdt
489
490      ! calls dyn_spg. we assume euler time step, strating from rest.
491      indic = 0
492      !                                                     ! surface pressure gradient
493      IF( lk_dynspg_fsc     )   CALL dyn_spg_fsc     ( nit000, indic )  ! free surface constant volume case
494      IF( lk_dynspg_fsc_tsk )   CALL dyn_spg_fsc_atsk( nit000, indic )  ! autotask free surface constant volume case
495      IF( lk_dynspg_rl      )   CALL dyn_spg_rl      ( nit000, indic )  ! rigid-lid case
496
497      ! the new velocity is ua*rdt
498
499      CALL lbc_lnk( ua, 'U', -1. )
500      CALL lbc_lnk( va, 'V', -1. )
501
502      ub(:,:,:) = ua(:,:,:) * rdt
503      vb(:,:,:) = va(:,:,:) * rdt
504      ua(:,:,:) = 0.e0
505      va(:,:,:) = 0.e0
506      un(:,:,:) = ub(:,:,:)
507      vn(:,:,:) = vb(:,:,:)
508       
509#if defined key_dynspg_rl
510      IF( lk_isl )   bsfb(:,:) = bsfn(:,:)          ! Put bsfb to zero
511#endif
512
513      ! Compute the divergence and curl
514
515      CALL div_cur( nit000 )            ! now horizontal divergence and curl
516
517      hdivb(:,:,:) = hdivn(:,:,:)       ! set the before to the now value
518      rotb (:,:,:) = rotn (:,:,:)       ! set the before to the now value
519
520   END SUBROUTINE istate_uvg
521
522   !!=====================================================================
523END MODULE istate
Note: See TracBrowser for help on using the repository browser.