SUBROUTINE write_3d_binary !--------------------------------------------------------------------------------! ! This file is part of PALM. ! ! PALM is free software: you can redistribute it and/or modify it under the terms ! of the GNU General Public License as published by the Free Software Foundation, ! either version 3 of the License, or (at your option) any later version. ! ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License along with ! PALM. If not, see . ! ! Copyright 1997-2012 Leibniz University Hannover !--------------------------------------------------------------------------------! ! ! Current revisions: ! ----------------- ! ! Former revisions: ! ----------------- ! $Id: write_3d_binary.f90 1054 2012-11-13 17:30:09Z maronga $ ! ! 1053 2012-11-13 17:11:03Z hoffmann ! necessary expansions according to the two new prognostic equations (nr, qr) ! of the two-moment cloud physics scheme: ! +prr, prr_av, *, *_av, *s, *sws, *swst ! ! 1036 2012-10-22 13:43:42Z raasch ! code put under GPL (PALM 3.9) ! ! 1001 2012-09-13 14:08:46Z raasch ! all actions concerning leapfrog- and ups-scheme removed ! ! 978 2012-08-09 08:28:32Z fricke ! +z0h, z0h_av ! ! 790 2011-11-29 03:11:20Z raasch ! bugfix: output of 'ql' also if cloud droplets are used ! ! 776 2011-10-31 08:02:51Z heinze ! bugfix: increase binary_version due to last commit ! ! 771 2011-10-27 10:56:21Z heinze ! +lpt ! ! 759 2011-09-15 13:58:31Z raasch ! cpu measurement and file opening moved to main program ! ! 587 2010-10-27 08:36:51Z helmke ! nothing done but text written for "Current revisions" by mistake ! ! 367 2009-08-25 08:35:52Z maronga ! +shf_av, qsws_av ! ! 145 2008-01-09 08:17:38Z raasch ! 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 ! ! 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 ! !-- Write control parameters and other variables for restart. IF ( myid == 0 ) CALL write_var_list ! !-- Write arrays. binary_version = '3.3' 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 ) 'iran '; WRITE ( 14 ) iran, iran_part WRITE ( 14 ) 'kh '; WRITE ( 14 ) kh WRITE ( 14 ) 'km '; WRITE ( 14 ) km IF ( ALLOCATED( lpt_av ) ) THEN WRITE ( 14 ) 'lpt_av '; WRITE ( 14 ) lpt_av 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( prr ) ) THEN WRITE ( 14 ) 'prr '; WRITE ( 14 ) prr ENDIF IF ( ALLOCATED( prr_av ) ) THEN WRITE ( 14 ) 'prr_av '; WRITE ( 14 ) prr_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 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 IF ( cloud_physics .OR. cloud_droplets ) THEN WRITE ( 14 ) 'ql '; WRITE ( 14 ) ql IF ( ALLOCATED( ql_av ) ) THEN WRITE ( 14 ) 'ql_av '; WRITE ( 14 ) ql_av ENDIF IF ( icloud_scheme == 0 ) THEN WRITE ( 14 ) 'qr '; WRITE ( 14 ) qr WRITE ( 14 ) 'nr '; WRITE ( 14 ) nr IF ( ALLOCATED( qr_av ) ) THEN WRITE ( 14 ) 'qr_av '; WRITE ( 14 ) qr_av ENDIF IF ( ALLOCATED( nr_av ) ) THEN WRITE ( 14 ) 'nr_av '; WRITE ( 14 ) nr_av ENDIF WRITE ( 14 ) 'qrs '; WRITE ( 14 ) qrs WRITE ( 14 ) 'qrsws '; WRITE ( 14 ) qrsws WRITE ( 14 ) 'qrswst '; WRITE ( 14 ) qrswst WRITE ( 14 ) 'nrs '; WRITE ( 14 ) nrs WRITE ( 14 ) 'nrsws '; WRITE ( 14 ) nrsws WRITE ( 14 ) 'nrswst '; WRITE ( 14 ) nrswst ENDIF ENDIF WRITE ( 14 ) 'qs '; WRITE ( 14 ) qs WRITE ( 14 ) 'qsws '; WRITE ( 14 ) qsws IF ( ALLOCATED( qsws_av ) ) THEN WRITE ( 14 ) 'qsws_av '; WRITE ( 14 ) qsws_av ENDIF WRITE ( 14 ) 'qswst '; WRITE ( 14 ) qswst 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 ( 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 ( ALLOCATED( shf_av ) ) THEN WRITE ( 14 ) 'shf_av '; WRITE ( 14 ) shf_av 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 WRITE ( 14 ) 'u '; WRITE ( 14 ) u IF ( ALLOCATED( u_av ) ) THEN WRITE ( 14 ) 'u_av '; WRITE ( 14 ) u_av ENDIF 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 ( 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 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 ENDIF WRITE ( 14 ) 'vsws '; WRITE ( 14 ) vsws WRITE ( 14 ) 'vswst '; WRITE ( 14 ) vswst WRITE ( 14 ) 'w '; WRITE ( 14 ) w IF ( ALLOCATED( w_av ) ) THEN WRITE ( 14 ) 'w_av '; WRITE ( 14 ) w_av ENDIF 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 ( 14 ) 'z0h '; WRITE ( 14 ) z0h IF ( ALLOCATED( z0h_av ) ) THEN WRITE ( 14 ) 'z0h_av '; WRITE ( 14 ) z0h_av ENDIF ! !-- Write end label. Unit 14 is closed in the main program. WRITE ( 14 ) '*** end *** ' END SUBROUTINE write_3d_binary