Index: palm/trunk/SOURCE/netcdf_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 1973)
+++ palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 1976)
@@ -19,5 +19,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Removed remaining 2D land surface quantities. Definition of radiation 
+! quantities is now done directly in the respective module
 ! 
 ! Former revisions:
@@ -148,4 +149,6 @@
 !> @todo calculation of output time levels for parallel NetCDF still does not
 !>       cover every exception (change of dt_do, end_time in restart)
+!> @todo timeseries and profile output still needs to be rewritten to allow
+!>       modularization
 !------------------------------------------------------------------------------!
  MODULE netcdf_interface
@@ -414,4 +417,7 @@
     USE profil_parameter,                                                      &
         ONLY:  crmax, cross_profiles, dopr_index, profile_columns, profile_rows
+
+    USE radiation_model_mod,                                                   &
+        ONLY: radiation, radiation_define_netcdf_grid
 
     USE spectra_mod,                                                           &
@@ -735,6 +741,5 @@
                 CASE ( 'e', 'lpt', 'nr', 'p', 'pc', 'pr', 'prr', 'pt', 'q',    &
                        'qc', 'ql', 'ql_c', 'ql_v', 'ql_vp', 'qr', 'qv',        &
-                       'rad_lw_cs_hr', 'rad_lw_hr', 'rad_sw_cs_hr',            &
-                       'rad_sw_hr', 'rho', 's', 'sa', 'vpt'  )
+                       'rho', 's', 'sa', 'vpt'  )
 
                    grid_x = 'x'
@@ -757,6 +762,5 @@
 !
 !--             w grid
-                CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_sw_in', 'rad_sw_out',   &
-                       'w' )
+                CASE ( 'w' )
 
                    grid_x = 'x'
@@ -772,4 +776,12 @@
                       CALL lsm_define_netcdf_grid( domask(mid,av,i), found,    &
                                                    grid_x, grid_y, grid_z )
+                   ENDIF
+
+!
+!--                Check for radiation quantities
+                   IF ( .NOT. found  .AND.  radiation )  THEN
+                      CALL radiation_define_netcdf_grid( domask(mid,av,i),     &
+                                                         found, grid_x, grid_y,&
+                                                         grid_z )
                    ENDIF
 
@@ -1239,6 +1251,5 @@
                 CASE ( 'e', 'lpt', 'nr', 'p', 'pc', 'pr', 'prr', 'pt', 'q',    &
                        'qc', 'ql', 'ql_c', 'ql_v', 'ql_vp', 'qr', 'qv', 'rho', &
-                       's', 'sa', 'vpt' , 'rad_lw_cs_hr', 'rad_lw_hr',         &
-                       'rad_sw_cs_hr', 'rad_sw_hr' )
+                       's', 'sa', 'vpt' )
 
                    grid_x = 'x'
@@ -1261,6 +1272,5 @@
 !
 !--             w grid
-                CASE ( 'rad_lw_in', 'rad_lw_out', 'rad_sw_in', 'rad_sw_out',   &
-                       'w' )
+                CASE ( 'w' )
 
                    grid_x = 'x'
@@ -1275,5 +1285,13 @@
                    IF ( land_surface )  THEN
                       CALL lsm_define_netcdf_grid( do3d(av,i), found, grid_x,  &
-                                                    grid_y, grid_z )
+                                                   grid_y, grid_z )
+                   ENDIF
+
+!
+!--                Check for radiation quantities
+                   IF ( .NOT. found  .AND.  radiation )  THEN
+                      CALL radiation_define_netcdf_grid( do3d(av,i), found,    &
+                                                         grid_x, grid_y,       &
+                                                         grid_z )
                    ENDIF
                    
@@ -1837,7 +1855,6 @@
                              'pr_xy', 'prr_xy', 'pt_xy', 'q_xy', 'qc_xy',      &
                              'ql_xy', 'ql_c_xy', 'ql_v_xy', 'ql_vp_xy',        &
-                             'qr_xy', 'qv_xy', 'rad_lw_cs_hr_xy',              &
-                             'rad_lw_hr_xy', 'rad_sw_cs_hr_xy', 'rad_sw_hr_xy',& 
-                             'rho_xy', 's_xy', 'sa_xy', 'vpt_xy' )
+                             'qr_xy', 'qv_xy', 'rho_xy', 's_xy', 'sa_xy',      &
+                             'vpt_xy' )
 
                          grid_x = 'x'
@@ -1860,22 +1877,34 @@
 !
 !--                   w grid
-                      CASE ( 'rad_lw_in_xy', 'rad_lw_out_xy', 'rad_sw_in_xy',  &
-                             'rad_sw_out_xy' , 'w_xy' )
+                      CASE ( 'w_xy' )
 
                          grid_x = 'x'
                          grid_y = 'y'
                          grid_z = 'zw'
-!
-!--                   soil grid
-                      CASE ( 'm_soil_xy', 't_soil_xy' )
-                         grid_x = 'x'
-                         grid_y = 'y'
-                         grid_z = 'zs'
+
 
                       CASE DEFAULT
 !
+!--                      Check for land surface quantities
+                         IF ( land_surface )  THEN
+                            CALL lsm_define_netcdf_grid( do2d(av,i), found,    &
+                                                   grid_x, grid_y, grid_z )
+                         ENDIF
+
+!
+!--                      Check for radiation quantities
+                         IF ( .NOT. found  .AND.  radiation )  THEN
+                            CALL radiation_define_netcdf_grid( do2d(av,i),     &
+                                                         found, grid_x, grid_y,&
+                                                         grid_z )
+                         ENDIF
+
+!
 !--                      Check for user-defined quantities
