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 @ 873

Last change on this file since 873 was 869, checked in by rblod, 16 years ago

Parallelisation of LIM3. This commit seems to ensure the reproducibility mono/mpp. See ticket #77.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.6 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#if defined key_oasis3 || defined key_oasis4
18   USE geo2ocean, only : repcmo
19   USE ice, only       : frld       ! : leads fraction = 1-a/totalarea
20#if defined key_oasis3
21   USE cpl_oasis3      ! OASIS3 coupling (to ECHAM5)
22#elif defined key_oasis4
23   USE cpl_oasis4      ! OASIS4 coupling (to ECHAM5)
24#endif
25#endif
26   IMPLICIT NONE
27   PRIVATE
28
29   !! * Routine accessibility
30   PUBLIC tau                ! routine called by step.F90
31
32  !! * Share modules variables
33   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &
34      taux, tauy,      &  !: surface stress components in (i,j) referential
35#if defined key_lim3
36      tauxw, tauyw,    &  !: surface wind stress components in (i,j) referential
37      slotx, sloty,    &  !: time-slope for surface windstress in (i,j) referential
38      tauxg, tauyg        !: surface stress components in geographical
39      !                   !  referential (used in output)
40#endif
41
42   !!----------------------------------------------------------------------
43   !!   OPA 9.0 , LOCEAN-IPSL (2005)
44   !! $Header$
45   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
46   !!----------------------------------------------------------------------
47
48#if defined key_tau_monthly
49   ! Monthly climatology in (i,j) referential  (i-comp. at U-pt and j-comp. at V-pt)
50   !!----------------------------------------------------------------------
51   !!   'key_tau_monthly'                        MONTHLY climatology stress
52   !!   default case                                   NetCDF files
53   !!----------------------------------------------------------------------
54#   include "tau_forced_monthly.h90"
55
56# elif defined key_tau_daily
57   !!----------------------------------------------------------------------
58   !!   'key_tau_daily'                                 DAILY stress
59   !!                                                   NetCDF files
60   !!----------------------------------------------------------------------
61   ! Daily climatology/interannual in (i,j) referential  (i-comp. at U-pt and j-comp. at V-pt)
62#   include "tau_forced_daily.h90"
63
64#elif defined key_oasis3  ||  defined key_oasis4
65   ! Coupled case : stress at the coupling frequency
66   !!----------------------------------------------------------------------
67   !!   'key_oasis3' or 'key_oasis4' and           Coupled Ocean/Atmosphere
68   !!   'key_lim3'or 'key_lim2'                              LIM sea-ice
69   !!----------------------------------------------------------------------
70   ! New way: 3D referential link to the earth (avoid north pole pb)
71   ! (3 component stress defined at U- and V-points)
72#  include "tau_oasis_ice.h90"
73#else
74   !!----------------------------------------------------------------------
75   !!   Default option                                     constant forcing
76   !!----------------------------------------------------------------------
77   !! * local modules variables
78   INTEGER  ::       & !!! * Namelist numtau *
79      ntau000 = 1       ! nb of time-step during which the surface stress
80      !                 ! increase from 0 to its nominal value (taudta) (>0)
81   REAL(wp) ::       & !!! * Namelist numtau *
82      tau0x = 0.e0 , &  ! constant wind stress value in i-direction
83      tau0y = 0.e0      ! constant wind stress value in j-direction
84   !!----------------------------------------------------------------------
85
86CONTAINS
87
88   SUBROUTINE tau( kt )
89      !!---------------------------------------------------------------------
90      !!                    ***  ROUTINE tau  ***
91      !!
92      !! ** Purpose :   provide the ocean surface stress at each time step
93      !!
94      !! ** Method  :   Constant surface stress increasing from 0 to taudta
95      !!      value during the first ntau000 time-step (namelist)
96      !!        CAUTION: never mask the surface stress field !
97      !!
98      !! ** Action  : - update taux , tauy the stress in (i,j) ref.
99      !!
100      !! History :
101      !!   4.0  !  91-03  (G. Madec)  Original code
102      !!   8.5  !  02-11  (G. Madec)  F90: Free form and module
103      !!----------------------------------------------------------------------
104      !! * Arguments
105      INTEGER, INTENT( in  ) ::   kt    ! ocean time step
106      REAL(wp) ::   ztau, ztau_sais, &  ! wind intensity and of the seasonal cycle
107         ztime,                      &  ! time in hour
108         ztimemax, ztimemin,         &  ! 21th June, and 21th decem. if date0 = 1st january
109         ztaun                          ! intensity
110      INTEGER  ::   ji, jj              ! dummy loop indices
111
112      INTEGER  ::           &
113         zyear0,            &           ! initial year
114         zmonth0,           &           ! initial month
115         zday0,             &           ! initial day
116         zday_year0                    ! initial day since january 1st
117       
118
119      !! * Local declarations
120      REAL(wp) ::   zfacto              !
121
122      NAMELIST/namtau/ ntau000, tau0x, tau0y
123      !!---------------------------------------------------------------------
124
125      IF( cp_cfg == 'gyre' ) THEN
126
127         zyear0  = ndate0 / 10000                             ! initial year
128         zmonth0 = ( ndate0 - zyear0 * 10000 ) / 100          ! initial month
129         zday0   = ndate0 - zyear0 * 10000 - zmonth0 * 100    ! initial day betwen 1 and 30
130
131         zday_year0 = (zmonth0-1)*30.+zday0                   ! initial day betwen 1 and 360
132
133         ! current day (in hours) since january the 1st of the current year
134          ztime = FLOAT( kt ) * rdt / (rmmss * rhhmm)  &    !  total incrementation (in hours)
135             &     - (nyear  - 1) * rjjhh * raajj           !  minus years since beginning of experiment (in hours)
136
137
138        ! 21th june at 24h in hours
139         ztimemax = ((5.*30.)+21.)* 24.
140         ! 21th december day in hours
141         ! rjjhh * raajj / 4 = 1 seasonal cycle in hours
142         ztimemin = ztimemax + rjjhh * raajj / 2 
143
144         ! mean intensity at 0.105/srqt(2) because projected with 45deg angle
145         ztau = 0.105 / SQRT(2.)           
146         ! seasonal oscillation intensity
147         ztau_sais = 0.015                 
148         ztaun = ztau - ztau_sais * COS( (ztime - ztimemax) / (ztimemin - ztimemax) * rpi )
149         DO jj = 1, jpj
150            DO ji = 1, jpi
151              ! domain from 15deg to 50deg and 1/2 period along 14deg
152              ! so 5/4 of half period with seasonal cycle
153              taux (ji,jj) = - ztaun * SIN( rpi * (gphiu(ji,jj) - 15.) / (29.-15.) )
154              tauy (ji,jj) =   ztaun * SIN( rpi * (gphiv(ji,jj) - 15.) / (29.-15.) )
155            END DO
156         END DO
157   
158         IF( kt == nit000 .AND. lwp ) THEN
159            WRITE(numout,*)' tau    : analytical formulation for gyre'
160            WRITE(numout,*)' ~~~~~~~ '
161            WRITE(numout,*)'          nyear      = ', nyear
162            WRITE(numout,*)'          nmonth     = ', nmonth
163            WRITE(numout,*)'          nday       = ', nday
164            WRITE(numout,*)'          nday_year  = ',nday_year
165            WRITE(numout,*)'          ndastp     = ',ndastp
166            WRITE(numout,*)'          adatrj     = ',adatrj
167            WRITE(numout,*)'          ztime      = ',ztime
168            WRITE(numout,*)'          ztimemax   = ',ztimemax
169            WRITE(numout,*)'          ztimemin   = ',ztimemin
170            WRITE(numout,*)'          zyear0     = ', zyear0
171            WRITE(numout,*)'          zmonth0    = ', zmonth0
172            WRITE(numout,*)'          zday0      = ', zday0
173            WRITE(numout,*)'          zday_year0 = ',zday_year0
174            WRITE(numout,*)'          raajj      = ', raajj
175            WRITE(numout,*)'          ztau       = ', ztau
176            WRITE(numout,*)'          ztau_sais  = ', ztau_sais
177            WRITE(numout,*)'          ztaun      = ', ztaun
178         ENDIF
179   
180      ELSE
181
182         IF( kt == nit000 ) THEN
183   
184            ! Read Namelist namtau : surface wind stress
185            ! --------------------
186            REWIND ( numnam )
187            READ   ( numnam, namtau )
188   
189            IF(lwp) WRITE(numout,*)' '
190            IF(lwp) WRITE(numout,*)' tau     : Constant surface wind stress read in namelist'
191            IF(lwp) WRITE(numout,*)' ~~~~~~~ '
192            IF(lwp) WRITE(numout,*)'           Namelist namtau: set the constant stress values'
193            IF(lwp) WRITE(numout,*)'              spin up of the stress  ntau000 = ', ntau000, ' time-steps'
194            IF(lwp) WRITE(numout,*)'              constant i-stress      tau0x   = ', tau0x  , ' N/m2'
195            IF(lwp) WRITE(numout,*)'              constant j-stress      tau0y   = ', tau0y  , ' N/m2'
196   
197            ntau000 = MAX( ntau000, 1 )   ! must be >= 1
198   
199         ENDIF
200   
201         ! Increase the surface stress to its nominal value in ntau000 time-step
202         
203         IF( kt <= ntau000 ) THEN
204            zfacto = 0.5 * (  1. - COS( rpi * FLOAT( kt ) / FLOAT( ntau000 ) )  )
205            taux (:,:) = zfacto * tau0x
206            tauy (:,:) = zfacto * tau0y
207         ENDIF
208
209      ENDIF
210     
211   END SUBROUTINE tau
212#endif
213   !!======================================================================
214END MODULE taumod
Note: See TracBrowser for help on using the repository browser.