SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modi_glt_updice_r.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !GLT_LIC The GELATO model is a seaice model used in stand-alone or embedded mode.
6 !GLT_LIC It has been developed by Meteo-France. The holder of GELATO is Meteo-France.
7 !GLT_LIC
8 !GLT_LIC This software is governed by the CeCILL-C license under French law and biding
9 !GLT_LIC by the rules of distribution of free software. See the CeCILL-C_V1-en.txt
10 !GLT_LIC (English) and CeCILL-C_V1-fr.txt (French) for details. The CeCILL is a free
11 !GLT_LIC software license, explicitly compatible with the GNU GPL
12 !GLT_LIC (see http://www.gnu.org/licenses/license-list.en.html#CeCILL)
13 !GLT_LIC
14 !GLT_LIC The CeCILL-C licence agreement grants users the right to modify and re-use the
15 !GLT_LIC software governed by this free software license. The exercising of this right
16 !GLT_LIC is conditional upon the obligation to make available to the community the
17 !GLT_LIC modifications made to the source code of the software so as to contribute to
18 !GLT_LIC its evolution.
19 !GLT_LIC
20 !GLT_LIC In consideration of access to the source code and the rights to copy, modify
21 !GLT_LIC and redistribute granted by the license, users are provided only with a limited
22 !GLT_LIC warranty and the software's author, the holder of the economic rights, and the
23 !GLT_LIC successive licensors only have limited liability. In this respect, the risks
24 !GLT_LIC associated with loading, using, modifying and/or developing or reproducing the
25 !GLT_LIC software by the user are brought to the user's attention, given its Free
26 !GLT_LIC Software status, which may make it complicated to use, with the result that its
27 !GLT_LIC use is reserved for developers and experienced professionals having in-depth
28 !GLT_LIC computer knowledge. Users are therefore encouraged to load and test the
29 !GLT_LIC suitability of the software as regards their requirements in conditions enabling
30 !GLT_LIC the security of their systems and/or data to be ensured and, more generally, to
31 !GLT_LIC use and operate it in the same conditions of security.
32 !GLT_LIC
33 !GLT_LIC The GELATO sofware is cureently distibuted with the SURFEX software, available at
34 !GLT_LIC http://www.cnrm.meteo.fr/surfex. The fact that you download the software deemed that
35 !GLT_LIC you had knowledge of the CeCILL-C license and that you accept its terms.
36 !GLT_LIC Attempts to use this software in a way not complying with CeCILL-C license
37 !GLT_LIC may lead to prosecution.
38 !GLT_LIC
39 ! =======================================================================
40 ! ======================== MODULE modi_glt_updice_r =========================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! This module contains a subroutine that manages the ice content
46 ! --------------------- BEGIN MODULE modi_glt_updice_r ----------------------
47 !THXS_SFX!MODULE modi_glt_updice_r
48 !THXS_SFX!INTERFACE
49 !THXS_SFX!!
50 !THXS_SFX!SUBROUTINE glt_updice_r &
51 !THXS_SFX! ( kinit,omsg,tpdom,tpsit,psalt_a,pice_a,tptfl,pemps_a,psalf_a)
52 !THXS_SFX! USE modd_types_glt
53 !THXS_SFX! USE modd_glt_param
54 !THXS_SFX! INTEGER, INTENT(in) :: &
55 !THXS_SFX! kinit
56 !THXS_SFX! CHARACTER(*), INTENT(in) :: &
57 !THXS_SFX! omsg
58 !THXS_SFX! TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
59 !THXS_SFX! tpdom
60 !THXS_SFX! TYPE(t_tfl), DIMENSION(np), INTENT(in), OPTIONAL :: &
61 !THXS_SFX! tptfl
62 !THXS_SFX! TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
63 !THXS_SFX! tpsit
64 !THXS_SFX! REAL, INTENT(inout), OPTIONAL :: &
65 !THXS_SFX! pemps_a, psalf_a
66 !THXS_SFX! REAL, INTENT(inout) :: &
67 !THXS_SFX! pice_a, psalt_a
68 !THXS_SFX!END SUBROUTINE glt_updice_r
69 !THXS_SFX!!
70 !THXS_SFX!END INTERFACE
71 !THXS_SFX!END MODULE modi_glt_updice_r
72 !
73 ! --------------------- BEGIN MODULE modi_glt_updice_r ----------------------
74 !
75 !
76 !
77 ! -----------------------------------------------------------------------
78 ! ------------------------ SUBROUTINE glt_updice_r --------------------------
79 !
80 ! .. Subroutine used to check global water budget.
81 !
82 SUBROUTINE glt_updice_r &
83  ( kinit,omsg,tpdom,tpsit,psalt_a,pice_a,tptfl,pemps_a,psalf_a)
84 !
85  USE modd_types_glt
86  USE modd_glt_param
89  USE mode_glt_info_r
90 !
91  IMPLICIT NONE
92  INTEGER, INTENT(in) :: &
93  kinit
94  CHARACTER(*), INTENT(in) :: &
95  omsg
96  TYPE(t_dom), DIMENSION(np), INTENT(in) :: &
97  tpdom
98  TYPE(t_tfl), DIMENSION(np), INTENT(in), OPTIONAL :: &
99  tptfl
100  TYPE(t_sit), DIMENSION(nt,np), INTENT(in) :: &
101  tpsit
102  REAL, INTENT(inout), OPTIONAL :: &
103  pemps_a, psalf_a
104  REAL, INTENT(inout) :: &
105  pice_a, psalt_a
106 !
107  REAL, DIMENSION(np) :: &
108  zice, zemps, zsalf, zsalt
109  REAL :: &
110  zice_a, zemps_a, zdemps, zdmice, zdmsalt, zdsalf, zsalf_a, zsalt_a
111 !
112 !
113 ! Mass of fresh water in ice
114 ! zice(:) = rhoice*SUM( tpsit(:,:)%fsi*tpsit(:,:)%hsi / &
115 ! ( 1.-1.e-3*tpsit(:,:)%ssi), DIM=1 )
116  zice(:) = rhoice*sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi, dim=1 )
117  zice_a = glt_avg_r(tpdom, zice(:), 1)
118 ! Mass of salt in ice
119  zsalt(:) = rhoice*sum( tpsit(:,:)%fsi*tpsit(:,:)%hsi*tpsit(:,:)%ssi, dim=1 )*1.e-3
120  zsalt_a = glt_avg_r(tpdom, zsalt(:), 1)
121  IF ( present(tptfl) ) THEN
122  zemps(:) = tptfl(:)%cio
123  zemps_a = glt_avg_r(tpdom, zemps(:), 1)
124  ! Salt flux
125  zsalf(:) = tptfl(:)%sio
126  zsalf_a = glt_avg_r(tpdom, zsalf(:), 1)
127  ENDIF
128  IF ( kinit > 0) THEN
129  IF ( present(tptfl) ) THEN
130  zdemps = zemps_a - pemps_a
131  zdsalf = zsalf_a - psalf_a
132  ENDIF
133  zdmice = ( zice_a - pice_a) / dtt
134  zdmsalt = ( zsalt_a - psalt_a) / dtt
135  IF (lwg) THEN
136  WRITE(noutlu,*) &
137  '--------------------------------------------------------------------'
138  WRITE(noutlu,*) omsg
139  WRITE(noutlu,*) ' Change in ice mass content :', zdmice
140  IF ( present(tptfl) ) THEN
141  WRITE(noutlu,*) ' Change in emps :', zdemps
142  WRITE(noutlu,*) ' BILAN DMICE-EMP :', zdmice + zdemps
143  ENDIF
144  WRITE(noutlu,*) omsg,' Salt Content :', zsalt_a
145  WRITE(noutlu,*) ' Change in Salt Content :', zdmsalt
146  IF ( present(tptfl) ) THEN
147  WRITE(noutlu,*) ' Change in salt flux :', zdsalf
148  WRITE(noutlu,*) ' BILAN Dsalt_content/salflx :', zdmsalt + zdsalf
149  ENDIF
150  ENDIF
151  ELSE
152  IF (lwg) THEN
153  WRITE(noutlu,*) omsg,' Salt Content :', zsalt_a
154  WRITE(noutlu,*) omsg,' Mass Content :', zice_a
155  ENDIF
156  ENDIF
157  pice_a = zice_a
158  psalt_a = zsalt_a
159  IF ( present(tptfl) ) THEN
160  pemps_a = zemps_a
161  psalf_a = zsalf_a
162  ENDIF
163 
164 END SUBROUTINE glt_updice_r
165 
166 
167 
168 
169 
170 
171 
subroutine glt_updice_r(kinit, omsg, tpdom, tpsit, psalt_a, pice_a, tptfl, pemps_a, psalf_a)