diff --git a/config_src/ice_solo_driver/ice_shelf_driver.F90 b/config_src/ice_solo_driver/ice_shelf_driver.F90 index a97803d7d6..5832c6b6fa 100644 --- a/config_src/ice_solo_driver/ice_shelf_driver.F90 +++ b/config_src/ice_solo_driver/ice_shelf_driver.F90 @@ -54,13 +54,15 @@ program SHELF_main use MOM_restart, only : save_restart ! use MOM_sum_output, only : write_energy, accumulate_net_input ! use MOM_sum_output, only : MOM_sum_output_init, sum_output_CS + use MOM_string_functions, only : uppercase ! use MOM_surface_forcing, only : set_forcing, average_forcing ! use MOM_surface_forcing, only : surface_forcing_init, surface_forcing_CS use MOM_time_manager, only : time_type, set_date, set_time, get_date, time_type_to_real use MOM_time_manager, only : operator(+), operator(-), operator(*), operator(/) use MOM_time_manager, only : operator(>), operator(<), operator(>=) use MOM_time_manager, only : increment_date, set_calendar_type, month_name - use MOM_time_manager, only : JULIAN, NOLEAP, THIRTY_DAY_MONTHS, NO_CALENDAR + use MOM_time_manager, only : JULIAN, GREGORIAN, NOLEAP, THIRTY_DAY_MONTHS + use MOM_time_manager, only : NO_CALENDAR use MOM_write_cputime, only : write_cputime, MOM_write_cputime_init use MOM_write_cputime, only : write_cputime_start_clock, write_cputime_CS @@ -197,12 +199,14 @@ program SHELF_main read(unit,*) date call close_file(unit) else - if (calendar(1:6) == 'julian') then ; calendar_type = JULIAN + calendar = uppercase(calendar) + if (calendar(1:6) == 'JULIAN') then ; calendar_type = JULIAN + else if (calendar(1:9) == 'GREGORIAN') then ; calendar_type = GREGORIAN else if (calendar(1:6) == 'NOLEAP') then ; calendar_type = NOLEAP - else if (calendar(1:10)=='thirty_day') then ; calendar_type = THIRTY_DAY_MONTHS - else if (calendar(1:11)=='no_calendar') then; calendar_type = NO_CALENDAR + else if (calendar(1:10)=='THIRTY_DAY') then ; calendar_type = THIRTY_DAY_MONTHS + else if (calendar(1:11)=='NO_CALENDAR') then; calendar_type = NO_CALENDAR else if (calendar(1:1) /= ' ') then - call MOM_error(FATAL,'MOM_driver: Invalid namelist value for calendar') + call MOM_error(FATAL,'MOM_driver: Invalid namelist value '//trim(calendar)//' for calendar') else call MOM_error(FATAL,'MOM_driver: No namelist value for calendar') endif diff --git a/config_src/solo_driver/MOM_driver.F90 b/config_src/solo_driver/MOM_driver.F90 index eaaf748455..c933e62b5a 100644 --- a/config_src/solo_driver/MOM_driver.F90 +++ b/config_src/solo_driver/MOM_driver.F90 @@ -60,6 +60,7 @@ program MOM_main use MOM_io, only : check_nml_error, io_infra_init, io_infra_end use MOM_io, only : APPEND_FILE, ASCII_FILE, READONLY_FILE, SINGLE_FILE use MOM_restart, only : save_restart + use MOM_string_functions, only : uppercase use MOM_sum_output, only : write_energy, accumulate_net_input use MOM_sum_output, only : MOM_sum_output_init, sum_output_CS use MOM_surface_forcing, only : set_forcing, forcing_save_restart @@ -68,7 +69,8 @@ program MOM_main use MOM_time_manager, only : operator(+), operator(-), operator(*), operator(/) use MOM_time_manager, only : operator(>), operator(<), operator(>=) use MOM_time_manager, only : increment_date, set_calendar_type, month_name - use MOM_time_manager, only : JULIAN, NOLEAP, THIRTY_DAY_MONTHS, NO_CALENDAR + use MOM_time_manager, only : JULIAN, GREGORIAN, NOLEAP, THIRTY_DAY_MONTHS + use MOM_time_manager, only : NO_CALENDAR use MOM_variables, only : surface use MOM_verticalGrid, only : verticalGrid_type use MOM_write_cputime, only : write_cputime, MOM_write_cputime_init @@ -263,12 +265,14 @@ program MOM_main read(unit,*) date call close_file(unit) else - if (calendar(1:6) == 'julian') then ; calendar_type = JULIAN + calendar = uppercase(calendar) + if (calendar(1:6) == 'JULIAN') then ; calendar_type = JULIAN + else if (calendar(1:9) == 'GREGORIAN') then ; calendar_type = GREGORIAN else if (calendar(1:6) == 'NOLEAP') then ; calendar_type = NOLEAP - else if (calendar(1:10)=='thirty_day') then ; calendar_type = THIRTY_DAY_MONTHS - else if (calendar(1:11)=='no_calendar') then; calendar_type = NO_CALENDAR + else if (calendar(1:10)=='THIRTY_DAY') then ; calendar_type = THIRTY_DAY_MONTHS + else if (calendar(1:11)=='NO_CALENDAR') then; calendar_type = NO_CALENDAR else if (calendar(1:1) /= ' ') then - call MOM_error(FATAL,'MOM_driver: Invalid namelist value for calendar') + call MOM_error(FATAL,'MOM_driver: Invalid namelist value '//trim(calendar)//' for calendar') else call MOM_error(FATAL,'MOM_driver: No namelist value for calendar') endif diff --git a/src/ALE/MOM_ALE.F90 b/src/ALE/MOM_ALE.F90 index 080eae902b..103bae7c13 100644 --- a/src/ALE/MOM_ALE.F90 +++ b/src/ALE/MOM_ALE.F90 @@ -609,7 +609,7 @@ subroutine ALE_offline_tracer_final( G, GV, h, tv, h_target, Reg, CS) ! Override old grid with new one. The new grid 'h_new' is built in ! one of the 'build_...' routines above. -!$OMP parallel do default(none) shared(isc,iec,jsc,jec,nk,h,h_target,CS) + !$OMP parallel do default(shared) do k = 1,nk do j = jsc-1,jec+1 ; do i = isc-1,iec+1 h(i,j,k) = h_new(i,j,k) diff --git a/src/framework/MOM_time_manager.F90 b/src/framework/MOM_time_manager.F90 index 9926318772..98ae835272 100644 --- a/src/framework/MOM_time_manager.F90 +++ b/src/framework/MOM_time_manager.F90 @@ -18,7 +18,8 @@ module MOM_time_manager use time_manager_mod, only : get_date, set_date, increment_date use time_manager_mod, only : days_in_month, month_name use time_manager_mod, only : set_calendar_type, get_calendar_type -use time_manager_mod, only : JULIAN, NOLEAP, THIRTY_DAY_MONTHS, NO_CALENDAR +use time_manager_mod, only : JULIAN, NOLEAP, THIRTY_DAY_MONTHS, GREGORIAN +use time_manager_mod, only : NO_CALENDAR implicit none ; private @@ -28,7 +29,7 @@ module MOM_time_manager public :: operator(>), operator(<), operator(>=), operator(<=) public :: operator(==), operator(/=), operator(//) public :: get_date, set_date, increment_date, month_name, days_in_month -public :: JULIAN, NOLEAP, THIRTY_DAY_MONTHS, NO_CALENDAR +public :: JULIAN, NOLEAP, THIRTY_DAY_MONTHS, GREGORIAN, NO_CALENDAR public :: set_calendar_type, get_calendar_type end module MOM_time_manager diff --git a/src/parameterizations/lateral/MOM_tidal_forcing.F90 b/src/parameterizations/lateral/MOM_tidal_forcing.F90 index 27d8c3cadf..7f5c0777c1 100644 --- a/src/parameterizations/lateral/MOM_tidal_forcing.F90 +++ b/src/parameterizations/lateral/MOM_tidal_forcing.F90 @@ -50,12 +50,14 @@ module MOM_tidal_forcing !* * !*********************************************************************** -use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_MODULE +use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, & + CLOCK_MODULE +use MOM_domains, only : pass_var use MOM_error_handler, only : MOM_error, FATAL, WARNING -use MOM_file_parser, only : get_param, log_version, param_file_type -use MOM_grid, only : ocean_grid_type -use MOM_io, only : field_exists, file_exists, read_data -use MOM_time_manager, only : time_type, time_type_to_real +use MOM_file_parser, only : get_param, log_version, param_file_type +use MOM_grid, only : ocean_grid_type +use MOM_io, only : field_exists, file_exists, read_data +use MOM_time_manager, only : time_type, time_type_to_real implicit none ; private @@ -164,11 +166,11 @@ subroutine tidal_forcing_init(Time, G, param_file, CS) lon_rad(i,j) = G%geoLonT(i,j)*deg_to_rad enddo ; enddo do j=js-1,je+1 ; do i=is-1,ie+1 - CS%sin_struct(i,j,1) = -sin(2.0*lat_rad(i,j)) * cos(lon_rad(i,j)) - CS%cos_struct(i,j,1) = sin(2.0*lat_rad(i,j)) * sin(lon_rad(i,j)) + CS%sin_struct(i,j,1) = -sin(2.0*lat_rad(i,j)) * sin(lon_rad(i,j)) + CS%cos_struct(i,j,1) = sin(2.0*lat_rad(i,j)) * cos(lon_rad(i,j)) CS%sin_struct(i,j,2) = -cos(lat_rad(i,j))**2 * sin(2.0*lon_rad(i,j)) - CS%cos_struct(i,j,2) = cos(lat_rad(i,j))**2 * cos(2.0*lon_rad(i,j)) - CS%sin_struct(i,j,3) = 0.0 + CS%cos_struct(i,j,2) = cos(lat_rad(i,j))**2 * cos(2.0*lon_rad(i,j)) + CS%sin_struct(i,j,3) = 0.0 CS%cos_struct(i,j,3) = (0.5-1.5*sin(lat_rad(i,j))**2) enddo ; enddo @@ -361,6 +363,8 @@ subroutine tidal_forcing_init(Time, G, param_file, CS) ! Read variables with names like PHASE_SAL_M2 and AMP_SAL_M2. call find_in_files(tidal_input_files,"PHASE_SAL_"//trim(CS%const_name(c)),phase,G) call find_in_files(tidal_input_files,"AMP_SAL_"//trim(CS%const_name(c)),CS%ampsal(:,:,c),G) + call pass_var(phase, G%domain,complete=.false.) + call pass_var(CS%ampsal(:,:,c),G%domain,complete=.true.) do j=js-1,je+1 ; do i=is-1,ie+1 CS%cosphasesal(i,j,c) = cos(phase(i,j)*deg_to_rad) CS%sinphasesal(i,j,c) = sin(phase(i,j)*deg_to_rad) @@ -376,6 +380,8 @@ subroutine tidal_forcing_init(Time, G, param_file, CS) ! Read variables with names like PHASE_PREV_M2 and AMP_PREV_M2. call find_in_files(tidal_input_files,"PHASE_PREV_"//trim(CS%const_name(c)),phase,G) call find_in_files(tidal_input_files,"AMP_PREV_"//trim(CS%const_name(c)),CS%amp_prev(:,:,c),G) + call pass_var(phase, G%domain,complete=.false.) + call pass_var(CS%amp_prev(:,:,c),G%domain,complete=.true.) do j=js-1,je+1 ; do i=is-1,ie+1 CS%cosphase_prev(i,j,c) = cos(phase(i,j)*deg_to_rad) CS%sinphase_prev(i,j,c) = sin(phase(i,j)*deg_to_rad) diff --git a/src/tracer/MOM_tracer_diabatic.F90 b/src/tracer/MOM_tracer_diabatic.F90 index 3c34625dfc..a99ad392a9 100644 --- a/src/tracer/MOM_tracer_diabatic.F90 +++ b/src/tracer/MOM_tracer_diabatic.F90 @@ -278,7 +278,7 @@ subroutine applyTracerBoundaryFluxesInOut(G, GV, Tr, dt, fluxes, h, evap_CFL_lim !$OMP parallel do default(none) shared(is,ie,js,je,nz,h,Tr,G,GV,fluxes,dt, & !$OMP IforcingDepthScale,minimum_forcing_depth, & -!$OMP numberOfGroundings,iGround,jGround, & +!$OMP numberOfGroundings,iGround,jGround,update_h, & !$OMP in_flux,out_flux,hGrounding,Idt,evap_CFL_limit) & !$OMP private(h2d,Tr2d,netMassInOut,netMassOut, & !$OMP in_flux_1d,out_flux_1d,fractionOfForcing, &