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.
cool_skin.F90 in branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/DIU – NEMO

source: branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/DIU/cool_skin.F90 @ 6010

Last change on this file since 6010 was 6010, checked in by timgraham, 8 years ago

Tidying of DIU code

File size: 6.1 KB
Line 
1MODULE cool_skin
2   !!======================================================================
3   !!                    ***  MODULE  cool_skin  ***
4   !!     Cool skin thickness and delta T correction using Artele et al. (2002)
5   !!     [see also Tu and Tsuang (2005)]
6   !!
7   !!=====================================================================
8   !! History :        !  2012-01  (P. Sykes)  Original code
9   !!----------------------------------------------------------------------
10
11   !!----------------------------------------------------------------------
12   !!   diurnal_sst_coolskin_step  : time-step the cool skin corrections
13   !!----------------------------------------------------------------------
14   USE par_kind
15   USE phycst
16   USE dom_oce
17   USE in_out_manager
18   USE sbc_oce
19   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
20   
21   IMPLICIT NONE
22   
23   ! Namelist parameters
24
25   ! Parameters
26   REAL(wp), PRIVATE, PARAMETER :: pp_k = 0.596_wp          ! Thermal conductivity of seawater
27   REAL(wp), PRIVATE, PARAMETER :: pp_v = 1.05e-6_wp        ! Kinematic viscosity of seawater
28   REAL(wp), PRIVATE, PARAMETER :: pp_C = 86400             ! seconds [see Tu and Tsuang (2005)]
29   REAL(wp), PRIVATE, PARAMETER :: pp_cw = 3993._wp         ! specific heat capacity of seawater
30   REAL(wp), PRIVATE, PARAMETER :: pp_h = 10._wp            ! reference depth [using 10m from Artale et al. (2002)]
31   REAL(wp), PRIVATE, PARAMETER :: pp_rhoa = 1.20421_wp     ! density of air (at 20C)
32   REAL(wp), PRIVATE, PARAMETER :: pp_cda = 1.45e-3_wp      ! assumed air-sea drag coefficient for calculating wind speed
33   
34   ! Key variables
35   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: x_csdsst    ! Cool skin delta SST
36   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: x_csthick   ! Cool skin thickness
37
38   PRIVATE
39   PUBLIC diurnal_sst_coolskin_step, diurnal_sst_coolskin_init
40
41      !! * Substitutions
42#  include "domzgr_substitute.h90"
43#  include "vectopt_loop_substitute.h90"
44   
45   CONTAINS
46   
47   SUBROUTINE diurnal_sst_coolskin_init
48      !!----------------------------------------------------------------------
49      !! *** ROUTINE diurnal_sst_coolskin_init ***
50      !!
51      !! ** Purpose :   initialise the cool skin model
52      !!
53      !! ** Method :
54      !!
55      !! ** Reference :
56      !!
57      !!----------------------------------------------------------------------
58     
59      IMPLICIT NONE
60     
61      ALLOCATE( x_csdsst(jpi,jpj), x_csthick(jpi,jpj) )
62      x_csdsst = 0.
63      x_csthick = 0.
64     
65   END SUBROUTINE diurnal_sst_coolskin_init
66 
67   SUBROUTINE diurnal_sst_coolskin_step(psqflux, pstauflux, psrho, rdt)
68      !!----------------------------------------------------------------------
69      !! *** ROUTINE diurnal_sst_takaya_step ***
70      !!
71      !! ** Purpose :   Time-step the Artale cool skin model
72      !!
73      !! ** Method :
74      !!
75      !! ** Reference :
76      !!----------------------------------------------------------------------
77     
78      IMPLICIT NONE
79     
80      ! Dummy variables
81      REAL(wp), INTENT(IN), DIMENSION(jpi,jpj) :: psqflux     ! Heat (non-solar)(Watts)
82      REAL(wp), INTENT(IN), DIMENSION(jpi,jpj) :: pstauflux   ! Wind stress (kg/ m s^2)
83      REAL(wp), INTENT(IN), DIMENSION(jpi,jpj) :: psrho       ! Water density (kg/m^3)
84      REAL(wp), INTENT(IN) :: rdt                             ! Time-step
85     
86      ! Local variables
87      REAL(wp), DIMENSION(jpi,jpj) :: z_fv                    ! Friction velocity     
88      REAL(wp), DIMENSION(jpi,jpj) :: z_gamma                 ! Dimensionless function of wind speed
89      REAL(wp), DIMENSION(jpi,jpj) :: z_lamda                 ! Sauders (dimensionless) proportionality constant
90      REAL(wp), DIMENSION(jpi,jpj) :: z_wspd                  ! Wind speed (m/s)
91      REAL(wp) :: z_ztx                                       ! Temporary u wind stress
92      REAL(wp) :: z_zty                                       ! Temporary v wind stress
93      REAL(wp) :: z_zmod                                      ! Temporary total wind stress
94     
95      INTEGER :: ji,jj
96     
97      IF ( .NOT. ln_blk_core ) THEN
98         CALL ctl_stop("cool_skin.f90: diurnal flux processing only implemented"//&
99         &             " for core bulk forcing")
100      ENDIF
101 
102      DO jj = 1,jpj
103         DO ji = 1,jpi
104           
105            ! Calcualte wind speed from wind stress and friction velocity
106            IF( tmask(ji,jj,1) == 1. .AND. pstauflux(ji,jj) /= 0 .AND. psrho(ji,jj) /=0 ) THEN
107               z_fv(ji,jj) = SQRT( pstauflux(ji,jj) / psrho(ji,jj) )
108               z_wspd(ji,jj) = SQRT( pstauflux(ji,jj) / ( pp_cda * pp_rhoa ) )
109            ELSE
110               z_fv(ji,jj) = 0.
111               z_wspd(ji,jj) = 0.     
112            ENDIF
113
114 
115            ! Calculate gamma function which is dependent upon wind speed
116            IF( tmask(ji,jj,1) == 1. ) THEN
117               IF( ( z_wspd(ji,jj) <= 7.5 ) ) z_gamma(ji,jj) = ( 0.2 * z_wspd(ji,jj) ) + 0.5
118               IF( ( z_wspd(ji,jj) > 7.5 ) .AND. ( z_wspd(ji,jj) < 10. ) ) z_gamma(ji,jj) = ( 1.6 * z_wspd(ji,jj) ) - 10.
119               IF( ( z_wspd(ji,jj) >= 10. ) ) z_gamma(ji,jj) = 6.
120            ENDIF
121
122
123            ! Calculate lamda function
124            IF( tmask(ji,jj,1) == 1. .AND. z_fv(ji,jj) /= 0 ) THEN
125               z_lamda(ji,jj) = ( z_fv(ji,jj) * pp_k * pp_C ) / ( z_gamma(ji,jj) * psrho(ji,jj) * pp_cw * pp_h * pp_v )
126            ELSE
127               z_lamda(ji,jj) = 0.
128            ENDIF
129
130
131
132            ! Calculate the cool skin thickness - only when heat flux is out of the ocean
133            IF( tmask(ji,jj,1) == 1. .AND. z_fv(ji,jj) /= 0 .AND. psqflux(ji,jj) < 0 ) THEN
134                x_csthick(ji,jj) = ( z_lamda(ji,jj) * pp_v ) / z_fv(ji,jj)
135            ELSE
136                x_csthick(ji,jj) = 0.
137            ENDIF
138
139
140
141            ! Calculate the cool skin correction - only when the heat flux is out of the ocean
142            IF( tmask(ji,jj,1) == 1. .AND. x_csthick(ji,jj) /= 0. .AND. psqflux(ji,jj) < 0. ) THEN
143               x_csdsst(ji,jj) = ( psqflux(ji,jj) * x_csthick(ji,jj) ) / pp_k
144             ELSE
145               x_csdsst(ji,jj) = 0.
146            ENDIF
147
148         ENDDO
149      ENDDO
150
151   END SUBROUTINE diurnal_sst_coolskin_step
152
153
154END MODULE cool_skin
Note: See TracBrowser for help on using the repository browser.