-                         CALL user_define_netcdf_grid( do2d(av,i), found, &
-                                                       grid_x, grid_y, grid_z )
+                         IF ( .NOT. found )  THEN
+                            CALL user_define_netcdf_grid( do2d(av,i), found,   &
+                                                          grid_x, grid_y,      &
+                                                          grid_z )
+                         ENDIF
 
                          IF ( .NOT. found )  THEN
@@ -2491,7 +2520,5 @@
                           'prr_xz', 'pt_xz', 'q_xz', 'qc_xz', 'ql_xz',         &
                           'ql_c_xz', 'ql_v_xz', 'ql_vp_xz', 'qr_xz', 'qv_xz',  &
-                          'rad_lw_cs_hr_xz', 'rad_lw_hr_xz',                   &
-                          'rad_sw_cs_hr_xz', 'rad_sw_hr_xz''rho_xz', 's_xz',   &
-                          'sa_xz', 'vpt_xz' )
+                          'rho_xz', 's_xz', 'sa_xz', 'vpt_xz' )
 
                       grid_x = 'x'
@@ -2514,6 +2541,5 @@
 !
 !--                w grid
-                   CASE ( 'rad_lw_in_xz', 'rad_lw_out_xz', 'rad_sw_in_xz',     &
-                          'rad_sw_out_xz', 'w_xz' )
+                   CASE ( 'w_xz' )
 
                       grid_x = 'x'
@@ -2521,17 +2547,28 @@
                       grid_z = 'zw'
 
-!
-!--                soil grid
-                   CASE ( 'm_soil_xz', 't_soil_xz' )
-
-                      grid_x = 'x'
-                      grid_y = 'y'
-                      grid_z = 'zs'
-
                    CASE DEFAULT
+
+!
+!--                   Check for land surface quantities
+                      IF ( land_surface )  THEN
+                         CALL lsm_define_netcdf_grid( do2d(av,i), found,       &
+                                                      grid_x, grid_y, grid_z )
+                      ENDIF
+
+!
+!--                   Check for radiation quantities
+                      IF ( .NOT. found  .AND.  radiation )  THEN
+                         CALL radiation_define_netcdf_grid( do2d(av,i), found, &
+                                                            grid_x, grid_y,    &
+                                                            grid_z )
+                      ENDIF
+
 !
 !--                   Check for user-defined quantities
-                      CALL user_define_netcdf_grid( do2d(av,i), found, &
-                                                    grid_x, grid_y, grid_z )
+                      IF ( .NOT. found )  THEN
+                         CALL user_define_netcdf_grid( do2d(av,i), found,      &
+                                                       grid_x, grid_y, grid_z )
+                      ENDIF
+
                       IF ( .NOT. found )  THEN
                          WRITE ( message_string, * ) 'no grid defined for', &
@@ -3137,7 +3174,5 @@
                           'prr_yz', 'pt_yz', 'q_yz', 'qc_yz', 'ql_yz',         &
                           'ql_c_yz', 'ql_v_yz', 'ql_vp_yz', 'qr_yz', 'qv_yz',  &
-                          'rad_lw_cs_hr_yz', 'rad_lw_hr_yz',                   &
-                          'rad_sw_cs_hr_yz', 'rad_sw_hr_yz''rho_yz', 's_yz',   &
-                          'sa_yz', 'vpt_yz' )
+                          'rho_yz', 's_yz', 'sa_yz', 'vpt_yz' )
 
                       grid_x = 'x'
@@ -3160,23 +3195,33 @@
 !
 !--                w grid
-                   CASE ( 'rad_lw_in_yz', 'rad_lw_out_yz', 'rad_sw_in_yz',     &
-                          'rad_sw_out_yz', 'w_yz' )
+                   CASE ( 'w_yz' )
 
                       grid_x = 'x'
                       grid_y = 'y'
                       grid_z = 'zw'
-!
-!--                soil grid
-                   CASE ( 'm_soil_yz', 't_soil_yz' )
-
-                      grid_x = 'x'
-                      grid_y = 'y'
-                      grid_z = 'zs'
+
 
                    CASE DEFAULT
 !
+!--                   Check for land surface quantities
+                      IF ( land_surface )  THEN
+                         CALL lsm_define_netcdf_grid( do2d(av,i), found,       &
+                                                      grid_x, grid_y, grid_z )
+                      ENDIF
+
+!
+!--                   Check for radiation quantities
+                      IF ( .NOT. found  .AND.  radiation )  THEN
+                         CALL radiation_define_netcdf_grid( do2d(av,i), found, &
+                                                            grid_x, grid_y,    &
+                                                            grid_z )
+                      ENDIF
+
+!
 !--                   Check for user-defined quantities
-                      CALL user_define_netcdf_grid( do2d(av,i), found, &
-                                                    grid_x, grid_y, grid_z )
+                      IF ( .NOT. found )  THEN
+                         CALL user_define_netcdf_grid( do2d(av,i), found,      &
+                                                       grid_x, grid_y, grid_z )
+                      ENDIF
 
                       IF ( .NOT. found )  THEN
@@ -4313,5 +4358,5 @@
 !--                Check for user-defined quantities (found, grid_x and grid_y
 !--                are dummies)
-                   CALL user_define_netcdf_grid( data_output_sp(i), found,  &
+                   CALL user_define_netcdf_grid( data_output_sp(i), found,     &
                                                  grid_x, grid_y, grid_z )
 
