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