diff --git a/src/core/MOM_forcing_type.F90 b/src/core/MOM_forcing_type.F90 index 23b8b9da7c..bdf4823f81 100644 --- a/src/core/MOM_forcing_type.F90 +++ b/src/core/MOM_forcing_type.F90 @@ -1489,39 +1489,41 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles, !========================================================================= ! area averaged surface mass transport - handles%id_prcme_ga = register_scalar_field('ocean_model', 'PRCmE_ga', Time, diag, & - long_name='Area averaged net surface water flux (precip+melt+liq runoff+ice calving-evap)',& - units='kg m-2 s-1', standard_name='water_flux_into_sea_water_area_averaged', & - cmor_field_name='ave_wfo', & - cmor_standard_name='rainfall_flux_area_averaged', & + handles%id_prcme_ga = register_scalar_field('ocean_model', 'PRCmE_ga', Time, diag, & + long_name='Area averaged net surface water flux (precip+melt+liq runoff+ice calving-evap)', & + units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s, & + standard_name='water_flux_into_sea_water_area_averaged', & + cmor_field_name='ave_wfo', cmor_standard_name='rainfall_flux_area_averaged', & cmor_long_name='Water Transport Into Sea Water Area Averaged') - handles%id_evap_ga = register_scalar_field('ocean_model', 'evap_ga', Time, diag,& - long_name='Area averaged evap/condense at ocean surface', & - units='kg m-2 s-1', standard_name='water_evaporation_flux_area_averaged', & - cmor_field_name='ave_evs', & - cmor_standard_name='water_evaporation_flux_area_averaged', & + handles%id_evap_ga = register_scalar_field('ocean_model', 'evap_ga', Time, diag, & + long_name='Area averaged evap/condense at ocean surface', & + units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s, & + standard_name='water_evaporation_flux_area_averaged', & + cmor_field_name='ave_evs', cmor_standard_name='water_evaporation_flux_area_averaged', & cmor_long_name='Evaporation Where Ice Free Ocean over Sea Area Averaged') handles%id_lprec_ga = register_scalar_field('ocean_model', 'lprec_ga', Time, diag,& - long_name='Area integrated liquid precip into ocean', units='kg m-2 s-1', & - standard_name='rainfall_flux_area_averaged', & - cmor_field_name='ave_pr', & - cmor_standard_name='rainfall_flux_area_averaged', & + long_name='Area integrated liquid precip into ocean', & + units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s, & + standard_name='rainfall_flux_area_averaged', & + cmor_field_name='ave_pr', cmor_standard_name='rainfall_flux_area_averaged', & cmor_long_name='Rainfall Flux where Ice Free Ocean over Sea Area Averaged') - handles%id_fprec_ga = register_scalar_field('ocean_model', 'fprec_ga', Time, diag,& - long_name='Area integrated frozen precip into ocean', units='kg m-2 s-1', & + handles%id_fprec_ga = register_scalar_field('ocean_model', 'fprec_ga', Time, diag, & + long_name='Area integrated frozen precip into ocean', & + units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s, & standard_name='snowfall_flux_area_averaged', & - cmor_field_name='ave_prsn', & - cmor_standard_name='snowfall_flux_area_averaged', & + cmor_field_name='ave_prsn',cmor_standard_name='snowfall_flux_area_averaged', & cmor_long_name='Snowfall Flux where Ice Free Ocean over Sea Area Averaged') handles%id_precip_ga = register_scalar_field('ocean_model', 'precip_ga', Time, diag, & - long_name='Area averaged liquid+frozen precip into ocean', units='kg m-2 s-1') + long_name='Area averaged liquid+frozen precip into ocean', & + units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) handles%id_vprec_ga = register_scalar_field('ocean_model', 'vrec_ga', Time, diag, & - long_name='Area averaged virtual liquid precip due to SSS restoring', units='kg m-2 s-1') + long_name='Area averaged virtual liquid precip due to SSS restoring', & + units='kg m-2 s-1', conversion=US%RZ_T_to_kg_m2s) !=============================================================== ! surface heat flux maps @@ -1820,12 +1822,12 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles, handles%id_net_heat_coupler_ga = register_scalar_field('ocean_model', & 'net_heat_coupler_ga', Time, diag, & long_name='Area averaged surface heat flux from SW+LW+latent+sensible+seaice_melt_heat (via the coupler)',& - units='W m-2') + units='W m-2', conversion=US%QRZ_T_to_W_m2) handles%id_net_heat_surface_ga = register_scalar_field('ocean_model', & 'net_heat_surface_ga', Time, diag, long_name= & 'Area averaged surface heat flux from SW+LW+lat+sens+mass+frazil+restore+seaice_melt_heat or flux adjustments', & - units='W m-2', & + units='W m-2', conversion=US%QRZ_T_to_W_m2, & cmor_field_name='ave_hfds', & cmor_standard_name='surface_downward_heat_flux_in_sea_water_area_averaged', & cmor_long_name= & @@ -1834,7 +1836,7 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles, handles%id_sw_ga = register_scalar_field('ocean_model', & 'sw_ga', Time, diag, & long_name='Area averaged net downward shortwave at sea water surface', & - units='W m-2', & + units='W m-2', conversion=US%QRZ_T_to_W_m2, & cmor_field_name='ave_rsntds', & cmor_standard_name='net_downward_shortwave_flux_at_sea_water_surface_area_averaged',& cmor_long_name= & @@ -1843,12 +1845,12 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles, handles%id_LwLatSens_ga = register_scalar_field('ocean_model',& 'LwLatSens_ga', Time, diag, & long_name='Area averaged longwave+latent+sensible heating',& - units='W m-2') + units='W m-2', conversion=US%QRZ_T_to_W_m2) handles%id_lw_ga = register_scalar_field('ocean_model', & 'lw_ga', Time, diag, & long_name='Area averaged net downward longwave at sea water surface', & - units='W m-2', & + units='W m-2', conversion=US%QRZ_T_to_W_m2, & cmor_field_name='ave_rlntds', & cmor_standard_name='surface_net_downward_longwave_flux_area_averaged',& cmor_long_name= & @@ -1857,7 +1859,7 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles, handles%id_lat_ga = register_scalar_field('ocean_model', & 'lat_ga', Time, diag, & long_name='Area averaged surface downward latent heat flux', & - units='W m-2', & + units='W m-2', conversion=US%QRZ_T_to_W_m2, & cmor_field_name='ave_hflso', & cmor_standard_name='surface_downward_latent_heat_flux_area_averaged',& cmor_long_name= & @@ -1866,7 +1868,7 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles, handles%id_sens_ga = register_scalar_field('ocean_model', & 'sens_ga', Time, diag, & long_name='Area averaged downward sensible heat flux', & - units='W m-2', & + units='W m-2', conversion=US%QRZ_T_to_W_m2, & cmor_field_name='ave_hfsso', & cmor_standard_name='surface_downward_sensible_heat_flux_area_averaged',& cmor_long_name= & @@ -2347,7 +2349,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h real, dimension(SZI_(diag%G),SZJ_(diag%G)) :: res ! A temporary array for combinations ! of fluxes [R Z T-1 ~> kg m-2 s-1] or [Q R Z T-1 ~> W m-2] real :: total_transport ! for diagnosing integrated boundary transport, in MKS units of [kg s-1] or [W] - real :: ave_flux ! for diagnosing averaged boundary flux, in MKS units of [kg m-2 s-1] or [W m-2] + real :: ave_flux ! for diagnosing averaged boundary flux in [R Z T-1 ~> kg m-2 s-1] or [Q R Z T-1 ~> W m-2] real :: I_dt ! inverse time step [T-1 ~> s-1] real :: ppt2mks ! conversion between ppt and mks units [nondim] integer :: turns ! Number of index quarter turns @@ -2395,7 +2397,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_prcme, total_transport, diag) endif if (handles%id_prcme_ga > 0) then - ave_flux = global_area_mean(res, G, scale=US%RZ_T_to_kg_m2s) + ave_flux = global_area_mean(res, G, tmp_scale=US%RZ_T_to_kg_m2s) call post_data(handles%id_prcme_ga, ave_flux, diag) endif endif @@ -2465,7 +2467,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_evap, total_transport, diag) endif if ((handles%id_evap_ga > 0) .and. associated(fluxes%evap)) then - ave_flux = global_area_mean(fluxes%evap, G, scale=US%RZ_T_to_kg_m2s) + ave_flux = global_area_mean(fluxes%evap, G, tmp_scale=US%RZ_T_to_kg_m2s) call post_data(handles%id_evap_ga, ave_flux, diag) endif @@ -2479,7 +2481,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_precip, total_transport, diag) endif if (handles%id_precip_ga > 0) then - ave_flux = global_area_mean(res, G, scale=US%RZ_T_to_kg_m2s) + ave_flux = global_area_mean(res, G, tmp_scale=US%RZ_T_to_kg_m2s) call post_data(handles%id_precip_ga, ave_flux, diag) endif endif @@ -2491,7 +2493,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_lprec, total_transport, diag) endif if (handles%id_lprec_ga > 0) then - ave_flux = global_area_mean(fluxes%lprec, G, scale=US%RZ_T_to_kg_m2s) + ave_flux = global_area_mean(fluxes%lprec, G, tmp_scale=US%RZ_T_to_kg_m2s) call post_data(handles%id_lprec_ga, ave_flux, diag) endif endif @@ -2503,7 +2505,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_fprec, total_transport, diag) endif if (handles%id_fprec_ga > 0) then - ave_flux = global_area_mean(fluxes%fprec, G, scale=US%RZ_T_to_kg_m2s) + ave_flux = global_area_mean(fluxes%fprec, G, tmp_scale=US%RZ_T_to_kg_m2s) call post_data(handles%id_fprec_ga, ave_flux, diag) endif endif @@ -2515,7 +2517,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_vprec, total_transport, diag) endif if (handles%id_vprec_ga > 0) then - ave_flux = global_area_mean(fluxes%vprec, G, scale=US%RZ_T_to_kg_m2s) + ave_flux = global_area_mean(fluxes%vprec, G, tmp_scale=US%RZ_T_to_kg_m2s) call post_data(handles%id_vprec_ga, ave_flux, diag) endif endif @@ -2625,7 +2627,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_net_heat_coupler, total_transport, diag) endif if (handles%id_net_heat_coupler_ga > 0) then - ave_flux = global_area_mean(res, G, scale=US%QRZ_T_to_W_m2) + ave_flux = global_area_mean(res, G, tmp_scale=US%QRZ_T_to_W_m2) call post_data(handles%id_net_heat_coupler_ga, ave_flux, diag) endif endif @@ -2669,7 +2671,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_net_heat_surface, total_transport, diag) endif if (handles%id_net_heat_surface_ga > 0) then - ave_flux = global_area_mean(res, G, scale=US%QRZ_T_to_W_m2) + ave_flux = global_area_mean(res, G, tmp_scale=US%QRZ_T_to_W_m2) call post_data(handles%id_net_heat_surface_ga, ave_flux, diag) endif endif @@ -2740,7 +2742,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h do j=js,je ; do i=is,ie res(i,j) = ((fluxes%lw(i,j) + fluxes%latent(i,j)) + fluxes%sens(i,j)) enddo ; enddo - ave_flux = global_area_mean(res, G, scale=US%QRZ_T_to_W_m2) + ave_flux = global_area_mean(res, G, tmp_scale=US%QRZ_T_to_W_m2) call post_data(handles%id_LwLatSens_ga, ave_flux, diag) endif @@ -2760,7 +2762,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_sw, total_transport, diag) endif if ((handles%id_sw_ga > 0) .and. associated(fluxes%sw)) then - ave_flux = global_area_mean(fluxes%sw, G, scale=US%QRZ_T_to_W_m2) + ave_flux = global_area_mean(fluxes%sw, G, tmp_scale=US%QRZ_T_to_W_m2) call post_data(handles%id_sw_ga, ave_flux, diag) endif @@ -2772,7 +2774,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_lw, total_transport, diag) endif if ((handles%id_lw_ga > 0) .and. associated(fluxes%lw)) then - ave_flux = global_area_mean(fluxes%lw, G, scale=US%QRZ_T_to_W_m2) + ave_flux = global_area_mean(fluxes%lw, G, tmp_scale=US%QRZ_T_to_W_m2) call post_data(handles%id_lw_ga, ave_flux, diag) endif @@ -2784,7 +2786,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_lat, total_transport, diag) endif if ((handles%id_lat_ga > 0) .and. associated(fluxes%latent)) then - ave_flux = global_area_mean(fluxes%latent, G, scale=US%QRZ_T_to_W_m2) + ave_flux = global_area_mean(fluxes%latent, G, tmp_scale=US%QRZ_T_to_W_m2) call post_data(handles%id_lat_ga, ave_flux, diag) endif @@ -2830,7 +2832,7 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h call post_data(handles%id_total_sens, total_transport, diag) endif if ((handles%id_sens_ga > 0) .and. associated(fluxes%sens)) then - ave_flux = global_area_mean(fluxes%sens, G, scale=US%QRZ_T_to_W_m2) + ave_flux = global_area_mean(fluxes%sens, G, tmp_scale=US%QRZ_T_to_W_m2) call post_data(handles%id_sens_ga, ave_flux, diag) endif @@ -3228,7 +3230,7 @@ subroutine myAlloc(array, is, ie, js, je, flag) logical, optional, intent(in) :: flag !< Flag to indicate to allocate if (present(flag)) then ; if (flag) then ; if (.not.associated(array)) then - allocate(array(is:ie,js:je)) ; array(is:ie,js:je) = 0.0 + allocate(array(is:ie,js:je), source=0.0) endif ; endif ; endif end subroutine myAlloc @@ -3498,14 +3500,14 @@ subroutine homogenize_mech_forcing(forces, G, US, Rho0, UpdateUstar) logical, optional, intent(in) :: UpdateUstar !< A logical to determine if Ustar should be directly averaged !! or updated from mean tau. - real :: tx_mean, ty_mean, avg - real :: iRho0 + real :: tx_mean, ty_mean ! Mean wind stresses [R L Z T-2 ~> Pa] + real :: Irho0 ! Inverse of the mean density rescaled to [Z L-1 R-1 ~> m3 kg-1] logical :: do_stress, do_ustar, do_shelf, do_press, do_iceberg, tau2ustar integer :: i, j, is, ie, js, je, isB, ieB, jsB, jeB is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec isB = G%iscB ; ieB = G%iecB ; jsB = G%jscB ; jeB = G%jecB - iRho0 = US%L_to_Z / Rho0 + Irho0 = US%L_to_Z / Rho0 tau2ustar = .false. if (present(UpdateUstar)) tau2ustar = UpdateUstar @@ -3524,7 +3526,7 @@ subroutine homogenize_mech_forcing(forces, G, US, Rho0, UpdateUstar) enddo ; enddo if (tau2ustar) then do j=js,je ; do i=is,ie - if (G%mask2dT(i,j) > 0.) forces%ustar(i,j) = US%L_to_Z*sqrt(sqrt(tx_mean**2 + ty_mean**2)*iRho0) + if (G%mask2dT(i,j) > 0.) forces%ustar(i,j) = sqrt(sqrt(tx_mean**2 + ty_mean**2)*Irho0) enddo ; enddo else call homogenize_field_t(forces%ustar, G, tmp_scale=US%Z_to_m*US%s_to_T) @@ -3563,7 +3565,7 @@ subroutine homogenize_forcing(fluxes, G, GV, US) type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type - real :: avg + real :: avg ! Global average of a variable, in the same units as that variable logical :: do_ustar, do_water, do_heat, do_salt, do_press, do_shelf, & do_iceberg, do_heat_added, do_buoy integer :: i, j, is, ie, js, je, isB, ieB, jsB, jeB @@ -3681,7 +3683,7 @@ subroutine homogenize_field_t(var, G, tmp_scale) real, optional, intent(in) :: tmp_scale !< A temporary rescaling factor for the !! variable that is reversed in the return value - real :: avg + real :: avg ! Global average of var, in the same units as var integer :: i, j, is, ie, js, je is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec @@ -3698,7 +3700,7 @@ subroutine homogenize_field_v(var, G, tmp_scale) real, optional, intent(in) :: tmp_scale !< A temporary rescaling factor for the !! variable that is reversed in the return value - real :: avg + real :: avg ! Global average of var, in the same units as var integer :: i, j, is, ie, jsB, jeB is = G%isc ; ie = G%iec ; jsB = G%jscB ; jeB = G%jecB @@ -3715,7 +3717,7 @@ subroutine homogenize_field_u(var, G, tmp_scale) real, optional, intent(in) :: tmp_scale !< A temporary rescaling factor for the !! variable that is reversed in the return value - real :: avg + real :: avg ! Global average of var, in the same units as var integer :: i, j, isB, ieB, js, je isB = G%iscB ; ieB = G%iecB ; js = G%jsc ; je = G%jec diff --git a/src/diagnostics/MOM_diagnostics.F90 b/src/diagnostics/MOM_diagnostics.F90 index 8d667503d7..ef71d9286c 100644 --- a/src/diagnostics/MOM_diagnostics.F90 +++ b/src/diagnostics/MOM_diagnostics.F90 @@ -1293,32 +1293,27 @@ subroutine post_surface_thermo_diags(IDs, G, GV, US, diag, dt_int, sfc_state, tv real, dimension(SZI_(G),SZJ_(G)) :: work_2d ! A 2-d work array real, dimension(SZI_(G),SZJ_(G)) :: & - zos ! dynamic sea lev (zero area mean) from inverse-barometer adjusted ssh [m] + zos ! dynamic sea lev (zero area mean) from inverse-barometer adjusted ssh [Z ~> m] real :: I_time_int ! The inverse of the time interval [T-1 ~> s-1]. - real :: zos_area_mean ! Global area mean sea surface height [m] + real :: zos_area_mean ! Global area mean sea surface height [Z ~> m] real :: volo ! Total volume of the ocean [m3] - real :: ssh_ga ! Global ocean area weighted mean sea seaface height [m] + real :: ssh_ga ! Global ocean area weighted mean sea seaface height [Z ~> m] integer :: i, j, is, ie, js, je is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ! area mean SSH if (IDs%id_ssh_ga > 0) then - ssh_ga = global_area_mean(ssh, G, scale=US%Z_to_m) + ssh_ga = global_area_mean(ssh, G, tmp_scale=US%Z_to_m) call post_data(IDs%id_ssh_ga, ssh_ga, diag) endif ! post the dynamic sea level, zos, and zossq. - ! zos is ave_ssh with sea ice inverse barometer removed, - ! and with zero global area mean. + ! zos is ave_ssh with sea ice inverse barometer removed, and with zero global area mean. if (IDs%id_zos > 0 .or. IDs%id_zossq > 0) then - zos(:,:) = 0.0 + zos_area_mean = global_area_mean(ssh_ibc, G, tmp_scale=US%Z_to_m) do j=js,je ; do i=is,ie - zos(i,j) = US%Z_to_m*ssh_ibc(i,j) - enddo ; enddo - zos_area_mean = global_area_mean(zos, G) - do j=js,je ; do i=is,ie - zos(i,j) = zos(i,j) - G%mask2dT(i,j)*zos_area_mean + zos(i,j) = ssh_ibc(i,j) - G%mask2dT(i,j)*zos_area_mean enddo ; enddo if (IDs%id_zos > 0) call post_data(IDs%id_zos, zos, diag, mask=G%mask2dT) if (IDs%id_zossq > 0) then @@ -1844,14 +1839,14 @@ subroutine register_surface_diags(Time, G, US, IDs, diag, tv) standard_name='sea_water_volume') IDs%id_zos = register_diag_field('ocean_model', 'zos', diag%axesT1, Time,& standard_name = 'sea_surface_height_above_geoid', & - long_name= 'Sea surface height above geoid', units='m') + long_name= 'Sea surface height above geoid', units='m', conversion=US%Z_to_m) IDs%id_zossq = register_diag_field('ocean_model', 'zossq', diag%axesT1, Time,& standard_name='square_of_sea_surface_height_above_geoid', & - long_name='Square of sea surface height above geoid', units='m2') + long_name='Square of sea surface height above geoid', units='m2', conversion=US%Z_to_m**2) IDs%id_ssh = register_diag_field('ocean_model', 'SSH', diag%axesT1, Time, & 'Sea Surface Height', 'm', conversion=US%Z_to_m) IDs%id_ssh_ga = register_scalar_field('ocean_model', 'ssh_ga', Time, diag,& - long_name='Area averaged sea surface height', units='m', & + long_name='Area averaged sea surface height', units='m', conversion=US%Z_to_m, & standard_name='area_averaged_sea_surface_height') IDs%id_ssu = register_diag_field('ocean_model', 'SSU', diag%axesCu1, Time, & 'Sea Surface Zonal Velocity', 'm s-1', conversion=US%L_T_to_m_s) diff --git a/src/framework/MOM_diag_mediator.F90 b/src/framework/MOM_diag_mediator.F90 index eb24c994f8..92d53330a7 100644 --- a/src/framework/MOM_diag_mediator.F90 +++ b/src/framework/MOM_diag_mediator.F90 @@ -2775,7 +2775,7 @@ end subroutine attach_cell_methods function register_scalar_field(module_name, field_name, init_time, diag_cs, & long_name, units, missing_value, range, standard_name, & do_not_log, err_msg, interp_method, cmor_field_name, & - cmor_long_name, cmor_units, cmor_standard_name) + cmor_long_name, cmor_units, cmor_standard_name, conversion) integer :: register_scalar_field !< An integer handle for a diagnostic array. character(len=*), intent(in) :: module_name !< Name of this module, usually "ocean_model" !! or "ice_shelf_model" @@ -2796,6 +2796,7 @@ function register_scalar_field(module_name, field_name, init_time, diag_cs, & character(len=*), optional, intent(in) :: cmor_long_name !< CMOR long name of a field character(len=*), optional, intent(in) :: cmor_units !< CMOR units of a field character(len=*), optional, intent(in) :: cmor_standard_name !< CMOR standardized name associated with a field + real, optional, intent(in) :: conversion !< A value to multiply data by before writing to file ! Local variables real :: MOM_missing_value @@ -2826,6 +2827,7 @@ function register_scalar_field(module_name, field_name, init_time, diag_cs, & call assert(associated(diag), 'register_scalar_field: diag allocation failed') diag%fms_diag_id = fms_id diag%debug_str = trim(module_name)//"-"//trim(field_name) + if (present(conversion)) diag%conversion_factor = conversion endif if (present(cmor_field_name)) then @@ -2856,6 +2858,7 @@ function register_scalar_field(module_name, field_name, init_time, diag_cs, & call alloc_diag_with_id(dm_id, diag_cs, cmor_diag) cmor_diag%fms_diag_id = fms_id cmor_diag%debug_str = trim(module_name)//"-"//trim(cmor_field_name) + if (present(conversion)) cmor_diag%conversion_factor = conversion endif endif diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index bcb17589dc..5db9198a22 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -136,7 +136,7 @@ module MOM_ice_shelf !!!! PHYSICAL AND NUMERICAL PARAMETERS FOR ICE DYNAMICS !!!!!! - real :: time_step !< this is the shortest timestep that the ice shelf sees, and + real :: time_step !< this is the shortest timestep that the ice shelf sees [T ~> s], and !! is equal to the forcing timestep (it is passed in when the shelf !! is initialized - so need to reorganize MOM driver. !! it will be the prognistic timestep ... maybe. @@ -153,8 +153,9 @@ module MOM_ice_shelf real :: min_thickness_simple_calve !< min. ice shelf thickness criteria for calving [Z ~> m]. real :: T0 !< temperature at ocean surface in the restoring region [degC] real :: S0 !< Salinity at ocean surface in the restoring region [ppt]. - real :: input_flux !< Ice volume flux at an upstream open boundary [m3 s-1]. - real :: input_thickness !< Ice thickness at an upstream open boundary [m]. + real :: input_flux !< The vertically integrated inward ice thickness flux per + !! unit face length at an upstream boundary [Z L T-1 ~> m2 s-1] + real :: input_thickness !< Ice thickness at an upstream open boundary [Z ~> m]. type(time_type) :: Time !< The component's time. type(EOS_type) :: eqn_of_state !< Type that indicates the @@ -368,7 +369,7 @@ subroutine shelf_calc_flux(sfc_state_in, fluxes_in, Time, time_step, CS) CS%Time = Time if (CS%override_shelf_movement) then - CS%time_step = time_step + CS%time_step = US%s_to_T*time_step ! update shelf mass if (CS%mass_from_file) call update_shelf_mass(G, US, CS, ISS, Time) endif @@ -1109,7 +1110,7 @@ subroutine add_shelf_flux(G, US, CS, sfc_state, fluxes) ! take into account changes in mass (or thickness) when imposing ice shelf mass if (CS%override_shelf_movement .and. CS%mass_from_file) then - dTime = real_to_time(CS%time_step) + dTime = real_to_time(US%T_to_s*CS%time_step) ! Compute changes in mass after at least one full time step if (CS%Time > dTime) then @@ -1144,8 +1145,8 @@ subroutine add_shelf_flux(G, US, CS, sfc_state, fluxes) delta_float_mass(i,j) = 0.0 endif enddo ; enddo - delta_mass_shelf = US%kg_m2s_to_RZ_T*(global_area_integral(delta_float_mass, G, scale=US%RZ_to_kg_m2, & - area=ISS%area_shelf_h) / CS%time_step) + delta_mass_shelf = global_area_integral(delta_float_mass, G, tmp_scale=US%RZ_to_kg_m2, & + area=ISS%area_shelf_h) / CS%time_step else! first time step delta_mass_shelf = 0.0 endif @@ -1166,8 +1167,8 @@ subroutine add_shelf_flux(G, US, CS, sfc_state, fluxes) balancing_area = global_area_integral(bal_frac, G) if (balancing_area > 0.0) then - balancing_flux = ( US%kg_m2s_to_RZ_T*global_area_integral(ISS%water_flux, G, scale=US%RZ_T_to_kg_m2s, & - area=ISS%area_shelf_h) + & + balancing_flux = ( global_area_integral(ISS%water_flux, G, tmp_scale=US%RZ_T_to_kg_m2s, & + area=ISS%area_shelf_h) + & delta_mass_shelf ) / balancing_area else balancing_flux = 0.0 @@ -1184,7 +1185,7 @@ subroutine add_shelf_flux(G, US, CS, sfc_state, fluxes) enddo ; enddo if (CS%debug) then - write(mesg,*) 'Balancing flux (kg/(m^2 s)), dt = ', balancing_flux*US%RZ_T_to_kg_m2s, CS%time_step + write(mesg,*) 'Balancing flux (kg/(m^2 s)), dt = ', balancing_flux*US%RZ_T_to_kg_m2s, US%T_to_s*CS%time_step call MOM_mesg(mesg) call MOM_forcing_chksum("After constant sea level", fluxes, G, CS%US, haloshift=0) endif @@ -1487,15 +1488,15 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces_in, if (CS%constant_sea_level) CS%min_ocean_mass_float = dz_ocean_min_float*CS%Rho_ocn call get_param(param_file, mdl, "ICE_SHELF_FLUX_FACTOR", CS%flux_factor, & - "Non-dimensional factor applied to shelf thermodynamic "//& - "fluxes.", units="none", default=1.0) + "Non-dimensional factor applied to shelf thermodynamic fluxes.", & + units="none", default=1.0) call get_param(param_file, mdl, "KV_ICE", CS%kv_ice, & "The viscosity of the ice.", & units="m2 s-1", default=1.0e10, scale=US%Z_to_L**2*US%m_to_L**2*US%T_to_s) call get_param(param_file, mdl, "KV_MOLECULAR", CS%kv_molec, & - "The molecular kinimatic viscosity of sea water at the "//& - "freezing temperature.", units="m2 s-1", default=1.95e-6, scale=US%m2_s_to_Z2_T) + "The molecular kinimatic viscosity of sea water at the freezing temperature.", & + units="m2 s-1", default=1.95e-6, scale=US%m2_s_to_Z2_T) call get_param(param_file, mdl, "ICE_SHELF_SALINITY", CS%Salin_ice, & "The salinity of the ice inside the ice shelf.", units="psu", & default=0.0) @@ -1511,7 +1512,7 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces_in, call get_param(param_file, mdl, "DT_FORCING", CS%time_step, & "The time step for changing forcing, coupling with other "//& "components, or potentially writing certain diagnostics. "//& - "The default value is given by DT.", units="s", default=0.0) + "The default value is given by DT.", units="s", default=0.0, scale=US%s_to_T) call get_param(param_file, mdl, "COL_THICK_MELT_THRESHOLD", col_thick_melt_thresh, & "The minimum ocean column thickness where melting is allowed.", & @@ -1571,9 +1572,9 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces_in, "A typical density of ice.", units="kg m-3", default=917.0, scale=US%kg_m3_to_R) call get_param(param_file, mdl, "INPUT_FLUX_ICE_SHELF", CS%input_flux, & - "volume flux at upstream boundary", units="m2 s-1", default=0.) + "volume flux at upstream boundary", units="m2 s-1", default=0., scale=US%m_to_Z*US%m_s_to_L_T) call get_param(param_file, mdl, "INPUT_THICK_ICE_SHELF", CS%input_thickness, & - "flux thickness at upstream boundary", units="m", default=1000.) + "flux thickness at upstream boundary", units="m", default=1000., scale=US%m_to_Z) else ! This is here because of inconsistent defaults. I don't know why. RWH call get_param(param_file, mdl, "DENSITY_ICE", CS%density_ice, & @@ -2005,7 +2006,7 @@ end subroutine initialize_shelf_mass !> This subroutine applies net accumulation/ablation at the top surface to the dynamic ice shelf. !>>acc_rate[m-s]=surf_mass_flux/density_ice is ablation/accumulation rate !>>positive for accumulation negative for ablation -subroutine change_thickness_using_precip(CS, ISS, G, US, fluxes,time_step, Time) +subroutine change_thickness_using_precip(CS, ISS, G, US, fluxes, time_step, Time) type(ice_shelf_CS), intent(in) :: CS !< A pointer to the ice shelf control structure type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure. type(ice_shelf_state), intent(inout) :: ISS !< A structure with elements that describe @@ -2113,8 +2114,8 @@ end subroutine update_shelf_mass subroutine ice_shelf_query(CS, G, frac_shelf_h, mass_shelf, data_override_shelf_fluxes) type(ice_shelf_CS), pointer :: CS !< ice shelf control structure type(ocean_grid_type), intent(in) :: G !< A pointer to an ocean grid control structure. - real, optional, dimension(SZI_(G),SZJ_(G)), intent(out) :: frac_shelf_h !< Ice shelf area fraction [nodim]. - real, optional, dimension(SZI_(G),SZJ_(G)), intent(out) :: mass_shelf ! kg m-2] + real, optional, dimension(SZI_(G),SZJ_(G)), intent(out) :: frac_shelf_h !< Ice shelf area fraction [nondim]. + real, optional, dimension(SZI_(G),SZJ_(G)), intent(out) :: mass_shelf ! kg m-2] logical, optional :: data_override_shelf_fluxes !< If true, shelf fluxes can be written using !! the data_override capability (only for MOSAIC grids) diff --git a/src/ice_shelf/MOM_marine_ice.F90 b/src/ice_shelf/MOM_marine_ice.F90 index 64d4dbfdab..f24f9b1881 100644 --- a/src/ice_shelf/MOM_marine_ice.F90 +++ b/src/ice_shelf/MOM_marine_ice.F90 @@ -176,8 +176,9 @@ subroutine marine_ice_init(Time, G, param_file, diag, CS) type(param_file_type), intent(in) :: param_file !< Runtime parameter handles type(diag_ctrl), target, intent(inout) :: diag !< Diagnostics control structure type(marine_ice_CS), pointer :: CS !< Pointer to the control structure for MOM_marine_ice -! This include declares and sets the variable "version". -#include "version_variable.h" + + ! This include declares and sets the variable "version". +# include "version_variable.h" character(len=40) :: mdl = "MOM_marine_ice" ! This module's name. if (associated(CS)) then @@ -197,8 +198,8 @@ subroutine marine_ice_init(Time, G, param_file, diag, CS) "The latent heat of fusion.", units="J/kg", default=hlf, scale=G%US%J_kg_to_Q) call get_param(param_file, mdl, "BERG_AREA_THRESHOLD", CS%berg_area_threshold, & "Fraction of grid cell which iceberg must occupy, so that fluxes "//& - "below berg are set to zero. Not applied for negative "//& - "values.", units="non-dim", default=-1.0) + "below berg are set to zero. Not applied for negative values.", & + units="nondim", default=-1.0) end subroutine marine_ice_init diff --git a/src/initialization/MOM_shared_initialization.F90 b/src/initialization/MOM_shared_initialization.F90 index fc5ceaf3e4..87de12a9fa 100644 --- a/src/initialization/MOM_shared_initialization.F90 +++ b/src/initialization/MOM_shared_initialization.F90 @@ -184,7 +184,7 @@ subroutine apply_topography_edits_from_file(D, G, param_file, US) type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type ! Local variables - real, dimension(:), allocatable :: new_depth ! The new values of the depths [m] + real, dimension(:), allocatable :: new_depth ! The new values of the depths [Z ~> m] integer, dimension(:), allocatable :: ig, jg ! The global indicies of the points to modify character(len=200) :: topo_edits_file, inputdir ! Strings for file/path character(len=40) :: mdl = "apply_topography_edits_from_file" ! This subroutine's name. @@ -247,22 +247,22 @@ subroutine apply_topography_edits_from_file(D, G, param_file, US) ! Read iEdit, jEdit and zEdit call read_variable(topo_edits_file, 'iEdit', ig, ncid_in=ncid) call read_variable(topo_edits_file, 'jEdit', jg, ncid_in=ncid) - call read_variable(topo_edits_file, 'zEdit', new_depth, ncid_in=ncid) + call read_variable(topo_edits_file, 'zEdit', new_depth, ncid_in=ncid, scale=US%m_to_Z) call close_file_to_read(ncid, topo_edits_file) do n = 1, n_edits i = ig(n) - G%isd_global + 2 ! +1 for python indexing and +1 for ig-isd_global+1 j = jg(n) - G%jsd_global + 2 if (i>=G%isc .and. i<=G%iec .and. j>=G%jsc .and. j<=G%jec) then - if (new_depth(n)*US%m_to_Z /= mask_depth) then + if (new_depth(n) /= mask_depth) then write(stdout,'(a,3i5,f8.2,a,f8.2,2i4)') & - 'Ocean topography edit: ', n, ig(n), jg(n), D(i,j)*US%Z_to_m, '->', abs(new_depth(n)), i, j - D(i,j) = abs(US%m_to_Z*new_depth(n)) ! Allows for height-file edits (i.e. converts negatives) + 'Ocean topography edit: ', n, ig(n), jg(n), D(i,j)*US%Z_to_m, '->', abs(US%Z_to_m*new_depth(n)), i, j + D(i,j) = abs(new_depth(n)) ! Allows for height-file edits (i.e. converts negatives) else if (topo_edits_change_mask) then write(stdout,'(a,3i5,f8.2,a,f8.2,2i4)') & - 'Ocean topography edit: ',n,ig(n),jg(n),D(i,j)*US%Z_to_m,'->',abs(new_depth(n)),i,j - D(i,j) = abs(US%m_to_Z*new_depth(n)) ! Allows for height-file edits (i.e. converts negatives) + 'Ocean topography edit: ',n,ig(n),jg(n),D(i,j)*US%Z_to_m,'->',abs(US%Z_to_m*new_depth(n)),i,j + D(i,j) = abs(new_depth(n)) ! Allows for height-file edits (i.e. converts negatives) else call MOM_error(FATAL, ' apply_topography_edits_from_file: '//& "A zero depth edit would change the land mask and is not allowed in"//trim(topo_edits_file)) @@ -454,8 +454,8 @@ subroutine set_rotation_planetary(f, G, param_file, US) call callTree_enter(trim(mdl)//"(), MOM_shared_initialization.F90") call get_param(param_file, "set_rotation_planetary", "OMEGA", omega, & - "The rotation rate of the earth.", units="s-1", & - default=7.2921e-5, scale=US%T_to_s) + "The rotation rate of the earth.", & + units="s-1", default=7.2921e-5, scale=US%T_to_s) PI = 4.0*atan(1.0) do I=G%IsdB,G%IedB ; do J=G%JsdB,G%JedB @@ -893,13 +893,13 @@ subroutine reset_face_lengths_list(G, param_file, US) allocate(v_line_used(num_lines), source=0) allocate(v_line_no(num_lines), source=0) - allocate(Dmin_u(num_lines)) ; Dmin_u(:) = 0.0 - allocate(Dmax_u(num_lines)) ; Dmax_u(:) = 0.0 - allocate(Davg_u(num_lines)) ; Davg_u(:) = 0.0 + allocate(Dmin_u(num_lines), source=0.0) + allocate(Dmax_u(num_lines), source=0.0) + allocate(Davg_u(num_lines), source=0.0) - allocate(Dmin_v(num_lines)) ; Dmin_v(:) = 0.0 - allocate(Dmax_v(num_lines)) ; Dmax_v(:) = 0.0 - allocate(Davg_v(num_lines)) ; Davg_v(:) = 0.0 + allocate(Dmin_v(num_lines), source=0.0) + allocate(Dmax_v(num_lines), source=0.0) + allocate(Davg_v(num_lines), source=0.0) ! Actually read the lines. if (is_root_pe()) then diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90 index d337e039e2..4e8dd4f186 100644 --- a/src/initialization/MOM_state_initialization.F90 +++ b/src/initialization/MOM_state_initialization.F90 @@ -1179,7 +1179,7 @@ subroutine trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read) fail_if_missing=.not.just_read, do_not_log=just_read) call get_param(PF, mdl, "SURFACE_PRESSURE_VAR", p_surf_var, & "The initial condition variable for the surface pressure exerted by ice.", & - units="Pa", default="", do_not_log=just_read) + default="", do_not_log=just_read) call get_param(PF, mdl, "INPUTDIR", inputdir, default=".", do_not_log=.true.) filename = trim(slasher(inputdir))//trim(p_surf_file) if (.not.just_read) call log_param(PF, mdl, "!INPUTDIR/SURFACE_HEIGHT_IC_FILE", filename) diff --git a/src/parameterizations/lateral/MOM_internal_tides.F90 b/src/parameterizations/lateral/MOM_internal_tides.F90 index 9efb455854..c426b20a6a 100644 --- a/src/parameterizations/lateral/MOM_internal_tides.F90 +++ b/src/parameterizations/lateral/MOM_internal_tides.F90 @@ -18,15 +18,13 @@ module MOM_internal_tides use MOM_grid, only : ocean_grid_type use MOM_io, only : slasher, MOM_read_data, file_exists use MOM_restart, only : register_restart_field, MOM_restart_CS, restart_init, save_restart -use MOM_spatial_means, only : global_area_mean +use MOM_spatial_means, only : global_area_integral use MOM_time_manager, only : time_type, time_type_to_real, operator(+), operator(/), operator(-) use MOM_unit_scaling, only : unit_scale_type use MOM_variables, only : surface, thermo_var_ptrs use MOM_verticalGrid, only : verticalGrid_type use MOM_wave_structure, only: wave_structure_init, wave_structure, wave_structure_CS -!use, intrinsic :: IEEE_ARITHMETIC - implicit none ; private #include @@ -52,11 +50,11 @@ module MOM_internal_tides logical :: use_PPMang !< If true, use PPM for advection of energy in angular space. real, allocatable, dimension(:,:) :: refl_angle - !< local coastline/ridge/shelf angles read from file + !< local coastline/ridge/shelf angles read from file [rad] ! (could be in G control structure) - real :: nullangle = -999.9 !< placeholder value in cells with no reflection + real :: nullangle = -999.9 !< placeholder value in cells with no reflection [rad] real, allocatable, dimension(:,:) :: refl_pref - !< partial reflection coeff for each "coast cell" + !< partial reflection coeff for each "coast cell" [nondim] ! (could be in G control structure) logical, allocatable, dimension(:,:) :: refl_pref_logical !< true if reflecting cell with partial reflection @@ -98,11 +96,11 @@ module MOM_internal_tides real, allocatable, dimension(:,:) :: tot_allprocesses_loss !< Energy loss rates due to all processes, !! summed over angle, frequency and mode [R Z3 T-3 ~> W m-2] real :: q_itides !< fraction of local dissipation [nondim] - real :: En_sum !< global sum of energy for use in debugging [R Z3 T-2 ~> J m-2] + real :: En_sum !< global sum of energy for use in debugging, in MKS units [J] type(time_type), pointer :: Time => NULL() !< A pointer to the model's clock. character(len=200) :: inputdir !< directory to look for coastline angle file real :: decay_rate !< A constant rate at which internal tide energy is - !! lost to the interior ocean internal wave field. + !! lost to the interior ocean internal wave field [T-1 ~> s-1]. real :: cdrag !< The bottom drag coefficient [nondim]. real :: drag_min_depth !< The minimum total ocean thickness that will be used in the denominator !! of the quadratic drag terms for internal tides when @@ -537,7 +535,7 @@ subroutine propagate_int_tide(h, tv, cn, TKE_itidal_input, vel_btTide, Nb, dt, & ! Check for energy conservation on computational domain.************************* do m=1,CS%NMode ; do fr=1,CS%Nfreq - call sum_En(G,CS,CS%En(:,:,:,fr,m),'prop_int_tide') + call sum_En(G, US, CS, CS%En(:,:,:,fr,m), 'prop_int_tide') enddo ; enddo ! Output diagnostics.************************************************************ @@ -647,25 +645,23 @@ subroutine propagate_int_tide(h, tv, cn, TKE_itidal_input, vel_btTide, Nb, dt, & end subroutine propagate_int_tide !> Checks for energy conservation on computational domain -subroutine sum_En(G, CS, En, label) +subroutine sum_En(G, US, CS, En, label) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. + type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(int_tide_CS), intent(inout) :: CS !< Internal tide control struct real, dimension(G%isd:G%ied,G%jsd:G%jed,CS%NAngle), & intent(in) :: En !< The energy density of the internal tides [R Z3 T-2 ~> J m-2]. character(len=*), intent(in) :: label !< A label to use in error messages ! Local variables - real :: En_sum ! The total energy [R Z3 T-2 ~> J m-2] - real :: tmpForSumming + real :: En_sum ! The total energy in MKS units for potential output [J] integer :: m,fr,a ! real :: En_sum_diff, En_sum_pdiff ! character(len=160) :: mesg ! The text of an error message ! real :: days En_sum = 0.0 - tmpForSumming = 0.0 do a=1,CS%nAngle - tmpForSumming = global_area_mean(En(:,:,a),G)*G%areaT_global - En_sum = En_sum + tmpForSumming + En_sum = En_sum + global_area_integral(En(:,:,a), G, scale=US%RZ3_T3_to_W_m2*US%T_to_s) enddo CS%En_sum = En_sum !En_sum_diff = En_sum - CS%En_sum @@ -1143,7 +1139,7 @@ subroutine propagate(En, cn, freq, dt, G, US, CS, NAngle, residual_loss) call propagate_x(En, speed_x, Cgx_av, dCgx, dt, G, US, CS%nAngle, CS, LB, residual_loss) ! Check for energy conservation on computational domain (for debugging) - !call sum_En(G, CS, En, 'post-propagate_x') + !call sum_En(G, US, CS, En, 'post-propagate_x') ! Update halos call pass_var(En, G%domain) @@ -1155,7 +1151,7 @@ subroutine propagate(En, cn, freq, dt, G, US, CS, NAngle, residual_loss) call propagate_y(En, speed_y, Cgy_av, dCgy, dt, G, US, CS%nAngle, CS, LB, residual_loss) ! Check for energy conservation on computational domain (for debugging) - !call sum_En(G, CS, En, 'post-propagate_y') + !call sum_En(G, US, CS, En, 'post-propagate_y') endif end subroutine propagate @@ -1712,6 +1708,7 @@ subroutine reflect(En, NAngle, CS, G, LB) !! [R Z3 T-2 ~> J m-2]. type(int_tide_CS), intent(in) :: CS !< Internal tide control struct type(loop_bounds_type), intent(in) :: LB !< A structure with the active energy loop bounds. + ! Local variables real, dimension(G%isd:G%ied,G%jsd:G%jed) :: angle_c ! angle of boundary wrt equator [rad] @@ -1724,11 +1721,11 @@ subroutine reflect(En, NAngle, CS, G, LB) real :: TwoPi ! 2*pi = 6.2831853... [nondim] real :: Angle_size ! size of beam wedge [rad] - integer :: angle_wall ! angle of coast/ridge/shelf wrt equator [nondim] - integer :: angle_wall0 ! angle of coast/ridge/shelf wrt equator [nondim] - integer :: angle_r ! angle of reflected ray wrt equator [nondim] - integer :: angle_r0 ! angle of reflected ray wrt equator [nondim] - integer :: angle_to_wall ! angle relative to wall [nondim] + integer :: angle_wall ! angle-bin of coast/ridge/shelf wrt equator + integer :: angle_wall0 ! angle-bin of coast/ridge/shelf wrt equator + integer :: angle_r ! angle-bin of reflected ray wrt equator + integer :: angle_r0 ! angle-bin of reflected ray wrt equator + integer :: angle_to_wall ! angle-bin relative to wall integer :: a, a0 ! loop index for angles integer :: i, j, i_global integer :: Nangle_d2 ! Nangle / 2 diff --git a/src/tracer/MOM_neutral_diffusion.F90 b/src/tracer/MOM_neutral_diffusion.F90 index fd479eeaf3..1a80829255 100644 --- a/src/tracer/MOM_neutral_diffusion.F90 +++ b/src/tracer/MOM_neutral_diffusion.F90 @@ -244,9 +244,6 @@ logical function neutral_diffusion_init(Time, G, GV, US, param_file, diag, EOS, ! Store a rescaling factor for use in diagnostic messages. CS%R_to_kg_m3 = US%R_to_kg_m3 -! call get_param(param_file, mdl, "KHTR", CS%KhTr, & -! "The background along-isopycnal tracer diffusivity.", & -! units="m2 s-1", default=0.0) ! call closeParameterBlock(param_file) if (CS%continuous_reconstruction) then CS%nsurf = 2*GV%ke+2 ! Continuous reconstruction means that every interface has two connections @@ -269,17 +266,17 @@ logical function neutral_diffusion_init(Time, G, GV, US, param_file, diag, EOS, allocate(CS%Pint(SZI_(G),SZJ_(G),SZK_(GV)+1), source=0.) allocate(CS%stable_cell(SZI_(G),SZJ_(G),SZK_(GV)), source=.true.) ! U-points - allocate(CS%uPoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%uPoL(G%isc-1:G%iec,G%jsc:G%jec,:) = 0. - allocate(CS%uPoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%uPoR(G%isc-1:G%iec,G%jsc:G%jec,:) = 0. - allocate(CS%uKoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%uKoL(G%isc-1:G%iec,G%jsc:G%jec,:) = 0 - allocate(CS%uKoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%uKoR(G%isc-1:G%iec,G%jsc:G%jec,:) = 0 - allocate(CS%uHeff(G%isd:G%ied,G%jsd:G%jed,CS%nsurf-1)); CS%uHeff(G%isc-1:G%iec,G%jsc:G%jec,:) = 0 + allocate(CS%uPoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0.) + allocate(CS%uPoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0.) + allocate(CS%uKoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0) + allocate(CS%uKoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0) + allocate(CS%uHeff(G%isd:G%ied,G%jsd:G%jed,CS%nsurf-1), source=0.) ! V-points - allocate(CS%vPoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%vPoL(G%isc:G%iec,G%jsc-1:G%jec,:) = 0. - allocate(CS%vPoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%vPoR(G%isc:G%iec,G%jsc-1:G%jec,:) = 0. - allocate(CS%vKoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%vKoL(G%isc:G%iec,G%jsc-1:G%jec,:) = 0 - allocate(CS%vKoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf)); CS%vKoR(G%isc:G%iec,G%jsc-1:G%jec,:) = 0 - allocate(CS%vHeff(G%isd:G%ied,G%jsd:G%jed,CS%nsurf-1)); CS%vHeff(G%isc:G%iec,G%jsc-1:G%jec,:) = 0 + allocate(CS%vPoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0.) + allocate(CS%vPoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0.) + allocate(CS%vKoL(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0) + allocate(CS%vKoR(G%isd:G%ied,G%jsd:G%jed, CS%nsurf), source=0) + allocate(CS%vHeff(G%isd:G%ied,G%jsd:G%jed,CS%nsurf-1), source=0.) end function neutral_diffusion_init @@ -577,7 +574,7 @@ subroutine neutral_diffusion(G, GV, h, Coef_x, Coef_y, dt, Reg, US, CS) integer :: i, j, k, m, ks, nk real :: Idt ! The inverse of the time step [T-1 ~> s-1] - real :: h_neglect, h_neglect_edge + real :: h_neglect, h_neglect_edge ! Negligible thicknesses [H ~> m or kg m-2] h_neglect = GV%H_subroundoff ; h_neglect_edge = GV%H_subroundoff diff --git a/src/user/Idealized_Hurricane.F90 b/src/user/Idealized_Hurricane.F90 index 707a0972f9..d067b76eff 100644 --- a/src/user/Idealized_Hurricane.F90 +++ b/src/user/Idealized_Hurricane.F90 @@ -133,8 +133,8 @@ subroutine idealized_hurricane_wind_init(Time, G, US, param_file, CS) units='Pa', default=96800., scale=US%m_s_to_L_T**2*US%kg_m3_to_R) call get_param(param_file, mdl, "IDL_HURR_RAD_MAX_WIND", & CS%rad_max_wind, "Radius of maximum winds used in the "//& - "idealized hurricane wind profile.", units='m', & - default=50.e3, scale=US%m_to_L) + "idealized hurricane wind profile.", & + units='m', default=50.e3, scale=US%m_to_L) call get_param(param_file, mdl, "IDL_HURR_MAX_WIND", CS%max_windspeed, & "Maximum wind speed used in the idealized hurricane"// & "wind profile.", units='m/s', default=65., scale=US%m_s_to_L_T) @@ -143,8 +143,8 @@ subroutine idealized_hurricane_wind_init(Time, G, US, param_file, CS) "hurricane wind profile.", units='m/s', default=5.0, scale=US%m_s_to_L_T) call get_param(param_file, mdl, "IDL_HURR_TRAN_DIR", CS%hurr_translation_dir, & "Translation direction (towards) of hurricane used in the "//& - "idealized hurricane wind profile.", units='degrees', & - default=180.0, scale=CS%Deg2Rad) + "idealized hurricane wind profile.", & + units='degrees', default=180.0, scale=CS%Deg2Rad) call get_param(param_file, mdl, "IDL_HURR_X0", CS%Hurr_cen_X0, & "Idealized Hurricane initial X position", & units='m', default=0., scale=US%m_to_L) @@ -152,19 +152,17 @@ subroutine idealized_hurricane_wind_init(Time, G, US, param_file, CS) "Idealized Hurricane initial Y position", & units='m', default=0., scale=US%m_to_L) call get_param(param_file, mdl, "IDL_HURR_TAU_CURR_REL", CS%relative_tau, & - "Current relative stress switch "//& - "used in the idealized hurricane wind profile.", & - units='', default=.false.) + "Current relative stress switch used in the idealized hurricane wind profile.", & + default=.false.) ! Parameters for SCM mode call get_param(param_file, mdl, "IDL_HURR_SCM_BR_BENCH", CS%BR_BENCH, & "Single column mode benchmark case switch, which is "// & "invoking a modification (bug) in the wind profile meant to "//& - "reproduce a previous implementation.", units='', default=.false.) + "reproduce a previous implementation.", default=.false.) call get_param(param_file, mdl, "IDL_HURR_SCM", CS%SCM_MODE, & - "Single Column mode switch "//& - "used in the SCM idealized hurricane wind profile.", & - units='', default=.false.) + "Single Column mode switch used in the SCM idealized hurricane wind profile.", & + default=.false.) call get_param(param_file, mdl, "IDL_HURR_SCM_LOCY", CS%dy_from_center, & "Y distance of station used in the SCM idealized hurricane "//& "wind profile.", units='m', default=50.e3, scale=US%m_to_L) @@ -186,8 +184,8 @@ subroutine idealized_hurricane_wind_init(Time, G, US, param_file, CS) "parameters from vertical units of m to kg m-2.", & units="kg m-3", default=1035.0, scale=US%kg_m3_to_R, do_not_log=.true.) call get_param(param_file, mdl, "GUST_CONST", CS%gustiness, & - "The background gustiness in the winds.", units="Pa", & - default=0.0, scale=US%kg_m3_to_R*US%m_s_to_L_T**2*US%L_to_Z, do_not_log=.true.) + "The background gustiness in the winds.", & + units="Pa", default=0.0, scale=US%kg_m2s_to_RZ_T*US%m_s_to_L_T, do_not_log=.true.) if (CS%BR_BENCH) then CS%rho_a = 1.2*US%kg_m3_to_R diff --git a/src/user/MOM_wave_interface.F90 b/src/user/MOM_wave_interface.F90 index a26bca4711..3077d81bb2 100644 --- a/src/user/MOM_wave_interface.F90 +++ b/src/user/MOM_wave_interface.F90 @@ -241,10 +241,10 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag ) call log_version(param_file, mdl, version) ! Langmuir number Options - call get_param(param_file, mdl, "LA_DEPTH_RATIO", CS%LA_FracHBL, & - "The depth (normalized by BLD) to average Stokes drift over in "//& - "Langmuir number calculation, where La = sqrt(ust/Stokes).", & - units="nondim", default=0.04) + call get_param(param_file, mdl, "LA_DEPTH_RATIO", CS%LA_FracHBL, & + "The depth (normalized by BLD) to average Stokes drift over in "//& + "Langmuir number calculation, where La = sqrt(ust/Stokes).", & + units="nondim", default=0.04) if (StatisticalWaves) then CS%WaveMethod = LF17 @@ -256,25 +256,25 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag ) ! Wave modified physics ! Presently these are all in research mode call get_param(param_file, mdl, "LAGRANGIAN_MIXING", CS%LagrangianMixing, & - "Flag to use Lagrangian Mixing of momentum", units="", & - Default=.false., do_not_log=.not.use_waves) + "Flag to use Lagrangian Mixing of momentum", default=.false., & + do_not_log=.not.use_waves) if (CS%LagrangianMixing) then ! Force Code Intervention call MOM_error(FATAL,"Should you be enabling Lagrangian Mixing? Code not ready.") endif call get_param(param_file, mdl, "STOKES_MIXING", CS%StokesMixing, & - "Flag to use Stokes Mixing of momentum", units="", & - Default=.false., do_not_log=.not.use_waves) + "Flag to use Stokes Mixing of momentum", default=.false., & + do_not_log=.not.use_waves) if (CS%StokesMixing) then ! Force Code Intervention - call MOM_error(FATAL,"Should you be enabling Stokes Mixing? Code not ready.") + call MOM_error(FATAL, "Should you be enabling Stokes Mixing? Code not ready.") endif call get_param(param_file, mdl, "CORIOLIS_STOKES", CS%CoriolisStokes, & - "Flag to use Coriolis Stokes acceleration", units="", & - Default=.false., do_not_log=.not.use_waves) + "Flag to use Coriolis Stokes acceleration", default=.false., & + do_not_log=.not.use_waves) if (CS%CoriolisStokes) then ! Force Code Intervention - call MOM_error(FATAL,"Should you be enabling Coriolis-Stokes? Code not ready.") + call MOM_error(FATAL, "Should you be enabling Coriolis-Stokes? Code not ready.") endif ! Get Wave Method and write to integer WaveMethod @@ -293,7 +293,7 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag ) " directly from WW3 and is based on the \n"// & " surface layer and projected Langmuir \n"// & " number (Li 2016)\n", & - units='', default=NULL_STRING) + default=NULL_STRING) select case (TRIM(TMPSTRING1)) case (NULL_STRING)! No Waves call MOM_error(FATAL, "wave_interface_init called with no specified "//& @@ -311,12 +311,11 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag ) units='m', default=50.0, scale=US%m_to_Z) case (SURFBANDS_STRING)! Surface Stokes Drift Bands CS%WaveMethod = SURFBANDS - call get_param(param_file, mdl, "SURFBAND_SOURCE", TMPSTRING2, & - "Choice of SURFACE_BANDS data mode, valid options include: \n"// & - " DATAOVERRIDE - Read from NetCDF using FMS DataOverride. \n"// & - " COUPLER - Look for variables from coupler pass \n"// & - " INPUT - Testing with fixed values.", & - units='', default=NULL_STRING) + call get_param(param_file, mdl, "SURFBAND_SOURCE", TMPSTRING2, & + "Choice of SURFACE_BANDS data mode, valid options include: \n"//& + " DATAOVERRIDE - Read from NetCDF using FMS DataOverride. \n"//& + " COUPLER - Look for variables from coupler pass \n"//& + " INPUT - Testing with fixed values.", default=NULL_STRING) select case (TRIM(TMPSTRING2)) case (NULL_STRING)! Default call MOM_error(FATAL, "wave_interface_init called with SURFACE_BANDS"//& @@ -328,10 +327,10 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag ) case (COUPLER_STRING)! Reserved for coupling CS%DataSource = COUPLER ! This is just to make something work, but it needs to be read from the wavemodel. - call get_param(param_file,mdl,"STK_BAND_COUPLER",CS%NumBands, & - "STK_BAND_COUPLER is the number of Stokes drift bands in the coupler. "// & - "This has to be consistent with the number of Stokes drift bands in WW3, "//& - "or the model will fail.",units='', default=1) + call get_param(param_file, mdl, "STK_BAND_COUPLER",CS%NumBands, & + "STK_BAND_COUPLER is the number of Stokes drift bands in the coupler. "//& + "This has to be consistent with the number of Stokes drift bands in WW3, "//& + "or the model will fail.", default=1) allocate( CS%WaveNum_Cen(CS%NumBands), source=0.0 ) allocate( CS%STKx0(G%isdB:G%iedB,G%jsd:G%jed,CS%NumBands), source=0.0 ) allocate( CS%STKy0(G%isdB:G%iedB,G%jsd:G%jed,CS%NumBands), source=0.0 ) @@ -341,11 +340,10 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag ) units='rad/m', default=0.12566, scale=US%Z_to_m) case (INPUT_STRING)! A method to input the Stokes band (globally uniform) CS%DataSource = INPUT - call get_param(param_file,mdl,"SURFBAND_NB",CS%NumBands, & - "Prescribe number of wavenumber bands for Stokes drift. "// & - "Make sure this is consistnet w/ WAVENUMBERS, STOKES_X, and "// & - "STOKES_Y, there are no safety checks in the code.", & - units='', default=1) + call get_param(param_file, mdl, "SURFBAND_NB", CS%NumBands, & + "Prescribe number of wavenumber bands for Stokes drift. "//& + "Make sure this is consistnet w/ WAVENUMBERS, STOKES_X, and "//& + "STOKES_Y, there are no safety checks in the code.", default=1) allocate( CS%WaveNum_Cen(1:CS%NumBands), source=0.0 ) allocate( CS%PrescribedSurfStkX(1:CS%NumBands), source=0.0 ) allocate( CS%PrescribedSurfStkY(1:CS%NumBands), source=0.0 ) @@ -370,17 +368,15 @@ subroutine MOM_wave_interface_init(time, G, GV, US, param_file, CS, diag ) call MOM_error(WARNING,"DHH85 only ever set-up for uniform cases w/"//& " Stokes drift in x-direction.") call get_param(param_file, mdl, "DHH85_AGE_FP", CS%WaveAgePeakFreq, & - "Choose true to use waveage in peak frequency.", & - units='', default=.false.) + "Choose true to use waveage in peak frequency.", default=.false.) call get_param(param_file, mdl, "DHH85_AGE", CS%WaveAge, & "Wave Age for DHH85 spectrum.", & units='', default=1.2) - call get_param(param_file,mdl,"DHH85_WIND", CS%WaveWind, & + call get_param(param_file, mdl, "DHH85_WIND", CS%WaveWind, & "Wind speed for DHH85 spectrum.", & units='m s-1', default=10.0, scale=US%m_s_to_L_T) - call get_param(param_file,mdl,"STATIC_DHH85", CS%StaticWaves, & - "Flag to disable updating DHH85 Stokes drift.", & - default=.false.) + call get_param(param_file, mdl, "STATIC_DHH85", CS%StaticWaves, & + "Flag to disable updating DHH85 Stokes drift.", default=.false.) case (LF17_STRING)!Li and Fox-Kemper 17 wind-sea Langmuir number CS%WaveMethod = LF17 case (EFACTOR_STRING)!Li and Fox-Kemper 16 diff --git a/src/user/Phillips_initialization.F90 b/src/user/Phillips_initialization.F90 index db1b512ca9..7f958cfb7e 100644 --- a/src/user/Phillips_initialization.F90 +++ b/src/user/Phillips_initialization.F90 @@ -265,8 +265,8 @@ subroutine Phillips_initialize_sponges(G, GV, US, tv, param_file, CSp, h) "The fractional depth where the stratificaiton is centered.", & units="nondim", default = 0.5) call get_param(param_file, mdl, "SPONGE_RATE", damp_rate, & - "The rate at which the zonal-mean sponges damp.", units="s-1", & - default = 1.0/(10.0*86400.0), scale=US%T_to_s) + "The rate at which the zonal-mean sponges damp.", & + units="s-1", default = 1.0/(10.0*86400.0), scale=US%T_to_s) call get_param(param_file, mdl, "JET_WIDTH", jet_width, & "The width of the zonal-mean jet.", units="km", & diff --git a/src/user/SCM_CVMix_tests.F90 b/src/user/SCM_CVMix_tests.F90 index 5bbe65b8d8..74cf31a22b 100644 --- a/src/user/SCM_CVMix_tests.F90 +++ b/src/user/SCM_CVMix_tests.F90 @@ -143,48 +143,39 @@ subroutine SCM_CVMix_tests_surface_forcing_init(Time, G, param_file, CS) ! Read all relevant parameters and write them to the model log. call log_version(param_file, mdl, version, "") - call get_param(param_file, mdl, "SCM_USE_WIND_STRESS", & - CS%UseWindStress, "Wind Stress switch "// & - "used in the SCM CVMix surface forcing.", & - units='', default=.false.) - call get_param(param_file, mdl, "SCM_USE_HEAT_FLUX", & - CS%UseHeatFlux, "Heat flux switch "// & - "used in the SCM CVMix test surface forcing.", & - units='', default=.false.) - call get_param(param_file, mdl, "SCM_USE_EVAPORATION", & - CS%UseEvaporation, "Evaporation switch "// & - "used in the SCM CVMix test surface forcing.", & - units='', default=.false.) - call get_param(param_file, mdl, "SCM_USE_DIURNAL_SW", & - CS%UseDiurnalSW, "Diurnal sw radation switch "// & - "used in the SCM CVMix test surface forcing.", & - units='', default=.false.) + call get_param(param_file, mdl, "SCM_USE_WIND_STRESS", CS%UseWindStress, & + "Wind Stress switch used in the SCM CVMix surface forcing.", & + default=.false.) + call get_param(param_file, mdl, "SCM_USE_HEAT_FLUX", CS%UseHeatFlux, & + "Heat flux switch used in the SCM CVMix test surface forcing.", & + default=.false.) + call get_param(param_file, mdl, "SCM_USE_EVAPORATION", CS%UseEvaporation, & + "Evaporation switch used in the SCM CVMix test surface forcing.", & + default=.false.) + call get_param(param_file, mdl, "SCM_USE_DIURNAL_SW", CS%UseDiurnalSW, & + "Diurnal sw radation switch used in the SCM CVMix test surface forcing.", & + default=.false.) if (CS%UseWindStress) then - call get_param(param_file, mdl, "SCM_TAU_X", & - CS%tau_x, "Constant X-dir wind stress "// & - "used in the SCM CVMix test surface forcing.", & + call get_param(param_file, mdl, "SCM_TAU_X", CS%tau_x, & + "Constant X-dir wind stress used in the SCM CVMix test surface forcing.", & units='N/m2', scale=US%kg_m2s_to_RZ_T*US%m_s_to_L_T, fail_if_missing=.true.) - call get_param(param_file, mdl, "SCM_TAU_Y", & - CS%tau_y, "Constant y-dir wind stress "// & - "used in the SCM CVMix test surface forcing.", & + call get_param(param_file, mdl, "SCM_TAU_Y", CS%tau_y, & + "Constant y-dir wind stress used in the SCM CVMix test surface forcing.", & units='N/m2', scale=US%kg_m2s_to_RZ_T*US%m_s_to_L_T, fail_if_missing=.true.) endif if (CS%UseHeatFlux) then - call get_param(param_file, mdl, "SCM_HEAT_FLUX", & - CS%surf_HF, "Constant surface heat flux "// & - "used in the SCM CVMix test surface forcing.", & + call get_param(param_file, mdl, "SCM_HEAT_FLUX", CS%surf_HF, & + "Constant surface heat flux used in the SCM CVMix test surface forcing.", & units='m K/s', scale=US%m_to_Z*US%T_to_s, fail_if_missing=.true.) endif if (CS%UseEvaporation) then - call get_param(param_file, mdl, "SCM_EVAPORATION", & - CS%surf_evap, "Constant surface evaporation "// & - "used in the SCM CVMix test surface forcing.", & + call get_param(param_file, mdl, "SCM_EVAPORATION", CS%surf_evap, & + "Constant surface evaporation used in the SCM CVMix test surface forcing.", & units='m/s', scale=US%m_to_Z*US%T_to_s, fail_if_missing=.true.) endif if (CS%UseDiurnalSW) then - call get_param(param_file, mdl, "SCM_DIURNAL_SW_MAX", & - CS%Max_sw, "Maximum diurnal sw radiation "// & - "used in the SCM CVMix test surface forcing.", & + call get_param(param_file, mdl, "SCM_DIURNAL_SW_MAX", CS%Max_sw, & + "Maximum diurnal sw radiation used in the SCM CVMix test surface forcing.", & units='m K/s', scale=US%m_to_Z*US%T_to_s, fail_if_missing=.true.) endif call get_param(param_file, mdl, "RHO_0", CS%Rho0, & diff --git a/src/user/dumbbell_initialization.F90 b/src/user/dumbbell_initialization.F90 index ac4181d570..20beebc67f 100644 --- a/src/user/dumbbell_initialization.F90 +++ b/src/user/dumbbell_initialization.F90 @@ -51,10 +51,10 @@ subroutine dumbbell_initialize_topography( D, G, param_file, max_depth ) real :: x, y, delta, dblen, dbfrac logical :: dbrotate - call get_param(param_file, mdl,"DUMBBELL_LEN",dblen, & + call get_param(param_file, mdl, "DUMBBELL_LEN",dblen, & 'Lateral Length scale for dumbbell.',& - units='k', default=600., do_not_log=.false.) - call get_param(param_file, mdl,"DUMBBELL_FRACTION",dbfrac, & + units='km', default=600., do_not_log=.false.) + call get_param(param_file, mdl, "DUMBBELL_FRACTION",dbfrac, & 'Meridional fraction for narrow part of dumbbell.',& units='nondim', default=0.5, do_not_log=.false.) call get_param(param_file, mdl, "DUMBBELL_ROTATION", dbrotate, & @@ -141,8 +141,8 @@ subroutine dumbbell_initialize_thickness ( h, depth_tot, G, GV, US, param_file, select case ( coordinateMode(verticalCoordinate) ) case ( REGRIDDING_LAYER, REGRIDDING_RHO ) ! Initial thicknesses for isopycnal coordinates - call get_param(param_file, mdl,"INITIAL_SSS", S_surf, default=34., do_not_log=.true.) - call get_param(param_file, mdl,"INITIAL_S_RANGE", S_range, default=2., do_not_log=.true.) + call get_param(param_file, mdl, "INITIAL_SSS", S_surf, default=34., do_not_log=.true.) + call get_param(param_file, mdl, "INITIAL_S_RANGE", S_range, default=2., do_not_log=.true.) call get_param(param_file, mdl, "S_REF", S_ref, default=35.0, do_not_log=.true.) call get_param(param_file, mdl, "TS_RANGE_S_LIGHT", S_light, default = S_Ref, do_not_log=.true.) call get_param(param_file, mdl, "TS_RANGE_S_DENSE", S_dense, default = S_Ref, do_not_log=.true.) @@ -230,23 +230,23 @@ subroutine dumbbell_initialize_temperature_salinity ( T, S, h, G, GV, param_file call get_param(param_file, mdl, "REGRIDDING_COORDINATE_MODE", verticalCoordinate, & default=DEFAULT_COORDINATE_MODE, do_not_log=just_read) - call get_param(param_file, mdl,"INITIAL_DENSITY_PROFILE", density_profile, & + call get_param(param_file, mdl, "INITIAL_DENSITY_PROFILE", density_profile, & 'Initial profile shape. Valid values are "linear", "parabolic" '// & 'and "exponential".', default='linear', do_not_log=just_read) - call get_param(param_file, mdl,"DUMBBELL_SREF", S_surf, & + call get_param(param_file, mdl, "DUMBBELL_SREF", S_surf, & 'DUMBBELL REFERENCE SALINITY', units='1e-3', default=34., do_not_log=just_read) - call get_param(param_file, mdl,"DUMBBELL_S_RANGE", S_range, & - 'DUMBBELL salinity range (right-left)', units='1e-3', & - default=2., do_not_log=just_read) - call get_param(param_file, mdl,"DUMBBELL_LEN",dblen, & - 'Lateral Length scale for dumbbell ',& - units='k', default=600., do_not_log=just_read) + call get_param(param_file, mdl, "DUMBBELL_S_RANGE", S_range, & + 'DUMBBELL salinity range (right-left)', units='1e-3', default=2., & + do_not_log=just_read) + call get_param(param_file, mdl, "DUMBBELL_LEN", dblen, & + 'Lateral Length scale for dumbbell ', & + units='km', default=600., do_not_log=just_read) call get_param(param_file, mdl, "DUMBBELL_ROTATION", dbrotate, & - 'Logical for rotation of dumbbell domain.',& + 'Logical for rotation of dumbbell domain.', & units='nondim', default=.false., do_not_log=just_read) if (G%x_axis_units == 'm') then - dblen=dblen*1.e3 + dblen = dblen*1.e3 endif do j=G%jsc,G%jec @@ -259,16 +259,16 @@ subroutine dumbbell_initialize_temperature_salinity ( T, S, h, G, GV, param_file x = ( G%geoLonT(i,j) ) / dblen endif do k=1,nz - T(i,j,k)=T_surf + T(i,j,k) = T_surf enddo if (x>=0. ) then do k=1,nz - S(i,j,k)=S_surf + 0.5*S_range + S(i,j,k) = S_surf + 0.5*S_range enddo endif if (x<0. ) then do k=1,nz - S(i,j,k)=S_surf - 0.5*S_range + S(i,j,k) = S_surf - 0.5*S_range enddo endif @@ -303,7 +303,7 @@ subroutine dumbbell_initialize_sponges(G, GV, US, tv, depth_tot, param_file, use call get_param(param_file, mdl,"DUMBBELL_LEN",dblen, & 'Lateral Length scale for dumbbell ',& - units='k', default=600., do_not_log=.true.) + units='km', default=600., do_not_log=.true.) call get_param(param_file, mdl, "DUMBBELL_ROTATION", dbrotate, & 'Logical for rotation of dumbbell domain.',& units='nondim', default=.false., do_not_log=.true.) @@ -378,12 +378,12 @@ subroutine dumbbell_initialize_sponges(G, GV, US, tv, depth_tot, param_file, use endif if (x>=0.25 ) then do k=1,nz - S(i,j,k)=S_ref + 0.5*S_range + S(i,j,k) = S_ref + 0.5*S_range enddo endif if (x<=-0.25 ) then do k=1,nz - S(i,j,k)=S_ref - 0.5*S_range + S(i,j,k) = S_ref - 0.5*S_range enddo endif enddo ; enddo diff --git a/src/user/dumbbell_surface_forcing.F90 b/src/user/dumbbell_surface_forcing.F90 index a1d8bf4b52..8c980edc8e 100644 --- a/src/user/dumbbell_surface_forcing.F90 +++ b/src/user/dumbbell_surface_forcing.F90 @@ -215,7 +215,7 @@ subroutine dumbbell_surface_forcing_init(Time, G, US, param_file, diag, CS) units="Pa", default = 10000.0, scale=US%kg_m3_to_R*US%m_s_to_L_T**2) call get_param(param_file, mdl, "DUMBBELL_SLP_PERIOD", CS%slp_period, & "Periodicity of SLP forcing in reservoirs.", & - units="days", default = 1.0) + units="days", default=1.0) call get_param(param_file, mdl, "DUMBBELL_ROTATION", dbrotate, & 'Logical for rotation of dumbbell domain.',& units='nondim', default=.false., do_not_log=.true.) diff --git a/src/user/external_gwave_initialization.F90 b/src/user/external_gwave_initialization.F90 index 27d0cedded..ec507e181b 100644 --- a/src/user/external_gwave_initialization.F90 +++ b/src/user/external_gwave_initialization.F90 @@ -53,8 +53,8 @@ subroutine external_gwave_initialize_thickness(h, G, GV, US, param_file, just_re if (.not.just_read) call log_version(param_file, mdl, version, "") call get_param(param_file, mdl, "SSH_ANOMALY_HEIGHT", ssh_anomaly_height, & - "The vertical displacement of the SSH anomaly. ", units="m", & - fail_if_missing=.not.just_read, do_not_log=just_read, scale=US%m_to_Z) + "The vertical displacement of the SSH anomaly. ", units="m", scale=US%m_to_Z, & + fail_if_missing=.not.just_read, do_not_log=just_read) call get_param(param_file, mdl, "SSH_ANOMALY_WIDTH", ssh_anomaly_width, & "The lateral width of the SSH anomaly. ", units="coordinate", & fail_if_missing=.not.just_read, do_not_log=just_read) diff --git a/src/user/user_change_diffusivity.F90 b/src/user/user_change_diffusivity.F90 index 0308a3b008..3f276a1dd0 100644 --- a/src/user/user_change_diffusivity.F90 +++ b/src/user/user_change_diffusivity.F90 @@ -205,8 +205,8 @@ subroutine user_change_diff_init(Time, G, GV, US, param_file, diag, CS) !! point to the control !! structure for this module. -! This include declares and sets the variable "version". -#include "version_variable.h" + ! This include declares and sets the variable "version". +# include "version_variable.h" character(len=40) :: mdl = "user_set_diffusivity" ! This module's name. character(len=200) :: mesg integer :: i, j, is, ie, js, je @@ -228,8 +228,7 @@ subroutine user_change_diff_init(Time, G, GV, US, param_file, diag, CS) call log_version(param_file, mdl, version, "") call get_param(param_file, mdl, "USER_KD_ADD", CS%Kd_add, & "A user-specified additional diffusivity over a range of "//& - "latitude and density.", default=0.0, units="m2 s-1", & - scale=US%m2_s_to_Z2_T) + "latitude and density.", default=0.0, units="m2 s-1", scale=US%m2_s_to_Z2_T) if (CS%Kd_add /= 0.0) then call get_param(param_file, mdl, "USER_KD_ADD_LAT_RANGE", CS%lat_range(:), & "Four successive values that define a range of latitudes "//&