diff --git a/atmos_model.F90 b/atmos_model.F90 index d5231aae5..1bec14f0b 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -47,12 +47,8 @@ module atmos_model_mod use mpp_mod, only: FATAL, mpp_min, mpp_max, mpp_error, mpp_chksum use mpp_domains_mod, only: domain2d use mpp_mod, only: mpp_get_current_pelist_name -#ifdef INTERNAL_FILE_NML use mpp_mod, only: input_nml_file -#else -use fms_mod, only: open_namelist_file -#endif -use fms_mod, only: file_exist, error_mesg +use fms2_io_mod, only: file_exists use fms_mod, only: close_file, write_version_number, stdlog, stdout use fms_mod, only: clock_flag_default use fms_mod, only: check_nml_error @@ -551,19 +547,9 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) !---------------------------------------------------------------------------------------------- ! initialize atmospheric model - must happen AFTER atmosphere_init so that nests work correctly - IF ( file_exist('input.nml')) THEN -#ifdef INTERNAL_FILE_NML + IF ( file_exists('input.nml')) THEN read(input_nml_file, nml=atmos_model_nml, iostat=io) ierr = check_nml_error(io, 'atmos_model_nml') -#else - unit = open_namelist_file ( ) - ierr=1 - do while (ierr /= 0) - read (unit, nml=atmos_model_nml, iostat=io, end=10) - ierr = check_nml_error(io,'atmos_model_nml') - enddo - 10 call close_file (unit) -#endif endif !----------------------------------------------------------------------- diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index d15ed56d7..c7522a0e3 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -631,7 +631,7 @@ standard_name = surface_snow_area_fraction_over_ice long_name = surface snow area fraction over ice units = frac - dimensions = (horizontal_dimension) + dimensions = (horizontal_loop_extent) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_ruc_land_surface_scheme) @@ -1448,7 +1448,7 @@ standard_name = temperature_in_surface_snow_at_surface_adjacent_layer_over_land long_name = snow temperature at the bottom of the first snow layer over land units = K - dimensions = (horizontal_dimension) + dimensions = (horizontal_loop_extent) type = real kind = kind_phys active = (control_for_land_surface_scheme == identifier_for_ruc_land_surface_scheme) @@ -10110,7 +10110,7 @@ standard_name = saturation_vapor_pressure long_name = saturation vapor pressure units = Pa - dimensions = (horizontal_dimension,vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys optional = F @@ -10119,7 +10119,7 @@ standard_name = water_vapor_mixing_ratio long_name = water vaport mixing ratio units = kg/kg - dimensions = (horizontal_dimension,vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys optional = F diff --git a/ccpp/physics b/ccpp/physics index 1f8cf92bb..cb2b5166a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1f8cf92bb4d562ba1aa53966fc361fcd1331c2b3 +Subproject commit cb2b5166af5b5c5b284d910f36be31f67b325e8c diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 9ff27b1a6..a6e69b13a 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -24,7 +24,7 @@ module module_fcst_grid_comp use esmf use time_manager_mod, only: time_type, set_calendar_type, set_time, & - set_date, days_in_month, month_name, & + set_date, month_name, & operator(+), operator(-), operator (<), & operator (>), operator (/=), operator (/), & operator (==), operator (*), & @@ -43,22 +43,20 @@ module module_fcst_grid_comp addLsmask2grid use constants_mod, only: constants_init - use fms_mod, only: open_namelist_file, file_exist, check_nml_error, & - error_mesg, fms_init, fms_end, close_file, & + use fms_mod, only: error_mesg, fms_init, fms_end, & write_version_number, uppercase use mpp_mod, only: mpp_init, mpp_pe, mpp_root_pe, & mpp_error, FATAL, WARNING - use mpp_mod, only: mpp_clock_id, mpp_clock_begin, mpp_clock_end + use mpp_mod, only: mpp_clock_id, mpp_clock_begin - use mpp_io_mod, only: mpp_open, mpp_close, MPP_NATIVE, MPP_RDONLY, MPP_DELETE + use mpp_io_mod, only: mpp_open, mpp_close, MPP_DELETE use mpp_domains_mod, only: mpp_get_compute_domains, domain2D - use memutils_mod, only: print_memuse_stats use sat_vapor_pres_mod, only: sat_vapor_pres_init use diag_manager_mod, only: diag_manager_init, diag_manager_end, & - get_base_date, diag_manager_set_time_end + diag_manager_set_time_end use data_override_mod, only: data_override_init use fv_nggps_diags_mod, only: fv_dyn_bundle_setup @@ -359,9 +357,7 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) if(restart_interval(2)== -1) freq_restart = .true. endif if(freq_restart) then - if(restart_interval(1) == 0) then - frestart(1) = total_inttime - else if(restart_interval(1) > 0) then + if(restart_interval(1) >= 0) then tmpvar = restart_interval(1) * 3600 atm_int_state%Time_step_restart = set_time (tmpvar, 0) if(iau_offset > 0 ) then @@ -371,16 +367,18 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc) atm_int_state%Time_restart = atm_int_state%Time_init + atm_int_state%Time_step_restart frestart(1) = tmpvar endif - i = 2 - do while ( atm_int_state%Time_restart < atm_int_state%Time_end ) - frestart(i) = frestart(i-1) + tmpvar - atm_int_state%Time_restart = atm_int_state%Time_restart + atm_int_state%Time_step_restart - i = i + 1 - enddo + if(restart_interval(1) > 0) then + i = 2 + do while ( atm_int_state%Time_restart < atm_int_state%Time_end ) + frestart(i) = frestart(i-1) + tmpvar + atm_int_state%Time_restart = atm_int_state%Time_restart + atm_int_state%Time_step_restart + i = i + 1 + enddo + endif endif ! otherwise it is an array with forecast time at which the restart files will be written out else if(num_restart_interval >= 1) then - if(restart_interval(1) == 0 ) then + if(num_restart_interval == 1 .and. restart_interval(1) == 0 ) then frestart(1) = total_inttime else if(iau_offset > 0 ) then @@ -861,11 +859,11 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) !--- intermediate restart if (atm_int_state%intrm_rst>0) then if (na /= atm_int_state%num_atmos_calls-1) then - call get_time(atm_int_state%Time_atmos - atm_int_state%Time_atstart, seconds) + call get_time(atm_int_state%Time_atmos - atm_int_state%Time_init, seconds) if (ANY(frestart(:) == seconds)) then - restart_inctime = set_time(seconds, 0) - atm_int_state%Time_restart = atm_int_state%Time_atstart + restart_inctime - timestamp = date_to_string (atm_int_state%Time_restart) + if (mype == 0) write(0,*)'write out restart at na=',na,' seconds=',seconds, & + 'integration lenght=',na*dt_atmos/3600. + timestamp = date_to_string (atm_int_state%Time_atmos) call atmos_model_restart(atm_int_state%Atm, timestamp) call write_stoch_restart_atm('RESTART/'//trim(timestamp)//'.atm_stoch.res.nc') @@ -873,8 +871,6 @@ subroutine fcst_run_phase_2(fcst_comp, importState, exportState,clock,rc) endif endif endif -! - call print_memuse_stats('after full step') ! !----------------------------------------------------------------------- !