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