Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data override updates and bugfixes #67

Merged
merged 5 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions SHiELD/coupler_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ program coupler_main
!-----------------------------------------------------------------------

use FMS
use FMSconstants, only: constants_init
use atmos_model_mod, only: atmos_model_init, atmos_model_end, &
update_atmos_model_dynamics, &
update_atmos_radiation_physics, &
update_atmos_model_state, &
atmos_data_type, atmos_model_restart
use FMSconstants, only: fmsconstants_init
use atmos_model_mod, only: atmos_model_init, atmos_model_end, &
update_atmos_model_dynamics, &
update_atmos_radiation_physics, &
update_atmos_model_state, &
atmos_data_type, atmos_model_restart
!--- FMS old io
use fms_io_mod, only: fms_io_exit!< This can't be removed until fms_io is not used at all

Expand Down Expand Up @@ -122,7 +122,7 @@ program coupler_main

call fms_init()
call sat_vapor_pres_init()
call constants_init()
call fmsconstants_init()

initClock = mpp_clock_id( 'Initialization' )
call mpp_clock_begin (initClock) !nesting problem
Expand Down Expand Up @@ -201,18 +201,15 @@ subroutine coupler_init
! initialize all defined exchange grids and all boundary maps
!-----------------------------------------------------------------------
integer :: total_days, total_seconds, unit, ierr, io
integer :: n, gnlon, gnlat
integer :: n
integer :: date(6), flags
type (time_type) :: Run_length
character(len=9) :: month
logical :: use_namelist

character(len=:), dimension(:), allocatable :: restart_file !< Restart file saved as a string
integer :: time_stamp_unit !< Unif of the time_stamp file
integer :: ascii_unit !< Unit of a dummy ascii file

logical, allocatable, dimension(:,:) :: mask
real, allocatable, dimension(:,:) :: glon_bnd, glat_bnd
!-----------------------------------------------------------------------
!----- initialization timing identifiers ----

Expand Down Expand Up @@ -388,11 +385,7 @@ subroutine coupler_init

call print_memuse_stats('after atmos model init')

call mpp_get_global_domain(Atm%Domain, xsize=gnlon, ysize=gnlat)
allocate ( glon_bnd(gnlon+1,gnlat+1), glat_bnd(gnlon+1,gnlat+1) )
call mpp_global_field(Atm%Domain, Atm%lon_bnd, glon_bnd, position=CORNER)
call mpp_global_field(Atm%Domain, Atm%lat_bnd, glat_bnd, position=CORNER)

!------ initialize data_override -----
if (.NOT.Atm%bounded_domain) call data_override_init (Atm_domain_in = Atm%domain)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know what the logic behind excluding bounded_domain is here? I know Lauren opened an issue a while ago relating to some unsupported regional model behavior in data override, but that could be unrelated. I would assume there wouldn't be a data_table if the bounded_domain existed because it would never get called in this scenario, but I don't know that for sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GFDL-Eric - this is a topic I'll be bringing up for FMS dev as a whole and data_override in particular. I'll try to make it a topic for the next group meeting.


!-----------------------------------------------------------------------
Expand Down
20 changes: 4 additions & 16 deletions simple/coupler_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ subroutine coupler_init
integer :: total_days, total_seconds, ierr, io
integer :: n, gnlon, gnlat
integer :: date(6), flags
integer :: dt_size
type (time_type) :: Run_length
character(len=9) :: month
logical :: use_namelist
Expand Down Expand Up @@ -443,18 +442,10 @@ subroutine coupler_init
call ice_model_init (Ice, Time_init, Time_atmos, Time_step_atmos, Time_step_ocean, &
glon_bnd, glat_bnd, atmos_domain=Atm%Domain)

if (file_exists('data_table')) then
inquire(file='data_table', size=dt_size)
if (dt_size > 0.) then
call data_override_init(Atm_domain_in = Atm%domain)
call data_override_init(Ice_domain_in = Ice%domain)
call data_override_init(Land_domain_in = Land%domain)
else
call error_mesg ('program coupler', 'empty data table, skipping data override init', WARNING)
endif
else
call error_mesg ('program coupler', 'no data table, skipping data override init', WARNING)
endif
!------ initialize data_override -----
call data_override_init(Atm_domain_in = Atm%domain)
call data_override_init(Ice_domain_in = Ice%domain)
call data_override_init(Land_domain_in = Land%domain)

!------------------------------------------------------------------------
!---- setup allocatable storage for fluxes exchanged between models ----
Expand All @@ -465,9 +456,6 @@ subroutine coupler_init
atmos_ice_boundary, &
land_ice_atmos_boundary )




!-----------------------------------------------------------------------
!---- open and close dummy file in restart dir to check if dir exists --
if ( mpp_pe().EQ.mpp_root_pe() ) then
Expand Down