Skip to content

Commit

Permalink
Reorganize calls to subs in init state
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-jm committed Jun 20, 2024
1 parent 9a2d117 commit 9a8f659
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions state/state_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ subroutine Init_domain (this, config_flags, geogrid)
integer :: ids0, ide0, jds0, jde0


! Domain dimensions
! Set dimensions
ids0 = geogrid%ifds
ide0 = geogrid%ifde
jds0 = geogrid%jfds
Expand Down Expand Up @@ -271,20 +271,26 @@ subroutine Init_domain (this, config_flags, geogrid)
this%kfts = config_flags%kds
this%kfte = config_flags%kde

call this%Set_time_stamps (config_flags)

this%cen_lat = geogrid%cen_lat
this%cen_lon = geogrid%cen_lon

this%dx = geogrid%dx / geogrid%sr_x
this%dy = geogrid%dy / geogrid%sr_y
call this%Init_tiles (config_flags)

this%nx = this%ifde
this%ny = this%jfde
this%dt = config_flags%dt

! Init memory
call this%Allocate_vars (this%ifms, this%ifme, this%jfms, this%jfme)

! Set projection
proj = geogrid%Get_atm_proj ()
call this%Init_latlons (proj, srx = geogrid%sr_x, sry = geogrid%sr_y)

this%cen_lat = geogrid%cen_lat
this%cen_lon = geogrid%cen_lon

this%dx = geogrid%dx / geogrid%sr_x
this%dy = geogrid%dy / geogrid%sr_y

! Init vars
call this%Set_vars_to_default (config_flags)

this%zsf(this%ifds:this%ifde, this%jfds:this%jfde) = geogrid%elevations
Expand All @@ -300,13 +306,11 @@ subroutine Init_domain (this, config_flags, geogrid)
end if
end if

proj = geogrid%Get_atm_proj ()
call this%Init_latlons (proj, srx = geogrid%sr_x, sry = geogrid%sr_y)

call this%Init_tiles (config_flags)

if (config_flags%fuel_opt == FUEL_ANDERSON) call this%Convert_sb_to_ander ()

! Set clock
call this%Set_time_stamps (config_flags)

if (DEBUG_LOCAL) call this%Print()

end subroutine Init_domain
Expand Down Expand Up @@ -427,6 +431,7 @@ subroutine Init_tiles (this, config_flags)

integer :: num_tiles


num_tiles = config_flags%num_tiles
call Calc_tiles_dims (this%ifps, this%ifpe, this%jfps, this%jfpe, num_tiles, &
this%i_start, this%i_end, this%j_start, this%j_end)
Expand Down

0 comments on commit 9a8f659

Please sign in to comment.