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