[1] | 1 | SUBROUTINE write_3d_binary |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
[484] | 4 | ! Current revisions: |
---|
[1] | 5 | ! ----------------- |
---|
[1001] | 6 | ! all actions concerning leapfrog scheme removed |
---|
[1] | 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
[3] | 10 | ! $Id: write_3d_binary.f90 1001 2012-09-13 14:08:46Z raasch $ |
---|
[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 ) 'iran '; WRITE ( 14 ) iran, iran_part |
---|
| 107 | WRITE ( 14 ) 'kh '; WRITE ( 14 ) kh |
---|
| 108 | WRITE ( 14 ) 'km '; WRITE ( 14 ) km |
---|
[771] | 109 | IF ( ALLOCATED( lpt_av ) ) THEN |
---|
| 110 | WRITE ( 14 ) 'lpt_av '; WRITE ( 14 ) lpt_av |
---|
| 111 | ENDIF |
---|
[1] | 112 | IF ( ALLOCATED( lwp_av ) ) THEN |
---|
| 113 | WRITE ( 14 ) 'lwp_av '; WRITE ( 14 ) lwp_av |
---|
| 114 | ENDIF |
---|
| 115 | WRITE ( 14 ) 'p '; WRITE ( 14 ) p |
---|
| 116 | IF ( ALLOCATED( p_av ) ) THEN |
---|
| 117 | WRITE ( 14 ) 'p_av '; WRITE ( 14 ) p_av |
---|
| 118 | ENDIF |
---|
| 119 | IF ( ALLOCATED( pc_av ) ) THEN |
---|
| 120 | WRITE ( 14 ) 'pc_av '; WRITE ( 14 ) pc_av |
---|
| 121 | ENDIF |
---|
| 122 | IF ( ALLOCATED( pr_av ) ) THEN |
---|
| 123 | WRITE ( 14 ) 'pr_av '; WRITE ( 14 ) pr_av |
---|
| 124 | ENDIF |
---|
[72] | 125 | IF ( ALLOCATED( precipitation_amount ) ) THEN |
---|
| 126 | WRITE ( 14 ) 'precipitation_amount'; WRITE ( 14 ) precipitation_amount |
---|
| 127 | ENDIF |
---|
| 128 | IF ( ALLOCATED( precipitation_rate_av ) ) THEN |
---|
| 129 | WRITE ( 14 ) 'precipitation_rate_a'; WRITE ( 14 ) & |
---|
| 130 | precipitation_rate_av |
---|
| 131 | ENDIF |
---|
[1] | 132 | WRITE ( 14 ) 'pt '; WRITE ( 14 ) pt |
---|
| 133 | IF ( ALLOCATED( pt_av ) ) THEN |
---|
| 134 | WRITE ( 14 ) 'pt_av '; WRITE ( 14 ) pt_av |
---|
| 135 | ENDIF |
---|
[75] | 136 | IF ( humidity .OR. passive_scalar ) THEN |
---|
[1] | 137 | WRITE ( 14 ) 'q '; WRITE ( 14 ) q |
---|
| 138 | IF ( ALLOCATED( q_av ) ) THEN |
---|
| 139 | WRITE ( 14 ) 'q_av '; WRITE ( 14 ) q_av |
---|
| 140 | ENDIF |
---|
[790] | 141 | IF ( cloud_physics .OR. cloud_droplets ) THEN |
---|
[1] | 142 | WRITE ( 14 ) 'ql '; WRITE ( 14 ) ql |
---|
| 143 | IF ( ALLOCATED( ql_av ) ) THEN |
---|
| 144 | WRITE ( 14 ) 'ql_av '; WRITE ( 14 ) ql_av |
---|
| 145 | ENDIF |
---|
| 146 | ENDIF |
---|
| 147 | WRITE ( 14 ) 'qs '; WRITE ( 14 ) qs |
---|
| 148 | WRITE ( 14 ) 'qsws '; WRITE ( 14 ) qsws |
---|
[354] | 149 | IF ( ALLOCATED( qsws_av ) ) THEN |
---|
| 150 | WRITE ( 14 ) 'qsws_av '; WRITE ( 14 ) qsws_av |
---|
| 151 | ENDIF |
---|
[19] | 152 | WRITE ( 14 ) 'qswst '; WRITE ( 14 ) qswst |
---|
[1] | 153 | ENDIF |
---|
[94] | 154 | IF ( ocean ) THEN |
---|
[96] | 155 | IF ( ALLOCATED( rho_av ) ) THEN |
---|
| 156 | WRITE ( 14 ) 'rho_av '; WRITE ( 14 ) rho_av |
---|
| 157 | ENDIF |
---|
[94] | 158 | WRITE ( 14 ) 'sa '; WRITE ( 14 ) sa |
---|
[96] | 159 | IF ( ALLOCATED( sa_av ) ) THEN |
---|
| 160 | WRITE ( 14 ) 'sa_av '; WRITE ( 14 ) sa_av |
---|
| 161 | ENDIF |
---|
[95] | 162 | WRITE ( 14 ) 'saswsb '; WRITE ( 14 ) saswsb |
---|
[94] | 163 | WRITE ( 14 ) 'saswst '; WRITE ( 14 ) saswst |
---|
| 164 | ENDIF |
---|
[1] | 165 | IF ( ALLOCATED( ql_c_av ) ) THEN |
---|
| 166 | WRITE ( 14 ) 'ql_c_av '; WRITE ( 14 ) ql_c_av |
---|
| 167 | ENDIF |
---|
| 168 | IF ( ALLOCATED( ql_v_av ) ) THEN |
---|
| 169 | WRITE ( 14 ) 'ql_v_av '; WRITE ( 14 ) ql_v_av |
---|
| 170 | ENDIF |
---|
| 171 | IF ( ALLOCATED( ql_vp_av ) ) THEN |
---|
| 172 | WRITE ( 14 ) 'ql_vp_av '; WRITE ( 14 ) ql_vp_av |
---|
| 173 | ENDIF |
---|
| 174 | IF ( ALLOCATED( qv_av ) ) THEN |
---|
| 175 | WRITE ( 14 ) 'qv_av '; WRITE ( 14 ) qv_av |
---|
| 176 | ENDIF |
---|
| 177 | WRITE ( 14 ) 'random_iv '; WRITE ( 14 ) random_iv |
---|
| 178 | WRITE ( 14 ) random_iy |
---|
| 179 | WRITE ( 14 ) 'rif '; WRITE ( 14 ) rif |
---|
[51] | 180 | IF ( topography /= 'flat' ) THEN |
---|
| 181 | WRITE ( 14 ) 'rif_wall '; WRITE ( 14 ) rif_wall |
---|
| 182 | ENDIF |
---|
[1] | 183 | IF ( ALLOCATED( s_av ) ) THEN |
---|
| 184 | WRITE ( 14 ) 's_av '; WRITE ( 14 ) s_av |
---|
| 185 | ENDIF |
---|
| 186 | WRITE ( 14 ) 'shf '; WRITE ( 14 ) shf |
---|
[354] | 187 | IF ( ALLOCATED( shf_av ) ) THEN |
---|
| 188 | WRITE ( 14 ) 'shf_av '; WRITE ( 14 ) shf_av |
---|
| 189 | ENDIF |
---|
[143] | 190 | IF ( ALLOCATED( spectrum_x ) ) THEN |
---|
| 191 | WRITE ( 14 ) 'spectrum_x '; WRITE ( 14 ) spectrum_x |
---|
| 192 | WRITE ( 14 ) 'spectrum_y '; WRITE ( 14 ) spectrum_y |
---|
| 193 | ENDIF |
---|
[1] | 194 | WRITE ( 14 ) 'ts '; WRITE ( 14 ) ts |
---|
| 195 | IF ( ALLOCATED( ts_av ) ) THEN |
---|
| 196 | WRITE ( 14 ) 'ts_av '; WRITE ( 14 ) ts_av |
---|
| 197 | ENDIF |
---|
[19] | 198 | WRITE ( 14 ) 'tswst '; WRITE ( 14 ) tswst |
---|
[1] | 199 | WRITE ( 14 ) 'u '; WRITE ( 14 ) u |
---|
| 200 | IF ( ALLOCATED( u_av ) ) THEN |
---|
| 201 | WRITE ( 14 ) 'u_av '; WRITE ( 14 ) u_av |
---|
| 202 | ENDIF |
---|
[73] | 203 | IF ( ALLOCATED( u_m_l ) ) THEN |
---|
| 204 | WRITE ( 14 ) 'u_m_l '; WRITE ( 14 ) u_m_l |
---|
| 205 | ENDIF |
---|
| 206 | IF ( ALLOCATED( u_m_n ) ) THEN |
---|
| 207 | WRITE ( 14 ) 'u_m_n '; WRITE ( 14 ) u_m_n |
---|
| 208 | ENDIF |
---|
| 209 | IF ( ALLOCATED( u_m_r ) ) THEN |
---|
| 210 | WRITE ( 14 ) 'u_m_r '; WRITE ( 14 ) u_m_r |
---|
| 211 | ENDIF |
---|
| 212 | IF ( ALLOCATED( u_m_s ) ) THEN |
---|
| 213 | WRITE ( 14 ) 'u_m_s '; WRITE ( 14 ) u_m_s |
---|
| 214 | ENDIF |
---|
[1] | 215 | WRITE ( 14 ) 'us '; WRITE ( 14 ) us |
---|
| 216 | WRITE ( 14 ) 'usws '; WRITE ( 14 ) usws |
---|
[102] | 217 | WRITE ( 14 ) 'uswst '; WRITE ( 14 ) uswst |
---|
[1] | 218 | IF ( ALLOCATED( us_av ) ) THEN |
---|
| 219 | WRITE ( 14 ) 'us_av '; WRITE ( 14 ) us_av |
---|
| 220 | ENDIF |
---|
| 221 | WRITE ( 14 ) 'v '; WRITE ( 14 ) v |
---|
| 222 | IF ( ALLOCATED( v_av ) ) THEN |
---|
| 223 | WRITE ( 14 ) 'v_av '; WRITE ( 14 ) v_av |
---|
| 224 | ENDIF |
---|
[73] | 225 | IF ( ALLOCATED( v_m_l ) ) THEN |
---|
| 226 | WRITE ( 14 ) 'v_m_l '; WRITE ( 14 ) v_m_l |
---|
| 227 | ENDIF |
---|
| 228 | IF ( ALLOCATED( v_m_n ) ) THEN |
---|
| 229 | WRITE ( 14 ) 'v_m_n '; WRITE ( 14 ) v_m_n |
---|
| 230 | ENDIF |
---|
| 231 | IF ( ALLOCATED( v_m_r ) ) THEN |
---|
| 232 | WRITE ( 14 ) 'v_m_r '; WRITE ( 14 ) v_m_r |
---|
| 233 | ENDIF |
---|
| 234 | IF ( ALLOCATED( v_m_s ) ) THEN |
---|
| 235 | WRITE ( 14 ) 'v_m_s '; WRITE ( 14 ) v_m_s |
---|
| 236 | ENDIF |
---|
[75] | 237 | IF ( humidity ) THEN |
---|
[1] | 238 | WRITE ( 14 ) 'vpt '; WRITE ( 14 ) vpt |
---|
| 239 | IF ( ALLOCATED( vpt_av ) ) THEN |
---|
| 240 | WRITE ( 14 ) 'vpt_av '; WRITE ( 14 ) vpt_av |
---|
| 241 | ENDIF |
---|
| 242 | ENDIF |
---|
| 243 | WRITE ( 14 ) 'vsws '; WRITE ( 14 ) vsws |
---|
[102] | 244 | WRITE ( 14 ) 'vswst '; WRITE ( 14 ) vswst |
---|
[1] | 245 | WRITE ( 14 ) 'w '; WRITE ( 14 ) w |
---|
| 246 | IF ( ALLOCATED( w_av ) ) THEN |
---|
| 247 | WRITE ( 14 ) 'w_av '; WRITE ( 14 ) w_av |
---|
| 248 | ENDIF |
---|
[73] | 249 | IF ( ALLOCATED( w_m_l ) ) THEN |
---|
| 250 | WRITE ( 14 ) 'w_m_l '; WRITE ( 14 ) w_m_l |
---|
| 251 | ENDIF |
---|
| 252 | IF ( ALLOCATED( w_m_n ) ) THEN |
---|
| 253 | WRITE ( 14 ) 'w_m_n '; WRITE ( 14 ) w_m_n |
---|
| 254 | ENDIF |
---|
| 255 | IF ( ALLOCATED( w_m_r ) ) THEN |
---|
| 256 | WRITE ( 14 ) 'w_m_r '; WRITE ( 14 ) w_m_r |
---|
| 257 | ENDIF |
---|
| 258 | IF ( ALLOCATED( w_m_s ) ) THEN |
---|
| 259 | WRITE ( 14 ) 'w_m_s '; WRITE ( 14 ) w_m_s |
---|
| 260 | ENDIF |
---|
[1] | 261 | WRITE ( 14 ) 'z0 '; WRITE ( 14 ) z0 |
---|
[72] | 262 | IF ( ALLOCATED( z0_av ) ) THEN |
---|
| 263 | WRITE ( 14 ) 'z0_av '; WRITE ( 14 ) z0_av |
---|
| 264 | ENDIF |
---|
[978] | 265 | WRITE ( 14 ) 'z0h '; WRITE ( 14 ) z0h |
---|
| 266 | IF ( ALLOCATED( z0h_av ) ) THEN |
---|
| 267 | WRITE ( 14 ) 'z0h_av '; WRITE ( 14 ) z0h_av |
---|
| 268 | ENDIF |
---|
[1] | 269 | |
---|
| 270 | ! |
---|
| 271 | !-- Write end label. Unit 14 is closed in the main program. |
---|
| 272 | WRITE ( 14 ) '*** end *** ' |
---|
| 273 | |
---|
| 274 | END SUBROUTINE write_3d_binary |
---|