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

source: trunk/NEMO/OPA_SRC/SBC/bulk.F90 @ 218

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

CT : UPDATE153 : add/change comments

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1MODULE bulk
2   !!======================================================================
3   !!                           ***  bulk  ***
4   !!======================================================================
5#if defined key_flx_bulk_monthly || defined key_flx_bulk_daily
6   !!----------------------------------------------------------------------
7   !!   'key_flx_bulk_monthly'                        monthly bulk formulea
8   !!   'key_flx_bulk_daily'                          daily bulk formulea
9   !!----------------------------------------------------------------------
10   !!   bulk          : computation of fluxes using bulk formulation
11   !!----------------------------------------------------------------------
12   !! * Modules used   
13   USE oce             ! ocean dynamics and tracers
14   USE dom_oce         ! ocean space and time domain
15   USE ice_oce         ! bulk variable 
16   USE ocfzpt          ! ocean freezing point
17   USE flxblk          ! bulk formulae
18   USE blk_oce         ! bulk variable
19   USE flx_oce
20   USE taumod
21   USE phycst          ! physical constants
22   USE in_out_manager  ! I/O manager
23
24   IMPLICIT NONE
25   PRIVATE
26
27   !! * Routine accessibility
28   PUBLIC blk        ! called by flx.F90   
29   !!----------------------------------------------------------------------
30   !!   OPA 9.0 , LODYC-IPSL  (2003)
31   !!----------------------------------------------------------------------
32CONTAINS
33
34   SUBROUTINE blk( kt )
35      !!---------------------------------------------------------------------
36      !!                    ***  ROUTINE blk  ***
37      !!       
38      !! ** Purpose :   provide the heat fluxes on ice and ocean
39      !!                using bulk formulation
40      !!
41      !! History :
42      !!   9.0  !  03-11  (C. Ethe and G. Madec)  F90: Free form and MODULE
43      !!----------------------------------------------------------------------
44      !! * arguments
45      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
46
47      !! * Local declarations   
48      REAL(wp), DIMENSION(jpi,jpj) ::   &
49         zsst , zsss
50# if ! defined key_ice_lim
51      INTEGER  ::   ji, jj         ! dummy loop indices 
52      REAL(wp) ::   ztgel, zicopa
53# endif
54      !!---------------------------------------------------------------------
55
56     ! Initialisation
57     IF( kt == nit000) THEN
58      ! computation of rdtbs2
59        IF( nacc == 1 ) THEN
60           rdtbs2 = nfbulk * rdtmin * 0.5
61        ELSE
62           rdtbs2 = nfbulk * rdt * 0.5
63        ENDIF
64        IF ( .NOT.ln_rstart ) THEN
65           gsst(:,:) =  ( nfbulk - 1 ) * ( tn(:,:,1) + rt0 )
66           gsss(:,:) =  ( nfbulk - 1 ) *   sn(:,:,1)
67        ENDIF
68     ENDIF
69
70# if ! defined key_ice_lim
71      ! opa model ice freeze()     
72      DO jj = 1, jpj
73         DO ji = 1, jpi
74            ztgel  = fzptn(ji,jj)
75            zicopa = tmask(ji,jj,1)
76            IF( tn(ji,jj,1) >= ztgel ) zicopa = 0.
77            freeze(ji,jj) = zicopa
78         END DO
79      END DO
80# endif
81
82      gsst(:,:) = gsst(:,:) + tn(:,:,1) + rt0 
83      gsss(:,:) = gsss(:,:) + sn(:,:,1)
84
85      !  Computation of the fluxes       
86      IF( MOD( kt - 1 , nfbulk ) == 0 ) THEN
87
88!i       zsst(:,:) = gsst(:,:) / REAL( nfbulk )
89         zsst(:,:) = gsst(:,:) / REAL( nfbulk ) * tmask(:,:,1)
90         zsss(:,:) = gsss(:,:) / REAL( nfbulk )
91         CALL flx_blk( zsst )   
92     
93         gsst(:,:) = 0.   
94         gsss(:,:) = 0. 
95
96# if ! defined key_ice_lim
97         IF(l_ctl) THEN         ! print mean trends (used for debugging)
98            WRITE(numout,*) ' Forcings '
99            WRITE(numout,*) ' qsr_oce  : ', SUM( qsr_oce (1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) )
100            WRITE(numout,*) ' qsr_ice  : ', SUM( qsr_ice (1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) )
101            WRITE(numout,*) ' qnsr_oce : ', SUM( qnsr_oce(1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) )
102            WRITE(numout,*) ' qnsr_ice : ', SUM( qnsr_ice(1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) )
103            WRITE(numout,*) ' evap     : ', SUM( evap    (1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) )
104            WRITE(numout,*) ' precip   : ', SUM( tprecip (1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) ) / rday
105            WRITE(numout,*) ' Snow     : ', SUM( sprecip (1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) ) / rday
106            WRITE(numout,*) ' u-stress : ', SUM( taux    (1:nictl+1,1:njctl+1) * umask(1:nictl+1,1:njctl+1,1) )
107            WRITE(numout,*) ' v-stress : ', SUM( tauy    (1:nictl+1,1:njctl+1) * vmask(1:nictl+1,1:njctl+1,1) )
108            WRITE(numout,*) ' sst      : ', SUM( zsst    (1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) )
109            WRITE(numout,*) ' sss      : ', SUM( zsss    (1:nictl+1,1:njctl+1) * tmask(1:nictl+1,1:njctl+1,1) )
110            WRITE(numout,*)
111         ENDIF
112# endif   
113      ENDIF
114 
115   END SUBROUTINE blk
116
117#else
118   !!----------------------------------------------------------------------
119   !!   Dummy module :                                     NO bulk formulea
120   !!----------------------------------------------------------------------
121CONTAINS
122   SUBROUTINE blk( kt )          ! Dummy routine
123      WRITE(*,*) 'blk: You should not see this print! error? ', kt
124   END SUBROUTINE blk
125#endif
126 
127   !!======================================================================
128END MODULE bulk
Note: See TracBrowser for help on using the repository browser.