[1] | 1 | SUBROUTINE write_3d_binary |
---|
| 2 | |
---|
[1036] | 3 | !--------------------------------------------------------------------------------! |
---|
| 4 | ! This file is part of PALM. |
---|
| 5 | ! |
---|
| 6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 8 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
| 17 | ! Copyright 1997-2012 Leibniz University Hannover |
---|
| 18 | !--------------------------------------------------------------------------------! |
---|
| 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
| 22 | ! |
---|
| 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
[3] | 25 | ! $Id: write_3d_binary.f90 1054 2012-11-13 17:30:09Z hoffmann $ |
---|
[39] | 26 | ! |
---|
[1054] | 27 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 28 | ! necessary expansions according to the two new prognostic equations (nr, qr) |
---|
| 29 | ! of the two-moment cloud physics scheme: |
---|
| 30 | ! +prr, prr_av, *, *_av, *s, *sws, *swst |
---|
| 31 | ! |
---|
[1037] | 32 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 33 | ! code put under GPL (PALM 3.9) |
---|
| 34 | ! |
---|
[1002] | 35 | ! 1001 2012-09-13 14:08:46Z raasch |
---|
| 36 | ! all actions concerning leapfrog- and ups-scheme removed |
---|
| 37 | ! |
---|
[979] | 38 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 39 | ! +z0h, z0h_av |
---|
| 40 | ! |
---|
[791] | 41 | ! 790 2011-11-29 03:11:20Z raasch |
---|
| 42 | ! bugfix: output of 'ql' also if cloud droplets are used |
---|
| 43 | ! |
---|
[777] | 44 | ! 776 2011-10-31 08:02:51Z heinze |
---|
| 45 | ! bugfix: increase binary_version due to last commit |
---|
| 46 | ! |
---|
[772] | 47 | ! 771 2011-10-27 10:56:21Z heinze |
---|
| 48 | ! +lpt |
---|
| 49 | ! |
---|
[760] | 50 | ! 759 2011-09-15 13:58:31Z raasch |
---|
| 51 | ! cpu measurement and file opening moved to main program |
---|
| 52 | ! |
---|
[588] | 53 | ! 587 2010-10-27 08:36:51Z helmke |
---|
| 54 | ! nothing done but text written for "Current revisions" by mistake |
---|
| 55 | ! |
---|
[392] | 56 | ! 367 2009-08-25 08:35:52Z maronga |
---|
| 57 | ! +shf_av, qsws_av |
---|
| 58 | ! |
---|
[198] | 59 | ! 145 2008-01-09 08:17:38Z raasch |
---|
| 60 | ! write_var_list is only called for pe0, -dopr_time_count, |
---|
| 61 | ! hom_sum moved, volume_flow_area, volume_flow_initial moved to write_var_list, |
---|
| 62 | ! writing of old profil parameters (cross_..., dopr_crossindex, profile_***) |
---|
| 63 | ! removed |
---|
| 64 | ! |
---|
[110] | 65 | ! 102 2007-07-27 09:09:17Z raasch |
---|
| 66 | ! +uswst, uswst_m, vswst, vswst_m |
---|
| 67 | ! |
---|
[98] | 68 | ! 96 2007-06-04 08:07:41Z raasch |
---|
| 69 | ! +rho_av, sa, sa_av, saswsb, saswst |
---|
| 70 | ! |
---|
[77] | 71 | ! 75 2007-03-22 09:54:05Z raasch |
---|
| 72 | ! +precipitation_amount, precipitation_rate_av, rif_wall, u_m_l, u_m_r, etc., |
---|
| 73 | ! z0_av, moisture renamed humidity |
---|
| 74 | ! |
---|
[39] | 75 | ! 19 2007-02-23 04:53:48Z raasch |
---|
| 76 | ! +qswst, qswst_m, tswst, tswst_m |
---|
| 77 | ! |
---|
[3] | 78 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 79 | ! |
---|
[1] | 80 | ! Revision 1.21 2006/08/04 15:05:11 raasch |
---|
| 81 | ! +iran, iran_part |
---|
| 82 | ! |
---|
| 83 | ! Revision 1.1 1998/03/18 20:20:21 raasch |
---|
| 84 | ! Initial revision |
---|
| 85 | ! |
---|
| 86 | ! |
---|
| 87 | ! Description: |
---|
| 88 | ! ------------ |
---|
| 89 | ! Binary output of variables and arrays for restarts. |
---|
| 90 | !------------------------------------------------------------------------------! |
---|
| 91 | |
---|
| 92 | USE arrays_3d |
---|
| 93 | USE averaging |
---|
[72] | 94 | USE cloud_parameters |
---|
[1] | 95 | USE control_parameters |
---|
| 96 | USE cpulog |
---|
| 97 | USE indices |
---|
| 98 | USE interfaces |
---|
| 99 | USE particle_attributes |
---|
| 100 | USE pegrid |
---|
| 101 | USE profil_parameter |
---|
| 102 | USE random_function_mod |
---|
| 103 | USE statistics |
---|
| 104 | |
---|
| 105 | IMPLICIT NONE |
---|
| 106 | |
---|
| 107 | CHARACTER (LEN=10) :: binary_version |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | ! |
---|
| 111 | !-- Write control parameters and other variables for restart. |
---|
[143] | 112 | IF ( myid == 0 ) CALL write_var_list |
---|
[1] | 113 | |
---|
| 114 | ! |
---|
| 115 | !-- Write arrays. |
---|
[1053] | 116 | binary_version = '3.3' |
---|
[1] | 117 | |
---|
| 118 | WRITE ( 14 ) binary_version |
---|
| 119 | |
---|
| 120 | WRITE ( 14 ) numprocs, myid, nxl, nxr, nys, nyn, nzb, nzt |
---|
| 121 | |
---|
| 122 | ! |
---|
| 123 | !-- Attention: After changes to the following output commands the version number |
---|
| 124 | !-- --------- of the variable binary_version must be changed! |
---|
| 125 | !-- Also, the list of arrays to be read in read_3d_binary must be |
---|
| 126 | !-- adjusted accordingly. |
---|
| 127 | |
---|
| 128 | WRITE ( 14 ) 'e '; WRITE ( 14 ) e |
---|
| 129 | IF ( ALLOCATED( e_av ) ) THEN |
---|
| 130 | WRITE ( 14 ) 'e_av '; WRITE ( 14 ) e_av |
---|
| 131 | ENDIF |
---|
| 132 | WRITE ( 14 ) 'iran '; WRITE ( 14 ) iran, iran_part |
---|
| 133 | WRITE ( 14 ) 'kh '; WRITE ( 14 ) kh |
---|
| 134 | WRITE ( 14 ) 'km '; WRITE ( 14 ) km |
---|
[771] | 135 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
| 136 | WRITE ( 14 ) 'lpt_av '; WRITE ( 14 ) lpt_av |
---|
| 137 | ENDIF |
---|
[1] | 138 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
| 139 | WRITE ( 14 ) 'lwp_av '; WRITE ( 14 ) lwp_av |
---|
| 140 | ENDIF |
---|
| 141 | WRITE ( 14 ) 'p '; WRITE ( 14 ) p |
---|
| 142 | IF ( ALLOCATED( p_av ) ) THEN |
---|
| 143 | WRITE ( 14 ) 'p_av '; WRITE ( 14 ) p_av |
---|
| 144 | ENDIF |
---|
| 145 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
| 146 | WRITE ( 14 ) 'pc_av '; WRITE ( 14 ) pc_av |
---|
| 147 | ENDIF |
---|
| 148 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
| 149 | WRITE ( 14 ) 'pr_av '; WRITE ( 14 ) pr_av |
---|
| 150 | ENDIF |
---|
[1053] | 151 | IF ( ALLOCATED( prr ) ) THEN |
---|
| 152 | WRITE ( 14 ) 'prr '; WRITE ( 14 ) prr |
---|
| 153 | ENDIF |
---|
| 154 | IF ( ALLOCATED( prr_av ) ) THEN |
---|
| 155 | WRITE ( 14 ) 'prr_av '; WRITE ( 14 ) prr_av |
---|
| 156 | ENDIF |
---|
[72] | 157 | IF ( ALLOCATED( precipitation_amount ) ) THEN |
---|
| 158 | WRITE ( 14 ) 'precipitation_amount'; WRITE ( 14 ) precipitation_amount |
---|
| 159 | ENDIF |
---|
| 160 | IF ( ALLOCATED( precipitation_rate_av ) ) THEN |
---|
| 161 | WRITE ( 14 ) 'precipitation_rate_a'; WRITE ( 14 ) & |
---|
| 162 | precipitation_rate_av |
---|
| 163 | ENDIF |
---|
[1] | 164 | WRITE ( 14 ) 'pt '; WRITE ( 14 ) pt |
---|
| 165 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
| 166 | WRITE ( 14 ) 'pt_av '; WRITE ( 14 ) pt_av |
---|
| 167 | ENDIF |
---|
[75] | 168 | IF ( humidity .OR. passive_scalar ) THEN |
---|
[1] | 169 | WRITE ( 14 ) 'q '; WRITE ( 14 ) q |
---|
| 170 | IF ( ALLOCATED( q_av ) ) THEN |
---|
| 171 | WRITE ( 14 ) 'q_av '; WRITE ( 14 ) q_av |
---|
| 172 | ENDIF |
---|
[790] | 173 | IF ( cloud_physics .OR. cloud_droplets ) THEN |
---|
[1] | 174 | WRITE ( 14 ) 'ql '; WRITE ( 14 ) ql |
---|
| 175 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
| 176 | WRITE ( 14 ) 'ql_av '; WRITE ( 14 ) ql_av |
---|
| 177 | ENDIF |
---|
[1053] | 178 | IF ( icloud_scheme == 0 ) THEN |
---|
| 179 | WRITE ( 14 ) 'qr '; WRITE ( 14 ) qr |
---|
| 180 | WRITE ( 14 ) 'nr '; WRITE ( 14 ) nr |
---|
| 181 | IF ( ALLOCATED( qr_av ) ) THEN |
---|
| 182 | WRITE ( 14 ) 'qr_av '; WRITE ( 14 ) qr_av |
---|
| 183 | ENDIF |
---|
| 184 | IF ( ALLOCATED( nr_av ) ) THEN |
---|
| 185 | WRITE ( 14 ) 'nr_av '; WRITE ( 14 ) nr_av |
---|
| 186 | ENDIF |
---|
| 187 | WRITE ( 14 ) 'qrs '; WRITE ( 14 ) qrs |
---|
| 188 | WRITE ( 14 ) 'qrsws '; WRITE ( 14 ) qrsws |
---|
| 189 | WRITE ( 14 ) 'qrswst '; WRITE ( 14 ) qrswst |
---|
| 190 | WRITE ( 14 ) 'nrs '; WRITE ( 14 ) nrs |
---|
| 191 | WRITE ( 14 ) 'nrsws '; WRITE ( 14 ) nrsws |
---|
| 192 | WRITE ( 14 ) 'nrswst '; WRITE ( 14 ) nrswst |
---|
| 193 | ENDIF |
---|
[1] | 194 | ENDIF |
---|
| 195 | WRITE ( 14 ) 'qs '; WRITE ( 14 ) qs |
---|
| 196 | WRITE ( 14 ) 'qsws '; WRITE ( 14 ) qsws |
---|
[354] | 197 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
| 198 | WRITE ( 14 ) 'qsws_av '; WRITE ( 14 ) qsws_av |
---|
| 199 | ENDIF |
---|
[19] | 200 | WRITE ( 14 ) 'qswst '; WRITE ( 14 ) qswst |
---|
[1] | 201 | ENDIF |
---|
[94] | 202 | IF ( ocean ) THEN |
---|
[96] | 203 | IF ( ALLOCATED( rho_av ) ) THEN |
---|
| 204 | WRITE ( 14 ) 'rho_av '; WRITE ( 14 ) rho_av |
---|
| 205 | ENDIF |
---|
[94] | 206 | WRITE ( 14 ) 'sa '; WRITE ( 14 ) sa |
---|
[96] | 207 | IF ( ALLOCATED( sa_av ) ) THEN |
---|
| 208 | WRITE ( 14 ) 'sa_av '; WRITE ( 14 ) sa_av |
---|
| 209 | ENDIF |
---|
[95] | 210 | WRITE ( 14 ) 'saswsb '; WRITE ( 14 ) saswsb |
---|
[94] | 211 | WRITE ( 14 ) 'saswst '; WRITE ( 14 ) saswst |
---|
| 212 | ENDIF |
---|
[1] | 213 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
| 214 | WRITE ( 14 ) 'ql_c_av '; WRITE ( 14 ) ql_c_av |
---|
| 215 | ENDIF |
---|
| 216 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
| 217 | WRITE ( 14 ) 'ql_v_av '; WRITE ( 14 ) ql_v_av |
---|
| 218 | ENDIF |
---|
| 219 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
| 220 | WRITE ( 14 ) 'ql_vp_av '; WRITE ( 14 ) ql_vp_av |
---|
| 221 | ENDIF |
---|
| 222 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
| 223 | WRITE ( 14 ) 'qv_av '; WRITE ( 14 ) qv_av |
---|
| 224 | ENDIF |
---|
| 225 | WRITE ( 14 ) 'random_iv '; WRITE ( 14 ) random_iv |
---|
| 226 | WRITE ( 14 ) random_iy |
---|
| 227 | WRITE ( 14 ) 'rif '; WRITE ( 14 ) rif |
---|
[51] | 228 | IF ( topography /= 'flat' ) THEN |
---|
| 229 | WRITE ( 14 ) 'rif_wall '; WRITE ( 14 ) rif_wall |
---|
| 230 | ENDIF |
---|
[1] | 231 | IF ( ALLOCATED( s_av ) ) THEN |
---|
| 232 | WRITE ( 14 ) 's_av '; WRITE ( 14 ) s_av |
---|
| 233 | ENDIF |
---|
| 234 | WRITE ( 14 ) 'shf '; WRITE ( 14 ) shf |
---|
[354] | 235 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
| 236 | WRITE ( 14 ) 'shf_av '; WRITE ( 14 ) shf_av |
---|
| 237 | ENDIF |
---|
[143] | 238 | IF ( ALLOCATED( spectrum_x ) ) THEN |
---|
| 239 | WRITE ( 14 ) 'spectrum_x '; WRITE ( 14 ) spectrum_x |
---|
| 240 | WRITE ( 14 ) 'spectrum_y '; WRITE ( 14 ) spectrum_y |
---|
| 241 | ENDIF |
---|
[1] | 242 | WRITE ( 14 ) 'ts '; WRITE ( 14 ) ts |
---|
| 243 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
| 244 | WRITE ( 14 ) 'ts_av '; WRITE ( 14 ) ts_av |
---|
| 245 | ENDIF |
---|
[19] | 246 | WRITE ( 14 ) 'tswst '; WRITE ( 14 ) tswst |
---|
[1] | 247 | WRITE ( 14 ) 'u '; WRITE ( 14 ) u |
---|
| 248 | IF ( ALLOCATED( u_av ) ) THEN |
---|
| 249 | WRITE ( 14 ) 'u_av '; WRITE ( 14 ) u_av |
---|
| 250 | ENDIF |
---|
[73] | 251 | IF ( ALLOCATED( u_m_l ) ) THEN |
---|
| 252 | WRITE ( 14 ) 'u_m_l '; WRITE ( 14 ) u_m_l |
---|
| 253 | ENDIF |
---|
| 254 | IF ( ALLOCATED( u_m_n ) ) THEN |
---|
| 255 | WRITE ( 14 ) 'u_m_n '; WRITE ( 14 ) u_m_n |
---|
| 256 | ENDIF |
---|
| 257 | IF ( ALLOCATED( u_m_r ) ) THEN |
---|
| 258 | WRITE ( 14 ) 'u_m_r '; WRITE ( 14 ) u_m_r |
---|
| 259 | ENDIF |
---|
| 260 | IF ( ALLOCATED( u_m_s ) ) THEN |
---|
| 261 | WRITE ( 14 ) 'u_m_s '; WRITE ( 14 ) u_m_s |
---|
| 262 | ENDIF |
---|
[1] | 263 | WRITE ( 14 ) 'us '; WRITE ( 14 ) us |
---|
| 264 | WRITE ( 14 ) 'usws '; WRITE ( 14 ) usws |
---|
[102] | 265 | WRITE ( 14 ) 'uswst '; WRITE ( 14 ) uswst |
---|
[1] | 266 | IF ( ALLOCATED( us_av ) ) THEN |
---|
| 267 | WRITE ( 14 ) 'us_av '; WRITE ( 14 ) us_av |
---|
| 268 | ENDIF |
---|
| 269 | WRITE ( 14 ) 'v '; WRITE ( 14 ) v |
---|
| 270 | IF ( ALLOCATED( v_av ) ) THEN |
---|
| 271 | WRITE ( 14 ) 'v_av '; WRITE ( 14 ) v_av |
---|
| 272 | ENDIF |
---|
[73] | 273 | IF ( ALLOCATED( v_m_l ) ) THEN |
---|
| 274 | WRITE ( 14 ) 'v_m_l '; WRITE ( 14 ) v_m_l |
---|
| 275 | ENDIF |
---|
| 276 | IF ( ALLOCATED( v_m_n ) ) THEN |
---|
| 277 | WRITE ( 14 ) 'v_m_n '; WRITE ( 14 ) v_m_n |
---|
| 278 | ENDIF |
---|
| 279 | IF ( ALLOCATED( v_m_r ) ) THEN |
---|
| 280 | WRITE ( 14 ) 'v_m_r '; WRITE ( 14 ) v_m_r |
---|
| 281 | ENDIF |
---|
| 282 | IF ( ALLOCATED( v_m_s ) ) THEN |
---|
| 283 | WRITE ( 14 ) 'v_m_s '; WRITE ( 14 ) v_m_s |
---|
| 284 | ENDIF |
---|
[75] | 285 | IF ( humidity ) THEN |
---|
[1] | 286 | WRITE ( 14 ) 'vpt '; WRITE ( 14 ) vpt |
---|
| 287 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
| 288 | WRITE ( 14 ) 'vpt_av '; WRITE ( 14 ) vpt_av |
---|
| 289 | ENDIF |
---|
| 290 | ENDIF |
---|
| 291 | WRITE ( 14 ) 'vsws '; WRITE ( 14 ) vsws |
---|
[102] | 292 | WRITE ( 14 ) 'vswst '; WRITE ( 14 ) vswst |
---|
[1] | 293 | WRITE ( 14 ) 'w '; WRITE ( 14 ) w |
---|
| 294 | IF ( ALLOCATED( w_av ) ) THEN |
---|
| 295 | WRITE ( 14 ) 'w_av '; WRITE ( 14 ) w_av |
---|
| 296 | ENDIF |
---|
[73] | 297 | IF ( ALLOCATED( w_m_l ) ) THEN |
---|
| 298 | WRITE ( 14 ) 'w_m_l '; WRITE ( 14 ) w_m_l |
---|
| 299 | ENDIF |
---|
| 300 | IF ( ALLOCATED( w_m_n ) ) THEN |
---|
| 301 | WRITE ( 14 ) 'w_m_n '; WRITE ( 14 ) w_m_n |
---|
| 302 | ENDIF |
---|
| 303 | IF ( ALLOCATED( w_m_r ) ) THEN |
---|
| 304 | WRITE ( 14 ) 'w_m_r '; WRITE ( 14 ) w_m_r |
---|
| 305 | ENDIF |
---|
| 306 | IF ( ALLOCATED( w_m_s ) ) THEN |
---|
| 307 | WRITE ( 14 ) 'w_m_s '; WRITE ( 14 ) w_m_s |
---|
| 308 | ENDIF |
---|
[1] | 309 | WRITE ( 14 ) 'z0 '; WRITE ( 14 ) z0 |
---|
[72] | 310 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
| 311 | WRITE ( 14 ) 'z0_av '; WRITE ( 14 ) z0_av |
---|
| 312 | ENDIF |
---|
[978] | 313 | WRITE ( 14 ) 'z0h '; WRITE ( 14 ) z0h |
---|
| 314 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
| 315 | WRITE ( 14 ) 'z0h_av '; WRITE ( 14 ) z0h_av |
---|
| 316 | ENDIF |
---|
[1] | 317 | |
---|
| 318 | ! |
---|
| 319 | !-- Write end label. Unit 14 is closed in the main program. |
---|
| 320 | WRITE ( 14 ) '*** end *** ' |
---|
| 321 | |
---|
| 322 | END SUBROUTINE write_3d_binary |
---|