- Timestamp:
- Oct 3, 2018 12:04:15 PM (6 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/ocean_mod.f90
r3302 r3303 25 25 ! ----------------- 26 26 ! $Id$ 27 ! salinity allowed to be switched off 28 ! 29 ! 3302 2018-10-03 02:39:40Z raasch 27 30 ! Craik Leibovich force (Stokes drift) + wave breaking effect added 28 31 ! … … 70 73 INTEGER(iwp) :: sa_vertical_gradient_level_ind(10) = -9999 !< grid index values of sa_vertical_gradient_level(s) 71 74 75 LOGICAL :: salinity = .TRUE. !< switch for using salinity 72 76 LOGICAL :: stokes_force = .FALSE. !< switch to switch on the Stokes force 73 77 LOGICAL :: wave_breaking = .FALSE. !< switch to switch on wave breaking effects … … 500 504 501 505 502 NAMELIST /ocean_parameters/ bc_sa_t, bottom_salinityflux, sa _surface,&503 sa_ vertical_gradient, sa_vertical_gradient_level,&506 NAMELIST /ocean_parameters/ bc_sa_t, bottom_salinityflux, salinity, & 507 sa_surface, sa_vertical_gradient, sa_vertical_gradient_level, & 504 508 stokes_waveheight, stokes_wavelength, top_salinityflux, & 505 509 wall_salinityflux, wave_breaking … … 579 583 580 584 IF ( top_salinityflux == 9999999.9_wp ) constant_top_salinityflux = .FALSE. 585 586 IF ( .NOT. salinity ) THEN 587 IF ( ( bottom_salinityflux /= 0.0_wp .AND. & 588 bottom_salinityflux /= 9999999.9_wp ) .OR. & 589 ( top_salinityflux /= 0.0_wp .AND. & 590 top_salinityflux /= 9999999.9_wp ) ) & 591 THEN 592 message_string = 'salinityflux must not be set for ocean run ' // & 593 'without salinity' 594 CALL message( 'check_parameters', 'PA0509', 1, 2, 0, 6, 0 ) 595 ENDIF 596 ENDIF 581 597 582 598 IF ( ibc_sa_t == 1 .AND. top_salinityflux == 9999999.9_wp ) THEN … … 904 920 905 921 USE indices, & 906 ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt 922 ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt, & 923 wall_flags_0 907 924 908 925 IMPLICIT NONE … … 968 985 969 986 IF ( found .AND. .NOT. resorted ) THEN 970 ! DO i = nxl, nxr 971 ! DO j = nys, nyn 972 ! DO k = nzb_do, nzt_do 973 ! local_pf(i,j,k) = MERGE( to_be_resorted(k,j,i), & 974 ! REAL( fill_value, KIND = wp ), & 975 ! BTEST( wall_flags_0(k,j,i), flag_nr ) ) 976 ! ENDDO 977 ! ENDDO 978 ! ENDDO 987 DO i = nxl, nxr 988 DO j = nys, nyn 989 DO k = nzb_do, nzt_do 990 local_pf(i,j,k) = MERGE( to_be_resorted(k,j,i), & 991 REAL( fill_value, KIND = wp ), & 992 BTEST( wall_flags_0(k,j,i), flag_nr ) ) 993 ENDDO 994 ENDDO 995 ENDDO 996 resorted = .TRUE. 979 997 ENDIF 980 998 … … 1062 1080 DO j = nys, nyn 1063 1081 DO k = nzb_do, nzt_do 1064 local_pf(i,j,k) = MERGE( & 1065 to_be_resorted(k,j,i), & 1066 REAL( fill_value, KIND = wp ), & 1067 BTEST( wall_flags_0(k,j,i), flag_nr ) ) 1082 local_pf(i,j,k) = MERGE( to_be_resorted(k,j,i), & 1083 REAL( fill_value, KIND = wp ), & 1084 BTEST( wall_flags_0(k,j,i), flag_nr ) ) 1068 1085 ENDDO 1069 1086 ENDDO … … 1094 1111 WRITE( io, 3 ) alpha_wave_breaking, timescale_wave_breaking 1095 1112 ENDIF 1113 IF ( .NOT. salinity ) WRITE( io, 4 ) 1096 1114 1097 1115 1 FORMAT (//' Ocean settings:'/ & … … 1103 1121 ' alpha: ',F4.1/ & 1104 1122 ' timescale:',F5.1,' s') 1123 4 FORMAT (' --> prognostic salinity equation is switched off' ) 1105 1124 1106 1125 END SUBROUTINE ocean_header … … 1123 1142 1124 1143 #if defined( __nopointer ) 1125 ALLOCATE( prho(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &1126 rho_ocean(nzb:nzt+1,nysg:nyng,nxlg:nxrg), 1127 sa(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &1128 sa_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg), &1144 ALLOCATE( prho(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1145 rho_ocean(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1146 sa(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1147 sa_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1129 1148 tsa_m(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1130 1149 #else 1131 ALLOCATE( prho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1132 rho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1133 sa_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1134 sa_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1150 ALLOCATE( prho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1151 rho_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1152 sa_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 1135 1153 sa_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1154 1155 IF ( salinity ) THEN 1156 ALLOCATE( sa_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1157 ENDIF 1136 1158 1137 1159 prho => prho_1 … … 1143 1165 ! 1144 1166 !-- Initial assignment of pointers 1145 sa => sa_1; sa_p => sa_2; tsa_m => sa_3 1167 IF ( salinity ) THEN 1168 sa => sa_1; sa_p => sa_2; tsa_m => sa_3 1169 ELSE 1170 sa => sa_1; sa_p => sa_1; tsa_m => sa_3 1171 ENDIF 1146 1172 #endif 1147 1173 … … 1213 1239 !-- possible Neumann boundary condition. This is not realized for the ocean 1214 1240 !-- mode, therefore a dummy argument is used. 1215 CALL init_vertical_profiles( sa_vertical_gradient_level_ind, & 1216 sa_vertical_gradient_level, & 1217 sa_vertical_gradient, sa_init, & 1218 sa_surface, dum ) 1241 IF ( salinity ) THEN 1242 CALL init_vertical_profiles( sa_vertical_gradient_level_ind, & 1243 sa_vertical_gradient_level, & 1244 sa_vertical_gradient, sa_init, & 1245 sa_surface, dum ) 1246 ENDIF 1219 1247 ENDIF 1220 1248 … … 1467 1495 !-- Compute prognostic equations for the ocean mode 1468 1496 !-- First, start with salinity 1497 IF ( .NOT. salinity ) RETURN 1498 1469 1499 CALL cpu_log( log_point(37), 'sa-equation', 'start' ) 1470 1500 … … 1615 1645 !-- Compute prognostic equations for the ocean mode 1616 1646 !-- First, start with tendency-terms for salinity 1647 IF ( .NOT. salinity ) RETURN 1648 1617 1649 tend(:,j,i) = 0.0_wp 1618 1650 IF ( timestep_scheme(1:5) == 'runge' ) & … … 1699 1731 1700 1732 CASE ( 0 ) 1701 sa => sa_1; sa_p => sa_2 1733 IF ( salinity ) THEN 1734 sa => sa_1; sa_p => sa_2 1735 ENDIF 1702 1736 1703 1737 CASE ( 1 ) 1704 sa => sa_2; sa_p => sa_1 1738 IF ( salinity ) THEN 1739 sa => sa_2; sa_p => sa_1 1740 ENDIF 1705 1741 1706 1742 END SELECT … … 1737 1773 CASE ( 'bottom_salinityflux' ) 1738 1774 READ ( 13 ) bottom_salinityflux 1775 1776 CASE ( 'salinity' ) 1777 READ ( 13 ) salinity 1739 1778 1740 1779 CASE ( 'sa_init' ) … … 1866 1905 CALL wrd_write_string( 'bottom_salinityflux' ) 1867 1906 WRITE ( 14 ) bottom_salinityflux 1907 1908 CALL wrd_write_string( 'salinity' ) 1909 WRITE ( 14 ) salinity 1868 1910 1869 1911 CALL wrd_write_string( 'sa_init' ) -
palm/trunk/SOURCE/swap_timelevel.f90
r3294 r3303 25 25 ! ----------------- 26 26 ! $Id$ 27 ! bugfix for swapping in case of ocean mode 28 ! 29 ! 3294 2018-10-01 02:37:10Z raasch 27 30 ! changes concerning modularization of ocean option 28 31 ! … … 219 222 IF ( gust_module_enabled ) CALL gust_swap_timelevel( 0 ) 220 223 IF ( land_surface ) CALL lsm_swap_timelevel( 0 ) 221 IF ( ocean_mode ) CALL ocean_swap_timelev l( 0 )224 IF ( ocean_mode ) CALL ocean_swap_timelevel( 0 ) 222 225 CALL tcm_swap_timelevel( 0 ) 223 226 IF ( urban_surface ) CALL usm_swap_timelevel( 0 ) … … 237 240 pt => pt_1; pt_p => pt_2 238 241 ENDIF 239 IF ( ocean_mode ) THEN240 sa => sa_1; sa_p => sa_2241 ENDIF242 242 IF ( humidity ) THEN 243 243 q => q_1; q_p => q_2 … … 257 257 pt => pt_2; pt_p => pt_1 258 258 ENDIF 259 IF ( ocean_mode ) THEN260 sa => sa_2; sa_p => sa_1261 ENDIF262 259 IF ( humidity ) THEN 263 260 q => q_2; q_p => q_1 … … 271 268 END SELECT 272 269 270 IF ( humidity .AND. bulk_cloud_model ) THEN 271 CALL bcm_swap_timelevel( MOD( timestep_count, 2) ) 272 ENDIF 273 273 274 IF ( air_chemistry ) CALL chem_swap_timelevel( MOD( timestep_count, 2) ) 274 275 275 CALL tcm_swap_timelevel ( MOD( timestep_count, 2) ) 276 277 IF ( humidity .AND. bulk_cloud_model ) THEN 278 CALL bcm_swap_timelevel ( MOD( timestep_count, 2) ) 276 IF ( gust_module_enabled ) THEN 277 CALL gust_swap_timelevel( MOD( timestep_count, 2) ) 279 278 ENDIF 280 279 281 280 IF ( land_surface ) THEN 282 CALL lsm_swap_timelevel ( MOD( timestep_count, 2) ) 283 ENDIF 281 CALL lsm_swap_timelevel( MOD( timestep_count, 2) ) 282 ENDIF 283 284 IF ( ocean_mode ) THEN 285 CALL ocean_swap_timelevel( MOD( timestep_count, 2 ) ) 286 ENDIF 287 288 CALL tcm_swap_timelevel( MOD( timestep_count, 2) ) 284 289 285 290 IF ( urban_surface ) THEN 286 CALL usm_swap_timelevel ( MOD( timestep_count, 2) ) 287 ENDIF 288 289 IF ( gust_module_enabled ) THEN 290 CALL gust_swap_timelevel ( MOD( timestep_count, 2) ) 291 CALL usm_swap_timelevel( MOD( timestep_count, 2) ) 291 292 ENDIF 292 293
Note: See TracChangeset
for help on using the changeset viewer.