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

source: trunk/NEMO/OPA_SRC/SBC/taumod.F90 @ 247

Last change on this file since 247 was 247, checked in by opalod, 19 years ago

CL : Add CVS Header and CeCILL licence information

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.8 KB
Line 
1MODULE taumod
2   !!======================================================================
3   !!                       ***  MODULE  taumod  ***
4   !! Ocean forcing : stress at the the ocean surface
5   !!=====================================================================
6
7   !!----------------------------------------------------------------------
8   !!   tau          : define the surface stress for the ocean
9   !!----------------------------------------------------------------------
10   !! * Modules used
11   USE dom_oce         ! ocean space and time domain
12   USE phycst          ! physical constants
13   USE in_out_manager  ! I/O manager
14   USE daymod          ! calendar
15   USE lbclnk          !
16
17   IMPLICIT NONE
18   PRIVATE
19
20   !! * Routine accessibility
21   PUBLIC tau                ! routine called by step.F90
22
23   !! * Share modules variables
24   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &
25      taux, tauy,      &  !: surface stress components in (i,j) referential
26      tauxg, tauyg        !: surface stress components in geographical
27      !                   !  referential (used in output)
28   !!----------------------------------------------------------------------
29   !!   OPA 9.0 , LOCEAN-IPSL (2005)
30   !! $Header$
31   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
32   !!----------------------------------------------------------------------
33
34#if defined key_tau_monthly
35   ! Monthly climatology in (i,j) referential  (i-comp. at U-pt and j-comp. at V-pt)
36   !!----------------------------------------------------------------------
37   !!   'key_tau_monthly'                        MONTHLY climatology stress
38   !!   default case                                   NetCDF files
39   !!----------------------------------------------------------------------
40#   include "tau_forced_monthly.h90"
41
42# elif defined key_tau_daily
43   !!----------------------------------------------------------------------
44   !!   'key_tau_daily'                                 DAILY stress
45   !!                                                   NetCDF files
46   !!----------------------------------------------------------------------
47   ! Daily climatology/interannual in (i,j) referential  (i-comp. at U-pt and j-comp. at V-pt)
48#   include "tau_forced_daily.h90"
49
50#elif defined key_coupled
51   ! Coupled case : stress at the coupling frequency
52# if defined key_ice_lim
53   !!----------------------------------------------------------------------
54   !!   'key_coupled'                              Coupled Ocean/Atmosphere
55   !!   'key_ice_lim'                                   LIM sea-ice
56   !!----------------------------------------------------------------------
57   ! New way: 3D referential link to the earth (avoid north pole pb)
58   ! (3 component stress defined at U- and V-points)
59#  include "tau_coupled_ice.h90"
60# else
61   !!----------------------------------------------------------------------
62   !!   'key_coupled'                              Coupled Ocean/Atmosphere
63   !!   Default case                                  NO sea-ice
64   !!----------------------------------------------------------------------
65   ! old fashion: geographical referential
66   ! (zonal and meridional stress defined at U- and V-points)
67#  include "tau_coupled.h90"
68# endif
69#else
70   !!----------------------------------------------------------------------
71   !!   Default option                                     constant forcing
72   !!----------------------------------------------------------------------
73   !! * local modules variables
74   INTEGER  ::       & !!! * Namelist numtau *
75      ntau000 = 1       ! nb of time-step during which the surface stress
76      !                 ! increase from 0 to its nominal value (taudta) (>0)
77   REAL(wp) ::       & !!! * Namelist numtau *
78      tau0x = 0.e0 , &  ! constant wind stress value in i-direction
79      tau0y = 0.e0      ! constant wind stress value in j-direction
80   !!----------------------------------------------------------------------
81
82CONTAINS
83
84   SUBROUTINE tau( kt )
85      !!---------------------------------------------------------------------
86      !!                    ***  ROUTINE tau  ***
87      !!
88      !! ** Purpose :   provide the ocean surface stress at each time step
89      !!
90      !! ** Method  :   Constant surface stress increasing from 0 to taudta
91      !!      value during the first ntau000 time-step (namelist)
92      !!        CAUTION: never mask the surface stress field !
93      !!
94      !! ** Action  : - update taux , tauy the stress in (i,j) ref.
95      !!              - update tauxg, tauyg the stress in geographic ref.
96      !!
97      !! History :
98      !!   4.0  !  91-03  (G. Madec)  Original code
99      !!   8.5  !  02-11  (G. Madec)  F90: Free form and module
100      !!----------------------------------------------------------------------
101      !! * Arguments
102      INTEGER, INTENT( in  ) ::   kt    ! ocean time step
103      REAL(wp) ::   ztau, ztau_sais, &  ! wind intensity and of the seasonal cycle
104         ztime,                      &  ! time in hour
105         ztimemax, ztimemin,         &  ! 21th June, and 21th decem. if date0 = 1st january
106         ztaun                          ! intensity
107      INTEGER  ::   ji, jj, &           ! dummy loop indices
108         js                             ! indice for months
109      INTEGER  ::           &
110         zyear0,            &           ! initial year
111         zmonth0,           &           ! initial month
112         zday0,             &           ! initial day
113         zday_year0,        &           ! initial day since january 1st
114         zdaymax
115
116      !! * Local declarations
117      REAL(wp) ::   zfacto              !
118
119      NAMELIST/namtau/ ntau000, tau0x, tau0y
120      !!---------------------------------------------------------------------
121
122      IF( cp_cfg == 'gyre' ) THEN
123
124         ! same wind as in Wico
125         !test date0 : ndate0 = 010203
126         zyear0  = ndate0 / 10000
127         zmonth0 = ( ndate0 - zyear0 * 10000 ) / 100
128         zday0   = ndate0 - zyear0 * 10000 - zmonth0 * 100
129         !Calculates nday_year, day since january 1st
130         zday_year0 = zday0
131         !accumulates days of previous months of this year
132
133         DO js = 1, zmonth0
134            IF(nleapy > 1) THEN
135               zday_year0 = zday_year0 + nleapy
136            ELSE
137               IF( MOD(zyear0, 4 ) == 0 ) THEN
138                  zday_year0 = zday_year0 + nbiss(js)
139               ELSE
140                  zday_year0 = zday_year0 + nobis(js)
141               ENDIF
142            ENDIF
143         END DO
144   
145         ! day (in hours) since january the 1st
146         ztime = FLOAT( kt ) * rdt / (rmmss * rhhmm)  &  ! incrementation in hour
147            &     - (nyear - 1) * rjjhh * raajj       &  !  - nber of hours the precedent years
148            &     + zday_year0 / 24                      ! nber of hours initial date
149         ! day 21th counted since the 1st January
150         zdaymax = 21                                    ! 21th day of the month
151         DO js = 1, 5                                    ! count each day  until end May
152           IF(nleapy > 1) THEN
153               zdaymax = zdaymax + nleapy
154           ELSE
155               IF( MOD(zyear0, 4 ) == 0 ) THEN
156                   zdaymax = zdaymax + nbiss(js)
157               ELSE
158                   zdaymax = zdaymax + nobis(js)
159               ENDIF
160           ENDIF
161         END DO
162        ! 21th june in hours
163         ztimemax = zdaymax * 24
164         ! 21th december day in hours
165         ! rjjhh * raajj / 4 = 1 seasonal cycle in hours
166         ztimemin = ztimemax + rjjhh * raajj / 2 
167
168         ! mean intensity at 0.105 ; srqt(2) because projected with 45deg angle
169         ztau = 0.105 / SQRT(2.)           
170         ! seasonal oscillation intensity
171         ztau_sais = 0.015                 
172         ztaun = ztau - ztau_sais * COS( (ztime - ztimemax) / (ztimemin - ztimemax) * rpi )
173         DO jj = 1, jpj
174            DO ji = 1, jpi
175              ! domain from 15deg to 50deg and 1/2 period along 14deg
176              ! so 5/4 of half period with seasonal cycle
177              taux (ji,jj) = - ztaun * SIN( rpi * (gphiu(ji,jj) - 15.) / (29.-15.) )
178              tauy (ji,jj) =   ztaun * SIN( rpi * (gphiv(ji,jj) - 15.) / (29.-15.) )
179            END DO
180         END DO
181   
182         IF( kt == nit000 ) THEN
183            IF(lwp) WRITE(numout,*)' tau     : Constant surface wind stress read in namelist'
184            IF(lwp) WRITE(numout,*)' ~~~~~~~ '
185            IF(lwp) WRITE(numout,*)'nyear      = ', nyear
186            IF(lwp) WRITE(numout,*)'nmonth     = ', nmonth
187            IF(lwp) WRITE(numout,*)'nday       = ', nday
188            IF(lwp) WRITE(numout,*)'nday_year  = ',nday_year
189            IF(lwp) WRITE(numout,*)'ndastp     = ',ndastp
190            IF(lwp) WRITE(numout,*)'adatrj     = ',adatrj
191            IF(lwp) WRITE(numout,*)'ztime      = ',ztime
192            IF(lwp) WRITE(numout,*)'zdaymax    = ',zdaymax
193   
194            IF(lwp) WRITE(numout,*)'ztimemax   = ',ztimemax
195            IF(lwp) WRITE(numout,*)'ztimemin   = ',ztimemin
196            IF(lwp) WRITE(numout,*)'zyear0     = ', zyear0
197            IF(lwp) WRITE(numout,*)'zmonth0    = ', zmonth0
198            IF(lwp) WRITE(numout,*)'zday0      = ', zday0
199            IF(lwp) WRITE(numout,*)'zday_year0 = ',zday_year0
200            IF(lwp) WRITE(numout,*)'nobis(2)', nobis(2)
201            IF(lwp) WRITE(numout,*)'nobis(5)', nobis(5)
202            IF(lwp) WRITE(numout,*)'nobis(6)', nobis(6)
203            IF(lwp) WRITE(numout,*)'nobis(1)', nobis(1)
204            IF(lwp) WRITE(numout,*)'nobis(zmonth0 -1)', nobis(zmonth0 - 1)
205            IF(lwp) WRITE(numout,*)'raajj  = ', raajj
206         ENDIF
207   
208      ELSE
209
210         IF( kt == nit000 ) THEN
211   
212            ! Read Namelist namtau : surface wind stress
213            ! --------------------
214            REWIND ( numnam )
215            READ   ( numnam, namtau )
216   
217            IF(lwp) WRITE(numout,*)' '
218            IF(lwp) WRITE(numout,*)' tau     : Constant surface wind stress read in namelist'
219            IF(lwp) WRITE(numout,*)' ~~~~~~~ '
220            IF(lwp) WRITE(numout,*)'           Namelist namtau: set the constant stress values'
221            IF(lwp) WRITE(numout,*)'              spin up of the stress  ntau000 = ', ntau000, ' time-steps'
222            IF(lwp) WRITE(numout,*)'              constant i-stress      tau0x   = ', tau0x  , ' N/m2'
223            IF(lwp) WRITE(numout,*)'              constant j-stress      tau0y   = ', tau0y  , ' N/m2'
224   
225            ntau000 = MAX( ntau000, 1 )   ! must be >= 1
226   
227         ENDIF
228   
229         ! Increase the surface stress to its nominal value in ntau000 time-step
230         
231         IF( kt <= ntau000 ) THEN
232            zfacto = 0.5 * (  1. - COS( rpi * FLOAT( kt ) / FLOAT( ntau000 ) )  )
233            taux (:,:) = zfacto * tau0x
234            tauy (:,:) = zfacto * tau0y
235            tauxg(:,:) = zfacto * tau0x
236            tauyg(:,:) = zfacto * tau0y
237         ENDIF
238
239      ENDIF
240     
241   END SUBROUTINE tau
242#endif
243   !!======================================================================
244END MODULE taumod
Note: See TracBrowser for help on using the repository browser.