Skip to content

Commit

Permalink
Coupling field fixes. #155
Browse files Browse the repository at this point in the history
  • Loading branch information
nichannah committed Mar 14, 2020
1 parent 4c992c3 commit 0030662
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
2 changes: 2 additions & 0 deletions drivers/auscom/cpl_forcing_handler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ subroutine get_time0_i2o_fields(fname)
!!!
if (jf == n_i2a+14) iomelt = vwork
if (jf == n_i2a+15) ioform = vwork
if (jf == n_i2a+16) iolicefw = vwork
if (jf == n_i2a+17) iolicefh = vwork
enddo
if (my_task == master_task) call ice_close_nc(ncid_i2o)
#if defined(DEBUG)
Expand Down
24 changes: 15 additions & 9 deletions drivers/auscom/cpl_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)
cl_read(8) ='qair_i'
cl_read(9) ='uwnd_i'
cl_read(10)='vwnd_i'
cl_read(11)='licalv_i'
cl_read(11)='licalvf_i'
!ocn ==> ice
cl_read(n_a2i+1)='sst_i'
cl_read(n_a2i+2)='sss_i'
Expand Down Expand Up @@ -301,6 +301,7 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)
allocate (lwflx0(nx_block, ny_block, max_blocks)); lwflx0(:,:,:) = 0
allocate (uwnd0(nx_block, ny_block, max_blocks)); uwnd0(:,:,:) = 0
allocate (vwnd0(nx_block, ny_block, max_blocks)); vwnd0(:,:,:) = 0
allocate (calv0(nx_block, ny_block, max_blocks)); calv0(:,:,:) = 0
allocate (qair0(nx_block, ny_block, max_blocks)); qair0(:,:,:) = 0
allocate (rain0(nx_block, ny_block, max_blocks)); rain0(:,:,:) = 0
allocate (snow0(nx_block, ny_block, max_blocks)); snow0(:,:,:) = 0
Expand Down Expand Up @@ -336,6 +337,8 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)

allocate (iomelt (nx_block, ny_block, max_blocks)); iomelt(:,:,:) = 0
allocate (ioform (nx_block, ny_block, max_blocks)); ioform(:,:,:) = 0
allocate (iolicefw (nx_block, ny_block, max_blocks)); iolicefw(:,:,:) = 0
allocate (iolicefh (nx_block, ny_block, max_blocks)); iolicefh(:,:,:) = 0

allocate (tiostrsu(nx_block, ny_block, max_blocks)); tiostrsu(:,:,:) = 0
allocate (tiostrsv(nx_block, ny_block, max_blocks)); tiostrsv(:,:,:) = 0
Expand All @@ -354,6 +357,9 @@ subroutine init_cpl(runtime_seconds, coupling_field_timesteps)
allocate (tiomelt(nx_block, ny_block, max_blocks)); tiomelt(:,:,:) = 0
allocate (tioform(nx_block, ny_block, max_blocks)); tioform(:,:,:) = 0

allocate (tiolicefw(nx_block, ny_block, max_blocks)); tiolicefw(:,:,:) = 0
allocate (tiolicefh(nx_block, ny_block, max_blocks)); tiolicefh(:,:,:) = 0

allocate (vwork(nx_block, ny_block, max_blocks)); vwork(:,:,:) = 0
allocate (gwork(nx_global, ny_global)); gwork(:,:) = 0
allocate (vwork2d(l_ilo:l_ihi, l_jlo:l_jhi)); vwork2d(:,:) = 0.
Expand Down Expand Up @@ -564,26 +570,26 @@ subroutine from_ocn(isteps)
call ice_timer_start(timer_from_ocn)
call ice_timer_start(timer_waiting_ocn)

call oasis_get(il_var_id_in(11), isteps, work, info)
call oasis_get(il_var_id_in(12), isteps, work, info)
call unpack_coupling_array(work, ssto)
call ice_timer_stop(timer_waiting_ocn)

call oasis_get(il_var_id_in(12), isteps, work, info)
call oasis_get(il_var_id_in(13), isteps, work, info)
call unpack_coupling_array(work, ssso)

call oasis_get(il_var_id_in(13), isteps, work, info)
call oasis_get(il_var_id_in(14), isteps, work, info)
call unpack_coupling_array(work, ssuo)

call oasis_get(il_var_id_in(14), isteps, work, info)
call oasis_get(il_var_id_in(15), isteps, work, info)
call unpack_coupling_array(work, ssvo)

call oasis_get(il_var_id_in(15), isteps, work, info)
call oasis_get(il_var_id_in(16), isteps, work, info)
call unpack_coupling_array(work, sslx)

call oasis_get(il_var_id_in(16), isteps, work, info)
call oasis_get(il_var_id_in(17), isteps, work, info)
call unpack_coupling_array(work, ssly)

call oasis_get(il_var_id_in(17), isteps, work, info)
call oasis_get(il_var_id_in(18), isteps, work, info)
call unpack_coupling_array(work, pfmice)

if (chk_o2i_fields) then
Expand Down Expand Up @@ -783,7 +789,7 @@ subroutine write_boundary_checksums(time)
print*, '[ice chksum] qair0:', sum(qair0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] uwnd0:', sum(uwnd0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] vwnd0:', sum(vwnd0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] vwnd0:', sum(calv0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] calv0:', sum(calv0(isc:iec, jsc:jec, 1))

print*, '[ice chksum] u_star0:', sum(u_star0(isc:iec, jsc:jec, 1))
print*, '[ice chksum] rough_mom0:', sum(rough_mom0(isc:iec, jsc:jec, 1))
Expand Down
12 changes: 6 additions & 6 deletions drivers/auscom/cpl_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ module cpl_parameters

integer(kind=int_kind) :: nt_cells ! nx_global x ny_global
! assigned in prism_init
integer(kind=int_kind), parameter :: jpfldout = 16 ! total number of fields sent
integer(kind=int_kind), parameter :: jpfldin = 17 ! total number of fields rcvd
integer(kind=int_kind), parameter :: jpfldout = 18 ! total number of fields sent
integer(kind=int_kind), parameter :: jpfldin = 18 ! total number of fields rcvd

integer(kind=int_kind), parameter :: n_a2i = 10 ! number of a2i fields
integer(kind=int_kind), parameter :: n_a2i = 11 ! number of a2i fields
integer(kind=int_kind), parameter :: n_o2i = 7 ! number of o2i fields
integer(kind=int_kind), parameter :: n_i2a = 1 ! number of i2a fields
integer(kind=int_kind), parameter :: n_i2o = 15 ! number of i2o fields
integer(kind=int_kind), parameter :: n_i2o = 17 ! number of i2o fields

!
character(len=8), dimension(jpfldout) :: cl_writ ! Symb names fields sent
character(len=8), dimension(jpfldin) :: cl_read ! Symb names fields rcvd
character(len=16), dimension(jpfldout) :: cl_writ ! Symb names fields sent
character(len=16), dimension(jpfldin) :: cl_read ! Symb names fields rcvd
integer(kind=int_kind) :: il_out ! format io unit(s) for coupling cpu(s)
!

Expand Down

0 comments on commit 0030662

Please sign in to comment.