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