Ignore:
Timestamp:
Oct 1, 2018 2:37:10 AM (6 years ago)
Author:
raasch
Message:

modularization of the ocean code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/init_3d_model.f90

    r3289 r3294  
    2525! -----------------
    2626! $Id$
     27! changes concerning modularization of ocean option
     28!
     29! 3289 2018-09-28 10:23:58Z suehring
    2730! Introduce module parameter for number of inflow profiles
    2831!
     
    549552    USE netcdf_data_input_mod,                                                 &
    550553        ONLY:  init_3d, netcdf_data_input_init_3d
     554
     555    USE ocean_mod,                                                             &
     556        ONLY:  ocean_init, ocean_init_arrays
    551557   
    552558    USE particle_attributes,                                                   &
     
    772778                 s_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                           &
    773779                 s_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
    774 #endif
    775     ENDIF
    776 
    777     IF ( ocean )  THEN
    778 #if defined( __nopointer )
    779        ALLOCATE( prho(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                          &
    780                  rho_ocean(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                           &
    781                  sa(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                            &
    782                  sa_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                          &
    783                  tsa_m(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
    784 #else
    785        ALLOCATE( prho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                        &
    786                  rho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                         &
    787                  sa_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                          &
    788                  sa_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg),                          &
    789                  sa_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
    790        prho => prho_1
    791        rho_ocean  => rho_1  ! routines calc_mean_profile and diffusion_e require
    792                       ! density to be apointer
    793780#endif
    794781    ENDIF
     
    1010997       s => s_1;  s_p => s_2;  ts_m => s_3
    1011998    ENDIF   
    1012 
    1013     IF ( ocean )  THEN
    1014        sa => sa_1;  sa_p => sa_2;  tsa_m => sa_3
    1015     ENDIF
    1016999#endif
     1000
    10171001!
    10181002!-- Initialize arrays for turbulence closure
     
    10221006    CALL init_surface_arrays
    10231007!
    1024 !-- Allocate microphysics module arrays
    1025     IF ( bulk_cloud_model )  THEN
    1026        CALL bcm_init_arrays
    1027     ENDIF
    1028 !
    1029 !-- Allocate land surface model arrays
    1030     IF ( land_surface )  THEN
    1031        CALL lsm_init_arrays
    1032     ENDIF
    1033 
    1034 !
    1035 !-- Allocate wind turbine model arrays
    1036     IF ( wind_turbine )  THEN
    1037        CALL wtm_init_arrays
    1038     ENDIF
    1039 !
    1040 !-- Allocate gust module arrays
    1041     IF ( gust_module_enabled )  THEN
    1042        CALL gust_init_arrays
    1043     ENDIF
     1008!-- Allocate arrays for other modules
     1009    IF ( bulk_cloud_model    )  CALL bcm_init_arrays
     1010    IF ( gust_module_enabled )  CALL gust_init_arrays
     1011    IF ( land_surface        )  CALL lsm_init_arrays
     1012    IF ( ocean_mode          )  CALL ocean_init_arrays
     1013    IF ( wind_turbine        )  CALL wtm_init_arrays
     1014    IF ( uv_exposure         )  CALL uvem_init_arrays
    10441015
    10451016!
     
    10531024    IF ( uv_exposure )  THEN
    10541025       CALL uvem_init
    1055     ENDIF
    1056 !
    1057 !-- Allocate uv exposure arrays
    1058     IF ( uv_exposure )  THEN
    1059        CALL uvem_init_arrays
    10601026    ENDIF
    10611027
     
    12301196          ENDIF
    12311197
    1232           IF ( ocean )  THEN
    1233              DO  i = nxlg, nxrg
    1234                 DO  j = nysg, nyng
    1235                    sa(:,j,i) = sa_init
    1236                 ENDDO
    1237              ENDDO
    1238           ENDIF
    12391198!
    12401199!--       Set velocity components at non-atmospheric / oceanic grid points to
     
    13801339          ENDIF
    13811340
    1382           IF ( ocean )  THEN
    1383              DO  i = nxlg, nxrg
    1384                 DO  j = nysg, nyng
    1385                    sa(:,j,i) = sa_init
    1386                 ENDDO
    1387              ENDDO
    1388           ENDIF
    13891341!
    13901342!--       Compute initial temperature field and other constants used in case
     
    14491401       hom(:,1,7,:)  = SPREAD( pt(:,nys,nxl), 2, statistic_regions+1 )
    14501402
    1451 
    1452 !
    1453 !--    Store initial salinity profile
    1454        IF ( ocean )  THEN
    1455           hom(:,1,26,:)  = SPREAD( sa(:,nys,nxl), 2, statistic_regions+1 )
    1456        ENDIF
    1457 
    14581403       IF ( humidity )  THEN
    14591404!
     
    15571502       ENDIF       
    15581503
    1559        IF ( ocean )  THEN
    1560           tsa_m = 0.0_wp
    1561           sa_p  = sa
    1562        ENDIF
    1563        
    15641504       CALL location_message( 'finished', .TRUE. )
    15651505
     
    18101750       ENDIF
    18111751       IF ( passive_scalar )  s_p  = s
    1812        IF ( ocean          )  sa_p = sa
    1813 
    18141752!
    18151753!--    Allthough tendency arrays are set in prognostic_equations, they have
     
    18211759       ENDIF
    18221760       IF ( passive_scalar )  ts_m  = 0.0_wp
    1823        IF ( ocean          )  tsa_m = 0.0_wp
    18241761!
    18251762!--    Initialize synthetic turbulence generator in case of restart.
     
    22412178    IF ( dt_dvrp /= 9999999.9_wp )  CALL init_dvrp
    22422179
    2243     IF ( ocean )  THEN
    2244 !
    2245 !--    Initialize quantities needed for the ocean model
    2246        CALL init_ocean
    2247 
    2248     ENDIF
    2249 !
    2250 !--    Initialize quantities for handling cloud physics
    2251 !--    This routine must be called before lpm_init, because
    2252 !--    otherwise, array d_exner, needed in data_output_dvrp (called by
    2253 !--    lpm_init) is not defined.
    2254     IF ( .NOT. ocean )  THEN
     2180!
     2181!-- Initialize quantities needed for the ocean model
     2182    IF ( ocean_mode )  CALL ocean_init
     2183
     2184!
     2185!-- Initialize quantities for handling cloud physics.
     2186!-- This routine must be called before lpm_init, becaus otherwise,
     2187!-- array d_exner, needed in data_output_dvrp (called by lpm_init) is not defined.
     2188    IF ( .NOT. ocean_mode )  THEN
    22552189
    22562190       ALLOCATE( hyp(nzb:nzt+1) )
     
    24542388    rdf_sc = 0.0_wp
    24552389    IF ( rayleigh_damping_factor /= 0.0_wp )  THEN
    2456        IF (  .NOT.  ocean )  THEN
     2390
     2391       IF (  .NOT.  ocean_mode )  THEN
    24572392          DO  k = nzb+1, nzt
    24582393             IF ( zu(k) >= rayleigh_damping_height )  THEN
     
    24642399          ENDDO
    24652400       ELSE
     2401!
     2402!--       In ocean mode, rayleigh damping is applied in the lower part of the
     2403!--       model domain
    24662404          DO  k = nzt, nzb+1, -1
    24672405             IF ( zu(k) <= rayleigh_damping_height )  THEN
     
    24732411          ENDDO
    24742412       ENDIF
     2413
    24752414    ENDIF
    24762415    IF ( scalar_rayleigh_damping )  rdf_sc = rdf
Note: See TracChangeset for help on using the changeset viewer.