SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
mode_gltools_prtrarr.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 mode_gltools_prtrarr =====================
41 ! =======================================================================
42 !
43 !
44 ! * This module contains :
45 ! - a subroutine that displays part of a 2D array of dimensions
46 ! (nx,ny).
47 ! - a subroutine that displays part of a 3D array of dimensions
48 ! (nt,nx,ny).
49 
50 
51 ! ------------------- BEGIN MODULE mode_gltools_prtrarr -------------------
52 
54 INTERFACE
55 
56 SUBROUTINE glt_prtrarr2(omess,pfield,kin,kix,kjn,kjx,ktab)
57  CHARACTER(*), INTENT(in) :: &
58  omess
59  REAL, DIMENSION(:,:), INTENT(in) :: &
60  pfield
61  INTEGER, INTENT(in) :: &
62  kin,kix,kjn,kjx
63  INTEGER, INTENT(in) :: &
64  ktab
65 END SUBROUTINE glt_prtrarr2
66 
67 SUBROUTINE glt_prtrarr3(omess,pfield,klay,kin,kix,kjn,kjx,ktab)
68  CHARACTER(*), INTENT(in) :: &
69  omess
70  REAL, DIMENSION(:,:,:), INTENT(in) :: &
71  pfield
72  INTEGER, INTENT(in) :: &
73  klay
74  INTEGER, INTENT(in) :: &
75  kin,kix,kjn,kjx
76  INTEGER, INTENT(in) :: &
77  ktab
78 END SUBROUTINE glt_prtrarr3
79 
80 END INTERFACE
81 END MODULE mode_gltools_prtrarr
82 
83 ! ------------------- END MODULE mode_gltools_prtrarr ---------------------
84 
85 
86 ! -----------------------------------------------------------------------
87 ! ------------------------- SUBROUTINE glt_prtrarr2 -------------------------
88 !
89 SUBROUTINE glt_prtrarr2(omess,pfield,kin,kix,kjn,kjx,ktab)
90 !
91  USE modd_glt_param
92 !
93  IMPLICIT NONE
94  CHARACTER(*), INTENT(in) :: &
95  omess
96  REAL, DIMENSION(:,:), INTENT(in) :: &
97  pfield
98  INTEGER, INTENT(in) :: &
99  kin,kix,kjn,kjx
100  INTEGER, INTENT(in) :: &
101  ktab
102  INTEGER :: &
103  jl
104  INTEGER :: &
105  kx,ky
106  REAL, DIMENSION(:,:), ALLOCATABLE :: &
107  zwork21
108 
109 
110 ! *** Get input array dimensions
111  kx = SIZE(pfield,1)
112  ky = SIZE(pfield,2)
113 
114 ! *** Test specified array sections vs array dimensions
115  IF (kix<1 .OR. kix>kx .OR. kjx<1 .OR. kjx>ky .OR. &
116  kin<1 .OR. kin>kx .OR. kjn<1 .OR. kjn>ky .OR. &
117  kix<kin .OR. kjx<kjn) THEN
118  IF(lwg) THEN
119  WRITE(noutlu,*) ' *** WARNING ***'
120  WRITE(noutlu,*) ' glt_prtrarr2 : check array section boundaries'
121  WRITE(noutlu,*)'kin=',kin,'kix=',kix
122  WRITE(noutlu,*)'kjn=',kjn,'kjx=',kjx
123  WRITE(noutlu,*)'kx =',kx, 'ky =',ky
124  WRITE(noutlu,*) ' '
125  ENDIF
126  ELSE
127 ! * Allocate work array
128  ALLOCATE(zwork21(kix-kin+1,kjx-kjn+1))
129 
130 ! * Print requested information
131  IF (ktab==0) THEN
132  IF(lwg) WRITE(noutlu,1400) omess
133  ELSE
134  IF(lwg) WRITE(noutlu,2400) omess
135  ENDIF
136  zwork21 = pfield(kin:kix,kjn:kjx)
137  DO jl = kjx-kjn+1,1,-1
138  IF (ktab==0) THEN
139  IF(lwg) WRITE(noutlu,1300) kjn-1+jl,zwork21(:,jl)
140  ELSE
141  IF(lwg) WRITE(noutlu,2300) kjn-1+jl,zwork21(:,jl)
142  ENDIF
143  END DO
144  IF(lwg) WRITE(noutlu,*) ' '
145 
146 ! * Deallocate work array
147  DEALLOCATE(zwork21)
148  ENDIF
149 
150 ! *** Formats
151 1300 FORMAT(6x,i3,10(1x,e10.4))
152 1400 FORMAT(6x,a)
153 2300 FORMAT(55x,i3,10(1x,e10.4))
154 2400 FORMAT(55x,a)
155 !
156 END SUBROUTINE glt_prtrarr2
157 
158 ! ----------------------- END SUBROUTINE glt_prtrarr2 -----------------------
159 ! -----------------------------------------------------------------------
160 
161 
162 ! -----------------------------------------------------------------------
163 ! ------------------------- SUBROUTINE glt_prtrarr3 -------------------------
164 !
165 SUBROUTINE glt_prtrarr3(omess,pfield,klay,kin,kix,kjn,kjx,ktab)
166 !
167  USE modd_glt_param
168 !
169  IMPLICIT NONE
170  CHARACTER(*), INTENT(in) :: &
171  omess
172  REAL, DIMENSION(:,:,:), INTENT(in) :: &
173  pfield
174  INTEGER, INTENT(in) :: &
175  klay
176  INTEGER, INTENT(in) :: &
177  kin,kix,kjn,kjx
178  INTEGER, INTENT(in) :: &
179  ktab
180  INTEGER :: &
181  jl
182  INTEGER :: &
183  kx,ky,kz
184  REAL, DIMENSION(:,:), ALLOCATABLE :: &
185  zwork21
186 
187 
188 ! *** Get input array dimensions
189  kx = SIZE(pfield,2)
190  ky = SIZE(pfield,3)
191  kz = SIZE(pfield,1)
192 
193 ! *** Test specified array sections vs array dimensions
194  IF (kix<1 .OR. kix>kx .OR. kjx<1 .OR. kjx>ky .OR. &
195  kin<1 .OR. kin>kx .OR. kjn<1 .OR. kjn>ky .OR. &
196  klay<1 .OR. klay>kz .OR. kix<kin .OR. kjx<kjn) THEN
197  IF(lwg) WRITE(noutlu,*) ' *** WARNING ***'
198  IF(lwg) WRITE(noutlu,*) ' glt_prtrarr3 : check array section boundaries'
199  IF(lwg) WRITE(noutlu,*) ' '
200  ELSE
201 ! * Allocate work array
202  ALLOCATE(zwork21(kix-kin+1,kjx-kjn+1))
203 
204 ! * Print requested information
205  IF (ktab==0) THEN
206  IF(lwg) WRITE(noutlu,1400) omess,klay
207  ELSE
208  IF(lwg) WRITE(noutlu,2400) omess,klay
209  ENDIF
210  zwork21 = pfield(klay,kin:kix,kjn:kjx)
211  DO jl = kjx-kjn+1,1,-1
212  IF (ktab==0) THEN
213  IF(lwg) WRITE(noutlu,1300) kjn-1+jl,zwork21(:,jl)
214  ELSE
215  IF(lwg) WRITE(noutlu,2300) kjn-1+jl,zwork21(:,jl)
216  ENDIF
217  END DO
218  IF(lwg) WRITE(noutlu,*) ' '
219 
220 ! * Deallocate work array
221  DEALLOCATE(zwork21)
222  ENDIF
223 
224 ! *** Formats
225 1300 FORMAT(6x,i3,5(1x,e10.4))
226 1400 FORMAT(6x,a," - thk = ",i3)
227 2300 FORMAT(55x,i3,5(1x,e10.4))
228 2400 FORMAT(55x,a," - thk = ",i3)
229 !
230 END SUBROUTINE glt_prtrarr3
231 
232 ! ----------------------- END SUBROUTINE glt_prtrarr3 -----------------------
233 ! -----------------------------------------------------------------------
subroutine glt_prtrarr2(omess, pfield, kin, kix, kjn, kjx, ktab)
subroutine glt_prtrarr3(omess, pfield, klay, kin, kix, kjn, kjx, ktab)