SUBROUTINE write_3d_binary !------------------------------------------------------------------------------! ! Actual revisions: ! ----------------- ! write_var_list is only called for pe0 ! -dopr_time_count, ! hom_sum moved, volume_flow_area, volume_flow_initial moved to write_var_list, ! writing of old profil parameters (cross_..., dopr_crossindex, profile_***) ! removed ! ! Former revisions: ! ----------------- ! $Id: write_3d_binary.f90 145 2008-01-09 08:17:38Z letzel $ ! ! 102 2007-07-27 09:09:17Z raasch ! +uswst, uswst_m, vswst, vswst_m ! ! 96 2007-06-04 08:07:41Z raasch ! +rho_av, sa, sa_av, saswsb, saswst ! ! 75 2007-03-22 09:54:05Z raasch ! +precipitation_amount, precipitation_rate_av, rif_wall, u_m_l, u_m_r, etc., ! z0_av, moisture renamed humidity ! ! 19 2007-02-23 04:53:48Z raasch ! +qswst, qswst_m, tswst, tswst_m ! ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.21 2006/08/04 15:05:11 raasch ! +iran, iran_part ! ! Revision 1.1 1998/03/18 20:20:21 raasch ! Initial revision ! ! ! Description: ! ------------ ! Binary output of variables and arrays for restarts. !------------------------------------------------------------------------------! USE arrays_3d USE averaging USE cloud_parameters USE control_parameters USE cpulog USE indices USE interfaces USE particle_attributes USE pegrid USE profil_parameter USE random_function_mod USE statistics IMPLICIT NONE CHARACTER (LEN=10) :: binary_version CALL cpu_log( log_point(22), 'write_3d_binary', 'start' ) CALL check_open( 14 ) ! !-- Write control parameters and other variables for restart. IF ( myid == 0 ) CALL write_var_list ! !-- Write arrays. binary_version = '3.1' WRITE ( 14 ) binary_version WRITE ( 14 ) numprocs, myid, nxl, nxr, nys, nyn, nzb, nzt ! !-- Attention: After changes to the following output commands the version number !-- --------- of the variable binary_version must be changed! !-- Also, the list of arrays to be read in read_3d_binary must be !-- adjusted accordingly. WRITE ( 14 ) 'e '; WRITE ( 14 ) e IF ( ALLOCATED( e_av ) ) THEN WRITE ( 14 ) 'e_av '; WRITE ( 14 ) e_av ENDIF WRITE ( 14 ) 'e_m '; WRITE ( 14 ) e_m WRITE ( 14 ) 'iran '; WRITE ( 14 ) iran, iran_part WRITE ( 14 ) 'kh '; WRITE ( 14 ) kh IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'kh_m '; WRITE ( 14 ) kh_m ENDIF WRITE ( 14 ) 'km '; WRITE ( 14 ) km IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'km_m '; WRITE ( 14 ) km_m ENDIF IF ( ALLOCATED( lwp_av ) ) THEN WRITE ( 14 ) 'lwp_av '; WRITE ( 14 ) lwp_av ENDIF WRITE ( 14 ) 'p '; WRITE ( 14 ) p IF ( ALLOCATED( p_av ) ) THEN WRITE ( 14 ) 'p_av '; WRITE ( 14 ) p_av ENDIF IF ( ALLOCATED( pc_av ) ) THEN WRITE ( 14 ) 'pc_av '; WRITE ( 14 ) pc_av ENDIF IF ( ALLOCATED( pr_av ) ) THEN WRITE ( 14 ) 'pr_av '; WRITE ( 14 ) pr_av ENDIF IF ( ALLOCATED( precipitation_amount ) ) THEN WRITE ( 14 ) 'precipitation_amount'; WRITE ( 14 ) precipitation_amount ENDIF IF ( ALLOCATED( precipitation_rate_av ) ) THEN WRITE ( 14 ) 'precipitation_rate_a'; WRITE ( 14 ) & precipitation_rate_av ENDIF WRITE ( 14 ) 'pt '; WRITE ( 14 ) pt IF ( ALLOCATED( pt_av ) ) THEN WRITE ( 14 ) 'pt_av '; WRITE ( 14 ) pt_av ENDIF WRITE ( 14 ) 'pt_m '; WRITE ( 14 ) pt_m IF ( humidity .OR. passive_scalar ) THEN WRITE ( 14 ) 'q '; WRITE ( 14 ) q IF ( ALLOCATED( q_av ) ) THEN WRITE ( 14 ) 'q_av '; WRITE ( 14 ) q_av ENDIF WRITE ( 14 ) 'q_m '; WRITE ( 14 ) q_m IF ( cloud_physics ) THEN WRITE ( 14 ) 'ql '; WRITE ( 14 ) ql IF ( ALLOCATED( ql_av ) ) THEN WRITE ( 14 ) 'ql_av '; WRITE ( 14 ) ql_av ENDIF ENDIF WRITE ( 14 ) 'qs '; WRITE ( 14 ) qs WRITE ( 14 ) 'qsws '; WRITE ( 14 ) qsws IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'qsws_m '; WRITE ( 14 ) qsws_m ENDIF WRITE ( 14 ) 'qswst '; WRITE ( 14 ) qswst IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'qswst_m '; WRITE ( 14 ) qswst_m ENDIF ENDIF IF ( ocean ) THEN IF ( ALLOCATED( rho_av ) ) THEN WRITE ( 14 ) 'rho_av '; WRITE ( 14 ) rho_av ENDIF WRITE ( 14 ) 'sa '; WRITE ( 14 ) sa IF ( ALLOCATED( sa_av ) ) THEN WRITE ( 14 ) 'sa_av '; WRITE ( 14 ) sa_av ENDIF WRITE ( 14 ) 'saswsb '; WRITE ( 14 ) saswsb WRITE ( 14 ) 'saswst '; WRITE ( 14 ) saswst ENDIF IF ( ALLOCATED( ql_c_av ) ) THEN WRITE ( 14 ) 'ql_c_av '; WRITE ( 14 ) ql_c_av ENDIF IF ( ALLOCATED( ql_v_av ) ) THEN WRITE ( 14 ) 'ql_v_av '; WRITE ( 14 ) ql_v_av ENDIF IF ( ALLOCATED( ql_vp_av ) ) THEN WRITE ( 14 ) 'ql_vp_av '; WRITE ( 14 ) ql_vp_av ENDIF IF ( ALLOCATED( qv_av ) ) THEN WRITE ( 14 ) 'qv_av '; WRITE ( 14 ) qv_av ENDIF WRITE ( 14 ) 'random_iv '; WRITE ( 14 ) random_iv WRITE ( 14 ) random_iy WRITE ( 14 ) 'rif '; WRITE ( 14 ) rif IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'rif_m '; WRITE ( 14 ) rif_m ENDIF IF ( topography /= 'flat' ) THEN WRITE ( 14 ) 'rif_wall '; WRITE ( 14 ) rif_wall ENDIF IF ( ALLOCATED( s_av ) ) THEN WRITE ( 14 ) 's_av '; WRITE ( 14 ) s_av ENDIF WRITE ( 14 ) 'shf '; WRITE ( 14 ) shf IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'shf_m '; WRITE ( 14 ) shf_m ENDIF IF ( ALLOCATED( spectrum_x ) ) THEN WRITE ( 14 ) 'spectrum_x '; WRITE ( 14 ) spectrum_x WRITE ( 14 ) 'spectrum_y '; WRITE ( 14 ) spectrum_y ENDIF WRITE ( 14 ) 'ts '; WRITE ( 14 ) ts IF ( ALLOCATED( ts_av ) ) THEN WRITE ( 14 ) 'ts_av '; WRITE ( 14 ) ts_av ENDIF WRITE ( 14 ) 'tswst '; WRITE ( 14 ) tswst IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'tswst_m '; WRITE ( 14 ) tswst_m ENDIF WRITE ( 14 ) 'u '; WRITE ( 14 ) u IF ( ALLOCATED( u_av ) ) THEN WRITE ( 14 ) 'u_av '; WRITE ( 14 ) u_av ENDIF WRITE ( 14 ) 'u_m '; WRITE ( 14 ) u_m IF ( ALLOCATED( u_m_l ) ) THEN WRITE ( 14 ) 'u_m_l '; WRITE ( 14 ) u_m_l ENDIF IF ( ALLOCATED( u_m_n ) ) THEN WRITE ( 14 ) 'u_m_n '; WRITE ( 14 ) u_m_n ENDIF IF ( ALLOCATED( u_m_r ) ) THEN WRITE ( 14 ) 'u_m_r '; WRITE ( 14 ) u_m_r ENDIF IF ( ALLOCATED( u_m_s ) ) THEN WRITE ( 14 ) 'u_m_s '; WRITE ( 14 ) u_m_s ENDIF WRITE ( 14 ) 'us '; WRITE ( 14 ) us WRITE ( 14 ) 'usws '; WRITE ( 14 ) usws WRITE ( 14 ) 'uswst '; WRITE ( 14 ) uswst IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'usws_m '; WRITE ( 14 ) usws_m WRITE ( 14 ) 'uswst_m '; WRITE ( 14 ) uswst_m ENDIF IF ( ALLOCATED( us_av ) ) THEN WRITE ( 14 ) 'us_av '; WRITE ( 14 ) us_av ENDIF WRITE ( 14 ) 'v '; WRITE ( 14 ) v IF ( ALLOCATED( v_av ) ) THEN WRITE ( 14 ) 'v_av '; WRITE ( 14 ) v_av ENDIF WRITE ( 14 ) 'v_m '; WRITE ( 14 ) v_m IF ( ALLOCATED( v_m_l ) ) THEN WRITE ( 14 ) 'v_m_l '; WRITE ( 14 ) v_m_l ENDIF IF ( ALLOCATED( v_m_n ) ) THEN WRITE ( 14 ) 'v_m_n '; WRITE ( 14 ) v_m_n ENDIF IF ( ALLOCATED( v_m_r ) ) THEN WRITE ( 14 ) 'v_m_r '; WRITE ( 14 ) v_m_r ENDIF IF ( ALLOCATED( v_m_s ) ) THEN WRITE ( 14 ) 'v_m_s '; WRITE ( 14 ) v_m_s ENDIF IF ( humidity ) THEN WRITE ( 14 ) 'vpt '; WRITE ( 14 ) vpt IF ( ALLOCATED( vpt_av ) ) THEN WRITE ( 14 ) 'vpt_av '; WRITE ( 14 ) vpt_av ENDIF IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'vpt_m '; WRITE ( 14 ) vpt_m ENDIF ENDIF WRITE ( 14 ) 'vsws '; WRITE ( 14 ) vsws WRITE ( 14 ) 'vswst '; WRITE ( 14 ) vswst IF ( timestep_scheme(1:5) /= 'runge' ) THEN WRITE ( 14 ) 'vsws_m '; WRITE ( 14 ) vsws_m WRITE ( 14 ) 'vswst_m '; WRITE ( 14 ) vswst_m ENDIF WRITE ( 14 ) 'w '; WRITE ( 14 ) w IF ( ALLOCATED( w_av ) ) THEN WRITE ( 14 ) 'w_av '; WRITE ( 14 ) w_av ENDIF WRITE ( 14 ) 'w_m '; WRITE ( 14 ) w_m IF ( ALLOCATED( w_m_l ) ) THEN WRITE ( 14 ) 'w_m_l '; WRITE ( 14 ) w_m_l ENDIF IF ( ALLOCATED( w_m_n ) ) THEN WRITE ( 14 ) 'w_m_n '; WRITE ( 14 ) w_m_n ENDIF IF ( ALLOCATED( w_m_r ) ) THEN WRITE ( 14 ) 'w_m_r '; WRITE ( 14 ) w_m_r ENDIF IF ( ALLOCATED( w_m_s ) ) THEN WRITE ( 14 ) 'w_m_s '; WRITE ( 14 ) w_m_s ENDIF WRITE ( 14 ) 'z0 '; WRITE ( 14 ) z0 IF ( ALLOCATED( z0_av ) ) THEN WRITE ( 14 ) 'z0_av '; WRITE ( 14 ) z0_av ENDIF ! !-- Write end label. Unit 14 is closed in the main program. WRITE ( 14 ) '*** end *** ' CALL cpu_log( log_point(22), 'write_3d_binary', 'stop' ) END SUBROUTINE write_3d_binary