1 | MODULE limupdate1 |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE limupdate1 *** |
---|
4 | !! LIM-3 : Update of sea-ice global variables at the end of the time step |
---|
5 | !!====================================================================== |
---|
6 | !! History : 3.0 ! 2006-04 (M. Vancoppenolle) Original code |
---|
7 | !! 3.5 ! 2014-06 (C. Rousset) Complete rewriting/cleaning |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | #if defined key_lim3 |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | !! 'key_lim3' LIM3 sea-ice model |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! lim_update1 : computes update of sea-ice global variables from trend terms |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
16 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
17 | USE dom_oce |
---|
18 | USE phycst ! physical constants |
---|
19 | USE ice |
---|
20 | USE thd_ice ! LIM thermodynamic sea-ice variables |
---|
21 | USE limitd_th |
---|
22 | USE limvar |
---|
23 | USE wrk_nemo ! work arrays |
---|
24 | USE timing ! Timing |
---|
25 | USE limcons ! conservation tests |
---|
26 | USE limctl ! control prints |
---|
27 | USE lib_mpp ! MPP library |
---|
28 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
29 | USE in_out_manager ! I/O manager |
---|
30 | |
---|
31 | IMPLICIT NONE |
---|
32 | PRIVATE |
---|
33 | |
---|
34 | PUBLIC lim_update1 |
---|
35 | |
---|
36 | !! * Substitutions |
---|
37 | # include "vectopt_loop_substitute.h90" |
---|
38 | !!---------------------------------------------------------------------- |
---|
39 | !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) |
---|
40 | !! $Id$ |
---|
41 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
42 | !!---------------------------------------------------------------------- |
---|
43 | CONTAINS |
---|
44 | |
---|
45 | SUBROUTINE lim_update1( kt ) |
---|
46 | !!------------------------------------------------------------------- |
---|
47 | !! *** ROUTINE lim_update1 *** |
---|
48 | !! |
---|
49 | !! ** Purpose : Computes update of sea-ice global variables at |
---|
50 | !! the end of the dynamics. |
---|
51 | !! |
---|
52 | !!--------------------------------------------------------------------- |
---|
53 | INTEGER, INTENT(in) :: kt ! number of iteration |
---|
54 | INTEGER :: ji, jj, jk, jl ! dummy loop indices |
---|
55 | REAL(wp) :: zsal |
---|
56 | REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b |
---|
57 | !!------------------------------------------------------------------- |
---|
58 | IF( nn_timing == 1 ) CALL timing_start('limupdate1') |
---|
59 | |
---|
60 | IF( kt == nit000 .AND. lwp ) THEN |
---|
61 | WRITE(numout,*)'' |
---|
62 | WRITE(numout,*)' lim_update1 ' |
---|
63 | WRITE(numout,*)' ~~~~~~~~~~~ ' |
---|
64 | ENDIF |
---|
65 | |
---|
66 | ! conservation test |
---|
67 | IF( ln_limdiachk ) CALL lim_cons_hsm(0, 'limupdate1', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) |
---|
68 | |
---|
69 | !---------------------------------------------------- |
---|
70 | ! ice concentration should not exceed amax |
---|
71 | !----------------------------------------------------- |
---|
72 | at_i(:,:) = 0._wp |
---|
73 | DO jl = 1, jpl |
---|
74 | at_i(:,:) = a_i(:,:,jl) + at_i(:,:) |
---|
75 | END DO |
---|
76 | |
---|
77 | DO jl = 1, jpl |
---|
78 | DO jj = 1, jpj |
---|
79 | DO ji = 1, jpi |
---|
80 | IF( at_i(ji,jj) > rn_amax_2d(ji,jj) .AND. a_i(ji,jj,jl) > 0._wp ) THEN |
---|
81 | a_i (ji,jj,jl) = a_i (ji,jj,jl) * ( 1._wp - ( 1._wp - rn_amax_2d(ji,jj) / at_i(ji,jj) ) ) |
---|
82 | oa_i(ji,jj,jl) = oa_i(ji,jj,jl) * ( 1._wp - ( 1._wp - rn_amax_2d(ji,jj) / at_i(ji,jj) ) ) |
---|
83 | ENDIF |
---|
84 | END DO |
---|
85 | END DO |
---|
86 | END DO |
---|
87 | |
---|
88 | !--------------------- |
---|
89 | ! Ice salinity bounds |
---|
90 | !--------------------- |
---|
91 | IF ( nn_icesal == 2 ) THEN |
---|
92 | DO jl = 1, jpl |
---|
93 | DO jj = 1, jpj |
---|
94 | DO ji = 1, jpi |
---|
95 | zsal = smv_i(ji,jj,jl) |
---|
96 | ! salinity stays in bounds |
---|
97 | rswitch = 1._wp - MAX( 0._wp, SIGN( 1._wp, - v_i(ji,jj,jl) ) ) |
---|
98 | smv_i(ji,jj,jl) = rswitch * MAX( MIN( rn_simax * v_i(ji,jj,jl), smv_i(ji,jj,jl) ), rn_simin * v_i(ji,jj,jl) ) |
---|
99 | ! associated salt flux |
---|
100 | sfx_res(ji,jj) = sfx_res(ji,jj) - ( smv_i(ji,jj,jl) - zsal ) * rhoic * r1_rdtice |
---|
101 | END DO |
---|
102 | END DO |
---|
103 | END DO |
---|
104 | ENDIF |
---|
105 | |
---|
106 | !---------------------------------------------------- |
---|
107 | ! Rebin categories with thickness out of bounds |
---|
108 | !---------------------------------------------------- |
---|
109 | IF ( jpl > 1 ) CALL lim_itd_th_reb(1, jpl) |
---|
110 | |
---|
111 | !----------------- |
---|
112 | ! zap small values |
---|
113 | !----------------- |
---|
114 | CALL lim_var_zapsmall |
---|
115 | |
---|
116 | ! ------------------------------------------------- |
---|
117 | ! Diagnostics |
---|
118 | ! ------------------------------------------------- |
---|
119 | DO jl = 1, jpl |
---|
120 | afx_dyn(:,:) = afx_dyn(:,:) + ( a_i(:,:,jl) - a_i_b(:,:,jl) ) * r1_rdtice |
---|
121 | END DO |
---|
122 | |
---|
123 | DO jj = 1, jpj |
---|
124 | DO ji = 1, jpi |
---|
125 | ! heat content variation (W.m-2) |
---|
126 | diag_heat(ji,jj) = - ( SUM( e_i(ji,jj,1:nlay_i,:) - e_i_b(ji,jj,1:nlay_i,:) ) + & |
---|
127 | & SUM( e_s(ji,jj,1:nlay_s,:) - e_s_b(ji,jj,1:nlay_s,:) ) & |
---|
128 | & ) * r1_rdtice |
---|
129 | ! salt, volume |
---|
130 | diag_smvi(ji,jj) = SUM( smv_i(ji,jj,:) - smv_i_b(ji,jj,:) ) * rhoic * r1_rdtice |
---|
131 | diag_vice(ji,jj) = SUM( v_i (ji,jj,:) - v_i_b (ji,jj,:) ) * rhoic * r1_rdtice |
---|
132 | diag_vsnw(ji,jj) = SUM( v_s (ji,jj,:) - v_s_b (ji,jj,:) ) * rhosn * r1_rdtice |
---|
133 | END DO |
---|
134 | END DO |
---|
135 | |
---|
136 | ! conservation test |
---|
137 | IF( ln_limdiachk ) CALL lim_cons_hsm(1, 'limupdate1', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) |
---|
138 | |
---|
139 | ! control prints |
---|
140 | IF( ln_ctl ) CALL lim_prt3D( 'limupdate1' ) |
---|
141 | |
---|
142 | IF( nn_timing == 1 ) CALL timing_stop('limupdate1') |
---|
143 | |
---|
144 | END SUBROUTINE lim_update1 |
---|
145 | |
---|
146 | #else |
---|
147 | !!---------------------------------------------------------------------- |
---|
148 | !! Default option Empty Module No sea-ice model |
---|
149 | !!---------------------------------------------------------------------- |
---|
150 | CONTAINS |
---|
151 | SUBROUTINE lim_update1 ! Empty routine |
---|
152 | END SUBROUTINE lim_update1 |
---|
153 | #endif |
---|
154 | |
---|
155 | END MODULE limupdate1 |
---|