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