diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90 index 641b2ae382..9b9fdac145 100644 --- a/src/initialization/MOM_state_initialization.F90 +++ b/src/initialization/MOM_state_initialization.F90 @@ -257,7 +257,7 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, & "use_temperature must be true if INIT_LAYERS_FROM_Z_FILE is true") call MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, & - just_read_params=just_read, frac_shelf_h=frac_shelf_h) + just_read=just_read, frac_shelf_h=frac_shelf_h) else ! Initialize thickness, h. call get_param(PF, mdl, "THICKNESS_CONFIG", config, & @@ -290,9 +290,9 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, & default="uniform", do_not_log=just_read) select case (trim(config)) case ("file") - call initialize_thickness_from_file(h, depth_tot, G, GV, US, PF, .false., just_read_params=just_read) + call initialize_thickness_from_file(h, depth_tot, G, GV, US, PF, .false., just_read=just_read) case ("thickness_file") - call initialize_thickness_from_file(h, depth_tot, G, GV, US, PF, .true., just_read_params=just_read) + call initialize_thickness_from_file(h, depth_tot, G, GV, US, PF, .true., just_read=just_read) case ("coord") if (new_sim .and. useALE) then call ALE_initThicknessToCoord( ALE_CSp, G, GV, h ) @@ -301,41 +301,41 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, & "for THICKNESS_CONFIG of 'coord'") endif case ("uniform"); call initialize_thickness_uniform(h, depth_tot, G, GV, PF, & - just_read_params=just_read) + just_read=just_read) case ("list"); call initialize_thickness_list(h, depth_tot, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("DOME"); call DOME_initialize_thickness(h, depth_tot, G, GV, PF, & - just_read_params=just_read) + just_read=just_read) case ("ISOMIP"); call ISOMIP_initialize_thickness(h, depth_tot, G, GV, US, PF, tv, & - just_read_params=just_read) + just_read=just_read) case ("benchmark"); call benchmark_initialize_thickness(h, depth_tot, G, GV, US, PF, & - tv%eqn_of_state, tv%P_Ref, just_read_params=just_read) + tv%eqn_of_state, tv%P_Ref, just_read=just_read) case ("Neverworld","Neverland"); call Neverworld_initialize_thickness(h, depth_tot, G, GV, US, PF, & tv%eqn_of_state, tv%P_Ref) case ("search"); call initialize_thickness_search() case ("circle_obcs"); call circle_obcs_initialize_thickness(h, depth_tot, G, GV, PF, & - just_read_params=just_read) + just_read=just_read) case ("lock_exchange"); call lock_exchange_initialize_thickness(h, G, GV, US, & - PF, just_read_params=just_read) + PF, just_read=just_read) case ("external_gwave"); call external_gwave_initialize_thickness(h, G, GV, US, & - PF, just_read_params=just_read) + PF, just_read=just_read) case ("DOME2D"); call DOME2d_initialize_thickness(h, depth_tot, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("adjustment2d"); call adjustment_initialize_thickness(h, G, GV, US, & - PF, just_read_params=just_read) + PF, just_read=just_read) case ("sloshing"); call sloshing_initialize_thickness(h, depth_tot, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("seamount"); call seamount_initialize_thickness(h, depth_tot, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("dumbbell"); call dumbbell_initialize_thickness(h, depth_tot, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("soliton"); call soliton_initialize_thickness(h, depth_tot, G, GV, US) case ("phillips"); call Phillips_initialize_thickness(h, depth_tot, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("rossby_front"); call Rossby_front_initialize_thickness(h, G, GV, US, & - PF, just_read_params=just_read) + PF, just_read=just_read) case ("USER"); call user_initialize_thickness(h, G, GV, PF, & - just_read_params=just_read) + just_read=just_read) case default ; call MOM_error(FATAL, "MOM_initialize_state: "//& "Unrecognized layer thickness configuration "//trim(config)) end select @@ -366,37 +366,37 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, & ! " \t baroclinic_zone - an analytic baroclinic zone. \n"//& select case (trim(config)) case ("fit"); call initialize_temp_salt_fit(tv%T, tv%S, G, GV, US, PF, & - eos, tv%P_Ref, just_read_params=just_read) + eos, tv%P_Ref, just_read=just_read) case ("file"); call initialize_temp_salt_from_file(tv%T, tv%S, G, GV, & - PF, just_read_params=just_read) + PF, just_read=just_read) case ("benchmark"); call benchmark_init_temperature_salinity(tv%T, tv%S, & - G, GV, US, PF, eos, tv%P_Ref, just_read_params=just_read) + G, GV, US, PF, eos, tv%P_Ref, just_read=just_read) case ("TS_profile") ; call initialize_temp_salt_from_profile(tv%T, tv%S, & - G, GV, PF, just_read_params=just_read) + G, GV, PF, just_read=just_read) case ("linear"); call initialize_temp_salt_linear(tv%T, tv%S, G, GV, PF, & - just_read_params=just_read) + just_read=just_read) case ("DOME2D"); call DOME2d_initialize_temperature_salinity ( tv%T, & - tv%S, h, G, GV, PF, eos, just_read_params=just_read) + tv%S, h, G, GV, PF, eos, just_read=just_read) case ("ISOMIP"); call ISOMIP_initialize_temperature_salinity ( tv%T, & - tv%S, h, depth_tot, G, GV, US, PF, eos, just_read_params=just_read) + tv%S, h, depth_tot, G, GV, US, PF, eos, just_read=just_read) case ("adjustment2d"); call adjustment_initialize_temperature_salinity ( tv%T, & - tv%S, h, depth_tot, G, GV, PF, eos, just_read_params=just_read) + tv%S, h, depth_tot, G, GV, PF, eos, just_read=just_read) case ("baroclinic_zone"); call baroclinic_zone_init_temperature_salinity( tv%T, & - tv%S, h, depth_tot, G, GV, US, PF, just_read_params=just_read) + tv%S, h, depth_tot, G, GV, US, PF, just_read=just_read) case ("sloshing"); call sloshing_initialize_temperature_salinity(tv%T, & - tv%S, h, G, GV, PF, eos, just_read_params=just_read) + tv%S, h, G, GV, PF, eos, just_read=just_read) case ("seamount"); call seamount_initialize_temperature_salinity(tv%T, & - tv%S, h, G, GV, PF, eos, just_read_params=just_read) + tv%S, h, G, GV, PF, eos, just_read=just_read) case ("dumbbell"); call dumbbell_initialize_temperature_salinity(tv%T, & - tv%S, h, G, GV, PF, eos, just_read_params=just_read) + tv%S, h, G, GV, PF, eos, just_read=just_read) case ("rossby_front"); call Rossby_front_initialize_temperature_salinity ( tv%T, & - tv%S, h, G, GV, PF, eos, just_read_params=just_read) + tv%S, h, G, GV, PF, eos, just_read=just_read) case ("SCM_CVMix_tests"); call SCM_CVMix_tests_TS_init(tv%T, tv%S, h, & - G, GV, US, PF, just_read_params=just_read) + G, GV, US, PF, just_read=just_read) case ("dense"); call dense_water_initialize_TS(G, GV, PF, eos, tv%T, tv%S, & - h, just_read_params=just_read) + h, just_read=just_read) case ("USER"); call user_init_temperature_salinity(tv%T, tv%S, G, GV, PF, eos, & - just_read_params=just_read) + just_read=just_read) case default ; call MOM_error(FATAL, "MOM_initialize_state: "//& "Unrecognized Temp & salt configuration "//trim(config)) end select @@ -423,20 +423,20 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, & do_not_log=just_read) select case (trim(config)) case ("file"); call initialize_velocity_from_file(u, v, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("zero"); call initialize_velocity_zero(u, v, G, GV, PF, & - just_read_params=just_read) + just_read=just_read) case ("uniform"); call initialize_velocity_uniform(u, v, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("circular"); call initialize_velocity_circular(u, v, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("phillips"); call Phillips_initialize_velocity(u, v, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case ("rossby_front"); call Rossby_front_initialize_velocity(u, v, h, & - G, GV, US, PF, just_read_params=just_read) + G, GV, US, PF, just_read=just_read) case ("soliton"); call soliton_initialize_velocity(u, v, h, G, GV, US) case ("USER"); call user_initialize_velocity(u, v, G, GV, US, PF, & - just_read_params=just_read) + just_read=just_read) case default ; call MOM_error(FATAL, "MOM_initialize_state: "//& "Unrecognized velocity configuration "//trim(config)) end select @@ -472,8 +472,8 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, US, PF, dirs, & "DEPRESS_INITIAL_SURFACE and TRIM_IC_FOR_P_SURF are exclusive and cannot both be True") if (new_sim .and. debug .and. (depress_sfc .or. trim_ic_for_p_surf)) & call hchksum(h, "Pre-depress: h ", G%HI, haloshift=1, scale=GV%H_to_m) - if (depress_sfc) call depress_surface(h, G, GV, US, PF, tv, just_read_params=just_read) - if (trim_ic_for_p_surf) call trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read_params=just_read) + if (depress_sfc) call depress_surface(h, G, GV, US, PF, tv, just_read=just_read) + if (trim_ic_for_p_surf) call trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read=just_read) ! Perhaps we want to run the regridding coordinate generator for multiple ! iterations here so the initial grid is consistent with the coordinate @@ -659,7 +659,7 @@ end subroutine MOM_initialize_state !> Reads the layer thicknesses or interface heights from a file. subroutine initialize_thickness_from_file(h, depth_tot, G, GV, US, param_file, file_has_thickness, & - just_read_params) + just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -672,22 +672,19 @@ subroutine initialize_thickness_from_file(h, depth_tot, G, GV, US, param_file, f logical, intent(in) :: file_has_thickness !< If true, this file contains layer !! thicknesses; otherwise it contains !! interface heights. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables real :: eta(SZI_(G),SZJ_(G),SZK_(GV)+1) ! Interface heights, in depth units [Z ~> m]. integer :: inconsistent = 0 logical :: correct_thickness - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "initialize_thickness_from_file" ! This subroutine's name. character(len=200) :: filename, thickness_file, inputdir, mesg ! Strings for file/path integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") @@ -832,7 +829,7 @@ subroutine adjustEtaToFitBathymetry(G, GV, US, eta, h, dZ_ref_eta) end subroutine adjustEtaToFitBathymetry !> Initializes thickness to be uniform -subroutine initialize_thickness_uniform(h, depth_tot, G, GV, param_file, just_read_params) +subroutine initialize_thickness_uniform(h, depth_tot, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & @@ -841,21 +838,18 @@ subroutine initialize_thickness_uniform(h, depth_tot, G, GV, param_file, just_re intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables character(len=40) :: mdl = "initialize_thickness_uniform" ! This subroutine's name. real :: e0(SZK_(GV)+1) ! The resting interface heights, in depth units, usually ! negative because it is positive upward. real :: eta1D(SZK_(GV)+1)! Interface height relative to the sea surface ! positive upward, in depth units. - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (just_read) return ! This subroutine has no run-time parameters. call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") @@ -889,33 +883,30 @@ subroutine initialize_thickness_uniform(h, depth_tot, G, GV, param_file, just_re end subroutine initialize_thickness_uniform !> Initialize thickness from a 1D list -subroutine initialize_thickness_list(h, depth_tot, G, GV, US, param_file, just_read_params) +subroutine initialize_thickness_list(h, depth_tot, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables character(len=40) :: mdl = "initialize_thickness_list" ! This subroutine's name. real :: e0(SZK_(GV)+1) ! The resting interface heights, in depth units [Z ~> m], ! usually negative because it is positive upward. real :: eta1D(SZK_(GV)+1)! Interface height relative to the sea surface ! positive upward, in depth units [Z ~> m]. - logical :: just_read ! If true, just read parameters but set nothing. character(len=200) :: filename, eta_file, inputdir ! Strings for file/path character(len=72) :: eta_var integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - call get_param(param_file, mdl, "INTERFACE_IC_FILE", eta_file, & "The file from which horizontal mean initial conditions "//& "for interface depths can be read.", fail_if_missing=.true.) @@ -1047,7 +1038,7 @@ subroutine convert_thickness(h, G, GV, US, tv) end subroutine convert_thickness !> Depress the sea-surface based on an initial condition file -subroutine depress_surface(h, G, GV, US, param_file, tv, just_read_params) +subroutine depress_surface(h, G, GV, US, param_file, tv, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -1055,8 +1046,8 @@ subroutine depress_surface(h, G, GV, US, param_file, tv, just_read_params) intent(inout) :: h !< Layer thicknesses [H ~> m or kg m-2] type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters type(thermo_var_ptrs), intent(in) :: tv !< A structure pointing to various thermodynamic variables - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables real, dimension(SZI_(G),SZJ_(G)) :: & eta_sfc ! The free surface height that the model should use [Z ~> m]. @@ -1068,11 +1059,9 @@ subroutine depress_surface(h, G, GV, US, param_file, tv, just_read_params) character(len=40) :: mdl = "depress_surface" ! This subroutine's name. character(len=200) :: inputdir, eta_srf_file ! Strings for file/path character(len=200) :: filename, eta_srf_var ! Strings for file/path - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, is, ie, js, je, nz - is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params + is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke ! Read the surface height (or pressure) from a file. @@ -1131,7 +1120,7 @@ end subroutine depress_surface !> Adjust the layer thicknesses by cutting away the top of each model column at the depth !! where the hydrostatic pressure matches an imposed surface pressure read from file. -subroutine trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read_params) +subroutine trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read) type(param_file_type), intent(in) :: PF !< Parameter file structure type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure @@ -1140,8 +1129,8 @@ subroutine trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read_params) type(thermo_var_ptrs), intent(inout) :: tv !< Thermodynamics structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(inout) :: h !< Layer thickness [H ~> m or kg m-2] - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables character(len=200) :: mdl = "trim_for_ice" real, dimension(SZI_(G),SZJ_(G)) :: p_surf ! Imposed pressure on ocean at surface [R L2 T-2 ~> Pa] @@ -1152,12 +1141,9 @@ subroutine trim_for_ice(PF, G, GV, US, ALE_CSp, tv, h, just_read_params) real :: min_thickness ! The minimum layer thickness, recast into Z units [Z ~> m]. integer :: i, j, k logical :: default_2018_answers, remap_answers_2018 - logical :: just_read ! If true, just read parameters but set nothing. logical :: use_remapping ! If true, remap the initial conditions. type(remapping_CS), pointer :: remap_CS => NULL() - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - call get_param(PF, mdl, "SURFACE_PRESSURE_FILE", p_surf_file, & "The initial condition file for the surface pressure exerted by ice.", & fail_if_missing=.not.just_read, do_not_log=just_read) @@ -1321,7 +1307,7 @@ subroutine cut_off_column_top(nk, tv, GV, US, G_earth, depth, min_thickness, T, end subroutine cut_off_column_top !> Initialize horizontal velocity components from file -subroutine initialize_velocity_from_file(u, v, G, GV, US, param_file, just_read_params) +subroutine initialize_velocity_from_file(u, v, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), & @@ -1331,14 +1317,11 @@ subroutine initialize_velocity_from_file(u, v, G, GV, US, param_file, just_read_ type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to !! parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing u or v. ! Local variables character(len=40) :: mdl = "initialize_velocity_from_file" ! This subroutine's name. character(len=200) :: filename,velocity_file,inputdir ! Strings for file/path - logical :: just_read ! If true, just read parameters but set nothing. - - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params if (.not.just_read) call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") @@ -1363,7 +1346,7 @@ subroutine initialize_velocity_from_file(u, v, G, GV, US, param_file, just_read_ end subroutine initialize_velocity_from_file !> Initialize horizontal velocity components to zero. -subroutine initialize_velocity_zero(u, v, G, GV, param_file, just_read_params) +subroutine initialize_velocity_zero(u, v, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), & @@ -1372,17 +1355,15 @@ subroutine initialize_velocity_zero(u, v, G, GV, param_file, just_read_params) intent(out) :: v !< The meridional velocity that is being initialized [L T-1 ~> m s-1] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to !! parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables character(len=200) :: mdl = "initialize_velocity_zero" ! This subroutine's name. - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz + is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") if (just_read) return ! All run-time parameters have been read, so return. @@ -1398,7 +1379,7 @@ subroutine initialize_velocity_zero(u, v, G, GV, param_file, just_read_params) end subroutine initialize_velocity_zero !> Sets the initial velocity components to uniform -subroutine initialize_velocity_uniform(u, v, G, GV, US, param_file, just_read_params) +subroutine initialize_velocity_uniform(u, v, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), & @@ -1408,18 +1389,16 @@ subroutine initialize_velocity_uniform(u, v, G, GV, US, param_file, just_read_pa type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to !! parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing u or v. ! Local variables integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz real :: initial_u_const, initial_v_const - logical :: just_read ! If true, just read parameters but set nothing. character(len=200) :: mdl = "initialize_velocity_uniform" ! This subroutine's name. + is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - call get_param(param_file, mdl, "INITIAL_U_CONST", initial_u_const, & "A initial uniform value for the zonal flow.", & default=0.0, units="m s-1", scale=US%m_s_to_L_T, do_not_log=just_read) @@ -1440,7 +1419,7 @@ end subroutine initialize_velocity_uniform !> Sets the initial velocity components to be circular with !! no flow at edges of domain and center. -subroutine initialize_velocity_circular(u, v, G, GV, US, param_file, just_read_params) +subroutine initialize_velocity_circular(u, v, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), & @@ -1450,20 +1429,17 @@ subroutine initialize_velocity_circular(u, v, G, GV, US, param_file, just_read_p type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to !! parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing u or v. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing u or v. ! Local variables character(len=200) :: mdl = "initialize_velocity_circular" real :: circular_max_u ! The amplitude of the zonal flow [L T-1 ~> m s-1] real :: dpi ! A local variable storing pi = 3.14159265358979... real :: psi1, psi2 ! Values of the streamfunction at two points [L2 T-1 ~> m2 s-1] - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke Isq = G%IscB ; Ieq = G%IecB ; Jsq = G%JscB ; Jeq = G%JecB - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - call get_param(param_file, mdl, "CIRCULAR_MAX_U", circular_max_u, & "The amplitude of zonal flow from which to scale the "// & "circular stream function [m s-1].", & @@ -1504,25 +1480,22 @@ end function my_psi end subroutine initialize_velocity_circular !> Initializes temperature and salinity from file -subroutine initialize_temp_salt_from_file(T, S, G, GV, param_file, just_read_params) +subroutine initialize_temp_salt_from_file(T, S, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< The potential temperature that is !! being initialized [degC] real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< The salinity that is !! being initialized [ppt] - type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing T or S. + type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters + logical, intent(in) :: just_read !< If true, this call will only + !! read parameters without changing T or S. ! Local variables - logical :: just_read ! If true, just read parameters but set nothing. character(len=200) :: filename, salt_filename ! Full paths to input files character(len=200) :: ts_file, salt_file, inputdir ! Strings for file/path character(len=40) :: mdl = "initialize_temp_salt_from_file" character(len=64) :: temp_var, salt_var ! Temperature and salinity names in files - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") call get_param(param_file, mdl, "TS_FILE", ts_file, & @@ -1561,7 +1534,7 @@ subroutine initialize_temp_salt_from_file(T, S, G, GV, param_file, just_read_par end subroutine initialize_temp_salt_from_file !> Initializes temperature and salinity from a 1D profile -subroutine initialize_temp_salt_from_profile(T, S, G, GV, param_file, just_read_params) +subroutine initialize_temp_salt_from_profile(T, S, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< The potential temperature that is @@ -1569,17 +1542,14 @@ subroutine initialize_temp_salt_from_profile(T, S, G, GV, param_file, just_read_ real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< The salinity that is !! being initialized [ppt] type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing T or S. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing T or S. ! Local variables real, dimension(SZK_(GV)) :: T0, S0 integer :: i, j, k - logical :: just_read ! If true, just read parameters but set nothing. character(len=200) :: filename, ts_file, inputdir ! Strings for file/path character(len=40) :: mdl = "initialize_temp_salt_from_profile" - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") call get_param(param_file, mdl, "TS_FILE", ts_file, & @@ -1607,7 +1577,7 @@ subroutine initialize_temp_salt_from_profile(T, S, G, GV, param_file, just_read_ end subroutine initialize_temp_salt_from_profile !> Initializes temperature and salinity by fitting to density -subroutine initialize_temp_salt_fit(T, S, G, GV, US, param_file, eqn_of_state, P_Ref, just_read_params) +subroutine initialize_temp_salt_fit(T, S, G, GV, US, param_file, eqn_of_state, P_Ref, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< The potential temperature that is @@ -1620,8 +1590,8 @@ subroutine initialize_temp_salt_fit(T, S, G, GV, US, param_file, eqn_of_state, P type(EOS_type), pointer :: eqn_of_state !< Equation of state structure real, intent(in) :: P_Ref !< The coordinate-density reference pressure !! [R L2 T-2 ~> Pa]. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing T or S. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing T or S. ! Local variables real :: T0(SZK_(GV)) ! Layer potential temperatures [degC] real :: S0(SZK_(GV)) ! Layer salinities [degC] @@ -1632,13 +1602,10 @@ subroutine initialize_temp_salt_fit(T, S, G, GV, US, param_file, eqn_of_state, P real :: drho_dS(SZK_(GV)) ! Derivative of density with salinity [R ppt-1 ~> kg m-3 ppt-1]. real :: rho_guess(SZK_(GV)) ! Potential density at T0 & S0 [R ~> kg m-3]. logical :: fit_salin ! If true, accept the prescribed temperature and fit the salinity. - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "initialize_temp_salt_fit" ! This subroutine's name. integer :: i, j, k, itt, nz nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") call get_param(param_file, mdl, "T_REF", T_Ref, & @@ -1701,7 +1668,7 @@ end subroutine initialize_temp_salt_fit !! !! \remark Note that the linear distribution is set up with respect to the layer !! number, not the physical position). -subroutine initialize_temp_salt_linear(T, S, G, GV, param_file, just_read_params) +subroutine initialize_temp_salt_linear(T, S, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< The potential temperature that is @@ -1710,7 +1677,7 @@ subroutine initialize_temp_salt_linear(T, S, G, GV, param_file, just_read_params !! being initialized [ppt] type(param_file_type), intent(in) :: param_file !< A structure to parse for !! run-time parameters - logical, optional, intent(in) :: just_read_params !< If present and true, + logical, intent(in) :: just_read !< If present and true, !! this call will only read parameters !! without changing T or S. @@ -1719,11 +1686,8 @@ subroutine initialize_temp_salt_linear(T, S, G, GV, param_file, just_read_params real :: S_top, T_top ! Reference salinity and temperature within surface layer real :: S_range, T_range ! Range of salinities and temperatures over the vertical real :: delta - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "initialize_temp_salt_linear" ! This subroutine's name. - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") call get_param(param_file, mdl, "T_TOP", T_top, & "Initial temperature of the top surface.", & @@ -2283,7 +2247,7 @@ end subroutine set_velocity_depth_min !> This subroutine determines the isopycnal or other coordinate interfaces and !! layer potential temperatures and salinities directly from a z-space file on !! a latitude-longitude grid. -subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just_read_params, frac_shelf_h) +subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just_read, frac_shelf_h) type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & @@ -2295,8 +2259,8 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: PF !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing T or S. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing T or S. real, dimension(SZI_(G),SZJ_(G)), & optional, intent(in) :: frac_shelf_h !< The fraction of the grid cell covered !! by a floating ice shelf [nondim]. @@ -2340,7 +2304,6 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just character(len=8) :: laynum integer, parameter :: niter=10 ! number of iterations for t/s adjustment to layer density - logical :: just_read ! If true, just read parameters but set nothing. logical :: adjust_temperature = .true. ! fit t/s to target densities real, parameter :: missing_value = -1.e20 real, parameter :: temp_land_fill = 0.0, salt_land_fill = 35.0 @@ -2393,8 +2356,6 @@ subroutine MOM_temp_salt_initialize_from_Z(h, tv, depth_tot, G, GV, US, PF, just PI_180=atan(1.0)/45. - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call callTree_enter(trim(mdl)//"(), MOM_state_initialization.F90") if (.not.just_read) call log_version(PF, mdl, version, "") diff --git a/src/user/DOME2d_initialization.F90 b/src/user/DOME2d_initialization.F90 index f99f0b8d5c..bc689b112e 100644 --- a/src/user/DOME2d_initialization.F90 +++ b/src/user/DOME2d_initialization.F90 @@ -90,18 +90,18 @@ subroutine DOME2d_initialize_topography( D, G, param_file, max_depth ) end subroutine DOME2d_initialize_topography !> Initialize thicknesses according to coordinate mode -subroutine DOME2d_initialize_thickness ( h, depth_tot, G, GV, US, param_file, just_read_params ) +subroutine DOME2d_initialize_thickness ( h, depth_tot, G, GV, US, param_file, just_read ) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables real :: e0(SZK_(GV)) ! The resting interface heights, in depth units [Z ~> m], usually @@ -113,13 +113,10 @@ subroutine DOME2d_initialize_thickness ( h, depth_tot, G, GV, US, param_file, ju real :: delta_h real :: min_thickness real :: dome2d_width_bay, dome2d_width_bottom, dome2d_depth_bay - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: verticalCoordinate is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg("MOM_initialization.F90, DOME2d_initialize_thickness: setting thickness") @@ -224,7 +221,7 @@ end subroutine DOME2d_initialize_thickness !> Initialize temperature and salinity in the 2d DOME configuration subroutine DOME2d_initialize_temperature_salinity ( T, S, h, G, GV, param_file, & - eqn_of_state, just_read_params) + eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC] @@ -232,7 +229,7 @@ subroutine DOME2d_initialize_temperature_salinity ( T, S, h, G, GV, param_file, real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2] type(param_file_type), intent(in) :: param_file !< Parameter file structure type(EOS_type), pointer :: eqn_of_state !< Equation of state structure - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing T & S. ! Local variables @@ -240,17 +237,14 @@ subroutine DOME2d_initialize_temperature_salinity ( T, S, h, G, GV, param_file, real :: x integer :: index_bay_z real :: delta_S, delta_T - real :: S_ref, T_ref; ! Reference salinity and temperature within surface layer - real :: S_range, T_range; ! Range of salinities and temperatures over the vertical + real :: S_ref, T_ref ! Reference salinity and temperature within surface layer + real :: S_range, T_range ! Range of salinities and temperatures over the vertical real :: xi0, xi1 - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: verticalCoordinate real :: dome2d_width_bay, dome2d_width_bottom, dome2d_depth_bay is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - call get_param(param_file, mdl,"REGRIDDING_COORDINATE_MODE", verticalCoordinate, & default=DEFAULT_COORDINATE_MODE, do_not_log=.true.) call get_param(param_file, mdl, "DOME2D_SHELF_WIDTH", dome2d_width_bay, & diff --git a/src/user/DOME_initialization.F90 b/src/user/DOME_initialization.F90 index 1f3d24e1c9..8599272e32 100644 --- a/src/user/DOME_initialization.F90 +++ b/src/user/DOME_initialization.F90 @@ -87,7 +87,7 @@ end subroutine DOME_initialize_topography ! ----------------------------------------------------------------------------- !> This subroutine initializes layer thicknesses for the DOME experiment -subroutine DOME_initialize_thickness(h, depth_tot, G, GV, param_file, just_read_params) +subroutine DOME_initialize_thickness(h, depth_tot, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & @@ -96,21 +96,18 @@ subroutine DOME_initialize_thickness(h, depth_tot, G, GV, param_file, just_read_ intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. real :: e0(SZK_(GV)+1) ! The resting interface heights [Z ~> m], usually ! negative because it is positive upward [Z ~> m]. real :: eta1D(SZK_(GV)+1) ! Interface height relative to the sea surface ! positive upward [Z ~> m]. - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "DOME_initialize_thickness" ! This subroutine's name. integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (just_read) return ! This subroutine has no run-time parameters. call MOM_mesg(" DOME_initialization.F90, DOME_initialize_thickness: setting thickness", 5) @@ -149,8 +146,8 @@ end subroutine DOME_initialize_thickness !! the first registered field. ! subroutine DOME_initialize_sponges(G, GV, US, tv, depth_tot, PF, CSp) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. - type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. - type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type + type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. + type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(thermo_var_ptrs), intent(in) :: tv !< A structure containing pointers to any available !! thermodynamic fields, including potential temperature and !! salinity or mixed layer density. Absent fields have NULL ptrs. @@ -250,7 +247,7 @@ end subroutine DOME_initialize_sponges subroutine register_DOME_OBC(param_file, US, OBC, tr_Reg) type(param_file_type), intent(in) :: param_file !< parameter file. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type - type(ocean_OBC_type), pointer :: OBC !< OBC registry. + type(ocean_OBC_type), pointer :: OBC !< OBC registry. type(tracer_registry_type), pointer :: tr_Reg !< Tracer registry. if (OBC%number_of_segments /= 1) then diff --git a/src/user/ISOMIP_initialization.F90 b/src/user/ISOMIP_initialization.F90 index 76f60d9b99..580fab1ac6 100644 --- a/src/user/ISOMIP_initialization.F90 +++ b/src/user/ISOMIP_initialization.F90 @@ -51,9 +51,9 @@ subroutine ISOMIP_initialize_topography(D, G, param_file, max_depth, US) real :: min_depth ! The minimum and maximum depths [Z ~> m]. real :: m_to_Z ! A dimensional rescaling factor. ! The following variables are used to set up the bathymetry in the ISOMIP example. - real :: bmax ! max depth of bedrock topography - real :: b0,b2,b4,b6 ! first, second, third and fourth bedrock topography coeff - real :: xbar ! characteristic along-flow lenght scale of the bedrock + real :: bmax ! max depth of bedrock topography [Z ~> m] + real :: b0,b2,b4,b6 ! first, second, third and fourth bedrock topography coeffs [Z ~> m] + real :: xbar ! characteristic along-flow length scale of the bedrock real :: dc ! depth of the trough compared with side walls [Z ~> m]. real :: fc ! characteristic width of the side walls of the channel real :: wc ! half-width of the trough @@ -128,7 +128,7 @@ subroutine ISOMIP_initialize_topography(D, G, param_file, max_depth, US) end subroutine ISOMIP_initialize_topography !> Initialization of thicknesses -subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv, just_read_params) +subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -141,8 +141,8 @@ subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv type(thermo_var_ptrs), intent(in) :: tv !< A structure containing pointers to any !! available thermodynamic fields, including !! the eqn. of state. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables real :: e0(SZK_(GV)+1) ! The resting interface heights, in depth units [Z ~> m], ! usually negative because it is positive upward. @@ -153,14 +153,11 @@ subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv real :: min_thickness, s_sur, s_bot, t_sur, t_bot real :: rho_sur, rho_bot ! Surface and bottom densities [R ~> kg m-3] real :: rho_range ! The range of densities [R ~> kg m-3] - logical :: just_read ! If true, just read parameters but set nothing. character(len=256) :: mesg ! The text of an error message character(len=40) :: verticalCoordinate is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg("MOM_initialization.F90, initialize_thickness_uniform: setting thickness") @@ -251,7 +248,7 @@ end subroutine ISOMIP_initialize_thickness !> Initial values for temperature and salinity subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, US, param_file, & - eqn_of_state, just_read_params) + eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -262,7 +259,7 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, U !! depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< Parameter file structure type(EOS_type), pointer :: eqn_of_state !< Equation of state structure - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing T & S. ! Local variables integer :: i, j, k, is, ie, js, je, nz, itt @@ -277,7 +274,6 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, U character(len=256) :: mesg ! The text of an error message character(len=40) :: verticalCoordinate, density_profile real :: rho_tmp - logical :: just_read ! If true, just read parameters but set nothing. logical :: fit_salin ! If true, accept the prescribed temperature and fit the salinity. real :: T0(SZK_(GV)) ! A profile of temperatures [degC] real :: S0(SZK_(GV)) ! A profile of salinities [ppt] @@ -291,8 +287,6 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, U is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke pres(:) = 0.0 - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - 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, "ISOMIP_T_SUR",t_sur, & diff --git a/src/user/Phillips_initialization.F90 b/src/user/Phillips_initialization.F90 index 448c86b5fb..a2dd76519d 100644 --- a/src/user/Phillips_initialization.F90 +++ b/src/user/Phillips_initialization.F90 @@ -35,7 +35,7 @@ module Phillips_initialization contains !> Initialize the thickness field for the Phillips model test case. -subroutine Phillips_initialize_thickness(h, depth_tot, G, GV, US, param_file, just_read_params) +subroutine Phillips_initialize_thickness(h, depth_tot, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -45,8 +45,8 @@ subroutine Phillips_initialize_thickness(h, depth_tot, G, GV, US, param_file, ju intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. real :: eta0(SZK_(GV)+1) ! The 1-d nominal positions of the interfaces [Z ~> m] real :: eta_im(SZJ_(G),SZK_(GV)+1) ! A temporary array for zonal-mean eta [Z ~> m] @@ -56,7 +56,6 @@ subroutine Phillips_initialize_thickness(h, depth_tot, G, GV, US, param_file, ju real :: y_2 ! The y-position relative to the center of the domain [km] real :: half_strat ! The fractional depth where the stratification is centered [nondim] real :: half_depth ! The depth where the stratification is centered [Z ~> m] - logical :: just_read ! If true, just read parameters but set nothing. logical :: reentrant_y ! If true, model is re-entrant in the y direction character(len=40) :: mdl = "Phillips_initialize_thickness" ! This subroutine's name. integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz @@ -67,8 +66,6 @@ subroutine Phillips_initialize_thickness(h, depth_tot, G, GV, US, param_file, ju eta_im(:,:) = 0.0 - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call log_version(param_file, mdl, version) call get_param(param_file, mdl, "HALF_STRAT_DEPTH", half_strat, & "The fractional depth where the stratification is centered.", & @@ -130,7 +127,7 @@ subroutine Phillips_initialize_thickness(h, depth_tot, G, GV, US, param_file, ju end subroutine Phillips_initialize_thickness !> Initialize the velocity fields for the Phillips model test case -subroutine Phillips_initialize_velocity(u, v, G, GV, US, param_file, just_read_params) +subroutine Phillips_initialize_velocity(u, v, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< Grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), & @@ -140,8 +137,8 @@ subroutine Phillips_initialize_velocity(u, v, G, GV, US, param_file, just_read_p type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to !! parse for modelparameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing u & v. real :: jet_width ! The width of the zonal-mean jet [km] real :: jet_height ! The interface height scale associated with the zonal-mean jet [Z ~> m] @@ -150,13 +147,10 @@ subroutine Phillips_initialize_velocity(u, v, G, GV, US, param_file, just_read_p real :: velocity_amplitude ! The amplitude of velocity perturbations [L T-1 ~> m s-1] real :: pi ! The ratio of the circumference of a circle to its diameter [nondim] integer :: i, j, k, is, ie, js, je, nz, m - logical :: just_read ! If true, just read parameters but set nothing. logical :: reentrant_y ! If true, model is re-entrant in the y direction character(len=40) :: mdl = "Phillips_initialize_velocity" ! This subroutine's name. is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call log_version(param_file, mdl, version) call get_param(param_file, mdl, "VELOCITY_IC_PERTURB_AMP", velocity_amplitude, & "The magnitude of the initial velocity perturbation.", & diff --git a/src/user/Rossby_front_2d_initialization.F90 b/src/user/Rossby_front_2d_initialization.F90 index cd87b47621..d7af8af0e4 100644 --- a/src/user/Rossby_front_2d_initialization.F90 +++ b/src/user/Rossby_front_2d_initialization.F90 @@ -36,7 +36,7 @@ module Rossby_front_2d_initialization contains !> Initialization of thicknesses in 2D Rossby front test -subroutine Rossby_front_initialize_thickness(h, G, GV, US, param_file, just_read_params) +subroutine Rossby_front_initialize_thickness(h, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< Grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -44,20 +44,17 @@ subroutine Rossby_front_initialize_thickness(h, G, GV, US, param_file, just_read intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. integer :: i, j, k, is, ie, js, je, nz real :: Tz, Dml, eta, stretch, h0 real :: min_thickness, T_range real :: dRho_dT ! The partial derivative of density with temperature [R degC-1 ~> kg m-3 degC-1] - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: verticalCoordinate is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg("Rossby_front_2d_initialization.F90, Rossby_front_initialize_thickness: setting thickness") @@ -110,7 +107,7 @@ end subroutine Rossby_front_initialize_thickness !> Initialization of temperature and salinity in the Rossby front test subroutine Rossby_front_initialize_temperature_salinity(T, S, h, G, GV, & - param_file, eqn_of_state, just_read_params) + param_file, eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< Grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC] @@ -118,21 +115,18 @@ subroutine Rossby_front_initialize_temperature_salinity(T, S, h, G, GV, & real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Thickness [H ~> m or kg m-2] type(param_file_type), intent(in) :: param_file !< Parameter file handle type(EOS_type), pointer :: eqn_of_state !< Equation of state structure - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing T & S. integer :: i, j, k, is, ie, js, je, nz real :: T_ref, S_ref ! Reference salinity and temerature within surface layer real :: T_range ! Range of salinities and temperatures over the vertical real :: y, zc, zi, dTdz - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: verticalCoordinate real :: PI ! 3.1415926... calculated as 4*atan(1) is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - 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, "S_REF", S_ref, 'Reference salinity', & @@ -162,7 +156,7 @@ end subroutine Rossby_front_initialize_temperature_salinity !> Initialization of u and v in the Rossby front test -subroutine Rossby_front_initialize_velocity(u, v, h, G, GV, US, param_file, just_read_params) +subroutine Rossby_front_initialize_velocity(u, v, h, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< Grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)), & @@ -174,8 +168,8 @@ subroutine Rossby_front_initialize_velocity(u, v, h, G, GV, US, param_file, just type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call - !! will only read parameters without setting u & v. + logical, intent(in) :: just_read !< If present and true, this call will only + !! read parameters without setting u & v. real :: y ! Non-dimensional coordinate across channel, 0..pi real :: T_range ! Range of salinities and temperatures over the vertical @@ -186,13 +180,10 @@ subroutine Rossby_front_initialize_velocity(u, v, h, G, GV, US, param_file, just real :: Ty ! The meridional temperature gradient [degC L-1 ~> degC m-1] real :: hAtU ! Interpolated layer thickness [Z ~> m]. integer :: i, j, k, is, ie, js, je, nz - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: verticalCoordinate is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - 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, "T_RANGE", T_range, 'Initial temperature range', & diff --git a/src/user/SCM_CVMix_tests.F90 b/src/user/SCM_CVMix_tests.F90 index 1d426be636..261a01ab03 100644 --- a/src/user/SCM_CVMix_tests.F90 +++ b/src/user/SCM_CVMix_tests.F90 @@ -52,7 +52,7 @@ module SCM_CVMix_tests contains !> Initializes temperature and salinity for the SCM CVMix test example -subroutine SCM_CVMix_tests_TS_init(T, S, h, G, GV, US, param_file, just_read_params) +subroutine SCM_CVMix_tests_TS_init(T, S, h, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< Grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC] @@ -60,8 +60,8 @@ subroutine SCM_CVMix_tests_TS_init(T, S, h, G, GV, US, param_file, just_read_par real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2] type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< Input parameter structure - logical, optional, intent(in) :: just_read_params !< If present and true, this call - !! will only read parameters without changing h. + logical, intent(in) :: just_read !< If present and true, this call + !! will only read parameters without changing T & S. ! Local variables real :: UpperLayerTempMLD !< Upper layer Temp MLD thickness [Z ~> m]. real :: UpperLayerSaltMLD !< Upper layer Salt MLD thickness [Z ~> m]. @@ -73,15 +73,11 @@ subroutine SCM_CVMix_tests_TS_init(T, S, h, G, GV, US, param_file, just_read_par real :: LowerLayerdSdz !< Salt gradient in lower layer [ppt / Z ~> ppt m-1]. real :: LowerLayerMinTemp !< Minimum temperature in lower layer [degC] real :: zC, DZ, top, bottom ! Depths and thicknesses [Z ~> m]. - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed - - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) call log_version(param_file, mdl, version) call get_param(param_file, mdl, "SCM_TEMP_MLD", UpperLayerTempMLD, & 'Initial temp mixed layer depth', & diff --git a/src/user/adjustment_initialization.F90 b/src/user/adjustment_initialization.F90 index b9f676dc55..c39561513c 100644 --- a/src/user/adjustment_initialization.F90 +++ b/src/user/adjustment_initialization.F90 @@ -32,7 +32,7 @@ module adjustment_initialization contains !> Initializes the layer thicknesses in the adjustment test case -subroutine adjustment_initialize_thickness ( h, G, GV, US, param_file, just_read_params) +subroutine adjustment_initialize_thickness ( h, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -40,8 +40,8 @@ subroutine adjustment_initialize_thickness ( h, G, GV, US, param_file, just_read intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables real :: e0(SZK_(GV)+1) ! The resting interface heights, in depth units [Z ~> m], usually ! negative because it is positive upward. @@ -55,7 +55,6 @@ subroutine adjustment_initialize_thickness ( h, G, GV, US, param_file, just_read real :: adjustment_deltaS real :: front_wave_amp, front_wave_length, front_wave_asym real :: target_values(SZK_(GV)+1) ! Target densities or density anomalies [R ~> kg m-3] - logical :: just_read ! If true, just read parameters but set nothing. character(len=20) :: verticalCoordinate ! This include declares and sets the variable "version". # include "version_variable.h" @@ -63,8 +62,6 @@ subroutine adjustment_initialize_thickness ( h, G, GV, US, param_file, just_read is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg("initialize_thickness_uniform: setting thickness") @@ -194,19 +191,19 @@ end subroutine adjustment_initialize_thickness !> Initialization of temperature and salinity in the adjustment test case subroutine adjustment_initialize_temperature_salinity(T, S, h, depth_tot, G, GV, param_file, & - eqn_of_state, just_read_params) + eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< The temperature that is being initialized. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< The salinity that is being initialized. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< The model thicknesses [H ~> m or kg m-2]. real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] - type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to - !! parse for model parameter values. - type(EOS_type), pointer :: eqn_of_state !< Equation of state. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing T & S. + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + type(param_file_type), intent(in) :: param_file !< A structure indicating the open file to + !! parse for model parameter values. + type(EOS_type), pointer :: eqn_of_state !< Equation of state. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing T & S. integer :: i, j, k, is, ie, js, je, nz real :: x, y, yy @@ -219,13 +216,10 @@ subroutine adjustment_initialize_temperature_salinity(T, S, h, depth_tot, G, GV, real :: adjustment_width, adjustment_deltaS real :: front_wave_amp, front_wave_length, front_wave_asym real :: eta1d(SZK_(GV)+1) - logical :: just_read ! If true, just read parameters but set nothing. character(len=20) :: verticalCoordinate is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - ! Parameters used by main model initialization call get_param(param_file, mdl, "S_REF", S_ref, 'Reference salinity', & default=35.0, units='1e-3', do_not_log=just_read) diff --git a/src/user/baroclinic_zone_initialization.F90 b/src/user/baroclinic_zone_initialization.F90 index 22f4d705a1..1555f4ecad 100644 --- a/src/user/baroclinic_zone_initialization.F90 +++ b/src/user/baroclinic_zone_initialization.F90 @@ -28,10 +28,10 @@ module baroclinic_zone_initialization !> Reads the parameters unique to this module subroutine bcz_params(G, GV, US, param_file, S_ref, dSdz, delta_S, dSdx, T_ref, dTdz, & - delta_T, dTdx, L_zone, just_read_params) + delta_T, dTdx, L_zone, just_read) type(ocean_grid_type), intent(in) :: G !< Grid structure type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. - type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type + type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type type(param_file_type), intent(in) :: param_file !< Parameter file handle real, intent(out) :: S_ref !< Reference salinity [ppt] real, intent(out) :: dSdz !< Salinity stratification [ppt Z-1 ~> ppt m-1] @@ -42,13 +42,9 @@ subroutine bcz_params(G, GV, US, param_file, S_ref, dSdz, delta_S, dSdx, T_ref, real, intent(out) :: delta_T !< Temperature difference across baroclinic zone [degC] real, intent(out) :: dTdx !< Linear temperature gradient in [degC G%x_axis_units-1] real, intent(out) :: L_zone !< Width of baroclinic zone in [G%x_axis_units] - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing h. - logical :: just_read ! If true, just read parameters but set nothing. - - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call log_version(param_file, mdl, version, 'Initialization of an analytic baroclinic zone') call openParameterBlock(param_file,'BCZIC') @@ -76,18 +72,22 @@ end subroutine bcz_params !> Initialization of temperature and salinity with the baroclinic zone initial conditions subroutine baroclinic_zone_init_temperature_salinity(T, S, h, depth_tot, G, GV, US, param_file, & - just_read_params) - type(ocean_grid_type), intent(in) :: G !< Grid structure - type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. - type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type - real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC] - real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Salinity [ppt] - real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< The model thicknesses [H ~> m or kg m-2] + just_read) + type(ocean_grid_type), intent(in) :: G !< Grid structure + type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. + type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type + real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & + intent(out) :: T !< Potential temperature [degC] + real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & + intent(out) :: S !< Salinity [ppt] + real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & + intent(in) :: h !< The model thicknesses [H ~> m or kg m-2] real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] - type(param_file_type), intent(in) :: param_file !< Parameter file handle - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing T & S. + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + type(param_file_type), intent(in) :: param_file !< A structure indicating the open file + !! to parse for model parameter values. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing T & S. integer :: i, j, k, is, ie, js, je, nz real :: T_ref, dTdz, dTdx, delta_T ! Parameters describing temperature distribution @@ -96,13 +96,11 @@ subroutine baroclinic_zone_init_temperature_salinity(T, S, h, depth_tot, G, GV, real :: zc, zi ! Depths in depth units [Z ~> m] real :: x, xd, xs, y, yd, fn real :: PI ! 3.1415926... calculated as 4*atan(1) - logical :: just_read ! If true, just read parameters but set nothing. is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params call bcz_params(G, GV, US, param_file, S_ref, dSdz, delta_S, dSdx, T_ref, dTdz, & - delta_T, dTdx, L_zone, just_read_params) + delta_T, dTdx, L_zone, just_read) if (just_read) return ! All run-time parameters have been read, so return. diff --git a/src/user/benchmark_initialization.F90 b/src/user/benchmark_initialization.F90 index d077e0fa6f..e0dc87c96e 100644 --- a/src/user/benchmark_initialization.F90 +++ b/src/user/benchmark_initialization.F90 @@ -83,20 +83,20 @@ end subroutine benchmark_initialize_topography !! temperature profile with an exponentially decaying thermocline on top of a !! linear stratification. subroutine benchmark_initialize_thickness(h, depth_tot, G, GV, US, param_file, eqn_of_state, & - P_Ref, just_read_params) + P_Ref, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. - type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type + type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. type(EOS_type), pointer :: eqn_of_state !< Equation of state structure real, intent(in) :: P_Ref !< The coordinate-density !! reference pressure [R L2 T-2 ~> Pa]. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing h. ! Local variables real :: e0(SZK_(GV)+1) ! The resting interface heights, in depth units [Z ~> m], @@ -122,7 +122,6 @@ subroutine benchmark_initialize_thickness(h, depth_tot, G, GV, US, param_file, e real :: err, derr_dz ! The error between the profile's temperature and the ! interface temperature for a given z and its derivative. real :: pi, z - logical :: just_read ! This include declares and sets the variable "version". # include "version_variable.h" character(len=40) :: mdl = "benchmark_initialize_thickness" ! This subroutine's name. @@ -130,7 +129,6 @@ subroutine benchmark_initialize_thickness(h, depth_tot, G, GV, US, param_file, e is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params if (.not.just_read) call log_version(param_file, mdl, version, "") call get_param(param_file, mdl, "BENCHMARK_ML_DEPTH_IC", ML_depth, & "Initial mixed layer depth in the benchmark test case.", & @@ -215,7 +213,7 @@ end subroutine benchmark_initialize_thickness !> Initializes layer temperatures and salinities for benchmark subroutine benchmark_init_temperature_salinity(T, S, G, GV, US, param_file, & - eqn_of_state, P_Ref, just_read_params) + eqn_of_state, P_Ref, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< The potential temperature @@ -229,8 +227,8 @@ subroutine benchmark_init_temperature_salinity(T, S, G, GV, US, param_file, & type(EOS_type), pointer :: eqn_of_state !< Equation of state structure real, intent(in) :: P_Ref !< The coordinate-density !! reference pressure [R L2 T-2 ~> Pa]. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing T & S. ! Local variables real :: T0(SZK_(GV)) ! A profile of temperatures [degC] real :: S0(SZK_(GV)) ! A profile of salinities [ppt] @@ -241,14 +239,11 @@ subroutine benchmark_init_temperature_salinity(T, S, G, GV, US, param_file, & real :: PI ! 3.1415926... calculated as 4*atan(1) real :: SST ! The initial sea surface temperature [degC]. real :: lat - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "benchmark_init_temperature_salinity" ! This subroutine's name. integer :: i, j, k, k1, is, ie, js, je, nz, itt is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (just_read) return ! All run-time parameters have been read, so return. k1 = GV%nk_rho_varies + 1 diff --git a/src/user/circle_obcs_initialization.F90 b/src/user/circle_obcs_initialization.F90 index 29fb6647b3..3bfdeaa0ff 100644 --- a/src/user/circle_obcs_initialization.F90 +++ b/src/user/circle_obcs_initialization.F90 @@ -28,7 +28,7 @@ module circle_obcs_initialization contains !> This subroutine initializes layer thicknesses for the circle_obcs experiment. -subroutine circle_obcs_initialize_thickness(h, depth_tot, G, GV, param_file, just_read_params) +subroutine circle_obcs_initialize_thickness(h, depth_tot, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & @@ -37,8 +37,8 @@ subroutine circle_obcs_initialize_thickness(h, depth_tot, G, GV, param_file, jus intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. real :: e0(SZK_(GV)+1) ! The resting interface heights, in depth units [Z ~> m], usually ! negative because it is positive upward. @@ -46,7 +46,6 @@ subroutine circle_obcs_initialize_thickness(h, depth_tot, G, GV, param_file, jus ! positive upward, in depth units [Z ~> m]. real :: IC_amp ! The amplitude of the initial height displacement [H ~> m or kg m-2]. real :: diskrad, rad, xCenter, xRadius, lonC, latC, xOffset - logical :: just_read ! This include declares and sets the variable "version". # include "version_variable.h" character(len=40) :: mdl = "circle_obcs_initialization" ! This module's name. @@ -54,8 +53,6 @@ subroutine circle_obcs_initialize_thickness(h, depth_tot, G, GV, param_file, jus is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg(" circle_obcs_initialization.F90, circle_obcs_initialize_thickness: setting thickness", 5) diff --git a/src/user/dense_water_initialization.F90 b/src/user/dense_water_initialization.F90 index c1eb4fa2e7..9169b27a06 100644 --- a/src/user/dense_water_initialization.F90 +++ b/src/user/dense_water_initialization.F90 @@ -95,7 +95,7 @@ subroutine dense_water_initialize_topography(D, G, param_file, max_depth) end subroutine dense_water_initialize_topography !> Initialize the temperature and salinity for the dense water experiment -subroutine dense_water_initialize_TS(G, GV, param_file, eqn_of_state, T, S, h, just_read_params) +subroutine dense_water_initialize_TS(G, GV, param_file, eqn_of_state, T, S, h, just_read) type(ocean_grid_type), intent(in) :: G !< Horizontal grid control structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid control structure type(param_file_type), intent(in) :: param_file !< Parameter file structure @@ -103,18 +103,15 @@ subroutine dense_water_initialize_TS(G, GV, param_file, eqn_of_state, T, S, h, j real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Output temperature [degC] real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Output salinity [ppt] real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thicknesses [H ~> m or kg m-2] - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will + !! only read parameters without changing T & S. ! Local variables real :: mld, S_ref, S_range, T_ref real :: zi, zmid - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, nz nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - call get_param(param_file, mdl, "DENSE_WATER_MLD", mld, & "Depth of unstratified mixed layer as a fraction of the water column.", & units="nondim", default=default_mld, do_not_log=just_read) diff --git a/src/user/dumbbell_initialization.F90 b/src/user/dumbbell_initialization.F90 index 463fe018b0..6bc3dd67af 100644 --- a/src/user/dumbbell_initialization.F90 +++ b/src/user/dumbbell_initialization.F90 @@ -90,18 +90,18 @@ subroutine dumbbell_initialize_topography( D, G, param_file, max_depth ) end subroutine dumbbell_initialize_topography !> Initializes the layer thicknesses to be uniform in the dumbbell test case -subroutine dumbbell_initialize_thickness ( h, depth_tot, G, GV, US, param_file, just_read_params) +subroutine dumbbell_initialize_thickness ( h, depth_tot, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. real :: e0(SZK_(GV)+1) ! The resting interface heights [Z ~> m], usually ! negative because it is positive upward. @@ -113,13 +113,10 @@ subroutine dumbbell_initialize_thickness ( h, depth_tot, G, GV, US, param_file, ! This include declares and sets the variable "version". # include "version_variable.h" character(len=20) :: verticalCoordinate - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg("MOM_initialization.F90, initialize_thickness_uniform: setting thickness") @@ -210,7 +207,7 @@ end subroutine dumbbell_initialize_thickness !> Initial values for temperature and salinity for the dumbbell test case subroutine dumbbell_initialize_temperature_salinity ( T, S, h, G, GV, param_file, & - eqn_of_state, just_read_params) + eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC] @@ -218,7 +215,7 @@ subroutine dumbbell_initialize_temperature_salinity ( T, S, h, G, GV, param_file real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2] type(param_file_type), intent(in) :: param_file !< Parameter file structure type(EOS_type), pointer :: eqn_of_state !< Equation of state structure - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing h. ! Local variables @@ -226,14 +223,11 @@ subroutine dumbbell_initialize_temperature_salinity ( T, S, h, G, GV, param_file real :: xi0, xi1, dxi, r, S_surf, T_surf, S_range, T_range real :: x, y, dblen real :: T_ref, T_Light, T_Dense, S_ref, S_Light, S_Dense, a1, frac_dense, k_frac, res_rat - logical :: just_read ! If true, just read parameters but set nothing. logical :: dbrotate ! If true, rotate the domain. character(len=20) :: verticalCoordinate, density_profile is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - T_surf = 20.0 call get_param(param_file, mdl, "REGRIDDING_COORDINATE_MODE", verticalCoordinate, & diff --git a/src/user/external_gwave_initialization.F90 b/src/user/external_gwave_initialization.F90 index 9da82cb721..27d0cedded 100644 --- a/src/user/external_gwave_initialization.F90 +++ b/src/user/external_gwave_initialization.F90 @@ -25,7 +25,7 @@ module external_gwave_initialization contains !> This subroutine initializes layer thicknesses for the external_gwave experiment. -subroutine external_gwave_initialize_thickness(h, G, GV, US, param_file, just_read_params) +subroutine external_gwave_initialize_thickness(h, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -33,24 +33,21 @@ subroutine external_gwave_initialize_thickness(h, G, GV, US, param_file, just_re intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. ! Local variables real :: eta1D(SZK_(GV)+1) ! Interface height relative to the sea surface ! positive upward [Z ~> m]. real :: ssh_anomaly_height ! Vertical height of ssh anomaly [Z ~> m] real :: ssh_anomaly_width ! Lateral width of anomaly [degrees] - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "external_gwave_initialize_thickness" ! This subroutine's name. -! This include declares and sets the variable "version". -#include "version_variable.h" + ! This include declares and sets the variable "version". +# include "version_variable.h" integer :: i, j, k, is, ie, js, je, nz real :: PI, Xnondim is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg(" external_gwave_initialization.F90, external_gwave_initialize_thickness: setting thickness", 5) diff --git a/src/user/lock_exchange_initialization.F90 b/src/user/lock_exchange_initialization.F90 index d56605aa63..a61d07fcc8 100644 --- a/src/user/lock_exchange_initialization.F90 +++ b/src/user/lock_exchange_initialization.F90 @@ -23,7 +23,7 @@ module lock_exchange_initialization !> This subroutine initializes layer thicknesses for the lock_exchange experiment. ! ----------------------------------------------------------------------------- -subroutine lock_exchange_initialize_thickness(h, G, GV, US, param_file, just_read_params) +subroutine lock_exchange_initialize_thickness(h, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type @@ -31,8 +31,8 @@ subroutine lock_exchange_initialize_thickness(h, G, GV, US, param_file, just_rea intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. real :: e0(SZK_(GV)) ! The resting interface heights [Z ~> m], usually ! negative because it is positive upward. @@ -41,16 +41,13 @@ subroutine lock_exchange_initialize_thickness(h, G, GV, US, param_file, just_rea ! positive upward [Z ~> m]. real :: front_displacement ! Vertical displacement acrodd front real :: thermocline_thickness ! Thickness of stratified region - logical :: just_read ! If true, just read parameters but set nothing. -! 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 = "lock_exchange_initialize_thickness" ! This subroutine's name. integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg(" lock_exchange_initialization.F90, lock_exchange_initialize_thickness: setting thickness", 5) diff --git a/src/user/seamount_initialization.F90 b/src/user/seamount_initialization.F90 index 6bfaedc221..20e42de41b 100644 --- a/src/user/seamount_initialization.F90 +++ b/src/user/seamount_initialization.F90 @@ -77,18 +77,18 @@ end subroutine seamount_initialize_topography !> Initialization of thicknesses. !! This subroutine initializes the layer thicknesses to be uniform. -subroutine seamount_initialize_thickness (h, depth_tot, G, GV, US, param_file, just_read_params) +subroutine seamount_initialize_thickness (h, depth_tot, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will only read + !! parameters without changing h. real :: e0(SZK_(GV)+1) ! The resting interface heights [Z ~> m], usually ! negative because it is positive upward. @@ -97,13 +97,10 @@ subroutine seamount_initialize_thickness (h, depth_tot, G, GV, US, param_file, j real :: S_surf, S_range, S_ref, S_light, S_dense ! Various salinities [ppt]. real :: eta_IC_quanta ! The granularity of quantization of intial interface heights [Z-1 ~> m-1]. character(len=20) :: verticalCoordinate - logical :: just_read ! If true, just read parameters but set nothing. integer :: i, j, k, is, ie, js, je, nz is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (.not.just_read) & call MOM_mesg("MOM_initialization.F90, initialize_thickness_uniform: setting thickness") @@ -193,7 +190,7 @@ end subroutine seamount_initialize_thickness !> Initial values for temperature and salinity subroutine seamount_initialize_temperature_salinity ( T, S, h, G, GV, param_file, & - eqn_of_state, just_read_params) + eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC] @@ -201,20 +198,17 @@ subroutine seamount_initialize_temperature_salinity ( T, S, h, G, GV, param_file real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2] type(param_file_type), intent(in) :: param_file !< Parameter file structure type(EOS_type), pointer :: eqn_of_state !< Equation of state structure - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will + !! only read parameters without changing T & S. ! Local variables integer :: i, j, k, is, ie, js, je, nz, k_light real :: xi0, xi1, dxi, r, S_surf, T_surf, S_range, T_range real :: T_ref, T_Light, T_Dense, S_ref, S_Light, S_Dense, a1, frac_dense, k_frac, res_rat - logical :: just_read ! If true, just read parameters but set nothing. character(len=20) :: verticalCoordinate, density_profile is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - 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, & diff --git a/src/user/sloshing_initialization.F90 b/src/user/sloshing_initialization.F90 index 1c3334d8b0..0c1cf59df8 100644 --- a/src/user/sloshing_initialization.F90 +++ b/src/user/sloshing_initialization.F90 @@ -53,17 +53,17 @@ end subroutine sloshing_initialize_topography !! same thickness but all interfaces (except bottom and sea surface) are !! displaced according to a half-period cosine, with maximum value on the !! left and minimum value on the right. This sets off a regular sloshing motion. -subroutine sloshing_initialize_thickness ( h, depth_tot, G, GV, US, param_file, just_read_params) +subroutine sloshing_initialize_thickness ( h, depth_tot, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2]. real, dimension(SZI_(G),SZJ_(G)), & - intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] + intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m] type(param_file_type), intent(in) :: param_file !< A structure indicating the open file !! to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing h. real :: displ(SZK_(GV)+1) ! The interface displacement [Z ~> m]. @@ -74,7 +74,6 @@ subroutine sloshing_initialize_thickness ( h, depth_tot, G, GV, US, param_file, real :: x1, y1, x2, y2 ! Dimensonless parameters. real :: x, t ! Dimensionless depth coordinates? logical :: use_IC_bug ! If true, set the initial conditions retaining an old bug. - logical :: just_read ! If true, just read parameters but set nothing. ! This include declares and sets the variable "version". # include "version_variable.h" character(len=40) :: mdl = "sloshing_initialization" !< This module's name. @@ -83,7 +82,6 @@ subroutine sloshing_initialize_thickness ( h, depth_tot, G, GV, US, param_file, is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params if (.not.just_read) call log_version(param_file, mdl, version, "") call get_param(param_file, mdl, "SLOSHING_IC_AMPLITUDE", a0, & "Initial amplitude of sloshing internal interface height "//& @@ -179,7 +177,7 @@ end subroutine sloshing_initialize_thickness !! Note that the linear distribution is set up with respect to the layer !! number, not the physical position). subroutine sloshing_initialize_temperature_salinity ( T, S, h, G, GV, param_file, & - eqn_of_state, just_read_params) + eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC]. @@ -189,8 +187,8 @@ subroutine sloshing_initialize_temperature_salinity ( T, S, h, G, GV, param_file !! open file to parse for model !! parameter values. type(EOS_type), pointer :: eqn_of_state !< Equation of state structure. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. + logical, intent(in) :: just_read !< If true, this call will + !! only read parameters without changing T & S. integer :: i, j, k, is, ie, js, je, nz real :: delta_S, delta_T @@ -201,14 +199,11 @@ subroutine sloshing_initialize_temperature_salinity ( T, S, h, G, GV, param_file integer :: kdelta real :: deltah real :: xi0, xi1 - logical :: just_read ! If true, just read parameters but set nothing. character(len=40) :: mdl = "initialize_temp_salt_linear" ! This subroutine's ! name. is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - call get_param(param_file, mdl, "S_REF", S_ref, 'Reference value for salinity', & default=35.0, units='1e-3', do_not_log=just_read) call get_param(param_file, mdl, "T_REF", T_ref, 'Reference value for temperature', & diff --git a/src/user/user_initialization.F90 b/src/user/user_initialization.F90 index 3338121d9e..915be87e8a 100644 --- a/src/user/user_initialization.F90 +++ b/src/user/user_initialization.F90 @@ -78,24 +78,20 @@ subroutine USER_initialize_topography(D, G, param_file, max_depth, US) end subroutine USER_initialize_topography !> initialize thicknesses. -subroutine USER_initialize_thickness(h, G, GV, param_file, just_read_params) +subroutine USER_initialize_thickness(h, G, GV, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), & intent(out) :: h !< The thicknesses being initialized [H ~> m or kg m-2]. type(param_file_type), intent(in) :: param_file !< A structure indicating the open !! file to parse for model parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will + logical, intent(in) :: just_read !< If true, this call will !! only read parameters without changing h. - logical :: just_read ! If true, just read parameters but set nothing. - call MOM_error(FATAL, & "USER_initialization.F90, USER_initialize_thickness: " // & "Unmodified user routine called - you must edit the routine to use it") - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (just_read) return ! All run-time parameters have been read, so return. h(:,:,1) = 0.0 ! h should be set [H ~> m or kg m-2]. @@ -105,7 +101,7 @@ subroutine USER_initialize_thickness(h, G, GV, param_file, just_read_params) end subroutine USER_initialize_thickness !> initialize velocities. -subroutine USER_initialize_velocity(u, v, G, GV, US, param_file, just_read_params) +subroutine USER_initialize_velocity(u, v, G, GV, US, param_file, just_read) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZIB_(G), SZJ_(G),SZK_(GV)), intent(out) :: u !< i-component of velocity [L T-1 ~> m s-1] @@ -114,17 +110,13 @@ subroutine USER_initialize_velocity(u, v, G, GV, US, param_file, just_read_param type(param_file_type), intent(in) :: param_file !< A structure indicating the !! open file to parse for model !! parameter values. - logical, optional, intent(in) :: just_read_params !< If present and true, this call will - !! only read parameters without changing h. - - logical :: just_read ! If true, just read parameters but set nothing. + logical, intent(in) :: just_read !< If true, this call will + !! only read parameters without changing u & v. call MOM_error(FATAL, & "USER_initialization.F90, USER_initialize_velocity: " // & "Unmodified user routine called - you must edit the routine to use it") - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (just_read) return ! All run-time parameters have been read, so return. u(:,:,1) = 0.0 @@ -136,7 +128,7 @@ end subroutine USER_initialize_velocity !> This function puts the initial layer temperatures and salinities !! into T(:,:,:) and S(:,:,:). -subroutine USER_init_temperature_salinity(T, S, G, GV, param_file, eqn_of_state, just_read_params) +subroutine USER_init_temperature_salinity(T, S, G, GV, param_file, eqn_of_state, just_read) type(ocean_grid_type), intent(in) :: G !< Ocean grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [degC]. @@ -145,17 +137,13 @@ subroutine USER_init_temperature_salinity(T, S, G, GV, param_file, eqn_of_state, !! open file to parse for model !! parameter values. type(EOS_type), pointer :: eqn_of_state !< Equation of state structure - logical, optional, intent(in) :: just_read_params !< If present and true, this call will only + logical, intent(in) :: just_read !< If true, this call will only !! read parameters without changing T & S. - logical :: just_read ! If true, just read parameters but set nothing. - call MOM_error(FATAL, & "USER_initialization.F90, USER_init_temperature_salinity: " // & "Unmodified user routine called - you must edit the routine to use it") - just_read = .false. ; if (present(just_read_params)) just_read = just_read_params - if (just_read) return ! All run-time parameters have been read, so return. T(:,:,1) = 0.0 @@ -229,8 +217,8 @@ subroutine write_user_log(param_file) !! open file to parse for model !! parameter values. -! 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_initialization" ! This module's name. call log_version(param_file, mdl, version)